Watt-32 tcp/ip  2.2 dev-rel.10
Functions
udp_rev.c File Reference

Go to the source code of this file.

Functions

static BOOL read_response (sock_type *s, char *name, size_t size)
 
static BYTE * dns_labels (BYTE *bp, BYTE *p, BYTE *ep, char *result)
 
static BYTE * dns_resource (WORD req_qtype, BYTE *bp, BYTE *p, BYTE *ep, char *result)
 
static size_t query_init_ip4 (struct DNS_query *q, DWORD ip)
 Fill in the reverse lookup question packet. More...
 
static BOOL reverse_lookup (const struct DNS_query *q, size_t qlen, char *name, size_t size, DWORD nameserver)
 Translate an IPv4/IPv6 address into a host name. More...
 
int reverse_lookup_myip (void)
 Do a reverse lookup on `my_ip_addr'. More...
 
static int do_reverse_resolve (const struct DNS_query *q, size_t qlen, char *result, size_t size)
 
int reverse_resolve_ip4 (DWORD ip, char *result, size_t size)
 
static size_t query_init_ip6 (struct DNS_query *q, const void *addr)
 Fill in the reverse lookup question packet. More...
 
int reverse_resolve_ip6 (const void *addr, char *result, size_t size)
 

Detailed Description

Reverse DNS lookup

Definition in file udp_rev.c.

Function Documentation

static size_t query_init_ip4 ( struct DNS_query q,
DWORD  ip 
)
static

Fill in the reverse lookup question packet.

Return total length of request.

Definition at line 63 of file udp_rev.c.

References set_timeout().

static size_t query_init_ip6 ( struct DNS_query q,
const void addr 
)
static

Fill in the reverse lookup question packet.

Return total length of request.

Todo:
Use "ip6.arpa" bitstring format ?

Definition at line 247 of file udp_rev.c.

References set_timeout().

static BOOL reverse_lookup ( const struct DNS_query q,
size_t  qlen,
char *  name,
size_t  size,
DWORD  nameserver 
)
static

Translate an IPv4/IPv6 address into a host name.

Returns 1 on success, 0 on error or timeout.

Definition at line 100 of file udp_rev.c.

References _watt_cbroke, chk_timeout(), dom_strerror(), read_response(), set_timeout(), sock_close(), sock_dataready(), sock_write(), tcp_tick(), and udp_open().

int reverse_lookup_myip ( void  )

Do a reverse lookup on `my_ip_addr'.

If successfull, replace `hostname' and `def_domain' with returned result.

Definition at line 176 of file udp_rev.c.

References my_ip_addr, and sethostname().