#include "rfc2181.h"
Go to the source code of this file.
Classes | |
class | rfc1035_rr |
struct | _rfc1035_query |
struct | _rfc1035_message |
Macros | |
#define | RFC1035_MAXHOSTNAMESZ RFC2181_MAXHOSTNAMELEN |
#define | RFC1035_DEFAULT_PACKET_SZ 512 |
#define | RFC1035_TYPE_A 1 |
#define | RFC1035_TYPE_CNAME 5 |
#define | RFC1035_TYPE_PTR 12 |
#define | RFC1035_CLASS_IN 1 |
Typedefs | |
typedef struct _rfc1035_query | rfc1035_query |
typedef struct _rfc1035_message | rfc1035_message |
Macro Definition Documentation
◆ RFC1035_CLASS_IN
◆ RFC1035_DEFAULT_PACKET_SZ
◆ RFC1035_MAXHOSTNAMESZ
#define RFC1035_MAXHOSTNAMESZ RFC2181_MAXHOSTNAMELEN |
◆ RFC1035_TYPE_A
◆ RFC1035_TYPE_CNAME
◆ RFC1035_TYPE_PTR
Typedef Documentation
◆ rfc1035_message
typedef struct _rfc1035_message rfc1035_message |
◆ rfc1035_query
typedef struct _rfc1035_query rfc1035_query |
Function Documentation
◆ rfc1035BuildAQuery()
SQUIDCEXTERN ssize_t rfc1035BuildAQuery | ( | const char * | hostname, |
char * | buf, | ||
size_t | sz, | ||
unsigned short | qid, | ||
rfc1035_query * | query, | ||
ssize_t | edns_sz | ||
) |
Definition at line 658 of file rfc1035.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, RFC1035_TYPE_A, rfc1035HeaderPack(), rfc1035QuestionPack(), rfc2671RROptPack(), and xstrncpy().
◆ rfc1035BuildPTRQuery()
SQUIDCEXTERN ssize_t rfc1035BuildPTRQuery | ( | const struct in_addr | addr, |
char * | buf, | ||
size_t | sz, | ||
unsigned short | qid, | ||
rfc1035_query * | query, | ||
ssize_t | edns_sz | ||
) |
Definition at line 697 of file rfc1035.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, RFC1035_TYPE_PTR, rfc1035HeaderPack(), rfc1035QuestionPack(), rfc2671RROptPack(), and xstrncpy().
◆ rfc1035ErrorMessage()
SQUIDCEXTERN const char * rfc1035ErrorMessage | ( | int | n | ) |
Definition at line 444 of file rfc1035.cc.
References rfc1035_unpack_error.
Referenced by idnsCheckQueue(), idnsGrokReply(), and TestRfc1035::testBugPacketHeadersOnly().
◆ rfc1035HeaderPack()
SQUIDCEXTERN int rfc1035HeaderPack | ( | char * | buf, |
size_t | sz, | ||
rfc1035_message * | hdr | ||
) |
Definition at line 56 of file rfc1035.cc.
References _rfc1035_message::aa, _rfc1035_message::ancount, _rfc1035_message::arcount, assert, _rfc1035_message::id, _rfc1035_message::nscount, _rfc1035_message::opcode, _rfc1035_message::qdcount, _rfc1035_message::qr, _rfc1035_message::ra, _rfc1035_message::rcode, _rfc1035_message::rd, and _rfc1035_message::tc.
Referenced by rfc1035BuildAQuery(), rfc1035BuildPTRQuery(), and rfc3596BuildHostQuery().
◆ rfc1035HeaderUnpack()
SQUIDCEXTERN int rfc1035HeaderUnpack | ( | const char * | buf, |
size_t | sz, | ||
unsigned int * | off, | ||
rfc1035_message * | h | ||
) |
Definition at line 180 of file rfc1035.cc.
References _rfc1035_message::aa, _rfc1035_message::ancount, _rfc1035_message::arcount, assert, _rfc1035_message::id, _rfc1035_message::nscount, _rfc1035_message::opcode, _rfc1035_message::qdcount, _rfc1035_message::qr, _rfc1035_message::ra, _rfc1035_message::rcode, _rfc1035_message::rd, and _rfc1035_message::tc.
Referenced by rfc1035MessageUnpack(), TestRfc1035::testBugPacketEndingOnCompressionPtr(), TestRfc1035::testBugPacketHeadersOnly(), and TestRfc1035::testHeaderUnpack().
◆ rfc1035MessageDestroy()
SQUIDCEXTERN void rfc1035MessageDestroy | ( | rfc1035_message ** | message | ) |
Definition at line 530 of file rfc1035.cc.
References rfc1035RRDestroy(), and xfree.
Referenced by idns_query::~idns_query(), idnsGrokReply(), rfc1035MessageUnpack(), TestRfc1035::testBugPacketEndingOnCompressionPtr(), and TestRfc1035::testParseAPacket().
◆ rfc1035MessageUnpack()
SQUIDCEXTERN int rfc1035MessageUnpack | ( | const char * | buf, |
size_t | sz, | ||
rfc1035_message ** | answer | ||
) |
Definition at line 584 of file rfc1035.cc.
References _rfc1035_message::ancount, _rfc1035_message::answer, int, _rfc1035_message::qdcount, _rfc1035_message::query, _rfc1035_message::rcode, RFC1035_UNPACK_DEBUG, rfc1035_unpack_error, rfc1035HeaderUnpack(), rfc1035MessageDestroy(), rfc1035QueryUnpack(), rfc1035RRUnpack(), xcalloc(), and xfree.
Referenced by idnsGrokReply(), TestRfc1035::testBugPacketEndingOnCompressionPtr(), TestRfc1035::testBugPacketHeadersOnly(), and TestRfc1035::testParseAPacket().
◆ rfc1035QueryCompare()
SQUIDCEXTERN int rfc1035QueryCompare | ( | const rfc1035_query * | a, |
const rfc1035_query * | b | ||
) |
Definition at line 550 of file rfc1035.cc.
References _rfc1035_query::name, _rfc1035_query::qclass, and _rfc1035_query::qtype.
Referenced by idnsGrokReply().
◆ rfc1035QuestionPack()
SQUIDCEXTERN int rfc1035QuestionPack | ( | char * | buf, |
size_t | sz, | ||
const char * | name, | ||
const unsigned short | type, | ||
const unsigned short | _class | ||
) |
Definition at line 149 of file rfc1035.cc.
References assert, and rfc1035NamePack().
Referenced by rfc1035BuildAQuery(), rfc1035BuildPTRQuery(), and rfc3596BuildHostQuery().
◆ rfc1035RRDestroy()
SQUIDCEXTERN void rfc1035RRDestroy | ( | rfc1035_rr ** | rr, |
int | n | ||
) |
◆ rfc1035RRPack()
SQUIDCEXTERN int rfc1035RRPack | ( | char * | buf, |
size_t | sz, | ||
const rfc1035_rr * | RR | ||
) |
Definition at line 325 of file rfc1035.cc.
References rfc1035_rr::_class, assert, rfc1035_rr::name, rfc1035_rr::rdata, rfc1035_rr::rdlength, rfc1035NamePack(), rfc1035_rr::ttl, and rfc1035_rr::type.
Referenced by rfc2671RROptPack().
◆ rfc1035SetQueryID()
SQUIDCEXTERN void rfc1035SetQueryID | ( | char * | buf, |
unsigned short | qid | ||
) |
Definition at line 739 of file rfc1035.cc.