ITS
GnAddr Class Reference

#include <GnAddr.h>

Public Types

enum  e_helper { helper_size = 8 }
 The e_helper enum is used to help to have sizes. More...
 

Public Member Functions

 GnAddr ()
 GnAddr Default constructor. More...
 
 GnAddr (quint8 manually, quint8 stationType, quint16 stationCountryCode, quint8 *mid)
 GnAddr Initialization constructor. More...
 
 GnAddr (quint16 mStationTypeStationCountryCode, quint8 *mid)
 GnAddr Initialization constructor. More...
 
 GnAddr (sniff_gnAddr_t gnAddr)
 GnAddr Initialization constructor. More...
 
 GnAddr (QByteArray gnAddr)
 GnAddr Initialization constructor. More...
 
 GnAddr (const GnAddr &other)
 GnAddr Copy constructor. More...
 
quint64 extract (uchar *packet)
 extract Fill the GnAddr with values contained in the packet. More...
 
bool operator== (const GnAddr &g2) const
 operator == Overload of the == operator. More...
 
QByteArray toHex ()
 toHex Create a QByteArray containing the hexadecimal format of the GnAddr. More...
 
quint8 manually () const
 manually Manually field getter (1 bit). More...
 
quint8 stationType () const
 stationType Station Type field getter (5 bits). More...
 
quint16 stationCountryCode () const
 stationCountryCode Station Country Code field getter (10 bits). More...
 
quint16 MStationTypeCountryCode () const
 MStationTypeCountryCode Manually StationType CountryCode field getter. More...
 
quint8 * mid ()
 mid MID field getter. More...
 
quint8 mid (int i) const
 mid MID specific value field getter. More...
 

Private Attributes

quint16 m_StationType_StationCountryCode
 setMID More...
 
quint8 m_mid [6]
 

Detailed Description

Definition at line 28 of file GnAddr.h.

Member Enumeration Documentation

◆ e_helper

The e_helper enum is used to help to have sizes.

Enumerator
helper_size 

The GN_ADDR size is 8 bytes.

Definition at line 34 of file GnAddr.h.

Constructor & Destructor Documentation

◆ GnAddr() [1/6]

GnAddr::GnAddr ( )

GnAddr Default constructor.

Definition at line 3 of file GnAddr.cpp.

References m_mid, and m_StationType_StationCountryCode.

◆ GnAddr() [2/6]

GnAddr::GnAddr ( quint8  manually,
quint8  stationType,
quint16  stationCountryCode,
quint8 *  mid 
)

GnAddr Initialization constructor.

Parameters
manuallyManually field.
stationTypeStation Type field.
stationCountryCodeStation Country Code field.
midMID field.
Note
This constructor will take the only needed bits from Manually, Station Type and Station Country Code.

Definition at line 10 of file GnAddr.cpp.

References m_mid, m_StationType_StationCountryCode, manually(), mid(), stationCountryCode(), and stationType().

Here is the call graph for this function:

◆ GnAddr() [3/6]

GnAddr::GnAddr ( quint16  mStationTypeStationCountryCode,
quint8 *  mid 
)

GnAddr Initialization constructor.

Parameters
mStationTypeStationCountryCode2 first bytes of the GnAddr (Manually + Station Type + Station Country Code).
midMID field.

Definition at line 19 of file GnAddr.cpp.

References m_mid, m_StationType_StationCountryCode, and mid().

Here is the call graph for this function:

◆ GnAddr() [4/6]

GnAddr::GnAddr ( sniff_gnAddr_t  gnAddr)

GnAddr Initialization constructor.

Parameters
sniff_gnAddr_tthe sniff structure for GnAddr.

Definition at line 26 of file GnAddr.cpp.

References m_mid, m_StationType_StationCountryCode, sniff_gnAddr_s::mid, and sniff_gnAddr_s::stationType_StationCountryCode.

◆ GnAddr() [5/6]

GnAddr::GnAddr ( QByteArray  gnAddr)

GnAddr Initialization constructor.

Parameters
gnAddrThe GnAddr in hex.

Definition at line 33 of file GnAddr.cpp.

References extract().

Here is the call graph for this function:

◆ GnAddr() [6/6]

GnAddr::GnAddr ( const GnAddr other)

GnAddr Copy constructor.

Parameters
otherThe GnAddr to copy.

Definition at line 38 of file GnAddr.cpp.

References m_mid, and m_StationType_StationCountryCode.

Member Function Documentation

◆ extract()

