summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw/main.c
Commit message (Collapse)AuthorAgeFilesLines
* * Move "talist" and "iflist" cmds into newly-create "internal" ipfw(8) cmd.melifaro2014-08-031-4/+2
| | | | | * Add "table X detail" cmd and show detailed algo info there instead of "info".
* * Dump available table algorithms via "ipfw talist" cmd.melifaro2014-07-291-0/+2
| | | | | | | | | | | Kernel changes: * Add type/refcount fields to table algo instances. * Add IP_FW_TABLES_ALIST opcode to export available algorihms to userland. Userland changes: * Fix cores on empty input inside "ipfw table" handler. * Add "ipfw talist" cmd to print availabled kernel algorithms. * Change "table info" output to reflect long algorithm config lines.
* * Add generic ipfw interface tracking APImelifaro2014-07-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Fully switch to named tables:melifaro2014-07-031-0/+2
| | | | | | | | | | | | | | | | | | | Kernel changes: * Introduce ipfw_obj_tentry table entry structure to force u64 alignment. * Support "update-on-existing-key" "add" bahavior (TEI_FLAGS_UPDATED). * Use "subtype" field to distingush between IPv4 and IPv6 table records instead of previous hack. * Add value type (vtype) field for kernel tables. Current types are number,ip and dscp * Fix sets mask retrieval for old binaries * Fix crash while using interface tables Userland changes: * Switch ipfw_table_handler() to use named-only tables. * Add "table NAME create [type {cidr|iface|u32} [valtype {number|ip|dscp}] ..." * Switch ipfw_table_handler to match_token()-based parser. * Switch ipfw_sets_handler to use new ipfw_get_config() for mask retrieval. * Allow ipfw set X table ... syntax to permit using per-set table namespaces.
* Spelling fixes for sbin/uqs2012-01-071-1/+1
|
* Replace index() and rindex() calls with strchr() and strrchr().ed2012-01-031-5/+5
| | | | | | | | | | The index() and rindex() functions were marked LEGACY in the 2001 revision of POSIX and were subsequently removed from the 2008 revision. The strchr() and strrchr() functions are part of the C standard. This makes the source code a lot more consistent, as most of these C files also call into other str*() routines. In fact, about a dozen already perform strchr() calls.
* - Add fallthrough commenteadler2011-12-241-0/+1
| | | | | | Approved by: pluknet Found with: Coverity Prevent(tm) CID: 10125
* - fix duplicate "a a" in some commentseadler2011-11-131-1/+1
| | | | | | Submitted by: eadler Approved by: simon MFC after: 3 days
* Improve error reporting. Use corresponding error message when file to beae2011-06-291-4/+11
| | | | | | | | preprocessed is missing. Also suggest to use absolute pathname if -p option is specified. PR: bin/156653 MFC after: 2 weeks
* Initialize co.use_set variable before parsing each new rule.ae2011-06-061-0/+1
| | | | | PR: bin/134975 MFC after: 2 weeks
* Increase buffer size for the command line.ae2011-06-061-2/+2
| | | | | | PR: bin/125370 Submitted by: sem MFC after: 2 weeks
* Whitespace fixes.glebius2011-04-181-3/+3
| | | | Checked with: md5, diff -w
* fix a buffer overflow with large (100k+) number of input lines.luigi2010-04-121-2/+2
| | | | MFC after: 3 days
* reduce diffs with the cross-platform version (windows needsluigi2010-03-041-0/+14
| | | | some extra initialization)
* Bring in the most recent version of ipfw and dummynet, developedluigi2010-03-021-41/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and tested over the past two months in the ipfw3-head branch. This also happens to be the same code available in the Linux and Windows ports of ipfw and dummynet. The major enhancement is a completely restructured version of dummynet, with support for different packet scheduling algorithms (loadable at runtime), faster queue/pipe lookup, and a much cleaner internal architecture and kernel/userland ABI which simplifies future extensions. In addition to the existing schedulers (FIFO and WF2Q+), we include a Deficit Round Robin (DRR or RR for brevity) scheduler, and a new, very fast version of WF2Q+ called QFQ. Some test code is also present (in sys/netinet/ipfw/test) that lets you build and test schedulers in userland. Also, we have added a compatibility layer that understands requests from the RELENG_7 and RELENG_8 versions of the /sbin/ipfw binaries, and replies correctly (at least, it does its best; sometimes you just cannot tell who sent the request and how to answer). The compatibility layer should make it possible to MFC this code in a relatively short time. Some minor glitches (e.g. handling of ipfw set enable/disable, and a workaround for a bug in RELENG_7's /sbin/ipfw) will be fixed with separate commits. CREDITS: This work has been partly supported by the ONELAB2 project, and mostly developed by Riccardo Panicucci and myself. The code for the qfq scheduler is mostly from Fabio Checconi, and Marta Carbone and Francesco Magno have helped with testing, debugging and some bug fixes.
* Implement an ipfw action to reassemble ip packets: reass.piso2009-04-011-1/+1
|
* move a variable declaration to the beginning of the blockluigi2009-03-051-1/+1
| | | | | (unfortunately, it is far away; we need to pack this code in a better way).
* Start splitting the monster file in smaller blocks.luigi2009-01-271-0/+539
In this episode: - introduce a common header with a minimal set of common definitions; - bring the main() function and options parser in main.c - rename the main functions with an ipfw_ prefix No code changes except for the introduction of a global variable, resvd_set_number, which stores the RESVD_SET value from ip_fw.h and is used to remove the dependency of main.c from ip_fw.h (and the subtree of dependencies) for just a single constant.
OpenPOWER on IntegriCloud