Project

General

Profile

Actions

Task #2021

closed

Extend MetaInfo abstraction to allow application-specific TLVs

Added by Alex Afanasyev about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Base
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

Description

This change does not (strictly speaking) violate the protocol, rather than just extends what MetaInfo block holds.

Interface for this extension:

partial MetaInfo {
  /**
   * @brief Get all app-defined MetaInfo items
   */
  const std::list<Block>&
  getAppMetaInfo() const;

  /**
   * @brief Set app-defined MetaInfo items
   *
   * This method will replace all existing app-defined MetaInfo items, if they existed.
   */
  MetaInfo&
  setAppMetaInfo(const std::list<Block>& info);

  /**
   * @brief Add an app-defined MetaInfo item
   *
   * Note that only one
   */
  MetaInfo&
  addAppMetaInfo(const Block& block);

  /**
   * @brief Remove a first app-defined MetaInfo item with type @param tlvType
   *
   * @return true if an item was deleted
   */
  bool
  removeAppMetaInfo(uint32_t tlvType);

  /**
   * @brief Find a first app-defined MetaInfo item of type @param tlvType
   *
   * @return NULL if an item is not found, otherwise const pointer to the item
   */
  const Block*
  findAppMetaInfo(uint32_t tlvType) const;
};
Actions #1

Updated by Junxiao Shi about 10 years ago

This feature is violating the protocol:

MetaInfo ::= META-INFO-TYPE TLV-LENGTH
               ContentType?
               FreshnessPeriod?
               FinalBlockId?

MetaInfo definition does not permit any other TLV except those in the definition, and TLV structure does not permit arbitrary elements to be injected.

In addition, I disagree with allowing application-specific elements in MetaInfo.

Those elements need not be understood by the network, so they can be placed as part of Content.

Actions #2

Updated by Junxiao Shi about 10 years ago

  • Start date deleted (10/02/2014)

20141003 conference call agrees to go with this feature for experiment only.

It may be merged to master under the following conditions:

  • Application-specific TLVs can appear at the back of MetaInfo. TLV-TYPE must be in application range.
  • On the APIs, mark: "\note Warning: This API is not finalized; it may change or disappear in the future."
  • lazy decoding: don't decode until application-specific TLVs are needed.
Actions #3

Updated by Alex Afanasyev about 10 years ago

  • Status changed from Code review to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF