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

Go to the source code of this file.

Macros

#define RFC1035_MAXLABELSZ   63
 
#define rfc1035_unpack_error   15
 
#define RFC1035_UNPACK_DEBUG   (void)0
 

Functions

int rfc1035HeaderPack (char *buf, size_t sz, rfc1035_message *hdr)
 
static int rfc1035LabelPack (char *buf, size_t sz, const char *label)
 
static int rfc1035NamePack (char *buf, size_t sz, const char *name)
 
int rfc1035QuestionPack (char *buf, const size_t sz, const char *name, const unsigned short type, const unsigned short _class)
 
int rfc1035HeaderUnpack (const char *buf, size_t sz, unsigned int *off, rfc1035_message *h)
 
static int rfc1035NameUnpack (const char *buf, size_t sz, unsigned int *off, unsigned short *rdlength, char *name, size_t ns, int rdepth)
 
int rfc1035RRPack (char *buf, const size_t sz, const rfc1035_rr *RR)
 
static int rfc1035RRUnpack (const char *buf, size_t sz, unsigned int *off, rfc1035_rr *RR)
 
const char * rfc1035ErrorMessage (int n)
 
void rfc1035RRDestroy (rfc1035_rr **rr, int n)
 
static int rfc1035QueryUnpack (const char *buf, size_t sz, unsigned int *off, rfc1035_query *query)
 
void rfc1035MessageDestroy (rfc1035_message **msg)
 
int rfc1035QueryCompare (const rfc1035_query *a, const rfc1035_query *b)
 
int rfc1035MessageUnpack (const char *buf, size_t sz, rfc1035_message **answer)
 
ssize_t rfc1035BuildAQuery (const char *hostname, char *buf, size_t sz, unsigned short qid, rfc1035_query *query, ssize_t edns_sz)
 
ssize_t rfc1035BuildPTRQuery (const struct in_addr addr, char *buf, size_t sz, unsigned short qid, rfc1035_query *query, ssize_t edns_sz)
 
void rfc1035SetQueryID (char *buf, unsigned short qid)
 

Macro Definition Documentation

#define RFC1035_MAXLABELSZ   63

Definition at line 44 of file rfc1035.cc.

Referenced by rfc1035LabelPack(), and rfc1035NameUnpack().

#define RFC1035_UNPACK_DEBUG   (void)0
#define rfc1035_unpack_error   15

Definition at line 45 of file rfc1035.cc.

Referenced by rfc1035ErrorMessage(), and rfc1035MessageUnpack().

Function Documentation

const char* rfc1035ErrorMessage ( int  n)
static int rfc1035LabelPack ( char *  buf,
size_t  sz,
const char *  label 
)
static

Definition at line 105 of file rfc1035.cc.

References assert, len, and RFC1035_MAXLABELSZ.

Referenced by rfc1035NamePack().

static int rfc1035NamePack ( char *  buf,
size_t  sz,
const char *  name 
)
static

Definition at line 130 of file rfc1035.cc.

References assert, NULL, rfc1035LabelPack(), xfree, and xstrdup.

Referenced by rfc1035QuestionPack(), and rfc1035RRPack().

static int rfc1035NameUnpack ( const char *  buf,
size_t  sz,
unsigned int off,
unsigned short *  rdlength,
char *  name,
size_t  ns,
int  rdepth 
)
static

Definition at line 247 of file rfc1035.cc.

References assert, len, RFC1035_MAXLABELSZ, RFC1035_UNPACK_DEBUG, and size_t.

Referenced by rfc1035QueryUnpack(), and rfc1035RRUnpack().

int rfc1035QueryCompare ( const rfc1035_query a,
const rfc1035_query b 
)

Definition at line 557 of file rfc1035.cc.

References _rfc1035_query::name, _rfc1035_query::qclass, and _rfc1035_query::qtype.

Referenced by idnsGrokReply().

static int rfc1035QueryUnpack ( const char *  buf,
size_t  sz,
unsigned int off,
rfc1035_query query 
)
static
int rfc1035QuestionPack ( char *  buf,
const size_t  sz,
const char *  name,
const unsigned short  type,
const unsigned short  _class 
)

Definition at line 153 of file rfc1035.cc.

References assert, and rfc1035NamePack().

Referenced by rfc1035BuildAQuery(), rfc1035BuildPTRQuery(), and rfc3596BuildHostQuery().

void rfc1035RRDestroy ( rfc1035_rr **  rr,
int  n 
)

Definition at line 490 of file rfc1035.cc.

References NULL, and xfree.

Referenced by rfc1035MessageDestroy().

int rfc1035RRPack ( char *  buf,
const size_t  sz,
const rfc1035_rr RR 
)
void rfc1035SetQueryID ( char *  buf,
unsigned short  qid 
)

Definition at line 746 of file rfc1035.cc.

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors