ifq.h (87914) | ifq.h (92725) |
---|---|
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 87914 2001-12-14 19:32:47Z jlemon $ | 34 * $FreeBSD: head/sys/net/if_var.h 92725 2002-03-19 21:54:18Z alfred $ |
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). --- 100 unchanged lines hidden (view full) --- 143 int if_ipending; /* interrupts pending */ 144 void *if_linkmib; /* link-type-specific MIB data */ 145 size_t if_linkmiblen; /* length of above data */ 146 struct if_data if_data; 147 struct ifmultihead if_multiaddrs; /* multicast addresses configured */ 148 int if_amcount; /* number of all-multicast requests */ 149/* procedure handles */ 150 int (*if_output) /* output routine (enqueue) */ | 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). --- 100 unchanged lines hidden (view full) --- 143 int if_ipending; /* interrupts pending */ 144 void *if_linkmib; /* link-type-specific MIB data */ 145 size_t if_linkmiblen; /* length of above data */ 146 struct if_data if_data; 147 struct ifmultihead if_multiaddrs; /* multicast addresses configured */ 148 int if_amcount; /* number of all-multicast requests */ 149/* procedure handles */ 150 int (*if_output) /* output routine (enqueue) */ |
151 __P((struct ifnet *, struct mbuf *, struct sockaddr *, 152 struct rtentry *)); | 151 (struct ifnet *, struct mbuf *, struct sockaddr *, 152 struct rtentry *); |
153 void (*if_start) /* initiate output routine */ | 153 void (*if_start) /* initiate output routine */ |
154 __P((struct ifnet *)); | 154 (struct ifnet *); |
155 int (*if_done) /* output complete routine */ | 155 int (*if_done) /* output complete routine */ |
156 __P((struct ifnet *)); /* (XXX not used; fake prototype) */ | 156 (struct ifnet *); /* (XXX not used; fake prototype) */ |
157 int (*if_ioctl) /* ioctl routine */ | 157 int (*if_ioctl) /* ioctl routine */ |
158 __P((struct ifnet *, u_long, caddr_t)); | 158 (struct ifnet *, u_long, caddr_t); |
159 void (*if_watchdog) /* timer routine */ | 159 void (*if_watchdog) /* timer routine */ |
160 __P((struct ifnet *)); | 160 (struct ifnet *); |
161 int (*if_poll_recv) /* polled receive routine */ | 161 int (*if_poll_recv) /* polled receive routine */ |
162 __P((struct ifnet *, int *)); | 162 (struct ifnet *, int *); |
163 int (*if_poll_xmit) /* polled transmit routine */ | 163 int (*if_poll_xmit) /* polled transmit routine */ |
164 __P((struct ifnet *, int *)); | 164 (struct ifnet *, int *); |
165 void (*if_poll_intren) /* polled interrupt reenable routine */ | 165 void (*if_poll_intren) /* polled interrupt reenable routine */ |
166 __P((struct ifnet *)); | 166 (struct ifnet *); |
167 void (*if_poll_slowinput) /* input routine for slow devices */ | 167 void (*if_poll_slowinput) /* input routine for slow devices */ |
168 __P((struct ifnet *, struct mbuf *)); | 168 (struct ifnet *, struct mbuf *); |
169 void (*if_init) /* Init routine */ | 169 void (*if_init) /* Init routine */ |
170 __P((void *)); | 170 (void *); |
171 int (*if_resolvemulti) /* validate/resolve multicast */ | 171 int (*if_resolvemulti) /* validate/resolve multicast */ |
172 __P((struct ifnet *, struct sockaddr **, struct sockaddr *)); | 172 (struct ifnet *, struct sockaddr **, struct sockaddr *); |
173 struct ifqueue if_snd; /* output queue */ 174 struct ifqueue *if_poll_slowq; /* input queue for slow devices */ 175 struct ifprefixhead if_prefixhead; /* list of prefixes per if */ 176 u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */ 177}; 178 | 173 struct ifqueue if_snd; /* output queue */ 174 struct ifqueue *if_poll_slowq; /* input queue for slow devices */ 175 struct ifprefixhead if_prefixhead; /* list of prefixes per if */ 176 u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */ 177}; 178 |
179typedef void if_init_f_t __P((void *)); | 179typedef void if_init_f_t(void *); |
180 181#define if_mtu if_data.ifi_mtu 182#define if_type if_data.ifi_type 183#define if_physical if_data.ifi_physical 184#define if_addrlen if_data.ifi_addrlen 185#define if_hdrlen if_data.ifi_hdrlen 186#define if_metric if_data.ifi_metric 187#define if_baudrate if_data.ifi_baudrate --- 142 unchanged lines hidden (view full) --- 330 struct sockaddr *ifa_addr; /* address of interface */ 331 struct sockaddr *ifa_dstaddr; /* other end of p-to-p link */ 332#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */ 333 struct sockaddr *ifa_netmask; /* used to determine subnet */ 334 struct if_data if_data; /* not all members are meaningful */ 335 struct ifnet *ifa_ifp; /* back-pointer to interface */ 336 TAILQ_ENTRY(ifaddr) ifa_link; /* queue macro glue */ 337 void (*ifa_rtrequest) /* check or clean routes (+ or -)'d */ | 180 181#define if_mtu if_data.ifi_mtu 182#define if_type if_data.ifi_type 183#define if_physical if_data.ifi_physical 184#define if_addrlen if_data.ifi_addrlen 185#define if_hdrlen if_data.ifi_hdrlen 186#define if_metric if_data.ifi_metric 187#define if_baudrate if_data.ifi_baudrate --- 142 unchanged lines hidden (view full) --- 330 struct sockaddr *ifa_addr; /* address of interface */ 331 struct sockaddr *ifa_dstaddr; /* other end of p-to-p link */ 332#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */ 333 struct sockaddr *ifa_netmask; /* used to determine subnet */ 334 struct if_data if_data; /* not all members are meaningful */ 335 struct ifnet *ifa_ifp; /* back-pointer to interface */ 336 TAILQ_ENTRY(ifaddr) ifa_link; /* queue macro glue */ 337 void (*ifa_rtrequest) /* check or clean routes (+ or -)'d */ |
338 __P((int, struct rtentry *, struct rt_addrinfo *)); | 338 (int, struct rtentry *, struct rt_addrinfo *); |
339 u_short ifa_flags; /* mostly rt_flags for cloning */ 340 u_int ifa_refcnt; /* references to this structure */ 341 int ifa_metric; /* cost of going out this interface */ 342#ifdef notdef 343 struct rtentry *ifa_rt; /* XXXX for ROUTETOIF ????? */ 344#endif 345 int (*ifa_claim_addr) /* check if an addr goes to this if */ | 339 u_short ifa_flags; /* mostly rt_flags for cloning */ 340 u_int ifa_refcnt; /* references to this structure */ 341 int ifa_metric; /* cost of going out this interface */ 342#ifdef notdef 343 struct rtentry *ifa_rt; /* XXXX for ROUTETOIF ????? */ 344#endif 345 int (*ifa_claim_addr) /* check if an addr goes to this if */ |
346 __P((struct ifaddr *, struct sockaddr *)); | 346 (struct ifaddr *, struct sockaddr *); |
347 348}; 349#define IFA_ROUTE RTF_UP /* route installed */ 350 351/* for compatibility with other BSDs */ 352#define ifa_list ifa_link 353 354/* --- 45 unchanged lines hidden (view full) --- 400#define ifdev_byindex(idx) ifindex_table[(idx)].ife_dev 401 402extern struct ifnethead ifnet; 403extern struct ifindex_entry *ifindex_table; 404extern int ifqmaxlen; 405extern struct ifnet *loif; /* first loopback interface */ 406extern int if_index; 407 | 347 348}; 349#define IFA_ROUTE RTF_UP /* route installed */ 350 351/* for compatibility with other BSDs */ 352#define ifa_list ifa_link 353 354/* --- 45 unchanged lines hidden (view full) --- 400#define ifdev_byindex(idx) ifindex_table[(idx)].ife_dev 401 402extern struct ifnethead ifnet; 403extern struct ifindex_entry *ifindex_table; 404extern int ifqmaxlen; 405extern struct ifnet *loif; /* first loopback interface */ 406extern int if_index; 407 |
408void ether_ifattach __P((struct ifnet *, int)); 409void ether_ifdetach __P((struct ifnet *, int)); 410void ether_input __P((struct ifnet *, struct ether_header *, struct mbuf *)); 411void ether_demux __P((struct ifnet *, struct ether_header *, struct mbuf *)); 412int ether_output __P((struct ifnet *, 413 struct mbuf *, struct sockaddr *, struct rtentry *)); 414int ether_output_frame __P((struct ifnet *, struct mbuf *)); 415int ether_ioctl __P((struct ifnet *, int, caddr_t)); | 408void ether_ifattach(struct ifnet *, int); 409void ether_ifdetach(struct ifnet *, int); 410void ether_input(struct ifnet *, struct ether_header *, struct mbuf *); 411void ether_demux(struct ifnet *, struct ether_header *, struct mbuf *); 412int ether_output(struct ifnet *, 413 struct mbuf *, struct sockaddr *, struct rtentry *); 414int ether_output_frame(struct ifnet *, struct mbuf *); 415int ether_ioctl(struct ifnet *, int, caddr_t); |
416 | 416 |
417int if_addmulti __P((struct ifnet *, struct sockaddr *, 418 struct ifmultiaddr **)); 419int if_allmulti __P((struct ifnet *, int)); 420void if_attach __P((struct ifnet *)); 421int if_delmulti __P((struct ifnet *, struct sockaddr *)); 422void if_detach __P((struct ifnet *)); 423void if_down __P((struct ifnet *)); 424void if_route __P((struct ifnet *, int flag, int fam)); 425int if_setlladdr __P((struct ifnet *, const u_char *, int)); 426void if_unroute __P((struct ifnet *, int flag, int fam)); 427void if_up __P((struct ifnet *)); 428/*void ifinit __P((void));*/ /* declared in systm.h for main() */ 429int ifioctl __P((struct socket *, u_long, caddr_t, struct thread *)); 430int ifpromisc __P((struct ifnet *, int)); 431struct ifnet *ifunit __P((const char *)); 432struct ifnet *if_withname __P((struct sockaddr *)); | 417int if_addmulti(struct ifnet *, struct sockaddr *, struct ifmultiaddr **); 418int if_allmulti(struct ifnet *, int); 419void if_attach(struct ifnet *); 420int if_delmulti(struct ifnet *, struct sockaddr *); 421void if_detach(struct ifnet *); 422void if_down(struct ifnet *); 423void if_route(struct ifnet *, int flag, int fam); 424int if_setlladdr(struct ifnet *, const u_char *, int); 425void if_unroute(struct ifnet *, int flag, int fam); 426void if_up(struct ifnet *); 427/*void ifinit(void);*/ /* declared in systm.h for main() */ 428int ifioctl(struct socket *, u_long, caddr_t, struct thread *); 429int ifpromisc(struct ifnet *, int); 430struct ifnet *ifunit(const char *); 431struct ifnet *if_withname(struct sockaddr *); |
433 | 432 |
434int if_poll_recv_slow __P((struct ifnet *ifp, int *quotap)); 435void if_poll_xmit_slow __P((struct ifnet *ifp, int *quotap)); 436void if_poll_throttle __P((void)); 437void if_poll_unthrottle __P((void *)); 438void if_poll_init __P((void)); 439void if_poll __P((void)); | 433int if_poll_recv_slow(struct ifnet *ifp, int *quotap); 434void if_poll_xmit_slow(struct ifnet *ifp, int *quotap); 435void if_poll_throttle(void); 436void if_poll_unthrottle(void *); 437void if_poll_init(void); 438void if_poll(void); |
440 | 439 |
441struct ifaddr *ifa_ifwithaddr __P((struct sockaddr *)); 442struct ifaddr *ifa_ifwithdstaddr __P((struct sockaddr *)); 443struct ifaddr *ifa_ifwithnet __P((struct sockaddr *)); 444struct ifaddr *ifa_ifwithroute __P((int, struct sockaddr *, 445 struct sockaddr *)); 446struct ifaddr *ifaof_ifpforaddr __P((struct sockaddr *, struct ifnet *)); 447void ifafree __P((struct ifaddr *)); | 440struct ifaddr *ifa_ifwithaddr(struct sockaddr *); 441struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *); 442struct ifaddr *ifa_ifwithnet(struct sockaddr *); 443struct ifaddr *ifa_ifwithroute(int, struct sockaddr *, struct sockaddr *); 444struct ifaddr *ifaof_ifpforaddr(struct sockaddr *, struct ifnet *); 445void ifafree(struct ifaddr *); |
448 | 446 |
449struct ifmultiaddr *ifmaof_ifpforaddr __P((struct sockaddr *, 450 struct ifnet *)); 451int if_simloop __P((struct ifnet *ifp, struct mbuf *m, int af, int hlen)); | 447struct ifmultiaddr *ifmaof_ifpforaddr(struct sockaddr *, struct ifnet *); 448int if_simloop(struct ifnet *ifp, struct mbuf *m, int af, int hlen); |
452 | 449 |
453void if_clone_attach __P((struct if_clone *)); 454void if_clone_detach __P((struct if_clone *)); | 450void if_clone_attach(struct if_clone *); 451void if_clone_detach(struct if_clone *); |
455 | 452 |
456int if_clone_create __P((char *, int)); 457int if_clone_destroy __P((const char *)); | 453int if_clone_create(char *, int); 454int if_clone_destroy(const char *); |
458 459#define IF_LLADDR(ifp) \ 460 LLADDR((struct sockaddr_dl *) ifaddr_byindex((ifp)->if_index)->ifa_addr) 461 462#ifdef DEVICE_POLLING 463enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS, POLL_DEREGISTER }; 464 | 455 456#define IF_LLADDR(ifp) \ 457 LLADDR((struct sockaddr_dl *) ifaddr_byindex((ifp)->if_index)->ifa_addr) 458 459#ifdef DEVICE_POLLING 460enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS, POLL_DEREGISTER }; 461 |
465typedef void poll_handler_t __P((struct ifnet *ifp, 466 enum poll_cmd cmd, int count)); 467int ether_poll_register __P((poll_handler_t *h, struct ifnet *ifp)); 468int ether_poll_deregister __P((struct ifnet *ifp)); | 462typedef void poll_handler_t(struct ifnet *ifp, enum poll_cmd cmd, int count); 463int ether_poll_register(poll_handler_t *h, struct ifnet *ifp); 464int ether_poll_deregister(struct ifnet *ifp); |
469#endif /* DEVICE_POLLING */ 470 471#endif /* _KERNEL */ 472 473#endif /* !_NET_IF_VAR_H_ */ | 465#endif /* DEVICE_POLLING */ 466 467#endif /* _KERNEL */ 468 469#endif /* !_NET_IF_VAR_H_ */ |