libptpmgmt
1.4
libptpmgmt library that provides the functionality of linuxptp pmc
|
#include <sock.h>
Public Attributes | |
void(* | free )(ptpmgmt_sk sk) |
void(* | close )(ptpmgmt_sk sk) |
bool(* | init )(ptpmgmt_sk sk) |
bool(* | send )(ptpmgmt_sk sk, const void *msg, size_t len) |
ssize_t(* | rcv )(ptpmgmt_sk sk, void *buf, size_t bufSize, bool block) |
int(* | getFd )(const_ptpmgmt_sk sk) |
int(* | fileno )(const_ptpmgmt_sk sk) |
bool(* | poll )(ptpmgmt_sk sk, uint64_t timeout_ms) |
bool(* | tpoll )(ptpmgmt_sk sk, uint64_t *timeout_ms) |
const char *(* | getPeerAddress )(const_ptpmgmt_sk sk) |
bool(* | isPeerAddressAbstract )(const_ptpmgmt_sk sk) |
bool(* | setPeerAddress )(ptpmgmt_sk sk, const char *string) |
bool(* | setPeerAddressAbstract )(ptpmgmt_sk sk, const char *string) |
bool(* | setPeerAddressCfg )(ptpmgmt_sk sk, const_ptpmgmt_cfg cfg, const char *section) |
const char *(* | getSelfAddress )(const_ptpmgmt_sk sk) |
bool(* | isSelfAddressAbstract )(const_ptpmgmt_sk sk) |
bool(* | setSelfAddress )(ptpmgmt_sk sk, const char *string) |
bool(* | setSelfAddressAbstract )(ptpmgmt_sk sk, const char *string) |
bool(* | setDefSelfAddress )(ptpmgmt_sk sk, const char *rootBase, const char *useDef) |
const char *(* | getHomeDir )(ptpmgmt_sk sk) |
bool(* | sendTo )(ptpmgmt_sk sk, const void *msg, size_t len, const char *addrStr) |
bool(* | sendToA )(ptpmgmt_sk sk, const void *msg, size_t len, const char *addrStr) |
ssize_t(* | rcvFrom )(ptpmgmt_sk sk, void *buf, size_t bufSize, char *from, size_t *fromSize, bool block) |
ssize_t(* | rcvFromA )(ptpmgmt_sk sk, void *buf, size_t bufSize, bool block) |
const char *(* | getLastFrom )(const_ptpmgmt_sk sk) |
bool(* | isLastFromAbstract )(const_ptpmgmt_sk sk) |
bool(* | setIfUsingName )(ptpmgmt_sk sk, const char *ifName) |
bool(* | setIfUsingIndex )(ptpmgmt_sk sk, int ifIndex) |
bool(* | setIf )(ptpmgmt_sk sk, const_ptpmgmt_ifInfo ifObj) |
bool(* | setAll )(ptpmgmt_sk sk, const_ptpmgmt_ifInfo ifObj, const_ptpmgmt_cfg cfg, const char *section) |
bool(* | setAllInit )(ptpmgmt_sk sk, const_ptpmgmt_ifInfo ifObj, const_ptpmgmt_cfg cfg, const char *section) |
bool(* | setUdpTtl )(ptpmgmt_sk sk, uint8_t udp_ttl) |
bool(* | setUdpTtlCfg )(ptpmgmt_sk sk, const_ptpmgmt_cfg cfg, const char *section) |
bool(* | setScope )(ptpmgmt_sk sk, uint8_t udp6_scope) |
bool(* | setScopeCfg )(ptpmgmt_sk sk, const_ptpmgmt_cfg cfg, const char *section) |
bool(* | setPtpDstMacStr )(ptpmgmt_sk sk, const char *string) |
bool(* | setPtpDstMac )(ptpmgmt_sk sk, const void *ptp_dst_mac, size_t len) |
bool(* | setPtpDstMacCfg )(ptpmgmt_sk sk, const_ptpmgmt_cfg cfg, const char *section) |
bool(* | setSocketPriority )(ptpmgmt_sk sk, uint8_t socket_priority) |
bool(* | setSocketPriorityCfg )(ptpmgmt_sk sk, const_ptpmgmt_cfg cfg, const char *section) |
The ptpmgmt socket structure hold the socket object and call backs to call C++ methods
void(* ptpmgmt_sk_t::close) (ptpmgmt_sk sk) |
close socket and release its resources
[in,out] | sk | socket |
int(* ptpmgmt_sk_t::fileno) (const_ptpmgmt_sk sk) |
Get socket file description
[in] | sk | socket |
void(* ptpmgmt_sk_t::free) (ptpmgmt_sk sk) |
< Free a socket object
[in,out] | sk | socket |
int(* ptpmgmt_sk_t::getFd) (const_ptpmgmt_sk sk) |
Get socket file description
[in] | sk | socket |
const char*(* ptpmgmt_sk_t::getHomeDir) (ptpmgmt_sk sk) |
Get user home directory
[in,out] | sk | socket |
const char*(* ptpmgmt_sk_t::getLastFrom) (const_ptpmgmt_sk sk) |
const char*(* ptpmgmt_sk_t::getPeerAddress) (const_ptpmgmt_sk sk) |
Get peer address
[in] | sk | socket |
const char*(* ptpmgmt_sk_t::getSelfAddress) (const_ptpmgmt_sk sk) |
Get self address
[in] | sk | socket |
bool(* ptpmgmt_sk_t::init) (ptpmgmt_sk sk) |
Allocate the socket and initialize it with current parameters
[in,out] | sk | socket |
bool(* ptpmgmt_sk_t::isLastFromAbstract) (const_ptpmgmt_sk sk) |
Is last from address abstract?
[in] | sk | socket |
bool(* ptpmgmt_sk_t::isPeerAddressAbstract) (const_ptpmgmt_sk sk) |
Is peer address abstract?
[in] | sk | socket |
bool(* ptpmgmt_sk_t::isSelfAddressAbstract) (const_ptpmgmt_sk sk) |
Is self address abstract?
[in] | sk | socket |
bool(* ptpmgmt_sk_t::poll) (ptpmgmt_sk sk, uint64_t timeout_ms) |
Single socket polling
[in,out] | sk | socket |
[in] | timeout_ms | timeout in milliseconds, until receive a packet. use 0 for blocking. |
ssize_t(* ptpmgmt_sk_t::rcv) (ptpmgmt_sk sk, void *buf, size_t bufSize, bool block) |
Receive a message using the socket
[in,out] | sk | socket |
[in,out] | buf | pointer to a memory buffer |
[in] | bufSize | memory buffer size |
[in] | block | true, wait till a packet arrives. false, do not wait, return error if no packet available |
ssize_t(* ptpmgmt_sk_t::rcvFrom) (ptpmgmt_sk sk, void *buf, size_t bufSize, char *from, size_t *fromSize, bool block) |
Receive a message using the socket from any address
[in,out] | sk | socket |
[in,out] | buf | pointer to a memory buffer |
[in] | bufSize | memory buffer size |
[out] | from | Unix socket address (socket file) |
[in,out] | fromSize | from string buffer size Actual from string size on return |
[in] | block | true, wait till a packet arrives. false, do not wait, return error if no packet available |
ssize_t(* ptpmgmt_sk_t::rcvFromA) (ptpmgmt_sk sk, void *buf, size_t bufSize, bool block) |
Receive a message using the socket from any address
[in,out] | sk | socket |
[in,out] | buf | pointer to a memory buffer |
[in] | bufSize | memory buffer size |
[in] | block | true, wait till a packet arrives. false, do not wait, return error if no packet available |
bool(* ptpmgmt_sk_t::send) (ptpmgmt_sk sk, const void *msg, size_t len) |
Send the message using the socket
[in,out] | sk | socket |
[in] | msg | pointer to message memory buffer |
[in] | len | message length |
bool(* ptpmgmt_sk_t::sendTo) (ptpmgmt_sk sk, const void *msg, size_t len, const char *addrStr) |
Send the message using the socket to a specific address
[in,out] | sk | socket |
[in] | msg | pointer to message memory buffer |
[in] | len | message length |
[in] | addrStr | Unix socket address (socket file) |
bool(* ptpmgmt_sk_t::sendToA) (ptpmgmt_sk sk, const void *msg, size_t len, const char *addrStr) |
Send the message using the socket to a specific abstract soket address
[in,out] | sk | socket |
[in] | msg | pointer to message memory buffer |
[in] | len | message length |
[in] | addrStr | Unix abstract socket address |
bool(* ptpmgmt_sk_t::setAll) (ptpmgmt_sk sk, const_ptpmgmt_ifInfo ifObj, const_ptpmgmt_cfg cfg, const char *section) |
Set all socket parameters using a network interface object and a configuration file
[in,out] | sk | socket |
[in] | ifObj | initialized network interface object |
[in] | cfg | reference to configuration file object |
[in] | section | in configuration file |
bool(* ptpmgmt_sk_t::setAllInit) (ptpmgmt_sk sk, const_ptpmgmt_ifInfo ifObj, const_ptpmgmt_cfg cfg, const char *section) |
Set all socket parameters using a network interface object and a configuration file and initialize
[in,out] | sk | socket |
[in] | ifObj | initialized network interface object |
[in] | cfg | reference to configuration file object |
[in] | section | in configuration file |
bool(* ptpmgmt_sk_t::setDefSelfAddress) (ptpmgmt_sk sk, const char *rootBase, const char *useDef) |
Set self address using predefined algorithm
[in,out] | sk | socket |
[in] | rootBase | base used for root user |
[in] | useDef | base used for non root user |
bool(* ptpmgmt_sk_t::setIf) (ptpmgmt_sk sk, const_ptpmgmt_ifInfo ifObj) |
Set network interface using a network interface object
[in,out] | sk | socket |
[in] | ifObj | initialized network interface object |
bool(* ptpmgmt_sk_t::setIfUsingIndex) (ptpmgmt_sk sk, int ifIndex) |
Set network interface using its index
[in,out] | sk | socket |
[in] | ifIndex | interface index |
bool(* ptpmgmt_sk_t::setIfUsingName) (ptpmgmt_sk sk, const char *ifName) |
Set network interface using its name
[in,out] | sk | socket |
[in] | ifName | interface name |
bool(* ptpmgmt_sk_t::setPeerAddress) (ptpmgmt_sk sk, const char *string) |
Set peer address
[in,out] | sk | socket |
[in] | string | object with peer address |
bool(* ptpmgmt_sk_t::setPeerAddressAbstract) (ptpmgmt_sk sk, const char *string) |
Set peer address with Abstract address
[in,out] | sk | socket |
[in] | string | object with peer address |
bool(* ptpmgmt_sk_t::setPeerAddressCfg) (ptpmgmt_sk sk, const_ptpmgmt_cfg cfg, const char *section) |
Set peer address using configuration file
[in,out] | sk | socket |
[in] | cfg | reference to configuration file object |
[in] | section | in configuration file |
bool(* ptpmgmt_sk_t::setPtpDstMac) (ptpmgmt_sk sk, const void *ptp_dst_mac, size_t len) |
Set PTP multicast address using binary from
[in,out] | sk | socket |
[in] | ptp_dst_mac | address in binary string object |
[in] | len | MAC address length |
bool(* ptpmgmt_sk_t::setPtpDstMacCfg) (ptpmgmt_sk sk, const_ptpmgmt_cfg cfg, const char *section) |
Set PTP multicast address using configuration file
[in,out] | sk | socket |
[in] | cfg | reference to configuration file object |
[in] | section | in configuration file |
bool(* ptpmgmt_sk_t::setPtpDstMacStr) (ptpmgmt_sk sk, const char *string) |
Set PTP multicast address using string from
[in,out] | sk | socket |
[in] | string | address in a string object |
bool(* ptpmgmt_sk_t::setScope) (ptpmgmt_sk sk, uint8_t udp6_scope) |
Set IP version 6 address scope
[in,out] | sk | socket |
[in] | udp6_scope | IP version 6 address scope |
bool(* ptpmgmt_sk_t::setScopeCfg) (ptpmgmt_sk sk, const_ptpmgmt_cfg cfg, const char *section) |
Set IP version 6 address scope using configuration file
[in,out] | sk | socket |
[in] | cfg | reference to configuration file object |
[in] | section | in configuration file |
bool(* ptpmgmt_sk_t::setSelfAddress) (ptpmgmt_sk sk, const char *string) |
Set self address
[in,out] | sk | socket |
[in] | string | object with self address |
bool(* ptpmgmt_sk_t::setSelfAddressAbstract) (ptpmgmt_sk sk, const char *string) |
Set self address with Abstract address
[in,out] | sk | socket |
[in] | string | object with self address |
bool(* ptpmgmt_sk_t::setSocketPriority) (ptpmgmt_sk sk, uint8_t socket_priority) |
Set socket priority
[in,out] | sk | socket |
[in] | socket_priority | socket priority value |
bool(* ptpmgmt_sk_t::setSocketPriorityCfg) (ptpmgmt_sk sk, const_ptpmgmt_cfg cfg, const char *section) |
Set socket priority using configuration file
[in,out] | sk | socket |
[in] | cfg | reference to configuration file object |
[in] | section | in configuration file |
bool(* ptpmgmt_sk_t::setUdpTtl) (ptpmgmt_sk sk, uint8_t udp_ttl) |
Set IP ttl value
[in,out] | sk | socket |
[in] | udp_ttl | IP time to live |
bool(* ptpmgmt_sk_t::setUdpTtlCfg) (ptpmgmt_sk sk, const_ptpmgmt_cfg cfg, const char *section) |
Set IP ttl value using configuration file
[in,out] | sk | socket |
[in] | cfg | reference to configuration file object |
[in] | section | in configuration file |
bool(* ptpmgmt_sk_t::tpoll) (ptpmgmt_sk sk, uint64_t *timeout_ms) |
Single socket polling and update timeout
[in,out] | sk | socket |
[in,out] | timeout_ms | timeout in milliseconds until receive a packet. use 0 for blocking. |