Included Files
- #include <nut/include/cfg/os.h>
- #include <nut/include/sys/device.h>
- #include <nut/include/sys/timer.h>
- #include <nut/include/sys/heap.h>
- #include <nut/include/arpa/inet.h>
- #include <nut/include/net/if_var.h>
- #include <nut/include/sys/socket.h>
- #include <nut/include/include2/string.h>
- #include <nut/include/memdebug.h>
- #include <nut/include/netdb.h>
typedef struct {...} DNSHEADER
struct
|
|
{
|
|
uint16_t doh_id;
|
|
uint16_t doh_flags;
|
|
uint16_t doh_quests;
|
|
uint16_t doh_answers;
|
|
uint16_t doh_authrr;
|
|
uint16_t doh_addrr;
|
|
}
|
|
typedef struct {...} DNSQUESTION
struct
|
|
{
|
|
uint8_t* doq_name;
|
|
uint16_t doq_type;
|
|
uint16_t doq_class;
|
|
}
|
|
typedef struct {...} DNSRESOURCE
struct
|
|
{
|
|
uint8_t* dor_name;
|
|
uint16_t dor_type;
|
|
uint16_t dor_class;
|
|
uint32_t dor_ttl;
|
|
uint16_t dor_len;
|
|
uint8_t* dor_data;
|
|
}
|
|
External Variables
confdns
extern DNSCONFIG confdns
void NutDnsConfig ( const uint8_t* hostname, const uint8_t* domain, uint32_t dnsip )
void NutDnsGetConfig2 ( char** hostname, char** domain, uint32_t* pdnsip, uint32_t* sdnsip )
uint32_t NutDnsGetHostByName ( const uint8_t* hostname )
uint8_t NutDnsGetHostsByName ( const uint8_t* hostname, uint32_t* ip_all )
uint32_t NutDnsGetMxByDomain ( const uint8_t* hostname )
uint32_t NutDnsGetResource ( const uint8_t* hostname, const uint16_t type )
uint8_t NutDnsGetResourceAll ( const uint8_t* hostname, const uint16_t type, uint32_t* ip_all )
static uint16_t AddName ( uint8_t* cp, const uint8_t* name )
static uint16_t AddShort ( uint8_t* cp, uint16_t val )
static DNSHEADER* CreateDnsHeader ( DNSHEADER* doh, uint16_t id )
static DNSQUESTION* CreateDnsQuestion ( DNSQUESTION* doq, const uint8_t* name, uint16_t type )
static DNSRESOURCE* CreateDnsResource ( DNSRESOURCE* dor )
static uint16_t DecodeDnsHeader ( DNSHEADER* doh, uint8_t* buf )
static uint16_t DecodeDnsQuestion ( DNSQUESTION* doq, uint8_t* buf )
static uint16_t DecodeDnsResource ( DNSRESOURCE* dor, uint8_t* buf )
static uint16_t EncodeDnsHeader ( uint8_t* buf, DNSHEADER* doh )
static uint16_t EncodeDnsQuestion ( uint8_t* buf, DNSQUESTION* doq )
static void ReleaseDnsHeader ( DNSHEADER* doh )
static void ReleaseDnsQuestion ( DNSQUESTION* doq )
static void ReleaseDnsResource ( DNSRESOURCE* dor )
static uint16_t ScanBinary ( uint8_t* cp, uint8_t** npp, uint16_t len )
static uint16_t ScanLong ( uint8_t* cp, uint32_t* val )
static uint16_t ScanName ( uint8_t* cp, uint8_t** npp )
static uint16_t ScanShort ( uint8_t* cp, uint16_t* val )