Project

General

Profile

Feature #2901

Updated by Junxiao Shi almost 9 years ago

These two fields are optional for non-encrypted or uncompressed packet. 
 However, if a data packet is encrypted or compressed, they should be set accordingly. 

 Normally, encryption or compression is applied on data before segmentation, one may choose to just set those fields in the final block. 

 ``` 
 type MetaInfo struct { 
	 ContentType       uint64         `tlv:"24?"` 
	 FreshnessPeriod uint64         `tlv:"25?"` 
	 FinalBlockID      FinalBlockID `tlv:"26?"` 
	 EncryptionType    uint64         `tlv:"30?"` 
	 CompressionType uint64         `tlv:"31?"` 
 } 

 const ( 
	 CompressionTypeGZIP uint64 = 1 
 ) 

 const ( 
	 EncryptionTypeAESWithCTR uint64 = 1 
 ) 
 ```

Back