title: Any better code to define generic TLV initiatzed to different types
body: <p>Maybe more of this is object oriented programming based - </p>
  
  <p>defined a generic TLV as</p>
  
  <pre><code> class MYTLV(Packet):
         fields_desc = [
               ByteEnumField("type", 0x1, defaultTLV_enum),
               FieldLenField("length", None, fmt='B', length_of="value"),
               StrLenField("value", "ABCDEF", length_from=lambda x:x.length)
         ]
  </code></pre>
  
  <p>I have many TLV of same form but have different type.
  How can i have better code to reduce this in codes as</p>
  
  <pre><code>     class newTLV(MYTLV):
            some code to say or initiaze type field of this newTLV to newTLV_enum
       ....
  </code></pre>
  
  <p>So later I can use as -</p>
  
  <pre><code>     PacketListField('tlvlist', [], newTLV(fields.type=newTLV_enum))
  </code></pre>
  
  <p>All TLVs are same except for the dictionary for the type field.</p>
  
  <pre><code>    class MYTLV1(Packet):
         fields_desc = [
               ByteEnumField("type", 0x1, TLV1_enum),
               FieldLenField("length", None, fmt='B', length_of="value"),
               StrLenField("value", "ABCDEF", length_from=lambda x:x.length)
         ]
     class MYTLV2(Packet):
         fields_desc = [
               ByteEnumField("type", 0x1, TLV2_enum),
               FieldLenField("length", None, fmt='B', length_of="value"),
               StrLenField("value", "ABCDEF", length_from=lambda x:x.length)
         ]
  </code></pre>