rfc1035.h File Reference
#include "rfc2181.h"
Include dependency graph for rfc1035.h:
This graph shows which files directly or indirectly include this file:

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
 

Functions

SQUIDCEXTERN ssize_t rfc1035BuildAQuery (const char *hostname, char *buf, size_t sz, unsigned short qid, rfc1035_query *query, ssize_t edns_sz)
 
SQUIDCEXTERN ssize_t rfc1035BuildPTRQuery (const struct in_addr, char *buf, size_t sz, unsigned short qid, rfc1035_query *query, ssize_t edns_sz)
 
SQUIDCEXTERN void rfc1035SetQueryID (char *, unsigned short qid)
 
SQUIDCEXTERN int rfc1035MessageUnpack (const char *buf, size_t sz, rfc1035_message **answer)
 
SQUIDCEXTERN int rfc1035QueryCompare (const rfc1035_query *, const rfc1035_query *)
 
SQUIDCEXTERN void rfc1035RRDestroy (rfc1035_rr **rr, int n)
 
SQUIDCEXTERN void rfc1035MessageDestroy (rfc1035_message **message)
 
SQUIDCEXTERN const char * rfc1035ErrorMessage (int n)
 
SQUIDCEXTERN int rfc1035HeaderPack (char *buf, size_t sz, rfc1035_message *hdr)
 
SQUIDCEXTERN int rfc1035HeaderUnpack (const char *buf, size_t sz, unsigned int *off, rfc1035_message *h)
 
SQUIDCEXTERN int rfc1035QuestionPack (char *buf, size_t sz, const char *name, const unsigned short type, const unsigned short _class)
 
SQUIDCEXTERN int rfc1035RRPack (char *buf, size_t sz, const rfc1035_rr *RR)
 

Macro Definition Documentation

◆ RFC1035_CLASS_IN

#define RFC1035_CLASS_IN   1

Definition at line 96 of file rfc1035.h.

◆ RFC1035_DEFAULT_PACKET_SZ

#define RFC1035_DEFAULT_PACKET_SZ   512

Definition at line 34 of file rfc1035.h.

◆ RFC1035_MAXHOSTNAMESZ

#define RFC1035_MAXHOSTNAMESZ   RFC2181_MAXHOSTNAMELEN
RFC 1035 Section 3.1:
To simplify implementations, the total length of a domain name (i.e., label octets and label length octets) is restricted to 255 octets or less.
Clarified by RFC 2181 Section 11. (RFC2181_MAXHOSTNAMELEN)

Definition at line 32 of file rfc1035.h.

◆ RFC1035_TYPE_A

#define RFC1035_TYPE_A   1

Definition at line 93 of file rfc1035.h.

◆ RFC1035_TYPE_CNAME

#define RFC1035_TYPE_CNAME   5

Definition at line 94 of file rfc1035.h.

◆ RFC1035_TYPE_PTR

#define RFC1035_TYPE_PTR   12

Definition at line 95 of file rfc1035.h.

Typedef Documentation

◆ rfc1035_message

Definition at line 54 of file rfc1035.h.

◆ rfc1035_query

typedef struct _rfc1035_query rfc1035_query

Definition at line 47 of file rfc1035.h.

Function Documentation

◆ rfc1035BuildAQuery()

◆ rfc1035BuildPTRQuery()

◆ rfc1035ErrorMessage()

SQUIDCEXTERN const char * rfc1035ErrorMessage ( int  n)

◆ rfc1035HeaderPack()

◆ rfc1035HeaderUnpack()

◆ rfc1035MessageDestroy()

◆ rfc1035MessageUnpack()

◆ 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 
)

Definition at line 483 of file rfc1035.cc.

References xfree.

Referenced by rfc1035MessageDestroy().

◆ rfc1035RRPack()

SQUIDCEXTERN int rfc1035RRPack ( char *  buf,
size_t  sz,
const rfc1035_rr RR 
)

◆ rfc1035SetQueryID()

SQUIDCEXTERN void rfc1035SetQueryID ( char *  buf,
unsigned short  qid 
)

Definition at line 739 of file rfc1035.cc.

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors