1 .\" $OpenBSD: pf.4,v 1.54 2004/12/22 17:17:55 dhartmei Exp $
3 .\" Copyright (C) 2001, Kjell Wooding. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. Neither the name of the project nor the names of its contributors
14 .\" may be used to endorse or promote products derived from this software
15 .\" without specific prior written permission.
17 .\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 Packet filtering takes place in the kernel.
43 allows userland processes to control the
44 behavior of the packet filter through an
47 There are commands to enable and disable the filter, load rulesets,
48 add and remove individual rules or state table entries,
49 and retrieve statistics.
50 The most commonly used functions are covered by
53 Manipulations like loading a ruleset that involve more than a single
55 call require a so-called
57 which prevents the occurrence of
58 multiple concurrent manipulations.
62 parameter structures that refer to packet data (like
63 addresses and ports) are generally expected in network byte-order.
65 Rules and address tables are contained in so-called
69 request, if the anchor field of the argument structure is empty,
70 the kernel will use the default anchor (i.e., the main ruleset)
72 Anchors are specified by name and may be nested, with components
75 characters, similar to how file system hierarchies are laid out.
76 The final component of the anchor path is the anchor under which
77 operations will be performed.
80 supports the following
82 commands, available through
84 .Bl -tag -width xxxxxx
86 Start the packet filter.
88 Stop the packet filter.
90 Start the ALTQ bandwidth control system (see
93 Stop the ALTQ bandwidth control system.
94 .It Dv DIOCBEGINADDRS Fa "struct pfioc_pooladdr *pp"
96 struct pfioc_pooladdr {
104 char anchor[MAXPATHLEN];
105 struct pf_pooladdr addr;
109 Clear the buffer address pool and get a
117 .It Dv DIOCADDADDR Fa "struct pfioc_pooladdr *pp"
121 to the buffer address pool to be used in the following
126 All other members of the structure are ignored.
127 .It Dv DIOCADDRULE Fa "struct pfioc_rule *pr"
132 u_int32_t pool_ticket;
134 char anchor[MAXPATHLEN];
135 char anchor_call[MAXPATHLEN];
142 at the end of the inactive ruleset.
145 obtained through a preceding
153 must also be called if any pool addresses are required.
156 name indicates the anchor in which to append the rule.
161 .It Dv DIOCADDALTQ Fa "struct pfioc_altq *pa"
162 Add an ALTQ discipline or queue.
171 .It Dv DIOCGETRULES Fa "struct pfioc_rule *pr"
178 of rules in the active ruleset.
179 .It Dv DIOCGETRULE Fa "struct pfioc_rule *pr"
186 obtained through a preceding
189 .It Dv DIOCGETADDRS Fa "struct pfioc_pooladdr *pp"
196 of pool addresses in the rule specified with
201 .It Dv DIOCGETADDR Fa "struct pfioc_pooladdr *pp"
206 from the rule specified with
213 obtained through a preceding
216 .It Dv DIOCGETALTQS Fa "struct pfioc_altq *pa"
223 of queues in the active list.
224 .It Dv DIOCGETALTQ Fa "struct pfioc_altq *pa"
225 Get the queueing discipline
231 obtained through a preceding
234 .It Dv DIOCGETQSTATS Fa "struct pfioc_qstats *pq"
235 Get the statistics on a queue.
237 struct pfioc_qstats {
246 This call fills in a pointer to the buffer of statistics
250 for the queue specified by
252 .It Dv DIOCGETRULESETS Fa "struct pfioc_ruleset *pr"
254 struct pfioc_ruleset {
256 char path[MAXPATHLEN];
257 char name[PF_ANCHOR_NAME_SIZE];
263 of rulesets (i.e., anchors) directly attached to the anchor named by
265 for use in subsequent
268 Nested anchors, since they are not directly attached to the given
269 anchor, will not be included.
272 if the given anchor does not exist.
273 .It Dv DIOCGETRULESET Fa "struct pfioc_ruleset *pr"
274 Get a ruleset (i.e., an anchor)
278 from the given anchor
280 the maximum number of which can be obtained from a preceding
285 if the given anchor does not exist or
287 if another process is concurrently updating a ruleset.
288 .It Dv DIOCADDSTATE Fa "struct pfioc_state *ps"
293 struct pf_state state;
296 .It Dv DIOCGETSTATE Fa "struct pfioc_state *ps"
297 Extract the entry with the specified number
299 from the state table.
300 .It Dv DIOCKILLSTATES Fa "struct pfioc_state_kill *psk"
301 Remove matching entries from the state table.
302 This ioctl returns the number of killed states in
305 struct pfioc_state_kill {
308 struct pf_rule_addr psk_src;
309 struct pf_rule_addr psk_dst;
310 char psk_ifname[IFNAMSIZ];
313 .It Dv DIOCCLRSTATES Fa "struct pfioc_state_kill *psk"
326 .It Dv DIOCSETSTATUSIF Fa "struct pfioc_if *pi"
327 Specify the interface for which statistics are accumulated.
330 char ifname[IFNAMSIZ];
333 .It Dv DIOCGETSTATUS Fa "struct pf_status *s"
334 Get the internal packet filter statistics.
337 u_int64_t counters[PFRES_MAX];
338 u_int64_t lcounters[LCNT_MAX];
339 u_int64_t fcounters[FCNT_MAX];
340 u_int64_t scounters[SCNT_MAX];
341 u_int64_t pcounters[2][2][3];
342 u_int64_t bcounters[2][2];
350 char ifname[IFNAMSIZ];
354 Clear the internal packet filter statistics.
355 .It Dv DIOCNATLOOK Fa "struct pfioc_natlook *pnl"
356 Look up a state table entry by source and destination addresses and ports.
358 struct pfioc_natlook {
359 struct pf_addr saddr;
360 struct pf_addr daddr;
361 struct pf_addr rsaddr;
362 struct pf_addr rdaddr;
372 .It Dv DIOCSETDEBUG Fa "u_int32_t *level"
375 enum { PF_DEBUG_NONE, PF_DEBUG_URGENT, PF_DEBUG_MISC,
378 .It Dv DIOCGETSTATES Fa "struct pfioc_states *ps"
379 Get state table entries.
381 struct pfioc_states {
385 struct pf_state *psu_states;
387 #define ps_buf ps_u.psu_buf
388 #define ps_states ps_u.psu_states
394 is zero, all states will be gathered into
398 will be set to the size they take in memory (i.e.,
399 .Li sizeof(struct pf_state) * nr ) .
402 is non-zero, as many states that can fit into
404 as possible will be gathered, and
406 will be updated to the size those rules take in memory.
407 .It Dv DIOCCHANGERULE Fa "struct pfioc_rule *pcr"
410 in the ruleset specified by
413 The type of operation to be performed is indicated by
415 which can be any of the following:
417 enum { PF_CHANGE_NONE, PF_CHANGE_ADD_HEAD, PF_CHANGE_ADD_TAIL,
418 PF_CHANGE_ADD_BEFORE, PF_CHANGE_ADD_AFTER,
419 PF_CHANGE_REMOVE, PF_CHANGE_GET_TICKET };
423 must be set to the value obtained with
424 .Dv PF_CHANGE_GET_TICKET
425 for all actions except
426 .Dv PF_CHANGE_GET_TICKET .
428 must be set to the value obtained with the
430 call for all actions except
433 .Dv PF_CHANGE_GET_TICKET .
435 indicates to which anchor the operation applies.
437 indicates the rule number against which
438 .Dv PF_CHANGE_ADD_BEFORE ,
439 .Dv PF_CHANGE_ADD_AFTER ,
443 .\" It Dv DIOCCHANGEALTQ Fa "struct pfioc_altq *pcr"
444 .It Dv DIOCCHANGEADDR Fa "struct pfioc_pooladdr *pca"
445 Add or remove the pool address
447 from the rule specified by
452 .It Dv DIOCSETTIMEOUT Fa "struct pfioc_tm *pt"
460 Set the state timeout of
464 The old value will be placed into
466 For possible values of
472 .It Dv DIOCGETTIMEOUT Fa "struct pfioc_tm *pt"
473 Get the state timeout of
475 The value will be placed into the
478 .It Dv DIOCCLRRULECTRS
479 Clear per-rule statistics.
480 .It Dv DIOCSETLIMIT Fa "struct pfioc_limit *pl"
481 Set the hard limits on the memory pools used by the packet filter.
488 enum { PF_LIMIT_STATES, PF_LIMIT_SRC_NODES, PF_LIMIT_FRAGS };
490 .It Dv DIOCGETLIMIT Fa "struct pfioc_limit *pl"
493 for the memory pool indicated by
495 .It Dv DIOCRCLRTABLES Fa "struct pfioc_table *io"
497 All the ioctls that manipulate radix tables
498 use the same structure described below.
502 contains on exit the number of tables deleted.
505 struct pfr_table pfrio_table;
514 u_int32_t pfrio_ticket;
516 #define pfrio_exists pfrio_nadd
517 #define pfrio_nzero pfrio_nadd
518 #define pfrio_nmatch pfrio_nadd
519 #define pfrio_naddr pfrio_size2
520 #define pfrio_setflag pfrio_size2
521 #define pfrio_clrflag pfrio_nadd
523 .It Dv DIOCRADDTABLES Fa "struct pfioc_table *io"
524 Create one or more tables.
526 .Va pfrio_buffer[pfrio_size]
532 contains the number of tables effectively created.
535 char pfrt_anchor[MAXPATHLEN];
536 char pfrt_name[PF_TABLE_NAME_SIZE];
537 u_int32_t pfrt_flags;
541 .It Dv DIOCRDELTABLES Fa "struct pfioc_table *io"
542 Delete one or more tables.
544 .Va pfrio_buffer[pfrio_size]
550 contains the number of tables effectively deleted.
551 .It Dv DIOCRGETTABLES Fa "struct pfioc_table *io"
552 Get the list of all tables.
554 .Va pfrio_buffer[pfrio_size]
555 contains a valid writeable buffer for
560 contains the number of tables written into the buffer.
561 If the buffer is too small, the kernel does not store anything but just
562 returns the required buffer size, without error.
563 .It Dv DIOCRGETTSTATS Fa "struct pfioc_table *io"
566 but is used to get an array of
571 struct pfr_table pfrts_t;
572 u_int64_t pfrts_packets
573 [PFR_DIR_MAX][PFR_OP_TABLE_MAX];
574 u_int64_t pfrts_bytes
575 [PFR_DIR_MAX][PFR_OP_TABLE_MAX];
576 u_int64_t pfrts_match;
577 u_int64_t pfrts_nomatch;
580 int pfrts_refcnt[PFR_REFCNT_MAX];
582 #define pfrts_name pfrts_t.pfrt_name
583 #define pfrts_flags pfrts_t.pfrt_flags
585 .It Dv DIOCRCLRTSTATS Fa "struct pfioc_table *io"
586 Clear the statistics of one or more tables.
588 .Va pfrio_buffer[pfrio_size]
594 contains the number of tables effectively cleared.
595 .It Dv DIOCRCLRADDRS Fa "struct pfioc_table *io"
596 Clear all addresses in a table.
599 contains the table to clear.
602 contains the number of addresses removed.
603 .It Dv DIOCRADDADDRS Fa "struct pfioc_table *io"
604 Add one or more addresses to a table.
607 contains the table ID and
608 .Va pfrio_buffer[pfrio_size]
614 contains the number of addresses effectively added.
618 struct in_addr _pfra_ip4addr;
619 struct in6_addr _pfra_ip6addr;
626 #define pfra_ip4addr pfra_u._pfra_ip4addr
627 #define pfra_ip6addr pfra_u._pfra_ip6addr
629 .It Dv DIOCRDELADDRS Fa "struct pfioc_table *io"
630 Delete one or more addresses from a table.
633 contains the table ID and
634 .Va pfrio_buffer[pfrio_size]
637 structures to delete.
640 contains the number of addresses effectively deleted.
641 .It Dv DIOCRSETADDRS Fa "struct pfioc_table *io"
642 Replace the content of a table by a new address list.
643 This is the most complicated command, which uses all the structure members.
647 contains the table ID and
648 .Va pfrio_buffer[pfrio_size]
649 contains the new list of
655 .Va pfrio_buffer[pfrio_size..pfrio_size2]
656 must be a writeable buffer, into which the kernel can copy the
657 addresses that have been deleted during the replace operation.
663 contain the number of addresses deleted, added, and changed by the
669 will point to the size of the buffer used, exactly like
671 .It Dv DIOCRGETADDRS Fa "struct pfioc_table *io"
672 Get all the addresses of a table.
675 contains the table ID and
676 .Va pfrio_buffer[pfrio_size]
677 contains a valid writeable buffer for
682 contains the number of addresses written into the buffer.
683 If the buffer was too small, the kernel does not store anything but just
684 returns the required buffer size, without returning an error.
685 .It Dv DIOCRGETASTATS Fa "struct pfioc_table *io"
688 but is used to get an array of
693 struct pfr_addr pfras_a;
694 u_int64_t pfras_packets
695 [PFR_DIR_MAX][PFR_OP_ADDR_MAX];
696 u_int64_t pfras_bytes
697 [PFR_DIR_MAX][PFR_OP_ADDR_MAX];
701 .It Dv DIOCRCLRASTATS Fa "struct pfioc_table *io"
702 Clear the statistics of one or more addresses.
705 contains the table ID and
706 .Va pfrio_buffer[pfrio_size]
712 contains the number of addresses effectively cleared.
713 .It Dv DIOCRTSTADDRS Fa "struct pfioc_table *io"
714 Test if the given addresses match a table.
717 contains the table ID and
718 .Va pfrio_buffer[pfrio_size]
722 On exit, the kernel updates the
726 member appropriately.
727 .It Dv DIOCRSETTFLAGS Fa "struct pfioc_table *io"
731 .Dv PFR_TFLAG_PERSIST
734 .Va pfrio_buffer[pfrio_size]
739 contains the flags to add, while
741 contains the flags to remove.
746 contain the number of tables altered or deleted by the kernel.
747 Yes, tables can be deleted if one removes the
748 .Dv PFR_TFLAG_PERSIST
749 flag of an unreferenced table.
750 .It Dv DIOCRINADEFINE Fa "struct pfioc_table *io"
751 Defines a table in the inactive set.
754 contains the table ID and
755 .Va pfrio_buffer[pfrio_size]
758 structures to put in the table.
759 A valid ticket must also be supplied to
763 contains 0 if the table was already defined in the inactive list
764 or 1 if a new table has been created.
766 contains the number of addresses effectively put in the table.
767 .It Dv DIOCXBEGIN Fa "struct pfioc_trans *io"
770 int size; /* number of elements */
771 int esize; /* size of each element in bytes */
772 struct pfioc_trans_e {
774 char anchor[MAXPATHLEN];
780 Clear all the inactive rulesets specified in the
783 For each ruleset, a ticket is returned for subsequent "add rule" ioctls,
790 Ruleset types, identified by
792 include the following:
794 .Bl -tag -width PF_RULESET_FILTER -offset ind -compact
795 .It Dv PF_RULESET_SCRUB
796 Scrub (packet normalization) rules.
797 .It Dv PF_RULESET_FILTER
799 .It Dv PF_RULESET_NAT
800 NAT (Network Address Translation) rules.
801 .It Dv PF_RULESET_BINAT
802 Bidirectional NAT rules.
803 .It Dv PF_RULESET_RDR
805 .It Dv PF_RULESET_ALTQ
807 .It Dv PF_RULESET_TABLE
810 .It Dv DIOCXCOMMIT Fa "struct pfioc_trans *io"
811 Atomically switch a vector of inactive rulesets to the active rulesets.
812 This call is implemented as a standard two-phase commit, which will either
813 fail for all rulesets or completely succeed.
814 All tickets need to be valid.
817 if another process is concurrently updating some of the same rulesets.
818 .It Dv DIOCXROLLBACK Fa "struct pfioc_trans *io"
819 Clean up the kernel by undoing all changes that have taken place on the
820 inactive rulesets since the last
823 will silently ignore rulesets for which the ticket is invalid.
824 .It Dv DIOCSETHOSTID Fa "u_int32_t *hostid"
825 Set the host ID, which is used by
827 to identify which host created state table entries.
829 Flush the passive OS fingerprint table.
830 .It Dv DIOCOSFPADD Fa "struct pf_osfp_ioctl *io"
832 struct pf_osfp_ioctl {
833 struct pf_osfp_entry {
834 SLIST_ENTRY(pf_osfp_entry) fp_entry;
836 char fp_class_nm[PF_OSFP_LEN];
837 char fp_version_nm[PF_OSFP_LEN];
838 char fp_subtype_nm[PF_OSFP_LEN];
840 pf_tcpopts_t fp_tcpopts;
852 Add a passive OS fingerprint to the table.
855 to the packed fingerprint,
856 .Va fp_os.fp_class_nm
857 to the name of the class (Linux, Windows, etc),
858 .Va fp_os.fp_version_nm
859 to the name of the version (NT, 95, 98), and
860 .Va fp_os.fp_subtype_nm
861 to the name of the subtype or patchlevel.
870 are set to the TCP MSS, the TCP window size, the IP length, the IP TTL,
871 the number of TCP options, and the TCP window scaling constant of the
872 TCP SYN packet, respectively.
876 member is filled according to the
883 member contains packed TCP options.
885 .Dv PF_OSFP_TCPOPT_BITS
886 bits in the packed value.
887 Options include any of
888 .Dv PF_OSFP_TCPOPT_NOP ,
889 .Dv PF_OSFP_TCPOPT_SACK ,
890 .Dv PF_OSFP_TCPOPT_WSCALE ,
891 .Dv PF_OSFP_TCPOPT_MSS ,
893 .Dv PF_OSFP_TCPOPT_TS .
897 member is not used with this ioctl.
899 The structure's slack space must be zeroed for correct operation;
901 the whole structure to zero before filling and sending to the kernel.
902 .It Dv DIOCOSFPGET Fa "struct pf_osfp_ioctl *io"
903 Get the passive OS fingerprint number
905 from the kernel's fingerprint list.
906 The rest of the structure members will come back filled.
907 Get the whole list by repeatedly incrementing the
909 number until the ioctl returns
911 .It Dv DIOCGETSRCNODES Fa "struct pfioc_src_nodes *psn"
913 struct pfioc_src_nodes {
917 struct pf_src_node *psu_src_nodes;
919 #define psn_buf psn_u.psu_buf
920 #define psn_src_nodes psn_u.psu_src_nodes
924 Get the list of source nodes kept by sticky addresses and source
926 The ioctl must be called once with
929 If the ioctl returns without error,
931 will be set to the size of the buffer required to hold all the
933 structures held in the table.
934 A buffer of this size should then be allocated, and a pointer to this buffer
937 The ioctl must then be called again to fill this buffer with the actual
941 will be set to the length of the buffer actually used.
942 .It Dv DIOCCLRSRCNODES
943 Clear the tree of source tracking nodes.
944 .It Dv DIOCIGETIFACES Fa "struct pfioc_iface *io"
945 Get the list of interfaces and interface drivers known to
947 All the ioctls that manipulate interfaces
948 use the same structure described below:
951 char pfiio_name[IFNAMSIZ];
959 #define PFI_FLAG_GROUP 0x0001 /* gets groups of interfaces */
960 #define PFI_FLAG_INSTANCE 0x0002 /* gets single interfaces */
961 #define PFI_FLAG_ALLMASK 0x0003
966 can be used to restrict the search to a specific interface or driver.
967 .Va pfiio_buffer[pfiio_size]
968 is the user-supplied buffer for returning the data.
971 represents the number of
973 entries that can fit into the buffer.
974 The kernel will replace this value by the real number of entries it wants
978 .Li sizeof(struct pfi_if) .
982 .Dv PFI_FLAG_INSTANCE ,
983 or both, to tell the kernel to return a group of interfaces
984 (drivers, like "fxp"), real interface instances (like "fxp1") or both.
985 The data is returned in the
987 structure described below:
990 char pfif_name[IFNAMSIZ];
991 u_int64_t pfif_packets[2][2][2];
992 u_int64_t pfif_bytes[2][2][2];
993 u_int64_t pfif_addcnt;
994 u_int64_t pfif_delcnt;
1001 #define PFI_IFLAG_GROUP 0x0001 /* group of interfaces */
1002 #define PFI_IFLAG_INSTANCE 0x0002 /* single instance */
1003 #define PFI_IFLAG_CLONABLE 0x0010 /* clonable group */
1004 #define PFI_IFLAG_DYNAMIC 0x0020 /* dynamic group */
1005 #define PFI_IFLAG_ATTACHED 0x0040 /* interface attached */
1007 .It Dv DIOCICLRISTATS Fa "struct pfioc_iface *io"
1008 Clear the statistics counters of one or more interfaces.
1012 can be used to select which interfaces need to be cleared.
1013 The filtering process is the same as for
1014 .Dv DIOCIGETIFACES .
1016 will be set by the kernel to the number of interfaces and drivers
1017 that have been cleared.
1018 .It Dv DIOCSETIFFLAG Fa "struct pfioc_iface *io"
1019 Set the user setable flags (described below) of the pf internal interface
1021 The filtering process is the same as for
1022 .Dv DIOCIGETIFACES .
1024 #define PFI_IFLAG_SKIP 0x0100 /* skip interface */
1025 #define PFI_IFLAG_SETABLE_MASK 0x0100 /* mask */
1027 .It Dv DIOCCLRIFFLAG Fa "struct pfioc_iface *io"
1030 above but clears the flags.
1033 .Bl -tag -width /dev/pf -compact
1035 packet filtering device.
1038 The following example demonstrates how to use the
1040 command to find the internal host/port of a NATed connection:
1042 #include <sys/types.h>
1043 #include <sys/socket.h>
1044 #include <sys/ioctl.h>
1045 #include <sys/fcntl.h>
1047 #include <netinet/in.h>
1048 #include <net/pfvar.h>
1054 read_address(const char *s)
1058 sscanf(s, "%i.%i.%i.%i", &a, &b, &c, &d);
1059 return htonl(a << 24 | b << 16 | c << 8 | d);
1063 print_address(u_int32_t a)
1066 printf("%d.%d.%d.%d", a >> 24 & 255, a >> 16 & 255,
1067 a >> 8 & 255, a & 255);
1071 main(int argc, char *argv[])
1073 struct pfioc_natlook nl;
1077 printf("%s <gwy addr> <gwy port> <ext addr> <ext port>\\n",
1082 dev = open("/dev/pf", O_RDWR);
1084 err(1, "open(\\"/dev/pf\\") failed");
1086 memset(&nl, 0, sizeof(struct pfioc_natlook));
1087 nl.saddr.v4.s_addr = read_address(argv[1]);
1088 nl.sport = htons(atoi(argv[2]));
1089 nl.daddr.v4.s_addr = read_address(argv[3]);
1090 nl.dport = htons(atoi(argv[4]));
1092 nl.proto = IPPROTO_TCP;
1093 nl.direction = PF_IN;
1095 if (ioctl(dev, DIOCNATLOOK, &nl))
1096 err(1, "DIOCNATLOOK");
1098 printf("internal host ");
1099 print_address(nl.rsaddr.v4.s_addr);
1100 printf(":%u\\n", ntohs(nl.rsport));
1115 packet filtering mechanism first appeared in