ipsec.c (192648) | ipsec.c (193731) |
---|---|
1/* $FreeBSD: head/sys/netipsec/ipsec.c 192648 2009-05-23 16:42:38Z bz $ */ | 1/* $FreeBSD: head/sys/netipsec/ipsec.c 193731 2009-06-08 17:15:40Z zec $ */ |
2/* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 89 unchanged lines hidden (view full) --- 99 100#ifndef VIMAGE 101#ifndef VIMAGE_GLOBALS 102struct vnet_ipsec vnet_ipsec_0; 103#endif 104#endif 105 106static int ipsec_iattach(const void *); | 2/* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 89 unchanged lines hidden (view full) --- 99 100#ifndef VIMAGE 101#ifndef VIMAGE_GLOBALS 102struct vnet_ipsec vnet_ipsec_0; 103#endif 104#endif 105 106static int ipsec_iattach(const void *); |
107#ifdef VIMAGE 108static int ipsec_idetach(const void *); 109#endif |
|
107 108#ifdef VIMAGE_GLOBALS 109/* NB: name changed so netstat doesn't use it. */ 110struct ipsecstat ipsec4stat; 111struct secpolicy ip4_def_policy; 112int ipsec_debug; 113int ip4_ah_offsetmask; 114int ip4_ipsec_dfbit; --- 136 unchanged lines hidden (view full) --- 251MALLOC_DEFINE(M_IPSEC_INPCB, "inpcbpolicy", "inpcb-resident ipsec policy"); 252 253#ifndef VIMAGE_GLOBALS 254static const vnet_modinfo_t vnet_ipsec_modinfo = { 255 .vmi_id = VNET_MOD_IPSEC, 256 .vmi_name = "ipsec", 257 .vmi_size = sizeof(struct vnet_ipsec), 258 .vmi_dependson = VNET_MOD_INET, /* XXX revisit - INET6 ? */ | 110 111#ifdef VIMAGE_GLOBALS 112/* NB: name changed so netstat doesn't use it. */ 113struct ipsecstat ipsec4stat; 114struct secpolicy ip4_def_policy; 115int ipsec_debug; 116int ip4_ah_offsetmask; 117int ip4_ipsec_dfbit; --- 136 unchanged lines hidden (view full) --- 254MALLOC_DEFINE(M_IPSEC_INPCB, "inpcbpolicy", "inpcb-resident ipsec policy"); 255 256#ifndef VIMAGE_GLOBALS 257static const vnet_modinfo_t vnet_ipsec_modinfo = { 258 .vmi_id = VNET_MOD_IPSEC, 259 .vmi_name = "ipsec", 260 .vmi_size = sizeof(struct vnet_ipsec), 261 .vmi_dependson = VNET_MOD_INET, /* XXX revisit - INET6 ? */ |
259 .vmi_iattach = ipsec_iattach | 262 .vmi_iattach = ipsec_iattach, 263#ifdef VIMAGE 264 .vmi_idetach = ipsec_idetach 265#endif |
260}; 261#endif /* !VIMAGE_GLOBALS */ 262 263void 264ipsec_init(void) 265{ 266 INIT_VNET_IPSEC(curvnet); 267 --- 1518 unchanged lines hidden (view full) --- 1786ipsec_attach(void) 1787{ 1788 1789#ifndef VIMAGE_GLOBALS 1790 vnet_mod_register(&vnet_ipsec_modinfo); 1791#else 1792 ipsec_iattach(NULL); 1793#endif | 266}; 267#endif /* !VIMAGE_GLOBALS */ 268 269void 270ipsec_init(void) 271{ 272 INIT_VNET_IPSEC(curvnet); 273 --- 1518 unchanged lines hidden (view full) --- 1792ipsec_attach(void) 1793{ 1794 1795#ifndef VIMAGE_GLOBALS 1796 vnet_mod_register(&vnet_ipsec_modinfo); 1797#else 1798 ipsec_iattach(NULL); 1799#endif |
1794 | |
1795} 1796 1797static int 1798ipsec_iattach(const void *unused __unused) 1799{ 1800 INIT_VNET_IPSEC(curvnet); 1801 1802 SECPOLICY_LOCK_INIT(&V_ip4_def_policy); 1803 V_ip4_def_policy.refcnt = 1; /* NB: disallow free. */ 1804 1805 return (0); 1806} | 1800} 1801 1802static int 1803ipsec_iattach(const void *unused __unused) 1804{ 1805 INIT_VNET_IPSEC(curvnet); 1806 1807 SECPOLICY_LOCK_INIT(&V_ip4_def_policy); 1808 V_ip4_def_policy.refcnt = 1; /* NB: disallow free. */ 1809 1810 return (0); 1811} |
1812 1813#ifdef VIMAGE 1814static int 1815ipsec_idetach(const void *unused __unused) 1816{ 1817 1818 /* XXX revisit this! */ 1819 1820 return (0); 1821} 1822#endif |
|
1807SYSINIT(ipsec, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, ipsec_attach, NULL); 1808 1809 1810/* XXX This stuff doesn't belong here... */ 1811 1812static struct xformsw* xforms = NULL; 1813 1814/* --- 25 unchanged lines hidden --- | 1823SYSINIT(ipsec, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, ipsec_attach, NULL); 1824 1825 1826/* XXX This stuff doesn't belong here... */ 1827 1828static struct xformsw* xforms = NULL; 1829 1830/* --- 25 unchanged lines hidden --- |