Thread: Encoding a data structure based on TLV encoding

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    13

    Arrow Encoding a data structure based on TLV encoding

    I have to encode the parameters present inside a structure based on X.690 encoding.
    Suppose, my structure is:
    Code:
    struct Data_Struct
       {
          parameter1
          parameter2
          parameter3
       }
    Some or all of these parameter may be having valid data, say, parameter1 and parameter3.
    Then I am supposed to encode only parameter1 and parameter3 using TLV encoding.
    Do I have to follow a sequencial procedure to follow this. Like,


    Code:
    Check whether parameter 1 is present
        If present, find the tag of the parameter from a lookup table and encode it
    Check whether parameter 2 is present
        If present, find the tag of the parameter from a lookup table and encode it
    Check whether parameter 3 is present
        If present, find the tag of the parameter from a lookup table and encode it

    As the procedure is repetative can I modularize it? What will be the best way to do it? Is there any way to access the parameters sequentially? How can I have a relationship between the parameter and it's tag? Length of the value is variable.
    Last edited by Sajas K K; 02-14-2013 at 12:24 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to convert string in url encoding to html encoding?
    By Jerel2k11 in forum C Programming
    Replies: 6
    Last Post: 11-06-2011, 09:05 AM
  2. Encoding
    By /dev/bag in forum Linux Programming
    Replies: 1
    Last Post: 06-05-2011, 02:08 PM
  3. HUffman encoding(data compression)
    By jia in forum C++ Programming
    Replies: 4
    Last Post: 06-01-2010, 03:44 PM
  4. Encoding data in 7 bit words, need some ideas.
    By Subsonics in forum C Programming
    Replies: 7
    Last Post: 01-18-2009, 11:44 AM
  5. Encoding
    By gvector1 in forum C# Programming
    Replies: 0
    Last Post: 06-20-2003, 10:17 AM

Tags for this Thread