ValentinBELYN / icmplib

Easily forge ICMP packets and make your own ping and traceroute.
GNU Lesser General Public License v3.0
266 stars 46 forks source link

Separate parsing from sockets #50

Open KOLANICH opened 2 years ago

KOLANICH commented 2 years ago

I have some packets as bytes and want to analyse them. I also want to generate them as bytes. Currently it is done within the classes for sockets, but they are tied to network functions.

It is proposed to move the parsing and serialization code into .models and add the 2 methods, __bytes__ and from_bytes.

ValentinBELYN commented 2 years ago

Hi @KOLANICH!

You are right. I have already thought about it several times but until now, the fact of putting the logic at the level of the sockets allowed me to multualize certain variables and portions of code.

I'll try to change that as part of the next major update. However, I have a lot of projects to finish before :D