if.h (72786) | if.h (79103) |
---|---|
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 * @(#)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 * @(#)if.h 8.1 (Berkeley) 6/10/93 |
34 * $FreeBSD: head/sys/net/if.h 72786 2001-02-21 06:39:57Z rwatson $ | 34 * $FreeBSD: head/sys/net/if.h 79103 2001-07-02 20:49:25Z brooks $ |
35 */ 36 37#ifndef _NET_IF_H_ 38#define _NET_IF_H_ 39 | 35 */ 36 37#ifndef _NET_IF_H_ 38#define _NET_IF_H_ 39 |
40#include <sys/queue.h> 41 |
|
40/* 41 * <net/if.h> does not depend on <sys/time.h> on most other systems. This 42 * helps userland compatibility. (struct timeval ifi_lastchange) 43 */ 44#ifndef _KERNEL 45#include <sys/time.h> 46#endif 47 | 42/* 43 * <net/if.h> does not depend on <sys/time.h> on most other systems. This 44 * helps userland compatibility. (struct timeval ifi_lastchange) 45 */ 46#ifndef _KERNEL 47#include <sys/time.h> 48#endif 49 |
50struct ifnet; 51 |
|
48/* | 52/* |
53 * Length of interface external name, including terminating '\0'. 54 * Note: this is the same size as a generic device's external name. 55 */ 56#define IFNAMSIZ 16 57#define IF_NAMESIZE IFNAMSIZ 58 59/* 60 * Structure describing a `cloning' interface. 61 */ 62struct if_clone { 63 LIST_ENTRY(if_clone) ifc_list; /* on list of cloners */ 64 const char *ifc_name; /* name of device, e.g. `gif' */ 65 size_t ifc_namelen; /* length of name */ 66 67 int (*ifc_create)(struct if_clone *, int *); 68 void (*ifc_destroy)(struct ifnet *); 69}; 70 71#define IF_CLONE_INITIALIZER(name, create, destroy) \ 72 { { 0 }, name, sizeof(name) - 1, create, destroy } 73 74/* 75 * Structure used to query names of interface cloners. 76 */ 77 78struct if_clonereq { 79 int ifcr_total; /* total cloners (out) */ 80 int ifcr_count; /* room for this many in user buffer */ 81 char *ifcr_buffer; /* buffer for cloner names */ 82}; 83 84/* |
|
49 * Structure describing information about an interface 50 * which may be of interest to management entities. 51 */ 52struct if_data { 53 /* generic interface information */ 54 u_char ifi_type; /* ethernet, tokenring, etc */ 55 u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */ 56 u_char ifi_addrlen; /* media address length */ --- 89 unchanged lines hidden (view full) --- 146 147/* 148 * Interface request structure used for socket 149 * ioctl's. All interface ioctl's must have parameter 150 * definitions which begin with ifr_name. The 151 * remainder may be interface specific. 152 */ 153struct ifreq { | 85 * Structure describing information about an interface 86 * which may be of interest to management entities. 87 */ 88struct if_data { 89 /* generic interface information */ 90 u_char ifi_type; /* ethernet, tokenring, etc */ 91 u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */ 92 u_char ifi_addrlen; /* media address length */ --- 89 unchanged lines hidden (view full) --- 182 183/* 184 * Interface request structure used for socket 185 * ioctl's. All interface ioctl's must have parameter 186 * definitions which begin with ifr_name. The 187 * remainder may be interface specific. 188 */ 189struct ifreq { |
154#define IFNAMSIZ 16 155#define IF_NAMESIZE IFNAMSIZ | |
156 char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */ 157 union { 158 struct sockaddr ifru_addr; 159 struct sockaddr ifru_dstaddr; 160 struct sockaddr ifru_broadaddr; 161 short ifru_flags[2]; 162 int ifru_metric; 163 int ifru_mtu; --- 109 unchanged lines hidden --- | 190 char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */ 191 union { 192 struct sockaddr ifru_addr; 193 struct sockaddr ifru_dstaddr; 194 struct sockaddr ifru_broadaddr; 195 short ifru_flags[2]; 196 int ifru_metric; 197 int ifru_mtu; --- 109 unchanged lines hidden --- |