mikroSDK Reference Manual
nbns_client.h
Go to the documentation of this file.
1
31#ifndef _NBNS_CLIENT_H
32#define _NBNS_CLIENT_H
33
34//Dependencies
35#include "core/net.h"
36#include "core/socket.h"
37#include "core/udp.h"
38#include "dns/dns_cache.h"
39#include "dns/dns_common.h"
40#include "netbios/nbns_common.h"
41
42//NBNS client support
43#ifndef NBNS_CLIENT_SUPPORT
44 #define NBNS_CLIENT_SUPPORT ENABLED
45#elif (NBNS_CLIENT_SUPPORT != ENABLED && NBNS_CLIENT_SUPPORT != DISABLED)
46 #error NBNS_CLIENT_SUPPORT parameter is not valid
47#endif
48
49//Maximum number of retransmissions of NBNS queries
50#ifndef NBNS_CLIENT_MAX_RETRIES
51 #define NBNS_CLIENT_MAX_RETRIES 3
52#elif (NBNS_CLIENT_MAX_RETRIES < 1)
53 #error NBNS_CLIENT_MAX_RETRIES parameter is not valid
54#endif
55
56//Initial retransmission timeout
57#ifndef NBNS_CLIENT_INIT_TIMEOUT
58 #define NBNS_CLIENT_INIT_TIMEOUT 1000
59#elif (NBNS_CLIENT_INIT_TIMEOUT < 1000)
60 #error NBNS_CLIENT_INIT_TIMEOUT parameter is not valid
61#endif
62
63//Maximum retransmission timeout
64#ifndef NBNS_CLIENT_MAX_TIMEOUT
65 #define NBNS_CLIENT_MAX_TIMEOUT 1000
66#elif (NBNS_CLIENT_MAX_TIMEOUT < 1000)
67 #error NBNS_CLIENT_MAX_TIMEOUT parameter is not valid
68#endif
69
70//Maximum cache lifetime for NBNS entries
71#ifndef NBNS_MAX_LIFETIME
72 #define NBNS_MAX_LIFETIME 60000
73#elif (NBNS_MAX_LIFETIME < 1000)
74 #error NBNS_MAX_LIFETIME parameter is not valid
75#endif
76
77//C++ guard
78#ifdef __cplusplus
79extern "C" {
80#endif
81
82//NBNS related functions
83error_t nbnsResolve(NetInterface *interface, const char_t *name, IpAddr *ipAddr);
84
85error_t nbnsSendQuery(DnsCacheEntry *entry);
86
87void nbnsProcessResponse(NetInterface *interface, const Ipv4PseudoHeader *pseudoHeader,
88 const UdpHeader *udpHeader, const NbnsHeader *message, size_t length);
89
90//C++ guard
91#ifdef __cplusplus
92}
93#endif
94
95#endif
DNS cache management.
Common DNS routines.
error_t
Error codes.
Definition error.h:43
Definitions common to NBNS client and NBNS responder.
TCP/IP stack core.
Socket API.
DNS cache entry.
Definition dns_cache.h:97
IP network address.
Definition ip.h:72
UDP (User Datagram Protocol)