MCPcopy Index your code
hub / github.com/secdev/scapy / load_contrib

Function load_contrib

scapy/main.py:350–369  ·  view source on GitHub ↗

Loads a Scapy contrib module to make variables, objects and functions available globally. If no contrib module can be found with the given name, try to find a layer module, since a contrib module may become a layer module.

(name, globals_dict=None, symb_list=None)

Source from the content-addressed store, hash-verified

348
349
350def load_contrib(name, globals_dict=None, symb_list=None):
351 # type: (str, Optional[Dict[str, Any]], Optional[List[str]]) -> None
352 """Loads a Scapy contrib module to make variables, objects and
353 functions available globally.
354
355 If no contrib module can be found with the given name, try to find
356 a layer module, since a contrib module may become a layer module.
357
358 """
359 try:
360 importlib.import_module("scapy.contrib." + name)
361 _load("scapy.contrib." + name,
362 globals_dict=globals_dict, symb_list=symb_list)
363 except ImportError as e:
364 # if layer not found in contrib, try in layers
365 try:
366 load_layer(name,
367 globals_dict=globals_dict, symb_list=symb_list)
368 except ImportError:
369 raise e # Let's raise the original error to avoid confusion
370
371
372def list_contrib(name=None, # type: Optional[str]

Callers 2

exploreFunction · 0.90

Calls 2

_loadFunction · 0.85
load_layerFunction · 0.85

Tested by

no test coverage detected