home *** CD-ROM | disk | FTP | other *** search
- #ifndef NET_IF_H
- #define NET_IF_H \
- "$Id: if.h,v 4.4 1994/10/05 23:12:24 ppessi Exp $"
- /*
- * Network interface definitions
- *
- * Copyright © 1994 AmiTCP/IP Group,
- * Network Solutions Development, Inc.
- * All rights reserved.
- */
-
-
- /*
- * Interface request structure used for socket
- * ioctl's. All interface ioctl's must have parameter
- * definitions which begin with ifr_name. The
- * remainder may be interface specific.
- */
- struct ifreq {
- #define IFNAMSIZ 16
- char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- union {
- struct sockaddr ifru_addr;
- struct sockaddr ifru_dstaddr;
- struct sockaddr ifru_broadaddr;
- short ifru_flags;
- int ifru_metric;
- caddr_t ifru_data;
- } ifr_ifru;
- #define ifr_addr ifr_ifru.ifru_addr /* address */
- #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
- #define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
- #define ifr_flags ifr_ifru.ifru_flags /* flags */
- #define ifr_metric ifr_ifru.ifru_metric /* metric */
- #define ifr_data ifr_ifru.ifru_data /* for use by interface */
- };
-
- struct ifaliasreq {
- char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- struct sockaddr ifra_addr;
- struct sockaddr ifra_broadaddr;
- struct sockaddr ifra_mask;
- };
-
- /*
- * Structure used in SIOCGIFCONF request.
- * Used to retrieve interface configuration
- * for machine (useful for programs which
- * must know all networks accessible).
- */
- struct ifconf {
- int ifc_len; /* size of associated buffer */
- union {
- caddr_t ifcu_buf;
- struct ifreq *ifcu_req;
- } ifc_ifcu;
- #define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
- #define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
- };
-
- #define IFF_UP 0x1 /* interface is up */
- #define IFF_BROADCAST 0x2 /* broadcast address valid */
- #define IFF_DEBUG 0x4 /* turn on debugging */
- #define IFF_LOOPBACK 0x8 /* is a loopback net */
- #define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */
- #define IFF_NOTRAILERS 0x20 /* avoid use of trailers */
- #define IFF_RUNNING 0x40 /* resources allocated */
- #define IFF_NOARP 0x80 /* no address resolution protocol */
- #define IFF_SIMPLEX 0x800 /* can't hear own transmissions */
-
- /* next two not supported now, but reserved: */
- #define IFF_PROMISC 0x100 /* receive all packets */
- #define IFF_ALLMULTI 0x200 /* receive all multicast packets */
- #define IFF_OACTIVE 0x400 /* transmission in progress */
-
- /* flags set internally only: */
- #define IFF_CANTCHANGE \
- (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|IFF_SIMPLEX)
-
- #ifndef NET_IF_ARP_H
- #include <net/if_arp.h>
- #endif
-
- #endif /* IF_H */
-