EthernetMacHeader¶
Namespace: inet
class EthernetMacHeader
This class represents an IEEE 802.3 Ethernet MAC header as defined in the section 3.2 Elements of the MAC frame and packet of the IEEE Std 802.3-2018, IEEE Standard for Ethernet.
- 0 1 2 3 4
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7
| Destination Address | +———————————————————————————————–+ | Source Address | +——————————-+—————————————————————+ | EtherType | +——————————-+
Inheritance diagram¶
Extends¶
Name |
Type |
Description |
|---|---|---|
class |
This class represents the source and destination address fields of an IEEE 802.3 Ethernet MAC header as defined in the sections 3.2.3 Address fields, 3.2.4 Destination Address field, 3.2.5 Source Address field of the IEEE Std 802.3-2018, IEEE Standard for Ethernet. |
Fields¶
Name |
Type |
Description |
|---|---|---|
id |
int |
|
mutable |
bool |
|
complete |
bool |
|
correct |
bool |
|
properlyRepresented |
bool |
|
chunkLength |
||
rawBin |
string[] |
|
rawHex |
string[] |
|
regionTags |
||
chunkLength |
||
dest |
The Destination Address field specifies the station(s) for which the MAC frame is intended. It may be an individual or multicast (including broadcast) address. TODO rename to sourceAddress |
|
src |
The Source Address field specifies the station sending the MAC frame. |
|
chunkLength |
||
typeOrLength |
uint16_t |
This two-octet field takes one of two meanings, depending on its numeric value. For numerical evaluation, the first octet is the most significant octet of this field. a) If the value of this field is less than or equal to 1500 decimal (05DC hexadecimal), then the Length/ Type field indicates the number of MAC client data octets contained in the subsequent MAC Client Data field of the basic frame (Length interpretation). b) If the value of this field is greater than or equal to 1536 decimal (0600 hexadecimal), then the Length/Type field indicates the Ethertype of the MAC client protocol (Type interpretation). |
Properties¶
Name |
Value |
Description |
|---|---|---|
beforeChange |
handleChange() |
|
descriptor |
readonly |
|
existingClass |
||
packetData |
Source code¶
//
// This class represents an IEEE 802.3 Ethernet MAC header as defined in the
// section 3.2 Elements of the MAC frame and packet of the IEEE Std 802.3-2018,
// IEEE Standard for Ethernet.
//
// 0 1 2 3 4
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7
// +-----------------------------------------------------------------------------------------------+
// | Destination Address |
// +-----------------------------------------------------------------------------------------------+
// | Source Address |
// +-------------------------------+---------------------------------------------------------------+
// | EtherType |
// +-------------------------------+
//
class EthernetMacHeader extends EthernetMacAddressFields
{
chunkLength = B(14); // B(6) + B(6) + B(2)
uint16_t typeOrLength; // This two-octet field takes one of two meanings, depending on its numeric value. For numerical evaluation,
// the first octet is the most significant octet of this field.
// a) If the value of this field is less than or equal to 1500 decimal (05DC hexadecimal), then the Length/
// Type field indicates the number of MAC client data octets contained in the subsequent MAC Client
// Data field of the basic frame (Length interpretation).
// b) If the value of this field is greater than or equal to 1536 decimal (0600 hexadecimal), then the
// Length/Type field indicates the Ethertype of the MAC client protocol (Type interpretation).
}
File: src/inet/linklayer/ethernet/common/EthernetMacHeader.msg