1 # The MIT License (MIT)
3 # Copyright (c) 2013-2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
5 # Permission is hereby granted, free of charge, to any person obtaining a copy
6 # of this software and associated documentation files (the "Software"), to deal
7 # in the Software without restriction, including without limitation the rights
8 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 # copies of the Software, and to permit persons to whom the Software is
10 # furnished to do so, subject to the following conditions:
12 # The above copyright notice and this permission notice shall be included in
13 # all copies or substantial portions of the Software.
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 class CTFStringEncoding
:
42 # Based on the enum in ctf-writer/writer.h
52 BYTE_ORDER_LITTLE_ENDIAN
= 1
55 BYTE_ORDER_BIG_ENDIAN
= 2
57 #: Network byte order (big-endian)
58 BYTE_ORDER_NETWORK
= 3
61 BYTE_ORDER_UNKNOWN
= 4 # Python-specific entry
64 # enum equivalent, accessible constants
65 # These are taken directly from ctf/events.h
66 # All changes to enums must also be made here
69 CTF numeric type identifiers.
78 #: Floating point number
106 Returns the name of the CTF numeric type identifier *id*.
109 name
= "UNKNOWN_TYPE"
111 attr
for attr
in dir(CTFTypeId
) if not callable(
114 attr
)) and not attr
.startswith("__")]
116 for attr
in constants
:
117 if getattr(CTFTypeId
, attr
) == id:
130 TRACE_PACKET_HEADER
= 0
133 STREAM_PACKET_CONTEXT
= 1
136 STREAM_EVENT_HEADER
= 2
138 #: Stream event context
139 STREAM_EVENT_CONTEXT
= 3
147 def scope_name(scope
):
149 Returns the name of the CTF scope *scope*.
152 name
= "UNKNOWN_SCOPE"
154 attr
for attr
in dir(CTFScope
) if not callable(
157 attr
)) and not attr
.startswith("__")]
159 for attr
in constants
:
160 if getattr(CTFScope
, attr
) == scope
:
This page took 0.045284 seconds and 4 git commands to generate.