aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/if_ether.h
Commit message (Collapse)AuthorAgeFilesLines
* Retire arpresolve_addr(), which is not used anywhere, from if_ether.c.Bjoern A. Zeeb2018-11-171-3/+0
| | | | Notes: svn path=/head/; revision=340493
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326023
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* This change re-adds L2 caching for TCP and UDP, as originally added in D4306George V. Neville-Neil2016-06-021-2/+5
| | | | | | | | | | | | but removed due to other changes in the system. Restore the llentry pointer to the "struct route", and use it to cache the L2 lookup (ARP or ND6) as appropriate. Submitted by: Mike Karels Differential Revision: https://reviews.freebsd.org/D6262 Notes: svn path=/head/; revision=301217
* Implement interface link header precomputation API.Alexander V. Chernikov2015-12-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add if_requestencap() interface method which is capable of calculating various link headers for given interface. Right now there is support for INET/INET6/ARP llheader calculation (IFENCAP_LL type request). Other types are planned to support more complex calculation (L2 multipath lagg nexthops, tunnel encap nexthops, etc..). Reshape 'struct route' to be able to pass additional data (with is length) to prepend to mbuf. These two changes permits routing code to pass pre-calculated nexthop data (like L2 header for route w/gateway) down to the stack eliminating the need for other lookups. It also brings us closer to more complex scenarios like transparently handling MPLS nexthops and tunnel interfaces. Last, but not least, it removes layering violation introduced by flowtable code (ro_lle) and simplifies handling of existing if_output consumers. ARP/ND changes: Make arp/ndp stack pre-calculate link header upon installing/updating lle record. Interface link address change are handled by re-calculating headers for all lles based on if_lladdr event. After these changes, arpresolve()/nd6_resolve() returns full pre-calculated header for supported interfaces thus simplifying if_output(). Move these lookups to separate ether_resolve_addr() function which ether returs error or fully-prepared link header. Add <arp|nd6_>resolve_addr() compat versions to return link addresses instead of pre-calculated data. BPF changes: Raw bpf writes occupied _two_ cases: AF_UNSPEC and pseudo_AF_HDRCMPLT. Despite the naming, both of there have ther header "complete". The only difference is that interface source mac has to be filled by OS for AF_UNSPEC (controlled via BIOCGHDRCMPLT). This logic has to stay inside BPF and not pollute if_output() routines. Convert BPF to pass prepend data via new 'struct route' mechanism. Note that it does not change non-optimized if_output(): ro_prepend handling is purely optional. Side note: hackish pseudo_AF_HDRCMPLT is supported for ethernet and FDDI. It is not needed for ethernet anymore. The only remaining FDDI user is dev/pdq mostly untouched since 2007. FDDI support was eliminated from OpenBSD in 2013 (sys/net/if_fddisubr.c rev 1.65). Flowtable changes: Flowtable violates layering by saving (and not correctly managing) rtes/lles. Instead of passing lle pointer, pass pointer to pre-calculated header data from that lle. Differential Revision: https://reviews.freebsd.org/D4102 Notes: svn path=/head/; revision=292978
* Revert r292275 & r292379Steven Hartland2015-12-171-2/+1
| | | | | | | | | | glebius has concerns about these changes so reverting those can be discussed and addressed. Sponsored by: Multiplay Notes: svn path=/head/; revision=292402
* Fix lagg failover due to missing notificationsSteven Hartland2015-12-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using lagg failover mode neither Gratuitous ARP (IPv4) or Unsolicited Neighbour Advertisements (IPv6) are sent to notify other nodes that the address may have moved. This results is slow failover, dropped packets and network outages for the lagg interface when the primary link goes down. We now use the new if_link_state_change_cond with the force param set to allow lagg to force through link state changes and hence fire a ifnet_link_event which are now monitored by rip and nd6. Upon receiving these events each protocol trigger the relevant notifications: * inet4 => Gratuitous ARP * inet6 => Unsolicited Neighbour Announce This also fixes the carp IPv6 NA's that stopped working after r251584 which added the ipv6_route__llma route. The new behavour can be controlled using the sysctls: * net.link.ether.inet.arp_on_link * net.inet6.icmp6.nd6_on_link Also removed unused param from lagg_port_state and added descriptions for the sysctls while here. PR: 156226 MFC after: 1 month Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D4111 Notes: svn path=/head/; revision=292275
* Decompose arp_ifinit() into arp_add_ifa_lle() and arp_announce_ifaddr().Alexander V. Chernikov2015-11-091-1/+1
| | | | | | | | | | | Rename arp_ifinit2() into arp_announce_ifaddr(). Eliminate zeroing ifa_rtrequest: it was used for calling arp_rtrequest() which was responsible for handling route cloning requests. It became obsolete since r186119 (L2/L3 split). Notes: svn path=/head/; revision=290604
* * Do more fine-grained locking: call eventhandlers/free_entryAlexander V. Chernikov2015-09-141-1/+0
| | | | | | | | | | | | | without holding afdata wlock * convert per-af delete_address callback to global lltable_delete_entry() and more low-level "delete this lle" per-af callback * fix some bugs/inconsistencies in IPv4/IPv6 ifscrub procedures Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D3573 Notes: svn path=/head/; revision=287789
* Do not return unlocked/unreferenced lle in arpresolve/nd6_storelladdr -Alexander V. Chernikov2014-11-271-3/+2
| | | | | | | | return lle flags IFF needed. Do not pass rte to arpresolve - pass is_gateway flag instead. Notes: svn path=/head/; revision=275196
* Add const qualifier to the dst parameter of the ifnet if_output method.Gleb Smirnoff2013-04-261-12/+11
| | | | Notes: svn path=/head/; revision=249925
* Retire struct sockaddr_inarp.Gleb Smirnoff2013-01-311-0/+3
| | | | | | | | | | | | | | | | | | Since ARP and routing are separated, "proxy only" entries don't have any meaning, thus we don't need additional field in sockaddr to pass SIN_PROXY flag. New kernel is binary compatible with old tools, since sizes of sockaddr_inarp and sockaddr_in match, and sa_family are filled with same value. The structure declaration is left for compatibility with third party software, but in tree code no longer use it. Reviewed by: ru, andre, net@ Notes: svn path=/head/; revision=246143
* Move lle_event to if_llatbl.hNavdeep Parhar2013-01-251-11/+0
| | | | | | | | | | | | | | | lle_event replaced arp_update_event after the ARP rewrite and ended up in if_ether.h simply because arp_update_event used to be there too. IPv6 neighbor discovery is going to grow lle_event support and this is a good time to move it to if_llatbl.h. The two in-tree consumers of this event - OFED and toecore - are not affected. Reviewed by: bz@ Notes: svn path=/head/; revision=245924
* - Updated TOE support in the kernel.Navdeep Parhar2012-06-191-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Stateful TCP offload drivers for Terminator 3 and 4 (T3 and T4) ASICs. These are available as t3_tom and t4_tom modules that augment cxgb(4) and cxgbe(4) respectively. The cxgb/cxgbe drivers continue to work as usual with or without these extra features. - iWARP driver for Terminator 3 ASIC (kernel verbs). T4 iWARP in the works and will follow soon. Build-tested with make universe. 30s overview ============ What interfaces support TCP offload? Look for TOE4 and/or TOE6 in the capabilities of an interface: # ifconfig -m | grep TOE Enable/disable TCP offload on an interface (just like any other ifnet capability): # ifconfig cxgbe0 toe # ifconfig cxgbe0 -toe Which connections are offloaded? Look for toe4 and/or toe6 in the output of netstat and sockstat: # netstat -np tcp | grep toe # sockstat -46c | grep toe Reviewed by: bz, gnn Sponsored by: Chelsio communications. MFC after: ~3 months (after 9.1, and after ensuring MFC is feasible) Notes: svn path=/head/; revision=237263
* Move arprequest() declaration to if_ether.h.Gleb Smirnoff2012-01-081-0/+2
| | | | Notes: svn path=/head/; revision=229810
* A major overhaul of the CARP implementation. The ip_carp.c was startedGleb Smirnoff2011-12-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from scratch, copying needed functionality from the old implemenation on demand, with a thorough review of all code. The main change is that interface layer has been removed from the CARP. Now redundant addresses are configured exactly on the interfaces, they run on. The CARP configuration itself is, as before, configured and read via SIOCSVH/SIOCGVH ioctls. A new prefix created with SIOCAIFADDR or SIOCAIFADDR_IN6 may now be configured to a particular virtual host id, which makes the prefix redundant. ifconfig(8) semantics has been changed too: now one doesn't need to clone carpXX interface, he/she should directly configure a vhid on a Ethernet interface. To supply vhid data from the kernel to an application the getifaddrs(8) function had been changed to pass ifam_data with each address. [1] The new implementation definitely closes all PRs related to carp(4) being an interface, and may close several others. It also allows to run a single redundant IP per interface. Big thanks to Bjoern Zeeb for his help with inet6 part of patch, for idea on using ifam_data and for several rounds of reviewing! PR: kern/117000, kern/126945, kern/126714, kern/120130, kern/117448 Reviewed by: bz Submitted by: bz [1] Notes: svn path=/head/; revision=228571
* Add arp_update_event. This replaces route_arp_update_event, whichNavdeep Parhar2009-09-081-0/+5
| | | | | | | | | | | | | | | has not worked since the arp-v2 rewrite. The event handler will be called with the llentry write-locked and can examine la_flags to determine whether the entry is being added or removed. Reviewed by: gnn, kmacy Approved by: gnn (mentor) MFC after: 1 month Notes: svn path=/head/; revision=196995
* remove dependency on net/if.h of this headerLuigi Rizzo2009-02-161-0/+1
| | | | Notes: svn path=/head/; revision=188672
* This main goals of this project are:Qing Li2008-12-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. separating L2 tables (ARP, NDP) from the L3 routing tables 2. removing as much locking dependencies among these layers as possible to allow for some parallelism in the search operations 3. simplify the logic in the routing code, The most notable end result is the obsolescent of the route cloning (RTF_CLONING) concept, which translated into code reduction in both IPv4 ARP and IPv6 NDP related modules, and size reduction in struct rtentry{}. The change in design obsoletes the semantics of RTF_CLONING, RTF_WASCLONE and RTF_LLINFO routing flags. The userland applications such as "arp" and "ndp" have been modified to reflect those changes. The output from "netstat -r" shows only the routing entries. Quite a few developers have contributed to this project in the past: Glebius Smirnoff, Luigi Rizzo, Alessandro Cerri, and Andre Oppermann. And most recently: - Kip Macy revised the locking code completely, thus completing the last piece of the puzzle, Kip has also been conducting active functional testing - Sam Leffler has helped me improving/refactoring the code, and provided valuable reviews - Julian Elischer setup the perforce tree for me and has helped me maintaining that branch before the svn conversion Notes: svn path=/head/; revision=186119
* Don't duplicate the whole of arpresolve to arpresolve 2 for the sakeJulian Elischer2007-12-311-2/+0
| | | | | | | | | | | of two compares against 0. The negative effect of cache flushing is probably more than the gain by not doing the two compares (the value is almost certainly in register or at worst, cache). Note that the uses of m_freem() are in error cases and m_freem() handles NULL anyhow. So fast-path really isn't changed much at all. Notes: svn path=/head/; revision=175025
* widen the routing event interface (arp update, redirect, and eventually pmtu ↵Kip Macy2007-12-171-0/+2
| | | | | | | | | | | | change) into separate functions revert previous commit's changes to arpresolve and add a new interface arpresolve2 which does arp resolution without an mbuf Notes: svn path=/head/; revision=174703
* Add CARP (Common Address Redundancy Protocol), which allows multipleGleb Smirnoff2005-02-221-0/+1
| | | | | | | | | | | | | | | | hosts to share an IP address, providing high availability and load balancing. Original work on CARP done by Michael Shalayeff, with many additions by Marco Pfatschbacher and Ryan McBride. FreeBSD port done solely by Max Laier. Patch by: mlaier Obtained from: OpenBSD (mickey, mcbride) Notes: svn path=/head/; revision=142215
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-071-1/+1
| | | | Notes: svn path=/head/; revision=139823
* Remove advertising clause from University of California Regent'sWarner Losh2004-04-071-4/+0
| | | | | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson Notes: svn path=/head/; revision=128019
* + arpresolve(): remove an unused argumentLuigi Rizzo2004-04-041-2/+2
| | | | | | | | | | | | + struct ifnet: remove unused fields, move ipv6-related field close to each other, add a pointer to l3<->l2 translation tables (arp,nd6, etc.) for future use. + struct route: remove an unused field, move close to each other some fields that might likely go away in the future Notes: svn path=/head/; revision=127828
* Update netisr handling; Each SWI now registers its queue, and all queueJonathan Lemon2003-03-041-1/+0
| | | | | | | | | | | | | drain routines are done by swi_net, which allows for better queue control at some future point. Packets may also be directly dispatched to a netisr instead of queued, this may be of interest at some installations, but currently defaults to off. Reviewed by: hsu, silby, jayanth, sam Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=111888
* Fixed some style bugs in the removal of __P(()). Continuation linesBruce Evans2002-03-241-1/+1
| | | | | | | | were not outdented to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting. Notes: svn path=/head/; revision=93085
* Remove __P.Alfred Perlstein2002-03-191-3/+3
| | | | Notes: svn path=/head/; revision=92723
* bring in ARP support for variable length link level addressesMax Khon2001-10-141-2/+2
| | | | | | | | | | Reviewed by: jdp Approved by: jdp Obtained from: NetBSD MFC after: 6 weeks Notes: svn path=/head/; revision=84931
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"Peter Wemm1999-12-291-1/+1
| | | | | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come. Notes: svn path=/head/; revision=55205
* KAME related header files additions and merges.Yoshinobu Inoue1999-11-051-0/+16
| | | | | | | | | | (only those which don't affect c source files so much) Reviewed by: cvs-committers Obtained from: KAME project Notes: svn path=/head/; revision=52904
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Make INET a proper option.Eivind Eklund1998-01-081-17/+1
| | | | | | | | | | | | | | | This will not make any of object files that LINT create change; there might be differences with INET disabled, but hardly anything compiled before without INET anyway. Now the 'obvious' things will give a proper error if compiled without inet - ipx_ip, ipfw, tcp_debug. The only thing that _should_ work (but can't be made to compile reasonably easily) is sppp :-( This commit move struct arpcom from <netinet/if_ether.h> to <net/if_arp.h>. Notes: svn path=/head/; revision=32350
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Use the new if_multiaddrs list for multicast addresses rather than theGarrett Wollman1997-01-131-73/+1
| | | | | | | | | | previous hackery involving struct in_ifaddr and arpcom. Get rid of the abominable multi_kludge. Update all network interfaces to use the new machanism. Distressingly few Ethernet drivers program the multicast filter properly (assuming the hardware has one, which it usually does). Notes: svn path=/head/; revision=21666
* Move the ethertypes from <netinet/if_ether.h> to <net/ethernet.h>.Garrett Wollman1997-01-031-17/+1
| | | | | | | | | Many programs need the numbers but don't need the internals of ARP. More commits to follow... Notes: svn path=/head/; revision=21260
* Include <net/if_arp.h> in the one header that requires it,Garrett Wollman1996-12-111-1/+2
| | | | | | | | | | <netinet/if_ether.h>, rather than in <net/if.h>, most of whose callers have no need of it. Pointed-out-by: bde Notes: svn path=/head/; revision=20330
* Megacommit to straigthen out ETHER_ mess.Poul-Henning Kamp1996-08-061-31/+17
| | | | | | | | I'm pretty convinced after looking at this that the majority of our drivers are confused about the in/exclusion of ETHER_CRC_LEN :-( Notes: svn path=/head/; revision=17455
* Send ARP's for aliased subnets with the proper source address.Bill Fenner1996-03-231-2/+1
| | | | | | | | | | Get rid of ac->ac_ipaddr and arpwhohas() since they assume that an interface has only one address. Obtained from: BSD/OS 2.1, via Rich Stevens <rstevens@noao.edu> Notes: svn path=/head/; revision=14761
* Remove old ballast, clean up a little bit, staticize.Poul-Henning Kamp1995-12-091-4/+1
| | | | | | | | | | | | | | | | Add five sysctl variables that you should probably never tweak. net.arp.t_prune: 300 net.arp.t_keep: 1200 net.arp.t_down: 20 net.arp.maxtries: 5 net.arp.useloopback: 1 net.arp.proxyall: 0 (It's net.arp because arp isn't limited to inet, though our present implementation surely is). Notes: svn path=/head/; revision=12693
* all:David Greenman1995-12-051-1/+4
| | | | | | | | | | | | | | | | | | | Removed ifnet.if_init and ifnet.if_reset as they are generally unused. Change the parameter passed to if_watchdog to be a ifnet * rather than a unit number. All of this is an attempt to move toward not needing an array of softc pointers (which is usually static in size) to point to the driver softc. if_ed.c: Changed some of the argument passing to some functions to make a little more sense. if_ep.c, if_vx.c: Killed completely bogus use of if_timer. It was being set in such a way that the interface was being reset once per second (blech!). Notes: svn path=/head/; revision=12628
* Convert ARP to use queue.h macros rather than insque/remque. WhileGarrett Wollman1995-10-051-13/+1
| | | | | | | | | | we're at it, eliminate obsolete exposure of `struct llinfo_arp' to the world. (This dates back to when ARP entries were not stored in the routing table, and there was no other way for the `arp' program to read the whole table than to grovel around in /dev/kmem.) Notes: svn path=/head/; revision=11225
* Merge with 4.4-Lite-2. This involves changing the version number andGarrett Wollman1995-09-211-3/+3
| | | | | | | | | moving a declaration around. Obtained from: 4.4BSD-Lite-2 Notes: svn path=/head/; revision=10938
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-4/+4
| | | | Notes: svn path=/head/; revision=8876
* Add declaration for struct ether_addr (this is where Sun documentsBill Paul1995-04-021-1/+8
| | | | | | | it to go). Notes: svn path=/head/; revision=7575
* Make arp_rtrequest() static since nobody needs to referene it any more.Garrett Wollman1994-12-221-2/+1
| | | | Notes: svn path=/head/; revision=5196
* Move ARP interface initialization into if_ether.c:arp_ifinit().Garrett Wollman1994-12-221-1/+2
| | | | Notes: svn path=/head/; revision=5195
* Fix a bug which caused panics when attempting to change just the flags ofGarrett Wollman1994-10-111-3/+3
| | | | | | | | | | | a route. (This still doesn't work, but it doesn't panic now.) It looks like there may be a number of incipient bugs in this code. Also, get ready for the time when all IP gateway routes are cloning, which is necessary to keep proper TCP statistics. Notes: svn path=/head/; revision=3514
* Made idempotent.Paul Richards1994-08-211-1/+6
| | | | | | | Submitted by: Paul Notes: svn path=/head/; revision=2169