Changeset View
Standalone View
sys/net/ethernet.h
| Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | |||||||||
| #define ETHER_IS_BROADCAST(addr) \ | #define ETHER_IS_BROADCAST(addr) \ | ||||||||
| (((addr)[0] & (addr)[1] & (addr)[2] & \ | (((addr)[0] & (addr)[1] & (addr)[2] & \ | ||||||||
| (addr)[3] & (addr)[4] & (addr)[5]) == 0xff) | (addr)[3] & (addr)[4] & (addr)[5]) == 0xff) | ||||||||
| #define ETHER_IS_ZERO(addr) \ | #define ETHER_IS_ZERO(addr) \ | ||||||||
| (((addr)[0] | (addr)[1] | (addr)[2] | \ | (((addr)[0] | (addr)[1] | (addr)[2] | \ | ||||||||
| (addr)[3] | (addr)[4] | (addr)[5]) == 0x00) | (addr)[3] | (addr)[4] | (addr)[5]) == 0x00) | ||||||||
| /* | /* | ||||||||
| * 802.1q VID constants from IEEE 802.1Q-2014, table 9-2. | |||||||||
| */ | |||||||||
| /* Null VID: The tag contains only PCP (priority) and DEI information. */ | |||||||||
| #define DOT1Q_VID_NULL 0x0 | |||||||||
kib: What do DEF_PVID and DEF_SR_PVID mean? | |||||||||
Done Inline Actionsi had the same question, and it turns out these come from 802.1Q-2014 table 9-2:
i will add some comments for these. ivy: i had the same question, and it turns out these come from 802.1Q-2014 table 9-2:
- 1 is "The… | |||||||||
Not Done Inline ActionsPVID and SR_PVID repeated in comments do not explain much. PVID port VLAN Identifier SR_PVID Stream Reservation Port VLAN Identifier And from what I understand, PVID is the vlan assigned to packets without vlan tag. kib: PVID and SR_PVID repeated in comments do not explain much.
My instance of 802.1Q pdf says
```… | |||||||||
Done Inline Actionsi'm not sure we want to reproduce all of 802.1q in the comments :-) at least there's now enough information for an interested reader to look up more detail. yes, PVID is the VLAN untagged packets go to, but DEF_PVID is only the default PVID, i.e., if the admin doesn't configure it. the default pvid in bridge(4) is effectively 0 (not 1) and we can't easily change that without breaking everyone's bridges, so i'm not sure we will ever use this... but it doesn't hurt to have it. ivy: i'm not sure we want to reproduce all of 802.1q in the comments :-) at least there's now enough… | |||||||||
| /* The default PVID for a bridge port. NB: bridge(4) does not honor this. */ | |||||||||
Not Done Inline Actions
kib: | |||||||||
Not Done Inline ActionsI think it's reasonable to expect that anyone reading this code already knows what a PVID is. des: I think it's reasonable to expect that anyone reading this code already knows what a PVID is. | |||||||||
| #define DOT1Q_VID_DEF_PVID 0x1 | |||||||||
| /* The default SR_PVID for SRP Stream related traffic. */ | |||||||||
| #define DOT1Q_VID_DEF_SR_PVID 0x2 | |||||||||
| /* A VID reserved for implementation use, not permitted on the wire. */ | |||||||||
| #define DOT1Q_VID_RSVD_IMPL 0xfff | |||||||||
| /* The lowest valid VID. */ | |||||||||
| #define DOT1Q_VID_MIN 0x1 | |||||||||
| /* The highest valid VID. */ | |||||||||
| #define DOT1Q_VID_MAX 0xffe | |||||||||
| /* | |||||||||
| * This is the type of the VLAN ID inside the tag, not the tag itself. | * This is the type of the VLAN ID inside the tag, not the tag itself. | ||||||||
| */ | */ | ||||||||
| typedef uint16_t ether_vlanid_t; | typedef uint16_t ether_vlanid_t; | ||||||||
| /* | /* | ||||||||
| * 802.1q Virtual LAN header. | * 802.1q Virtual LAN header. | ||||||||
| */ | */ | ||||||||
| struct ether_vlan_header { | struct ether_vlan_header { | ||||||||
| ▲ Show 20 Lines • Show All 395 Lines • Show Last 20 Lines | |||||||||
What do DEF_PVID and DEF_SR_PVID mean?