File nut/pro/resolv.c


Included Files


Typedef DNSHEADER

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 DNSQUESTION

typedef struct {...} DNSQUESTION
struct  
   {  
      uint8_t* doq_name;  
      uint16_t doq_type;  
      uint16_t doq_class;  
   }  

Typedef DNSRESOURCE

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
Defined in: nut/pro/confdns.c

Global Function NutDnsConfig()

void NutDnsConfig ( const uint8_t* hostname, const uint8_t* domain, uint32_t dnsip )
Prototyped in: nut/include/netdb.h
Calls: NutDnsConfig2() nut/pro/confdns.c

Global Function NutDnsGetConfig2()

void NutDnsGetConfig2 ( char** hostname, char** domain, uint32_t* pdnsip, uint32_t* sdnsip )
Prototyped in: nut/include/netdb.h
References Variables: confdns nut/pro/confdns.c

Global Function NutDnsGetHostByName()

uint32_t NutDnsGetHostByName ( const uint8_t* hostname )
Prototyped in: nut/include/netdb.h
Calls: NutDnsGetResource() nut/pro/resolv.c
Called by: NutAppMain() nut/app/inetq/inetq.c
  QueryDateAndTime() nut/app/pppc/pppc.c

Global Function NutDnsGetHostsByName()

uint8_t NutDnsGetHostsByName ( const uint8_t* hostname, uint32_t* ip_all )
Prototyped in: nut/include/netdb.h
Calls: NutDnsGetResourceAll() nut/pro/resolv.c

Global Function NutDnsGetMxByDomain()

uint32_t NutDnsGetMxByDomain ( const uint8_t* hostname )
Prototyped in: nut/include/netdb.h
Calls: NutDnsGetResource() nut/pro/resolv.c

Global Function NutDnsGetResource()

uint32_t NutDnsGetResource ( const uint8_t* hostname, const uint16_t type )
Prototyped in: nut/pro/resolv.c
Calls: CreateDnsHeader() nut/pro/resolv.c
  CreateDnsQuestion() nut/pro/resolv.c
  CreateDnsResource() nut/pro/resolv.c
  DecodeDnsHeader() nut/pro/resolv.c
  DecodeDnsQuestion() nut/pro/resolv.c
  DecodeDnsResource() nut/pro/resolv.c
  EncodeDnsHeader() nut/pro/resolv.c
  EncodeDnsQuestion() nut/pro/resolv.c
  NutUdpCreateSocket() nut/net/udpsock.c
  NutUdpDestroySocket() nut/net/udpsock.c
  NutUdpReceiveFrom() nut/net/udpsock.c
  NutUdpSendTo() nut/net/udpsock.c
  ReleaseDnsHeader() nut/pro/resolv.c
  ReleaseDnsQuestion() nut/pro/resolv.c
  ReleaseDnsResource() nut/pro/resolv.c
  free() nut/crt/malloc.c
  malloc() nut/crt/malloc.c
Called by: NutDnsGetHostByName() nut/pro/resolv.c
  NutDnsGetMxByDomain() nut/pro/resolv.c
References Variables: confdns nut/pro/confdns.c

Global Function NutDnsGetResourceAll()

uint8_t NutDnsGetResourceAll ( const uint8_t* hostname, const uint16_t type, uint32_t* ip_all )
Prototyped in: nut/pro/resolv.c
Calls: CreateDnsHeader() nut/pro/resolv.c
  CreateDnsQuestion() nut/pro/resolv.c
  CreateDnsResource() nut/pro/resolv.c
  DecodeDnsHeader() nut/pro/resolv.c
  DecodeDnsQuestion() nut/pro/resolv.c
  DecodeDnsResource() nut/pro/resolv.c
  EncodeDnsHeader() nut/pro/resolv.c
  EncodeDnsQuestion() nut/pro/resolv.c
  NutHeapRootAlloc() nut/os/heap.c
  NutHeapRootFree() nut/os/heap.c
  NutUdpCreateSocket() nut/net/udpsock.c
  NutUdpDestroySocket() nut/net/udpsock.c
  NutUdpReceiveFrom() nut/net/udpsock.c
  NutUdpSendTo() nut/net/udpsock.c
  ReleaseDnsHeader() nut/pro/resolv.c
  ReleaseDnsQuestion() nut/pro/resolv.c
  ReleaseDnsResource() nut/pro/resolv.c
Called by: NutDnsGetHostsByName() nut/pro/resolv.c
References Variables: confdns nut/pro/confdns.c

Local Function AddName()

static uint16_t AddName ( uint8_t* cp, const uint8_t* name )
Calls: strlen() nut/c/string/strlen.c
Called by: EncodeDnsQuestion() nut/pro/resolv.c

Local Function AddShort()

static uint16_t AddShort ( uint8_t* cp, uint16_t val )
Called by: EncodeDnsHeader() nut/pro/resolv.c
  EncodeDnsQuestion() nut/pro/resolv.c

