Commit | Line | Data |
---|---|---|
8a13b737 | 1 | /* if.c 4.3 81/11/26 */ |
1bfd8df7 BJ |
2 | |
3 | #include "../h/param.h" | |
4 | #include "../h/systm.h" | |
8a13b737 BJ |
5 | #include "../net/in.h" |
6 | #include "../net/in_systm.h" | |
1bfd8df7 BJ |
7 | #include "../net/if.h" |
8 | ||
4ad99bae BJ |
9 | /*ARGSUSED*/ |
10 | struct ifnet * | |
1bfd8df7 BJ |
11 | if_ifwithaddr(in) |
12 | struct in_addr in; | |
13 | { | |
14 | register struct ifnet *ifp; | |
15 | ||
4ad99bae | 16 | COUNT(IF_IFWITHADDR); |
1bfd8df7 BJ |
17 | for (ifp = ifnet; ifp; ifp = ifp->if_next) |
18 | if (ifp->if_addr.s_addr == in.s_addr) | |
19 | break; | |
1bfd8df7 BJ |
20 | return (ifp); |
21 | } | |
22 | ||
4ad99bae BJ |
23 | /*ARGSUSED*/ |
24 | struct ifnet * | |
1bfd8df7 BJ |
25 | if_ifonnetof(in) |
26 | struct in_addr in; | |
27 | { | |
28 | register struct ifnet *ifp; | |
1bfd8df7 BJ |
29 | int net; |
30 | ||
4ad99bae | 31 | COUNT(IF_IFONNETOF); |
8a13b737 | 32 | net = in.s_net; /* XXX */ |
1bfd8df7 BJ |
33 | for (ifp = ifnet; ifp; ifp = ifp->if_next) |
34 | if (ifp->if_net == net) | |
35 | break; | |
1bfd8df7 BJ |
36 | return (ifp); |
37 | } | |
38 | ||
8a13b737 BJ |
39 | struct ifnet * |
40 | if_gatewayfor(addr) | |
41 | struct in_addr addr; | |
42 | { | |
43 | ||
44 | COUNT(IF_GATEWAYFOR); | |
45 | return (0); | |
46 | } |