My Project
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ethernet_packet Class Reference

The ethernet_packet class contains function to change the ethernet information in bytes from the ethernet packet header to human readable data types (strings) More...

#include <ethernet_packet.h>

Inheritance diagram for ethernet_packet:
ip_packet

Public Member Functions

 ethernet_packet ()
 Constructor, does nothing.
 
void setEtherDHost (u_char[])
 Receives the array of 6 bytes of a destination host. More...
 
void setEtherSHost (u_char[])
 Receives the array of 6 bytes of a source host. More...
 
void setEtherType (u_short)
 Set the Ethernet type. More...
 
string getEtherDHost ()
 Returns the destination HA in string format. More...
 
string getEtherSHost ()
 Returns the source HA in string format. More...
 
u_short getEtherType ()
 Returns the Ethernet type. More...
 

Private Member Functions

string mac2string (u_char[])
 Function to change the array of bytes representing a Hardware Address to its standard string representation. More...
 

Private Attributes

sniff_ethernet ethernet
 

Detailed Description

The ethernet_packet class contains function to change the ethernet information in bytes from the ethernet packet header to human readable data types (strings)

Member Function Documentation

string ethernet_packet::getEtherDHost ( )

Returns the destination HA in string format.

Returns
the destination HA in string format
string ethernet_packet::getEtherSHost ( )

Returns the source HA in string format.

Returns
the source HA in string format
u_short ethernet_packet::getEtherType ( )

Returns the Ethernet type.

Returns
the Ethernet type.
string ethernet_packet::mac2string ( u_char  srcmac[])
private

Function to change the array of bytes representing a Hardware Address to its standard string representation.

Parameters
srcmacarray with an Ethernet address
Returns
Ethernet address in string format
void ethernet_packet::setEtherDHost ( u_char  dhost[])

Receives the array of 6 bytes of a destination host.

Parameters
dhostdestination host Ethernet address
void ethernet_packet::setEtherSHost ( u_char  shost[])

Receives the array of 6 bytes of a source host.

Parameters
shostsource host Ethernet address
void ethernet_packet::setEtherType ( u_short  type)

Set the Ethernet type.

Parameters
typeEthernet type

Member Data Documentation

sniff_ethernet ethernet_packet::ethernet
private

Ethernet header / encabezado Ethernet


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