Deleted Added
full compact
if.c (185810) if.c (185895)
1/*-
2 * Copyright (c) 1980, 1986, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

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
27 * SUCH DAMAGE.
28 *
29 * @(#)if.c 8.5 (Berkeley) 1/9/95
1/*-
2 * Copyright (c) 1980, 1986, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

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
27 * SUCH DAMAGE.
28 *
29 * @(#)if.c 8.5 (Berkeley) 1/9/95
30 * $FreeBSD: head/sys/net/if.c 185810 2008-12-09 21:09:05Z bz $
30 * $FreeBSD: head/sys/net/if.c 185895 2008-12-10 23:12:39Z zec $
31 */
32
33#include "opt_compat.h"
34#include "opt_inet6.h"
35#include "opt_inet.h"
36#include "opt_mac.h"
37#include "opt_carp.h"
38

--- 46 unchanged lines hidden (view full) ---

85#include <netinet/vinet.h>
86#endif
87#ifdef DEV_CARP
88#include <netinet/ip_carp.h>
89#endif
90
91#include <security/mac/mac_framework.h>
92
31 */
32
33#include "opt_compat.h"
34#include "opt_inet6.h"
35#include "opt_inet.h"
36#include "opt_mac.h"
37#include "opt_carp.h"
38

--- 46 unchanged lines hidden (view full) ---

85#include <netinet/vinet.h>
86#endif
87#ifdef DEV_CARP
88#include <netinet/ip_carp.h>
89#endif
90
91#include <security/mac/mac_framework.h>
92
93#ifndef VIMAGE
94#ifndef VIMAGE_GLOBALS
95struct vnet_net vnet_net_0;
96#endif
97#endif
98
93SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers");
94SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management");
95
96/* Log link state change events */
97static int log_link_state_change = 1;
98
99SYSCTL_INT(_net_link, OID_AUTO, log_link_state_change, CTLFLAG_RW,
100 &log_link_state_change, 0,

--- 55 unchanged lines hidden (view full) ---

156static if_com_free_t *if_com_free[256];
157
158static void filt_netdetach(struct knote *kn);
159static int filt_netdev(struct knote *kn, long hint);
160
161static struct filterops netdev_filtops =
162 { 1, NULL, filt_netdetach, filt_netdev };
163
99SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers");
100SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management");
101
102/* Log link state change events */
103static int log_link_state_change = 1;
104
105SYSCTL_INT(_net_link, OID_AUTO, log_link_state_change, CTLFLAG_RW,
106 &log_link_state_change, 0,

--- 55 unchanged lines hidden (view full) ---

162static if_com_free_t *if_com_free[256];
163
164static void filt_netdetach(struct knote *kn);
165static int filt_netdev(struct knote *kn, long hint);
166
167static struct filterops netdev_filtops =
168 { 1, NULL, filt_netdetach, filt_netdev };
169
170#ifndef VIMAGE_GLOBALS
171static struct vnet_symmap vnet_net_symmap[] = {
172 VNET_SYMMAP(net, ifnet),
173 VNET_SYMMAP(net, rt_tables),
174 VNET_SYMMAP(net, rtstat),
175 VNET_SYMMAP(net, rttrash),
176 VNET_SYMMAP_END
177};
178
179VNET_MOD_DECLARE(NET, net, vnet_net_iattach, vnet_net_idetach,
180 NONE, vnet_net_symmap)
181#endif
182
164/*
165 * System initialization
166 */
167SYSINIT(interfaces, SI_SUB_INIT_IF, SI_ORDER_FIRST, if_init, NULL);
168SYSINIT(interface_check, SI_SUB_PROTO_IF, SI_ORDER_FIRST, if_slowtimo, NULL);
169
170MALLOC_DEFINE(M_IFNET, "ifnet", "interface internals");
171MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address");

--- 184 unchanged lines hidden (view full) ---

356 */
357
358/* ARGSUSED*/
359static void
360if_init(void *dummy __unused)
361{
362 INIT_VNET_NET(curvnet);
363
183/*
184 * System initialization
185 */
186SYSINIT(interfaces, SI_SUB_INIT_IF, SI_ORDER_FIRST, if_init, NULL);
187SYSINIT(interface_check, SI_SUB_PROTO_IF, SI_ORDER_FIRST, if_slowtimo, NULL);
188
189MALLOC_DEFINE(M_IFNET, "ifnet", "interface internals");
190MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address");

--- 184 unchanged lines hidden (view full) ---

375 */
376
377/* ARGSUSED*/
378static void
379if_init(void *dummy __unused)
380{
381 INIT_VNET_NET(curvnet);
382
383#ifndef VIMAGE_GLOBALS
384 vnet_mod_register(&vnet_net_modinfo);
385#endif
386
364 V_if_index = 0;
365 V_ifindex_table = NULL;
366 V_if_indexlim = 8;
367
368 IFNET_LOCK_INIT();
369 TAILQ_INIT(&V_ifnet);
370 TAILQ_INIT(&V_ifg_head);
371 knlist_init(&V_ifklist, NULL, NULL, NULL, NULL);

--- 2509 unchanged lines hidden ---
387 V_if_index = 0;
388 V_ifindex_table = NULL;
389 V_if_indexlim = 8;
390
391 IFNET_LOCK_INIT();
392 TAILQ_INIT(&V_ifnet);
393 TAILQ_INIT(&V_ifg_head);
394 knlist_init(&V_ifklist, NULL, NULL, NULL, NULL);

--- 2509 unchanged lines hidden ---