@@ -35,13 +35,10 @@ static struct config_keyset libulog_kset = {
[MARK_MARK] = {
.key = "mark",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = 0,
},
[MARK_MASK] = {
.key = "mask",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = 0xffffffff,
},
@@ -90,7 +90,6 @@ struct db_instance {
{ \
.key = "backlog_memcap", \
.type = CONFIG_TYPE_INT, \
- .u.value = 0, \
}, \
{ \
.key = "backlog_oneshot_requests", \
@@ -83,71 +83,57 @@ static struct config_keyset nfct_kset = {
{
.key = "pollinterval",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = 0,
},
{
.key = "hash_enable",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = 1,
},
{
.key = "hash_buckets",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = HTABLE_SIZE,
},
{
.key = "hash_max_entries",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = MAX_ENTRIES,
},
{
.key = "event_mask",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = EVENT_MASK,
},
{
.key = "netlink_socket_buffer_size",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = 0,
},
{
.key = "netlink_socket_buffer_maxsize",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = 0,
},
{
.key = "netlink_resync_timeout",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = 60,
},
{
.key = "reliable",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = 0,
},
{
.key = "accept_src_filter",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
},
{
.key = "accept_dst_filter",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
},
{
.key = "accept_proto_filter",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
},
},
};
@@ -45,69 +45,50 @@ static struct config_keyset libulog_kset = {
{
.key = "bufsize",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = NFLOG_BUFSIZE_DEFAULT,
},
{
.key = "group",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = NFLOG_GROUP_DEFAULT,
},
{
.key = "unbind",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = 1,
},
{
.key = "bind",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = 0,
},
{
.key = "seq_local",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = 0,
},
{
.key = "seq_global",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = 0,
},
{
.key = "numeric_label",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = 0,
},
{
.key = "netlink_socket_buffer_size",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = 0,
},
{
.key = "netlink_socket_buffer_maxsize",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = 0,
},
{
.key = "netlink_qthreshold",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = 0,
},
{
.key = "netlink_qtimeout",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = 0,
},
{
.key = "attach_conntrack",
@@ -37,31 +37,25 @@ struct ulog_input {
static struct config_keyset libulog_kset = {
.num_ces = 4,
.ces = {
- {
- .key = "bufsize",
- .type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = ULOGD_BUFSIZE_DEFAULT,
- },
- {
- .key = "nlgroup",
- .type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = ULOGD_NLGROUP_DEFAULT,
- },
- {
- .key = "rmem",
- .type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = ULOGD_RMEM_DEFAULT,
- },
- {
- .key = "numeric_label",
- .type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = 0,
- },
-
+ {
+ .key = "bufsize",
+ .type = CONFIG_TYPE_INT,
+ .u.value = ULOGD_BUFSIZE_DEFAULT,
+ },
+ {
+ .key = "nlgroup",
+ .type = CONFIG_TYPE_INT,
+ .u.value = ULOGD_NLGROUP_DEFAULT,
+ },
+ {
+ .key = "rmem",
+ .type = CONFIG_TYPE_INT,
+ .u.value = ULOGD_RMEM_DEFAULT,
+ },
+ {
+ .key = "numeric_label",
+ .type = CONFIG_TYPE_INT,
+ },
}
};
enum ulog_keys {
@@ -290,30 +290,25 @@ static struct config_keyset libunixsock_kset = {
{
.key = "socket_path",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
.u.string = UNIXSOCK_UNIXPATH_DEFAULT,
},
{
.key = "bufsize",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = UNIXSOCK_BUFSIZE_DEFAULT,
},
{
.key = "perms",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = UNIXSOCK_PERMS_DEFAULT,
},
{
.key = "owner",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
},
{
.key = "group",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
},
},
};
@@ -38,20 +38,15 @@ static struct config_keyset nfacct_kset = {
{
.key = "pollinterval",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = 0,
},
{
.key = "zerocounter",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = 1,
},
{
.key = "timestamp",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u.value = 0,
}
},
.num_ces = 3,
@@ -52,7 +52,6 @@ static struct config_keyset dbi_kset = {
{
.key = "host",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
},
{
.key = "user",
@@ -62,17 +61,14 @@ static struct config_keyset dbi_kset = {
{
.key = "pass",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
},
{
.key = "port",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
},
{
.key = "schema",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
.u.string = "public",
},
{
@@ -53,12 +53,10 @@ static const struct config_keyset ipfix_kset = {
{
.key = "oid",
.type = CONFIG_TYPE_INT,
- .u.value = 0
},
{
.key = "host",
.type = CONFIG_TYPE_STRING,
- .u.string = ""
},
{
.key = "port",
@@ -94,13 +94,11 @@ static struct config_keyset pcap_kset = {
{
.key = "file",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
.u = { .string = ULOGD_PCAP_DEFAULT },
},
{
.key = "sync",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u = { .value = ULOGD_PCAP_SYNC_DEFAULT },
},
},
@@ -49,7 +49,6 @@ static struct config_keyset pgsql_kset = {
{
.key = "host",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
},
{
.key = "user",
@@ -59,23 +58,19 @@ static struct config_keyset pgsql_kset = {
{
.key = "pass",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
},
{
.key = "port",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
},
{
.key = "schema",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
.u.string = "public",
},
{
.key = "connstring",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
},
},
};
@@ -51,20 +51,15 @@ static struct config_keyset gprint_kset = {
[GPRINT_CONF_FILENAME] = {
.key = "file",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
- .u = {.string = ULOGD_GPRINT_DEFAULT },
+ .u = { .string = ULOGD_GPRINT_DEFAULT },
},
[GPRINT_CONF_SYNC] = {
.key = "sync",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u = { .value = 0 },
},
[GPRINT_CONF_TIMESTAMP] = {
.key = "timestamp",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u = { .value = 0 },
},
},
};
@@ -67,17 +67,14 @@ static struct config_keyset graphite_kset = {
{
.key = "host",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
},
{
.key = "port",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
},
{
.key = "prefix",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
},
},
};
@@ -87,26 +87,20 @@ static struct config_keyset json_kset = {
[JSON_CONF_FILENAME] = {
.key = "file",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
- .u = {.string = ULOGD_JSON_DEFAULT },
+ .u = { .string = ULOGD_JSON_DEFAULT },
},
[JSON_CONF_SYNC] = {
.key = "sync",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u = { .value = 0 },
},
[JSON_CONF_TIMESTAMP] = {
.key = "timestamp",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u = { .value = 1 },
},
[JSON_CONF_EVENTV1] = {
.key = "eventv1",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u = { .value = 0 },
},
[JSON_CONF_DEVICE] = {
.key = "device",
@@ -117,25 +111,20 @@ static struct config_keyset json_kset = {
[JSON_CONF_BOOLEAN_LABEL] = {
.key = "boolean_label",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u = { .value = 0 },
},
[JSON_CONF_MODE] = {
.key = "mode",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
.u = { .string = "file" },
},
[JSON_CONF_HOST] = {
.key = "host",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
.u = { .string = "127.0.0.1" },
},
[JSON_CONF_PORT] = {
.key = "port",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
.u = { .string = "12345" },
},
},
@@ -64,13 +64,11 @@ static struct config_keyset logemu_kset = {
{
.key = "file",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
.u = { .string = ULOGD_LOGEMU_DEFAULT },
},
{
.key = "sync",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u = { .value = ULOGD_LOGEMU_SYNC_DEFAULT },
},
},
@@ -163,14 +163,11 @@ static struct config_keyset nacct_kset = {
{
.key = "file",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
- .u = {.string = NACCT_FILE_DEFAULT },
+ .u = { .string = NACCT_FILE_DEFAULT },
},
{
.key = "sync",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u = { .value = 0 },
},
},
};
@@ -105,14 +105,11 @@ static struct config_keyset oprint_kset = {
{
.key = "file",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
- .u = {.string = ULOGD_OPRINT_DEFAULT },
+ .u = { .string = ULOGD_OPRINT_DEFAULT },
},
{
.key = "sync",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u = { .value = 0 },
},
},
};
@@ -49,16 +49,14 @@ static struct config_keyset syslog_kset = {
.num_ces = 2,
.ces = {
{
- .key = "facility",
- .type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
- .u = { .string = SYSLOG_FACILITY_DEFAULT }
+ .key = "facility",
+ .type = CONFIG_TYPE_STRING,
+ .u = { .string = SYSLOG_FACILITY_DEFAULT }
},
- {
- .key = "level",
- .type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
- .u = { .string = SYSLOG_LEVEL_DEFAULT }
+ {
+ .key = "level",
+ .type = CONFIG_TYPE_STRING,
+ .u = { .string = SYSLOG_LEVEL_DEFAULT }
},
},
};
@@ -75,20 +75,15 @@ static struct config_keyset xml_kset = {
[CFG_XML_DIR] = {
.key = "directory",
.type = CONFIG_TYPE_STRING,
- .options = CONFIG_OPT_NONE,
.u = { .string = ULOGD_XML_DEFAULT_DIR },
},
[CFG_XML_SYNC] = {
.key = "sync",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u = { .value = 0 },
},
[CFG_XML_STDOUT] = {
.key = "stdout",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
- .u = { .value = 0 },
},
},
};
@@ -133,7 +133,6 @@ static struct config_keyset ulogd_kset = {
{
.key = "logfile",
.type = CONFIG_TYPE_CALLBACK,
- .options = CONFIG_OPT_NONE,
.u.parser = &logfile_open,
},
{
@@ -145,7 +144,6 @@ static struct config_keyset ulogd_kset = {
{
.key = "loglevel",
.type = CONFIG_TYPE_INT,
- .options = CONFIG_OPT_NONE,
.u.value = ULOGD_NOTICE,
},
{
Struct members are zero-initialized as a matter of course. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> --- filter/ulogd_filter_MARK.c | 3 -- include/ulogd/db.h | 1 - input/flow/ulogd_inpflow_NFCT.c | 14 --------- input/packet/ulogd_inppkt_NFLOG.c | 19 ------------ input/packet/ulogd_inppkt_ULOG.c | 44 ++++++++++++---------------- input/packet/ulogd_inppkt_UNIXSOCK.c | 5 ---- input/sum/ulogd_inpflow_NFACCT.c | 5 ---- output/dbi/ulogd_output_DBI.c | 4 --- output/ipfix/ulogd_output_IPFIX.c | 2 -- output/pcap/ulogd_output_PCAP.c | 2 -- output/pgsql/ulogd_output_PGSQL.c | 5 ---- output/ulogd_output_GPRINT.c | 7 +---- output/ulogd_output_GRAPHITE.c | 3 -- output/ulogd_output_JSON.c | 13 +------- output/ulogd_output_LOGEMU.c | 2 -- output/ulogd_output_NACCT.c | 5 +--- output/ulogd_output_OPRINT.c | 5 +--- output/ulogd_output_SYSLOG.c | 16 +++++----- output/ulogd_output_XML.c | 5 ---- src/ulogd.c | 2 -- 20 files changed, 30 insertions(+), 132 deletions(-)