1 /* if.c 4.2 81/11/20 */ 2 3 #include "../h/param.h" 4 #include "../h/systm.h" 5 #include "../net/inet.h" 6 #include "../net/inet_systm.h" 7 #include "../net/if.h" 8 9 /*ARGSUSED*/ 10 struct ifnet * 11 if_ifwithaddr(in) 12 struct in_addr in; 13 { 14 register struct ifnet *ifp; 15 16 COUNT(IF_IFWITHADDR); 17 #if 0 18 for (ifp = ifnet; ifp; ifp = ifp->if_next) 19 if (ifp->if_addr.s_addr == in.s_addr) 20 break; 21 #else 22 ifp = ifnet; 23 #endif 24 return (ifp); 25 } 26 27 /*ARGSUSED*/ 28 struct ifnet * 29 if_ifonnetof(in) 30 struct in_addr in; 31 { 32 register struct ifnet *ifp; 33 #if 0 34 int net; 35 36 COUNT(IF_IFONNETOF); 37 net = 0; /* XXX */ 38 for (ifp = ifnet; ifp; ifp = ifp->if_next) 39 if (ifp->if_net == net) 40 break; 41 #else 42 ifp = ifnet; 43 #endif 44 return (ifp); 45 } 46 47 struct ifnet ifen; 48 struct ifnet *ifnet = &ifen; 49