if_var.h (155051) | if_var.h (159781) |
---|---|
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 --- 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 * 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 --- 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 * From: @(#)if.h 8.1 (Berkeley) 6/10/93 |
30 * $FreeBSD: head/sys/net/if_var.h 155051 2006-01-30 13:45:15Z glebius $ | 30 * $FreeBSD: head/sys/net/if_var.h 159781 2006-06-19 22:20:45Z mlaier $ |
31 */ 32 33#ifndef _NET_IF_VAR_H_ 34#define _NET_IF_VAR_H_ 35 36/* 37 * Structures defining a network interface, providing a packet 38 * transport mechanism (ala level 0 of the PUP protocols). --- 47 unchanged lines hidden (view full) --- 86#define IF_DUNIT_NONE -1 87 88#include <altq/if_altq.h> 89 90TAILQ_HEAD(ifnethead, ifnet); /* we use TAILQs so that the order of */ 91TAILQ_HEAD(ifaddrhead, ifaddr); /* instantiation is preserved in the list */ 92TAILQ_HEAD(ifprefixhead, ifprefix); 93TAILQ_HEAD(ifmultihead, ifmultiaddr); | 31 */ 32 33#ifndef _NET_IF_VAR_H_ 34#define _NET_IF_VAR_H_ 35 36/* 37 * Structures defining a network interface, providing a packet 38 * transport mechanism (ala level 0 of the PUP protocols). --- 47 unchanged lines hidden (view full) --- 86#define IF_DUNIT_NONE -1 87 88#include <altq/if_altq.h> 89 90TAILQ_HEAD(ifnethead, ifnet); /* we use TAILQs so that the order of */ 91TAILQ_HEAD(ifaddrhead, ifaddr); /* instantiation is preserved in the list */ 92TAILQ_HEAD(ifprefixhead, ifprefix); 93TAILQ_HEAD(ifmultihead, ifmultiaddr); |
94TAILQ_HEAD(ifgrouphead, ifg_group); |
|
94 95/* 96 * Structure defining a queue for a network interface. 97 */ 98struct ifqueue { 99 struct mbuf *ifq_head; 100 struct mbuf *ifq_tail; 101 int ifq_len; --- 75 unchanged lines hidden (view full) --- 177 struct ifprefixhead if_prefixhead; /* list of prefixes per if */ 178 void *if_afdata[AF_MAX]; 179 int if_afdata_initialized; 180 struct mtx if_afdata_mtx; 181 struct task if_starttask; /* task for IFF_NEEDSGIANT */ 182 struct task if_linktask; /* task for link change events */ 183 struct mtx if_addr_mtx; /* mutex to protect address lists */ 184 LIST_ENTRY(ifnet) if_clones; /* interfaces of a cloner */ | 95 96/* 97 * Structure defining a queue for a network interface. 98 */ 99struct ifqueue { 100 struct mbuf *ifq_head; 101 struct mbuf *ifq_tail; 102 int ifq_len; --- 75 unchanged lines hidden (view full) --- 178 struct ifprefixhead if_prefixhead; /* list of prefixes per if */ 179 void *if_afdata[AF_MAX]; 180 int if_afdata_initialized; 181 struct mtx if_afdata_mtx; 182 struct task if_starttask; /* task for IFF_NEEDSGIANT */ 183 struct task if_linktask; /* task for link change events */ 184 struct mtx if_addr_mtx; /* mutex to protect address lists */ 185 LIST_ENTRY(ifnet) if_clones; /* interfaces of a cloner */ |
186 TAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if */ 187 /* protected by if_addr_mtx */ 188 void *if_pf_kif; |
|
185}; 186 187typedef void if_init_f_t(void *); 188 189/* 190 * XXX These aliases are terribly dangerous because they could apply 191 * to anything. 192 */ --- 120 unchanged lines hidden (view full) --- 313EVENTHANDLER_DECLARE(ifaddr_event, ifaddr_event_handler_t); 314/* new interface arrival event */ 315typedef void (*ifnet_arrival_event_handler_t)(void *, struct ifnet *); 316EVENTHANDLER_DECLARE(ifnet_arrival_event, ifnet_arrival_event_handler_t); 317/* interface departure event */ 318typedef void (*ifnet_departure_event_handler_t)(void *, struct ifnet *); 319EVENTHANDLER_DECLARE(ifnet_departure_event, ifnet_departure_event_handler_t); 320 | 189}; 190 191typedef void if_init_f_t(void *); 192 193/* 194 * XXX These aliases are terribly dangerous because they could apply 195 * to anything. 196 */ --- 120 unchanged lines hidden (view full) --- 317EVENTHANDLER_DECLARE(ifaddr_event, ifaddr_event_handler_t); 318/* new interface arrival event */ 319typedef void (*ifnet_arrival_event_handler_t)(void *, struct ifnet *); 320EVENTHANDLER_DECLARE(ifnet_arrival_event, ifnet_arrival_event_handler_t); 321/* interface departure event */ 322typedef void (*ifnet_departure_event_handler_t)(void *, struct ifnet *); 323EVENTHANDLER_DECLARE(ifnet_departure_event, ifnet_departure_event_handler_t); 324 |
325/* 326 * interface groups 327 */ 328struct ifg_group { 329 char ifg_group[IFNAMSIZ]; 330 u_int ifg_refcnt; 331 void *ifg_pf_kif; 332 TAILQ_HEAD(, ifg_member) ifg_members; 333 TAILQ_ENTRY(ifg_group) ifg_next; 334}; 335 336struct ifg_member { 337 TAILQ_ENTRY(ifg_member) ifgm_next; 338 struct ifnet *ifgm_ifp; 339}; 340 341struct ifg_list { 342 struct ifg_group *ifgl_group; 343 TAILQ_ENTRY(ifg_list) ifgl_next; 344}; 345 346/* group attach event */ 347typedef void (*group_attach_event_handler_t)(void *, struct ifg_group *); 348EVENTHANDLER_DECLARE(group_attach_event, group_attach_event_handler_t); 349/* group detach event */ 350typedef void (*group_detach_event_handler_t)(void *, struct ifg_group *); 351EVENTHANDLER_DECLARE(group_detach_event, group_detach_event_handler_t); 352/* group change event */ 353typedef void (*group_change_event_handler_t)(void *, const char *); 354EVENTHANDLER_DECLARE(group_change_event, group_change_event_handler_t); 355 |
|
321#define IF_AFDATA_LOCK_INIT(ifp) \ 322 mtx_init(&(ifp)->if_afdata_mtx, "if_afdata", NULL, MTX_DEF) 323#define IF_AFDATA_LOCK(ifp) mtx_lock(&(ifp)->if_afdata_mtx) 324#define IF_AFDATA_TRYLOCK(ifp) mtx_trylock(&(ifp)->if_afdata_mtx) 325#define IF_AFDATA_UNLOCK(ifp) mtx_unlock(&(ifp)->if_afdata_mtx) 326#define IF_AFDATA_DESTROY(ifp) mtx_destroy(&(ifp)->if_afdata_mtx) 327 328#define IFF_LOCKGIANT(ifp) do { \ --- 290 unchanged lines hidden (view full) --- 619#define ifdev_byindex(idx) ifindex_table[(idx)].ife_dev 620 621extern struct ifnethead ifnet; 622extern struct ifindex_entry *ifindex_table; 623extern int ifqmaxlen; 624extern struct ifnet *loif; /* first loopback interface */ 625extern int if_index; 626 | 356#define IF_AFDATA_LOCK_INIT(ifp) \ 357 mtx_init(&(ifp)->if_afdata_mtx, "if_afdata", NULL, MTX_DEF) 358#define IF_AFDATA_LOCK(ifp) mtx_lock(&(ifp)->if_afdata_mtx) 359#define IF_AFDATA_TRYLOCK(ifp) mtx_trylock(&(ifp)->if_afdata_mtx) 360#define IF_AFDATA_UNLOCK(ifp) mtx_unlock(&(ifp)->if_afdata_mtx) 361#define IF_AFDATA_DESTROY(ifp) mtx_destroy(&(ifp)->if_afdata_mtx) 362 363#define IFF_LOCKGIANT(ifp) do { \ --- 290 unchanged lines hidden (view full) --- 654#define ifdev_byindex(idx) ifindex_table[(idx)].ife_dev 655 656extern struct ifnethead ifnet; 657extern struct ifindex_entry *ifindex_table; 658extern int ifqmaxlen; 659extern struct ifnet *loif; /* first loopback interface */ 660extern int if_index; 661 |
662int if_addgroup(struct ifnet *, const char *); 663int if_delgroup(struct ifnet *, const char *); |
|
627int if_addmulti(struct ifnet *, struct sockaddr *, struct ifmultiaddr **); 628int if_allmulti(struct ifnet *, int); 629struct ifnet* if_alloc(u_char); 630void if_attach(struct ifnet *); 631int if_delmulti(struct ifnet *, struct sockaddr *); 632void if_detach(struct ifnet *); 633void if_purgeaddrs(struct ifnet *); 634void if_down(struct ifnet *); --- 39 unchanged lines hidden --- | 664int if_addmulti(struct ifnet *, struct sockaddr *, struct ifmultiaddr **); 665int if_allmulti(struct ifnet *, int); 666struct ifnet* if_alloc(u_char); 667void if_attach(struct ifnet *); 668int if_delmulti(struct ifnet *, struct sockaddr *); 669void if_detach(struct ifnet *); 670void if_purgeaddrs(struct ifnet *); 671void if_down(struct ifnet *); --- 39 unchanged lines hidden --- |