quint64 GnAddr::extract ( uchar *  packet)

extract Fill the GnAddr with values contained in the packet.

Parameters
packetThe packet that contains the GnAddr data.

Definition at line 55 of file GnAddr.cpp.

References get_UINT16(), m_mid, and m_StationType_StationCountryCode.

Referenced by LSRequestPacket::extract(), ShortPositionVector::extract(), LongPositionVector::extract(), and GnAddr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ manually()

quint8 GnAddr::manually ( ) const
inline

manually Manually field getter (1 bit).

Returns
Manually field.

Definition at line 101 of file GnAddr.h.

References m_StationType_StationCountryCode.

Referenced by GnAddr().

Here is the caller graph for this function:

◆ mid() [1/2]

◆ mid() [2/2]

quint8 GnAddr::mid ( int  i) const
inline

mid MID specific value field getter.

Returns
specific value of MID.

Definition at line 126 of file GnAddr.h.

References m_mid.

◆ MStationTypeCountryCode()

quint16 GnAddr::MStationTypeCountryCode ( ) const
inline

MStationTypeCountryCode Manually StationType CountryCode field getter.

Returns
Manually StationType CountryCode.

Definition at line 116 of file GnAddr.h.

References m_StationType_StationCountryCode.

Referenced by GeoNet::beaconPacketProcessing(), GeoNet::gacPacketProcessing(), GeoNet::gbcPacketProcessing(), GeoNet::gucPacketProcessing(), GeoNet::LSReplyPacketProcessing(), GeoNet::LSRequestPacketProcessing(), operator==(), LocationTableEntry::print(), GeoNet::shbPacketProcessing(), and GeoNet::tsbPacketProcessing().

Here is the caller graph for this function:

◆ operator==()

bool GnAddr::operator== ( const GnAddr g2) const

operator == Overload of the == operator.

Parameters
aFirst GnAddr to compare.
bSecond GnAddr to compare.
Returns
if the GnAddr are the same or not.

Definition at line 45 of file GnAddr.cpp.

References m_mid, and MStationTypeCountryCode().

Here is the call graph for this function:

◆ stationCountryCode()

quint16 GnAddr::stationCountryCode ( ) const
inline

stationCountryCode Station Country Code field getter (10 bits).

Returns
Station Country Code field.

Definition at line 111 of file GnAddr.h.

References m_StationType_StationCountryCode.

Referenced by GnAddr().

Here is the caller graph for this function:

◆ stationType()

quint8 GnAddr::stationType ( ) const
inline

stationType Station Type field getter (5 bits).

Returns
Station Type field.

Definition at line 106 of file GnAddr.h.

References m_StationType_StationCountryCode.

Referenced by GeoNet::beaconPacketProcessing(), GnAddr(), GeoNet::LSReplyPacketProcessing(), GeoNet::LSRequestPacketProcessing(), and GeoNet::shbPacketProcessing().

Here is the caller graph for this function:

◆ toHex()

QByteArray GnAddr::toHex ( )

toHex Create a QByteArray containing the hexadecimal format of the GnAddr.

Returns
The created QByteArray.

Definition at line 69 of file GnAddr.cpp.

References m_mid, and m_StationType_StationCountryCode.

Referenced by GeoNet::advancedForwarding(), GeoNet::beaconPacketProcessing(), GeoNet::CBFUnicast(), GeoNet::contentionBasedForwardingAlgorithm(), GeoNet::LSReplyPacketProcessing(), GeoNet::LSRequestPacketProcessing(), GeoNet::lsRetransmit(), GeoNet::sendGUC(), GeoNet::sendLsRequest(), CBFPacketBuffer::sendPacket(), GeoNet::shbPacketProcessing(), CBFPacketBuffer::stopPacket(), ShortPositionVector::toHex(), LSRequestPacket::toHex(), and LongPositionVector::toHex().

Here is the caller graph for this function:

Member Data Documentation

◆ m_mid

quint8 GnAddr::m_mid[6]
private

MID (MAC Address).

Definition at line 138 of file GnAddr.h.

Referenced by extract(), GnAddr(), mid(), operator==(), and toHex().

◆ m_StationType_StationCountryCode

quint16 GnAddr::m_StationType_StationCountryCode
private

setMID

Parameters
mManually(1 bit) + Station Type (5 bits) + Station Country Code (10 bits).

Definition at line 137 of file GnAddr.h.

Referenced by extract(), GnAddr(), manually(), MStationTypeCountryCode(), stationCountryCode(), stationType(), and toHex().


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