Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 1 | #include <stdio.h> |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 2 | #include <string.h> |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 3 | #include <syslog.h> |
Jan Engelhardt | 5d9678a | 2008-11-20 10:15:35 +0100 | [diff] [blame] | 4 | #include <xtables.h> |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 5 | #include <linux/netfilter_ipv4/ipt_LOG.h> |
| 6 | |
| 7 | #define LOG_DEFAULT_LEVEL LOG_WARNING |
| 8 | |
Martin Josefsson | 2b9a577 | 2005-01-05 15:21:15 +0000 | [diff] [blame] | 9 | #ifndef IPT_LOG_UID /* Old kernel */ |
| 10 | #define IPT_LOG_UID 0x08 /* Log UID owning local socket */ |
| 11 | #undef IPT_LOG_MASK |
| 12 | #define IPT_LOG_MASK 0x0f |
| 13 | #endif |
| 14 | |
Jan Engelhardt | 0dd344a | 2011-02-15 12:05:12 +0100 | [diff] [blame] | 15 | enum { |
| 16 | O_LOG_LEVEL = 0, |
| 17 | O_LOG_PREFIX, |
| 18 | O_LOG_TCPSEQ, |
| 19 | O_LOG_TCPOPTS, |
| 20 | O_LOG_IPOPTS, |
| 21 | O_LOG_UID, |
| 22 | O_LOG_MAC, |
| 23 | }; |
| 24 | |
Jan Engelhardt | 1d5b63d | 2007-10-04 16:29:00 +0000 | [diff] [blame] | 25 | static void LOG_help(void) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 26 | { |
| 27 | printf( |
Jan Engelhardt | 8b7c64d | 2008-04-15 11:48:25 +0200 | [diff] [blame] | 28 | "LOG target options:\n" |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 29 | " --log-level level Level of logging (numeric or see syslog.conf)\n" |
| 30 | " --log-prefix prefix Prefix log messages with this prefix.\n\n" |
| 31 | " --log-tcp-sequence Log TCP sequence numbers.\n\n" |
| 32 | " --log-tcp-options Log TCP options.\n\n" |
John Lange | f46e1af | 2005-01-02 23:33:12 +0000 | [diff] [blame] | 33 | " --log-ip-options Log IP options.\n\n" |
Patrick McHardy | 1276478 | 2010-06-28 14:51:35 +0200 | [diff] [blame] | 34 | " --log-uid Log UID owning the local socket.\n\n" |
| 35 | " --log-macdecode Decode MAC addresses and protocol.\n\n"); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 36 | } |
| 37 | |
Jan Engelhardt | 0dd344a | 2011-02-15 12:05:12 +0100 | [diff] [blame] | 38 | #define s struct ipt_log_info |
| 39 | static const struct xt_option_entry LOG_opts[] = { |
| 40 | {.name = "log-level", .id = O_LOG_LEVEL, .type = XTTYPE_SYSLOGLEVEL, |
| 41 | .flags = XTOPT_PUT, XTOPT_POINTER(s, level)}, |
| 42 | {.name = "log-prefix", .id = O_LOG_PREFIX, .type = XTTYPE_STRING, |
| 43 | .flags = XTOPT_PUT, XTOPT_POINTER(s, prefix), .min = 1}, |
| 44 | {.name = "log-tcp-sequence", .id = O_LOG_TCPSEQ, .type = XTTYPE_NONE}, |
| 45 | {.name = "log-tcp-options", .id = O_LOG_TCPOPTS, .type = XTTYPE_NONE}, |
| 46 | {.name = "log-ip-options", .id = O_LOG_IPOPTS, .type = XTTYPE_NONE}, |
| 47 | {.name = "log-uid", .id = O_LOG_UID, .type = XTTYPE_NONE}, |
| 48 | {.name = "log-macdecode", .id = O_LOG_MAC, .type = XTTYPE_NONE}, |
| 49 | XTOPT_TABLEEND, |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 50 | }; |
Jan Engelhardt | 0dd344a | 2011-02-15 12:05:12 +0100 | [diff] [blame] | 51 | #undef s |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 52 | |
Jan Engelhardt | 1d5b63d | 2007-10-04 16:29:00 +0000 | [diff] [blame] | 53 | static void LOG_init(struct xt_entry_target *t) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 54 | { |
| 55 | struct ipt_log_info *loginfo = (struct ipt_log_info *)t->data; |
| 56 | |
| 57 | loginfo->level = LOG_DEFAULT_LEVEL; |
| 58 | |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | struct ipt_log_names { |
| 62 | const char *name; |
| 63 | unsigned int level; |
| 64 | }; |
| 65 | |
Shivani Bhardwaj | a3ea892 | 2016-01-05 23:32:29 +0530 | [diff] [blame] | 66 | struct ipt_log_xlate { |
| 67 | const char *name; |
| 68 | unsigned int level; |
| 69 | }; |
| 70 | |
Jan Engelhardt | 0e2abed | 2007-10-04 16:25:58 +0000 | [diff] [blame] | 71 | static const struct ipt_log_names ipt_log_names[] |
Stephane Ouellette | 2be28ab | 2003-08-11 19:58:56 +0000 | [diff] [blame] | 72 | = { { .name = "alert", .level = LOG_ALERT }, |
| 73 | { .name = "crit", .level = LOG_CRIT }, |
| 74 | { .name = "debug", .level = LOG_DEBUG }, |
| 75 | { .name = "emerg", .level = LOG_EMERG }, |
| 76 | { .name = "error", .level = LOG_ERR }, /* DEPRECATED */ |
| 77 | { .name = "info", .level = LOG_INFO }, |
| 78 | { .name = "notice", .level = LOG_NOTICE }, |
| 79 | { .name = "panic", .level = LOG_EMERG }, /* DEPRECATED */ |
| 80 | { .name = "warning", .level = LOG_WARNING } |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 81 | }; |
| 82 | |
Jan Engelhardt | 0dd344a | 2011-02-15 12:05:12 +0100 | [diff] [blame] | 83 | static void LOG_parse(struct xt_option_call *cb) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 84 | { |
Jan Engelhardt | 0dd344a | 2011-02-15 12:05:12 +0100 | [diff] [blame] | 85 | struct ipt_log_info *info = cb->data; |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 86 | |
Jan Engelhardt | 0dd344a | 2011-02-15 12:05:12 +0100 | [diff] [blame] | 87 | xtables_option_parse(cb); |
| 88 | switch (cb->entry->id) { |
| 89 | case O_LOG_PREFIX: |
| 90 | if (strchr(cb->arg, '\n') != NULL) |
Jan Engelhardt | 1829ed4 | 2009-02-21 03:29:44 +0100 | [diff] [blame] | 91 | xtables_error(PARAMETER_PROBLEM, |
Phil Oester | 182f3f6 | 2005-04-01 07:07:00 +0000 | [diff] [blame] | 92 | "Newlines not allowed in --log-prefix"); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 93 | break; |
Jan Engelhardt | 0dd344a | 2011-02-15 12:05:12 +0100 | [diff] [blame] | 94 | case O_LOG_TCPSEQ: |
Jan Engelhardt | 4e98e81 | 2011-06-21 17:00:45 +0200 | [diff] [blame] | 95 | info->logflags |= IPT_LOG_TCPSEQ; |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 96 | break; |
Jan Engelhardt | 0dd344a | 2011-02-15 12:05:12 +0100 | [diff] [blame] | 97 | case O_LOG_TCPOPTS: |
Jan Engelhardt | 4e98e81 | 2011-06-21 17:00:45 +0200 | [diff] [blame] | 98 | info->logflags |= IPT_LOG_TCPOPT; |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 99 | break; |
Jan Engelhardt | 0dd344a | 2011-02-15 12:05:12 +0100 | [diff] [blame] | 100 | case O_LOG_IPOPTS: |
Jan Engelhardt | 4e98e81 | 2011-06-21 17:00:45 +0200 | [diff] [blame] | 101 | info->logflags |= IPT_LOG_IPOPT; |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 102 | break; |
Jan Engelhardt | 0dd344a | 2011-02-15 12:05:12 +0100 | [diff] [blame] | 103 | case O_LOG_UID: |
Jan Engelhardt | 4e98e81 | 2011-06-21 17:00:45 +0200 | [diff] [blame] | 104 | info->logflags |= IPT_LOG_UID; |
John Lange | f46e1af | 2005-01-02 23:33:12 +0000 | [diff] [blame] | 105 | break; |
Jan Engelhardt | 0dd344a | 2011-02-15 12:05:12 +0100 | [diff] [blame] | 106 | case O_LOG_MAC: |
Jan Engelhardt | 4e98e81 | 2011-06-21 17:00:45 +0200 | [diff] [blame] | 107 | info->logflags |= IPT_LOG_MACDECODE; |
Patrick McHardy | 1276478 | 2010-06-28 14:51:35 +0200 | [diff] [blame] | 108 | break; |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 109 | } |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 110 | } |
| 111 | |
Jan Engelhardt | 1d5b63d | 2007-10-04 16:29:00 +0000 | [diff] [blame] | 112 | static void LOG_print(const void *ip, const struct xt_entry_target *target, |
| 113 | int numeric) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 114 | { |
| 115 | const struct ipt_log_info *loginfo |
| 116 | = (const struct ipt_log_info *)target->data; |
| 117 | unsigned int i = 0; |
| 118 | |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 119 | printf(" LOG"); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 120 | if (numeric) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 121 | printf(" flags %u level %u", |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 122 | loginfo->logflags, loginfo->level); |
| 123 | else { |
Jan Engelhardt | 2c69b55 | 2009-04-30 19:32:02 +0200 | [diff] [blame] | 124 | for (i = 0; i < ARRAY_SIZE(ipt_log_names); ++i) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 125 | if (loginfo->level == ipt_log_names[i].level) { |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 126 | printf(" level %s", ipt_log_names[i].name); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 127 | break; |
| 128 | } |
Jan Engelhardt | 2c69b55 | 2009-04-30 19:32:02 +0200 | [diff] [blame] | 129 | if (i == ARRAY_SIZE(ipt_log_names)) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 130 | printf(" UNKNOWN level %u", loginfo->level); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 131 | if (loginfo->logflags & IPT_LOG_TCPSEQ) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 132 | printf(" tcp-sequence"); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 133 | if (loginfo->logflags & IPT_LOG_TCPOPT) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 134 | printf(" tcp-options"); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 135 | if (loginfo->logflags & IPT_LOG_IPOPT) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 136 | printf(" ip-options"); |
John Lange | f46e1af | 2005-01-02 23:33:12 +0000 | [diff] [blame] | 137 | if (loginfo->logflags & IPT_LOG_UID) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 138 | printf(" uid"); |
Patrick McHardy | 1276478 | 2010-06-28 14:51:35 +0200 | [diff] [blame] | 139 | if (loginfo->logflags & IPT_LOG_MACDECODE) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 140 | printf(" macdecode"); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 141 | if (loginfo->logflags & ~(IPT_LOG_MASK)) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 142 | printf(" unknown-flags"); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | if (strcmp(loginfo->prefix, "") != 0) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 146 | printf(" prefix \"%s\"", loginfo->prefix); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 147 | } |
| 148 | |
Jan Engelhardt | 1d5b63d | 2007-10-04 16:29:00 +0000 | [diff] [blame] | 149 | static void LOG_save(const void *ip, const struct xt_entry_target *target) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 150 | { |
| 151 | const struct ipt_log_info *loginfo |
| 152 | = (const struct ipt_log_info *)target->data; |
| 153 | |
Max Kellermann | a5d0994 | 2008-01-29 13:44:34 +0000 | [diff] [blame] | 154 | if (strcmp(loginfo->prefix, "") != 0) { |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 155 | printf(" --log-prefix"); |
Jan Engelhardt | a0baae8 | 2009-01-30 04:32:50 +0100 | [diff] [blame] | 156 | xtables_save_string(loginfo->prefix); |
Max Kellermann | a5d0994 | 2008-01-29 13:44:34 +0000 | [diff] [blame] | 157 | } |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 158 | |
Thomas Woerner | 01cbaa6 | 2003-07-14 20:01:29 +0000 | [diff] [blame] | 159 | if (loginfo->level != LOG_DEFAULT_LEVEL) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 160 | printf(" --log-level %d", loginfo->level); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 161 | |
| 162 | if (loginfo->logflags & IPT_LOG_TCPSEQ) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 163 | printf(" --log-tcp-sequence"); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 164 | if (loginfo->logflags & IPT_LOG_TCPOPT) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 165 | printf(" --log-tcp-options"); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 166 | if (loginfo->logflags & IPT_LOG_IPOPT) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 167 | printf(" --log-ip-options"); |
John Lange | f46e1af | 2005-01-02 23:33:12 +0000 | [diff] [blame] | 168 | if (loginfo->logflags & IPT_LOG_UID) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 169 | printf(" --log-uid"); |
Patrick McHardy | 1276478 | 2010-06-28 14:51:35 +0200 | [diff] [blame] | 170 | if (loginfo->logflags & IPT_LOG_MACDECODE) |
Jan Engelhardt | 7386635 | 2010-12-18 02:04:59 +0100 | [diff] [blame] | 171 | printf(" --log-macdecode"); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 172 | } |
| 173 | |
Shivani Bhardwaj | a3ea892 | 2016-01-05 23:32:29 +0530 | [diff] [blame] | 174 | static const struct ipt_log_xlate ipt_log_xlate_names[] = { |
| 175 | {"alert", LOG_ALERT }, |
| 176 | {"crit", LOG_CRIT }, |
| 177 | {"debug", LOG_DEBUG }, |
| 178 | {"emerg", LOG_EMERG }, |
| 179 | {"err", LOG_ERR }, |
| 180 | {"info", LOG_INFO }, |
| 181 | {"notice", LOG_NOTICE }, |
| 182 | {"warn", LOG_WARNING } |
| 183 | }; |
| 184 | |
Pablo Neira Ayuso | 7a0992d | 2016-07-24 12:45:53 +0200 | [diff] [blame] | 185 | static int LOG_xlate(struct xt_xlate *xl, |
| 186 | const struct xt_xlate_tg_params *params) |
Shivani Bhardwaj | a3ea892 | 2016-01-05 23:32:29 +0530 | [diff] [blame] | 187 | { |
Shivani Bhardwaj | a3ea892 | 2016-01-05 23:32:29 +0530 | [diff] [blame] | 188 | const struct ipt_log_info *loginfo = |
Pablo Neira Ayuso | 7a0992d | 2016-07-24 12:45:53 +0200 | [diff] [blame] | 189 | (const struct ipt_log_info *)params->target->data; |
| 190 | unsigned int i = 0; |
Shivani Bhardwaj | a3ea892 | 2016-01-05 23:32:29 +0530 | [diff] [blame] | 191 | |
Liping Zhang | bb50942 | 2016-11-27 20:08:29 +0800 | [diff] [blame] | 192 | xt_xlate_add(xl, "log"); |
Pablo M. Bermudo Garay | 68c57e8 | 2016-07-26 18:45:24 +0200 | [diff] [blame] | 193 | if (strcmp(loginfo->prefix, "") != 0) { |
| 194 | if (params->escape_quotes) |
Liping Zhang | bb50942 | 2016-11-27 20:08:29 +0800 | [diff] [blame] | 195 | xt_xlate_add(xl, " prefix \\\"%s\\\"", loginfo->prefix); |
Pablo M. Bermudo Garay | 68c57e8 | 2016-07-26 18:45:24 +0200 | [diff] [blame] | 196 | else |
Liping Zhang | bb50942 | 2016-11-27 20:08:29 +0800 | [diff] [blame] | 197 | xt_xlate_add(xl, " prefix \"%s\"", loginfo->prefix); |
Pablo M. Bermudo Garay | 68c57e8 | 2016-07-26 18:45:24 +0200 | [diff] [blame] | 198 | } |
Shivani Bhardwaj | a3ea892 | 2016-01-05 23:32:29 +0530 | [diff] [blame] | 199 | |
| 200 | for (i = 0; i < ARRAY_SIZE(ipt_log_xlate_names); ++i) |
Laura Garcia Liebana | 75a7f70 | 2016-03-10 19:15:40 +0100 | [diff] [blame] | 201 | if (loginfo->level != LOG_DEFAULT_LEVEL && |
| 202 | loginfo->level == ipt_log_xlate_names[i].level) { |
Liping Zhang | bb50942 | 2016-11-27 20:08:29 +0800 | [diff] [blame] | 203 | xt_xlate_add(xl, " level %s", |
Shivani Bhardwaj | a3ea892 | 2016-01-05 23:32:29 +0530 | [diff] [blame] | 204 | ipt_log_xlate_names[i].name); |
| 205 | break; |
| 206 | } |
| 207 | |
Liping Zhang | bb50942 | 2016-11-27 20:08:29 +0800 | [diff] [blame] | 208 | if ((loginfo->logflags & IPT_LOG_MASK) == IPT_LOG_MASK) { |
| 209 | xt_xlate_add(xl, " flags all"); |
| 210 | } else { |
| 211 | if (loginfo->logflags & (IPT_LOG_TCPSEQ | IPT_LOG_TCPOPT)) { |
| 212 | const char *delim = " "; |
| 213 | |
| 214 | xt_xlate_add(xl, " flags tcp"); |
| 215 | if (loginfo->logflags & IPT_LOG_TCPSEQ) { |
| 216 | xt_xlate_add(xl, " sequence"); |
| 217 | delim = ","; |
| 218 | } |
| 219 | if (loginfo->logflags & IPT_LOG_TCPOPT) |
| 220 | xt_xlate_add(xl, "%soptions", delim); |
| 221 | } |
| 222 | if (loginfo->logflags & IPT_LOG_IPOPT) |
| 223 | xt_xlate_add(xl, " flags ip options"); |
| 224 | if (loginfo->logflags & IPT_LOG_UID) |
| 225 | xt_xlate_add(xl, " flags skuid"); |
| 226 | if (loginfo->logflags & IPT_LOG_MACDECODE) |
| 227 | xt_xlate_add(xl, " flags ether"); |
| 228 | } |
| 229 | |
Shivani Bhardwaj | a3ea892 | 2016-01-05 23:32:29 +0530 | [diff] [blame] | 230 | return 1; |
| 231 | } |
Jan Engelhardt | 8b7c64d | 2008-04-15 11:48:25 +0200 | [diff] [blame] | 232 | static struct xtables_target log_tg_reg = { |
Jan Engelhardt | e1df221 | 2011-02-15 12:02:51 +0100 | [diff] [blame] | 233 | .name = "LOG", |
| 234 | .version = XTABLES_VERSION, |
| 235 | .family = NFPROTO_IPV4, |
| 236 | .size = XT_ALIGN(sizeof(struct ipt_log_info)), |
| 237 | .userspacesize = XT_ALIGN(sizeof(struct ipt_log_info)), |
| 238 | .help = LOG_help, |
| 239 | .init = LOG_init, |
Jan Engelhardt | e1df221 | 2011-02-15 12:02:51 +0100 | [diff] [blame] | 240 | .print = LOG_print, |
| 241 | .save = LOG_save, |
Jan Engelhardt | 0dd344a | 2011-02-15 12:05:12 +0100 | [diff] [blame] | 242 | .x6_parse = LOG_parse, |
| 243 | .x6_options = LOG_opts, |
Shivani Bhardwaj | a3ea892 | 2016-01-05 23:32:29 +0530 | [diff] [blame] | 244 | .xlate = LOG_xlate, |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 245 | }; |
| 246 | |
| 247 | void _init(void) |
| 248 | { |
Jan Engelhardt | 8b7c64d | 2008-04-15 11:48:25 +0200 | [diff] [blame] | 249 | xtables_register_target(&log_tg_reg); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 250 | } |