summaryrefslogtreecommitdiff
path: root/sys/net/pf_ioctl.c
AgeCommit message (Collapse)Author
2003-01-20It's difficult to create a table by changing its flags.Cedric Berger
2003-01-09minor KNFHenning Brauer
2003-01-09(whitespace) KNF, re-fold -w 80Daniel Hartmeier
2003-01-09Add support for active/inactive tablesets in the kernel.Cedric Berger
Add table definition/initialisation construct in pfctl parser. Add and fix documentation for pf.4 and pf.conf.5. Tested on i386 and sparc64 by myself, macppc by Daniel. ok dhartmei@
2003-01-07Remove table name hashing (pass the name in each ioctl instead), andDaniel Hartmeier
introduce reference counting for tables, they are now automatically created and deleted through referencing rules. Diff partly from cedric@. ok mcbride@, henning@, cedric@
2003-01-06Move initialisation of radix table globals in pfr_initialize()Cedric Berger
ok dhartmei@
2003-01-05Move ifname from pf_addr to pf_addr_wrap, prepare pf_addr_wrap for tableDaniel Hartmeier
name. ok henning@, mcbride@, cedric@
2003-01-04Remove unused pf_add_addr(), ok mcbride@Daniel Hartmeier
2003-01-031) pfr_insert_kentries() cannot return ENOMEM anymore -> make it void.Cedric Berger
2) add new PFR_FLAG_REPLACE for use by pfr_tst_addrs(). 3) add new pfrio_nmatch alias to pfioc_table, set by pfr_tst_addrs(). Tested on i386, sparc64
2003-01-02Require a direction to be specified for rules which do routing.Ryan Thomas McBride
ok dhartmei@ henning@
2003-01-01KNFHenning Brauer
2003-01-01Fix breakage from PF_RULESET_MAX increase, regress tests match again.Daniel Hartmeier
2002-12-31Split scrub rules out from the filter rules in the kernel.Ryan Thomas McBride
Precursor to removing rule.action from skip steps. Also a couple of other small fixes: - s/PF_RULESET_RULE/PF_RULESET_FILTER/ - replacement of 4 with PF_RULESET_MAX in pfvar.h struct ruleset { - error handling in ioctl of an invalid value in rule.action - counting evaluations and matching packets for scrub rules ok henning@ dhartmei@
2002-12-31Use a default state table limit of 10000 entries. This is safe for allDaniel Hartmeier
normal configurations, and sufficient for many. You can always increase it, if you need more concurrent states and have enough memory (65000 for 64MB RAM, for instance). Suggested earlier by henning@. ok mcbride@
2002-12-30KNFHenning Brauer
2002-12-29Add support for radix tables for source and destination of PF rules.Cedric Berger
ok dhartmei@, mcbride@, henning@
2002-12-27Bugfix and better error handling:Ryan Thomas McBride
- set rpool.cur in DIOCCHANGERULE - check to make sure rpool.list is not empty if we're doing translation or routing other than fastroute ok dhartmei@ henning@
2002-12-27Initialize rt_ifp in newly allocated pf_state objects to NULL.Daniel Hartmeier
Solves the crashes in pf_route() with -current. Reports from Michael Lucas and Bjorn Runaker.
2002-12-23Change from array to single pf_pabuf (no longer need multiple buffers asRyan Thomas McBride
we don't need the second list of addresses for DIOCCHANGE* operations) Also get rid of a bug where DIOCBEGINADDRS clears pabuf[1] when pabuf[0] is the one being used. ok henning@ dhartmei@
2002-12-19Clear pf_state.nat_rule pointers when non-main nat rules are removed.Daniel Hartmeier
Unlike with filter rules, nat rules inside anchors might be pointed to.
2002-12-18Store translation rule pointer in state entries, so pfctl -vsn can printDaniel Hartmeier
evaluation, packet, byte and state entry counters similar to -vsr. Helps verify whether/how often translation rules are evaluated/matched. ok frantzen@, henning@
2002-12-18KNFHenning Brauer
2002-12-18Pass skip step values through ioctl interface, pfctl -vvsr shows them,Daniel Hartmeier
main purpose is making them regress-testable.
2002-12-17Merge pf_nat/pf_binat/pf_rdr structs into pf_rule. Simplifies code, allowsRyan Thomas McBride
skip steps on translation rules. Also: - Require a ticket for DIOCCHANGERULE operations to prevent races. - Remove pf_compare_* functions from pf_ioctl.c. DIOCCHANGE* operations use a rule number, and comparisons happen in userland. Testing and fixes from dhartmei@ and frantzen@ ok dhartmei@ henning@
2002-12-13add pqueue and pqid to pf_rule.Henning Brauer
this allows for a second queue on pf_rule. assign packets with tos 0x10 (lowdelay) to this one. if the second queue isn't specified set pqid = qid idea dhartmei@ ok dhartmei@ frantzen@ deraadt@
2002-12-12Pastos in pf_compare_pool(); dhartmei@, mcbride@ ok.Aaron Campbell
2002-12-06Introduce anchors and named rule sets, allowing to load additional ruleDaniel Hartmeier
sets with pfctl and evaluate them from the main rule set using a new type of rule (which will support conditional evaluation soon). Makes maintenance of sub-rulesets simpler for pfctl and daemons. Idea and ok deraadt@
2002-12-01KNFHenning Brauer
2002-12-01- Clean up pf_ioctl mainly by adding new functions to handle cleaning andRyan Thomas McBride
freeing rules. Fixes a number of potential memory leaks and other bugs. - Add new pool_ticket to insure that address pools don't get messed with by someone else while we add rules. - Add a second address pool buffer, so that DIOCCHANGE* operations which use pf_compare* will work correctly. Excellent bug report and anaylsis from DJ Gregor. ok dhartmei@ henning@
2002-11-29Get the address pool in DIOCCHANGEADDR for all operations, preventsRyan Thomas McBride
PF_CHANGE_REMOVE from dereferencing a NULL pointer. Noticed by dhartmei@ ok dhartmei@
2002-11-26fix "pfctl -Fq".Kenjiro Cho
after altq gets flushed, altq forgot that it was enabled since altq is actually detached with an empty ruleset. so, add a variable, pfaltq_running, to remember the running state and re-enable altq when a new ruleset is loaded. noticed, tested, and oked by henning@
2002-11-23KNFTheo de Raadt
2002-11-23kernel code to allow multiple redirection addresses to be specified for natRyan Thomas McBride
and rdr, as well as route-to, dup-to and reply-to. Addresses can be allocated in a number of ways: - masking out the network portion of the address and replacing it - randomly assigning an address in the block - hashing the source address and a key to determine the redirection address - iterating through the addresses sequentially (this is the only allocation scheme which works when a list of addresses is specified) ok dhartmei@ henning@
2002-11-12Missing splx.Mike Pechkin
dhartmei@ ok
2002-11-07Short-circuit evaluation can leave invalid pointers, closes PR2874.Daniel Hartmeier
2002-11-02Compare dynamic addresses correctly in pf_compare_*: check the interface nameRyan Thomas McBride
rather than the ip address if it exists. ok dhartmei@ henning@
2002-10-25Compare pf_rule->label in pf_compare_rules(), too.Daniel Hartmeier
Found by DJ Gregor.
2002-10-22check the correct return value from ifunit()Ryan Thomas McBride
(returns ifp, not ifname) ok dhartmei@ ish@ camield@ henning@
2002-10-20Move pf_compare_(rules|nats|binats|rdrs) to pf_ioctl.c. Simplifies andRyan Thomas McBride
reduces cross-file dependancies. ok dhartmei@ ish@ henning@
2002-10-08the first step of pf/altq merge.Kenjiro Cho
this commit is to allow further development in both userland and kernel. the goal is to replace altq's classifier by pf(4). - make pf tag a queue id to mbuf and make altq read the queue id - merge altq config into pf.conf(5) ok dhartmei@, henning@
2002-10-07-Wsign-compare cleanDaniel Hartmeier
2002-08-12Use state tree instead of separate (flat) list to find NAT proxy ports,Daniel Hartmeier
allows to use the same proxy port with different external peers. From Ryan McBride
2002-07-05fix a small bug I found while installing a -current pf firewall at aHenning Brauer
client some days ago: if you had a rulefile with "set loginterface <interface>" and loaded through pfctl -e -f /etc/pf.conf, pfctl -si didn't display the interface stats, because on DIOCSTART pf_status.ifname was cleared and enableing is done after loading the ruleset. similar for DIOCCLRSTATUS, remember pf_status.ifname there as well. added feature: On DIOCSETSTATUSIF unset the statusinterface if pi->ifname is empty. ok dhartmei@
2002-06-16Missing braces around else case, fixes a kernel crash introduced in r1.5 ifAaron Campbell
a non-existent interface is passed to "pfctl -l". Reported by grange@disorder.ru.
2002-06-11rework pfctl statistics displayHenning Brauer
move FCNT_NAMES from pfvar.h to pfctl_parser.h, only used by pfctl some input by nick@ ok frantzen@, dhartmei@
2002-06-10#include <sys/timeout.h>, from Chris KuetheDaniel Hartmeier
2002-06-10Don't #include <sys/malloc.h>Daniel Hartmeier
2002-06-09Make pf_nat.saddr/daddr a pf_rule_addr instead of pf_addr_wrap, so itDaniel Hartmeier
includes ports and operator.
2002-06-09new file sys/net/pf_ioctl.cPhilipp Buehler
functions moved from pf.c to there ok dhartmei@, frantzen@ testing myself + henning@, kernel & userland utils fine