Open Lighting Architecture  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | List of all members
ola::testing::MockUDPSocket Class Reference
Inheritance diagram for ola::testing::MockUDPSocket:
ola::network::UDPSocketInterface ola::io::BidirectionalFileDescriptor ola::io::ReadFileDescriptor ola::io::WriteFileDescriptor

Classes

struct  expected_call

Public Member Functions

bool Init ()
bool Bind (const ola::network::IPV4SocketAddress &endpoint)
bool GetSocketAddress (ola::network::IPV4SocketAddress *address) const
bool Close ()
int ReadDescriptor () const
int WriteDescriptor () const
ssize_t SendTo (const uint8_t *buffer, unsigned int size, const ola::network::IPV4Address &ip, unsigned short port) const
ssize_t SendTo (const uint8_t *buffer, unsigned int size, const ola::network::IPV4SocketAddress &dest) const
ssize_t SendTo (ola::io::IOVecInterface *data, const ola::network::IPV4Address &ip, unsigned short port) const
ssize_t SendTo (ola::io::IOVecInterface *data, const ola::network::IPV4SocketAddress &dest) const
bool RecvFrom (uint8_t *buffer, ssize_t *data_read) const
bool RecvFrom (uint8_t *buffer, ssize_t *data_read, ola::network::IPV4Address &source) const
bool RecvFrom (uint8_t *buffer, ssize_t *data_read, ola::network::IPV4Address &source, uint16_t &port) const
bool EnableBroadcast ()
bool SetMulticastInterface (const ola::network::IPV4Address &interface)
bool JoinMulticast (const ola::network::IPV4Address &interface, const ola::network::IPV4Address &group, bool loop=false)
bool LeaveMulticast (const ola::network::IPV4Address &interface, const ola::network::IPV4Address &group)
bool SetTos (uint8_t tos)
void SetDiscardMode (bool discard_mode)
void AddExpectedData (const uint8_t *data, unsigned int size, const ola::network::IPV4Address &ip, uint16_t port)
void AddExpectedData (ola::io::IOQueue *queue, const ola::network::IPV4SocketAddress &dest)
void InjectData (const uint8_t *data, unsigned int size, const ola::network::IPV4Address &ip, uint16_t port)
void InjectData (const uint8_t *data, unsigned int size, const ola::network::IPV4SocketAddress &source)
void InjectData (ola::io::IOQueue *ioqueue, const ola::network::IPV4SocketAddress &source)
void Verify ()
bool CheckNetworkParamsMatch (bool init_called, bool bound_to_port, uint16_t port, bool broadcast_set)
void SetInterface (const ola::network::IPV4Address &interface)
- Public Member Functions inherited from ola::network::UDPSocketInterface
bool Bind (const IPV4Address &ip, unsigned short port)
- Public Member Functions inherited from ola::io::BidirectionalFileDescriptor
void SetOnData (ola::Callback0< void > *on_read)
void SetOnWritable (ola::Callback0< void > *on_write)
void PerformRead ()
void PerformWrite ()
- Public Member Functions inherited from ola::io::ReadFileDescriptor
bool ValidReadDescriptor () const
- Public Member Functions inherited from ola::io::WriteFileDescriptor
bool ValidWriteDescriptor () const

Member Function Documentation

void ola::testing::MockUDPSocket::InjectData ( const uint8_t *  data,
unsigned int  size,
const ola::network::IPV4Address ip,
uint16_t  port 
)

Ownership of the data is not transferred.

void ola::testing::MockUDPSocket::InjectData ( const uint8_t *  data,
unsigned int  size,
const ola::network::IPV4SocketAddress source 
)

Ownership of the data is not transferred.

void ola::testing::MockUDPSocket::InjectData ( ola::io::IOQueue ioqueue,
const ola::network::IPV4SocketAddress source 
)

Inject the data in an IOQueue into the socket. This acts as if the data was received on the UDP socket.

Parameters
ioqueuethe data to inject
sourcethe socket address where this fake data came from

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