rfc3596.cc File Reference
#include "squid.h"
#include "dns/rfc2671.h"
#include "dns/rfc3596.h"
#include "util.h"
Include dependency graph for rfc3596.cc:

Go to the source code of this file.

Functions

ssize_t rfc3596BuildHostQuery (const char *hostname, char *buf, size_t sz, unsigned short qid, rfc1035_query *query, int qtype, ssize_t edns_sz)
 
ssize_t rfc3596BuildAQuery (const char *hostname, char *buf, size_t sz, unsigned short qid, rfc1035_query *query, ssize_t edns_sz)
 
ssize_t rfc3596BuildAAAAQuery (const char *hostname, char *buf, size_t sz, unsigned short qid, rfc1035_query *query, ssize_t edns_sz)
 
ssize_t rfc3596BuildPTRQuery4 (const struct in_addr addr, char *buf, size_t sz, unsigned short qid, rfc1035_query *query, ssize_t edns_sz)
 
ssize_t rfc3596BuildPTRQuery6 (const struct in6_addr addr, char *buf, size_t sz, unsigned short qid, rfc1035_query *query, ssize_t edns_sz)
 

Function Documentation

ssize_t rfc3596BuildAAAAQuery ( const char *  hostname,
char *  buf,
size_t  sz,
unsigned short  qid,
rfc1035_query query,
ssize_t  edns_sz 
)

Builds a message buffer with a QUESTION to lookup AAAA records for a hostname. Caller must allocate 'buf' which should probably be at least 512 octets. The 'szp' initially specifies the size of the buffer, on return it contains the size of the message (i.e. how much to write).

Returns
the size of the query

Definition at line 112 of file rfc3596.cc.

References RFC1035_TYPE_AAAA, and rfc3596BuildHostQuery().

Referenced by idnsSendSlaveAAAAQuery().

ssize_t rfc3596BuildAQuery ( const char *  hostname,
char *  buf,
size_t  sz,
unsigned short  qid,
rfc1035_query query,
ssize_t  edns_sz 
)

Builds a message buffer with a QUESTION to lookup A records for a hostname. Caller must allocate 'buf' which should probably be at least 512 octets. The 'szp' initially specifies the size of the buffer, on return it contains the size of the message (i.e. how much to write).

Returns
the size of the query

Definition at line 98 of file rfc3596.cc.

References RFC1035_TYPE_A, and rfc3596BuildHostQuery().

Referenced by idnsALookup(), and idnsGrokReply().

ssize_t rfc3596BuildHostQuery ( const char *  hostname,
char *  buf,
size_t  sz,
unsigned short  qid,
rfc1035_query query,
int  qtype,
ssize_t  edns_sz 
)

Builds a message buffer with a QUESTION to lookup records for a hostname. Caller must allocate 'buf' which should probably be at least 512 octets. The 'szp' initially specifies the size of the buffer, on return it contains the size of the message (i.e. how much to write). Returns the size of the query

Definition at line 59 of file rfc3596.cc.

References _rfc1035_message::arcount, assert, _rfc1035_message::id, int, _rfc1035_query::name, _rfc1035_message::opcode, _rfc1035_query::qclass, _rfc1035_message::qdcount, _rfc1035_message::qr, _rfc1035_query::qtype, _rfc1035_message::rd, RFC1035_CLASS_IN, rfc1035HeaderPack(), rfc1035QuestionPack(), rfc2671RROptPack(), and xstrncpy().

Referenced by rfc3596BuildAAAAQuery(), rfc3596BuildAQuery(), rfc3596BuildPTRQuery4(), and rfc3596BuildPTRQuery6().

ssize_t rfc3596BuildPTRQuery4 ( const struct in_addr  addr,
char *  buf,
size_t  sz,
unsigned short  qid,
rfc1035_query query,
ssize_t  edns_sz 
)

Builds a message buffer with a QUESTION to lookup PTR records for an address. Caller must allocate 'buf' which should probably be at least 512 octets. The 'szp' initially specifies the size of the buffer, on return it contains the size of the message (i.e. how much to write).

Returns
the size of the query

Definition at line 126 of file rfc3596.cc.

References i, int, RFC1035_MAXHOSTNAMESZ, RFC1035_TYPE_PTR, and rfc3596BuildHostQuery().

Referenced by idnsPTRLookup().

ssize_t rfc3596BuildPTRQuery6 ( const struct in6_addr  addr,
char *  buf,
size_t  sz,
unsigned short  qid,
rfc1035_query query,
ssize_t  edns_sz 
)

Definition at line 142 of file rfc3596.cc.

References i, p, RFC1035_MAXHOSTNAMESZ, RFC1035_TYPE_PTR, and rfc3596BuildHostQuery().

Referenced by idnsPTRLookup().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors