secdev / scapy

Scapy: the Python-based interactive packet manipulation program & library.
https://scapy.net
GNU General Public License v2.0
10.57k stars 2.01k forks source link

No interface for loading external layers #1540

Closed wasilukm closed 6 years ago

wasilukm commented 6 years ago

Currently (<=2.4.0) all layer extensions must be copied to scapy/layers and added to global config.py which makes distributing and using of external layers complicated.

Please add an interface which will allow scripts to load external layers to scapy scope or consider making _load() from main.py public.

guedou commented 6 years ago

The contrib mechanism is a possible way to go: copy your layer to scapy/contrib/ then call load_contrib().

It is seems to fit your need. Otherwise, please provide more example of your use case.

wasilukm commented 6 years ago

Thank you for the prompt answer. Your proposal looks reasonable. However I'm rather not able to fix all already existing extensions and their packages. Some of them are located in separate name space (not under scapy). Others like scapy-ssl_tls both uses own namespace and also (poorly so does not work in all cases) copies files to scapy.layers. So I was looking for a solution which will allow to load these extensions from any place. Currently I'm using private _load() which is ugly hack.

guedou commented 6 years ago

That's a good way to do it =)