BSD 4_4_Lite2 release
[unix-history] / usr / src / sys / net / if.h
index 66f80ff..ec86b68 100644 (file)
@@ -1,10 +1,36 @@
 /*
 /*
- * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1982, 1986, 1989, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  *
- * %sccs.include.redist.c%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
  *
  *
- *     @(#)if.h        7.19 (Berkeley) %G%
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)if.h        8.3 (Berkeley) 2/9/95
  */
 
 /*
  */
 
 /*
  * interfaces.  These routines live in the files if.c and route.c
  */
 #ifndef _TIME_ /*  XXX fast fix for SNMP, going away soon */
  * interfaces.  These routines live in the files if.c and route.c
  */
 #ifndef _TIME_ /*  XXX fast fix for SNMP, going away soon */
-#ifdef KERNEL
-#include "../sys/time.h"
-#else
 #include <sys/time.h>
 #endif
 #include <sys/time.h>
 #endif
-#endif
 
 #ifdef __STDC__
 /*
  * Forward structure declarations for function prototypes [sic].
  */
 
 #ifdef __STDC__
 /*
  * Forward structure declarations for function prototypes [sic].
  */
-struct rtentry;        
 struct mbuf;
 struct mbuf;
+struct proc;
+struct rtentry;        
+struct socket;
+struct ether_header;
 #endif
 /*
  * Structure describing information about an interface
 #endif
 /*
  * Structure describing information about an interface
@@ -99,7 +124,7 @@ struct ifnet {
        int     (*if_done)              /* output complete routine */
                __P((struct ifnet *));  /* (XXX not used; fake prototype) */
        int     (*if_ioctl)             /* ioctl routine */
        int     (*if_done)              /* output complete routine */
                __P((struct ifnet *));  /* (XXX not used; fake prototype) */
        int     (*if_ioctl)             /* ioctl routine */
-               __P((struct ifnet *, int, caddr_t));
+               __P((struct ifnet *, u_long, caddr_t));
        int     (*if_reset)     
                __P((int));             /* new autoconfig will permit removal */
        int     (*if_watchdog)          /* timer routine */
        int     (*if_reset)     
                __P((int));             /* new autoconfig will permit removal */
        int     (*if_watchdog)          /* timer routine */
@@ -151,7 +176,7 @@ struct ifnet {
 /* flags set internally only: */
 #define        IFF_CANTCHANGE \
        (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\
 /* flags set internally only: */
 #define        IFF_CANTCHANGE \
        (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\
-           IFF_SIMPLEX|IFF_MULTICAST)
+           IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI)
 
 /*
  * Output queues (ifp->if_snd) and internetwork datagram level (pup level 1)
 
 /*
  * Output queues (ifp->if_snd) and internetwork datagram level (pup level 1)
@@ -289,6 +314,8 @@ struct      ifconf {
 #define        ifc_req ifc_ifcu.ifcu_req       /* array of structures returned */
 };
 
 #define        ifc_req ifc_ifcu.ifcu_req       /* array of structures returned */
 };
 
+#include <net/if_arp.h>
+
 #ifdef KERNEL
 #define        IFAFREE(ifa) \
        if ((ifa)->ifa_refcnt <= 0) \
 #ifdef KERNEL
 #define        IFAFREE(ifa) \
        if ((ifa)->ifa_refcnt <= 0) \
@@ -296,13 +323,41 @@ struct    ifconf {
        else \
                (ifa)->ifa_refcnt--;
 
        else \
                (ifa)->ifa_refcnt--;
 
-#include "../net/if_arp.h"
 struct ifnet   *ifnet;
 struct ifnet   *ifnet;
-struct ifaddr  *ifa_ifwithaddr __P((struct sockaddr *)),
-               *ifa_ifwithnet __P((struct sockaddr *)),
-               *ifa_ifwithdstaddr __P((struct sockaddr *));
-void   ifafree __P((struct ifaddr *));
+
+void   ether_ifattach __P((struct ifnet *));
+void   ether_input __P((struct ifnet *, struct ether_header *, struct mbuf *));
+int    ether_output __P((struct ifnet *,
+          struct mbuf *, struct sockaddr *, struct rtentry *));
+char   *ether_sprintf __P((u_char *));
+
 void   if_attach __P((struct ifnet *));
 void   if_attach __P((struct ifnet *));
-#else KERNEL
-#include <net/if_arp.h>
-#endif KERNEL
+void   if_down __P((struct ifnet *));
+void   if_qflush __P((struct ifqueue *));
+void   if_slowtimo __P((void *));
+void   if_up __P((struct ifnet *));
+#ifdef vax
+void   ifubareset __P((int));
+#endif
+int    ifconf __P((int, caddr_t));
+void   ifinit __P((void));
+int    ifioctl __P((struct socket *, u_long, caddr_t, struct proc *));
+int    ifpromisc __P((struct ifnet *, int));
+struct ifnet *ifunit __P((char *));
+
+struct ifaddr *ifa_ifwithaddr __P((struct sockaddr *));
+struct ifaddr *ifa_ifwithaf __P((int));
+struct ifaddr *ifa_ifwithdstaddr __P((struct sockaddr *));
+struct ifaddr *ifa_ifwithnet __P((struct sockaddr *));
+struct ifaddr *ifa_ifwithroute __P((int, struct sockaddr *,
+                                       struct sockaddr *));
+struct ifaddr *ifaof_ifpforaddr __P((struct sockaddr *, struct ifnet *));
+void   ifafree __P((struct ifaddr *));
+void   link_rtrequest __P((int, struct rtentry *, struct sockaddr *));
+
+int    loioctl __P((struct ifnet *, u_long, caddr_t));
+void   loopattach __P((int));
+int    looutput __P((struct ifnet *,
+          struct mbuf *, struct sockaddr *, struct rtentry *));
+void   lortrequest __P((int, struct rtentry *, struct sockaddr *));
+#endif