14 #ifndef __PTPMGMT_MSG_H
15 #define __PTPMGMT_MSG_H
24 __PTPMGMT_NAMESPACE_BEGIN
74 uint16_t m_sequence = 0;
75 bool m_isUnicast =
true;
76 uint8_t m_PTPProfileSpecific = 0;
78 mng_vals_e m_replayTlv_id = NULL_PTP_MANAGEMENT;
82 uint8_t m_domainNumber = 0;
83 uint8_t m_versionPTP = 2;
84 uint8_t m_minorVersionPTP = 1;
86 std::vector<std::unique_ptr<BaseSigTlv>> m_sigTlvs;
88 std::vector<tlvType_e> m_sigTlvsType;
90 std::unique_ptr<BaseMngTlv> m_dataGet;
99 bool m_haveAuth =
false;
100 HMAC_Key *m_hmac =
nullptr;
116 bool checkReplyAction(uint8_t actionField);
128 ssize_t dataFieldSize(
const BaseMngTlv *data)
const;
338 bool caseSens =
true);
401 static bool is_PTP(uint8_t flags) {
return (flags &
F_PTP) != 0; }
667 __PTPMGMT_NAMESPACE_END
Buffer for send, receive, build, and parse.
C interface to configuration class.
Create and parse PTP management messages.
PTP management TLV structures.
PTP signalling TLV structures.
size_t size() const
Definition: buf.h:58
void * get() const
Definition: buf.h:48
Hold configuration parameters.
Definition: cfg.h:89
Abstract class used for callback for Signalling TLVs traverse.
Definition: msg.h:35
virtual bool callback(const Message &msg, tlvType_e tlvType, const BaseSigTlv *tlv)=0
Handle PTP management message.
Definition: msg.h:58
const PortIdentity_t & getTarget() const
Definition: msg.h:538
ssize_t getMsgPlanedLen() const
bool isValidId(mng_vals_e id)
bool isLastMsgSMPTE() const
const PortIdentity_t & getPeer() const
Definition: msg.h:533
bool useAuth(const SaFile &sa, uint8_t spp, uint32_t key)
static const char * portState2str_c(portState_e state)
actionField_e getReplyAction() const
Definition: msg.h:512
static bool is_FTRA(uint8_t flags)
Definition: msg.h:413
static const char * err2str_c(MNG_PARSE_ERROR_e err)
static bool isEmpty(mng_vals_e id)
static const char * ts2str_c(linuxptpTimeStamp_e type)
static const bool findPortState(const std::string &str, portState_e &state, bool caseSens=true)
uint8_t getPTPProfileSpecific() const
Definition: msg.h:523
static bool is_TTRA(uint8_t flags)
Definition: msg.h:407
MNG_PARSE_ERROR_e build(Buf &buf, uint16_t sequence)
Definition: msg.h:471
bool useAuth(const ConfigFile &cfg, const std::string §ion="")
tlvType_e getMngType() const
Definition: msg.h:615
const std::string & getErrDisplay() const
Definition: msg.h:588
bool traversSigTlvs(const std::function< bool(const Message &msg, tlvType_e tlvType, const BaseSigTlv *tlv)> callback) const
mng_vals_e getTlvId() const
Definition: msg.h:216
size_t getSigTlvsCount() const
MNG_PARSE_ERROR_e parse(const void *buf, ssize_t msgSize)
uint8_t getDomainNumber() const
Definition: msg.h:549
actionField_e getSendAction() const
Definition: msg.h:477
MNG_PARSE_ERROR_e parse(const Buf &buf, ssize_t msgSize)
static const char * us2str_c(linuxptpUnicastState_e state)
bool updateParams(const MsgParams &prms)
static const char * timeSrc2str_c(timeSource_e type)
static bool is_LI_59(uint8_t flags)
Definition: msg.h:389
uint8_t getMinorVersionPTP() const
Definition: msg.h:559
static const bool findTimeSrc(const std::string &str, timeSource_e &type, bool exact=true)
uint8_t getVersionPTP() const
Definition: msg.h:554
static const char * act2str_c(actionField_e action)
static const char * pwr2str_c(linuxptpPowerProfileVersion_e ver)
static const char * faultRec2str_c(faultRecord_e code)
tlvType_e getSigTlvType(size_t position) const
bool changeAuth(uint8_t spp, uint32_t key)
uint32_t usedAuthKeyID() const
Definition: msg.h:201
static const char * mng2str_c(mng_vals_e id)
managementErrorId_e getErrId() const
Definition: msg.h:582
mng_vals_e getBuildTlvId() const
Definition: msg.h:221
static const char * netProt2str_c(networkProtocol_e protocol)
const BaseMngTlv * getSigMngTlv(size_t position) const
static const char * errId2str_c(managementErrorId_e err)
MNG_PARSE_ERROR_e build(void *buf, size_t bufSize, uint16_t sequence)
const BaseSigTlv * getSigTlv(size_t position) const
bool isLastMsgSig() const
Definition: msg.h:599
static const char * smpteLck2str_c(SMPTEmasterLockingStatus_e state)
bool useConfig(const ConfigFile &cfg, const std::string §ion="")
mng_vals_e getSigMngTlvType(size_t position) const
static bool is_UTCV(uint8_t flags)
Definition: msg.h:395
static const bool findDelayMech(const std::string &str, delayMechanism_e &type, bool exact=true)
const char * getErrDisplay_c() const
Definition: msg.h:594
const BaseMngTlv * getSendData() const
Definition: msg.h:576
Message(const MsgParams &prms)
static const char * clkType2str_c(clockType_e type)
static bool is_PTP(uint8_t flags)
Definition: msg.h:401
static const char * type2str_c(msgType_e type)
bool haveAuth() const
Definition: msg.h:211
static bool is_LI_61(uint8_t flags)
Definition: msg.h:383
size_t getMsgLen() const
Definition: msg.h:482
bool changeAuth(uint32_t key)
const MsgParams & getParams() const
Definition: msg.h:151
static const char * clockAcc2str_c(clockAccuracy_e value)
bool isUnicast() const
Definition: msg.h:517
uint16_t getSequence() const
Definition: msg.h:528
int usedAuthSppID() const
Definition: msg.h:196
msgType_e getType() const
Definition: msg.h:609
bool traversSigTlvsCl(MessageSigTlvCallback &callback)
static const char * delayMech2str_c(delayMechanism_e type)
bool setAction(actionField_e actionField, mng_vals_e tlv_id, const BaseMngTlv *dataSend=nullptr)
static const bool findMngID(const std::string &str, mng_vals_e &id, bool exact=true)
const BaseMngTlv * getData() const
Definition: msg.h:567
uint32_t getSdoId() const
Definition: msg.h:544
const SaFile & getSa() const
Definition: msg.h:206
static const char * tlv2str_c(tlvType_e type)
bool disableAuth()
Definition: msg.h:191
authentication security association file
Definition: cfg.h:315
mng_vals_e
Management TLVs ID.
Definition: mngIds.h:29
const char * string() const
Definition: types.h:846
std::string textField
Definition: types.h:836
clockAccuracy_e
Definition: types.h:229
managementErrorId_e
Definition: types.h:199
@ F_TTRA
Definition: types.h:389
@ F_FTRA
Definition: types.h:392
@ F_UTCV
Definition: types.h:385
@ F_LI_61
Definition: types.h:381
@ F_PTP
Definition: types.h:387
@ F_LI_59
Definition: types.h:383
linuxptpTimeStamp_e
Definition: types.h:347
msgType_e
Definition: types.h:114
@ Signaling
Definition: types.h:134
@ Management
Definition: types.h:136
implementSpecific_e
Definition: types.h:322
delayMechanism_e
Definition: types.h:299
tlvType_e
Definition: types.h:142
@ MANAGEMENT
Definition: types.h:144
portState_e
Definition: types.h:284
SMPTEmasterLockingStatus_e
Definition: types.h:327
linuxptpUnicastState_e
Definition: types.h:372
actionField_e
Definition: types.h:191
@ GET
Definition: types.h:192
@ RESPONSE
Definition: types.h:194
linuxptpPowerProfileVersion_e
Definition: types.h:363
networkProtocol_e
Definition: types.h:220
MNG_PARSE_ERROR_e
Definition: types.h:71
faultRecord_e
Definition: types.h:260
clockType_e
Definition: types.h:212
timeSource_e
Definition: types.h:271