ifq.h (130585) | ifq.h (130933) |
---|---|
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 130585 2004-06-16 09:47:26Z phk $ | 30 * $FreeBSD: head/sys/net/if_var.h 130933 2004-06-22 20:13:25Z brooks $ |
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). --- 272 unchanged lines hidden (view full) --- 311typedef void (*ifaddr_event_handler_t)(void *, struct ifnet *); 312EVENTHANDLER_DECLARE(ifaddr_event, ifaddr_event_handler_t); 313/* new interface arrival event */ 314typedef void (*ifnet_arrival_event_handler_t)(void *, struct ifnet *); 315EVENTHANDLER_DECLARE(ifnet_arrival_event, ifnet_arrival_event_handler_t); 316/* interface departure event */ 317typedef void (*ifnet_departure_event_handler_t)(void *, struct ifnet *); 318EVENTHANDLER_DECLARE(ifnet_departure_event, ifnet_departure_event_handler_t); | 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). --- 272 unchanged lines hidden (view full) --- 311typedef void (*ifaddr_event_handler_t)(void *, struct ifnet *); 312EVENTHANDLER_DECLARE(ifaddr_event, ifaddr_event_handler_t); 313/* new interface arrival event */ 314typedef void (*ifnet_arrival_event_handler_t)(void *, struct ifnet *); 315EVENTHANDLER_DECLARE(ifnet_arrival_event, ifnet_arrival_event_handler_t); 316/* interface departure event */ 317typedef void (*ifnet_departure_event_handler_t)(void *, struct ifnet *); 318EVENTHANDLER_DECLARE(ifnet_departure_event, ifnet_departure_event_handler_t); |
319/* interface clone event */ 320typedef void (*if_clone_event_handler_t)(void *, struct if_clone *); 321EVENTHANDLER_DECLARE(if_clone_event, if_clone_event_handler_t); | |
322 323#define IF_AFDATA_LOCK_INIT(ifp) \ 324 mtx_init(&(ifp)->if_afdata_mtx, "if_afdata", NULL, MTX_DEF) 325#define IF_AFDATA_LOCK(ifp) mtx_lock(&(ifp)->if_afdata_mtx) 326#define IF_AFDATA_TRYLOCK(ifp) mtx_trylock(&(ifp)->if_afdata_mtx) 327#define IF_AFDATA_UNLOCK(ifp) mtx_unlock(&(ifp)->if_afdata_mtx) 328#define IF_AFDATA_DESTROY(ifp) mtx_destroy(&(ifp)->if_afdata_mtx) 329 --- 350 unchanged lines hidden (view full) --- 680struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *); 681struct ifaddr *ifa_ifwithnet(struct sockaddr *); 682struct ifaddr *ifa_ifwithroute(int, struct sockaddr *, struct sockaddr *); 683struct ifaddr *ifaof_ifpforaddr(struct sockaddr *, struct ifnet *); 684 685struct ifmultiaddr *ifmaof_ifpforaddr(struct sockaddr *, struct ifnet *); 686int if_simloop(struct ifnet *ifp, struct mbuf *m, int af, int hlen); 687 | 319 320#define IF_AFDATA_LOCK_INIT(ifp) \ 321 mtx_init(&(ifp)->if_afdata_mtx, "if_afdata", NULL, MTX_DEF) 322#define IF_AFDATA_LOCK(ifp) mtx_lock(&(ifp)->if_afdata_mtx) 323#define IF_AFDATA_TRYLOCK(ifp) mtx_trylock(&(ifp)->if_afdata_mtx) 324#define IF_AFDATA_UNLOCK(ifp) mtx_unlock(&(ifp)->if_afdata_mtx) 325#define IF_AFDATA_DESTROY(ifp) mtx_destroy(&(ifp)->if_afdata_mtx) 326 --- 350 unchanged lines hidden (view full) --- 677struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *); 678struct ifaddr *ifa_ifwithnet(struct sockaddr *); 679struct ifaddr *ifa_ifwithroute(int, struct sockaddr *, struct sockaddr *); 680struct ifaddr *ifaof_ifpforaddr(struct sockaddr *, struct ifnet *); 681 682struct ifmultiaddr *ifmaof_ifpforaddr(struct sockaddr *, struct ifnet *); 683int if_simloop(struct ifnet *ifp, struct mbuf *m, int af, int hlen); 684 |
688void if_clone_attach(struct if_clone *); 689void if_clone_detach(struct if_clone *); 690 691int if_clone_create(char *, int); 692int if_clone_destroy(const char *); 693 | |
694#define IF_LLADDR(ifp) \ 695 LLADDR((struct sockaddr_dl *) ifaddr_byindex((ifp)->if_index)->ifa_addr) 696 697#ifdef DEVICE_POLLING 698enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS, POLL_DEREGISTER }; 699 700typedef void poll_handler_t(struct ifnet *ifp, enum poll_cmd cmd, int count); 701int ether_poll_register(poll_handler_t *h, struct ifnet *ifp); 702int ether_poll_deregister(struct ifnet *ifp); 703#endif /* DEVICE_POLLING */ 704 705#endif /* _KERNEL */ 706 707#endif /* !_NET_IF_VAR_H_ */ | 685#define IF_LLADDR(ifp) \ 686 LLADDR((struct sockaddr_dl *) ifaddr_byindex((ifp)->if_index)->ifa_addr) 687 688#ifdef DEVICE_POLLING 689enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS, POLL_DEREGISTER }; 690 691typedef void poll_handler_t(struct ifnet *ifp, enum poll_cmd cmd, int count); 692int ether_poll_register(poll_handler_t *h, struct ifnet *ifp); 693int ether_poll_deregister(struct ifnet *ifp); 694#endif /* DEVICE_POLLING */ 695 696#endif /* _KERNEL */ 697 698#endif /* !_NET_IF_VAR_H_ */ |