GlobalBpiLib  1.0
Port Class Reference

Represents an BananaPi R1 ethernet port, starting an ingress port (pcap listener) as well as an egress port (raw socket) thread. More...

#include <Port.h>

Collaboration diagram for Port:

Public Member Functions

 Port (int id, ProtocolLogic *proto)
 
void start ()
 
void stop ()
 
void addMessage (EthernetMessage *msg)
 
void setNeighbour (char *mac)
 
char * getRawMacAddress ()
 
char * getRawDestMacAddress ()
 
std::string getLocalMacAddr ()
 
int getPortId ()
 
void setLinkSpeed (double d)
 

Public Attributes

BpiOutStream bpiout
 
BpiOutStream bpierr
 
int rxMsg
 
int txMsg
 

Protected Member Functions

virtual bool _handleIncomingPaket (EthernetMessage *msg)
 
virtual bool _handleOutgoingPaket (EthernetMessage *msg)
 
virtual bool _handleIncomingPaketFI (EthernetMessage *msg)
 
virtual bool _handleOutgoingPaketFI (EthernetMessage *msg)
 

Detailed Description

Represents an BananaPi R1 ethernet port, starting an ingress port (pcap listener) as well as an egress port (raw socket) thread.

Member Function Documentation

◆ _handleIncomingPaket()

bool Port::_handleIncomingPaket ( EthernetMessage msg)
protectedvirtual

Retrieves the mac address of this device.

◆ _handleIncomingPaketFI()

bool Port::_handleIncomingPaketFI ( EthernetMessage msg)
protectedvirtual

Virtual function without any function, which can be extended by overriding within a derived class.

◆ _handleOutgoingPaket()

bool Port::_handleOutgoingPaket ( EthernetMessage msg)
protectedvirtual

Virtual function without any function, which can be extended by overriding within a derived class.

◆ _handleOutgoingPaketFI()

bool Port::_handleOutgoingPaketFI ( EthernetMessage msg)
protectedvirtual

Default implementation of a packet handler to offer an easiere possibility to implement fault injection mechanisms in a modular way.

◆ addMessage()

void Port::addMessage ( EthernetMessage msg)

Terminates both running threads.

◆ getLocalMacAddr()

std::string Port::getLocalMacAddr ( )

Returns the MAC address of the connected device as char array (only correct if it was set before with setNeighbour(...)).

◆ getPortId()

int Port::getPortId ( )

Returns the MAC address of device as string.

◆ getRawDestMacAddress()

char * Port::getRawDestMacAddress ( )

Returns the MAC address of the device as char array.

◆ getRawMacAddress()

char * Port::getRawMacAddress ( )

Sets the destination MAC address (connected device) to the specified parameter.

◆ setLinkSpeed()

void Port::setLinkSpeed ( double  d)

Retrieves the port id as number between 1 and 4.

◆ setNeighbour()

void Port::setNeighbour ( char *  mac)

Adds message to the outgoing queue. It will be sent as soon as possible.

◆ stop()

void Port::stop ( )

Starts threads for egresss and ingress ports.

Member Data Documentation

◆ bpierr

BpiOutStream Port::bpierr

Error output printer.

◆ bpiout

BpiOutStream Port::bpiout

Standard output printer.

◆ txMsg

int Port::txMsg

Debugging member variables for retrieving statistics about received and transmitted messages.


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