libptpmgmt
1.4
libptpmgmt library that provides the functionality of linuxptp pmc
|
#include <msg.h>
The ptpmgmt message structure hold the message object and call backs to call C++ methods
const char*(* ptpmgmt_msg_t::act2str) (enum ptpmgmt_actionField_e action) |
Convert action to string
[in] | action |
enum ptpmgmt_MNG_PARSE_ERROR_e(* ptpmgmt_msg_t::build) (const_ptpmgmt_msg msg, void *buf, size_t bufSize, uint16_t sequence) |
Build a raw message for send using setAction setting
[in] | msg | object |
[in,out] | buf | memory buffer to fill with raw PTP Message |
[in] | bufSize | buffer size |
[in] | sequence | message sequence |
bool(* ptpmgmt_msg_t::changeAuth) (ptpmgmt_msg msg, uint8_t spp, uint32_t key) |
Change the spp and send key used in the AUTHENTICATION TLVs
[in,out] | msg | object |
[in] | spp | ID to use to send |
[in] | key | ID to use to send |
bool(* ptpmgmt_msg_t::changeAuthKey) (ptpmgmt_msg msg, uint32_t key) |
Change the send key used in the AUTHENTICATION TLVs.
[in,out] | msg | object |
[in] | key | ID to use to send |
void(* ptpmgmt_msg_t::clearData) (const_ptpmgmt_msg msg) |
Clear data for send, prevent accidentally use, in case it is freed
[in] | msg | object |
const char*(* ptpmgmt_msg_t::clkType2str) (enum ptpmgmt_clockType_e type) |
Convert clock type to string
[in] | type | clock type |
const char*(* ptpmgmt_msg_t::clockAcc2str) (enum ptpmgmt_clockAccuracy_e value) |
Convert clock accuracy to string
[in] | value | clock accuracy |
const char*(* ptpmgmt_msg_t::delayMech2str) (enum ptpmgmt_delayMechanism_e type) |
Convert delay mechanism to string
[in] | type | delay mechanism |
bool(* ptpmgmt_msg_t::disableAuth) (ptpmgmt_msg msg) |
Disable the use of AUTHENTICATION TLV.
[in,out] | msg | object |
const char*(* ptpmgmt_msg_t::err2str) (enum ptpmgmt_MNG_PARSE_ERROR_e err) |
Convert parse error code to string
[in] | err | parse code |
const char*(* ptpmgmt_msg_t::errId2str) (enum ptpmgmt_managementErrorId_e err) |
Convert management error to string
[in] | err | ID |
const char*(* ptpmgmt_msg_t::faultRec2str) (enum ptpmgmt_faultRecord_e code) |
Convert fault record severity code to string
[in] | code | severity code |
bool(* ptpmgmt_msg_t::findDelayMech) (const char *str, enum ptpmgmt_delayMechanism_e *type, bool exact) |
Convert string to delay mechanism
[in] | str | string to search |
[out] | type | delay mechanism |
[in] | exact | perform an exact match |
bool(* ptpmgmt_msg_t::findMngID) (const char *str, enum ptpmgmt_mng_vals_e *id, bool exact) |
Convert string to management id
[in] | str | string to search |
[out] | id | parse code |
[in] | exact | perform an exact match |
bool(* ptpmgmt_msg_t::findPortState) (const char *str, enum ptpmgmt_portState_e *state, bool caseSens) |
Convert string to port state
[in] | str | string to search |
[out] | state | port state |
[in] | caseSens | perform case sensetive match |
bool(* ptpmgmt_msg_t::findTimeSrc) (const char *str, enum ptpmgmt_timeSource_e *type, bool exact) |
Convert string to time source type
[in] | str | string to search |
[out] | type | time source |
[in] | exact | perform an exact match |
void(* ptpmgmt_msg_t::free) (ptpmgmt_msg msg) |
< Free msg object
[in,out] | msg | object |
enum ptpmgmt_mng_vals_e(* ptpmgmt_msg_t::getBuildTlvId) (const_ptpmgmt_msg msg) |
Get the current build TLV id
[in] | msg | object |
const void*(* ptpmgmt_msg_t::getData) (ptpmgmt_msg msg) |
Get last parsed message dataField
[in,out] | msg | object |
uint8_t(* ptpmgmt_msg_t::getDomainNumber) (const_ptpmgmt_msg msg) |
Get last parsed message domainNumber
[in] | msg | object |
const char*(* ptpmgmt_msg_t::getErrDisplay) (const_ptpmgmt_msg msg) |
Get management error message
[in] | msg | object Relevant only when parsed message return MNG_PARSE_ERROR_MSG |
enum ptpmgmt_managementErrorId_e(* ptpmgmt_msg_t::getErrId) (const_ptpmgmt_msg msg) |
Get management error code ID
[in] | msg | object Relevant only when parsed message return MNG_PARSE_ERROR_MSG |
uint8_t(* ptpmgmt_msg_t::getMinorVersionPTP) (const_ptpmgmt_msg msg) |
Get last parsed message minor PTP version
[in] | msg | object |
enum ptpmgmt_tlvType_e(* ptpmgmt_msg_t::getMngType) (const_ptpmgmt_msg msg) |
Get management message type
[in] | msg | object |
size_t(* ptpmgmt_msg_t::getMsgLen) (const_ptpmgmt_msg msg) |
Get last build message size
[in] | msg | object |
ssize_t(* ptpmgmt_msg_t::getMsgPlanedLen) (const_ptpmgmt_msg msg) |
Get planned message to build size
[in] | msg | object |
ptpmgmt_pMsgParams(* ptpmgmt_msg_t::getParams) (ptpmgmt_msg msg) |
Get the current msgparams parameters
[in,out] | msg | object |
const struct ptpmgmt_PortIdentity_t*(* ptpmgmt_msg_t::getPeer) (ptpmgmt_msg msg) |
Get last parsed message peer port ID
[in,out] | msg | object |
uint8_t(* ptpmgmt_msg_t::getPTPProfileSpecific) (const_ptpmgmt_msg msg) |
Get last reply PTP Profile Specific
[in] | msg | object |
enum ptpmgmt_actionField_e(* ptpmgmt_msg_t::getReplyAction) (const_ptpmgmt_msg msg) |
Get last reply management action
[in] | msg | object |
const_ptpmgmt_safile(* ptpmgmt_msg_t::getSa) (ptpmgmt_msg msg) |
Get authentication security association pool
uint32_t(* ptpmgmt_msg_t::getSdoId) (const_ptpmgmt_msg msg) |
Get last parsed message sdoId
[in] | msg | object |
enum ptpmgmt_actionField_e(* ptpmgmt_msg_t::getSendAction) (const_ptpmgmt_msg msg) |
Get build management action
[in] | msg | object |
const void*(* ptpmgmt_msg_t::getSendData) (const_ptpmgmt_msg msg) |
Get send message dataField
[in] | msg | object |
uint16_t(* ptpmgmt_msg_t::getSequence) (const_ptpmgmt_msg msg) |
Get last parsed message sequence number
[in] | msg | object |
const void*(* ptpmgmt_msg_t::getSigMngTlv) (ptpmgmt_msg msg, size_t position) |
Get a management TLV from the last signalling message TLVs by position
[in,out] | msg | object |
[in] | position | of TLV |
enum ptpmgmt_mng_vals_e(* ptpmgmt_msg_t::getSigMngTlvType) (const_ptpmgmt_msg msg, size_t position) |
Get the management TLV ID of a management TLV from the last signalling message TLVs by position
[in] | msg | object |
[in] | position | of TLV |
const void*(* ptpmgmt_msg_t::getSigTlv) (ptpmgmt_msg msg, size_t position) |
Get a TLV from the last signalling message TLVs by position
[in,out] | msg | object |
[in] | position | of TLV |
size_t(* ptpmgmt_msg_t::getSigTlvsCount) (const_ptpmgmt_msg msg) |
Get number of the last signalling message TLVs
[in] | msg | object |
enum ptpmgmt_tlvType_e(* ptpmgmt_msg_t::getSigTlvType) (const_ptpmgmt_msg msg, size_t position) |
Get a type of TLV from the last signalling message TLVs by position
[in] | msg | object |
[in] | position | of TLV |
const struct ptpmgmt_PortIdentity_t*(* ptpmgmt_msg_t::getTarget) (ptpmgmt_msg msg) |
Get last parsed message target port ID
[in,out] | msg | object |
enum ptpmgmt_mng_vals_e(* ptpmgmt_msg_t::getTlvId) (const_ptpmgmt_msg msg) |
Get the current parsed TLV id
[in] | msg | object |
enum ptpmgmt_msgType_e(* ptpmgmt_msg_t::getType) (const_ptpmgmt_msg msg) |
Get message type
[in] | msg | object |
uint8_t(* ptpmgmt_msg_t::getVersionPTP) (const_ptpmgmt_msg msg) |
Get last parsed message PTP version
[in] | msg | object |
bool(* ptpmgmt_msg_t::haveAuth) (const_ptpmgmt_msg msg) |
Get if AUTHENTICATION TLV with authentication parameters are used
[in] | msg | object |
bool(* ptpmgmt_msg_t::is_FTRA) (uint8_t flags) |
Check if frequency is traceable flag is enabled
[in] | flags |
bool(* ptpmgmt_msg_t::is_LI_59) (uint8_t flags) |
Check if leap 59 seconds flag is enabled
[in] | flags |
bool(* ptpmgmt_msg_t::is_LI_61) (uint8_t flags) |
Check if leap 61 seconds flag is enabled
[in] | flags |
bool(* ptpmgmt_msg_t::is_PTP) (uint8_t flags) |
Check if is PTP instance flag is enabled
[in] | flags |
bool(* ptpmgmt_msg_t::is_TTRA) (uint8_t flags) |
Check if timescale is traceable flag is enabled
[in] | flags |
bool(* ptpmgmt_msg_t::is_UTCV) (uint8_t flags) |
Check if UTC offset is valid flag is enabled
[in] | flags |
bool(* ptpmgmt_msg_t::isAllClocks) (const_ptpmgmt_msg msg) |
Query if target clock ID is using all clocks.
[in] | msg | object |
bool(* ptpmgmt_msg_t::isEmpty) (enum ptpmgmt_mng_vals_e id) |
Check management TLV id uses empty dataField
[in] | id | management TLV id |
bool(* ptpmgmt_msg_t::isLastMsgSig) (const_ptpmgmt_msg msg) |
query if last message is a signalling message
[in] | msg | object |
bool(* ptpmgmt_msg_t::isLastMsgSMPTE) (const_ptpmgmt_msg msg) |
query if last message is a SMPTE message
[in] | msg | object |
bool(* ptpmgmt_msg_t::isUnicast) (const_ptpmgmt_msg msg) |
Is last parsed message a unicast or not
[in] | msg | object |
bool(* ptpmgmt_msg_t::isValidId) (const_ptpmgmt_msg msg, enum ptpmgmt_mng_vals_e id) |
Check if management TLV is valid for use
[in] | msg | object |
[in] | id | management TLV id |
const char*(* ptpmgmt_msg_t::mng2str) (enum ptpmgmt_mng_vals_e id) |
Convert management id to string
[in] | id | parse code |
const char*(* ptpmgmt_msg_t::netProt2str) (enum ptpmgmt_networkProtocol_e protocol) |
Convert network protocol to string
[in] | protocol | network protocol |
enum ptpmgmt_MNG_PARSE_ERROR_e(* ptpmgmt_msg_t::parse) (const_ptpmgmt_msg msg, const void *buf, ssize_t msgSize) |
const char*(* ptpmgmt_msg_t::portState2str) (enum ptpmgmt_portState_e state) |
Convert port state to string
[in] | state | port state |
const char*(* ptpmgmt_msg_t::pwr2str) (enum ptpmgmt_linuxptpPowerProfileVersion_e ver) |
Convert linuxptp power profile version to string
[in] | ver | version |
bool(* ptpmgmt_msg_t::setAction) (ptpmgmt_msg msg, enum ptpmgmt_actionField_e actionField, enum ptpmgmt_mng_vals_e tlv_id, const void *dataSend) |
Set message object management TLV id, action and data for dataField
[in,out] | msg | object |
[in] | actionField | for sending |
[in] | tlv_id | management TLV id |
[in] | dataSend | pointer to TLV object |
void(* ptpmgmt_msg_t::setAllClocks) (const_ptpmgmt_msg msg) |
Set target clock ID to use all clocks.
[in] | msg | object |
const char*(* ptpmgmt_msg_t::smpteLck2str) (enum ptpmgmt_SMPTEmasterLockingStatus_e state) |
Convert SMPTE clock locking state to string
[in] | state | SMPTE clock locking state |
const char*(* ptpmgmt_msg_t::timeSrc2str) (enum ptpmgmt_timeSource_e type) |
Convert time source to string
[in] | type | time source |
const char*(* ptpmgmt_msg_t::tlv2str) (enum ptpmgmt_tlvType_e type) |
Convert TLV type to string
[in] | type |
bool(* ptpmgmt_msg_t::traversSigTlvs) (ptpmgmt_msg msg, void *cookie, ptpmgmt_msg_sig_callback callback) |
Traverse all last signalling message TLVs
[in,out] | msg | object |
[in] | cookie | pointer to a user cookie |
[in] | callback | function to call with each TLV |
const char*(* ptpmgmt_msg_t::ts2str) (enum ptpmgmt_linuxptpTimeStamp_e type) |
Convert linuxptp time stamp type to string
[in] | type | time stamp type |
const char*(* ptpmgmt_msg_t::type2str) (enum ptpmgmt_msgType_e type) |
Convert message type to string
[in] | type |
bool(* ptpmgmt_msg_t::updateParams) (ptpmgmt_msg msg, ptpmgmt_cpMsgParams prms) |
const char*(* ptpmgmt_msg_t::us2str) (enum ptpmgmt_linuxptpUnicastState_e state) |
Convert linuxptp master unicasy state to string
[in] | state |
bool(* ptpmgmt_msg_t::useAuth) (ptpmgmt_msg msg, const_ptpmgmt_safile sa, uint8_t spp, uint32_t key) |
Use the AUTHENTICATION TLV on send and receive, read SA file.
[in,out] | msg | object |
[in] | sa | reference to SA file object |
[in] | spp | ID to use to send |
[in] | key | ID to use to send |
bool(* ptpmgmt_msg_t::useAuth_cfg) (ptpmgmt_msg msg, const_ptpmgmt_cfg cfg, const char *section) |
Use the AUTHENTICATION TLV on send and receive read parameters from configuration file.
[in,out] | msg | object |
[in] | cfg | reference to configuration file object |
[in] | section | in configuration file |
bool(* ptpmgmt_msg_t::useConfig) (ptpmgmt_msg msg, const_ptpmgmt_cfg cfg, const char *section) |
Fetch MsgParams parameters from configuration file
[in,out] | msg | object |
[in] | cfg | reference to configuration file object |
[in] | section | in configuration file |
uint32_t(* ptpmgmt_msg_t::usedAuthKeyID) (const_ptpmgmt_msg msg) |
Get used AUTHENTICATION TLV key ID used for send.
[in] | msg | object |
int(* ptpmgmt_msg_t::usedAuthSppID) (const_ptpmgmt_msg msg) |