gnsrecord plugin to provide the API for basic DNS records More...
Go to the source code of this file.
Functions | |
static char * | dns_value_to_string (void *cls, uint32_t type, const void *data, size_t data_size) |
Convert the 'value' of a record to a string. More... | |
static unsigned int | rfc4398_mnemonic_to_value (const char *mnemonic) |
Convert RFC 4394 Mnemonics to the corresponding integer values. More... | |
static unsigned int | rfc4034_mnemonic_to_value (const char *mnemonic) |
Convert RFC 4034 algorithm types to the corresponding integer values. More... | |
static int | dns_string_to_value (void *cls, uint32_t type, const char *s, void **data, size_t *data_size) |
Convert human-readable version of a 'value' of a record to the binary representation. More... | |
static uint32_t | dns_typename_to_number (void *cls, const char *dns_typename) |
Convert a type name (e.g. More... | |
static const char * | dns_number_to_typename (void *cls, uint32_t type) |
Convert a type number to the corresponding type string (e.g. More... | |
static enum GNUNET_GenericReturnValue | dns_is_critical (void *cls, uint32_t type) |
void * | libgnunet_plugin_gnsrecord_dns_init (void *cls) |
Entry point for the plugin. More... | |
void * | libgnunet_plugin_gnsrecord_dns_done (void *cls) |
Exit point from the plugin. More... | |
Variables | |
struct { | |
const char * name | |
uint32_t number | |
} | name_map [] |
Mapping of record type numbers to human-readable record type names. More... | |
gnsrecord plugin to provide the API for basic DNS records
Definition in file plugin_gnsrecord_dns.c.
|
static |
Convert the 'value' of a record to a string.
cls | closure, unused |
type | type of the record |
data | value in binary encoding |
data_size | number of bytes in data |
Definition at line 41 of file plugin_gnsrecord_dns.c.
References GNUNET_DNSPARSER_CertRecord::algorithm, GNUNET_DNSPARSER_CertRecord::cert_tag, GNUNET_DNSPARSER_CertRecord::cert_type, GNUNET_DNSPARSER_CertRecord::certificate_data, GNUNET_DNSPARSER_CertRecord::certificate_size, data, data_size, GNUNET_DNSPARSER_SoaRecord::expire, GNUNET_DNSPARSER_CaaRecord::flags, GNUNET_asprintf(), GNUNET_break_op, GNUNET_DNSPARSER_bin_to_hex(), GNUNET_DNSPARSER_free_cert(), GNUNET_DNSPARSER_free_mx(), GNUNET_DNSPARSER_free_soa(), GNUNET_DNSPARSER_free_srv(), GNUNET_DNSPARSER_free_uri(), GNUNET_DNSPARSER_parse_cert(), GNUNET_DNSPARSER_parse_mx(), GNUNET_DNSPARSER_parse_name(), GNUNET_DNSPARSER_parse_soa(), GNUNET_DNSPARSER_parse_srv(), GNUNET_DNSPARSER_parse_uri(), GNUNET_DNSPARSER_TYPE_A, GNUNET_DNSPARSER_TYPE_AAAA, GNUNET_DNSPARSER_TYPE_CAA, GNUNET_DNSPARSER_TYPE_CERT, GNUNET_DNSPARSER_TYPE_CNAME, GNUNET_DNSPARSER_TYPE_MX, GNUNET_DNSPARSER_TYPE_NS, GNUNET_DNSPARSER_TYPE_PTR, GNUNET_DNSPARSER_TYPE_SMIMEA, GNUNET_DNSPARSER_TYPE_SOA, GNUNET_DNSPARSER_TYPE_SRV, GNUNET_DNSPARSER_TYPE_TLSA, GNUNET_DNSPARSER_TYPE_TXT, GNUNET_DNSPARSER_TYPE_URI, GNUNET_free, GNUNET_strdup, GNUNET_STRINGS_base64_encode(), GNUNET_strndup, GNUNET_TUN_DnsTlsaRecord::matching_type, GNUNET_DNSPARSER_SoaRecord::minimum_ttl, GNUNET_DNSPARSER_SoaRecord::mname, GNUNET_DNSPARSER_MxRecord::mxhost, ns, GNUNET_DNSPARSER_SrvRecord::port, GNUNET_DNSPARSER_MxRecord::preference, GNUNET_DNSPARSER_SrvRecord::priority, GNUNET_DNSPARSER_SoaRecord::refresh, result, GNUNET_DNSPARSER_SoaRecord::retry, GNUNET_DNSPARSER_SoaRecord::rname, GNUNET_TUN_DnsTlsaRecord::selector, GNUNET_DNSPARSER_SoaRecord::serial, GNUNET_DNSPARSER_CaaRecord::tag_len, GNUNET_DNSPARSER_SrvRecord::target, type, uri, GNUNET_TUN_DnsTlsaRecord::usage, value, and GNUNET_DNSPARSER_SrvRecord::weight.
Referenced by libgnunet_plugin_gnsrecord_dns_init().
|
static |
Convert RFC 4394 Mnemonics to the corresponding integer values.
mnemonic | string to look up |
Definition at line 302 of file plugin_gnsrecord_dns.c.
References table.
Referenced by dns_string_to_value().
|
static |
Convert RFC 4034 algorithm types to the corresponding integer values.
mnemonic | string to look up |
Definition at line 335 of file plugin_gnsrecord_dns.c.
References table.
Referenced by dns_string_to_value().
|
static |
Convert human-readable version of a 'value' of a record to the binary representation.
cls | closure, unused |
type | type of the record |
s | human-readable string |
data | set to value in binary encoding (will be allocated) |
data_size | set to number of bytes in data |
Definition at line 371 of file plugin_gnsrecord_dns.c.
References _, GNUNET_DNSPARSER_CertRecord::algorithm, GNUNET_DNSPARSER_CertRecord::cert_tag, GNUNET_DNSPARSER_CertRecord::cert_type, GNUNET_DNSPARSER_CertRecord::certificate_data, GNUNET_DNSPARSER_CertRecord::certificate_size, data, data_size, GNUNET_DNSPARSER_SoaRecord::expire, GNUNET_DNSPARSER_CaaRecord::flags, GNUNET_DNSPARSER_builder_add_cert(), GNUNET_DNSPARSER_builder_add_mx(), GNUNET_DNSPARSER_builder_add_name(), GNUNET_DNSPARSER_builder_add_soa(), GNUNET_DNSPARSER_builder_add_srv(), GNUNET_DNSPARSER_builder_add_uri(), GNUNET_DNSPARSER_hex_to_bin(), GNUNET_DNSPARSER_TYPE_A, GNUNET_DNSPARSER_TYPE_AAAA, GNUNET_DNSPARSER_TYPE_CAA, GNUNET_DNSPARSER_TYPE_CERT, GNUNET_DNSPARSER_TYPE_CNAME, GNUNET_DNSPARSER_TYPE_MX, GNUNET_DNSPARSER_TYPE_NS, GNUNET_DNSPARSER_TYPE_PTR, GNUNET_DNSPARSER_TYPE_SMIMEA, GNUNET_DNSPARSER_TYPE_SOA, GNUNET_DNSPARSER_TYPE_SRV, GNUNET_DNSPARSER_TYPE_TLSA, GNUNET_DNSPARSER_TYPE_TXT, GNUNET_DNSPARSER_TYPE_URI, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_malloc, GNUNET_memcpy, GNUNET_new, GNUNET_OK, GNUNET_strdup, GNUNET_STRINGS_base64_decode(), GNUNET_SYSERR, key, GNUNET_TUN_DnsTlsaRecord::matching_type, GNUNET_DNSPARSER_SoaRecord::minimum_ttl, GNUNET_DNSPARSER_SoaRecord::mname, GNUNET_DNSPARSER_MxRecord::mxhost, GNUNET_DNSPARSER_SrvRecord::port, port, GNUNET_DNSPARSER_MxRecord::preference, GNUNET_DNSPARSER_SrvRecord::priority, GNUNET_DNSPARSER_UriRecord::priority, GNUNET_DNSPARSER_SoaRecord::refresh, GNUNET_DNSPARSER_SoaRecord::retry, rfc4034_mnemonic_to_value(), rfc4398_mnemonic_to_value(), GNUNET_DNSPARSER_SoaRecord::rname, GNUNET_TUN_DnsTlsaRecord::selector, GNUNET_DNSPARSER_SoaRecord::serial, GNUNET_DNSPARSER_CaaRecord::tag_len, GNUNET_DNSPARSER_SrvRecord::target, GNUNET_DNSPARSER_UriRecord::target, type, uri, gnunet-chk::usage(), GNUNET_TUN_DnsTlsaRecord::usage, value, GNUNET_DNSPARSER_SrvRecord::weight, and GNUNET_DNSPARSER_UriRecord::weight.
Referenced by libgnunet_plugin_gnsrecord_dns_init().
|
static |
Convert a type name (e.g.
"AAAA") to the corresponding number.
cls | closure, unused |
dns_typename | name to convert |
Definition at line 822 of file plugin_gnsrecord_dns.c.
References name, and name_map.
Referenced by libgnunet_plugin_gnsrecord_dns_init().
|
static |
Convert a type number to the corresponding type string (e.g.
1 to "A")
cls | closure, unused |
type | number of a type to convert |
Definition at line 842 of file plugin_gnsrecord_dns.c.
References name, name_map, number, and type.
Referenced by libgnunet_plugin_gnsrecord_dns_init().
|
static |
Definition at line 854 of file plugin_gnsrecord_dns.c.
References GNUNET_NO.
Referenced by libgnunet_plugin_gnsrecord_dns_init().
void * libgnunet_plugin_gnsrecord_dns_init | ( | void * | cls | ) |
Entry point for the plugin.
cls | NULL |
Definition at line 870 of file plugin_gnsrecord_dns.c.
References dns_is_critical(), dns_number_to_typename(), dns_string_to_value(), dns_typename_to_number(), dns_value_to_string(), GNUNET_new, GNUNET_GNSRECORD_PluginFunctions::is_critical, GNUNET_GNSRECORD_PluginFunctions::number_to_typename, GNUNET_GNSRECORD_PluginFunctions::string_to_value, GNUNET_GNSRECORD_PluginFunctions::typename_to_number, and GNUNET_GNSRECORD_PluginFunctions::value_to_string.
void * libgnunet_plugin_gnsrecord_dns_done | ( | void * | cls | ) |
Exit point from the plugin.
cls | the return value from libgnunet_plugin_block_test_init |
Definition at line 894 of file plugin_gnsrecord_dns.c.
References GNUNET_GNSRECORD_PluginFunctions::cls, and GNUNET_free.
const char* name |
Definition at line 795 of file plugin_gnsrecord_dns.c.
Referenced by dns_number_to_typename(), and dns_typename_to_number().
uint32_t number |
Definition at line 796 of file plugin_gnsrecord_dns.c.
Referenced by dns_number_to_typename().
struct { ... } name_map[] |
Mapping of record type numbers to human-readable record type names.
Referenced by dns_number_to_typename(), and dns_typename_to_number().