Add T-Tag placeholder in sign protocol

This commit is contained in:
Srivats P 2023-03-16 11:30:02 +05:30
parent ebccc44cdf
commit 8e25669a0e
2 changed files with 29 additions and 0 deletions

View File

@ -77,6 +77,7 @@ AbstractProtocol::FieldFlags SignProtocol::fieldFlags(int index) const
{
case sign_magic:
case sign_tlv_guid:
case sign_tlv_ttag:
case sign_tlv_end:
break;
@ -116,6 +117,29 @@ QVariant SignProtocol::fieldData(int index, FieldAttrib attrib,
}
break;
}
case sign_tlv_ttag:
{
switch(attrib)
{
case FieldName:
return QString("T-Tag");
case FieldValue:
return 0;
case FieldTextValue:
return QString("%1").arg(0);
case FieldFrameValue:
{
QByteArray fv;
fv.resize(2);
fv[0] = 0;
fv[1] = kTypeLenTtagPlaceholder;
return fv;
}
default:
break;
}
break;
}
case sign_tlv_guid:
{
quint32 guid = data.stream_guid() & 0xFFFFFF;

View File

@ -42,6 +42,8 @@ TLVs are encoded as
Defined TLVs
Type = 0, Len = 0 (0x00): End of TLVs
Type = 1, Len = 3 (0x61): Stream GUID
Type = 2, Len = 1 (0x22): T-Tag Placeholder (0 value)
Type = 3, Len = 1 (0x23): T-Tag with actual value
*/
class SignProtocol : public AbstractProtocol
@ -52,6 +54,7 @@ public:
// Frame Fields
sign_tlv_end = 0,
sign_tlv_guid,
sign_tlv_ttag,
sign_magic,
// Meta Fields
@ -88,6 +91,8 @@ private:
static const quint32 kSignMagic = 0x1d10c0da; // coda! (unicode - 0x1d10c)
static const quint8 kTypeLenEnd = 0x00;
static const quint8 kTypeLenGuid = 0x61;
static const quint8 kTypeLenTtagPlaceholder = 0x22;
static const quint8 kTypeLenTtag = 0x23;
OstProto::Sign data;
};