Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/scapy/layers/all.py: 75%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

20 statements  

1# SPDX-License-Identifier: GPL-2.0-only 

2# This file is part of Scapy 

3# See https://scapy.net/ for more information 

4# Copyright (C) Philippe Biondi <phil@secdev.org> 

5 

6""" 

7All layers. Configurable with conf.load_layers. 

8""" 

9 

10 

11import builtins 

12import logging 

13 

14# We import conf from arch to make sure arch specific layers are populated 

15from scapy.arch import conf 

16from scapy.error import log_loading 

17from scapy.main import load_layer 

18 

19ignored = list(builtins.__dict__) + ["sys"] 

20log = logging.getLogger("scapy.loading") 

21 

22__all__ = [] 

23 

24for _l in conf.load_layers: 

25 log_loading.debug("Loading layer %s", _l) 

26 try: 

27 load_layer(_l, globals_dict=globals(), symb_list=__all__) 

28 except Exception as e: 

29 log.warning("can't import layer %s: %s", _l, e) 

30 

31try: 

32 del _l 

33except NameError: 

34 pass