Fix lldp org specific dissection clean #1151#1154
Conversation
required to show the names of the organizations used in LLDP org specific TLVs
implements generic encoding of org specific TLVs and dumps the payload as hex-string
guedou
left a comment
There was a problem hiding this comment.
Thanks for this PR. Please see my comments.
| def guess_payload_class(self, payload): | ||
| # type is a 7-bit bitfield spanning bits 1..7 -> div 2 | ||
| lldpdu_tlv_type = orb(payload[0]) // 2 | ||
| return LLDPDU_CLASS_TYPES[lldpdu_tlv_type] |
There was a problem hiding this comment.
Use this instead:
return LLDPDU_CLASS_TYPES.get(lldpdu_tlv_type, Raw)
There was a problem hiding this comment.
May I suggest to use conf.raw_layer instead?
There was a problem hiding this comment.
while reading more code that forms the basement of scapy I came across default_payload_class() in class packet . should/could this be used here instead of
conf.raw_layer or would this generate to much indirection, abstraction, ... ?
| return lhex(x) | ||
|
|
||
|
|
||
| class ThreeBytesEnumField(EnumField, ThreeBytesField): |
There was a problem hiding this comment.
Keep it lldp.uts as it not used elsewhere.
There was a problem hiding this comment.
uhm.. did you mean test or test & code?
Codecov Report
@@ Coverage Diff @@
## master #1154 +/- ##
==========================================
+ Coverage 83.47% 84.05% +0.57%
==========================================
Files 157 159 +2
Lines 37855 38225 +370
==========================================
+ Hits 31599 32129 +530
+ Misses 6256 6096 -160
|
as it is not used yet anywhere else.
fixes #1151