Skip to content

Commit c4064de

Browse files
polybassaNils Weiss
andauthored
Add CBOR fields (cborfields.py, cborpacket.py) and tests (#4958)
* Add CBOR fields (cborfields.py, cborpacket.py) and tests * Remove unused CBOR fields and codecs from cborfields.py --------- Co-authored-by: Nils Weiss <nils.weiss@dissecto.com>
1 parent 2e7c97f commit c4064de

File tree

4 files changed

+3967
-0
lines changed

4 files changed

+3967
-0
lines changed

scapy/cbor/__init__.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,26 @@
4444
CBORcodec_SIMPLE_AND_FLOAT,
4545
)
4646

47+
from scapy.cbor.cborfields import (
48+
CBORF_element,
49+
CBORF_field,
50+
CBORF_UNSIGNED_INTEGER,
51+
CBORF_NEGATIVE_INTEGER,
52+
CBORF_INTEGER,
53+
CBORF_BYTE_STRING,
54+
CBORF_TEXT_STRING,
55+
CBORF_BOOLEAN,
56+
CBORF_NULL,
57+
CBORF_UNDEFINED,
58+
CBORF_FLOAT,
59+
CBORF_ARRAY,
60+
CBORF_ARRAY_OF,
61+
CBORF_MAP,
62+
CBORF_SEMANTIC_TAG,
63+
CBORF_optional,
64+
CBORF_PACKET,
65+
)
66+
4767
__all__ = [
4868
# Exceptions
4969
"CBOR_Error",
@@ -81,4 +101,25 @@
81101
"CBORcodec_MAP",
82102
"CBORcodec_SEMANTIC_TAG",
83103
"CBORcodec_SIMPLE_AND_FLOAT",
104+
# Field base classes
105+
"CBORF_element",
106+
"CBORF_field",
107+
# Scalar fields
108+
"CBORF_UNSIGNED_INTEGER",
109+
"CBORF_NEGATIVE_INTEGER",
110+
"CBORF_INTEGER",
111+
"CBORF_BYTE_STRING",
112+
"CBORF_TEXT_STRING",
113+
"CBORF_BOOLEAN",
114+
"CBORF_NULL",
115+
"CBORF_UNDEFINED",
116+
"CBORF_FLOAT",
117+
# Structured fields
118+
"CBORF_ARRAY",
119+
"CBORF_ARRAY_OF",
120+
"CBORF_MAP",
121+
"CBORF_SEMANTIC_TAG",
122+
# Complex fields
123+
"CBORF_optional",
124+
"CBORF_PACKET",
84125
]

0 commit comments

Comments
 (0)