diff options
author | Riccardo Spagni <ric@spagni.net> | 2014-12-04 23:10:49 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2014-12-04 23:10:49 +0200 |
commit | 831933425b3406310e70476dc56e822f7ae3c549 (patch) | |
tree | bd05c1b54f8cff8ef0bc1f769a22232172ec2a96 /external/unbound/dnstap | |
parent | increased version number for tagged release (diff) | |
download | monero-831933425b3406310e70476dc56e822f7ae3c549.tar.xz |
update unbound from upstream
Diffstat (limited to 'external/unbound/dnstap')
-rw-r--r-- | external/unbound/dnstap/dnstap.c | 49 | ||||
-rw-r--r-- | external/unbound/dnstap/dnstap.h | 8 | ||||
-rw-r--r-- | external/unbound/dnstap/dnstap.m4 | 12 | ||||
-rw-r--r-- | external/unbound/dnstap/dnstap.pb-c.c | 518 | ||||
-rw-r--r-- | external/unbound/dnstap/dnstap.pb-c.h | 158 |
5 files changed, 40 insertions, 705 deletions
diff --git a/external/unbound/dnstap/dnstap.c b/external/unbound/dnstap/dnstap.c index d999ffd50..b2dc053bd 100644 --- a/external/unbound/dnstap/dnstap.c +++ b/external/unbound/dnstap/dnstap.c @@ -37,6 +37,7 @@ #ifdef USE_DNSTAP #include "config.h" +#include <string.h> #include <sys/time.h> #include "ldns/sbuffer.h" #include "util/config_file.h" @@ -65,6 +66,7 @@ dt_pack(const Dnstap__Dnstap *d, void **buf, size_t *sz) { ProtobufCBufferSimple sbuf; + memset(&sbuf, 0, sizeof(sbuf)); sbuf.base.append = protobuf_c_buffer_simple_append; sbuf.len = 0; sbuf.alloced = DNSTAP_INITIAL_BUF_SIZE; @@ -87,9 +89,9 @@ dt_send(const struct dt_env *env, void *buf, size_t len_buf) fstrm_res res; if (!buf) return; - res = fstrm_io_submit(env->fio, env->fq, buf, len_buf, - fstrm_free_wrapper, NULL); - if (res != FSTRM_RES_SUCCESS) + res = fstrm_iothr_submit(env->iothr, env->ioq, buf, len_buf, + fstrm_free_wrapper, NULL); + if (res != fstrm_res_success) free(buf); } @@ -119,10 +121,12 @@ dt_msg_init(const struct dt_env *env, struct dt_env * dt_create(const char *socket_path, unsigned num_workers) { - char *fio_err; + fstrm_res res; struct dt_env *env; - struct fstrm_io_options *fopt; + struct fstrm_iothr_options *fopt; struct fstrm_unix_writer_options *fuwopt; + struct fstrm_writer *fw; + struct fstrm_writer_options *fwopt; verbose(VERB_OPS, "opening dnstap socket %s", socket_path); log_assert(socket_path != NULL); @@ -132,24 +136,29 @@ dt_create(const char *socket_path, unsigned num_workers) if (!env) return NULL; + fwopt = fstrm_writer_options_init(); + res = fstrm_writer_options_add_content_type(fwopt, + DNSTAP_CONTENT_TYPE, sizeof(DNSTAP_CONTENT_TYPE) - 1); + log_assert(res == fstrm_res_success); + fuwopt = fstrm_unix_writer_options_init(); fstrm_unix_writer_options_set_socket_path(fuwopt, socket_path); - fopt = fstrm_io_options_init(); - fstrm_io_options_set_content_type(fopt, - DNSTAP_CONTENT_TYPE, - sizeof(DNSTAP_CONTENT_TYPE) - 1); - fstrm_io_options_set_num_queues(fopt, num_workers); - fstrm_io_options_set_writer(fopt, fstrm_unix_writer, fuwopt); - env->fio = fstrm_io_init(fopt, &fio_err); - if (env->fio == NULL) { - verbose(VERB_DETAIL, "dt_create: fstrm_io_init() failed: %s", - fio_err); - free(fio_err); + + fw = fstrm_unix_writer_init(fuwopt, fwopt); + log_assert(fw != NULL); + + fopt = fstrm_iothr_options_init(); + fstrm_iothr_options_set_num_input_queues(fopt, num_workers); + env->iothr = fstrm_iothr_init(fopt, &fw); + if (env->iothr == NULL) { + verbose(VERB_DETAIL, "dt_create: fstrm_iothr_init() failed"); + fstrm_writer_destroy(&fw); free(env); env = NULL; } - fstrm_io_options_destroy(&fopt); + fstrm_iothr_options_destroy(&fopt); fstrm_unix_writer_options_destroy(&fuwopt); + fstrm_writer_options_destroy(&fwopt); return env; } @@ -238,8 +247,8 @@ dt_apply_cfg(struct dt_env *env, struct config_file *cfg) int dt_init(struct dt_env *env) { - env->fq = fstrm_io_get_queue(env->fio); - if (env->fq == NULL) + env->ioq = fstrm_iothr_get_input_queue(env->iothr); + if (env->ioq == NULL) return 0; return 1; } @@ -250,7 +259,7 @@ dt_delete(struct dt_env *env) if (!env) return; verbose(VERB_OPS, "closing dnstap socket"); - fstrm_io_destroy(&env->fio); + fstrm_iothr_destroy(&env->iothr); free(env->identity); free(env->version); free(env); diff --git a/external/unbound/dnstap/dnstap.h b/external/unbound/dnstap/dnstap.h index d9121df7d..0103c1c0e 100644 --- a/external/unbound/dnstap/dnstap.h +++ b/external/unbound/dnstap/dnstap.h @@ -45,11 +45,11 @@ struct fstrm_queue; struct sldns_buffer; struct dt_env { - /** dnstap I/O socket */ - struct fstrm_io *fio; + /** dnstap I/O thread */ + struct fstrm_iothr *iothr; - /** dnstap I/O queue */ - struct fstrm_queue *fq; + /** dnstap I/O thread input queue */ + struct fstrm_iothr_queue *ioq; /** dnstap "identity" field, NULL if disabled */ char *identity; diff --git a/external/unbound/dnstap/dnstap.m4 b/external/unbound/dnstap/dnstap.m4 index de63256dc..5b78b3e26 100644 --- a/external/unbound/dnstap/dnstap.m4 +++ b/external/unbound/dnstap/dnstap.m4 @@ -22,7 +22,7 @@ AC_DEFUN([dt_DNSTAP], fi AC_ARG_WITH([protobuf-c], AC_HELP_STRING([--with-protobuf-c=path], [Path where protobuf-c is installed, for dnstap]), [ - # workaround for protobuf includes at old dir before protobuf-1.0.0 + # workaround for protobuf-c includes at old dir before protobuf-c-1.0.0 if test -f $withval/include/google/protobuf-c/protobuf-c.h; then CFLAGS="$CFLAGS -I$withval/include/google" else @@ -30,7 +30,7 @@ AC_DEFUN([dt_DNSTAP], fi LDFLAGS="$LDFLAGS -L$withval/lib" ], [ - # workaround for protobuf includes at old dir before protobuf-1.0.0 + # workaround for protobuf-c includes at old dir before protobuf-c-1.0.0 if test -f /usr/include/google/protobuf-c/protobuf-c.h; then CFLAGS="$CFLAGS -I/usr/include/google" else @@ -41,12 +41,14 @@ AC_DEFUN([dt_DNSTAP], fi ]) AC_ARG_WITH([libfstrm], AC_HELP_STRING([--with-libfstrm=path], - [Path where libfstrm in installed, for dnstap]), [ + [Path where libfstrm is installed, for dnstap]), [ CFLAGS="$CFLAGS -I$withval/include" LDFLAGS="$LDFLAGS -L$withval/lib" ]) - AC_SEARCH_LIBS([fstrm_io_init], [fstrm]) - AC_SEARCH_LIBS([protobuf_c_message_pack], [protobuf-c]) + AC_SEARCH_LIBS([fstrm_iothr_init], [fstrm], [], + AC_MSG_ERROR([The fstrm library was not found. Please install fstrm!])) + AC_SEARCH_LIBS([protobuf_c_message_pack], [protobuf-c], [], + AC_MSG_ERROR([The protobuf-c library was not found. Please install protobuf-c!])) $2 else $3 diff --git a/external/unbound/dnstap/dnstap.pb-c.c b/external/unbound/dnstap/dnstap.pb-c.c deleted file mode 100644 index 51100eb56..000000000 --- a/external/unbound/dnstap/dnstap.pb-c.c +++ /dev/null @@ -1,518 +0,0 @@ -/* Generated by the protocol buffer compiler. DO NOT EDIT! */ - -/* Do not generate deprecated warnings for self */ -#ifndef PROTOBUF_C_NO_DEPRECATED -#define PROTOBUF_C_NO_DEPRECATED -#endif - -#include "dnstap/dnstap.pb-c.h" -void dnstap__dnstap__init - (Dnstap__Dnstap *message) -{ - static Dnstap__Dnstap init_value = DNSTAP__DNSTAP__INIT; - *message = init_value; -} -size_t dnstap__dnstap__get_packed_size - (const Dnstap__Dnstap *message) -{ - PROTOBUF_C_ASSERT (message->base.descriptor == &dnstap__dnstap__descriptor); - return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); -} -size_t dnstap__dnstap__pack - (const Dnstap__Dnstap *message, - uint8_t *out) -{ - PROTOBUF_C_ASSERT (message->base.descriptor == &dnstap__dnstap__descriptor); - return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); -} -size_t dnstap__dnstap__pack_to_buffer - (const Dnstap__Dnstap *message, - ProtobufCBuffer *buffer) -{ - PROTOBUF_C_ASSERT (message->base.descriptor == &dnstap__dnstap__descriptor); - return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); -} -Dnstap__Dnstap * - dnstap__dnstap__unpack - (ProtobufCAllocator *allocator, - size_t len, - const uint8_t *data) -{ - return (Dnstap__Dnstap *) - protobuf_c_message_unpack (&dnstap__dnstap__descriptor, - allocator, len, data); -} -void dnstap__dnstap__free_unpacked - (Dnstap__Dnstap *message, - ProtobufCAllocator *allocator) -{ - PROTOBUF_C_ASSERT (message->base.descriptor == &dnstap__dnstap__descriptor); - protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); -} -void dnstap__message__init - (Dnstap__Message *message) -{ - static Dnstap__Message init_value = DNSTAP__MESSAGE__INIT; - *message = init_value; -} -size_t dnstap__message__get_packed_size - (const Dnstap__Message *message) -{ - PROTOBUF_C_ASSERT (message->base.descriptor == &dnstap__message__descriptor); - return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); -} -size_t dnstap__message__pack - (const Dnstap__Message *message, - uint8_t *out) -{ - PROTOBUF_C_ASSERT (message->base.descriptor == &dnstap__message__descriptor); - return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); -} -size_t dnstap__message__pack_to_buffer - (const Dnstap__Message *message, - ProtobufCBuffer *buffer) -{ - PROTOBUF_C_ASSERT (message->base.descriptor == &dnstap__message__descriptor); - return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); -} -Dnstap__Message * - dnstap__message__unpack - (ProtobufCAllocator *allocator, - size_t len, - const uint8_t *data) -{ - return (Dnstap__Message *) - protobuf_c_message_unpack (&dnstap__message__descriptor, - allocator, len, data); -} -void dnstap__message__free_unpacked - (Dnstap__Message *message, - ProtobufCAllocator *allocator) -{ - PROTOBUF_C_ASSERT (message->base.descriptor == &dnstap__message__descriptor); - protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); -} -const ProtobufCEnumValue dnstap__dnstap__type__enum_values_by_number[1] = -{ - { "MESSAGE", "DNSTAP__DNSTAP__TYPE__MESSAGE", 1 }, -}; -static const ProtobufCIntRange dnstap__dnstap__type__value_ranges[] = { -{1, 0},{0, 1} -}; -const ProtobufCEnumValueIndex dnstap__dnstap__type__enum_values_by_name[1] = -{ - { "MESSAGE", 0 }, -}; -const ProtobufCEnumDescriptor dnstap__dnstap__type__descriptor = -{ - PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC, - "dnstap.Dnstap.Type", - "Type", - "Dnstap__Dnstap__Type", - "dnstap", - 1, - dnstap__dnstap__type__enum_values_by_number, - 1, - dnstap__dnstap__type__enum_values_by_name, - 1, - dnstap__dnstap__type__value_ranges, - NULL,NULL,NULL,NULL /* reserved[1234] */ -}; -static const ProtobufCFieldDescriptor dnstap__dnstap__field_descriptors[5] = -{ - { - "identity", - 1, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_BYTES, - PROTOBUF_C_OFFSETOF(Dnstap__Dnstap, has_identity), - PROTOBUF_C_OFFSETOF(Dnstap__Dnstap, identity), - NULL, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "version", - 2, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_BYTES, - PROTOBUF_C_OFFSETOF(Dnstap__Dnstap, has_version), - PROTOBUF_C_OFFSETOF(Dnstap__Dnstap, version), - NULL, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "extra", - 3, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_BYTES, - PROTOBUF_C_OFFSETOF(Dnstap__Dnstap, has_extra), - PROTOBUF_C_OFFSETOF(Dnstap__Dnstap, extra), - NULL, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "message", - 14, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - PROTOBUF_C_OFFSETOF(Dnstap__Dnstap, message), - &dnstap__message__descriptor, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "type", - 15, - PROTOBUF_C_LABEL_REQUIRED, - PROTOBUF_C_TYPE_ENUM, - 0, /* quantifier_offset */ - PROTOBUF_C_OFFSETOF(Dnstap__Dnstap, type), - &dnstap__dnstap__type__descriptor, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned dnstap__dnstap__field_indices_by_name[] = { - 2, /* field[2] = extra */ - 0, /* field[0] = identity */ - 3, /* field[3] = message */ - 4, /* field[4] = type */ - 1, /* field[1] = version */ -}; -static const ProtobufCIntRange dnstap__dnstap__number_ranges[2 + 1] = -{ - { 1, 0 }, - { 14, 3 }, - { 0, 5 } -}; -const ProtobufCMessageDescriptor dnstap__dnstap__descriptor = -{ - PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, - "dnstap.Dnstap", - "Dnstap", - "Dnstap__Dnstap", - "dnstap", - sizeof(Dnstap__Dnstap), - 5, - dnstap__dnstap__field_descriptors, - dnstap__dnstap__field_indices_by_name, - 2, dnstap__dnstap__number_ranges, - (ProtobufCMessageInit) dnstap__dnstap__init, - NULL,NULL,NULL /* reserved[123] */ -}; -const ProtobufCEnumValue dnstap__message__type__enum_values_by_number[10] = -{ - { "AUTH_QUERY", "DNSTAP__MESSAGE__TYPE__AUTH_QUERY", 1 }, - { "AUTH_RESPONSE", "DNSTAP__MESSAGE__TYPE__AUTH_RESPONSE", 2 }, - { "RESOLVER_QUERY", "DNSTAP__MESSAGE__TYPE__RESOLVER_QUERY", 3 }, - { "RESOLVER_RESPONSE", "DNSTAP__MESSAGE__TYPE__RESOLVER_RESPONSE", 4 }, - { "CLIENT_QUERY", "DNSTAP__MESSAGE__TYPE__CLIENT_QUERY", 5 }, - { "CLIENT_RESPONSE", "DNSTAP__MESSAGE__TYPE__CLIENT_RESPONSE", 6 }, - { "FORWARDER_QUERY", "DNSTAP__MESSAGE__TYPE__FORWARDER_QUERY", 7 }, - { "FORWARDER_RESPONSE", "DNSTAP__MESSAGE__TYPE__FORWARDER_RESPONSE", 8 }, - { "STUB_QUERY", "DNSTAP__MESSAGE__TYPE__STUB_QUERY", 9 }, - { "STUB_RESPONSE", "DNSTAP__MESSAGE__TYPE__STUB_RESPONSE", 10 }, -}; -static const ProtobufCIntRange dnstap__message__type__value_ranges[] = { -{1, 0},{0, 10} -}; -const ProtobufCEnumValueIndex dnstap__message__type__enum_values_by_name[10] = -{ - { "AUTH_QUERY", 0 }, - { "AUTH_RESPONSE", 1 }, - { "CLIENT_QUERY", 4 }, - { "CLIENT_RESPONSE", 5 }, - { "FORWARDER_QUERY", 6 }, - { "FORWARDER_RESPONSE", 7 }, - { "RESOLVER_QUERY", 2 }, - { "RESOLVER_RESPONSE", 3 }, - { "STUB_QUERY", 8 }, - { "STUB_RESPONSE", 9 }, -}; -const ProtobufCEnumDescriptor dnstap__message__type__descriptor = -{ - PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC, - "dnstap.Message.Type", - "Type", - "Dnstap__Message__Type", - "dnstap", - 10, - dnstap__message__type__enum_values_by_number, - 10, - dnstap__message__type__enum_values_by_name, - 1, - dnstap__message__type__value_ranges, - NULL,NULL,NULL,NULL /* reserved[1234] */ -}; -static const ProtobufCFieldDescriptor dnstap__message__field_descriptors[14] = -{ - { - "type", - 1, - PROTOBUF_C_LABEL_REQUIRED, - PROTOBUF_C_TYPE_ENUM, - 0, /* quantifier_offset */ - PROTOBUF_C_OFFSETOF(Dnstap__Message, type), - &dnstap__message__type__descriptor, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "socket_family", - 2, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_ENUM, - PROTOBUF_C_OFFSETOF(Dnstap__Message, has_socket_family), - PROTOBUF_C_OFFSETOF(Dnstap__Message, socket_family), - &dnstap__socket_family__descriptor, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "socket_protocol", - 3, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_ENUM, - PROTOBUF_C_OFFSETOF(Dnstap__Message, has_socket_protocol), - PROTOBUF_C_OFFSETOF(Dnstap__Message, socket_protocol), - &dnstap__socket_protocol__descriptor, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "query_address", - 4, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_BYTES, - PROTOBUF_C_OFFSETOF(Dnstap__Message, has_query_address), - PROTOBUF_C_OFFSETOF(Dnstap__Message, query_address), - NULL, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "response_address", - 5, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_BYTES, - PROTOBUF_C_OFFSETOF(Dnstap__Message, has_response_address), - PROTOBUF_C_OFFSETOF(Dnstap__Message, response_address), - NULL, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "query_port", - 6, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, - PROTOBUF_C_OFFSETOF(Dnstap__Message, has_query_port), - PROTOBUF_C_OFFSETOF(Dnstap__Message, query_port), - NULL, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "response_port", - 7, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, - PROTOBUF_C_OFFSETOF(Dnstap__Message, has_response_port), - PROTOBUF_C_OFFSETOF(Dnstap__Message, response_port), - NULL, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "query_time_sec", - 8, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT64, - PROTOBUF_C_OFFSETOF(Dnstap__Message, has_query_time_sec), - PROTOBUF_C_OFFSETOF(Dnstap__Message, query_time_sec), - NULL, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "query_time_nsec", - 9, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_FIXED32, - PROTOBUF_C_OFFSETOF(Dnstap__Message, has_query_time_nsec), - PROTOBUF_C_OFFSETOF(Dnstap__Message, query_time_nsec), - NULL, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "query_message", - 10, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_BYTES, - PROTOBUF_C_OFFSETOF(Dnstap__Message, has_query_message), - PROTOBUF_C_OFFSETOF(Dnstap__Message, query_message), - NULL, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "query_zone", - 11, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_BYTES, - PROTOBUF_C_OFFSETOF(Dnstap__Message, has_query_zone), - PROTOBUF_C_OFFSETOF(Dnstap__Message, query_zone), - NULL, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "response_time_sec", - 12, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT64, - PROTOBUF_C_OFFSETOF(Dnstap__Message, has_response_time_sec), - PROTOBUF_C_OFFSETOF(Dnstap__Message, response_time_sec), - NULL, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "response_time_nsec", - 13, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_FIXED32, - PROTOBUF_C_OFFSETOF(Dnstap__Message, has_response_time_nsec), - PROTOBUF_C_OFFSETOF(Dnstap__Message, response_time_nsec), - NULL, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "response_message", - 14, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_BYTES, - PROTOBUF_C_OFFSETOF(Dnstap__Message, has_response_message), - PROTOBUF_C_OFFSETOF(Dnstap__Message, response_message), - NULL, - NULL, - 0, /* packed */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned dnstap__message__field_indices_by_name[] = { - 3, /* field[3] = query_address */ - 9, /* field[9] = query_message */ - 5, /* field[5] = query_port */ - 8, /* field[8] = query_time_nsec */ - 7, /* field[7] = query_time_sec */ - 10, /* field[10] = query_zone */ - 4, /* field[4] = response_address */ - 13, /* field[13] = response_message */ - 6, /* field[6] = response_port */ - 12, /* field[12] = response_time_nsec */ - 11, /* field[11] = response_time_sec */ - 1, /* field[1] = socket_family */ - 2, /* field[2] = socket_protocol */ - 0, /* field[0] = type */ -}; -static const ProtobufCIntRange dnstap__message__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 14 } -}; -const ProtobufCMessageDescriptor dnstap__message__descriptor = -{ - PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, - "dnstap.Message", - "Message", - "Dnstap__Message", - "dnstap", - sizeof(Dnstap__Message), - 14, - dnstap__message__field_descriptors, - dnstap__message__field_indices_by_name, - 1, dnstap__message__number_ranges, - (ProtobufCMessageInit) dnstap__message__init, - NULL,NULL,NULL /* reserved[123] */ -}; -const ProtobufCEnumValue dnstap__socket_family__enum_values_by_number[2] = -{ - { "INET", "DNSTAP__SOCKET_FAMILY__INET", 1 }, - { "INET6", "DNSTAP__SOCKET_FAMILY__INET6", 2 }, -}; -static const ProtobufCIntRange dnstap__socket_family__value_ranges[] = { -{1, 0},{0, 2} -}; -const ProtobufCEnumValueIndex dnstap__socket_family__enum_values_by_name[2] = -{ - { "INET", 0 }, - { "INET6", 1 }, -}; -const ProtobufCEnumDescriptor dnstap__socket_family__descriptor = -{ - PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC, - "dnstap.SocketFamily", - "SocketFamily", - "Dnstap__SocketFamily", - "dnstap", - 2, - dnstap__socket_family__enum_values_by_number, - 2, - dnstap__socket_family__enum_values_by_name, - 1, - dnstap__socket_family__value_ranges, - NULL,NULL,NULL,NULL /* reserved[1234] */ -}; -const ProtobufCEnumValue dnstap__socket_protocol__enum_values_by_number[2] = -{ - { "UDP", "DNSTAP__SOCKET_PROTOCOL__UDP", 1 }, - { "TCP", "DNSTAP__SOCKET_PROTOCOL__TCP", 2 }, -}; -static const ProtobufCIntRange dnstap__socket_protocol__value_ranges[] = { -{1, 0},{0, 2} -}; -const ProtobufCEnumValueIndex dnstap__socket_protocol__enum_values_by_name[2] = -{ - { "TCP", 1 }, - { "UDP", 0 }, -}; -const ProtobufCEnumDescriptor dnstap__socket_protocol__descriptor = -{ - PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC, - "dnstap.SocketProtocol", - "SocketProtocol", - "Dnstap__SocketProtocol", - "dnstap", - 2, - dnstap__socket_protocol__enum_values_by_number, - 2, - dnstap__socket_protocol__enum_values_by_name, - 1, - dnstap__socket_protocol__value_ranges, - NULL,NULL,NULL,NULL /* reserved[1234] */ -}; diff --git a/external/unbound/dnstap/dnstap.pb-c.h b/external/unbound/dnstap/dnstap.pb-c.h deleted file mode 100644 index d85e77715..000000000 --- a/external/unbound/dnstap/dnstap.pb-c.h +++ /dev/null @@ -1,158 +0,0 @@ -/* Generated by the protocol buffer compiler. DO NOT EDIT! */ - -#ifndef PROTOBUF_C_dnstap_2fdnstap_2eproto__INCLUDED -#define PROTOBUF_C_dnstap_2fdnstap_2eproto__INCLUDED - -#include <google/protobuf-c/protobuf-c.h> - -PROTOBUF_C_BEGIN_DECLS - - -typedef struct _Dnstap__Dnstap Dnstap__Dnstap; -typedef struct _Dnstap__Message Dnstap__Message; - - -/* --- enums --- */ - -typedef enum _Dnstap__Dnstap__Type { - DNSTAP__DNSTAP__TYPE__MESSAGE = 1 -} Dnstap__Dnstap__Type; -typedef enum _Dnstap__Message__Type { - DNSTAP__MESSAGE__TYPE__AUTH_QUERY = 1, - DNSTAP__MESSAGE__TYPE__AUTH_RESPONSE = 2, - DNSTAP__MESSAGE__TYPE__RESOLVER_QUERY = 3, - DNSTAP__MESSAGE__TYPE__RESOLVER_RESPONSE = 4, - DNSTAP__MESSAGE__TYPE__CLIENT_QUERY = 5, - DNSTAP__MESSAGE__TYPE__CLIENT_RESPONSE = 6, - DNSTAP__MESSAGE__TYPE__FORWARDER_QUERY = 7, - DNSTAP__MESSAGE__TYPE__FORWARDER_RESPONSE = 8, - DNSTAP__MESSAGE__TYPE__STUB_QUERY = 9, - DNSTAP__MESSAGE__TYPE__STUB_RESPONSE = 10 -} Dnstap__Message__Type; -typedef enum _Dnstap__SocketFamily { - DNSTAP__SOCKET_FAMILY__INET = 1, - DNSTAP__SOCKET_FAMILY__INET6 = 2 -} Dnstap__SocketFamily; -typedef enum _Dnstap__SocketProtocol { - DNSTAP__SOCKET_PROTOCOL__UDP = 1, - DNSTAP__SOCKET_PROTOCOL__TCP = 2 -} Dnstap__SocketProtocol; - -/* --- messages --- */ - -struct _Dnstap__Dnstap -{ - ProtobufCMessage base; - protobuf_c_boolean has_identity; - ProtobufCBinaryData identity; - protobuf_c_boolean has_version; - ProtobufCBinaryData version; - protobuf_c_boolean has_extra; - ProtobufCBinaryData extra; - Dnstap__Dnstap__Type type; - Dnstap__Message *message; -}; -#define DNSTAP__DNSTAP__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&dnstap__dnstap__descriptor) \ - , 0,{0,NULL}, 0,{0,NULL}, 0,{0,NULL}, 0, NULL } - - -struct _Dnstap__Message -{ - ProtobufCMessage base; - Dnstap__Message__Type type; - protobuf_c_boolean has_socket_family; - Dnstap__SocketFamily socket_family; - protobuf_c_boolean has_socket_protocol; - Dnstap__SocketProtocol socket_protocol; - protobuf_c_boolean has_query_address; - ProtobufCBinaryData query_address; - protobuf_c_boolean has_response_address; - ProtobufCBinaryData response_address; - protobuf_c_boolean has_query_port; - uint32_t query_port; - protobuf_c_boolean has_response_port; - uint32_t response_port; - protobuf_c_boolean has_query_time_sec; - uint64_t query_time_sec; - protobuf_c_boolean has_query_time_nsec; - uint32_t query_time_nsec; - protobuf_c_boolean has_query_message; - ProtobufCBinaryData query_message; - protobuf_c_boolean has_query_zone; - ProtobufCBinaryData query_zone; - protobuf_c_boolean has_response_time_sec; - uint64_t response_time_sec; - protobuf_c_boolean has_response_time_nsec; - uint32_t response_time_nsec; - protobuf_c_boolean has_response_message; - ProtobufCBinaryData response_message; -}; -#define DNSTAP__MESSAGE__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&dnstap__message__descriptor) \ - , 0, 0,0, 0,0, 0,{0,NULL}, 0,{0,NULL}, 0,0, 0,0, 0,0, 0,0, 0,{0,NULL}, 0,{0,NULL}, 0,0, 0,0, 0,{0,NULL} } - - -/* Dnstap__Dnstap methods */ -void dnstap__dnstap__init - (Dnstap__Dnstap *message); -size_t dnstap__dnstap__get_packed_size - (const Dnstap__Dnstap *message); -size_t dnstap__dnstap__pack - (const Dnstap__Dnstap *message, - uint8_t *out); -size_t dnstap__dnstap__pack_to_buffer - (const Dnstap__Dnstap *message, - ProtobufCBuffer *buffer); -Dnstap__Dnstap * - dnstap__dnstap__unpack - (ProtobufCAllocator *allocator, - size_t len, - const uint8_t *data); -void dnstap__dnstap__free_unpacked - (Dnstap__Dnstap *message, - ProtobufCAllocator *allocator); -/* Dnstap__Message methods */ -void dnstap__message__init - (Dnstap__Message *message); -size_t dnstap__message__get_packed_size - (const Dnstap__Message *message); -size_t dnstap__message__pack - (const Dnstap__Message *message, - uint8_t *out); -size_t dnstap__message__pack_to_buffer - (const Dnstap__Message *message, - ProtobufCBuffer *buffer); -Dnstap__Message * - dnstap__message__unpack - (ProtobufCAllocator *allocator, - size_t len, - const uint8_t *data); -void dnstap__message__free_unpacked - (Dnstap__Message *message, - ProtobufCAllocator *allocator); -/* --- per-message closures --- */ - -typedef void (*Dnstap__Dnstap_Closure) - (const Dnstap__Dnstap *message, - void *closure_data); -typedef void (*Dnstap__Message_Closure) - (const Dnstap__Message *message, - void *closure_data); - -/* --- services --- */ - - -/* --- descriptors --- */ - -extern const ProtobufCEnumDescriptor dnstap__socket_family__descriptor; -extern const ProtobufCEnumDescriptor dnstap__socket_protocol__descriptor; -extern const ProtobufCMessageDescriptor dnstap__dnstap__descriptor; -extern const ProtobufCEnumDescriptor dnstap__dnstap__type__descriptor; -extern const ProtobufCMessageDescriptor dnstap__message__descriptor; -extern const ProtobufCEnumDescriptor dnstap__message__type__descriptor; - -PROTOBUF_C_END_DECLS - - -#endif /* PROTOBUF_dnstap_2fdnstap_2eproto__INCLUDED */ |