#include "squid.h"
#include "dns/rfc2671.h"
#include "dns/rfc3596.h"
#include "util.h"
#include <cassert>
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
◆ rfc3596BuildAAAAQuery()
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 110 of file rfc3596.cc.
References RFC1035_TYPE_AAAA, and rfc3596BuildHostQuery().
Referenced by idnsSendSlaveAAAAQuery().
◆ rfc3596BuildAQuery()
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 96 of file rfc3596.cc.
References RFC1035_TYPE_A, and rfc3596BuildHostQuery().
Referenced by idnsALookup(), and idnsGrokReply().
◆ rfc3596BuildHostQuery()
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 57 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().
◆ rfc3596BuildPTRQuery4()
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 124 of file rfc3596.cc.
References int, RFC1035_MAXHOSTNAMESZ, RFC1035_TYPE_PTR, and rfc3596BuildHostQuery().
Referenced by idnsPTRLookup().
◆ rfc3596BuildPTRQuery6()
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 140 of file rfc3596.cc.
References RFC1035_MAXHOSTNAMESZ, RFC1035_TYPE_PTR, and rfc3596BuildHostQuery().
Referenced by idnsPTRLookup().