Sequence Chart Studio  svn HEAD revision
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | List of all members
EthernetPacket Class Reference

#include <data_link_layer.h>

Inheritance diagram for EthernetPacket:
Inheritance graph
Collaboration diagram for EthernetPacket:
Collaboration graph

Public Member Functions

 EthernetPacket (const u_char *data, u_short data_size)
 
 ~EthernetPacket ()
 
std::string get_src_address ()
 
std::string get_dst_address ()
 
u_short get_data_size ()
 
u_charget_upper_data ()
 
u_short get_upper_data_size ()
 
short get_proto ()
 
short get_upper_proto ()
 
std::string get_upper_proto_name ()
 
std::string get_message ()
 
Ports get_ports ()
 
- Public Member Functions inherited from Packet
virtual ~Packet ()
 

Private Attributes

EthernetHeadereth_hdr
 
u_short data_size
 
u_short type
 

Detailed Description

Ethernet packet

Definition at line 37 of file data_link_layer.h.

Constructor & Destructor Documentation

EthernetPacket::EthernetPacket ( const u_char data,
u_short  data_size 
)

Definition at line 19 of file data_link_layer.cpp.

References data_size, eth_hdr, EthernetHeader::ether_type, TO_NTOHS, and type.

EthernetPacket::~EthernetPacket ( )

Definition at line 30 of file data_link_layer.cpp.

Member Function Documentation

u_short EthernetPacket::get_data_size ( )
virtual

Return size of packet in Bytes

Implements Packet.

Definition at line 42 of file data_link_layer.cpp.

References data_size.

std::string EthernetPacket::get_dst_address ( )

Definition at line 37 of file data_link_layer.cpp.

References EthernetHeader::dst_host, eth_hdr, ETHER_ADDR_LEN, and get_host().

Referenced by PcapHandler::packet_handler().

std::string EthernetPacket::get_message ( )
virtual

Return protocol specific message to include in label

Implements Packet.

Definition at line 72 of file data_link_layer.cpp.

Ports EthernetPacket::get_ports ( )
virtual

Return ports, make_ports(0,0) otherwise

Implements Packet.

Definition at line 77 of file data_link_layer.cpp.

References make_ports().

short EthernetPacket::get_proto ( )
virtual

Return protocol numer

Implements Packet.

Definition at line 57 of file data_link_layer.cpp.

References ETHERNET.

std::string EthernetPacket::get_src_address ( )

Definition at line 32 of file data_link_layer.cpp.

References eth_hdr, ETHER_ADDR_LEN, get_host(), and EthernetHeader::src_host.

Referenced by PcapHandler::packet_handler().

u_char * EthernetPacket::get_upper_data ( )
virtual

Return pointer to encapsulated protocol, NULL otherwise

Implements Packet.

Definition at line 47 of file data_link_layer.cpp.

References eth_hdr, and SIZE_ETHERNET.

Referenced by PcapHandler::packet_handler().

u_short EthernetPacket::get_upper_data_size ( )
virtual

Return size of encapsulated data in Bytes, 0 otherwise

Implements Packet.

Definition at line 52 of file data_link_layer.cpp.

References data_size, and SIZE_ETHERNET.

Referenced by PcapHandler::packet_handler().

short EthernetPacket::get_upper_proto ( )
virtual

Return number-id of encapsulated protocol,-1 otherwise

Implements Packet.

Definition at line 62 of file data_link_layer.cpp.

References type.

Referenced by PcapHandler::packet_handler().

std::string EthernetPacket::get_upper_proto_name ( )
virtual

Return name of encapsulated protocol, empty string otherwise

Implements Packet.

Definition at line 67 of file data_link_layer.cpp.

References NET_PROTO_NAME, and type.

Member Data Documentation

u_short EthernetPacket::data_size
private

Definition at line 41 of file data_link_layer.h.

Referenced by EthernetPacket(), get_data_size(), and get_upper_data_size().

EthernetHeader* EthernetPacket::eth_hdr
private

Definition at line 40 of file data_link_layer.h.

Referenced by EthernetPacket(), get_dst_address(), get_src_address(), and get_upper_data().

u_short EthernetPacket::type
private

Definition at line 42 of file data_link_layer.h.

Referenced by EthernetPacket(), get_upper_proto(), and get_upper_proto_name().


The documentation for this class was generated from the following files:

SourceForge.net Logo
Generated on Fri Jan 15 2016 16:26:58 for Sequence Chart Studio by  doxygen