1 /* if.c 4.3 81/11/26 */ 2 3 #include "../h/param.h" 4 #include "../h/systm.h" 5 #include "../net/in.h" 6 #include "../net/in_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 for (ifp = ifnet; ifp; ifp = ifp->if_next) 18 if (ifp->if_addr.s_addr == in.s_addr) 19 break; 20 return (ifp); 21 } 22 23 /*ARGSUSED*/ 24 struct ifnet * 25 if_ifonnetof(in) 26 struct in_addr in; 27 { 28 register struct ifnet *ifp; 29 int net; 30 31 COUNT(IF_IFONNETOF); 32 net = in.s_net; /* XXX */ 33 for (ifp = ifnet; ifp; ifp = ifp->if_next) 34 if (ifp->if_net == net) 35 break; 36 return (ifp); 37 } 38 39 struct ifnet * 40 if_gatewayfor(addr) 41 struct in_addr addr; 42 { 43 44 COUNT(IF_GATEWAYFOR); 45 return (0); 46 } 47