Deleted Added
full compact
if_var.h (79103) if_var.h (83130)
1/*
2 * Copyright (c) 1982, 1986, 1989, 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

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

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * From: @(#)if.h 8.1 (Berkeley) 6/10/93
1/*
2 * Copyright (c) 1982, 1986, 1989, 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

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

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * From: @(#)if.h 8.1 (Berkeley) 6/10/93
34 * $FreeBSD: head/sys/net/if_var.h 79103 2001-07-02 20:49:25Z brooks $
34 * $FreeBSD: head/sys/net/if_var.h 83130 2001-09-06 02:40:43Z jlemon $
35 */
36
37#ifndef _NET_IF_VAR_H_
38#define _NET_IF_VAR_H_
39
40/*
41 * Structures defining a network interface, providing a packet
42 * transport mechanism (ala level 0 of the PUP protocols).

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

76#include <sys/queue.h> /* get TAILQ macros */
77
78#ifdef _KERNEL
79#include <sys/mbuf.h>
80#include <sys/systm.h> /* XXX */
81#endif /* _KERNEL */
82#include <sys/lock.h> /* XXX */
83#include <sys/mutex.h> /* XXX */
35 */
36
37#ifndef _NET_IF_VAR_H_
38#define _NET_IF_VAR_H_
39
40/*
41 * Structures defining a network interface, providing a packet
42 * transport mechanism (ala level 0 of the PUP protocols).

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

76#include <sys/queue.h> /* get TAILQ macros */
77
78#ifdef _KERNEL
79#include <sys/mbuf.h>
80#include <sys/systm.h> /* XXX */
81#endif /* _KERNEL */
82#include <sys/lock.h> /* XXX */
83#include <sys/mutex.h> /* XXX */
84#include <sys/event.h> /* XXX */
84
85TAILQ_HEAD(ifnethead, ifnet); /* we use TAILQs so that the order of */
86TAILQ_HEAD(ifaddrhead, ifaddr); /* instantiation is preserved in the list */
87TAILQ_HEAD(ifprefixhead, ifprefix);
88TAILQ_HEAD(ifmultihead, ifmultiaddr);
89
90/*
91 * Structure defining a queue for a network interface.

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

104 *
105 * (Would like to call this struct ``if'', but C isn't PL/1.)
106 */
107struct ifnet {
108 void *if_softc; /* pointer to driver state */
109 char *if_name; /* name, e.g. ``en'' or ``lo'' */
110 TAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained */
111 struct ifaddrhead if_addrhead; /* linked list of addresses per if */
85
86TAILQ_HEAD(ifnethead, ifnet); /* we use TAILQs so that the order of */
87TAILQ_HEAD(ifaddrhead, ifaddr); /* instantiation is preserved in the list */
88TAILQ_HEAD(ifprefixhead, ifprefix);
89TAILQ_HEAD(ifmultihead, ifmultiaddr);
90
91/*
92 * Structure defining a queue for a network interface.

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

105 *
106 * (Would like to call this struct ``if'', but C isn't PL/1.)
107 */
108struct ifnet {
109 void *if_softc; /* pointer to driver state */
110 char *if_name; /* name, e.g. ``en'' or ``lo'' */
111 TAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained */
112 struct ifaddrhead if_addrhead; /* linked list of addresses per if */
112 int if_pcount; /* number of promiscuous listeners */
113 struct klist if_klist; /* events attached to this if */
114 int if_pcount; /* number of promiscuous listeners */
113 struct bpf_if *if_bpf; /* packet filter structure */
114 u_short if_index; /* numeric abbreviation for this if */
115 short if_unit; /* sub-unit for lower level driver */
116 short if_timer; /* time 'til if_watchdog called */
117 short if_flags; /* up/down, broadcast, etc. */
118 int if_mpsafe; /* XXX TEMPORARY */
119 int if_ipending; /* interrupts pending */
120 void *if_linkmib; /* link-type-specific MIB data */

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

366#define IFAFREE(ifa) \
367 do { \
368 if ((ifa)->ifa_refcnt <= 0) \
369 ifafree(ifa); \
370 else \
371 (ifa)->ifa_refcnt--; \
372 } while (0)
373
115 struct bpf_if *if_bpf; /* packet filter structure */
116 u_short if_index; /* numeric abbreviation for this if */
117 short if_unit; /* sub-unit for lower level driver */
118 short if_timer; /* time 'til if_watchdog called */
119 short if_flags; /* up/down, broadcast, etc. */
120 int if_mpsafe; /* XXX TEMPORARY */
121 int if_ipending; /* interrupts pending */
122 void *if_linkmib; /* link-type-specific MIB data */

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

368#define IFAFREE(ifa) \
369 do { \
370 if ((ifa)->ifa_refcnt <= 0) \
371 ifafree(ifa); \
372 else \
373 (ifa)->ifa_refcnt--; \
374 } while (0)
375
376struct ifindex_entry {
377 struct ifnet *ife_ifnet;
378 struct ifaddr *ife_ifnet_addr;
379 dev_t ife_dev;
380};
381
382#define ifnet_byindex(idx) ifindex_table[(idx)].ife_ifnet
383#define ifaddr_byindex(idx) ifindex_table[(idx)].ife_ifnet_addr
384#define ifdev_byindex(idx) ifindex_table[(idx)].ife_dev
385
374extern struct ifnethead ifnet;
386extern struct ifnethead ifnet;
375extern struct ifnet **ifindex2ifnet;
387extern struct ifindex_entry *ifindex_table;
376extern int ifqmaxlen;
377extern struct ifnet *loif; /* first loopback interface */
378extern int if_index;
388extern int ifqmaxlen;
389extern struct ifnet *loif; /* first loopback interface */
390extern int if_index;
379extern struct ifaddr **ifnet_addrs;
380
381void ether_ifattach __P((struct ifnet *, int));
382void ether_ifdetach __P((struct ifnet *, int));
383void ether_input __P((struct ifnet *, struct ether_header *, struct mbuf *));
384void ether_demux __P((struct ifnet *, struct ether_header *, struct mbuf *));
385int ether_output __P((struct ifnet *,
386 struct mbuf *, struct sockaddr *, struct rtentry *));
387int ether_output_frame __P((struct ifnet *, struct mbuf *));

--- 47 unchanged lines hidden ---
391
392void ether_ifattach __P((struct ifnet *, int));
393void ether_ifdetach __P((struct ifnet *, int));
394void ether_input __P((struct ifnet *, struct ether_header *, struct mbuf *));
395void ether_demux __P((struct ifnet *, struct ether_header *, struct mbuf *));
396int ether_output __P((struct ifnet *,
397 struct mbuf *, struct sockaddr *, struct rtentry *));
398int ether_output_frame __P((struct ifnet *, struct mbuf *));

--- 47 unchanged lines hidden ---