Included Files
- #include <nut/include/cfg/os.h>
- #include </usr/avr/include/string.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>
typedef struct {...} DNSCONFIG
struct
|
|
{
|
|
u_char* doc_hostname;
|
|
u_char* doc_domain;
|
|
u_long doc_ip1;
|
|
u_long doc_ip2;
|
|
}
|
|
typedef struct {...} DNSHEADER
struct
|
|
{
|
|
u_short doh_id;
|
|
u_short doh_flags;
|
|
u_short doh_quests;
|
|
u_short doh_answers;
|
|
u_short doh_authrr;
|
|
u_short doh_addrr;
|
|
}
|
|
typedef struct {...} DNSQUESTION
struct
|
|
{
|
|
u_char* doq_name;
|
|
u_short doq_type;
|
|
u_short doq_class;
|
|
}
|
|
typedef struct {...} DNSRESOURCE
struct
|
|
{
|
|
u_char* dor_name;
|
|
u_short dor_type;
|
|
u_short dor_class;
|
|
u_long dor_ttl;
|
|
u_short dor_len;
|
|
u_char* dor_data;
|
|
}
|
|
Local Variables
doc
static DNSCONFIG doc
void NutDnsConfig ( u_char* hostname, u_char* domain, u_long dnsip )
void NutDnsConfig2 ( u_char* hostname, u_char* domain, u_long pdnsip, u_long sdnsip )
u_long NutDnsGetHostByName ( const u_char* hostname )
u_long NutDnsGetMxByDomain ( const u_char* hostname )
u_long NutDnsGetResource ( const u_char* hostname, const u_short type )
static u_short AddName ( u_char* cp, const u_char* name )
static u_short AddShort ( u_char* cp, u_short val )
static DNSHEADER* CreateDnsHeader ( DNSHEADER* doh, u_short id )
static DNSQUESTION* CreateDnsQuestion ( DNSQUESTION* doq, const u_char* name, u_short type )
static DNSRESOURCE* CreateDnsResource ( DNSRESOURCE* dor )
static u_short DecodeDnsHeader ( DNSHEADER* doh, u_char* buf )
static u_short DecodeDnsQuestion ( DNSQUESTION* doq, u_char* buf )
static u_short DecodeDnsResource ( DNSRESOURCE* dor, u_char* buf )
static u_short EncodeDnsHeader ( u_char* buf, DNSHEADER* doh )
static u_short EncodeDnsQuestion ( u_char* buf, DNSQUESTION* doq )
static void ReleaseDnsHeader ( DNSHEADER* doh )
static void ReleaseDnsQuestion ( DNSQUESTION* doq )
static void ReleaseDnsResource ( DNSRESOURCE* dor )
static u_short ScanBinary ( u_char* cp, u_char** npp, u_short len )
static u_short ScanLong ( u_char* cp, u_long* val )
static u_short ScanName ( u_char* cp, u_char** npp )
static u_short ScanShort ( u_char* cp, u_short* val )