Local Function CreateDnsHeader()

static DNSHEADER* CreateDnsHeader ( DNSHEADER* doh, uint16_t id )
Calls: calloc()
Called by: NutDnsGetResource() nut/pro/resolv.c
  NutDnsGetResourceAll() nut/pro/resolv.c

Local Function CreateDnsQuestion()

static DNSQUESTION* CreateDnsQuestion ( DNSQUESTION* doq, const uint8_t* name, uint16_t type )
Calls: free() nut/crt/malloc.c
  strdup() nut/crt/strdup.c
  calloc()
Called by: NutDnsGetResource() nut/pro/resolv.c
  NutDnsGetResourceAll() nut/pro/resolv.c

Local Function CreateDnsResource()

static DNSRESOURCE* CreateDnsResource ( DNSRESOURCE* dor )
Calls: calloc()
Called by: NutDnsGetResource() nut/pro/resolv.c
  NutDnsGetResourceAll() nut/pro/resolv.c

Local Function DecodeDnsHeader()

static uint16_t DecodeDnsHeader ( DNSHEADER* doh, uint8_t* buf )
Calls: ScanShort() nut/pro/resolv.c
Called by: NutDnsGetResource() nut/pro/resolv.c
  NutDnsGetResourceAll() nut/pro/resolv.c

Local Function DecodeDnsQuestion()

static uint16_t DecodeDnsQuestion ( DNSQUESTION* doq, uint8_t* buf )
Calls: ScanName() nut/pro/resolv.c
  ScanShort() nut/pro/resolv.c
Called by: NutDnsGetResource() nut/pro/resolv.c
  NutDnsGetResourceAll() nut/pro/resolv.c

Local Function DecodeDnsResource()

static uint16_t DecodeDnsResource ( DNSRESOURCE* dor, uint8_t* buf )
Calls: ScanBinary() nut/pro/resolv.c
  ScanLong() nut/pro/resolv.c
  ScanName() nut/pro/resolv.c
  ScanShort() nut/pro/resolv.c
Called by: NutDnsGetResource() nut/pro/resolv.c
  NutDnsGetResourceAll() nut/pro/resolv.c

Local Function EncodeDnsHeader()

static uint16_t EncodeDnsHeader ( uint8_t* buf, DNSHEADER* doh )
Calls: AddShort() nut/pro/resolv.c
Called by: NutDnsGetResource() nut/pro/resolv.c
  NutDnsGetResourceAll() nut/pro/resolv.c

Local Function EncodeDnsQuestion()

static uint16_t EncodeDnsQuestion ( uint8_t* buf, DNSQUESTION* doq )
Calls: AddName() nut/pro/resolv.c
  AddShort() nut/pro/resolv.c
Called by: NutDnsGetResource() nut/pro/resolv.c
  NutDnsGetResourceAll() nut/pro/resolv.c

Local Function ReleaseDnsHeader()

static void ReleaseDnsHeader ( DNSHEADER* doh )
Calls: free() nut/crt/malloc.c
Called by: NutDnsGetResource() nut/pro/resolv.c
  NutDnsGetResourceAll() nut/pro/resolv.c

Local Function ReleaseDnsQuestion()

static void ReleaseDnsQuestion ( DNSQUESTION* doq )
Calls: free() nut/crt/malloc.c
Called by: NutDnsGetResource() nut/pro/resolv.c
  NutDnsGetResourceAll() nut/pro/resolv.c

Local Function ReleaseDnsResource()

static void ReleaseDnsResource ( DNSRESOURCE* dor )
Calls: free() nut/crt/malloc.c
Called by: NutDnsGetResource() nut/pro/resolv.c
  NutDnsGetResourceAll() nut/pro/resolv.c

Local Function ScanBinary()

static uint16_t ScanBinary ( uint8_t* cp, uint8_t** npp, uint16_t len )
Calls: free() nut/crt/malloc.c
  malloc() nut/crt/malloc.c
  memcpy() nut/c/string/memcpy.c
Called by: DecodeDnsResource() nut/pro/resolv.c

Local Function ScanLong()

static uint16_t ScanLong ( uint8_t* cp, uint32_t* val )
Called by: DecodeDnsResource() nut/pro/resolv.c

Local Function ScanName()

static uint16_t ScanName ( uint8_t* cp, uint8_t** npp )
Calls: free() nut/crt/malloc.c
  malloc() nut/crt/malloc.c
  strlen() nut/c/string/strlen.c
Called by: DecodeDnsQuestion() nut/pro/resolv.c
  DecodeDnsResource() nut/pro/resolv.c

Local Function ScanShort()

static uint16_t ScanShort ( uint8_t* cp, uint16_t* val )
Called by: DecodeDnsHeader() nut/pro/resolv.c
  DecodeDnsQuestion() nut/pro/resolv.c
  DecodeDnsResource() nut/pro/resolv.c