Go to the source code of this file.
Data Structures | |
| struct | ldns_struct_rdf |
| Resource record data. More... | |
Defines | |
| #define | LDNS_MAX_RDFLEN 65535 |
| #define | LDNS_RDF_SIZE_BYTE 1 |
| #define | LDNS_RDF_SIZE_WORD 2 |
| #define | LDNS_RDF_SIZE_DOUBLEWORD 4 |
| #define | LDNS_RDF_SIZE_6BYTES 6 |
| #define | LDNS_RDF_SIZE_16BYTES 16 |
Typedefs | |
| typedef enum ldns_enum_rdf_type | ldns_rdf_type |
| typedef enum ldns_enum_cert_algorithm | ldns_cert_algorithm |
| typedef ldns_struct_rdf | ldns_rdf |
Enumerations | |
| enum | ldns_enum_rdf_type { LDNS_RDF_TYPE_NONE, LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_INT32, LDNS_RDF_TYPE_A, LDNS_RDF_TYPE_AAAA, LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_APL, LDNS_RDF_TYPE_B64, LDNS_RDF_TYPE_HEX, LDNS_RDF_TYPE_NSEC, LDNS_RDF_TYPE_TYPE, LDNS_RDF_TYPE_CLASS, LDNS_RDF_TYPE_CERT_ALG, LDNS_RDF_TYPE_ALG, LDNS_RDF_TYPE_UNKNOWN, LDNS_RDF_TYPE_TIME, LDNS_RDF_TYPE_PERIOD, LDNS_RDF_TYPE_TSIGTIME, LDNS_RDF_TYPE_TSIG, LDNS_RDF_TYPE_INT16_DATA, LDNS_RDF_TYPE_SERVICE, LDNS_RDF_TYPE_LOC, LDNS_RDF_TYPE_WKS, LDNS_RDF_TYPE_NSAP, LDNS_RDF_TYPE_IPSECKEY } |
| The different types of RDATA fields. More... | |
| enum | ldns_enum_cert_algorithm { LDNS_CERT_PKIX = 1, LDNS_CERT_SPKI = 2, LDNS_CERT_PGP = 3, LDNS_CERT_URI = 253, LDNS_CERT_OID = 254 } |
| algorithms used in CERT rrs More... | |
Functions | |
| void | ldns_rdf_set_size (ldns_rdf *rd, size_t size) |
| sets the size of the rdf. | |
| void | ldns_rdf_set_type (ldns_rdf *rd, ldns_rdf_type type) |
| sets the size of the rdf. | |
| void | ldns_rdf_set_data (ldns_rdf *rd, void *data) |
| sets the size of the rdf. | |
| size_t | ldns_rdf_size (const ldns_rdf *rd) |
| returns the size of the rdf. | |
| ldns_rdf_type | ldns_rdf_get_type (const ldns_rdf *rd) |
| returns the type of the rdf. | |
| uint8_t * | ldns_rdf_data (const ldns_rdf *rd) |
| returns the data of the rdf. | |
| ldns_rdf * | ldns_rdf_new (ldns_rdf_type type, size_t size, void *data) |
| allocates a new rdf structure and fills it. | |
| ldns_rdf * | ldns_rdf_new_frm_data (ldns_rdf_type type, size_t size, const void *data) |
| allocates a new rdf structure and fills it. | |
| ldns_rdf * | ldns_rdf_new_frm_str (ldns_rdf_type type, const char *str) |
| creates a new rdf from a string. | |
| ldns_rdf * | ldns_rdf_new_frm_fp (ldns_rdf_type type, FILE *fp) |
| creates a new rdf from a file containing a string. | |
| ldns_rdf * | ldns_rdf_new_frm_fp_l (ldns_rdf_type type, FILE *fp, int *line_nr) |
| creates a new rdf from a file containing a string. | |
| void | ldns_rdf_free (ldns_rdf *rd) |
| frees a rdf structure, leaving the data pointer intact. | |
| void | ldns_rdf_deep_free (ldns_rdf *rd) |
| frees a rdf structure _and_ frees the data. | |
| ldns_rdf * | ldns_native2rdf_int8 (ldns_rdf_type type, uint8_t value) |
| returns the rdf containing the native uint8_t repr. | |
| ldns_rdf * | ldns_native2rdf_int16 (ldns_rdf_type type, uint16_t value) |
| returns the rdf containing the native uint16_t representation. | |
| ldns_rdf * | ldns_native2rdf_int32 (ldns_rdf_type type, uint32_t value) |
| returns an rdf that contains the given int32 value. | |
| ldns_rdf * | ldns_native2rdf_int16_data (size_t size, uint8_t *data) |
| returns an int16_data rdf that contains the data in the given array, preceded by an int16 specifying the length. | |
| ldns_rdf * | ldns_rdf_address_reverse (ldns_rdf *rd) |
| reverses an rdf, only actually useful for AAAA and A records. | |
| uint8_t | ldns_rdf2native_int8 (ldns_rdf *rd) |
| returns the native uint8_t representation from the rdf. | |
| uint16_t | ldns_rdf2native_int16 (ldns_rdf *rd) |
| returns the native uint16_t representation from the rdf. | |
| uint32_t | ldns_rdf2native_int32 (ldns_rdf *rd) |
| returns the native uint32_t representation from the rdf. | |
| time_t | ldns_rdf2native_time_t (ldns_rdf *rd) |
| returns the native time_t representation from the rdf. | |
| uint32_t | ldns_str2period (const char *nptr, const char **endptr) |
| converts a ttl value (like 5d2h) to a long. | |
| sockaddr_storage * | ldns_rdf2native_sockaddr_storage (ldns_rdf *rd, uint16_t port, size_t *size) |
| returns the native sockaddr representation from the rdf. | |
| ldns_rdf * | ldns_sockaddr_storage2rdf (struct sockaddr_storage *sock, uint16_t *port) |
| returns an rdf with the sockaddr info. | |
| ldns_status | ldns_octet (char *word, size_t *length) |
| removes \DDD, \[space] and other escapes from the input. | |
| ldns_rdf * | ldns_rdf_clone (const ldns_rdf *rd) |
| clones a rdf structure. | |
| int | ldns_rdf_compare (const ldns_rdf *rd1, const ldns_rdf *rd2) |
| compares two rdf's. | |
| typedef enum ldns_enum_cert_algorithm ldns_cert_algorithm |
| typedef struct ldns_struct_rdf ldns_rdf |
| typedef enum ldns_enum_rdf_type ldns_rdf_type |
| enum ldns_enum_rdf_type |
The different types of RDATA fields.
| ldns_rdf* ldns_native2rdf_int16 | ( | ldns_rdf_type | type, | |
| uint16_t | value | |||
| ) |
returns the rdf containing the native uint16_t representation.
| [in] | type | the ldns_rdf type to use |
| [in] | value | the uint16_t to use |
| ldns_rdf* ldns_native2rdf_int16_data | ( | size_t | size, | |
| uint8_t * | data | |||
| ) |
returns an int16_data rdf that contains the data in the given array, preceded by an int16 specifying the length.
The memory is copied, and an LDNS_RDF_TYPE_INT16DATA is returned
| [in] | size | the size of the data |
| [in] | *data | pointer to the actual data |
| ldns_rdf* ldns_native2rdf_int32 | ( | ldns_rdf_type | type, | |
| uint32_t | value | |||
| ) |
returns an rdf that contains the given int32 value.
Because multiple rdf types can contain an int32, the type must be specified
| [in] | type | the ldns_rdf type to use |
| [in] | value | the uint32_t to use |
| ldns_rdf* ldns_native2rdf_int8 | ( | ldns_rdf_type | type, | |
| uint8_t | value | |||
| ) |
returns the rdf containing the native uint8_t repr.
| [in] | type | the ldns_rdf type to use |
| [in] | value | the uint8_t to use |
| ldns_status ldns_octet | ( | char * | word, | |
| size_t * | length | |||
| ) |
removes \DDD, \[space] and other escapes from the input.
See RFC 1035, section 5.1.
| [in] | word | what to check |
| [in] | length | the string |
| uint16_t ldns_rdf2native_int16 | ( | ldns_rdf * | rd | ) |
returns the native uint16_t representation from the rdf.
| [in] | rd | the ldns_rdf to operate on |
| uint32_t ldns_rdf2native_int32 | ( | ldns_rdf * | rd | ) |
returns the native uint32_t representation from the rdf.
| [in] | rd | the ldns_rdf to operate on |
| uint8_t ldns_rdf2native_int8 | ( | ldns_rdf * | rd | ) |
returns the native uint8_t representation from the rdf.
| [in] | rd | the ldns_rdf to operate on |
| struct sockaddr_storage* ldns_rdf2native_sockaddr_storage | ( | ldns_rdf * | rd, | |
| uint16_t | port, | |||
| size_t * | size | |||
| ) |
returns the native sockaddr representation from the rdf.
| [in] | rd | the ldns_rdf to operate on |
| [in] | port | what port to use. 0 means; use default (53) |
| [out] | size | what is the size of the sockaddr_storage |
| time_t ldns_rdf2native_time_t | ( | ldns_rdf * | rd | ) |
returns the native time_t representation from the rdf.
| [in] | rd | the ldns_rdf to operate on |
reverses an rdf, only actually useful for AAAA and A records.
The returned rdf has the type LDNS_RDF_TYPE_DNAME!
| [in] | *rd | rdf to be reversed |
clones a rdf structure.
The data is copied.
| [in] | rd | rdf to be copied |
compares two rdf's.
Order is canonical.
| [in] | rd1 | the first one |
| [in] | rd2 | the second one |
-1 if rd1 comes before rd2
+1 if rd2 comes before rd1
| uint8_t* ldns_rdf_data | ( | const ldns_rdf * | rd | ) |
returns the data of the rdf.
| [in] | *rd | the rdf to read from |
| void ldns_rdf_deep_free | ( | ldns_rdf * | rd | ) |
frees a rdf structure _and_ frees the data.
rdf should be created with _new_frm_data
| [in] | rd | the rdf structure to be freed |
| void ldns_rdf_free | ( | ldns_rdf * | rd | ) |
frees a rdf structure, leaving the data pointer intact.
| [in] | rd | the pointer to be freed |
| ldns_rdf_type ldns_rdf_get_type | ( | const ldns_rdf * | rd | ) |
returns the type of the rdf.
We need to insert _get_ here to prevent conflict the the rdf_type TYPE.
| [in] | *rd | the rdf to read from |
| ldns_rdf* ldns_rdf_new | ( | ldns_rdf_type | type, | |
| size_t | size, | |||
| void * | data | |||
| ) |
allocates a new rdf structure and fills it.
This function DOES NOT copy the contents from the buffer, unlinke ldns_rdf_new_frm_data()
| [in] | type | type of the rdf |
| [in] | size | size of the buffer |
| [in] | data | pointer to the buffer to be copied |
| ldns_rdf* ldns_rdf_new_frm_data | ( | ldns_rdf_type | type, | |
| size_t | size, | |||
| const void * | data | |||
| ) |
allocates a new rdf structure and fills it.
This function _does_ copy the contents from the buffer, unlinke ldns_rdf_new()
| [in] | type | type of the rdf |
| [in] | size | size of the buffer |
| [in] | data | pointer to the buffer to be copied |
| ldns_rdf* ldns_rdf_new_frm_fp | ( | ldns_rdf_type | type, | |
| FILE * | fp | |||
| ) |
creates a new rdf from a file containing a string.
| [in] | type | type to use |
| [in] | fp | the file pointer to use |
| ldns_rdf* ldns_rdf_new_frm_fp_l | ( | ldns_rdf_type | type, | |
| FILE * | fp, | |||
| int * | line_nr | |||
| ) |
creates a new rdf from a file containing a string.
| [in] | type | type to use |
| [in] | fp | the file pointer to use |
| [in] | line_nr | pointer to an integer containing the current line number (for debugging purposes) |
| ldns_rdf* ldns_rdf_new_frm_str | ( | ldns_rdf_type | type, | |
| const char * | str | |||
| ) |
creates a new rdf from a string.
| [in] | type | type to use |
| [in] | str | string to use |
| void ldns_rdf_set_data | ( | ldns_rdf * | rd, | |
| void * | data | |||
| ) |
sets the size of the rdf.
| [in] | *rd | the rdf to operate on |
| [in] | data* | pointer to the new data |
| void ldns_rdf_set_size | ( | ldns_rdf * | rd, | |
| size_t | size | |||
| ) |
sets the size of the rdf.
| [in] | *rd | the rdf to operate on |
| [in] | size | the new size |
| void ldns_rdf_set_type | ( | ldns_rdf * | rd, | |
| ldns_rdf_type | type | |||
| ) |
sets the size of the rdf.
| [in] | *rd | the rdf to operate on |
| [in] | type | the new type |
| size_t ldns_rdf_size | ( | const ldns_rdf * | rd | ) |
returns the size of the rdf.
| [in] | *rd | the rdf to read from |
| ldns_rdf* ldns_sockaddr_storage2rdf | ( | struct sockaddr_storage * | sock, | |
| uint16_t * | port | |||
| ) |
returns an rdf with the sockaddr info.
works for ip4 and ip6
| [in] | sock | the struct sockaddr_storage to convert |
| [in] | port | what port was used. When NULL this is not set |
| uint32_t ldns_str2period | ( | const char * | nptr, | |
| const char ** | endptr | |||
| ) |
converts a ttl value (like 5d2h) to a long.
| [in] | nptr | the start of the string |
| [out] | endptr | points to the last char in case of error |
1.5.1