Conversation
polydroi
left a comment
There was a problem hiding this comment.
Thanks for your contribution to Scapy.
|
|
||
| Original code by: Copyright 2014-2016 N.R Rodofile | ||
|
|
||
| Licensed under the GPLv3. |
There was a problem hiding this comment.
Please adapt the license to gplv2 only
| fields_desc = [ | ||
| BitEnumField("DIR", MASTER, 1, stations), # 9.2.4.1.3.1 DIR bit field | ||
| BitEnumField("PRM", MASTER, 1, stations), # 9.2.4.1.3.2 PRM bit field | ||
| ConditionalField(cond_field[0], lambda x: x.PRM == MASTER), |
There was a problem hiding this comment.
This cond_field array is not very readable, I suggest to directly add the fields here
| chunk_len = 18 | ||
| data_chunk_len = 16 | ||
|
|
||
| # def show_data_chunks(self): |
| if CRC != self.CRC: | ||
| pkt = pkt[:-2] + struct.pack("H", CRC) | ||
|
|
||
| self.data_chunks = [] |
There was a problem hiding this comment.
I’m not familiar with this protocol, but maybe it would make sense to introduce a chunk packet and add a PaketListField of chunk fields to DNP3 fields at the end.
|
|
||
| ############ | ||
| ############ | ||
| + DNP3 |
There was a problem hiding this comment.
Could you please add more unit test, especially for the chunk handling
There was a problem hiding this comment.
Sure, thank you for the guidance.
I would just to say that the original author of the module wrote it under GPLv3, I am not sure if I can just change it to GPLv2 - can you clarify if it is ok?
Checklist:
Sorry I am not show how to do this, some guidance?
Not sure if it is needed here or not - this is a new contrib protocol - should I add PCAP ? or something like
s = raw(IP()...)?tox)--
This PR will introduce DNP3 support to scapy, it was done about 9 years ago: https://github.com/nrodofile/ScapyDNP3_lib but never integrated (unknown reason)