before carry to arpavax
[unix-history] / usr / src / sys / net / if.c
CommitLineData
4ad99bae 1/* if.c 4.2 81/11/20 */
1bfd8df7
BJ
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
4ad99bae
BJ
9/*ARGSUSED*/
10struct ifnet *
1bfd8df7
BJ
11if_ifwithaddr(in)
12 struct in_addr in;
13{
14 register struct ifnet *ifp;
15
4ad99bae 16COUNT(IF_IFWITHADDR);
1bfd8df7
BJ
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
4ad99bae
BJ
27/*ARGSUSED*/
28struct ifnet *
1bfd8df7
BJ
29if_ifonnetof(in)
30 struct in_addr in;
31{
32 register struct ifnet *ifp;
33#if 0
34 int net;
35
4ad99bae 36COUNT(IF_IFONNETOF);
1bfd8df7
BJ
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
4ad99bae 47struct ifnet ifen;
1bfd8df7 48struct ifnet *ifnet = &ifen;