ISC DHCP  4.3.4
A reference DHCPv4 and DHCPv6 implementation
minires.h File Reference
#include "cdefs.h"
#include "osdep.h"

Go to the source code of this file.

Functions

int MRns_name_compress (const char *, u_char *, size_t, const unsigned char **, const unsigned char **)
 
int MRns_name_unpack (const unsigned char *, const unsigned char *, const unsigned char *, unsigned char *, size_t)
 
int MRns_name_pack (const unsigned char *, unsigned char *, unsigned, const unsigned char **, const unsigned char **)
 
int MRns_name_ntop (const unsigned char *, char *, size_t)
 
int MRns_name_pton (const char *, u_char *, size_t)
 
int MRns_name_uncompress_list (const unsigned char *, int buflen, char *, size_t)
 Creates a string of comma-separated domain-names from a compressed list. More...
 
int MRns_name_compress_list (const char *, int buflen, unsigned char *, size_t)
 Creates a compressed list from a string of comma-separated domain-names. More...
 

Function Documentation

int MRns_name_compress ( const char *  ,
u_char *  ,
size_t  ,
const unsigned char **  ,
const unsigned char **   
)
int MRns_name_compress_list ( const char *  buf,
int  buflen,
unsigned char *  compbuf,
size_t  compbuf_size 
)

Creates a compressed list from a string of comma-separated domain-names.

Produces a buffer containing a compressed data version of a list of domain-names extracted from a comma-separated string. Given a string containing:

one.two.com,three.four.com

It will compress this into:

03 6f 6e 65 03 74 77 6f 03 63 6f 6d 00 05 74 68 72 65 65 04 66 6f 75 72 c0 08

Parameters
buf- buffer containing the uncompressed string of domain-names
buflen- length of uncompressed string of domain-names
compbuf- buffer to receive the compressed list
compbuf_size- size of the compression buffer
Returns
the length of the compressed data when successful, -1 on error.

Definition at line 747 of file ns_name.c.

int MRns_name_ntop ( const unsigned char *  ,
char *  ,
size_t   
)
int MRns_name_pack ( const unsigned char *  ,
unsigned char *  ,
unsigned  ,
const unsigned char **  ,
const unsigned char **   
)
int MRns_name_pton ( const char *  ,
u_char *  ,
size_t   
)

Definition at line 141 of file ns_name.c.

int MRns_name_uncompress_list ( const unsigned char *  buf,
int  buflen,
char *  dst_buf,
size_t  dst_size 
)

Creates a string of comma-separated domain-names from a compressed list.

Produces a null-terminated string of comma-separated domain-names from a buffer containing a compressed list of domain-names. The names will be dotted and without enclosing quotes. For example: If a compressed list contains the follwoing two domain names:

a. one.two.com b. three.four.com

The compressed data will look like this:

03 6f 6e 65 03 74 77 6f 03 63 6f 6d 00 05 74 68 72 65 65 04 66 6f 75 72 c0 08

and will decompress into:

one.two.com,three.four.com

Parameters
buf- buffer containing the compressed list of domain-names
buflen- length of compressed list of domain-names
dst_buf- buffer to receive the decompressed list
dst_size- size of the destination buffer
Returns
the length of the decompressed string when successful, -1 on error.

Definition at line 678 of file ns_name.c.

int MRns_name_unpack ( const unsigned char *  ,
const unsigned char *  ,
const unsigned char *  ,
unsigned char *  ,
size_t   
)