raw_ip.c (197227) | raw_ip.c (197952) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 17 unchanged lines hidden (view full) --- 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * 30 * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 17 unchanged lines hidden (view full) --- 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * 30 * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/netinet/raw_ip.c 197227 2009-09-15 19:18:34Z qingli $"); | 34__FBSDID("$FreeBSD: head/sys/netinet/raw_ip.c 197952 2009-10-11 05:59:43Z julian $"); |
35 36#include "opt_inet6.h" 37#include "opt_ipsec.h" 38 39#include <sys/param.h> 40#include <sys/jail.h> 41#include <sys/kernel.h> 42#include <sys/lock.h> --- 36 unchanged lines hidden (view full) --- 79#define V_ripcb VNET(ripcb) 80#define V_ripcbinfo VNET(ripcbinfo) 81 82/* 83 * Control and data hooks for ipfw and dummynet. 84 * The data hooks are not used here but it is convenient 85 * to keep them all in one place. 86 */ | 35 36#include "opt_inet6.h" 37#include "opt_ipsec.h" 38 39#include <sys/param.h> 40#include <sys/jail.h> 41#include <sys/kernel.h> 42#include <sys/lock.h> --- 36 unchanged lines hidden (view full) --- 79#define V_ripcb VNET(ripcb) 80#define V_ripcbinfo VNET(ripcbinfo) 81 82/* 83 * Control and data hooks for ipfw and dummynet. 84 * The data hooks are not used here but it is convenient 85 * to keep them all in one place. 86 */ |
87int (*ip_fw_ctl_ptr)(struct sockopt *) = NULL; | 87VNET_DEFINE(ip_fw_chk_ptr_t, ip_fw_chk_ptr) = NULL; 88VNET_DEFINE(ip_fw_ctl_ptr_t, ip_fw_ctl_ptr) = NULL; |
88int (*ip_dn_ctl_ptr)(struct sockopt *) = NULL; | 89int (*ip_dn_ctl_ptr)(struct sockopt *) = NULL; |
89int (*ip_fw_chk_ptr)(struct ip_fw_args *args) = NULL; | |
90int (*ip_dn_io_ptr)(struct mbuf **m, int dir, struct ip_fw_args *fwa) = NULL; 91 92/* 93 * Hooks for multicast routing. They all default to NULL, so leave them not 94 * initialized and rely on BSS being set to 0. 95 */ 96 97/* --- 420 unchanged lines hidden (view full) --- 518 break; 519 520 case IP_FW_ADD: /* ADD actually returns the body... */ 521 case IP_FW_GET: 522 case IP_FW_TABLE_GETSIZE: 523 case IP_FW_TABLE_LIST: 524 case IP_FW_NAT_GET_CONFIG: 525 case IP_FW_NAT_GET_LOG: | 90int (*ip_dn_io_ptr)(struct mbuf **m, int dir, struct ip_fw_args *fwa) = NULL; 91 92/* 93 * Hooks for multicast routing. They all default to NULL, so leave them not 94 * initialized and rely on BSS being set to 0. 95 */ 96 97/* --- 420 unchanged lines hidden (view full) --- 518 break; 519 520 case IP_FW_ADD: /* ADD actually returns the body... */ 521 case IP_FW_GET: 522 case IP_FW_TABLE_GETSIZE: 523 case IP_FW_TABLE_LIST: 524 case IP_FW_NAT_GET_CONFIG: 525 case IP_FW_NAT_GET_LOG: |
526 if (ip_fw_ctl_ptr != NULL) 527 error = ip_fw_ctl_ptr(sopt); | 526 if (V_ip_fw_ctl_ptr != NULL) 527 error = V_ip_fw_ctl_ptr(sopt); |
528 else 529 error = ENOPROTOOPT; 530 break; 531 532 case IP_DUMMYNET_GET: 533 if (ip_dn_ctl_ptr != NULL) 534 error = ip_dn_ctl_ptr(sopt); 535 else --- 43 unchanged lines hidden (view full) --- 579 case IP_FW_FLUSH: 580 case IP_FW_ZERO: 581 case IP_FW_RESETLOG: 582 case IP_FW_TABLE_ADD: 583 case IP_FW_TABLE_DEL: 584 case IP_FW_TABLE_FLUSH: 585 case IP_FW_NAT_CFG: 586 case IP_FW_NAT_DEL: | 528 else 529 error = ENOPROTOOPT; 530 break; 531 532 case IP_DUMMYNET_GET: 533 if (ip_dn_ctl_ptr != NULL) 534 error = ip_dn_ctl_ptr(sopt); 535 else --- 43 unchanged lines hidden (view full) --- 579 case IP_FW_FLUSH: 580 case IP_FW_ZERO: 581 case IP_FW_RESETLOG: 582 case IP_FW_TABLE_ADD: 583 case IP_FW_TABLE_DEL: 584 case IP_FW_TABLE_FLUSH: 585 case IP_FW_NAT_CFG: 586 case IP_FW_NAT_DEL: |
587 if (ip_fw_ctl_ptr != NULL) 588 error = ip_fw_ctl_ptr(sopt); | 587 if (V_ip_fw_ctl_ptr != NULL) 588 error = V_ip_fw_ctl_ptr(sopt); |
589 else 590 error = ENOPROTOOPT; 591 break; 592 593 case IP_DUMMYNET_CONFIGURE: 594 case IP_DUMMYNET_DEL: 595 case IP_DUMMYNET_FLUSH: 596 if (ip_dn_ctl_ptr != NULL) --- 470 unchanged lines hidden --- | 589 else 590 error = ENOPROTOOPT; 591 break; 592 593 case IP_DUMMYNET_CONFIGURE: 594 case IP_DUMMYNET_DEL: 595 case IP_DUMMYNET_FLUSH: 596 if (ip_dn_ctl_ptr != NULL) --- 470 unchanged lines hidden --- |