summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw/main.c
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2014-07-28 19:01:25 +0000
committermelifaro <melifaro@FreeBSD.org>2014-07-28 19:01:25 +0000
commitfa3f38a6a0f5431577dbb7d336d2468cd60edab8 (patch)
treefb3bd0df0e64c28992f517fedc78a93ce0002cca /sbin/ipfw/main.c
parent505e5ae08158dae524fad92308b69c209a5f69d9 (diff)
downloadFreeBSD-src-fa3f38a6a0f5431577dbb7d336d2468cd60edab8.zip
FreeBSD-src-fa3f38a6a0f5431577dbb7d336d2468cd60edab8.tar.gz
* Add generic ipfw interface tracking API
* Rewrite interface tables to use interface indexes Kernel changes: * Add generic interface tracking API: - ipfw_iface_ref (must call unlocked, performs lazy init if needed, allocates state & bumps ref) - ipfw_iface_add_ntfy(UH_WLOCK+WLOCK, links comsumer & runs its callback to update ifindex) - ipfw_iface_del_ntfy(UH_WLOCK+WLOCK, unlinks consumer) - ipfw_iface_unref(unlocked, drops reference) Additionally, consumer callbacks are called in interface withdrawal/departure. * Rewrite interface tables to use iface tracking API. Currently tables are implemented the following way: runtime data is stored as sorted array of {ifidx, val} for existing interfaces full data is stored inside namedobj instance (chained hashed table). * Add IP_FW_XIFLIST opcode to dump status of tracked interfaces * Pass @chain ptr to most non-locked algorithm callbacks: (prepare_add, prepare_del, flush_entry ..). This may be needed for better interaction of given algorithm an other ipfw subsystems * Add optional "change_ti" algorithm handler to permit updating of cached table_info pointer (happens in case of table_max resize) * Fix small bug in ipfw_list_tables() * Add badd (insert into sorted array) and bdel (remove from sorted array) funcs Userland changes: * Add "iflist" cmd to print status of currently tracked interface * Add stringnum_cmp for better interface/table names sorting
Diffstat (limited to 'sbin/ipfw/main.c')
-rw-r--r--sbin/ipfw/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/ipfw/main.c b/sbin/ipfw/main.c
index 6d6e456..4dbe7b7 100644
--- a/sbin/ipfw/main.c
+++ b/sbin/ipfw/main.c
@@ -438,6 +438,8 @@ ipfw_main(int oldac, char **oldav)
ipfw_list(ac, av, 1 /* show counters */);
else if (_substrcmp(*av, "table") == 0)
ipfw_table_handler(ac, av);
+ else if (_substrcmp(*av, "iflist") == 0)
+ ipfw_list_tifaces();
else
errx(EX_USAGE, "bad command `%s'", *av);
}
OpenPOWER on IntegriCloud