Raw socket that uses PTP over Ethernet.
More...
#include <sock.h>
|
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 uint8_t *ptp_dst_mac, size_t len) |
|
bool | setPtpDstMac (const ConfigFile &cfg, const std::string §ion="") |
|
bool | setSocketPriority (uint8_t socket_priority) |
|
bool | setSocketPriority (const ConfigFile &cfg, const std::string §ion="") |
|
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 |
|
Raw socket that uses PTP over Ethernet.
- Note
- The class does NOT support VLAN tags!
◆ setPtpDstMac() [1/4]
bool SockRaw::setPtpDstMac |
( |
const Binary & |
ptp_dst_mac | ) |
|
|
protected |
Set PTP multicast address using binary from
- Parameters
-
[in] | ptp_dst_mac | address 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/4]
bool SockRaw::setPtpDstMac |
( |
const ConfigFile & |
cfg, |
|
|
const std::string & |
section = "" |
|
) |
| |
|
protected |
Set PTP multicast address using configuration file
- Parameters
-
[in] | cfg | reference to configuration file object |
[in] | section | in 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/4]
bool SockRaw::setPtpDstMac |
( |
const uint8_t * |
ptp_dst_mac, |
|
|
size_t |
len |
|
) |
| |
|
protected |
Set PTP multicast address using binary from
- Parameters
-
[in] | ptp_dst_mac | address in binary form |
[in] | len | address 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.
◆ setPtpDstMac() [4/4]
bool SockRaw::setPtpDstMac |
( |
const void * |
ptp_dst_mac, |
|
|
size_t |
len |
|
) |
| |
|
protected |
Set PTP multicast address using binary from
- Parameters
-
[in] | ptp_dst_mac | address in binary form |
[in] | len | address 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 | ) |
|
|
protected |
< Set PTP multicast address using string from
- Parameters
-
[in] | string | address 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 = "" |
|
) |
| |
|
protected |
Set socket priority using configuration file
- Parameters
-
[in] | cfg | reference to configuration file object |
[in] | section | in 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 | ) |
|
|
protected |
Set socket priority
- Parameters
-
[in] | socket_priority | socket 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: