dname.h
Go to the documentation of this file.
/*
* dname.h
*
* dname definitions
*
* a Net::DNS like library for C
*
* (c) NLnet Labs, 2004-2006
*
* See the file LICENSE for the license
*/
#ifndef LDNS_DNAME_H
#define LDNS_DNAME_H
#include <ldns/common.h>
#include <ldns/rdata.h>
#ifdef __cplusplus
extern "C" {
#endif
#define LDNS_DNAME_NORMALIZE tolower
ldns_rdf *ldns_dname_cat_clone(const ldns_rdf *rd1, const ldns_rdf *rd2);
ldns_status ldns_dname_cat(ldns_rdf *rd1, const ldns_rdf *rd2);
ldns_rdf *ldns_dname_reverse(const ldns_rdf *d);
ldns_rdf *
ldns_dname_clone_from(const ldns_rdf *d, uint16_t n);
ldns_rdf *ldns_dname_left_chop(const ldns_rdf *d);
uint8_t ldns_dname_label_count(const ldns_rdf *r);
ldns_rdf *ldns_dname_new_frm_str(const char *str);
ldns_rdf *ldns_dname_new(uint16_t s, void *data);
ldns_rdf *ldns_dname_new_frm_data(uint16_t size, const void *data);
void ldns_dname2canonical(const ldns_rdf *rdf);
bool ldns_dname_is_subdomain(const ldns_rdf *sub, const ldns_rdf *parent);
int ldns_dname_compare(const ldns_rdf *dname1, const ldns_rdf *dname2);
int ldns_dname_compare_v(const void *, const void *);
int ldns_dname_match_wildcard(const ldns_rdf *dname, const ldns_rdf *wildcard);
int ldns_dname_interval(const ldns_rdf *prev, const ldns_rdf *middle, const ldns_rdf *next);
bool ldns_dname_str_absolute(const char *dname_str);
bool ldns_dname_absolute(const ldns_rdf *dname);
ldns_rdf * ldns_dname_label(const ldns_rdf *rdf, uint8_t labelpos);
int ldns_dname_is_wildcard(const ldns_rdf* dname);
#ifdef __cplusplus
}
#endif
#endif /* LDNS_DNAME_H */
common.h
Common definitions for LDNS.
ldns_dname_cat_clone
ldns_rdf * ldns_dname_cat_clone(const ldns_rdf *rd1, const ldns_rdf *rd2)
concatenates two dnames together
Definition dname.c:52
ldns_dname_is_wildcard
int ldns_dname_is_wildcard(const ldns_rdf *dname)
Check if dname is a wildcard, starts with *.
Definition dname.c:456
ldns_dname_reverse
ldns_rdf * ldns_dname_reverse(const ldns_rdf *d)
Returns a clone of the given dname with the labels reversed.
Definition dname.c:124
ldns_dname_match_wildcard
int ldns_dname_match_wildcard(const ldns_rdf *dname, const ldns_rdf *wildcard)
Checks whether the dname matches the given wildcard.
Definition dname.c:464
ldns_dname_new_frm_data
ldns_rdf * ldns_dname_new_frm_data(uint16_t size, const void *data)
Create a new dname rdf from data (the data is copied)
Definition dname.c:274
ldns_dname_str_absolute
signed char ldns_dname_str_absolute(const char *dname_str)
Checks whether the given dname string is absolute (i.e.
Definition dname.c:518
ldns_dname_is_subdomain
signed char ldns_dname_is_subdomain(const ldns_rdf *sub, const ldns_rdf *parent)
test whether the name sub falls under parent (i.e.
Definition dname.c:296
ldns_dname_compare
int ldns_dname_compare(const ldns_rdf *dname1, const ldns_rdf *dname2)
Compares the two dname rdf's according to the algorithm for ordering in RFC4034 Section 6.
Definition dname.c:359
ldns_dname_compare_v
int ldns_dname_compare_v(const void *, const void *)
Given in dnssec_zone.c, also used in dnssec_sign.c:w.
Definition dnssec_zone.c:906
ldns_dname_absolute
signed char ldns_dname_absolute(const ldns_rdf *dname)
Checks whether the given dname is absolute (i.e.
Definition dname.c:548
ldns_dname_left_chop
ldns_rdf * ldns_dname_left_chop(const ldns_rdf *d)
chop one label off the left side of a dname.
Definition dname.c:189
ldns_dname_new
ldns_rdf * ldns_dname_new(uint16_t s, void *data)
Create a new dname rdf from a string.
Definition dname.c:250
ldns_dname_clone_from
ldns_rdf * ldns_dname_clone_from(const ldns_rdf *d, uint16_t n)
Clones the given dname from the nth label on.
Definition dname.c:160
ldns_dname_interval
int ldns_dname_interval(const ldns_rdf *prev, const ldns_rdf *middle, const ldns_rdf *next)
check if middle lays in the interval defined by prev and next prev <= middle < next.
Definition dname.c:488
ldns_dname2canonical
void ldns_dname2canonical(const ldns_rdf *rdf)
Put a dname into canonical fmt - ie.
Definition dname.c:280
ldns_dname_label
ldns_rdf * ldns_dname_label(const ldns_rdf *rdf, uint8_t labelpos)
look inside the rdf and if it is an LDNS_RDF_TYPE_DNAME try and retrieve a specific label.
Definition dname.c:560
ldns_dname_label_count
uint8_t ldns_dname_label_count(const ldns_rdf *r)
count the number of labels inside a LDNS_RDF_DNAME type rdf.
Definition dname.c:214
ldns_dname_cat
ldns_status ldns_dname_cat(ldns_rdf *rd1, const ldns_rdf *rd2)
concatenates rd2 after rd1 (rd2 is copied, rd1 is modified)
Definition dname.c:90
ldns_dname_new_frm_str
ldns_rdf * ldns_dname_new_frm_str(const char *str)
creates a new dname rdf from a string.
Definition dname.c:268
ldns_status
enum ldns_enum_status ldns_status
Definition error.h:148
rdata.h
Defines ldns_rdf and functions to manipulate those.
ldns_struct_rdf
Resource record data field.
Definition rdata.h:197