actf 0.0.1
An acute CTF reader
Loading...
Searching...
No Matches
/home/adwe/code/actf/fld_cls.h
Go to the documentation of this file.
1/*
2 * This file is a part of ACTF.
3 *
4 * Copyright (C) 2024 Adam Wendelin <adwe live se>
5 *
6 * ACTF is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * ACTF is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
14 * Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with ACTF. If not, see
18 * <https://www.gnu.org/licenses/>.
19 */
20
25#ifndef ACTF_FLD_CLS_H
26#define ACTF_FLD_CLS_H
27
28#include "flags.h"
29#include "fld_loc.h"
30#include "mappings.h"
31#include "rng.h"
32#include "types.h"
33
34
38 ACTF_ROLE_NIL = 0,
39 ACTF_ROLE_DSTREAM_CLS_ID = (1 << 0),
40 ACTF_ROLE_DSTREAM_ID = (1 << 1),
41 ACTF_ROLE_PKT_MAGIC_NUM = (1 << 2),
42 ACTF_ROLE_METADATA_STREAM_UUID = (1 << 3),
43 ACTF_ROLE_DEF_CLK_TSTAMP = (1 << 4),
44 ACTF_ROLE_DISC_EVENT_CNT_SNAPSHOT = (1 << 5),
45 ACTF_ROLE_PKT_CONTENT_LEN = (1 << 6),
46 ACTF_ROLE_PKT_END_DEF_CLK_TSTAMP = (1 << 7),
47 ACTF_ROLE_PKT_SEQ_NUM = (1 << 8),
48 ACTF_ROLE_PKT_TOT_LEN = (1 << 9),
49 ACTF_ROLE_EVENT_CLS_ID = (1 << 10),
50};
51
54 ACTF_FLD_CLS_NIL,
55 ACTF_FLD_CLS_FXD_LEN_BIT_ARR,
56 ACTF_FLD_CLS_FXD_LEN_BIT_MAP,
57 ACTF_FLD_CLS_FXD_LEN_UINT,
58 ACTF_FLD_CLS_FXD_LEN_SINT,
59 ACTF_FLD_CLS_FXD_LEN_BOOL,
60 ACTF_FLD_CLS_FXD_LEN_FLOAT,
61 ACTF_FLD_CLS_VAR_LEN_UINT,
62 ACTF_FLD_CLS_VAR_LEN_SINT,
63 ACTF_FLD_CLS_NULL_TERM_STR,
64 ACTF_FLD_CLS_STATIC_LEN_STR,
65 ACTF_FLD_CLS_DYN_LEN_STR,
66 ACTF_FLD_CLS_STATIC_LEN_BLOB,
67 ACTF_FLD_CLS_DYN_LEN_BLOB,
68 ACTF_FLD_CLS_STRUCT,
69 ACTF_FLD_CLS_STATIC_LEN_ARR,
70 ACTF_FLD_CLS_DYN_LEN_ARR,
71 ACTF_FLD_CLS_OPTIONAL,
72 ACTF_FLD_CLS_VARIANT,
73 ACTF_N_FLD_CLSES,
74};
75
82
107
125
143
162
175
191
207
222
237
251
266
281
294
308const char *actf_fld_cls_members_name_idx(const actf_fld_cls *fc, size_t i);
309
324
339
354
368
382
397
409
422
436const char *actf_fld_cls_options_name_idx(const actf_fld_cls *fc, size_t i);
437
452
467
482
497
506
516
526
527#endif /* ACTF_FLD_CLS_H */
Bit map flags related methods.
struct actf_flags actf_flags
Flags map names to bit index range sets.
Definition flags.h:34
const actf_fld_loc * actf_fld_cls_len_fld_loc(const actf_fld_cls *fc)
Get the field location denoting length of the field class.
actf_role
The possible roles of a field class.
Definition fld_cls.h:37
const actf_rng_set * actf_fld_cls_options_selector_rng_set_idx(const actf_fld_cls *fc, size_t i)
Get the selector range set of the option with the specified index of the variant field class.
const actf_fld * actf_fld_cls_members_attributes_idx(const actf_fld_cls *fc, size_t i)
Get the attributes of the member with the specified index of the struct field class.
size_t actf_fld_cls_options_len(const actf_fld_cls *fc)
Get the number of options of the variant field class.
const actf_fld * actf_fld_cls_members_extensions_idx(const actf_fld_cls *fc, size_t i)
Get the extensions of the member with the specified index of the struct field class.
const actf_fld_cls * actf_fld_cls_members_fld_cls_idx(const actf_fld_cls *fc, size_t i)
Get the field class of the member with the specified index of the struct field class.
enum actf_bit_order actf_fld_cls_bit_order(const actf_fld_cls *fc)
Get the bit order property of the field class.
const char * actf_fld_cls_aliased_name(const actf_fld_cls *fc)
Get the alias of the field class.
size_t actf_fld_cls_members_len(const actf_fld_cls *fc)
Get the number of members of the struct field class.
enum actf_base actf_fld_cls_pref_display_base(const actf_fld_cls *fc)
Get the preferred display base of the field class.
const char * actf_fld_cls_members_name_idx(const actf_fld_cls *fc, size_t i)
Get the name of the member with the specified index of the struct field class.
enum actf_byte_order actf_fld_cls_byte_order(const actf_fld_cls *fc)
Get the byte order property of the field class.
const actf_rng_set * actf_fld_cls_selector_rng_set(const actf_fld_cls *fc)
Get the selector ranges which determine if an optional field is enabled or not when the selector fiel...
const actf_fld_cls * actf_fld_cls_element_fld_cls(const actf_fld_cls *fc)
Get the element field class of the field class.
const actf_fld * actf_fld_cls_extensions(const actf_fld_cls *fc)
Get the extensions of the field class.
enum actf_encoding actf_fld_cls_encoding(const actf_fld_cls *fc)
Get the character encoding of the field class.
const actf_mappings * actf_fld_cls_mappings(const actf_fld_cls *fc)
Get any available mappings of the field class.
const actf_fld_cls * actf_fld_cls_optional_fld_cls(const actf_fld_cls *fc)
Get a the conditional field class of an optional field class.
actf_fld_cls_type
A field class type.
Definition fld_cls.h:53
const actf_fld_loc * actf_fld_cls_selector_fld_loc(const actf_fld_cls *fc)
Get the field location denoting selector field of the field class.
const actf_fld * actf_fld_cls_options_attributes_idx(const actf_fld_cls *fc, size_t i)
Get the attributes of the option with the specified index of the variant field class.
enum actf_role actf_fld_cls_roles(const actf_fld_cls *fc)
Get the roles of the field class.
const actf_fld * actf_fld_cls_options_extensions_idx(const actf_fld_cls *fc, size_t i)
Get the extensions of the option with the specified index of the variant field class.
const actf_fld * actf_fld_cls_attributes(const actf_fld_cls *fc)
Get the attributes of the field class.
uint64_t actf_fld_cls_min_alignment(const actf_fld_cls *fc)
Get the minimum alignment property of the field class.
size_t actf_fld_cls_len(const actf_fld_cls *fc)
Get the length property of the field class.
const actf_flags * actf_fld_cls_bit_map_flags(const actf_fld_cls *fc)
Get the flags of the field class.
const char * actf_fld_cls_media_type(const actf_fld_cls *fc)
Get the IANA media type of the field class.
const char * actf_fld_cls_options_name_idx(const actf_fld_cls *fc, size_t i)
Get the name of the option with the specified index of the variant field class.
size_t actf_fld_cls_alignment(const actf_fld_cls *fc)
Get the alignment property of the field class.
const actf_fld_cls * actf_fld_cls_options_fld_cls_idx(const actf_fld_cls *fc, size_t i)
Get the field class of the option with the specified index of the variant field class.
Field location related methods.
struct actf_fld_loc actf_fld_loc
A field location.
Definition fld_loc.h:29
Mapping related methods.
struct actf_mappings actf_mappings
Mappings map names to integer range sets.
Definition mappings.h:34
Range set related methods.
struct actf_rng_set actf_rng_set
A range set.
Definition rng.h:33
Basic types used by ACTF.
struct actf_fld actf_fld
A field.
Definition types.h:91
struct actf_fld_cls actf_fld_cls
A field class.
Definition types.h:93
actf_bit_order
Bit orders.
Definition types.h:102
actf_byte_order
Byte orders.
Definition types.h:96
actf_base
Bases.
Definition types.h:118
actf_encoding
Character encodings.
Definition types.h:108