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

#include <nic.h>

Inheritance diagram for NIC< Engine >:
Ethernet Conditionally_Data_Observed< Buffer< Ethernet::Frame >, Ethernet::Protocol >

Classes

struct  Statistics
 

Public Types

typedef Ethernet::Address Address
 
typedef Ethernet::Protocol Protocol_Number
 
typedef Buffer< Ethernet::FrameDataBuffer
 
typedef Conditional_Data_Observer< DataBuffer, Protocol_NumberObserver
 
typedef Conditionally_Data_Observed< DataBuffer, Protocol_NumberObserved
 
- Public Types inherited from Ethernet
typedef std::uint16_t Protocol
 
- Public Types inherited from Conditionally_Data_Observed< Buffer< Ethernet::Frame >, Ethernet::Protocol >
typedef Buffer< Ethernet::FrameObserved_Data
 
typedef Ethernet::Protocol Observing_Condition
 
typedef Conditional_Data_Observer< Buffer< Ethernet::Frame >, Ethernet::ProtocolObserver
 
typedef Ordered_List< Observer, Ethernet::ProtocolObservers
 

Public Member Functions

 ~NIC ()
 
int send (DataBuffer *buf, unsigned int packet_size)
 
int send (DataBuffer *buf)
 
int receive (DataBuffer *buf, Address *src, Address *dst, void *data, unsigned int size)
 
DataBufferalloc (Address dst, Protocol_Number prot, unsigned int size)
 
void free (DataBuffer *buf)
 
const Addressaddress ()
 
void setAddress (Address address)
 
const Statisticsstatistics ()
 
void stop ()
 
double radius ()
 
void setRadius (double radius)
 
- Public Member Functions inherited from Ethernet
struct Ethernet::Frame __attribute__ ((packed))
 
 Ethernet ()=default
 
 ~Ethernet ()=default
 
- Public Member Functions inherited from Conditionally_Data_Observed< Buffer< Ethernet::Frame >, Ethernet::Protocol >
 Conditionally_Data_Observed ()=default
 
virtual ~Conditionally_Data_Observed ()=default
 
void attach (Observer *o, Ethernet::Protocol c)
 
void detach (Observer *o, Ethernet::Protocol c)
 
bool notify (Buffer< Ethernet::Frame > *d, Ethernet::Protocol c)
 
bool notify (Buffer< Ethernet::Frame > *d)
 

Static Public Attributes

static const unsigned int N_BUFFERS = Traits<NIC<Engine>>::SEND_BUFFERS + Traits<NIC<Engine>>::RECEIVE_BUFFERS
 
static constexpr unsigned int MAX_FRAME_SIZE = sizeof(Ethernet::Frame)
 
- Static Public Attributes inherited from Ethernet
static constexpr unsigned int MTU = 1500
 
static constexpr unsigned int MAC_SIZE = 6
 
static const Ethernet::Address NULL_ADDRESS = {}
 
static const Ethernet::Address BROADCAST = {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}}
 
static constexpr unsigned int HEADER_SIZE = sizeof(Address)*2 + sizeof(Protocol)
 

Protected Member Functions

 NIC ()
 

Friends

class Initializer
 

Additional Inherited Members

- Static Public Member Functions inherited from Ethernet
static std::string mac_to_string (Address addr)
 
- Protected Attributes inherited from Conditionally_Data_Observed< Buffer< Ethernet::Frame >, Ethernet::Protocol >
Observers _observers
 

Member Typedef Documentation

◆ Address

template<typename Engine >
typedef Ethernet::Address NIC< Engine >::Address

◆ DataBuffer

template<typename Engine >
typedef Buffer<Ethernet::Frame> NIC< Engine >::DataBuffer

◆ Observed

template<typename Engine >
typedef Conditionally_Data_Observed<DataBuffer, Protocol_Number> NIC< Engine >::Observed

◆ Observer

template<typename Engine >
typedef Conditional_Data_Observer<DataBuffer, Protocol_Number> NIC< Engine >::Observer

◆ Protocol_Number

template<typename Engine >
typedef Ethernet::Protocol NIC< Engine >::Protocol_Number

Constructor & Destructor Documentation

◆ NIC()

template<typename Engine >
NIC< Engine >::NIC ( )
protected

◆ ~NIC()

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

Member Function Documentation

◆ address()

template<typename Engine >
const NIC< Engine >::Address & NIC< Engine >::address ( )

◆ alloc()

template<typename Engine >
NIC< Engine >::DataBuffer * NIC< Engine >::alloc ( Address  dst,
Protocol_Number  prot,
unsigned int  size 
)

◆ free()

template<typename Engine >
void NIC< Engine >::free ( DataBuffer buf)

◆ radius()

template<typename Engine >
double NIC< Engine >::radius ( )

◆ receive()

template<typename Engine >
int NIC< Engine >::receive ( DataBuffer buf,
Address src,
Address dst,
void data,
unsigned int  size 
)

◆ send() [1/2]

template<typename Engine >
int NIC< Engine >::send ( DataBuffer buf)

◆ send() [2/2]

template<typename Engine >
int NIC< Engine >::send ( DataBuffer buf,
unsigned int  packet_size 
)

◆ setAddress()

template<typename Engine >
void NIC< Engine >::setAddress ( Address  address)

◆ setRadius()

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

◆ statistics()

template<typename Engine >
const NIC< Engine >::Statistics & NIC< Engine >::statistics ( )

◆ stop()

template<typename Engine >
void NIC< Engine >::stop ( )

Friends And Related Symbol Documentation

◆ Initializer

template<typename Engine >
friend class Initializer
friend

Member Data Documentation

◆ MAX_FRAME_SIZE

template<typename Engine >
constexpr unsigned int NIC< Engine >::MAX_FRAME_SIZE = sizeof(Ethernet::Frame)
staticconstexpr

◆ N_BUFFERS

template<typename Engine >
const unsigned int NIC< Engine >::N_BUFFERS = Traits<NIC<Engine>>::SEND_BUFFERS + Traits<NIC<Engine>>::RECEIVE_BUFFERS
static

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