Refactor the source for ipfw2.
authorBill Yuan <bycn82@gmail.com>
Thu, 4 Dec 2014 14:56:56 +0000 (22:56 +0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 12 Mar 2015 21:23:54 +0000 (14:23 -0700)
39 files changed:
lib/libipfw2/Makefile
lib/libipfw2/basic/Makefile
lib/libipfw2/basic/ipfw2_basic.c [moved from lib/libipfw2/basic/ipfw_basic.c with 99% similarity]
lib/libipfw2/basic/ipfw2_basic.h [moved from lib/libipfw2/basic/ipfw_basic.h with 96% similarity]
lib/libipfw2/dummynet/Makefile
lib/libipfw2/dummynet/ipfw2_dummynet.c [moved from lib/libipfw2/dummynet/ipfw_dummynet.c with 99% similarity]
lib/libipfw2/dummynet/ipfw2_dummynet.h [moved from lib/libipfw2/dummynet/ipfw_dummynet.h with 96% similarity]
lib/libipfw2/layer2/Makefile
lib/libipfw2/layer2/ipfw2_layer2.c [moved from lib/libipfw2/layer2/ipfw_layer2.c with 99% similarity]
lib/libipfw2/layer2/ipfw2_layer2.h [moved from lib/libipfw2/layer2/ipfw_layer2.h with 96% similarity]
lib/libipfw2/layer4/Makefile
lib/libipfw2/layer4/ipfw2_layer4.c [moved from lib/libipfw2/layer4/ipfw_layer4.c with 99% similarity]
lib/libipfw2/layer4/ipfw2_layer4.h [moved from lib/libipfw2/layer4/ipfw_layer4.h with 96% similarity]
lib/libipfw2/nat/Makefile
lib/libipfw2/nat/ipfw2_nat.c [moved from lib/libipfw2/nat/ipfw_nat.c with 99% similarity]
lib/libipfw2/nat/ipfw2_nat.h [moved from lib/libipfw2/nat/ipfw_nat.h with 97% similarity]
sbin/ipfw2/ipfw2.c
sys/net/dummynet2/Makefile
sys/net/dummynet2/ip_dummynet2.c [moved from sys/net/dummynet2/ip_dummynet.c with 99% similarity]
sys/net/dummynet2/ip_dummynet2.h [moved from sys/net/dummynet2/ip_dummynet.h with 100% similarity]
sys/net/dummynet2/ip_dummynet2_glue.c [moved from sys/net/dummynet2/ip_dummynet_glue.c with 100% similarity]
sys/net/ipfw2/ip_fw.h
sys/net/ipfw2/ip_fw2.c
sys/net/ipfw2/ip_fw2.h
sys/net/ipfw2/ip_fw2_glue.c
sys/net/ipfw2_basic/Makefile
sys/net/ipfw2_basic/ip_fw2_basic.c [moved from sys/net/ipfw2_basic/ip_fw_basic.c with 99% similarity]
sys/net/ipfw2_basic/ip_fw2_basic.h [moved from sys/net/ipfw2_basic/ip_fw_basic.h with 100% similarity]
sys/net/ipfw2_layer2/Makefile
sys/net/ipfw2_layer2/ip_fw2_layer2.c [moved from sys/net/ipfw2_layer2/ip_fw_layer2.c with 94% similarity]
sys/net/ipfw2_layer2/ip_fw2_layer2.h [moved from sys/net/ipfw2_layer2/ip_fw_layer2.h with 100% similarity]
sys/net/ipfw2_layer4/Makefile
sys/net/ipfw2_layer4/ip_fw2_layer4.c [moved from sys/net/ipfw2_layer4/ip_fw_layer4.c with 96% similarity]
sys/net/ipfw2_layer4/ip_fw2_layer4.h [moved from sys/net/ipfw2_layer4/ip_fw_layer4.h with 100% similarity]
sys/net/ipfw2_nat/Makefile
sys/net/ipfw2_nat/ip_fw2_nat.c [moved from sys/net/ipfw2_nat/ip_fw_nat.c with 98% similarity]
sys/net/ipfw2_nat/ip_fw2_nat.h [moved from sys/net/ipfw2_nat/ip_fw_nat.h with 100% similarity]
sys/netinet/in.h
sys/netinet/raw_ip.c

index 50eae3a..7f693fb 100644 (file)
@@ -1,7 +1,7 @@
-SUBDIR=        ipfw_basic \
-       ipfw_layer2 \
-       ipfw_layer4 \
-       ipfw_dummynet \
-       ipfw_nat 
+SUBDIR=        basic \
+       layer2 \
+       layer4 \
+       dummynet \
+       nat
 
 .include <bsd.subdir.mk>
index 67faf5c..0082682 100644 (file)
@@ -1,9 +1,9 @@
 SRCDIR=        ${.CURDIR}/
 
-LIB=    _ipfw_basic
-SRCS=  ipfw_basic.c 
+LIB=    ipfw2basic
+SRCS=  ipfw2_basic.c
 
-INCS=  ipfw_basic.h 
+INCS=  ipfw2_basic.h
 
 
 WARNS?=        2
similarity index 99%
rename from lib/libipfw2/basic/ipfw_basic.c
rename to lib/libipfw2/basic/ipfw2_basic.c
index 86c364a..95a11f8 100644 (file)
@@ -57,7 +57,7 @@
 
 #include "../../../sys/net/ipfw2/ip_fw2.h"
 #include "../../../sbin/ipfw2/ipfw.h"
-#include "ipfw_basic.h"
+#include "ipfw2_basic.h"
 
 
 #define        IP_MASK_ALL     0xffffffff
similarity index 96%
rename from lib/libipfw2/basic/ipfw_basic.h
rename to lib/libipfw2/basic/ipfw2_basic.h
index f164a9c..5b17e47 100644 (file)
@@ -35,6 +35,6 @@
 #ifndef _IPFW_BASIC_H
 #define _IPFW_BASIC_H
 
-#include <../../../sys/net/ipfw_basic/ip_fw_basic.h>
+#include <../../../sys/net/ipfw2_basic/ip_fw2_basic.h>
 
 #endif
index 1decc33..bd8db43 100644 (file)
@@ -1,9 +1,9 @@
 SRCDIR=        ${.CURDIR}/
 
-LIB=    _ipfw_dummynet
-SRCS=  ipfw_dummynet.c
+LIB=    ipfw2dummynet
+SRCS=  ipfw2_dummynet.c
 
-INCS=  ipfw_dummynet.h
+INCS=  ipfw2_dummynet.h
 
 
 WARNS?=        2
similarity index 99%
rename from lib/libipfw2/dummynet/ipfw_dummynet.c
rename to lib/libipfw2/dummynet/ipfw2_dummynet.c
index fe06480..c0d0398 100644 (file)
@@ -42,7 +42,7 @@
 
 #include "../../../sys/net/ipfw2/ip_fw2.h"
 #include "../../../sbin/ipfw2/ipfw.h"
-#include "ipfw_dummynet.h"
+#include "ipfw2_dummynet.h"
 
 void
 parse_pipe(ipfw_insn **cmd, int *ac, char **av[])
similarity index 96%
rename from lib/libipfw2/dummynet/ipfw_dummynet.h
rename to lib/libipfw2/dummynet/ipfw2_dummynet.h
index 4b2d805..fd30c16 100644 (file)
@@ -35,6 +35,6 @@
 #ifndef _IPFW_DUMMYNET_H
 #define _IPFW_DUMMYNET_H
 
-#include "../../../../sys/net/dummynet2/ip_dummynet.h"
+#include "../../../../sys/net/dummynet2/ip_dummynet2.h"
 
 #endif
index fe15f64..8bdcade 100644 (file)
@@ -1,9 +1,9 @@
 SRCDIR=        ${.CURDIR}/
 
-LIB=    _ipfw_layer2
-SRCS=  ipfw_layer2.c 
+LIB=    ipfw2layer2
+SRCS=  ipfw2_layer2.c 
 
-INCS=  ipfw_layer2.h 
+INCS=  ipfw2_layer2.h 
 
 
 WARNS?=        2
similarity index 99%
rename from lib/libipfw2/layer2/ipfw_layer2.c
rename to lib/libipfw2/layer2/ipfw2_layer2.c
index 0677ab7..0c55bb3 100644 (file)
@@ -46,7 +46,7 @@
 
 #include "../../../sys/net/ipfw2/ip_fw2.h"
 #include "../../../sbin/ipfw2/ipfw.h"
-#include "ipfw_layer2.h"
+#include "ipfw2_layer2.h"
 
 /*
  * Returns the number of bits set (from left) in a contiguous bitmask,
similarity index 96%
rename from lib/libipfw2/layer2/ipfw_layer2.h
rename to lib/libipfw2/layer2/ipfw2_layer2.h
index 2dd5d85..0751874 100644 (file)
@@ -35,6 +35,6 @@
 #ifndef _IPFW_LAYER2_H
 #define _IPFW_LAYER2_H
 
-#include "../../../../sys/net/ipfw_layer2/ip_fw_layer2.h"
+#include "../../../../sys/net/ipfw2_layer2/ip_fw2_layer2.h"
 
 #endif
index 24a5d15..eb7337c 100644 (file)
@@ -1,9 +1,9 @@
 SRCDIR=        ${.CURDIR}/
 
-LIB=    _ipfw_layer4
-SRCS=  ipfw_layer4.c 
+LIB=    ipfw2layer4
+SRCS=  ipfw2_layer4.c 
 
-INCS=  ipfw_layer4.h 
+INCS=  ipfw2_layer4.h 
 
 
 WARNS?=        2
similarity index 99%
rename from lib/libipfw2/layer4/ipfw_layer4.c
rename to lib/libipfw2/layer4/ipfw2_layer4.c
index 3236c82..86ff4f8 100644 (file)
@@ -48,7 +48,7 @@
 
 #include "../../../sys/net/ipfw2/ip_fw2.h"
 #include "../../../sbin/ipfw2/ipfw.h"
-#include "ipfw_layer4.h"
+#include "ipfw2_layer4.h"
 
 
 void
similarity index 96%
rename from lib/libipfw2/layer4/ipfw_layer4.h
rename to lib/libipfw2/layer4/ipfw2_layer4.h
index b5ac5e7..02e6e2e 100644 (file)
@@ -35,6 +35,6 @@
 #ifndef _IPFW_LAYER2_H
 #define _IPFW_LAYER2_H
 
-#include "../../../../sys/net/ipfw_layer4/ip_fw_layer4.h"
+#include "../../../../sys/net/ipfw2_layer4/ip_fw2_layer4.h"
 
 #endif
index d1ab816..ad8a6bb 100644 (file)
@@ -1,9 +1,9 @@
 SRCDIR=        ${.CURDIR}/
 
-LIB=    _ipfw_nat
-SRCS=  ipfw_nat.c 
+LIB=    ipfw2nat
+SRCS=  ipfw2_nat.c 
 
-INCS=  ipfw_nat.h 
+INCS=  ipfw2_nat.h 
 
 
 WARNS?=        2
similarity index 99%
rename from lib/libipfw2/nat/ipfw_nat.c
rename to lib/libipfw2/nat/ipfw2_nat.c
index ef023bc..eb70dca 100644 (file)
@@ -42,7 +42,7 @@
 
 #include "../../../sys/net/ipfw2/ip_fw2.h"
 #include "../../../sbin/ipfw2/ipfw.h"
-#include "ipfw_nat.h"
+#include "ipfw2_nat.h"
 
 
 void
similarity index 97%
rename from lib/libipfw2/nat/ipfw_nat.h
rename to lib/libipfw2/nat/ipfw2_nat.h
index 57fa533..20b92bb 100644 (file)
@@ -35,6 +35,6 @@
 #ifndef _IPFW_NAT_H
 #define _IPFW_NAT_H
 
-#include "../../../../sys/net/ipfw_nat/ip_fw_nat.h"
+#include "../../../../sys/net/ipfw2_nat/ip_fw2_nat.h"
 
 #endif
index 168a1e4..e6ac867 100644 (file)
 #include <net/if_dl.h>
 #include <net/route.h>
 #include <net/ethernet.h>
-#include <net/ipfw2/ip_fw.h>
-#include <net/dummynet2/ip_dummynet.h>
 
-#include "ipfw.h"
+
+#include "../../sys/net/ipfw2/ip_fw2.h"
+#include "../../sys/net/dummynet2/ip_dummynet2.h"
 #include "../../sys/net/libalias/alias.h"
-#include "../../sys/net/ipfw_basic/ip_fw_basic.h"
-#include "../../sys/net/ipfw_nat/ip_fw_nat.h"
+#include "../../sys/net/ipfw2_basic/ip_fw2_basic.h"
+#include "../../sys/net/ipfw2_nat/ip_fw2_nat.h"
+#include "ipfw.h"
 
 
 #define KEYWORD_SIZE   256
index c338f7d..b2ca744 100644 (file)
@@ -2,7 +2,7 @@
 # $DragonFly: src/sys/net/dummynet/Makefile,v 1.7 2008/09/16 12:30:57 sephe Exp $
 
 KMOD=   dummynet2
-SRCS=   ip_dummynet.c
+SRCS=   ip_dummynet2.c
 SRCS+= opt_ipdn.h
 
 .ifndef BUILDING_WITH_KERNEL
similarity index 99%
rename from sys/net/dummynet2/ip_dummynet.c
rename to sys/net/dummynet2/ip_dummynet2.c
index 3223546..c845c35 100644 (file)
@@ -65,7 +65,7 @@
 #include <netinet/in_var.h>
 #include <netinet/ip_var.h>
 
-#include <net/dummynet2/ip_dummynet.h>
+#include <net/dummynet2/ip_dummynet2.h>
 #include <net/ipfw2/ip_fw2.h>
 
 void check_pipe(int *cmd_ctl, int *cmd_val, struct ip_fw_args **args,
@@ -2054,10 +2054,10 @@ dummynet_modevent(module_t mod, int type, void *data)
 }
 
 static moduledata_t dummynet_mod = {
-       "dummynet",
+       "dummynet2",
        dummynet_modevent,
        NULL
 };
-DECLARE_MODULE(dummynet, dummynet_mod, SI_SUB_PROTO_END, SI_ORDER_ANY);
-MODULE_DEPEND(ipfw_nat, ipfw_basic, 1, 1, 1);
-MODULE_VERSION(dummynet, 1);
+DECLARE_MODULE(dummynet2, dummynet_mod, SI_SUB_PROTO_END, SI_ORDER_ANY);
+MODULE_DEPEND(dummynet2, ipfw2_basic, 1, 1, 1);
+MODULE_VERSION(dummynet2, 1);
index 6e4d76d..41407c8 100644 (file)
@@ -35,6 +35,6 @@
 #ifndef _IP_FW_H
 #define _IP_FW_H
 
-#include <net/ipfw/ip_fw2.h>
+#include <net/ipfw2/ip_fw2.h>
 
 #endif /* _IP_FW_H */
index 7205dc4..a9eefa4 100644 (file)
 #include <net/route.h>
 #include <net/pfil.h>
 #include <net/netmsg2.h>
-#include <net/dummynet2/ip_dummynet.h>
+
 #include <net/ipfw2/ip_fw2.h>
-#include <net/ipfw_basic/ip_fw_basic.h>
-#include <net/ipfw_nat/ip_fw_nat.h>
+#include <net/ipfw2_basic/ip_fw2_basic.h>
+#include <net/ipfw2_nat/ip_fw2_nat.h>
+#include <net/dummynet2/ip_dummynet2.h>
 
 MALLOC_DEFINE(M_IPFW2, "IPFW2", "ip_fw2 default module");
 
index 132c0e7..c30d9f8 100644 (file)
@@ -306,13 +306,13 @@ struct sockopt;
 struct dn_flow_set;
 
 typedef int    ip_fw_chk_t(struct ip_fw_args *);
-typedef int    ip_fw_ctl_t(struct sockopt *);
+typedef int    ip_fw2_ctl_t(struct sockopt *);
 typedef int    ipfw_nat_cfg_t(struct sockopt *);
 typedef void ip_fw_dn_io_t(struct mbuf *, int, int, struct ip_fw_args *);
 
 
 extern ip_fw_chk_t     *ip_fw_chk_ptr;
-extern ip_fw_ctl_t     *ip_fw_ctl_x_ptr;
+extern ip_fw2_ctl_t    *ip_fw_ctl_x_ptr;
 extern ip_fw_dn_io_t   *ip_fw_dn_io_ptr;
 
 extern int fw_one_pass;
index 6483fef..76f16a5 100644 (file)
@@ -43,7 +43,7 @@
 
 #include <netinet/in.h>
 
-#include <net/ipfw/ip_fw2.h>
+#include <net/ipfw2/ip_fw2.h>
 
 ip_fw_chk_t *ip_fw_chk_ptr;
 ip_fw_dn_io_t *ip_fw_dn_io_ptr;
@@ -51,10 +51,10 @@ int ip_fw_loaded;
 int fw_enable = 1;
 int fw_one_pass = 1;
 
-static void    ip_fw_sockopt_dispatch(netmsg_t msg);
+static void    ip_fw2_sockopt_dispatch(netmsg_t msg);
 
 int
-ip_fw_sockopt(struct sockopt *sopt)
+ip_fw2_sockopt(struct sockopt *sopt)
 {
        struct netmsg_base smsg;
 
@@ -75,7 +75,7 @@ ip_fw_sockopt(struct sockopt *sopt)
 }
 
 static void
-ip_fw_sockopt_dispatch(netmsg_t msg)
+ip_fw2_sockopt_dispatch(netmsg_t msg)
 {
        struct sockopt *sopt = msg->lmsg.u.ms_resultp;
        int error;
index 7f91028..a9b2780 100644 (file)
@@ -1,4 +1,4 @@
-KMOD=   ipfw_basic 
-SRCS=   ip_fw_basic.c
+KMOD=   ipfw2_basic
+SRCS=   ip_fw2_basic.c
 
 .include <bsd.kmod.mk>
similarity index 99%
rename from sys/net/ipfw2_basic/ip_fw_basic.c
rename to sys/net/ipfw2_basic/ip_fw2_basic.c
index 040250b..9841777 100644 (file)
@@ -67,7 +67,7 @@
 
 #include <net/ipfw2/ip_fw2.h>
 
-#include "ip_fw_basic.h"
+#include "ip_fw2_basic.h"
 
 #define TIME_LEQ(a, b) ((int)((a) - (b)) <= 0)
 
index c88717e..4b65b13 100644 (file)
@@ -1,4 +1,4 @@
-KMOD=   ipfw_layer2 
-SRCS=   ip_fw_layer2.c
+KMOD=   ipfw2_layer2 
+SRCS=   ip_fw2_layer2.c
 
 .include <bsd.kmod.mk>
similarity index 94%
rename from sys/net/ipfw2_layer2/ip_fw_layer2.c
rename to sys/net/ipfw2_layer2/ip_fw2_layer2.c
index 7975355..d56dd1b 100644 (file)
@@ -51,7 +51,7 @@
 
 #include <net/ipfw2/ip_fw2.h>
 
-#include "ip_fw_layer2.h"
+#include "ip_fw2_layer2.h"
 
 
 void check_layer2(int *cmd_ctl, int *cmd_val, struct ip_fw_args **args,
@@ -108,10 +108,10 @@ ipfw_layer2_modevent(module_t mod, int type, void *data)
 }
 
 static moduledata_t ipfw_layer2_mod = {
-       "ipfw_layer2",
+       "ipfw2_layer2",
        ipfw_layer2_modevent,
        NULL
 };
-DECLARE_MODULE(ipfw_layer2, ipfw_layer2_mod, SI_SUB_PROTO_END, SI_ORDER_ANY);
-MODULE_DEPEND(ipfw_layer2, ipfw_basic, 1, 1, 1);
-MODULE_VERSION(ipfw_layer2, 1);
+DECLARE_MODULE(ipfw2_layer2, ipfw_layer2_mod, SI_SUB_PROTO_END, SI_ORDER_ANY);
+MODULE_DEPEND(ipfw2_layer2, ipfw2_basic, 1, 1, 1);
+MODULE_VERSION(ipfw2_layer2, 1);
index 58965c4..31b03ec 100644 (file)
@@ -1,4 +1,4 @@
-KMOD=   ipfw_layer4
-SRCS=   ip_fw_layer4.c
+KMOD=   ipfw2_layer4
+SRCS=   ip_fw2_layer4.c
 
 .include <bsd.kmod.mk>
similarity index 96%
rename from sys/net/ipfw2_layer4/ip_fw_layer4.c
rename to sys/net/ipfw2_layer4/ip_fw2_layer4.c
index e9e0d9b..a00be82 100644 (file)
@@ -65,7 +65,7 @@
 
 #include <net/ipfw2/ip_fw2.h>
 
-#include "ip_fw_layer4.h"
+#include "ip_fw2_layer4.h"
 
 void
 check_tcpflag(int *cmd_ctl, int *cmd_val, struct ip_fw_args **args,
@@ -189,10 +189,10 @@ ipfw_layer4_modevent(module_t mod, int type, void *data)
 }
 
 static moduledata_t ipfw_layer4_mod = {
-       "ipfw_layer4",
+       "ipfw2_layer4",
        ipfw_layer4_modevent,
        NULL
 };
-DECLARE_MODULE(ipfw_layer4, ipfw_layer4_mod, SI_SUB_PROTO_END, SI_ORDER_ANY);
-MODULE_DEPEND(ipfw_layer4, ipfw_basic, 1, 1, 1);
-MODULE_VERSION(ipfw_layer4, 1);
+DECLARE_MODULE(ipfw2_layer4, ipfw_layer4_mod, SI_SUB_PROTO_END, SI_ORDER_ANY);
+MODULE_DEPEND(ipfw2_layer4, ipfw2_basic, 1, 1, 1);
+MODULE_VERSION(ipfw2_layer4, 1);
index 831c819..5a65cc1 100644 (file)
@@ -1,4 +1,4 @@
-KMOD=   ipfw_nat 
-SRCS=   ip_fw_nat.c
+KMOD=   ipfw2_nat 
+SRCS=   ip_fw2_nat.c
 
 .include <bsd.kmod.mk>
similarity index 98%
rename from sys/net/ipfw2_nat/ip_fw_nat.c
rename to sys/net/ipfw2_nat/ip_fw2_nat.c
index 273c508..5fcb6f5 100644 (file)
@@ -75,7 +75,7 @@
 
 #include <net/ipfw2/ip_fw2.h>
 
-#include "ip_fw_nat.h"
+#include "ip_fw2_nat.h"
 
 
 static struct lock nat_lock;
@@ -570,12 +570,12 @@ static int ipfw_nat_modevent(module_t mod, int type, void *data)
 }
 
 static moduledata_t ipfw_nat_mod = {
-       "ipfw_nat",
+       "ipfw2_nat",
        ipfw_nat_modevent,
        NULL
 };
 
-DECLARE_MODULE(ipfw_nat, ipfw_nat_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY);
-MODULE_DEPEND(ipfw_nat, libalias, 1, 1, 1);
-MODULE_DEPEND(ipfw_nat, ipfw_basic, 1, 1, 1);
-MODULE_VERSION(ipfw_nat, 1);
+DECLARE_MODULE(ipfw2_nat, ipfw_nat_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY);
+MODULE_DEPEND(ipfw2_nat, libalias, 1, 1, 1);
+MODULE_DEPEND(ipfw2_nat, ipfw2_basic, 1, 1, 1);
+MODULE_VERSION(ipfw2_nat, 1);
index 37a9cc9..d4348c2 100644 (file)
@@ -348,6 +348,7 @@ struct sockaddr_in {
 #define        IP_IPSEC_POLICY         21   /* int; set/get security policy */
 #define        IP_FAITH                22   /* bool; accept FAITH'ed connections */
 
+#define IP_FW_X                        49   /* ipfw2 firewall */
 #define        IP_FW_ADD               50   /* add a firewall rule to chain */
 #define        IP_FW_DEL               51   /* delete a firewall rule from chain */
 #define        IP_FW_FLUSH             52   /* flush firewall rule chain */
index 9d06063..5114d02 100644 (file)
@@ -71,6 +71,9 @@
 #include <net/ipfw/ip_fw.h>
 #include <net/dummynet/ip_dummynet.h>
 
+#include <net/ipfw2/ip_fw.h>
+#include <net/dummynet2/ip_dummynet.h>
+
 #ifdef FAST_IPSEC
 #include <netproto/ipsec/ipsec.h>
 #endif /*FAST_IPSEC*/
@@ -86,6 +89,9 @@ struct        inpcbportinfo ripcbportinfo;
 ip_fw_ctl_t *ip_fw_ctl_ptr;
 ip_dn_ctl_t *ip_dn_ctl_ptr;
 
+
+ip_fw2_ctl_t *ip_fw2_ctl_x_ptr;
+
 /*
  * hooks for multicast routing. They all default to NULL,
  * so leave them not initialized and rely on BSS being set to 0.
@@ -375,7 +381,12 @@ rip_ctloutput(netmsg_t msg)
                        optval = inp->inp_flags & INP_HDRINCL;
                        soopt_from_kbuf(sopt, &optval, sizeof optval);
                        break;
-
+               case IP_FW_X:
+                       if (IPFW2_LOADED)
+                               error = ip_fw2_sockopt(sopt);
+                       else
+                               error = ENOPROTOOPT;
+                       break;
                case IP_FW_ADD: /* ADD actually returns the body... */
                case IP_FW_GET:
                        if (IPFW_LOADED)
@@ -423,7 +434,12 @@ rip_ctloutput(netmsg_t msg)
                        else
                                inp->inp_flags &= ~INP_HDRINCL;
                        break;
-
+               case IP_FW_X:
+                       if (IPFW2_LOADED)
+                               error = ip_fw2_ctl_x_ptr(sopt);
+                       else
+                                error = ENOPROTOOPT;
+                       break;
                case IP_FW_ADD:
                case IP_FW_DEL:
                case IP_FW_FLUSH: