summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pf_print_state.c
AgeCommit message (Collapse)Author
2008-06-10save somespace in the state by collapsing two 8 bit ints used as booleansHenning Brauer
into one 8 bit flags field. shrinks the state structure by 4 bytes on 32bit archs ryan ok
2008-06-10in verbose mode indicate which states are sloppy, ryan reyk theoHenning Brauer
2008-05-29Second half of PF state table rearrangement.Ryan Thomas McBride
- Mechanical change: Use arrays for state key pointers in pf_state, and addr/port in pf_state_key, to allow the use of indexes. - Fix NAT, pfsync, pfctl, and tcpdump to handle the new state structures. In struct pfsync_state, both state keys are included even when identical. - Also fix some bugs discovered in the existing code during testing. (in particular, "block return" for TCP packets was not returning an RST) ok henning beck deraadt tested by otto dlg beck laurent Special thanks to users Manuel Pata and Emilio Perea who did enough testing to actually find some bugs.
2008-05-09Add support to kill states by rule label or state id.Marco Pfatschbacher
Fix printing of the state id in pfctl -ss -vv. Remove the psnk_af hack to return the number of killed states. OK markus, beck. "I like it" henning, deraadt. Manpage help from jmc.
2007-08-30add support for address ranges ("from 10.1.2.50 - 10.1.3.75") in from/toDaniel Hartmeier
criteria. ok mcbride@
2007-05-31Cope with new ioctl interface (use pfsync_state instead of pf_state)Ryan Thomas McBride
ok henning@ toby@ pyr@
2007-03-01be more careful with mixing &/| with &&/||, ok ottoTheo de Raadt
2006-03-14implement a Unicast Reverse Path Forwarding (uRPF) check for pf(4)Damien Miller
which optionally verifies that a packet is received on the interface that holds the route back to the packet's source address. This makes it an automatic ingress filter, but only when routing is fully symmetric. bugfix feedback claudio@; ok claudio@ and dhartmei@
2005-11-04crank pf_state and pf_src_node byte and packet counters to u_in64_t, sinceRyan Thomas McBride
we're breaking pfsync compatibility this cycle anyways. Requested by djm@, ok henning@, 'wheee!' deraadt@
2005-05-24Identify states that will not be synchronised in pfctl -vvss output.Christopher Pascoe
ok mcbride@ henning@
2004-12-10allow pf to filter on route labelsHenning Brauer
pass in from route dtag keep state queue reallyslow tested by Gabriel Kihlman <gk@stacken.kth.se> and Michael Knudsen <e@molioner.dk> and ryan ok ryan
2004-02-10fix at leats the worst of Cedric "KNF is for everybody but me" Berger's fuckupHenning Brauer
2004-01-26we must not omit printing the netmask when it is all zero, this is dangerous -Henning Brauer
1.2.3.4/0 is not equal to 1.2.3.4... this "helped" to make failure already only omit the netmask when both the addr and the mask itself are all zero (the "any" case) ok dhartmei@ mcbride@
2003-12-31Many improvements to the handling of interfaces in PF.Cedric Berger
1) PF should do the right thing when unplugging/replugging or cloning/ destroying NICs. 2) Rules can be loaded in the kernel for not-yet-existing devices (USB, PCMCIA, Cardbus). For example, it is valid to write: "pass in on kue0" before kue USB is plugged in. 3) It is possible to write rules that apply to group of interfaces (drivers), like "pass in on ppp all" 4) There is a new ":peer" modifier that completes the ":broadcast" and ":network" modifiers. 5) There is a new ":0" modifier that will filter out interface aliases. Can also be applied to DNS names to restore original PF behaviour. 6) The dynamic interface syntax (foo) has been vastly improved, and now support multiple addresses, v4 and v6 addresses, and all userland modifiers, like "pass in from (fxp0:network)" 7) Scrub rules now support the !if syntax. 8) States can be bound to the specific interface that created them or to a group of interfaces for example: - pass all keep state (if-bound) - pass all keep state (group-bound) - pass all keep state (floating) 9) The default value when only keep state is given can be selected by using the "set state-policy" statement. 10) "pfctl -ss" will now print the interface scope of the state. This diff change the pf_state structure slighltly, so you should recompile your userland tools (pfctl, authpf, pflogd, tcpdump...) Tested on i386, sparc, sparc64 by Ryan Tested on macppc, sparc64 by Daniel ok deraadt@ mcbride@
2003-12-27Remove extra \n from pf_print_state().Ryan Thomas McBride
ok deraadt@ cedric@
2003-12-15Add initial support for pf state synchronization over the network.Ryan Thomas McBride
Implemented as an in-kernel multicast IP protocol. Turn it on like this: # ifconfig pfsync0 up syncif fxp0 There is not yet any authentication on this protocol, so the syncif must be on a trusted network. ie, a crossover cable between the two firewalls. NOTABLE CHANGES: - A new index based on a unique (creatorid, stateid) tuple has been added to the state tree. - Updates now appear on the pfsync(4) interface; multiple updates may be compressed into a single update. - Applications which use bpf on pfsync(4) will need modification; packets on pfsync no longer contains regular pf_state structs, but pfsync_state structs which contain no pointers. Much more to come. ok deraadt@
2003-12-15Add support to track stateful connections by source ip. This allows usRyan Thomas McBride
to: - Ensure that clients get a consistent IP mapping with load-balanced translation/routing rules - Limit the number of simultaneous connections a client can make - Limit the number of clients which can connect through a rule ok dhartmei@ deraadt@
2003-07-06knf (cedric did not do it right)Theo de Raadt
2003-07-04KNFHenning Brauer
2003-06-21count packets and bidirectionally on state entries, allowing for fine-grainedDamien Miller
traffic reporting w/ pfsync; ok dhartmei@ Note: ABI change (new fields in struct pf_state), requires a rebuild of pfctl and tcpdump.
2003-06-20some cleanings recommended by lint; dhartmei okTheo de Raadt
2003-06-07in print_host(), don't set the mask blindly to /128 but adhere to theHenning Brauer
address family. fixes the ipv4/128:port output in pfctl -ss.
2003-05-19print out the full netmask; don't just ignore the upper bits in the v4 caseHenning Brauer
helps finding assignment bugs.
2003-05-17Fix proxy related output.Daniel Hartmeier
2003-05-16TCP SYN proxy. Instead of 'keep state' or 'modulate state', one can useDaniel Hartmeier
'synproxy state' for TCP connections. pf will complete the TCP handshake with the active endpoint before passing any packets to the passive end- point, preventing spoofed SYN floods from reaching the passive endpoint. No additional memory requirements, no cookies needed, random initial sequence numbers, uses the existing sequence number modulators to translate packets after the handshakes. ok frantzen@
2003-04-09on "pfctl -vvss", print the anchor rule number when there is one.Cedric Berger
ok dhartmei@ henning@
2003-04-03Simplify pfctl printing code.Cedric Berger
ok dhartmei@ henning@
2003-03-24Add missing return. Fix following buglet:Cedric Berger
# echo "pass in from <veryLONGtableNAME>" | pfctl -nvf- pass in from <veryLONGtableNAME>/0 to any
2003-03-08Remove unneeded #includes, from Andrey Matveev andrushock(at)pisem(dot)netDaniel Hartmeier
2003-01-21Support for TCP window scaling (RFC 1323). ok frantzen@Daniel Hartmeier
2003-01-20Remove unused argument from print_name() and fix two other nitsCamiel Dobbelaar
found by lint. ok henning
2003-01-20Improve pfctl -vvs{r,n} output with rule containing tables.Cedric Berger
Shows the number of entries in the table or if the table is not active. ok dhartmei@, no objections.
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-05Move ifname from pf_addr to pf_addr_wrap, prepare pf_addr_wrap for tableDaniel Hartmeier
name. ok henning@, mcbride@, cedric@
2003-01-04I do not know where this policy of "one .h file for every .c file" comesTheo de Raadt
from, but whoever thought of it is stupid.
2003-01-03Bring in userland code for accessing PF radix tables.Cedric Berger
ok dhartmei@ mcbride@
2002-12-18rule.nr USHRT_MAX -> -1, to detect states whose creating rules areDaniel Hartmeier
already gone.
2002-11-30move unmask back into pf_print_state.c where it was, and please keep it ↵Michael Shalayeff
there; henning@ ok
2002-11-29no need for extra hrs; henning@ okMichael Shalayeff
2002-11-23KNFTheo de Raadt
2002-11-23code to support loading of pf rules with multiple redirection addressesRyan Thomas McBride
(in nat, rdr, route-to, dup-to and reply-to) Syntax looks like this, see pf.conf(5) for details: nat on wi0 proto { tcp, icmp } from any to 192.168.0.2 -> \ 192.168.0.16/29 source-hash random rdr on wi0 proto { tcp } from any to 192.168.0.34 port 22 -> \ { 192.168.0.8/31, 192.168.0.15 } port 22 round-robin ok dhartmei@ henning@
2002-11-02%i -> %d, matches the style of existing code, from millert@Daniel Hartmeier
2002-11-02printf int with %i, not %u. from pilot@monkey.org.Daniel Hartmeier
2002-10-25- more sa_family_tCamiel Dobbelaar
- move unmask code to correct file - whitespace ok mcbride@ dhartmei@
2002-10-22More conversion of "int af" and "u_int8_t af" declarations and functionRyan Thomas McBride
arguments to the more correct and descriptive "sa_family_t af" ok dhartmei@ henning@
2002-07-31KNF, esp. missing prototypesHenning Brauer
2002-07-19Use getnameinfo() instead of gethostbyaddr() to support IPv6 reverseDaniel Hartmeier
lookups with pfctl -r. Makes things actually simpler.
2002-07-18use inet_aton(), until this is made v6 awareTheo de Raadt
2002-06-11print a string for UDP and OTHER state level instead of a numeric levelMike Frantzen
ok dhartmei@, henning@
2002-06-06split out the pf_state printing functions to be used elsewhere, no ↵Michael Shalayeff
functional change; dhartmei@ ok