libptpmgmt 2.0
libptpmgmt library that provides the functionality of linuxptp pmc
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SockRaw Class Reference

#include <sock.h>

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

Public Member Functions

bool setPtpDstMacStr (const std::string &string)
 
bool setPtpDstMac (const Binary &ptp_dst_mac)
 
bool setPtpDstMac (const void *ptp_dst_mac, size_t len)
 
bool setPtpDstMac (const ConfigFile &cfg, const std::string &section="")
 
bool setSocketPriority (uint8_t socket_priority)
 
bool setSocketPriority (const ConfigFile &cfg, const std::string &section="")
 
- Public Member Functions inherited from SockBaseIf
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="")
 
- Public Member Functions inherited from SockBase
virtual ~SockBase ()
 
void close ()
 
bool init ()
 
bool send (const void *msg, size_t len) const
 
bool send (const Buf &buf, size_t len) const
 
bool sendBuf (const Buf &buf, size_t len) const
 
ssize_t rcv (void *buf, size_t bufSize, bool block=false) const
 
ssize_t rcv (Buf &buf, bool block=false) const
 
ssize_t rcvBuf (Buf &buf, bool block=false) const
 
int getFd () const
 
int fileno () const
 
bool poll (uint64_t timeout_ms=0) const
 
bool tpoll (uint64_t &timeout_ms) const
 

Detailed Description

Raw socket that uses PTP over Ethernet

Note
The class does NOT support VLAN tags!

Member Function Documentation

◆ setPtpDstMac() [1/3]

bool SockRaw::setPtpDstMac ( const Binary ptp_dst_mac)

Set PTP multicast address using binary from

Parameters
[in]ptp_dst_macaddress in binary string object
Returns
true if PTP multicast address is updated
Note
PTP multicast address can not be changed after initializing. User can close the socket, change this value, and initialize a new socket.

◆ setPtpDstMac() [2/3]

bool SockRaw::setPtpDstMac ( const ConfigFile cfg,
const std::string &  section = "" 
)

Set PTP multicast address using configuration file

Parameters
[in]cfgreference to configuration file object
[in]sectionin configuration file
Returns
true if PTP multicast address is updated
Note
PTP multicast address can not be changed after initializing. User can close the socket, change this value, and initialize a new socket.
calling without section will fetch value from "global" section

◆ setPtpDstMac() [3/3]

bool SockRaw::setPtpDstMac ( const void *  ptp_dst_mac,
size_t  len 
)

Set PTP multicast address using binary from

Parameters
[in]ptp_dst_macaddress in binary form
[in]lenaddress length
Returns
true if PTP multicast address is updated
Note
PTP multicast address can not be changed after initializing. User can close the socket, change this value, and initialize a new socket.

◆ setPtpDstMacStr()

bool SockRaw::setPtpDstMacStr ( const std::string &  string)

Set PTP multicast address using string from

Parameters
[in]stringaddress in a string object
Returns
true if PTP multicast address is updated
Note
PTP multicast address can not be changed after initializing. User can close the socket, change this value, and initialize a new socket.
function convert address to binary form and return false if conversion fail (address is using wrong format).

◆ setSocketPriority() [1/2]

bool SockRaw::setSocketPriority ( const ConfigFile cfg,
const std::string &  section = "" 
)

Set socket priority using configuration file

Parameters
[in]cfgreference to configuration file object
[in]sectionin configuration file
Returns
true if socket priority is updated
Note
socket priority can not be changed after initializing. User can close the socket, change this value, and initialize a new socket.
calling without section will fetch value from "global" section

◆ setSocketPriority() [2/2]

bool SockRaw::setSocketPriority ( uint8_t  socket_priority)

Set socket priority

Parameters
[in]socket_prioritysocket priority value
Returns
true if socket priority is updated
Note
socket priority can not be changed after initializing. User can close the socket, change this value, and initialize a new socket.
the priority is used by network layer, it is not part of the packet

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