X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/f540a634ce59906ba07c5c2a261622aae92b6515..d84c5c7b31467be031b38182640028dcb7c3a090:/sys/net/if.h diff --git a/sys/net/if.h b/sys/net/if.h index fa9e5d4ccf..7830c2dc81 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -32,7 +32,7 @@ * * @(#)if.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/net/if.h,v 1.58.2.9 2002/08/30 14:23:38 sobomax Exp $ - * $DragonFly: src/sys/net/if.h,v 1.17 2006/12/19 00:11:12 dillon Exp $ + * $DragonFly: src/sys/net/if.h,v 1.21 2008/08/30 16:07:59 hasso Exp $ */ #ifndef _NET_IF_H_ @@ -56,6 +56,14 @@ #endif +/* + * Values for if_link_state. + */ +#define LINK_STATE_UNKNOWN 0 /* link invalid/unknown */ +#define LINK_STATE_DOWN 1 /* link is down */ +#define LINK_STATE_UP 2 /* link is up */ +#define LINK_STATE_IS_UP(_s) ((_s) >= LINK_STATE_UP) + struct ifnet; /* @@ -66,31 +74,10 @@ struct ifnet; #define IF_NAMESIZE IFNAMSIZ #define IF_MAXUNIT 0x7fff /* if_unit is 15bits */ -#ifdef _KERNEL -/* - * Structure describing a `cloning' interface. - */ -struct if_clone { - LIST_ENTRY(if_clone) ifc_list; /* on list of cloners */ - const char *ifc_name; /* name of device, e.g. `gif' */ - size_t ifc_namelen; /* length of name */ - int ifc_minifs; /* minimum number of interfaces */ - int ifc_maxunit; /* maximum unit number */ - unsigned char *ifc_units; /* bitmap to handle units */ - int ifc_bmlen; /* bitmap length */ - - int (*ifc_create)(struct if_clone *, int); - void (*ifc_destroy)(struct ifnet *); -}; - -#define IF_CLONE_INITIALIZER(name, create, destroy, minifs, maxunit) \ - { { 0 }, name, sizeof(name) - 1, minifs, maxunit, NULL, 0, create, destroy } -#endif - /* * Structure used to query names of interface cloners. + * XXX should be moved to net/if_clone.h */ - struct if_clonereq { int ifcr_total; /* total cloners (out) */ int ifcr_count; /* room for this many in user buffer */ @@ -111,6 +98,7 @@ struct if_data { u_char ifi_xmitquota; /* polling quota for xmit intrs */ u_long ifi_mtu; /* maximum transmission unit */ u_long ifi_metric; /* routing metric (external only) */ + u_long ifi_link_state; /* current link state */ u_long ifi_baudrate; /* linespeed */ /* volatile statistics */ u_long ifi_ipackets; /* packets received on interface */ @@ -149,11 +137,14 @@ struct if_data { #define IFF_POLLING 0x10000 /* Interface is in polling mode. */ #define IFF_PPROMISC 0x20000 /* user-requested promisc mode */ #define IFF_MONITOR 0x40000 /* user-requested monitor mode */ +#define IFF_STATICARP 0x80000 /* static ARP */ +#define IFF_NPOLLING 0x100000 /* ifpoll is used */ /* flags set internally only: */ #define IFF_CANTCHANGE \ (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\ - IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART|IFF_POLLING) + IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART|IFF_POLLING|\ + IFF_NPOLLING) /* * Some convenience macros used for setting ifi_baudrate. @@ -170,6 +161,7 @@ struct if_data { #define IFCAP_VLAN_MTU 0x0008 /* VLAN-compatible MTU */ #define IFCAP_VLAN_HWTAGGING 0x0010 /* hardware VLAN tag support */ #define IFCAP_JUMBO_MTU 0x0020 /* 9000 byte MTU support */ +#define IFCAP_RSS 0x0040 /* Receive Side Scaling for IPv4 */ #define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM) @@ -245,12 +237,14 @@ struct ifreq { struct sockaddr ifru_dstaddr; struct sockaddr ifru_broadaddr; short ifru_flags[2]; + short ifru_index; int ifru_metric; int ifru_mtu; int ifru_phys; int ifru_media; void *ifru_data; int ifru_cap[2]; + int ifru_pollcpu; } ifr_ifru; #define ifr_addr ifr_ifru.ifru_addr /* address */ #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ @@ -264,6 +258,8 @@ struct ifreq { #define ifr_data ifr_ifru.ifru_data /* for use by interface */ #define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */ #define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */ +#define ifr_index ifr_ifru.ifru_index /* interface index */ +#define ifr_pollcpu ifr_ifru.ifru_pollcpu /* polling(4) cpu */ }; #define _SIZEOF_ADDR_IFREQ(ifr) \ @@ -339,8 +335,8 @@ struct if_laddrreq { #ifndef _KERNEL struct if_nameindex { - u_int if_index; /* 1, 2, ... */ - const char *if_name; /* null terminated name: "le0", ... */ + u_int if_index; /* 1, 2, ... */ + char *if_name; /* null terminated name: "le0", ... */ }; __BEGIN_DECLS