From f5ed98fbf5f1b35e38be836048a9f1e4045885d5 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sun, 26 Apr 2009 23:19:07 +0200 Subject: [PATCH] iface: update documentation For one, the tabs must go as they cause alignment problems. Also update the manpage with proper markup. --- doc/changelog.txt | 1 + extensions/libxt_iface.c | 58 ++++++++++++++++++-------------------- extensions/libxt_iface.man | 45 ++++++++++------------------- 3 files changed, 44 insertions(+), 60 deletions(-) diff --git a/doc/changelog.txt b/doc/changelog.txt index 5b958c9..5877f35 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -1,5 +1,6 @@ +- add "iface" match - fuzzy: need to account for kernel-level modified variables in .userspacesize - geoip: remove XT_ALIGN from .userspacesize when used with offsetof - SYSRQ: ignore non-UDP packets diff --git a/extensions/libxt_iface.c b/extensions/libxt_iface.c index 865fd08..091951e 100644 --- a/extensions/libxt_iface.c +++ b/extensions/libxt_iface.c @@ -17,22 +17,22 @@ #include "xt_iface.h" static const struct option iface_mt_opts[] = { - {.name = "iface", .has_arg = true, .val = 'i'}, - {.name = "up", .has_arg = false, .val = 'u'}, - {.name = "down", .has_arg = false, .val = 'U'}, /* not up */ - {.name = "broadcast", .has_arg = false, .val = 'b'}, - {.name = "loopback", .has_arg = false, .val = 'l'}, - {.name = "pointopoint", .has_arg = false, .val = 'p'}, - {.name = "pointtopoint",.has_arg = false, .val = 'p'}, /* eq pointopoint */ - {.name = "running", .has_arg = false, .val = 'r'}, - {.name = "noarp", .has_arg = false, .val = 'n'}, - {.name = "arp", .has_arg = false, .val = 'N'}, /* not noarp */ - {.name = "promisc", .has_arg = false, .val = 'o'}, - {.name = "multicast", .has_arg = false, .val = 'm'}, - {.name = "dynamic", .has_arg = false, .val = 'd'}, - {.name = "lower-up", .has_arg = false, .val = 'w'}, - {.name = "dormant", .has_arg = false, .val = 'a'}, - {.name = NULL}, + {.name = "iface", .has_arg = true, .val = 'i'}, + {.name = "up", .has_arg = false, .val = 'u'}, + {.name = "down", .has_arg = false, .val = 'U'}, /* not up */ + {.name = "broadcast", .has_arg = false, .val = 'b'}, + {.name = "loopback", .has_arg = false, .val = 'l'}, + {.name = "pointopoint", .has_arg = false, .val = 'p'}, + {.name = "pointtopoint", .has_arg = false, .val = 'p'}, /* eq pointopoint */ + {.name = "running", .has_arg = false, .val = 'r'}, + {.name = "noarp", .has_arg = false, .val = 'n'}, + {.name = "arp", .has_arg = false, .val = 'N'}, /* not noarp */ + {.name = "promisc", .has_arg = false, .val = 'o'}, + {.name = "multicast", .has_arg = false, .val = 'm'}, + {.name = "dynamic", .has_arg = false, .val = 'd'}, + {.name = "lower-up", .has_arg = false, .val = 'w'}, + {.name = "dormant", .has_arg = false, .val = 'a'}, + {NULL}, }; static void iface_print_opt(const struct xt_iface_mtinfo *info, @@ -68,21 +68,19 @@ static void iface_mt_help(void) { printf( "iface match options:\n" - " --iface interface\t\tName of interface\n" - "[!] --up\n" - "[!] --down\t\t\tmatch if UP flag (not) set\n" - "[!] --broadcast\t\tmatch if BROADCAST flag (not) set\n" - "[!] --loopback\t\t\tmatch if LOOPBACK flag (not) set\n" + " --iface interface Name of interface\n" + "[!] --up / --down match if UP flag (not) set\n" + "[!] --broadcast match if BROADCAST flag (not) set\n" + "[!] --loopback match if LOOPBACK flag (not) set\n" "[!] --pointopoint\n" - "[!] --pointtopoint\t\tmatch if POINTOPOINT flag (not) set\n" - "[!] --running\t\t\tmatch if RUNNING flag (not) set\n" - "[!] --noarp\n" - "[!] --arp\t\t\tmatch if NOARP flag (not) set\n" - "[!] --promisc\t\t\tmatch if PROMISC flag (not) set\n" - "[!] --multicast\t\tmatch if MULTICAST flag (not) set\n" - "[!] --dynamic\t\t\tmatch if DYNAMIC flag (not) set\n" - "[!] --lower-up\t\t\tmatch if LOWER_UP flag (not) set\n" - "[!] --dormant\t\t\tmatch if DORMANT flag (not) set\n"); + "[!] --pointtopoint match if POINTOPOINT flag (not) set\n" + "[!] --running match if RUNNING flag (not) set\n" + "[!] --noarp / --arp match if NOARP flag (not) set\n" + "[!] --promisc match if PROMISC flag (not) set\n" + "[!] --multicast match if MULTICAST flag (not) set\n" + "[!] --dynamic match if DYNAMIC flag (not) set\n" + "[!] --lower-up match if LOWER_UP flag (not) set\n" + "[!] --dormant match if DORMANT flag (not) set\n"); } static int iface_mt_parse(int c, char **argv, int invert, unsigned int *flags, diff --git a/extensions/libxt_iface.man b/extensions/libxt_iface.man index 40f70e3..7dc6820 100644 --- a/extensions/libxt_iface.man +++ b/extensions/libxt_iface.man @@ -1,52 +1,37 @@ Allows you to check interface states. - .TP -.BI "--iface " "interface" -Check the states on "interface". Required. +\fB\-\-iface\fP \fIname\fP +Check the states on the given interface. This option is required. .TP -.B [!] --up +[\fB!\fP] \fB\-\-up\fP, [\fB!\fP] \fB\-\-down\fP Check the UP flag. .TP -.B [!] --down -Not --up. -.TP -.B "[!] --broadcast" +[\fB!\fP] \fB\-\-broadcast\fP Check the BROADCAST flag. .TP -.B "[!] --loopback" +[\fB!\fP] \fB\-\-loopback\fP Check the LOOPBACK flag. .TP -.B "[!] --pointopoint" -Check the POINTOPOINT flag. +[\fB!\fP] \fB\-\-pointtopoint\fP +Check the POINTTOPOINT flag. .TP -.B "[!] --pointtopoint" -Same as --pointopoint. +[\fB!\fP] \fB\-\-running\fP +Check the RUNNING flag. Do NOT rely on it! .TP -.B [!] --running -Check the RUNNING flag. Do NOT relay on it! -.TP -.B [!] --noarp +[\fB!\fP] \fB\-\-noarp\fP, [\fB!\fP] \fB\-\-arp\fP Check the NOARP flag. .TP -.B [!] --arp -Not --noarp. -.TP -.B [!] --promisc +[\fB!\fP] \fB\-\-promisc\fP Check the PROMISC flag. .TP -.B [!] --promiscous -Same as --promisc. -.TP -.B [!] --multicast +[\fB!\fP] \fB\-\-multicast\fP Check the MULTICAST flag. .TP -.B [!] --dynamic +[\fB!\fP] \fB\-\-dynamic\fP Check the DYNAMIC flag. .TP -.B [!] --lower_up +[\fB!\fP] \fB\-\-lower-up\fP Check the LOWER_UP flag. .TP -.B [!] --dormant +[\fB!\fP] \fB\-\-dormant\fP Check the DORMANT flag. - -For more information see the \fIif.h\fP header file in the kernel source.