Communication Library for Autonomous Systems v1.0
Reliable and secure communication library for autonomous vehicle systems
Loading...
Searching...
No Matches
Protocol< NIC > Class Template Reference

#include <protocol.h>

Inheritance diagram for Protocol< NIC >:
Conditional_Data_Observer< T, Condition >

Classes

class  Address
 
struct  AuthenticationFields
 
class  Header
 
class  Packet
 
struct  TimestampFields
 

Public Types

enum class  EntityType { VEHICLE , RSU , UNKNOWN }
 
typedef NIC::DataBuffer Buffer
 
typedef NIC::Address Physical_Address
 
typedef std::uint16_t Port
 
typedef Message< Protocol< NIC > > ProtocolMessage
 
typedef Conditional_Data_Observer< Buffer, PortObserver
 
typedef Conditionally_Data_Observed< Buffer, PortObserved
 
typedef std::uint8_t Data[MTU]
 

Public Member Functions

template<typename NIC >
Protocol::Packet Header __attribute__ ((packed))
 
 Protocol (NIC *nic, EntityType entity_type=EntityType::UNKNOWN)
 
void set_vehicle_rsu_manager (VehicleRSUManager< Protocol< NIC > > *manager)
 
 ~Protocol ()
 
int send (Address from, Address to, const void *data, unsigned int size)
 
int receive (Buffer *buf, Address *from, void *data, unsigned int size)
 
void free (Buffer *buf)
 
void setRadius (double radius)
 
void add_neighbor_rsu (unsigned int rsu_id, const MacKeyType &key, const Address &address)
 
void clear_neighbor_rsus ()
 
Address address () const
 

Static Public Member Functions

static void attach (Observer *obs, Address address)
 
static void detach (Observer *obs, Address address)
 

Public Attributes

class Protocol::Address __attribute__
 

Static Public Attributes

static const NIC::Protocol_Number PROTO = Traits<Protocol>::ETHERNET_PROTOCOL_NUMBER
 
static const unsigned int MTU = NIC::MTU - sizeof(Header) - sizeof(TimestampFields) - sizeof(Coordinates) - sizeof(AuthenticationFields)
 

Member Typedef Documentation

◆ Buffer

◆ Data

template<typename NIC >
typedef std::uint8_t Protocol< NIC >::Data[MTU]

◆ Observed

◆ Observer

◆ Physical_Address

template<typename NIC >
typedef NIC::Address Protocol< NIC >::Physical_Address

◆ Port

template<typename NIC >
typedef std::uint16_t Protocol< NIC >::Port

◆ ProtocolMessage

template<typename NIC >
typedef Message<Protocol<NIC> > Protocol< NIC >::ProtocolMessage

Member Enumeration Documentation

◆ EntityType

Enumerator
VEHICLE 
RSU 
UNKNOWN 

Constructor & Destructor Documentation

◆ Protocol()

template<typename NIC >
Protocol< NIC >::Protocol ( NIC nic,
EntityType  entity_type = EntityType::UNKNOWN 
)

◆ ~Protocol()

template<typename NIC >
Protocol< NIC >::~Protocol ( )

Member Function Documentation

◆ __attribute__()

template<typename NIC >
template<typename NIC >
Protocol::Packet Header Protocol< NIC >::__attribute__ ( (packed )

◆ add_neighbor_rsu()

template<typename NIC >
void Protocol< NIC >::add_neighbor_rsu ( unsigned int  rsu_id,
const MacKeyType key,
const Address address 
)

◆ address()

template<typename NIC >
Protocol< NIC >::Address Protocol< NIC >::address ( ) const

◆ attach()

template<typename NIC >
void Protocol< NIC >::attach ( Observer obs,
Address  address 
)
static

◆ clear_neighbor_rsus()

template<typename NIC >
void Protocol< NIC >::clear_neighbor_rsus ( )

◆ detach()

template<typename NIC >
void Protocol< NIC >::detach ( Observer obs,
Address  address 
)
static

◆ free()

template<typename NIC >
void Protocol< NIC >::free ( Buffer buf)

◆ receive()

template<typename NIC >
int Protocol< NIC >::receive ( Buffer buf,
Address from,
void data,
unsigned int  size 
)

◆ send()

template<typename NIC >
int Protocol< NIC >::send ( Address  from,
Address  to,
const void data,
unsigned int  size 
)

◆ set_vehicle_rsu_manager()

template<typename NIC >
void Protocol< NIC >::set_vehicle_rsu_manager ( VehicleRSUManager< Protocol< NIC > > *  manager)

◆ setRadius()

template<typename NIC >
void Protocol< NIC >::setRadius ( double  radius)

Member Data Documentation

◆ __attribute__

template<typename NIC >
class Protocol::Address Protocol< NIC >::__attribute__

◆ MTU

◆ PROTO

template<typename NIC >
const NIC::Protocol_Number Protocol< NIC >::PROTO = Traits<Protocol>::ETHERNET_PROTOCOL_NUMBER
static

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