|
libptpmgmt 2.0
libptpmgmt library that provides the functionality of linuxptp pmc
|
Unix socket. More...
#include <sock.h>


Public Member Functions | |
| const std::string & | getPeerAddress () const |
| const char * | getPeerAddress_c () const |
| bool | isPeerAddressAbstract () const |
| bool | setPeerAddress (const std::string &string, bool useAbstract=false) |
| bool | setPeerAddress (const ConfigFile &cfg, const std::string §ion="") |
| const std::string & | getSelfAddress () const |
| const char * | getSelfAddress_c () const |
| bool | isSelfAddressAbstract () const |
| bool | setSelfAddress (const std::string &string, bool useAbstract=false) |
| bool | setDefSelfAddress (const std::string &rootBase="", const std::string &useDef="") |
| bool | sendTo (const void *msg, size_t len, const std::string &addrStr, bool useAbstract=false) const |
| bool | sendTo (const Buf &buf, size_t len, const std::string &addrStr, bool useAbstract=false) const |
| ssize_t | rcvFrom (void *buf, size_t bufSize, std::string &from, bool block=false) const |
| ssize_t | rcvFrom (Buf &buf, std::string &from, bool block=false) const |
| ssize_t | rcvFrom (void *buf, size_t bufSize, bool block=false) |
| ssize_t | rcvFrom (Buf &buf, bool block=false) |
| ssize_t | rcvBufFrom (Buf &buf, bool block=false) |
| const std::string & | getLastFrom () const |
| const char * | getLastFrom_c () const |
| bool | isLastFromAbstract () const |
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 |
Static Public Member Functions | |
| static const std::string & | getHomeDir () |
| static const char * | getHomeDir_c () |
| static bool | isAddressAbstract (const std::string &addr) |
Unix socket.
provide Unix socket that can be used to communicate with linuxptp daemon, ptp4l.
|
static |
Get user home directory
|
static |
Get user home directory
| const std::string & SockUnix::getLastFrom | ( | ) | const |
| const char * SockUnix::getLastFrom_c | ( | ) | const |
| const std::string & SockUnix::getPeerAddress | ( | ) | const |
Get peer address
| const char * SockUnix::getPeerAddress_c | ( | ) | const |
Get peer address
| const std::string & SockUnix::getSelfAddress | ( | ) | const |
Get self address
| const char * SockUnix::getSelfAddress_c | ( | ) | const |
Get self address
|
static |
Is address abstract?
| [in] | addr | socket address |
| bool SockUnix::isLastFromAbstract | ( | ) | const |
Is last from address abstract?
| bool SockUnix::isPeerAddressAbstract | ( | ) | const |
Is peer address abstract?
| bool SockUnix::isSelfAddressAbstract | ( | ) | const |
Is self address abstract?
| ssize_t SockUnix::rcvBufFrom | ( | Buf & | buf, |
| bool | block = false |
||
| ) |
Receive a message using the socket from any address
| [in] | buf | object with message memory buffer |
| [in] | block | true, wait till a packet arrives. false, do not wait, return error if no packet available |
| ssize_t SockUnix::rcvFrom | ( | Buf & | buf, |
| bool | block = false |
||
| ) |
Receive a message using the socket from any address
| [in] | buf | object with message memory buffer |
| [in] | block | true, wait till a packet arrives. false, do not wait, return error if no packet available |
| ssize_t SockUnix::rcvFrom | ( | Buf & | buf, |
| std::string & | from, | ||
| bool | block = false |
||
| ) | const |
Receive a message using the socket from any address
| [in] | buf | object with message memory buffer |
| [out] | from | Unix socket address (socket file) |
| [in] | block | true, wait till a packet arrives. false, do not wait, return error if no packet available |
| ssize_t SockUnix::rcvFrom | ( | void * | buf, |
| size_t | bufSize, | ||
| bool | block = false |
||
| ) |
Receive a message using the socket from any address
| [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 SockUnix::rcvFrom | ( | void * | buf, |
| size_t | bufSize, | ||
| std::string & | from, | ||
| bool | block = false |
||
| ) | const |
Receive a message using the socket from any address
| [in,out] | buf | pointer to a memory buffer |
| [in] | bufSize | memory buffer size |
| [out] | from | Unix socket address (socket file) |
| [in] | block | true, wait till a packet arrives. false, do not wait, return error if no packet available |
| bool SockUnix::sendTo | ( | const Buf & | buf, |
| size_t | len, | ||
| const std::string & | addrStr, | ||
| bool | useAbstract = false |
||
| ) | const |
Send the message using the socket to a specific address
| [in] | buf | object with message memory buffer |
| [in] | len | message length |
| [in] | addrStr | Unix socket address (socket file) |
| [in] | useAbstract | use Abstract socket address |
| bool SockUnix::sendTo | ( | const void * | msg, |
| size_t | len, | ||
| const std::string & | addrStr, | ||
| bool | useAbstract = false |
||
| ) | const |
Send the message using the socket to a specific address
| [in] | msg | pointer to message memory buffer |
| [in] | len | message length |
| [in] | addrStr | Unix socket address (socket file) |
| [in] | useAbstract | use Abstract socket address |
| bool SockUnix::setDefSelfAddress | ( | const std::string & | rootBase = "", |
| const std::string & | useDef = "" |
||
| ) |
Set self address using predefined algorithm
| [in] | rootBase | base used for root user |
| [in] | useDef | base used for non root user |
| bool SockUnix::setPeerAddress | ( | const ConfigFile & | cfg, |
| const std::string & | section = "" |
||
| ) |
Set peer address using configuration file
| [in] | cfg | reference to configuration file object |
| [in] | section | in configuration file |
| bool SockUnix::setPeerAddress | ( | const std::string & | string, |
| bool | useAbstract = false |
||
| ) |
Set peer address
| [in] | string | object with peer address |
| [in] | useAbstract | use Abstract socket address |
| bool SockUnix::setSelfAddress | ( | const std::string & | string, |
| bool | useAbstract = false |
||
| ) |
Set self address
| [in] | string | object with self address |
| [in] | useAbstract | use Abstract socket address |