C# Class NetworkPackets.EthernetPacket

Encapsulates an EthernetPacket and provides the mechanisms to generate new Ethernet Packets. This is immutable.
The Header is of the format: Field Position Destination Address6 bytes Source Address6 bytes Type2 bytes DataThe rest
Inheritance: NetworkPacket
Mostrar archivo Open project: pstjuste/brunet Class Usage Examples

Public Properties

Property Type Description
BroadcastAddress MemBlock
DestinationAddress MemBlock
SourceAddress MemBlock
Type Types
UnicastAddress MemBlock

Public Methods

Method Description
EthernetPacket ( MemBlock Packet ) : Brunet

This parses a MemBlock into the Ethernet fields

EthernetPacket ( MemBlock DestinationAddress, MemBlock SourceAddress, Types Type, ICopyable Payload ) : Brunet

Creates an Ethernet Packet from Ethernet fields and the payload

GetMulticastEthernetAddress ( MemBlock mcast_ip ) : MemBlock

Generates a multicast mac address based upon the multicast IP address.

Private Methods

Method Description
EthernetPacket ( ) : Brunet

Method Details

EthernetPacket() public method

This parses a MemBlock into the Ethernet fields
public EthernetPacket ( MemBlock Packet ) : Brunet
Packet MemBlock The Ethernet packet
return Brunet

EthernetPacket() public method

Creates an Ethernet Packet from Ethernet fields and the payload
public EthernetPacket ( MemBlock DestinationAddress, MemBlock SourceAddress, Types Type, ICopyable Payload ) : Brunet
DestinationAddress MemBlock Where the Ethernet packet is going.
SourceAddress MemBlock Where the Ethernet packet originated.
Type Types Type of Ethernet payload.
Payload ICopyable Payload as an ICopyable
return Brunet

GetMulticastEthernetAddress() public static method

Generates a multicast mac address based upon the multicast IP address.
public static GetMulticastEthernetAddress ( MemBlock mcast_ip ) : MemBlock
mcast_ip MemBlock The multicast ip address
return MemBlock

Property Details

BroadcastAddress public_oe static_oe property

The default broadcast (multicast) address
public static MemBlock BroadcastAddress
return MemBlock

DestinationAddress public_oe property

The address where the Ethernet packet is going
public MemBlock DestinationAddress
return MemBlock

SourceAddress public_oe property

The address where the Ethernet packet originated
public MemBlock SourceAddress
return MemBlock

Type public_oe property

The type for the Ethernet payload
public Types Type
return Types

UnicastAddress public_oe static_oe property

The default unicast address
public static MemBlock UnicastAddress
return MemBlock