summaryrefslogtreecommitdiffstats
path: root/sys/net/ethernet.h
Commit message (Collapse)AuthorAgeFilesLines
* Change if_output to take a struct route as its fourth argument in orderkmacy2009-04-161-2/+2
| | | | | | to allow passing a cached struct llentry * down to L2 Reviewed by: rwatson
* Move CTASSERT of ether header sizes out of the header file and intoemaste2008-08-271-5/+0
| | | | | | | | | | if_ethersubr.c. CTASSERT is implemented using a dummy typedef, which if used in a header file may conflict with another CTASSERT in a source file using that header. I'll make a note of this in CTASSERT's man page. Approved by: imp
* Spelling and capitalization fixes.scf2008-05-161-4/+4
| | | | MFC after: 3 days
* Use a uint16_t type for the vlan tag rather an int.thompsa2007-10-181-1/+1
|
* The bridging output function puts the mbuf directly on the interfaces sendthompsa2007-10-181-0/+1
| | | | | | | | | | | | | | | | queue so the output network card must support the same tagging mechanism as how the frame was input (prepended Ethernet header tag or stripped HW mflag). Now the vlan Ethernet header is _always_ stripped in ether_input and the mbuf flagged, only only network cards with VLAN_HWTAGGING enabled would properly re-tag any outgoing vlan frames. If the outgoing interface does not support hardware tagging then readd the vlan header to the front of the frame. Move the common vlan encapsulation in to ether_vlanencap(). Reported by: Erik Osterholm, Jon Otterholm MFC after: 1 week
* Sync ether_ioctl() with ioctl(2) and ifnet.if_ioctlyar2007-05-291-1/+1
| | | | | | | | | | | as to the type of the command argument: int -> u_long. These types have different widths in the 64-bit world. Add a note to UPDATING because the change breaks KBI on 64-bit platforms. Discussed on: -net, -current Reviewed by: bms, ru
* Add prototypes for ether_aton_r() and ether_ntoa_r() missed in previousrwatson2007-05-131-0/+2
| | | | commit.
* Add Ethertype for 802.3ad LACP.bms2007-03-071-0/+1
|
* style(9) nit. Prefer struct[space]name[space]{ to make grep searches morecsjp2007-01-011-2/+2
| | | | in line with that we find in the rest of the tree.
* Use CTASSERT to make sure:imp2006-12-011-1/+6
| | | | | | | | | | | | sizeof ether_header is 2 * ETHER_ADDR_LEN + 2 (14) bytes long sizeof ether_addr is ETHER_ADDR_LEN bytes long On arm, this shows that struct ether_addr needs to be __packed. The first condition muts be true for the bridging code to not dump core. The second one appears to be implicitly relied upon by wi (but many of the rids it sends down likely need __packed too to be safe) and maybe others. It appears to not hurt anything.
* Fix typo in commentcsjp2006-11-181-1/+1
| | | | Pointed out by: ru
* Currently, drivers that support hardware offload of VLAN tagcsjp2006-11-181-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | processing are forced to toggle this functionality when the card is put in and out of promiscuous mode. The main reason for this is because the hardware strips the VLAN tag, making it impossible for the tag information to show up in network diagnostic tools like tcpdump(1). This change introduces ether_vlan_mtap(), which is called if the mbuf has M_VLANTAG set. VLAN information is extracted from the mbuf and inserted into a stack allocated ether vlan header which is then inserted through the bpf machinery via bpf_mtap2(). The original mbuf's data pointer and lengths are temporarily adjusted to eliminate the original Ethernet header for the duration of the tap operation. This should have no long term effects on the mbuf. Also, define a new macro, ETHER_BPF_MTAP which should be used by drivers which support hardware offload of VLAN tag processing. The fixes for the relevant drivers will follow shortly. Discussed with: rwatson, andre, jhb (and others) Much feedback from: sam, ru MFC after: 1 month [1] [1] The version that is eventually MFCed will be somewhat different then this, as there has been significant work done to the VLAN code in HEAD.
* mark struct ether_header packed so gcc honors alignmentsam2006-11-181-1/+1
| | | | | | | | constratins on arm; this fixes bridging when packets are rx'd so ip headers are 32-bit aligned Reviewed by: imp (and discussed elsewhere) MFC after: 2 weeks
* add ETHERTYPE_PAE for EAPOL/802.1xsam2004-10-051-0/+1
|
* Add helper functions to calculate the standard ethernet CRC innaddy2004-06-021-0/+2
| | | | | | | | | little/big endian fashion, so that network drivers can just reference the standard implementation and don't have to bring their own. As discussed on arch@. Obtained from: NetBSD
* general cleanups mostly aimed at improving portability of driverssam2002-11-141-43/+38
| | | | | | | | | | | | | | o ETHER_* (ETHER_ALIGN, ETHER_MAX_FRAME, ETHER_CRC_LEN, etc.) o M_HASFCS for drivers to indicate packets include FCS o remove global declarations for ng_ether* and vlan_* since these represent a private contract between the if_ethersubr.c code and certain parts of the system that should not normally be abused o add ether_* declarations that were elsewhere o remove ETHER_BPF_* since they are no longer used with the parameter no longer passed to ether_ifattach and ether_ifdetach Reviewed by: many Approved by: re
* Add more ethernet types and move AppleTalk types into proper location.sobomax2002-09-061-7/+257
| | | | Obtained from: NetBSD (syssrc/sys/net/ethertypes.h, rev.1.13)
* Fix a couple of incorrect m_free() vs. m_freem() usages and related issues.luigi2002-04-041-29/+9
| | | | Reviewed-by: brooks
* Remove __P.alfred2002-03-191-5/+5
|
* Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from thebrooks2001-12-031-10/+10
| | | | | | mbuf instead. Suggested by: fenner
* Make vlan(4) loadable, unloadable, and clonable. As a side effect,brooks2001-09-051-0/+35
| | | | | | | interfaces must now always enable VLAN support. Reviewed by: jlemon MFC after: 3 weeks
* Const'ify parameters to ethers(3) routines as appropriate.archie2000-07-181-5/+5
|
* Make all Ethernet drivers attach using ether_ifattach() and detach usingarchie2000-07-131-0/+6
| | | | | | | | | ether_ifdetach(). The former consolidates the operations of if_attach(), ng_ether_attach(), and bpfattach(). The latter consolidates the corresponding detach operations. Reviewed by: julian, freebsd-net
* Provide forward declarations for struct ifnet and struct mbufarchie2000-06-291-0/+3
| | | | to avoid compiler warnings.
* Make the ng_ether(4) node type dynamically loadable like the rest.archie2000-06-261-2/+14
| | | | | | | | | | | | | This means 'options NETGRAPH' is no longer necessary in order to get netgraph-enabled Ethernet interfaces. This supports loading/unloading the ng_ether.ko and attaching/detaching the Ethernet interface in any order. Add two new hooks 'upper' and 'lower' to allow access to the protocol demux engine and the raw device, respectively. This enables bridging to be defined as a netgraph node, if so desired. Reviewed by: freebsd-net@freebsd.org
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-2/+2
| | | | | | 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.
* KAME related header files additions and merges.shin1999-11-051-3/+4
| | | | | | | (only those which don't affect c source files so much) Reviewed by: cvs-committers Obtained from: KAME project
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Add preliminary support for IEEE 802.1Q VLAN tagging. It doesn't actuallywollman1998-03-181-1/+2
| | | | | | | | work reliably yet (I've had panics), but it does seem to occasionally be able to transmit and receive syntactically-correct packets. Also fixes one of if_ethersubr.c's legion style bugs, and removes the hostcache code from standard kernels---the code that depends on it is not going to happen any time soon, I'm afraid.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-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.
* Move the ethertypes from <netinet/if_ether.h> to <net/ethernet.h>.wollman1997-01-031-1/+19
| | | | | | Many programs need the numbers but don't need the internals of ARP. More commits to follow...
* More cleanups to satisfy the following rules:bde1996-12-191-5/+8
| | | | | | | | | - C++ should be supported for application functions (use __BEGIN_DECLS, etc.). - prototypes should be sorted. - comments on #endif's should spell identifiers the same as the code. - comments on #endif's should have the same sense as the code (use `!' to match ifndef, etc.).
* Clean up Bill's additions.wollman1996-12-191-9/+11
|
* Add prototypes for ethers.3 functions as per wollman:wpaul1996-12-181-1/+11
| | | | | | | | | | | | | | > wollman 96/12/10 09:19:15 > > Modified: lib/libc/net ether_addr.c ethers.3 > Log: > Get struct ether_addr directly from <net/ethernet.h> rather than pulling > in lots of unrelated junk from <net/if.h> and <net/if_ether.h>. These > functions still aren't prototyped anywhere (but should be in > <net/ethernet.h>---got that, Bill?). (Note that this file has no copyright header; one should probably be added.)
* Megacommit to straigthen out ETHER_ mess.phk1996-08-061-6/+56
| | | | | I'm pretty convinced after looking at this that the majority of our drivers are confused about the in/exclusion of ETHER_CRC_LEN :-(
* This file is the (intended) definitive source of the ETHER_ macros.phk1996-08-051-0/+13
OpenPOWER on IntegriCloud