freebsd-skq/sys
Alexander V. Chernikov 74b22066b0 Make rule table kernel-index rewriting support any kind of objects.
Currently we have tables identified by their names in userland
with internal kernel-assigned indices. This works the following way:

When userland wishes to communicate with kernel to add or change rule(s),
it makes indexed sorted array of table names
(internally ipfw_obj_ntlv entries), and refer to indices in that
array in rule manipulation.
Prior to committing new rule to the ruleset kernel
a) finds all referenced tables, bump their refcounts and change
 values inside the opcodes to be real kernel indices
b) auto-creates all referenced but not existing tables and then
 do a) for them.

Kernel does almost the same when exporting rules to userland:
 prepares array of used tables in all rules in range, and
 prepends it before the actual ruleset retaining actual in-kernel
 indexes for that.

There is also special translation layer for legacy clients which is
able to provide 'real' indices for table names (basically doing atoi()).

While it is arguable that every subsystem really needs names instead of
numbers, there are several things that should be noted:

1) every non-singleton subsystem needs to store its runtime state
somewhere inside ipfw chain (and be able to get it fast)
2) we can't assume object numbers provided by humans will be dense.

Existing nat implementation (O(n) access and LIST inside chain) is a
good example.

Hence the following:
* Convert table-centric rewrite code to be more generic, callback-based
* Move most of the code from ip_fw_table.c to ip_fw_sockopt.c
* Provide abstract API to permit subsystems convert their objects
  between userland string identifier and in-kernel index.
  (See struct opcode_obj_rewrite) for more details
* Create another per-chain index (in next commit) shared among all subsystems
* Convert current NAT44 implementation to use new API, O(1) lookups,
 shared index and names instead of numbers (in next commit).

Sponsored by:	Yandex LLC
2015-04-27 08:29:39 +00:00
..
amd64 STOS/STOSB/STOSW/STOSD/STOSQ instruction emulation. 2015-04-25 19:02:06 +00:00
arm Pass the supplied buffer length instead of a fixed size. 2015-04-27 01:36:16 +00:00
arm64 Add the null implementation of stack_save and stack_save_td. 2015-04-22 12:24:38 +00:00
boot Small change in header order to allow this to compile. 2015-04-27 07:38:46 +00:00
bsm
cam Extend DA_Q_NO_RC16 to MXUB3* devices. 2015-04-21 22:55:52 +00:00
cddl Adjust PROF_ARTIFICIAL_FRAMES in the DTrace profile provider on ARM to 2015-04-25 15:43:12 +00:00
compat Simplify linux_getcwd(), removing code that was longer used. 2015-04-23 08:41:50 +00:00
conf Move common code from sys/i386/i386/mp_machdep.c and 2015-04-24 16:20:56 +00:00
contrib Move ALTQ from contrib to net/altq. The ALTQ code is for many years 2015-04-16 20:22:40 +00:00
crypto In the version of gcc in the FreeBSD tree, this modification was made to 2015-04-16 17:42:52 +00:00
ddb
dev Don't use ifm_data. It was used only for self checking debug. 2015-04-26 21:31:30 +00:00
fs Fix the NFS server's handling of a bogus NFSv2 ROOT RPC. 2015-04-25 00:58:24 +00:00
gdb
geom Move zlib.c from net to libkern. 2015-04-22 14:38:58 +00:00
gnu The GNU Amlogic DTS files have some errors (e.g. bad register 2015-04-11 08:17:39 +00:00
i386 Move common code from sys/i386/i386/mp_machdep.c and 2015-04-24 16:20:56 +00:00
isa
kern fd: plug an always overwritten initialization in fdalloc 2015-04-26 17:27:55 +00:00
kgssapi
libkern Move zlib.c from net to libkern. 2015-04-22 14:38:58 +00:00
mips Start enabling the available GPIO pins on the Carambola 2. 2015-04-12 00:02:32 +00:00
modules Rename the kld for oce(4) to if_oce.ko. ifconfig(8) has special knowledge 2015-04-24 14:47:53 +00:00
net Currently there is no easy way to specify net.isr.maxthreads = all cpus. We need 2015-04-25 16:12:06 +00:00
net80211 iwn, wlan: fix typos 2015-04-10 20:55:17 +00:00
netgraph Move zlib.c from net to libkern. 2015-04-22 14:38:58 +00:00
netinet Make rule table kernel-index rewriting support any kind of objects. 2015-04-27 08:29:39 +00:00
netinet6 Remove now unneded KEY_FREESP() for case when ipsec[46]_process_packet() 2015-04-27 01:11:09 +00:00
netipsec Make ipsec_in_reject() static. We use ipsec[46]_in_reject() instead. 2015-04-27 01:12:51 +00:00
netnatm
netpfil Make rule table kernel-index rewriting support any kind of objects. 2015-04-27 08:29:39 +00:00
netsmb
nfs Avoid closing unallocated socket in case socreate fails. 2015-02-28 20:30:29 +00:00
nfsclient Remove some oldnfs remnants. 2015-04-18 16:08:06 +00:00
nfsserver Use M_SIZE() instead of hand-crafted (and mostly correct) NFSMSIZ() macro 2015-01-07 17:22:56 +00:00
nlm
ofed fd: remove filedesc argument from fdclose 2015-04-11 15:40:28 +00:00
opencrypto Move zlib.c from net to libkern. 2015-04-22 14:38:58 +00:00
pc98 Fix kernel build ${MACHINE} path 2015-04-16 22:34:10 +00:00
powerpc Implement hwpmc(4) for Freescale e500 core. 2015-04-18 21:39:17 +00:00
rpc Remove hard limits on number of accepting NFS connections. 2015-04-07 10:25:27 +00:00
security cred: add proc_set_cred helper 2015-03-16 00:10:03 +00:00
sparc64 Update this driver to not save copies of registers that are no longer used 2015-04-24 13:12:04 +00:00
sys Cleanup a bit the clang attributes for type safety checking. 2015-04-25 18:17:08 +00:00
teken
tools
ufs Limit the number of cylinder groups that will be searched when 2015-04-24 23:27:50 +00:00
vm Revert r281451. It causes a panic/hang early in boot for a number of 2015-04-24 17:03:53 +00:00
x86 Move common code from sys/i386/i386/mp_machdep.c and 2015-04-24 16:20:56 +00:00
xdr
xen Use SYSCTL_OUT_STR() to return strings. 2015-03-14 21:40:24 +00:00
Makefile