Deleted Added
full compact
if_ether.c (63080) if_ether.c (69152)
1/*
2 * Copyright (c) 1982, 1986, 1988, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)if_ether.c 8.1 (Berkeley) 6/10/93
1/*
2 * Copyright (c) 1982, 1986, 1988, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)if_ether.c 8.1 (Berkeley) 6/10/93
34 * $FreeBSD: head/sys/netinet/if_ether.c 63080 2000-07-13 19:31:01Z dwmalone $
34 * $FreeBSD: head/sys/netinet/if_ether.c 69152 2000-11-25 07:35:38Z jlemon $
35 */
36
37/*
38 * Ethernet address resolution protocol.
39 * TODO:
40 * add "inuse/lock" bit (or ref. count) along with valid bit
41 */
42

--- 48 unchanged lines hidden (view full) ---

91 struct rtentry *la_rt;
92 struct mbuf *la_hold; /* last packet until resolved/timeout */
93 long la_asked; /* last time we QUERIED for this addr */
94#define la_timer la_rt->rt_rmx.rmx_expire /* deletion time in seconds */
95};
96
97static LIST_HEAD(, llinfo_arp) llinfo_arp;
98
35 */
36
37/*
38 * Ethernet address resolution protocol.
39 * TODO:
40 * add "inuse/lock" bit (or ref. count) along with valid bit
41 */
42

--- 48 unchanged lines hidden (view full) ---

91 struct rtentry *la_rt;
92 struct mbuf *la_hold; /* last packet until resolved/timeout */
93 long la_asked; /* last time we QUERIED for this addr */
94#define la_timer la_rt->rt_rmx.rmx_expire /* deletion time in seconds */
95};
96
97static LIST_HEAD(, llinfo_arp) llinfo_arp;
98
99struct ifqueue arpintrq = {0, 0, 0, 50};
99struct ifqueue arpintrq;
100static int arp_inuse, arp_allocated;
101
102static int arp_maxtries = 5;
103static int useloopback = 1; /* use loopback interface for local traffic */
104static int arp_proxyall = 0;
105
106SYSCTL_INT(_net_link_ether_inet, OID_AUTO, maxtries, CTLFLAG_RW,
107 &arp_maxtries, 0, "");
108SYSCTL_INT(_net_link_ether_inet, OID_AUTO, useloopback, CTLFLAG_RW,
109 &useloopback, 0, "");
110SYSCTL_INT(_net_link_ether_inet, OID_AUTO, proxyall, CTLFLAG_RW,
111 &arp_proxyall, 0, "");
112
100static int arp_inuse, arp_allocated;
101
102static int arp_maxtries = 5;
103static int useloopback = 1; /* use loopback interface for local traffic */
104static int arp_proxyall = 0;
105
106SYSCTL_INT(_net_link_ether_inet, OID_AUTO, maxtries, CTLFLAG_RW,
107 &arp_maxtries, 0, "");
108SYSCTL_INT(_net_link_ether_inet, OID_AUTO, useloopback, CTLFLAG_RW,
109 &useloopback, 0, "");
110SYSCTL_INT(_net_link_ether_inet, OID_AUTO, proxyall, CTLFLAG_RW,
111 &arp_proxyall, 0, "");
112
113static void arp_init __P((void));
113static void arp_rtrequest __P((int, struct rtentry *, struct sockaddr *));
114static void arprequest __P((struct arpcom *,
115 struct in_addr *, struct in_addr *, u_char *));
116static void arpintr __P((void));
117static void arptfree __P((struct llinfo_arp *));
118static void arptimer __P((void *));
119static struct llinfo_arp
120 *arplookup __P((u_long, int, int));

--- 689 unchanged lines hidden (view full) ---

810 struct ifaddr *ifa;
811{
812 if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) != INADDR_ANY)
813 arprequest(ac, &IA_SIN(ifa)->sin_addr,
814 &IA_SIN(ifa)->sin_addr, ac->ac_enaddr);
815 ifa->ifa_rtrequest = arp_rtrequest;
816 ifa->ifa_flags |= RTF_CLONING;
817}
114static void arp_rtrequest __P((int, struct rtentry *, struct sockaddr *));
115static void arprequest __P((struct arpcom *,
116 struct in_addr *, struct in_addr *, u_char *));
117static void arpintr __P((void));
118static void arptfree __P((struct llinfo_arp *));
119static void arptimer __P((void *));
120static struct llinfo_arp
121 *arplookup __P((u_long, int, int));

--- 689 unchanged lines hidden (view full) ---

811 struct ifaddr *ifa;
812{
813 if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) != INADDR_ANY)
814 arprequest(ac, &IA_SIN(ifa)->sin_addr,
815 &IA_SIN(ifa)->sin_addr, ac->ac_enaddr);
816 ifa->ifa_rtrequest = arp_rtrequest;
817 ifa->ifa_flags |= RTF_CLONING;
818}
819
820static void
821arp_init(void)
822{
823
824 arpintrq.ifq_maxlen = 50;
825 mtx_init(&arpintrq.ifq_mtx, "arp_inq", MTX_DEF);
826}
827
828SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0);