GlobalBpiLib
1.0
|
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>
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) |
Represents an BananaPi R1 ethernet port, starting an ingress port (pcap listener) as well as an egress port (raw socket) thread.
|
protectedvirtual |
Retrieves the mac address of this device.
|
protectedvirtual |
Virtual function without any function, which can be extended by overriding within a derived class.
|
protectedvirtual |
Virtual function without any function, which can be extended by overriding within a derived class.
|
protectedvirtual |
Default implementation of a packet handler to offer an easiere possibility to implement fault injection mechanisms in a modular way.
void Port::addMessage | ( | EthernetMessage * | msg | ) |
Terminates both running threads.
std::string Port::getLocalMacAddr | ( | ) |
Returns the MAC address of the connected device as char array (only correct if it was set before with setNeighbour(...)).
int Port::getPortId | ( | ) |
Returns the MAC address of device as string.
char * Port::getRawDestMacAddress | ( | ) |
Returns the MAC address of the device as char array.
char * Port::getRawMacAddress | ( | ) |
Sets the destination MAC address (connected device) to the specified parameter.
void Port::setLinkSpeed | ( | double | d | ) |
Retrieves the port id as number between 1 and 4.
void Port::setNeighbour | ( | char * | mac | ) |
Adds message to the outgoing queue. It will be sent as soon as possible.
void Port::stop | ( | ) |
Starts threads for egresss and ingress ports.
BpiOutStream Port::bpierr |
Error output printer.
BpiOutStream Port::bpiout |
Standard output printer.
int Port::txMsg |
Debugging member variables for retrieving statistics about received and transmitted messages.