00001 /* 00002 * dname.h 00003 * 00004 * dname definitions 00005 * 00006 * a Net::DNS like library for C 00007 * 00008 * (c) NLnet Labs, 2004-2006 00009 * 00010 * See the file LICENSE for the license 00011 */ 00012 00039 #ifndef LDNS_DNAME_H 00040 #define LDNS_DNAME_H 00041 00042 #include <ldns/common.h> 00043 #include <ldns/rdata.h> 00044 00045 #define LDNS_DNAME_NORMALIZE tolower 00046 00053 ldns_rdf *ldns_dname_cat_clone(const ldns_rdf *rd1, const ldns_rdf *rd2); 00054 00061 ldns_status ldns_dname_cat(ldns_rdf *rd1, ldns_rdf *rd2); 00062 00069 ldns_rdf *ldns_dname_reverse(const ldns_rdf *d); 00070 00077 ldns_rdf *ldns_dname_left_chop(const ldns_rdf *d); 00078 00084 uint8_t ldns_dname_label_count(const ldns_rdf *r); 00085 00091 ldns_rdf *ldns_dname_new_frm_str(const char *str); 00092 00099 ldns_rdf *ldns_dname_new(uint16_t s, void *data); 00100 00107 ldns_rdf *ldns_dname_new_frm_data(uint16_t size, const void *data); 00108 00114 void ldns_dname2canonical(const ldns_rdf *rdf); 00115 00123 bool ldns_dname_is_subdomain(const ldns_rdf *sub, const ldns_rdf *parent); 00124 00132 int ldns_dname_compare(const ldns_rdf *dname1, const ldns_rdf *dname2); 00133 00142 int ldns_dname_interval(const ldns_rdf *prev, const ldns_rdf *middle, const ldns_rdf *next); 00143 00149 bool ldns_dname_str_absolute(const char *dname_str); 00150 00159 ldns_rdf * ldns_dname_label(const ldns_rdf *rdf, uint8_t labelpos); 00160 00161 #endif /* LDNS_DNAME_H */