📄 rdata.h
字号:
*/isc_result_tdns_rdata_totext(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target);/* * Convert 'rdata' into text format, storing the result in 'target'. * The text will consist of a single line, with fields separated by * single spaces. * * Notes: * If 'origin' is not NULL, then any names in the rdata that are * subdomains of 'origin' will be made relative it. * * XXX Do we *really* want to support 'origin'? I'm inclined towards "no" * at the moment. * * Requires: * * 'rdata' is a valid, non-empty rdata * * 'origin' is NULL, or is a valid name * * 'target' is a valid text buffer * * Ensures: * If the result is success: * * The used space in target is updated. * * Returns: * Success * <Any non-success status from dns_name_totext()> * Resource Limit: Not enough space */isc_result_tdns_rdata_tofmttext(dns_rdata_t *rdata, dns_name_t *origin, unsigned int flags, unsigned int width, char *linebreak, isc_buffer_t *target);/* * Like dns_rdata_totext, but do formatted output suitable for * database dumps. This is intended for use by dns_db_dump(); * library users are discouraged from calling it directly. * * If (flags & DNS_STYLEFLAG_MULTILINE) != 0, attempt to stay * within 'width' by breaking the text into multiple lines. * The string 'linebreak' is inserted between lines, and parentheses * are added when necessary. Because RRs contain unbreakable elements * such as domain names whose length is variable, unpredictable, and * potentially large, there is no guarantee that the lines will * not exceed 'width' anyway. * * If (flags & DNS_STYLEFLAG_MULTILINE) == 0, the rdata is always * printed as a single line, and no parentheses are used. * The 'width' and 'linebreak' arguments are ignored. * * If (flags & DNS_STYLEFLAG_COMMENT) != 0, output explanatory * comments next to things like the SOA timer fields. Some * comments (e.g., the SOA ones) are only printed when multiline * output is selected. */isc_result_tdns_rdata_fromstruct(dns_rdata_t *rdata, dns_rdataclass_t rdclass, dns_rdatatype_t type, void *source, isc_buffer_t *target);/* * Convert the C structure representation of an rdata into uncompressed wire * format in 'target'. * * XXX Should we have a 'size' parameter as a sanity check on target? * * Requires: * * 'rdclass' and 'type' are valid. * * 'source' points to a valid C struct for the class and type. * * 'target' is a valid buffer. * * All structure pointers to memory blocks should be NULL if their * corresponding length values are zero. * * Ensures: * If result is success: * If 'rdata' is not NULL, it is attached to the target. * * The used space in 'target' is updated. * * Result: * Success * <Various 'Bad Form' class failures depending on class and type> * Resource Limit: Not enough space */isc_result_tdns_rdata_tostruct(dns_rdata_t *rdata, void *target, isc_mem_t *mctx);/* * Convert an rdata into its C structure representation. * * If 'mctx' is NULL then 'rdata' must persist while 'target' is being used. * * If 'mctx' is non NULL then memory will be allocated if required. * * Requires: * * 'rdata' is a valid, non-empty rdata. * * 'target' to point to a valid pointer for the type and class. * * Result: * Success * Resource Limit: Not enough memory */voiddns_rdata_freestruct(void *source);/* * Free dynamic memory attached to 'source' (if any). * * Requires: * * 'source' to point to the structure previously filled in by * dns_rdata_tostruct(). */isc_boolean_tdns_rdatatype_ismeta(dns_rdatatype_t type);/* * Return true iff the rdata type 'type' is a meta-type * like ANY or AXFR. */isc_boolean_tdns_rdatatype_issingleton(dns_rdatatype_t type);/* * Return true iff the rdata type 'type' is a singleton type, * like CNAME or SOA. * * Requires: * 'type' is a valid rdata type. * */isc_boolean_tdns_rdataclass_ismeta(dns_rdataclass_t rdclass);/* * Return true iff the rdata class 'rdclass' is a meta-class * like ANY or NONE. */isc_boolean_tdns_rdatatype_isdnssec(dns_rdatatype_t type);/* * Return true iff 'type' is one of the DNSSEC * rdata types that may exist alongside a CNAME record. * * Requires: * 'type' is a valid rdata type. */isc_boolean_tdns_rdatatype_iszonecutauth(dns_rdatatype_t type);/* * Return true iff rdata of type 'type' is considered authoritative * data (not glue) in the NSEC chain when it occurs in the parent zone * at a zone cut. * * Requires: * 'type' is a valid rdata type. * */isc_boolean_tdns_rdatatype_isknown(dns_rdatatype_t type);/* * Return true iff the rdata type 'type' is known. * * Requires: * 'type' is a valid rdata type. * */isc_result_tdns_rdata_additionaldata(dns_rdata_t *rdata, dns_additionaldatafunc_t add, void *arg);/* * Call 'add' for each name and type from 'rdata' which is subject to * additional section processing. * * Requires: * * 'rdata' is a valid, non-empty rdata. * * 'add' is a valid dns_additionalfunc_t. * * Ensures: * * If successful, then add() will have been called for each name * and type subject to additional section processing. * * If add() returns something other than ISC_R_SUCCESS, that result * will be returned as the result of dns_rdata_additionaldata(). * * Returns: * * ISC_R_SUCCESS * * Many other results are possible if not successful. */isc_result_tdns_rdata_digest(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg);/* * Send 'rdata' in DNSSEC canonical form to 'digest'. * * Note: * 'digest' may be called more than once by dns_rdata_digest(). The * concatenation of all the regions, in the order they were given * to 'digest', will be the DNSSEC canonical form of 'rdata'. * * Requires: * * 'rdata' is a valid, non-empty rdata. * * 'digest' is a valid dns_digestfunc_t. * * Ensures: * * If successful, then all of the rdata's data has been sent, in * DNSSEC canonical form, to 'digest'. * * If digest() returns something other than ISC_R_SUCCESS, that result * will be returned as the result of dns_rdata_digest(). * * Returns: * * ISC_R_SUCCESS * * Many other results are possible if not successful. */isc_boolean_tdns_rdatatype_questiononly(dns_rdatatype_t type);/* * Return true iff rdata of type 'type' can only appear in the question * section of a properly formatted message. * * Requires: * 'type' is a valid rdata type. * */isc_boolean_tdns_rdatatype_notquestion(dns_rdatatype_t type);/* * Return true iff rdata of type 'type' can not appear in the question * section of a properly formatted message. * * Requires: * 'type' is a valid rdata type. * */isc_boolean_tdns_rdatatype_atparent(dns_rdatatype_t type);/* * Return true iff rdata of type 'type' should appear at the parent of * a zone cut. * * Requires: * 'type' is a valid rdata type. * */unsigned intdns_rdatatype_attributes(dns_rdatatype_t rdtype);/* * Return attributes for the given type. * * Requires: * 'rdtype' are known. * * Returns: * a bitmask consisting of the following flags. *//* only one may exist for a name */#define DNS_RDATATYPEATTR_SINGLETON 0x00000001U/* requires no other data be present */#define DNS_RDATATYPEATTR_EXCLUSIVE 0x00000002U/* Is a meta type */#define DNS_RDATATYPEATTR_META 0x00000004U/* Is a DNSSEC type, like RRSIG or NSEC */#define DNS_RDATATYPEATTR_DNSSEC 0x00000008U/* Is a zone cut authority type */#define DNS_RDATATYPEATTR_ZONECUTAUTH 0x00000010U/* Is reserved (unusable) */#define DNS_RDATATYPEATTR_RESERVED 0x00000020U/* Is an unknown type */#define DNS_RDATATYPEATTR_UNKNOWN 0x00000040U/* Is META, and can only be in a question section */#define DNS_RDATATYPEATTR_QUESTIONONLY 0x00000080U/* is META, and can NOT be in a question section */#define DNS_RDATATYPEATTR_NOTQUESTION 0x00000100U/* Is present at zone cuts in the parent, not the child */#define DNS_RDATATYPEATTR_ATPARENT 0x00000200Udns_rdatatype_tdns_rdata_covers(dns_rdata_t *rdata);/* * Return the rdatatype that this type covers. * * Requires: * 'rdata' is a valid, non-empty rdata. * * 'rdata' is a type that covers other rdata types. * * Returns: * The type covered. */isc_boolean_tdns_rdata_checkowner(dns_name_t* name, dns_rdataclass_t rdclass, dns_rdatatype_t type, isc_boolean_t wildcard);/* * Returns whether this is a valid ownername for this <type,class>. * If wildcard is true allow the first label to be a wildcard if * appropriate. * * Requires: * 'name' is a valid name. */isc_boolean_tdns_rdata_checknames(dns_rdata_t *rdata, dns_name_t *owner, dns_name_t *bad);/* * Returns whether 'rdata' contains valid domain names. The checks are * sensitive to the owner name. * * If 'bad' is non-NULL and a domain name fails the check the * the offending name will be return in 'bad' by cloning from * the 'rdata' contents. * * Requires: * 'rdata' to be valid. * 'owner' to be valid. * 'bad' to be NULL or valid. */ISC_LANG_ENDDECLS#endif /* DNS_RDATA_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -