libptpmgmt  1.4
libptpmgmt library that provides the functionality of linuxptp pmc
Public Member Functions | List of all members
SockBaseIf Class Reference

Base for socket that uses network interface directly. More...

#include <sock.h>

Inheritance diagram for SockBaseIf:
Inheritance graph
[legend]
Collaboration diagram for SockBaseIf:
Collaboration graph
[legend]

Public Member Functions

bool setIfUsingName (const std::string &ifName)
 
bool setIfUsingIndex (int ifIndex)
 
bool setIf (const IfInfo &ifObj)
 
bool setAll (const IfInfo &ifObj, const ConfigFile &cfg, const std::string &section="")
 
bool setAllInit (const IfInfo &ifObj, const ConfigFile &cfg, const std::string &section="")
 

Additional Inherited Members

- Protected Member Functions inherited from SockBase
void close ()
 
bool init ()
 
bool send (const void *msg, size_t len)
 
bool send (Buf &buf, size_t len)
 
bool sendBuf (Buf &buf, size_t len)
 
ssize_t rcv (void *buf, size_t bufSize, bool block=false)
 
ssize_t rcv (Buf &buf, bool block=false)
 
ssize_t rcvBuf (Buf &buf, bool block=false)
 
int getFd () const
 
int fileno () const
 
bool poll (uint64_t timeout_ms=0) const
 
bool tpoll (uint64_t &timeout_ms) const
 

Detailed Description

Base for socket that uses network interface directly.

provide functions to set network interface for UDP and Raw sockets.

Member Function Documentation

◆ setAll()

bool SockBaseIf::setAll ( const IfInfo ifObj,
const ConfigFile cfg,
const std::string &  section = "" 
)
inline

Set all socket parameters using a network interface object and a configuration file

Parameters
[in]ifObjinitialized network interface object
[in]cfgreference to configuration file object
[in]sectionin configuration file
Returns
true if network interface exists and update all parameters.
Note
parameters can not be changed after initializing. User can close the socket, change any of the parameters value and initialize a new socket.
calling without section will fetch value from "global" section

◆ setAllInit()

bool SockBaseIf::setAllInit ( const IfInfo ifObj,
const ConfigFile cfg,
const std::string &  section = "" 
)
inline

Set all socket parameters using a network interface object and a configuration file and initialize

Parameters
[in]ifObjinitialized network interface object
[in]cfgreference to configuration file object
[in]sectionin configuration file
Returns
true if network interface exists and update all parameters.
Note
parameters can not be changed after initializing. User can close the socket, change any of the parameters value and initialize a new socket.
calling without section will fetch value from "global" section

◆ setIf()

bool SockBaseIf::setIf ( const IfInfo ifObj)

Set network interface using a network interface object

Parameters
[in]ifObjinitialized network interface object
Returns
true if network interface exists and updated.
Note
network interface can not be changed after initializing. User can close the socket, change this value, and initialize a new socket.

◆ setIfUsingIndex()

bool SockBaseIf::setIfUsingIndex ( int  ifIndex)

Set network interface using its index

Parameters
[in]ifIndexinterface index
Returns
true if network interface exists and updated.
Note
network interface can not be changed after initializing. User can close the socket, change this value, and initialize a new socket.

◆ setIfUsingName()

bool SockBaseIf::setIfUsingName ( const std::string &  ifName)

< Set network interface using its name

Parameters
[in]ifNameinterface name
Returns
true if network interface exists and updated.
Note
network interface can not be changed after initializing. User can close the socket, change this value, and initialize a new socket.

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