if_ether.c (191816) | if_ether.c (193219) |
---|---|
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 --- 22 unchanged lines hidden (view full) --- 31 32/* 33 * Ethernet address resolution protocol. 34 * TODO: 35 * add "inuse/lock" bit (or ref. count) along with valid bit 36 */ 37 38#include <sys/cdefs.h> | 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 --- 22 unchanged lines hidden (view full) --- 31 32/* 33 * Ethernet address resolution protocol. 34 * TODO: 35 * add "inuse/lock" bit (or ref. count) along with valid bit 36 */ 37 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/sys/netinet/if_ether.c 191816 2009-05-05 10:56:12Z zec $"); | 39__FBSDID("$FreeBSD: head/sys/netinet/if_ether.c 193219 2009-06-01 10:41:38Z rwatson $"); |
40 41#include "opt_inet.h" 42#include "opt_route.h" 43#include "opt_mac.h" 44#include "opt_carp.h" 45 46#include <sys/param.h> 47#include <sys/kernel.h> --- 43 unchanged lines hidden (view full) --- 91static int arp_maxtries; 92int useloopback; /* use loopback interface for local traffic */ 93static int arp_proxyall; 94#endif 95 96SYSCTL_V_INT(V_NET, vnet_inet, _net_link_ether_inet, OID_AUTO, max_age, 97 CTLFLAG_RW, arpt_keep, 0, "ARP entry lifetime in seconds"); 98 | 40 41#include "opt_inet.h" 42#include "opt_route.h" 43#include "opt_mac.h" 44#include "opt_carp.h" 45 46#include <sys/param.h> 47#include <sys/kernel.h> --- 43 unchanged lines hidden (view full) --- 91static int arp_maxtries; 92int useloopback; /* use loopback interface for local traffic */ 93static int arp_proxyall; 94#endif 95 96SYSCTL_V_INT(V_NET, vnet_inet, _net_link_ether_inet, OID_AUTO, max_age, 97 CTLFLAG_RW, arpt_keep, 0, "ARP entry lifetime in seconds"); 98 |
99static struct ifqueue arpintrq; 100 | |
101SYSCTL_V_INT(V_NET, vnet_inet, _net_link_ether_inet, OID_AUTO, maxtries, 102 CTLFLAG_RW, arp_maxtries, 0, 103 "ARP resolution attempts before returning error"); 104SYSCTL_V_INT(V_NET, vnet_inet, _net_link_ether_inet, OID_AUTO, useloopback, 105 CTLFLAG_RW, useloopback, 0, 106 "Use the loopback interface for local traffic"); 107SYSCTL_V_INT(V_NET, vnet_inet, _net_link_ether_inet, OID_AUTO, proxyall, 108 CTLFLAG_RW, arp_proxyall, 0, --- 4 unchanged lines hidden (view full) --- 113void arprequest(struct ifnet *, 114 struct in_addr *, struct in_addr *, u_char *); 115static void arpintr(struct mbuf *); 116static void arptimer(void *); 117#ifdef INET 118static void in_arpinput(struct mbuf *); 119#endif 120 | 99SYSCTL_V_INT(V_NET, vnet_inet, _net_link_ether_inet, OID_AUTO, maxtries, 100 CTLFLAG_RW, arp_maxtries, 0, 101 "ARP resolution attempts before returning error"); 102SYSCTL_V_INT(V_NET, vnet_inet, _net_link_ether_inet, OID_AUTO, useloopback, 103 CTLFLAG_RW, useloopback, 0, 104 "Use the loopback interface for local traffic"); 105SYSCTL_V_INT(V_NET, vnet_inet, _net_link_ether_inet, OID_AUTO, proxyall, 106 CTLFLAG_RW, arp_proxyall, 0, --- 4 unchanged lines hidden (view full) --- 111void arprequest(struct ifnet *, 112 struct in_addr *, struct in_addr *, u_char *); 113static void arpintr(struct mbuf *); 114static void arptimer(void *); 115#ifdef INET 116static void in_arpinput(struct mbuf *); 117#endif 118 |
119static const struct netisr_handler arp_nh = { 120 .nh_name = "arp", 121 .nh_handler = arpintr, 122 .nh_proto = NETISR_ARP, 123 .nh_policy = NETISR_POLICY_SOURCE, 124}; 125 |
|
121#ifndef VIMAGE_GLOBALS 122static const vnet_modinfo_t vnet_arp_modinfo = { 123 .vmi_id = VNET_MOD_ARP, 124 .vmi_name = "arp", 125 .vmi_dependson = VNET_MOD_INET, 126 .vmi_iattach = arp_iattach 127}; 128#endif /* !VIMAGE_GLOBALS */ --- 689 unchanged lines hidden (view full) --- 818{ 819 820#ifndef VIMAGE_GLOBALS 821 vnet_mod_register(&vnet_arp_modinfo); 822#else 823 arp_iattach(NULL); 824#endif 825 | 126#ifndef VIMAGE_GLOBALS 127static const vnet_modinfo_t vnet_arp_modinfo = { 128 .vmi_id = VNET_MOD_ARP, 129 .vmi_name = "arp", 130 .vmi_dependson = VNET_MOD_INET, 131 .vmi_iattach = arp_iattach 132}; 133#endif /* !VIMAGE_GLOBALS */ --- 689 unchanged lines hidden (view full) --- 823{ 824 825#ifndef VIMAGE_GLOBALS 826 vnet_mod_register(&vnet_arp_modinfo); 827#else 828 arp_iattach(NULL); 829#endif 830 |
826 arpintrq.ifq_maxlen = 50; 827 mtx_init(&arpintrq.ifq_mtx, "arp_inq", NULL, MTX_DEF); 828 netisr_register(NETISR_ARP, arpintr, &arpintrq, 0); | 831 netisr_register(&arp_nh); |
829} 830SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0); | 832} 833SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0); |