summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2003-01-11 16:16:54 +0000
committerBart De Schuymer <bdschuym@pandora.be>2003-01-11 16:16:54 +0000
commit9a0fbf2dedef483716fb270b9cfd9ed6e6ea78c2 (patch)
tree88dd1fc0e041d98597238ab455c358901147600e
parent9895a8eaa4b29c33472a9ad34df0356c8d83cac2 (diff)
introduce -h list_extensions
-rw-r--r--ebtables.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/ebtables.c b/ebtables.c
index cb09829..e01ef9f 100644
--- a/ebtables.c
+++ b/ebtables.c
@@ -428,6 +428,37 @@ int ebtables_insmod(const char *modname, const char *modprobe)
return 0;
}
+static void list_extensions()
+{
+ struct ebt_u_table *tbl = tables;
+ struct ebt_u_target *t = targets;
+ struct ebt_u_match *m = matches;
+ struct ebt_u_watcher *w = watchers;
+
+ printf(PROGNAME" v"PROGVERSION" ("PROGDATE")\n");
+ printf("Supported userspace extensions:\n\nSupported tables:\n");
+ while(tbl) {
+ printf("%s\n", tbl->name);
+ tbl = tbl->next;
+ }
+ printf("\nSupported targets:\n");
+ while(t) {
+ printf("%s\n", t->name);
+ t = t->next;
+ }
+ printf("\nSupported matches:\n");
+ while(m) {
+ printf("%s\n", m->name);
+ m = m->next;
+ }
+ printf("\nSupported watchers:\n");
+ while(w) {
+ printf("%s\n", w->name);
+ w = w->next;
+ }
+ exit(0);
+}
+
/*
* we use replace.flags, so we can't use the following values:
* 0x01 == OPT_COMMAND, 0x02 == OPT_TABLE, 0x100 == OPT_ZERO
@@ -1821,6 +1852,10 @@ int main(int argc, char *argv[])
struct ebt_u_match *m;
struct ebt_u_watcher *w;
+ if (!strcasecmp("list_extensions",
+ argv[optind]))
+ list_extensions();
+
if ((m = find_match(argv[optind])))
add_match(m);
else if ((w = find_watcher(argv[optind])))