lint and interface cleanups
[unix-history] / usr / src / sys / net / if.c
index c09068a..1cd6adb 100644 (file)
@@ -1,4 +1,4 @@
-/*     if.c    4.3     81/11/26        */
+/*     if.c    4.4     81/11/29        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -36,6 +36,7 @@ COUNT(IF_IFONNETOF);
        return (ifp);
 }
 
        return (ifp);
 }
 
+/*ARGSUSED*/
 struct ifnet *
 if_gatewayfor(addr)
        struct in_addr addr;
 struct ifnet *
 if_gatewayfor(addr)
        struct in_addr addr;
@@ -44,3 +45,19 @@ if_gatewayfor(addr)
 COUNT(IF_GATEWAYFOR);
        return (0);
 }
 COUNT(IF_GATEWAYFOR);
        return (0);
 }
+
+struct in_addr
+if_makeaddr(net, host)
+       int net, host;
+{
+       u_long addr;
+
+       if (net < 128)
+               addr = (host << 8) | net;
+       else if (net < 65536)
+               addr = (host << 16) | net;
+       else
+               addr = (host << 24) | net;
+       addr = htonl(addr);
+       return (*(struct in_addr *)&addr);
+}