__init__function of your packet to store an extra argument. Have a look online. You can copy the signature of
__init__(*args, credentials=None, **kwargs). Remember to call super
Thanks Gabriel that is super useful !
One additionnal questions here:
Some of the fields within my packet are meant to be manipulated as "bytes field".
Is there a better field than
XNBytesField/NBytesField to manipulate them? By digging, I realize that
NBytesField internal representation is a large int. So comparing
self.fingerprint needs some sugar syntax to either:
c.hashto a NBytesField to make the comparison in the internal format
Oh, nevermind I was reading the doc and realized that XStrLenField is probably the field that I am looking for.
I think it would be worth mentioning "raw" or "raw bytes" in XStrLenField to make it more searchable.
RawPcapNgReader / read_packet(size=x), but without success