14#ifndef __PTPMGMT_MSG_H
15#define __PTPMGMT_MSG_H
24__PTPMGMT_NAMESPACE_BEGIN
59 std::unique_ptr<BaseSigTlv> m_tlv;
99 std::vector<MessageSigTlv> m_tlvs;
103 bool m_lastSig =
false;
105 void clearToUse() { m_tlvs.clear(); m_lastSig =
true; }
114 std::vector<MessageSigTlv>::const_iterator it;
116 iterator(
const std::vector<MessageSigTlv>::const_iterator &it);
120 iterator &operator++();
121 iterator &operator++(
int);
123 bool operator!=(iterator &o);
225 uint16_t m_sequence = 0;
226 bool m_isUnicast =
true;
227 uint8_t m_PTPProfileSpecific = 0;
229 mng_vals_e m_replayTlv_id = NULL_PTP_MANAGEMENT;
230 uint32_t m_sdoId = 0;
233 uint8_t m_domainNumber = 0;
234 uint8_t m_versionPTP = 2;
235 uint8_t m_minorVersionPTP = 1;
239 std::unique_ptr<BaseMngTlv> m_dataGet;
245 uint32_t m_keyID = 0;
246 uint8_t m_sppID = -1;
248 bool m_haveAuth =
false;
249 std::unique_ptr<HMAC_Key> m_hmac;
262 bool checkReplyAction(uint8_t actionField);
275 ssize_t dataFieldSize(
const BaseMngTlv *tlv)
const;
485 bool caseSens =
true);
818__PTPMGMT_NAMESPACE_END
Buffer for send, receive, build, and parse.
Create and parse PTP management messages.
Read ptp4l Configuration file.
Hold configuration parameters.
Definition cfg.h:34
virtual bool callback(const Message &msg, tlvType_e tlvType, const BaseSigTlv *tlv)=0
const BaseSigTlv * tlv() const
MessageSigTlv(MessageSigTlv &&other)
tlvType_e tlvType() const
MessageSigTlv(const MessageSigTlv &other)
tlvType_e getType(size_t position) const
MessageSigTlvs(const MessageSigTlvs &other)
const BaseSigTlv * get(size_t position) const
bool traverse(const std::function< bool(const Message &msg, tlvType_e tlvType, const BaseSigTlv *tlv)> &callback) const
bool traverse(MessageSigTlvCallback &callback) const
const MessageSigTlv & getTlv(size_t position) const
MessageSigTlvs(MessageSigTlvs &&other)
const BaseMngTlv * getMngTlv(size_t position) const
mng_vals_e getTlvId(size_t position) const
Handle PTP management message.
Definition msg.h:215
const PortIdentity_t & getTarget() const
ssize_t getMsgPlanedLen() const
bool isLastMsgSMPTE() const
static const char * timeSrc2str_c(timeSource_e type)
const SaFile & getSa() const
bool useAuth(const SaFile &sa, uint8_t spp, uint32_t key)
static const char * type2str_c(msgType_e type)
bool isValidId(mng_vals_e id) const
actionField_e getReplyAction() const
static bool is_FTRA(uint8_t flags)
static const char * smpteLck2str_c(SMPTEmasterLockingStatus_e state)
static bool isEmpty(mng_vals_e id)
static const bool findPortState(const std::string &str, portState_e &state, bool caseSens=true)
uint8_t getPTPProfileSpecific() const
static bool is_TTRA(uint8_t flags)
MNG_PARSE_ERROR_e build(Buf &buf, uint16_t sequence)
const BaseSigTlv * getSigTlv(size_t position) const
bool useAuth(const ConfigFile &cfg, const std::string §ion="")
const std::string & getErrDisplay() const
tlvType_e getMngType() const
static const char * ts2str_c(linuxptpTimeStamp_e type)
bool traversSigTlvs(const std::function< bool(const Message &msg, tlvType_e tlvType, const BaseSigTlv *tlv)> callback) const
mng_vals_e getTlvId() const
size_t getSigTlvsCount() const
MNG_PARSE_ERROR_e parse(const void *buf, ssize_t msgSize)
static const char * err2str_c(MNG_PARSE_ERROR_e err)
uint8_t getDomainNumber() const
actionField_e getSendAction() const
MNG_PARSE_ERROR_e parse(const Buf &buf, ssize_t msgSize)
bool updateParams(const MsgParams &prms)
static const char * act2str_c(actionField_e action)
static bool is_LI_59(uint8_t flags)
uint8_t getMinorVersionPTP() const
static const bool findTimeSrc(const std::string &str, timeSource_e &type, bool exact=true)
uint8_t getVersionPTP() const
tlvType_e getSigTlvType(size_t position) const
static const char * clockAcc2str_c(clockAccuracy_e value)
static const char * pwr2str_c(linuxptpPowerProfileVersion_e ver)
bool changeAuth(uint8_t spp, uint32_t key)
static const char * tlv2str_c(tlvType_e type)
uint32_t usedAuthKeyID() const
static const char * delayMech2str_c(delayMechanism_e type)
const BaseMngTlv * getSigMngTlv(size_t position) const
static const char * netProt2str_c(networkProtocol_e protocol)
managementErrorId_e getErrId() const
mng_vals_e getBuildTlvId() const
MNG_PARSE_ERROR_e build(void *buf, size_t bufSize, uint16_t sequence)
bool isLastMsgSig() const
const MessageSigTlvs & getSigTlvs() const
bool traversSigTlvsCl(MessageSigTlvCallback &callback) const
bool useConfig(const ConfigFile &cfg, const std::string §ion="")
const BaseMngTlv * getSendData() const
mng_vals_e getSigMngTlvType(size_t position) const
static bool is_UTCV(uint8_t flags)
static const bool findDelayMech(const std::string &str, delayMechanism_e &type, bool exact=true)
static const char * portState2str_c(portState_e state)
const char * getErrDisplay_c() const
Message(const MsgParams &prms)
static const char * errId2str_c(managementErrorId_e err)
static bool is_PTP(uint8_t flags)
static const char * mng2str_c(mng_vals_e id)
static const char * clkType2str_c(clockType_e type)
static bool is_LI_61(uint8_t flags)
const PortIdentity_t & getPeer() const
bool changeAuth(uint32_t key)
const MsgParams & getParams() const
static const char * faultRec2str_c(faultRecord_e code)
static const char * us2str_c(linuxptpUnicastState_e state)
uint16_t getSequence() const
int usedAuthSppID() const
msgType_e getType() const
bool setAction(actionField_e actionField, mng_vals_e tlv_id, const BaseMngTlv *dataSend=nullptr)
const BaseMngTlv * getData() const
static const bool findMngID(const std::string &str, mng_vals_e &id, bool exact=true)
uint32_t getSdoId() const
authentication security association file
Definition cfg.h:308
mng_vals_e
Management TLVs ID.
Definition mngIds.h:29
PTP management TLV structures.
PTP signalling TLV structures.
clockAccuracy_e
Definition types.h:229
managementErrorId_e
Definition types.h:199
linuxptpTimeStamp_e
Definition types.h:347
msgType_e
Definition types.h:114
@ 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