#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <errno.h>
#include <string.h>
#include <ctype.h>
#include "ns_name.h"
#include "arpa/nameser.h"
Go to the source code of this file.
Functions | |
int | MRns_name_len (const u_char *eom, const u_char *src) |
int | MRns_name_ntop (const u_char *src, char *dst, size_t dstsiz) |
int | MRns_name_pton (const char *src, u_char *dst, size_t dstsiz) |
int | MRns_name_ntol (const u_char *src, u_char *dst, size_t dstsiz) |
int | MRns_name_unpack (const u_char *msg, const u_char *eom, const u_char *src, u_char *dst, size_t dstsiz) |
int | MRns_name_pack (const u_char *src, u_char *dst, unsigned dstsiz, const u_char **dnptrs, const u_char **lastdnptr) |
int | MRns_name_uncompress (const u_char *msg, const u_char *eom, const u_char *src, char *dst, size_t dstsiz) |
int | MRns_name_compress (const char *src, u_char *dst, size_t dstsiz, const u_char **dnptrs, const u_char **lastdnptr) |
int | MRns_name_skip (const u_char **ptrptr, const u_char *eom) |
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. | |
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. | |
int MRns_name_compress | ( | const char * | src, |
u_char * | dst, | ||
size_t | dstsiz, | ||
const u_char ** | dnptrs, | ||
const u_char ** | lastdnptr ) |
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
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 |
int MRns_name_len | ( | const u_char * | eom, |
const u_char * | src ) |
int MRns_name_ntol | ( | const u_char * | src, |
u_char * | dst, | ||
size_t | dstsiz ) |
int MRns_name_ntop | ( | const u_char * | src, |
char * | dst, | ||
size_t | dstsiz ) |
int MRns_name_pack | ( | const u_char * | src, |
u_char * | dst, | ||
unsigned | dstsiz, | ||
const u_char ** | dnptrs, | ||
const u_char ** | lastdnptr ) |
int MRns_name_pton | ( | const char * | src, |
u_char * | dst, | ||
size_t | dstsiz ) |
int MRns_name_skip | ( | const u_char ** | ptrptr, |
const u_char * | eom ) |
int MRns_name_uncompress | ( | const u_char * | msg, |
const u_char * | eom, | ||
const u_char * | src, | ||
char * | dst, | ||
size_t | dstsiz ) |
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
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 |