|
From: | Christopher Ayres |
Subject: | Software:NTOP Command:/configure issue Environment:Solaris5.8 Keywords:/usr/include/net/if.h |
Date: | Mon, 24 Feb 2003 04:47:04 -0000 |
Wondering what direction to take here. When I tryed to configure ntop, it
hangs on the below statement. I have included all the information I could find.
Including an ntop configure run output.
I have also search everywhere for similer issues. Please a little
help....
Thanks,
Christopher Weldon Ayres
==========================================================
# Data Attachments Below:
# - SSI System Software Information
# - The configure command in question or issue
source
# - The ntop configure runtime output
# - The /usr/include/net/if.h content
==========================================================
#
# SSI System Software Information
# Source: ntop-2.1.3.tar.gz
System: SunOS dauntless 5.8 Generic_108528-06 sun4u sparc
SUNW,Sun-Blade-100
Related Sources: autoconf-2.57.tar.gz
automake-1.7.tar.gz libtool-1.4.3.tar.gz m4-1.4.tar.gz
Related SubSystem: /usr/include/net/if.h
From : 5.8 install
SUN Package name: SUNWhea
File sum: 36994
==========================================================
# # The configure command in question or issue
source
#
# gcc -c -g -O2 -pipe conftest.c
In file included from configure:10072: /usr/include/net/if.h:225: field `ifa_addr' has incomplete type /usr/include/net/if.h:227: field `ifu_broadaddr' has incomplete type /usr/include/net/if.h:228: field `ifu_dstaddr' has incomplete type /usr/include/net/if.h:234: confused by earlier errors, bailing out <----Hangs Indefinitely
==========================================================
#
# The ntop configure runtime output
#
#./configure
checking build system type...
sparc-sun-solaris2.8
checking host system type... sparc-sun-solaris2.8 checking target system type... sparc-sun-solaris2.8 checking for a BSD-compatible install...
./install-sh -c
checking whether build environment is sane... yes checking for gawk... no checking for mawk... no checking for nawk... nawk checking whether make sets $(MAKE)... yes Step 1. Looking for required development tools.... checking for style of include used by make...
GNU
checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking dependency style of gcc... gcc3 checking for ld used by GCC... /usr/ccs/bin/ld checking if the linker (/usr/ccs/bin/ld) is GNU ld... no checking for /usr/ccs/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/ccs/bin/nm -p checking for a sed that does not truncate output... /usr/xpg4/bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/ccs/bin/nm -p output... ok checking how to run the C preprocessor... gcc -E checking for egrep... egrep checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... no checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/ccs/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... no checking dynamic linker characteristics... solaris2.8 ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes creating libtool checking for gcc option to accept ANSI C... none
needed
checking how to run the C preprocessor... gcc -E checking whether make sets $(MAKE)... (cached) yes checking for a BSD-compatible install... ./install-sh -c checking for compiler option -pipe... yes checking for compilation debug mode... disabled checking for compilation optimization mode... disabled Step 2. Processing user options....
Step 3. Checking for special support for platform/compiler.... Step 4. Looking for both required and optional system headers.... checking for ANSI C header files... (cached)
yes
checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking stdio.h usability... yes checking stdio.h presence... yes checking for stdio.h... yes checking errno.h usability... yes checking errno.h presence... yes checking for errno.h... yes checking for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking for string.h... (cached) yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking for sys/types.h... (cached) yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/wait.h usability... yes checking sys/wait.h presence... yes checking for sys/wait.h... yes checking for sys/stat.h... (cached) yes checking sys/ioctl usability... no checking sys/ioctl presence... no checking for sys/ioctl... no checking sys/un.h usability... yes checking sys/un.h presence... yes checking for sys/un.h... yes checking sys/select.h usability... yes checking sys/select.h presence... yes checking for sys/select.h... yes checking sys/ldr.h usability... no checking sys/ldr.h presence... no checking for sys/ldr.h... no checking sys/sockio.h usability... yes checking sys/sockio.h presence... yes checking for sys/sockio.h... yes checking dl.h usability... no checking dl.h presence... no checking for dl.h... no checking dirent.h usability... yes checking dirent.h presence... yes checking for dirent.h... yes checking for dlfcn.h... (cached) yes checking security/pam_appl.h usability... yes checking security/pam_appl.h presence... yes checking for security/pam_appl.h... yes checking shadow.h usability... yes checking shadow.h presence... yes checking for shadow.h... yes checking crypt.h usability... yes checking crypt.h presence... yes checking for crypt.h... yes checking if ether_header uses ether_addr structs... yes checking if in6_addr is defined... yes checking for curses.h... yes checking alloca.h usability... yes checking alloca.h presence... yes checking for alloca.h... yes checking sched.h usability... yes checking sched.h presence... yes checking for sched.h... yes checking sys/sched.h usability... no checking sys/sched.h presence... no checking for sys/sched.h... no checking semaphore.h usability... yes checking semaphore.h presence... yes checking for semaphore.h... yes checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking netdb.h usability... yes checking netdb.h presence... yes checking for netdb.h... yes checking netinet/in.h usability... yes checking netinet/in.h presence... yes checking for netinet/in.h... yes checking arpa/inet.h usability... yes checking arpa/inet.h presence... yes checking for arpa/inet.h... yes checking net/if.h usability... <------ hangs indefinitely ==========================================================
#
# The conftest.c file content
#
#line 9987 "configure"
/* confdefs.h. */ #define PACKAGE_NAME ""
#define PACKAGE_TARNAME "" #define PACKAGE_VERSION "" #define PACKAGE_STRING "" #define PACKAGE_BUGREPORT "" #define STDC_HEADERS 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_STDLIB_H 1 #define HAVE_STRING_H 1 #define HAVE_MEMORY_H 1 #define HAVE_STRINGS_H 1 #define HAVE_INTTYPES_H 1 #define HAVE_UNISTD_H 1 #define HAVE_DLFCN_H 1 #define NTOP_BIG_ENDIAN 1 #define STDC_HEADERS 1 #define HAVE_PWD_H 1 #define HAVE_STDIO_H 1 #define HAVE_ERRNO_H 1 #define HAVE_STDLIB_H 1 #define HAVE_UNISTD_H 1 #define HAVE_STRING_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_FCNTL_H 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_TIME_H 1 #define HAVE_SYS_WAIT_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_SYS_UN_H 1 #define HAVE_SYS_SELECT_H 1 #define HAVE_SYS_SOCKIO_H 1 #define HAVE_DIRENT_H 1 #define HAVE_DLFCN_H 1 #define HAVE_SECURITY_PAM_APPL_H 1 #define HAVE_SHADOW_H 1 #define HAVE_CRYPT_H 1 #define ETHER_HEADER_HAS_EA 1 #define HAVE_IN6_ADDR 1 #define HAVE_CURSES_H 1 #define HAVE_ALLOCA_H 1 #define HAVE_SCHED_H 1 #define HAVE_SEMAPHORE_H 1 #define HAVE_PTHREAD_H 1 #define HAVE_SYS_SOCKET_H 1 #define HAVE_NETDB_H 1 #define HAVE_NETINET_IN_H 1 #define HAVE_ARPA_INET_H 1 /* end confdefs.h. */ #include <stdio.h> #if HAVE_SYS_TYPES_H # include <sys/types.h> #endif #if HAVE_SYS_STAT_H # include <sys/stat.h> #endif #if STDC_HEADERS # include <stdlib.h> # include <stddef.h> #else # if HAVE_STDLIB_H # include <stdlib.h> # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include <memory.h> # endif # include <string.h> #endif #if HAVE_STRINGS_H # include <strings.h> #endif #if HAVE_INTTYPES_H # include <inttypes.h> #else # if HAVE_STDINT_H # include <stdint.h> # endif #endif #if HAVE_UNISTD_H # include <unistd.h> #endif #include <net/if.h> ==========================================================
#
#
The /usr/include/net/if.h content
#
# cat -n /usr/include/net/if.h
1 /* 2 * Copyright (c) 1992-1999 by Sun Microsystems, Inc. 3 * All rights reserved. 4 */ 5 6 /* 7 * Copyright (c) 1982, 1986 Regents of the University of California. 8 * All rights reserved. The Berkeley software License Agreement 9 * specifies the terms and conditions for redistribution. 10 */ 11 12 #ifndef _NET_IF_H 13 #define _NET_IF_H 14 15 #pragma ident "@(#)if.h 1.23 00/03/28 SMI" 16 /* if.h 1.26 90/05/29 SMI; from UCB 7.1 6/4/86 */ 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 /* 23 * Structures defining a network interface, providing a packet 24 * transport mechanism (ala level 0 of the PUP protocols). 25 * 26 * Each interface accepts output datagrams of a specified maximum 27 * length, and provides higher level routines with input datagrams 28 * received from its medium. 29 * 30 * Output occurs when the routine if_output is called, with three parameters: 31 * (*ifp->if_output)(ifp, m, dst) 32 * Here m is the mbuf chain to be sent and dst is the destination address. 33 * The output routine encapsulates the supplied datagram if necessary, 34 * and then transmits it on its medium. 35 * 36 * On input, each interface unwraps the data received by it, and either 37 * places it on the input queue of a internetwork datagram routine 38 * and posts the associated software interrupt, or passes the datagram to a raw 39 * packet input routine. 40 * 41 * Routines exist for locating interfaces by their addresses 42 * or for locating a interface on a certain network, as well as more general 43 * routing and gateway routines maintaining information used to locate 44 * interfaces. These routines live in the files if.c and route.c 45 */ 46 47 /* 48 * Structure defining a queue for a network interface. 49 * 50 * (Would like to call this struct ``if'', but C isn't PL/1.) 51 */ 52 struct ifnet { 53 char *if_name; /* name, e.g. ``en'' or ``lo'' */ 54 short if_unit; /* sub-unit for lower level driver */ 55 short if_mtu; /* maximum transmission unit */ 56 short if_flags; /* up/down, broadcast, etc. */ 57 short if_timer; /* time 'til if_watchdog called */ 58 ushort_t if_promisc; /* net # of requests for promisc mode */ 59 int if_metric; /* routing metric (external only) */ 60 struct ifaddr *if_addrlist; /* linked list of addresses per if */ 61 struct ifqueue { 62 struct mbuf *ifq_head; 63 struct mbuf *ifq_tail; 64 int ifq_len; 65 int ifq_maxlen; 66 int ifq_drops; 67 } if_snd; /* output queue */ 68 /* procedure handles */ 69 int (*if_init)(); /* init routine */ 70 int (*if_output)(); /* output routine */ 71 int (*if_ioctl)(); /* ioctl routine */ 72 int (*if_reset)(); /* bus reset routine */ 73 int (*if_watchdog)(); /* timer routine */ 74 /* generic interface statistics */ 75 int if_ipackets; /* packets received on interface */ 76 int if_ierrors; /* input errors on interface */ 77 int if_opackets; /* packets sent on interface */ 78 int if_oerrors; /* output errors on interface */ 79 int if_collisions; /* collisions on csma interfaces */ 80 /* end statistics */ 81 struct ifnet *if_next; 82 struct ifnet *if_upper; /* next layer up */ 83 struct ifnet *if_lower; /* next layer down */ 84 int (*if_input)(); /* input routine */ 85 int (*if_ctlin)(); /* control input routine */ 86 int (*if_ctlout)(); /* control output routine */ 87 struct map *if_memmap; /* rmap for interface specific memory */ 88 }; 89 90 /* 91 * NOTE : These flags are not directly used within IP. 92 * ip_if.h has definitions derived from this which is used within IP. 93 * If you define a flag here, you need to define one in ip_if.h before 94 * using the new flag in IP. Don't use these flags directly in IP. 95 */ 96 #define IFF_UP 0x00000001 /* interface is up */ 97 #define IFF_BROADCAST 0x00000002 /* broadcast address valid */ 98 #define IFF_DEBUG 0x00000004 /* turn on debugging */ 99 #define IFF_LOOPBACK 0x00000008 /* is a loopback net */ 100 101 #define IFF_POINTOPOINT 0x00000010 /* interface is point-to-point link */ 102 #define IFF_NOTRAILERS 0x00000020 /* avoid use of trailers */ 103 #define IFF_RUNNING 0x00000040 /* resources allocated */ 104 #define IFF_NOARP 0x00000080 /* no address resolution protocol */ 105 106 #define IFF_PROMISC 0x00000100 /* receive all packets */ 107 #define IFF_ALLMULTI 0x00000200 /* receive all multicast packets */ 108 #define IFF_INTELLIGENT 0x00000400 /* protocol code on board */ 109 #define IFF_MULTICAST 0x00000800 /* supports multicast */ 110 111 #define IFF_MULTI_BCAST 0x00001000 /* multicast using broadcast address */ 112 #define IFF_UNNUMBERED 0x00002000 /* non-unique address */ 113 #define IFF_DHCPRUNNING 0x00004000 /* DHCP controls this interface */ 114 #define IFF_PRIVATE 0x00008000 /* do not advertise */ 115 116 /* 117 * The following flags can't be grabbed or altered by SIOC[GS]IFFLAGS. 118 * Should use SIOC[GS]LIFLAGS which has a larger flags field. 119 */ 120 #define IFF_NOXMIT 0x00010000 /* Do not transmit packets */ 121 #define IFF_NOLOCAL 0x00020000 /* No address - just on-link subnet */ 122 #define IFF_DEPRECATED 0x00040000 /* interface address deprecated */ 123 #define IFF_ADDRCONF 0x00080000 /* address from stateless addrconf */ 124 125 #define IFF_ROUTER 0x00100000 /* router on this interface */ 126 #define IFF_NONUD 0x00200000 /* No NUD on this interface */ 127 #define IFF_ANYCAST 0x00400000 /* Anycast address */ 128 #define IFF_NORTEXCH 0x00800000 /* Do not exchange routing info */ 129 130 #define IFF_IPV4 0x01000000 /* IPv4 interface */ 131 #define IFF_IPV6 0x02000000 /* IPv6 interface */ 132 #define IFF_MIPRUNNING 0x04000000 /* Mobile IP controls this interface */ 133 #define IFF_NOFAILOVER 0x08000000 /* Don't failover on NIC failure */ 134 135 #define IFF_FAILED 0x10000000 /* NIC has failed */ 136 #define IFF_STANDBY 0x20000000 /* Standby NIC to be used on failures */ 137 #define IFF_INACTIVE 0x40000000 /* Standby active or not ? */ 138 #define IFF_LINKAGGR 0x80000000 /* Link Aggregation supported by NIC */ 139 140 /* 141 * The IFF_MULTICAST flag indicates that the network can support the 142 * transmission and reception of higher-level (e.g., IP) multicast packets. 143 * It is independent of hardware support for multicasting; for example, 144 * point-to-point links or pure broadcast networks may well support 145 * higher-level multicasts. 146 */ 147 148 /* flags set internally only: */ 149 #define IFF_CANTCHANGE \ 150 (IFF_BROADCAST | IFF_POINTOPOINT | IFF_RUNNING | IFF_PROMISC | \ 151 IFF_MULTICAST | IFF_MULTI_BCAST | IFF_UNNUMBERED | IFF_IPV4 | \ 152 IFF_IPV6|IFF_INACTIVE) 153 154 /* 155 * Output queues (ifp->if_snd) and internetwork datagram level (pup level 1) 156 * input routines have queues of messages stored on ifqueue structures 157 * (defined above). Entries are added to and deleted from these structures 158 * by these macros, which should be called with ipl raised to splimp(). 159 */ 160 #define IF_QFULL(ifq) ((ifq)->ifq_len >= (ifq)->ifq_maxlen) 161 #define IF_DROP(ifq) ((ifq)->ifq_drops++) 162 #define IF_ENQUEUE(ifq, m) { \ 163 (m)->m_act = 0; \ 164 if ((ifq)->ifq_tail == 0) \ 165 (ifq)->ifq_head = m; \ 166 else \ 167 (ifq)->ifq_tail->m_act = m; \ 168 (ifq)->ifq_tail = m; \ 169 (ifq)->ifq_len++; \ 170 } 171 #define IF_PREPEND(ifq, m) { \ 172 (m)->m_act = (ifq)->ifq_head; \ 173 if ((ifq)->ifq_tail == 0) \ 174 (ifq)->ifq_tail = (m); \ 175 (ifq)->ifq_head = (m); \ 176 (ifq)->ifq_len++; \ 177 } 178 179 /* 180 * Packets destined for level-1 protocol input routines 181 * have a pointer to the receiving interface prepended to the data. 182 * IF_DEQUEUEIF extracts and returns this pointer when dequeuing the packet. 183 * IF_ADJ should be used otherwise to adjust for its presence. 184 */ 185 #define IF_ADJ(m) { \ 186 (m)->m_off += sizeof (struct ifnet *); \ 187 (m)->m_len -= sizeof (struct ifnet *); \ 188 if ((m)->m_len == 0) { \ 189 struct mbuf *n; \ 190 MFREE((m), n); \ 191 (m) = n; \ 192 } \ 193 } 194 #define IF_DEQUEUEIF(ifq, m, ifp) { \ 195 (m) = (ifq)->ifq_head; \ 196 if (m) { \ 197 if (((ifq)->ifq_head = (m)->m_act) == 0) \ 198 (ifq)->ifq_tail = 0; \ 199 (m)->m_act = 0; \ 200 (ifq)->ifq_len--; \ 201 (ifp) = *(mtod((m), struct ifnet **)); \ 202 IF_ADJ(m); \ 203 } \ 204 } 205 #define IF_DEQUEUE(ifq, m) { \ 206 (m) = (ifq)->ifq_head; \ 207 if (m) { \ 208 if (((ifq)->ifq_head = (m)->m_act) == 0) \ 209 (ifq)->ifq_tail = 0; \ 210 (m)->m_act = 0; \ 211 (ifq)->ifq_len--; \ 212 } \ 213 } 214 215 #define IFQ_MAXLEN 50 216 #define IFNET_SLOWHZ 1 /* granularity is 1 second */ 217 218 /* 219 * The ifaddr structure contains information about one address 220 * of an interface. They are maintained by the different address families, 221 * are allocated and attached when an address is set, and are linked 222 * together so all addresses for an interface can be located. 223 */ 224 struct ifaddr { 225 struct sockaddr ifa_addr; /* address of interface */ 226 union { 227 struct sockaddr ifu_broadaddr; 228 struct sockaddr ifu_dstaddr; 229 } ifa_ifu; 230 #define ifa_broadaddr ifa_ifu.ifu_broadaddr /* broadcast address */ 231 #define ifa_dstaddr ifa_ifu.ifu_dstaddr /* other end of p-to-p link */ 232 struct ifnet *ifa_ifp; /* back-pointer to interface */ 233 struct ifaddr *ifa_next; /* next address for interface */ 234 }; 235 236 /* 237 * The if_nameindex structure holds the interface index value about 238 * a single interface. An array of this structure is used to return 239 * all interfaces and indexes. 240 */ 241 struct if_nameindex { 242 uint32_t if_index; /* positive interface index */ 243 char *if_name; /* if name, e.g. "en0" */ 244 }; 245 246 /* 247 * For SIOCLIF*ND ioctls. 248 * 249 * The lnr_state_* fields use the ND_* neighbor reachability states. 250 * The 3 different fields are for use with SIOCLIFSETND to cover the cases 251 * when 252 * A new entry is created 253 * The entry already exists and the link-layer address is the same 254 * The entry already exists and the link-layer address differs 255 * 256 * Use ND_UNCHANGED and ND_ISROUTER_UNCHANGED to not change any state. 257 */ 258 #define ND_MAX_HDW_LEN 64 259 typedef struct lif_nd_req { 260 struct sockaddr_storage lnr_addr; 261 uint8_t lnr_state_create; /* When creating */ 262 uint8_t lnr_state_same_lla; /* Update same addr */ 263 uint8_t lnr_state_diff_lla; /* Update w/ diff. */ 264 int lnr_hdw_len; 265 int lnr_flags; /* See below */ 266 /* padding because ia32 "long long"s are only 4-byte aligned. */ 267 int lnr_pad0; 268 char lnr_hdw_addr[ND_MAX_HDW_LEN]; 269 } lif_nd_req_t; 270 271 /* 272 * Neighbor reachability states 273 * Used with SIOCLIF*ND ioctls. 274 */ 275 #define ND_UNCHANGED 0 /* For ioctls that don't modify state */ 276 #define ND_INCOMPLETE 1 /* addr resolution in progress */ 277 #define ND_REACHABLE 2 /* have recently been reachable */ 278 #define ND_STALE 3 /* may be unreachable, don't do anything */ 279 #define ND_DELAY 4 /* wait for upper layer hint */ 280 #define ND_PROBE 5 /* send probes */ 281 #define ND_UNREACHABLE 6 /* delete this route */ 282 283 #define ND_STATE_VALID_MIN 0 284 #define ND_STATE_VALID_MAX 6 285 286 /* 287 * lnr_flags value of lif_nd_req. 288 * Used with SIOCLIF*ND ioctls. 289 */ 290 #define NDF_ISROUTER_ON 0x1 291 #define NDF_ISROUTER_OFF 0x2 292 #define NDF_ANYCAST_ON 0x4 293 #define NDF_ANYCAST_OFF 0x8 294 #define NDF_PROXY_ON 0x10 295 #define NDF_PROXY_OFF 0x20 296 297 /* For SIOC[GS]LIFLNKINFO */ 298 typedef struct lif_ifinfo_req { 299 uint8_t lir_maxhops; 300 uint32_t lir_reachtime; /* Reachable time in msec */ 301 uint32_t lir_reachretrans; /* Retransmission timer msec */ 302 uint32_t lir_maxmtu; 303 } lif_ifinfo_req_t; 304 305 /* Interface name size limit */ 306 #define LIFNAMSIZ 32 307 308 /* 309 * Interface request structure used for socket 310 * ioctl's. All interface ioctl's must have parameter 311 * definitions which begin with ifr_name. The 312 * remainder may be interface specific. 313 * Note: This data structure uses 64bit type uint64_t which is not 314 * a valid type for strict ANSI/ISO C compilation for ILP32. 315 * Applications with ioctls using this structure that insist on 316 * building with strict ANSI/ISO C (-Xc) will need to be LP64. 317 */ 318 #if defined(_LP64) || (__STDC__ - 0 == 0 && !defined(_NO_LONGLONG)) 319 struct lifreq { 320 char lifr_name[LIFNAMSIZ]; /* if name, e.g. "en0" */ 321 union { 322 int lifru_addrlen; /* for subnet/token etc */ 323 uint_t lifru_ppa; /* SIOCSLIFNAME */ 324 } lifr_lifru1; 325 #define lifr_addrlen lifr_lifru1.lifru_addrlen 326 #define lifr_ppa lifr_lifru1.lifru_ppa /* Driver's ppa */ 327 uint_t lifr_movetoindex; /* FAILOVER/FAILBACK ifindex */ 328 union { 329 struct sockaddr_storage lifru_addr; 330 struct sockaddr_storage lifru_dstaddr; 331 struct sockaddr_storage lifru_broadaddr; 332 struct sockaddr_storage lifru_token; /* With lifr_addrlen */ 333 struct sockaddr_storage lifru_subnet; /* With lifr_addrlen */ 334 int lifru_index; /* interface index */ 335 uint64_t lifru_flags; /* Flags for SIOC?LIFFLAGS */ 336 int lifru_metric; 337 uint_t lifru_mtu; 338 char lifru_data[1]; /* interface dependent data */ 339 char lifru_enaddr[6]; 340 int lif_muxid[2]; /* mux id's for arp and ip */ 341 struct lif_nd_req lifru_nd_req; 342 struct lif_ifinfo_req lifru_ifinfo_req; 343 char lifru_groupname[LIFNAMSIZ]; /* SIOC[GS]LIFGROUPNAME */ 344 uint_t lifru_delay; /* SIOC[GS]LIFNOTIFYDELAY */ 345 } lifr_lifru; 346 347 #define lifr_addr lifr_lifru.lifru_addr /* address */ 348 #define lifr_dstaddr lifr_lifru.lifru_dstaddr /* other end of p-to-p link */ 349 #define lifr_broadaddr lifr_lifru.lifru_broadaddr /* broadcast address */ 350 #define lifr_token lifr_lifru.lifru_token /* address token */ 351 #define lifr_subnet lifr_lifru.lifru_subnet /* subnet prefix */ 352 #define lifr_index lifr_lifru.lifru_index /* interface index */ 353 #define lifr_flags lifr_lifru.lifru_flags /* flags */ 354 #define lifr_metric lifr_lifru.lifru_metric /* metric */ 355 #define lifr_mtu lifr_lifru.lifru_mtu /* mtu */ 356 #define lifr_data lifr_lifru.lifru_data /* for use by interface */ 357 #define lifr_enaddr lifr_lifru.lifru_enaddr /* ethernet address */ 358 #define lifr_index lifr_lifru.lifru_index /* interface index */ 359 #define lifr_ip_muxid lifr_lifru.lif_muxid[0] 360 #define lifr_arp_muxid lifr_lifru.lif_muxid[1] 361 #define lifr_nd lifr_lifru.lifru_nd_req /* SIOCLIF*ND */ 362 #define lifr_ifinfo lifr_lifru.lifru_ifinfo_req /* SIOC[GS]LIFLNKINFO */ 363 #define lifr_groupname lifr_lifru.lifru_groupname 364 #define lifr_delay lifr_lifru.lifru_delay 365 }; 366 #endif /* defined(_LP64) || (__STDC__ - 0 == 0 && !defined(_NO_LONGLONG)) */ 367 368 /* 369 * Argument structure for SIOCT* address testing ioctls. 370 */ 371 struct sioc_addrreq { 372 struct sockaddr_storage sa_addr; /* Address to test */ 373 int sa_res; /* Result - 0/1 */ 374 int sa_pad; 375 }; 376 377 /* 378 * Argument structure used by mrouted to get src-grp pkt counts using 379 * SIOCGETLSGCNT. See <netinet/ip_mroute.h>. 380 */ 381 struct sioc_lsg_req { 382 struct sockaddr_storage slr_src; 383 struct sockaddr_storage slr_grp; 384 uint_t slr_pktcnt; 385 uint_t slr_bytecnt; 386 uint_t slr_wrong_if; 387 uint_t slr_pad; 388 }; 389 390 /* 391 * OBSOLETE: Replaced by struct lifreq. Supported for compatibility. 392 * 393 * Interface request structure used for socket 394 * ioctl's. All interface ioctl's must have parameter 395 * definitions which begin with ifr_name. The 396 * remainder may be interface specific. 397 */ 398 struct ifreq { 399 #define IFNAMSIZ 16 400 char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */ 401 union { 402 struct sockaddr ifru_addr; 403 struct sockaddr ifru_dstaddr; 404 char ifru_oname[IFNAMSIZ]; /* other if name */ 405 struct sockaddr ifru_broadaddr; 406 int ifru_index; /* interface index */ 407 short ifru_flags; 408 int ifru_metric; 409 char ifru_data[1]; /* interface dependent data */ 410 char ifru_enaddr[6]; 411 int if_muxid[2]; /* mux id's for arp and ip */ 412 413 /* Struct for flags/ppa */ 414 struct ifr_ppaflags { 415 short ifrup_flags; /* Space of ifru_flags. */ 416 short ifrup_filler; 417 uint_t ifrup_ppa; 418 } ifru_ppaflags; 419 420 /* Struct for FDDI ioctl's */ 421 struct ifr_dnld_reqs { 422 uint32_t v_addr; 423 uint32_t m_addr; 424 uint32_t ex_addr; 425 uint32_t size; 426 } ifru_dnld_req; 427 428 /* Struct for FDDI stats */ 429 struct ifr_fddi_stats { 430 uint32_t stat_size; 431 uint32_t fddi_stats; 432 } ifru_fddi_stat; 433 434 struct ifr_netmapents { 435 uint32_t map_ent_size, /* size of netmap structure */ 436 entry_number; /* index into netmap list */ 437 uint32_t fddi_map_ent; /* pointer to user structure */ 438 } ifru_netmapent; 439 440 /* Field for generic ioctl for fddi */ 441 442 struct ifr_fddi_gen_struct { 443 uint32_t ifru_fddi_gioctl; /* field for gen ioctl */ 444 uint32_t ifru_fddi_gaddr; /* Generic ptr to a field */ 445 } ifru_fddi_gstruct; 446 447 } ifr_ifru; 448 449 #define ifr_addr ifr_ifru.ifru_addr /* address */ 450 #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ 451 #define ifr_oname ifr_ifru.ifru_oname /* other if name */ 452 #define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ 453 #define ifr_flags ifr_ifru.ifru_flags /* flags */ 454 #define ifr_metric ifr_ifru.ifru_metric /* metric */ 455 #define ifr_data ifr_ifru.ifru_data /* for use by interface */ 456 #define ifr_enaddr ifr_ifru.ifru_enaddr /* ethernet address */ 457 #define ifr_index ifr_ifru.ifru_index /* interface index */ 458 /* For setting ppa */ 459 #define ifr_ppa ifr_ifru.ifru_ppaflags.ifrup_ppa 460 461 /* FDDI specific */ 462 #define ifr_dnld_req ifr_ifru.ifru_dnld_req 463 #define ifr_fddi_stat ifr_ifru.ifru_fddi_stat 464 #define ifr_fddi_netmap ifr_ifru.ifru_netmapent /* FDDI network map entries */ 465 #define ifr_fddi_gstruct ifr_ifru.ifru_fddi_gstruct 466 467 #define ifr_ip_muxid ifr_ifru.if_muxid[0] 468 #define ifr_arp_muxid ifr_ifru.if_muxid[1] 469 }; 470 471 /* Used by SIOCGLIFNUM. Uses same flags as in struct lifconf */ 472 struct lifnum { 473 sa_family_t lifn_family; 474 int lifn_flags; /* request specific interfaces */ 475 int lifn_count; /* Result */ 476 }; 477 478 /* 479 * Structure used in SIOCGLIFCONF request. 480 * Used to retrieve interface configuration 481 * for machine (useful for programs which 482 * must know all networks accessible) for a given address family. 483 * Using AF_UNSPEC will retrieve all address families. 484 */ 485 struct lifconf { 486 sa_family_t lifc_family; 487 int lifc_flags; /* request specific interfaces */ 488 int lifc_len; /* size of associated buffer */ 489 union { 490 caddr_t lifcu_buf; 491 struct lifreq *lifcu_req; 492 } lifc_lifcu; 493 #define lifc_buf lifc_lifcu.lifcu_buf /* buffer address */ 494 #define lifc_req lifc_lifcu.lifcu_req /* array of structures returned */ 495 }; 496 497 /* Flags */ 498 #define LIFC_NOXMIT 0x01 /* Include IFF_NOXMIT interfaces */ 499 #define LIFC_EXTERNAL_SOURCE 0x02 /* Exclude the interfaces which can't */ 500 /* be used to communicate outside the */ 501 /* node (exclude interfaces which are */ 502 /* IFF_NOXMIT, IFF_NOLOCAL, */ 503 /* IFF_LOOPBACK, IFF_DEPRECATED, or */ 504 /* not IFF_UP). Has priority over */ 505 /* LIFC_NOXMIT. */ 506 507 #if defined(_SYSCALL32) 508 509 struct lifconf32 { 510 sa_family_t lifc_family; 511 int lifc_flags; /* request specific interfaces */ 512 int32_t lifc_len; /* size of associated buffer */ 513 union { 514 caddr32_t lifcu_buf; 515 caddr32_t lifcu_req; 516 } lifc_lifcu; 517 }; 518 519 #endif /* _SYSCALL32 */ 520 521 /* 522 * OBSOLETE: Structure used in SIOCGIFCONF request. 523 * Used to retrieve interface configuration 524 * for machine (useful for programs which 525 * must know all networks accessible). 526 */ 527 struct ifconf { 528 int ifc_len; /* size of associated buffer */ 529 union { 530 caddr_t ifcu_buf; 531 struct ifreq *ifcu_req; 532 } ifc_ifcu; 533 #define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */ 534 #define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */ 535 }; 536 537 #if defined(_SYSCALL32) 538 539 struct ifconf32 { 540 int32_t ifc_len; /* size of associated buffer */ 541 union { 542 caddr32_t ifcu_buf; 543 caddr32_t ifcu_req; 544 } ifc_ifcu; 545 }; 546 547 #endif /* _SYSCALL32 */ 548 549 typedef struct if_data { 550 /* generic interface information */ 551 uchar_t ifi_type; /* ethernet, tokenring, etc */ 552 uchar_t ifi_addrlen; /* media address length */ 553 uchar_t ifi_hdrlen; /* media header length */ 554 uint_t ifi_mtu; /* maximum transmission unit */ 555 uint_t ifi_metric; /* routing metric (external only) */ 556 uint_t ifi_baudrate; /* linespeed */ 557 /* volatile statistics */ 558 uint_t ifi_ipackets; /* packets received on interface */ 559 uint_t ifi_ierrors; /* input errors on interface */ 560 uint_t ifi_opackets; /* packets sent on interface */ 561 uint_t ifi_oerrors; /* output errors on interface */ 562 uint_t ifi_collisions; /* collisions on csma interfaces */ 563 uint_t ifi_ibytes; /* total number of octets received */ 564 uint_t ifi_obytes; /* total number of octets sent */ 565 uint_t ifi_imcasts; /* packets received via multicast */ 566 uint_t ifi_omcasts; /* packets sent via multicast */ 567 uint_t ifi_iqdrops; /* dropped on input, this interface */ 568 uint_t ifi_noproto; /* destined for unsupported protocol */ 569 struct timeval ifi_lastchange; /* last updated */ 570 } if_data_t; 571 572 /* 573 * Message format for use in obtaining information about interfaces 574 * from the routing socket 575 */ 576 typedef struct if_msghdr { 577 ushort_t ifm_msglen; /* to skip over non-understood messages */ 578 uchar_t ifm_version; /* future binary compatibility */ 579 uchar_t ifm_type; /* message type */ 580 int ifm_addrs; /* like rtm_addrs */ 581 int ifm_flags; /* value of if_flags */ 582 ushort_t ifm_index; /* index for associated ifp */ 583 struct if_data ifm_data; /* statistics and other data about if */ 584 } if_msghdr_t; 585 586 /* 587 * Message format for use in obtaining information about interface addresses 588 * from the routing socket 589 */ 590 typedef struct ifa_msghdr { 591 ushort_t ifam_msglen; /* to skip over non-understood messages */ 592 uchar_t ifam_version; /* future binary compatibility */ 593 uchar_t ifam_type; /* message type */ 594 int ifam_addrs; /* like rtm_addrs */ 595 int ifam_flags; /* route flags */ 596 ushort_t ifam_index; /* index for associated ifp */ 597 int ifam_metric; /* value of ipif_metric */ 598 } ifa_msghdr_t; 599 600 /* currently tunnels only support IPv4 or IPv6 */ 601 enum ifta_proto { 602 IFTAP_INVALID, 603 IFTAP_IPV4, 604 IFTAP_IPV6 605 }; 606 607 #define IFTUN_SECINFOLEN 8 /* In units of 32-bit words. */ 608 #define IFTUN_VERSION 1 /* Current version number. */ 609 610 /* 611 * Used by tunneling module to get/set a tunnel parameters using 612 * SIOCTUN[SG]PARAM. 613 * 614 * There is a version number and an array of uint32_t at the end of this 615 * ioctl because in a perfect world, the ipsec_req_t would be inside 616 * tun_addreq. Since this file is independent of IP (and IPsec), I have to 617 * just leave room there, and have the appropriate handlers deal with the 618 * security information. 619 * 620 * In the future, the sockaddr types and the ta_vers could be used together 621 * to determine the nature of the security information that is at the end 622 * of this ioctl. 623 */ 624 struct iftun_req { 625 char ifta_lifr_name[LIFNAMSIZ]; /* if name */ 626 struct sockaddr_storage ifta_saddr; /* source address */ 627 struct sockaddr_storage ifta_daddr; /* destination address */ 628 uint_t ifta_flags; /* See below */ 629 /* IP version information is read only */ 630 enum ifta_proto ifta_upper; /* IP version above tunnel */ 631 enum ifta_proto ifta_lower; /* IP version below tunnel */ 632 uint_t ifta_vers; /* Version number */ 633 uint32_t ifta_secinfo[IFTUN_SECINFOLEN]; /* Security prefs. */ 634 }; 635 636 /* ifta_flags are set to indicate which members are valid */ 637 #define IFTUN_SRC 0x01 638 #define IFTUN_DST 0x02 639 #define IFTUN_SECURITY 0x04 /* Pay attention to secinfo */ 640 641 /* Interface index identification API definitions */ 642 extern uint32_t if_nametoindex(const char *ifname); 643 extern char *if_indextoname(uint32_t ifindex, char *ifname); 644 extern struct if_nameindex *if_nameindex(void); 645 extern void if_freenameindex(struct if_nameindex *ptr); 646 647 #define IF_NAMESIZE LIFNAMSIZ 648 649 #ifdef __cplusplus 650 } 651 #endif 652 653 #endif /* _NET_IF_H */ |
[Prev in Thread] | Current Thread | [Next in Thread] |