Lines Matching defs:tlv

36 uint8_t *TlvUtils::ParseTlv(const uint8_t *buffer, TlvCommon *tlv, const uint8_t *boundary, uint32_t *retCode)
46 tlv->tag_ = (reinterpret_cast<TlvCommon *>(const_cast<uint8_t *>(buffer)))->tag_;
47 tlv->len_ = (reinterpret_cast<TlvCommon *>(const_cast<uint8_t *>(buffer)))->len_;
48 tlv->value_ = const_cast<uint8_t *>(buffer) + TLV_TLV_HEAD_LEN;
53 uint8_t *TlvUtils::AppendTlv(uint8_t *buffer, const TlvCommon *tlv, const uint8_t *boundary, uint32_t *retCode)
63 (reinterpret_cast<TlvCommon *>(const_cast<uint8_t *>(buffer)))->tag_ = tlv->tag_;
64 (reinterpret_cast<TlvCommon *>(const_cast<uint8_t *>(buffer)))->len_ = tlv->len_;
65 if (tlv->len_ != 0 && tlv->value_ != nullptr) {
66 if (memcpy_s(buffer + TLV_TLV_HEAD_LEN, boundary - buffer - TLV_TLV_HEAD_LEN, tlv->value_, tlv->len_) !=
76 uint32_t TlvUtils::Serialize(const TlvCommon *tlv, uint32_t tlvCount, uint8_t *buff, uint32_t maxBuffSize,
79 if (tlv == nullptr || buff == nullptr || buffSize == nullptr) {
87 curr = AppendTlv(curr, &tlv[index], boundary, &retCode);
96 uint32_t TlvUtils::Deserialize(const uint8_t *buff, uint32_t buffSize, TlvCommon *tlv, uint32_t maxTlvCount,
99 if (tlv == nullptr || buff == nullptr || tlvCount == nullptr) {
112 msg = ParseTlv(msg, &tlv[index], boundary, &retCode);
199 NETSTACK_LOGE("tlv encode malloc tlvList failed");
211 NETSTACK_LOGE("tlv encode malloc data failed");
220 NETSTACK_LOGI("tlv encode finished. code=%{public}u", ret);
227 NETSTACK_LOGE("tlv decode invalid params");
232 NETSTACK_LOGE("tlv decode malloc tlvList failed");
242 NETSTACK_LOGI("tlv decode finished. code=%{public}u", ret);