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
23 class CTFStringEncoding
:
41 # Based on the enum in ctf-writer/writer.h
51 BYTE_ORDER_LITTLE_ENDIAN
= 1
54 BYTE_ORDER_BIG_ENDIAN
= 2
56 #: Network byte order (big-endian)
57 BYTE_ORDER_NETWORK
= 3
60 BYTE_ORDER_UNKNOWN
= 4 # Python-specific entry
63 # enum equivalent, accessible constants
64 # These are taken directly from ctf/events.h
65 # All changes to enums must also be made here
68 CTF numeric type identifiers.
77 #: Floating point number
105 Returns the name of the CTF numeric type identifier *id*.
108 name
= "UNKNOWN_TYPE"
110 attr
for attr
in dir(CTFTypeId
) if not callable(
113 attr
)) and not attr
.startswith("__")]
115 for attr
in constants
:
116 if getattr(CTFTypeId
, attr
) == id:
129 TRACE_PACKET_HEADER
= 0
132 STREAM_PACKET_CONTEXT
= 1
135 STREAM_EVENT_HEADER
= 2
137 #: Stream event context
138 STREAM_EVENT_CONTEXT
= 3
146 def scope_name(scope
):
148 Returns the name of the CTF scope *scope*.
151 name
= "UNKNOWN_SCOPE"
153 attr
for attr
in dir(CTFScope
) if not callable(
156 attr
)) and not attr
.startswith("__")]
158 for attr
in constants
:
159 if getattr(CTFScope
, attr
) == scope
:
This page took 0.039434 seconds and 4 git commands to generate.