nbns_responder.h
Go to the documentation of this file.
1 /**
2  * @file nbns_responder.h
3  * @brief NBNS responder (NetBIOS Name Service)
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneTCP Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _NBNS_RESPONDER_H
30 #define _NBNS_RESPONDER_H
31 
32 //Dependencies
33 #include "core/net.h"
34 #include "core/udp.h"
35 #include "dns/dns_common.h"
36 #include "netbios/nbns_common.h"
37 
38 //NBNS responder support
39 #ifndef NBNS_RESPONDER_SUPPORT
40  #define NBNS_RESPONDER_SUPPORT ENABLED
41 #elif (NBNS_RESPONDER_SUPPORT != ENABLED && NBNS_RESPONDER_SUPPORT != DISABLED)
42  #error NBNS_RESPONDER_SUPPORT parameter is not valid
43 #endif
44 
45 //C++ guard
46 #ifdef __cplusplus
47  extern "C" {
48 #endif
49 
50 //NBNS related functions
51 void nbnsProcessQuery(NetInterface *interface, const Ipv4PseudoHeader *pseudoHeader,
52  const UdpHeader *udpHeader, const NbnsHeader *message, size_t length);
53 
55  const IpAddr *destIpAddr, uint16_t destPort, uint16_t id);
56 
57 //C++ guard
58 #ifdef __cplusplus
59  }
60 #endif
61 
62 #endif
void nbnsProcessQuery(NetInterface *interface, const Ipv4PseudoHeader *pseudoHeader, const UdpHeader *udpHeader, const NbnsHeader *message, size_t length)
Process NBNS query message.
uint16_t destPort
Definition: tcp.h:301
TCP/IP stack core.
uint8_t message[]
Definition: chap.h:150
IP network address.
Definition: ip.h:57
error_t nbnsSendResponse(NetInterface *interface, const IpAddr *destIpAddr, uint16_t destPort, uint16_t id)
Send NBNS response message.
#define Ipv4PseudoHeader
Definition: ipv4.h:37
__start_packed struct @263 NbnsHeader
NBNS message header.
__start_packed struct @126 UdpHeader
UDP header.
error_t
Error codes.
Definition: error.h:40
Ipv4Addr destIpAddr
Definition: ipcp.h:76
#define NetInterface
Definition: net.h:34
uint8_t length
Definition: dtls_misc.h:140
Common DNS routines.
Definitions common to NBNS client and NBNS responder.
UDP (User Datagram Protocol)