NewLionwang / dpkt

Automatically exported from code.google.com/p/dpkt
Other
0 stars 0 forks source link

please set the 'data' fields in BGP-4 ASPath objects, for pretty-printing #42

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
ASPath objects accepts an ASPathSegment object in its 'segments' field. 
However, this field is not printed when representing the object. Only the 
'data' field is printed.
When an object is decoded, the 'data' field is set to the value of the 
'segments' field, so it is represented correctly, but it's not the case when an 
object is created in code.
Same problem in ASPathSegment: the 'data' field should be set to the value of 
the 'path' field.

As a workaround, I have to set the 'data' fields manually, after creating the 
objects:
for a in paths:  # ASPath objects
  a.data = a.segments
  for s in a.segments:  # ASPathSegment objects
    s.data = s.path

Please do that automatically, or use the 'segments' and 'path' fields to 
represent those objects, instead of the 'data' fields.

This is not essential, but very useful for debugging.

Original issue reported on code.google.com by lengletr...@googlemail.com on 5 Aug 2010 at 3:05

GoogleCodeExporter commented 8 years ago
More important, the ASPath and ASPathSegment objects only encode their 'data' 
fields instead of their 'segments' and 'path' fields. So setting the 'data' 
fields is necessary for the objects to encode correctly.

Original comment by lengletr...@googlemail.com on 5 Aug 2010 at 3:06