add IFF_LOCAL
[unix-history] / usr / src / sys / net / if.h
index 1aa0bfa..995d723 100644 (file)
@@ -1,4 +1,4 @@
-/*     if.h    4.15    82/06/23        */
+/*     if.h    6.4     84/04/06        */
 
 /*
  * Structures defining a network interface, providing a packet
 
 /*
  * Structures defining a network interface, providing a packet
@@ -57,7 +57,8 @@ struct ifnet {
 /* procedure handles */
        int     (*if_init)();           /* init routine */
        int     (*if_output)();         /* output routine */
 /* procedure handles */
        int     (*if_init)();           /* init routine */
        int     (*if_output)();         /* output routine */
-       int     (*if_ubareset)();       /* uba reset routine */
+       int     (*if_ioctl)();          /* ioctl routine */
+       int     (*if_reset)();          /* bus reset routine */
        int     (*if_watchdog)();       /* timer routine */
 /* generic interface statistics */
        int     if_ipackets;            /* packets received on interface */
        int     (*if_watchdog)();       /* timer routine */
 /* generic interface statistics */
        int     if_ipackets;            /* packets received on interface */
@@ -74,6 +75,10 @@ struct ifnet {
 #define        IFF_DEBUG       0x4             /* turn on debugging */
 #define        IFF_ROUTE       0x8             /* routing entry installed */
 #define        IFF_POINTOPOINT 0x10            /* interface is point-to-point link */
 #define        IFF_DEBUG       0x4             /* turn on debugging */
 #define        IFF_ROUTE       0x8             /* routing entry installed */
 #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_LOCAL       0x100           /* local network, host part encoded */
 
 /*
  * Output queues (ifp->if_snd) and internetwork datagram level (pup level 1)
 
 /*
  * Output queues (ifp->if_snd) and internetwork datagram level (pup level 1)
@@ -112,6 +117,57 @@ struct ifnet {
 #define        IFQ_MAXLEN      50
 #define        IFNET_SLOWHZ    1               /* granularity is 1 second */
 
 #define        IFQ_MAXLEN      50
 #define        IFNET_SLOWHZ    1               /* granularity is 1 second */
 
+/*
+ * 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;
+               short   ifru_flags;
+               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_flags       ifr_ifru.ifru_flags     /* flags */
+#define        ifr_data        ifr_ifru.ifru_data      /* for use by interface */
+};
+
+/*
+ * 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 */
+};
+
+/*
+ * ARP ioctl request
+ */
+struct arpreq {
+       struct sockaddr arp_pa;         /* protocol address */
+       struct sockaddr arp_ha;         /* hardware address */
+       int     arp_flags;              /* flags */
+};
+/*  arp_flags and at_flags field values */
+#define        ATF_INUSE       1       /* entry in use */
+#define ATF_COM                2       /* completed entry (enaddr valid) */
+#define        ATF_PERM        4       /* permanent entry */
+#define        ATF_PUBL        8       /* publish entry (respond for other host) */
+
 #ifdef KERNEL
 #ifdef INET
 struct ifqueue ipintrq;                /* ip packet input queue */
 #ifdef KERNEL
 #ifdef INET
 struct ifqueue ipintrq;                /* ip packet input queue */