~ubuntu-branches/ubuntu/lucid/iptables/lucid

« back to all changes in this revision

Viewing changes to extensions/libipt_LOG.c

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen, Iain Lane, Soren Hansen
  • Date: 2008-11-15 01:27:37 UTC
  • mfrom: (5.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20081115012737-o3kdn2z1o9ercq10
Tags: 1.4.1.1-4ubuntu1
[ Iain Lane ]
* Merge from debian unstable (LP: #294220), remaining changes:
  - debian/patches/0901-build-libipq_pic.a.patch - Build libipq_pic.a with
    -fPIC. Upstream changed build system and patch modified accordingly.

[ Soren Hansen ]
* Revert changes between 1.4.1.1-3 and 1.4.1.1-4, thus bringing back
  the howtos.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
static void LOG_help(void)
22
22
{
23
23
        printf(
24
 
"LOG v%s options:\n"
 
24
"LOG target options:\n"
25
25
" --log-level level             Level of logging (numeric or see syslog.conf)\n"
26
26
" --log-prefix prefix           Prefix log messages with this prefix.\n\n"
27
27
" --log-tcp-sequence            Log TCP sequence numbers.\n\n"
28
28
" --log-tcp-options             Log TCP options.\n\n"
29
29
" --log-ip-options              Log IP options.\n\n"
30
 
" --log-uid                     Log UID owning the local socket.\n\n",
31
 
IPTABLES_VERSION);
 
30
" --log-uid                     Log UID owning the local socket.\n\n");
32
31
}
33
32
 
34
33
static const struct option LOG_opts[] = {
38
37
        { .name = "log-tcp-options",  .has_arg = 0, .val = '2' },
39
38
        { .name = "log-ip-options",   .has_arg = 0, .val = '3' },
40
39
        { .name = "log-uid",          .has_arg = 0, .val = '4' },
41
 
        { }
 
40
        { .name = NULL }
42
41
};
43
42
 
44
43
/* Initialize the target. */
240
239
        const struct ipt_log_info *loginfo
241
240
                = (const struct ipt_log_info *)target->data;
242
241
 
243
 
        if (strcmp(loginfo->prefix, "") != 0)
244
 
                printf("--log-prefix \"%s\" ", loginfo->prefix);
 
242
        if (strcmp(loginfo->prefix, "") != 0) {
 
243
                printf("--log-prefix ");
 
244
                save_string(loginfo->prefix);
 
245
        }
245
246
 
246
247
        if (loginfo->level != LOG_DEFAULT_LEVEL)
247
248
                printf("--log-level %d ", loginfo->level);
256
257
                printf("--log-uid ");
257
258
}
258
259
 
259
 
static struct iptables_target log_target = {
 
260
static struct xtables_target log_tg_reg = {
260
261
    .name          = "LOG",
261
 
    .version       = IPTABLES_VERSION,
262
 
    .size          = IPT_ALIGN(sizeof(struct ipt_log_info)),
263
 
    .userspacesize = IPT_ALIGN(sizeof(struct ipt_log_info)),
 
262
    .version       = XTABLES_VERSION,
 
263
    .family        = PF_INET,
 
264
    .size          = XT_ALIGN(sizeof(struct ipt_log_info)),
 
265
    .userspacesize = XT_ALIGN(sizeof(struct ipt_log_info)),
264
266
    .help          = LOG_help,
265
267
    .init          = LOG_init,
266
268
    .parse         = LOG_parse,
271
273
 
272
274
void _init(void)
273
275
{
274
 
        register_target(&log_target);
 
276
        xtables_register_target(&log_tg_reg);
275
277
}