actf 0.0.1
An acute CTF reader
Loading...
Searching...
No Matches
/home/adwe/code/actf/pkt.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_PKT_H
26#define ACTF_PKT_H
27
28#include <stdint.h>
29
30#include "metadata.h"
31
33typedef struct actf_pkt actf_pkt;
34
37 ACTF_PKT_PROP_HEADER,
38 ACTF_PKT_PROP_CTX,
39 ACTF_PKT_N_PROPS,
40};
41
54const actf_fld *actf_pkt_fld(const actf_pkt *pkt, const char *key);
55
57const actf_fld *actf_pkt_fldn(const actf_pkt *pkt, const char *key, size_t len);
58
67const actf_fld *actf_pkt_prop_fld(const actf_pkt *pkt, const char *key,
68 enum actf_pkt_prop prop);
69
71const actf_fld *actf_pkt_prop_fldn(const actf_pkt *pkt, const char *key,
72 size_t len, enum actf_pkt_prop prop);
73
80const struct actf_fld *actf_pkt_prop(const struct actf_pkt *pkt,
81 enum actf_pkt_prop prop);
82
92uint64_t actf_pkt_seq_num(const actf_pkt *pkt);
93
101
112uint64_t actf_pkt_begin_tstamp(const actf_pkt *pkt);
113
125
138uint64_t actf_pkt_end_tstamp(const actf_pkt *pkt);
139
147
160
171
179
186uint64_t actf_pkt_dstream_id(const actf_pkt *pkt);
187
195
203
211
212#endif /* ACTF_PKT_H */
A CTF2 metadata representation.
struct actf_dstream_cls actf_dstream_cls
A data stream class.
Definition metadata.h:63
uint64_t actf_pkt_seq_num(const actf_pkt *pkt)
Get the sequence number of a packet.
actf_pkt_prop
Packet properties.
Definition pkt.h:36
uint64_t actf_pkt_end_tstamp(const actf_pkt *pkt)
Get the timestamp of the end of a packet in cycles.
const actf_dstream_cls * actf_pkt_dstream_cls(const actf_pkt *pkt)
Get the data stream class of the packet.
const actf_fld * actf_pkt_fldn(const actf_pkt *pkt, const char *key, size_t len)
Same as actf_pkt_fld() but with an explicit key length.
const actf_fld * actf_pkt_fld(const actf_pkt *pkt, const char *key)
Search the top-level struct of all packet properties for a field with name key.
bool actf_pkt_has_disc_event_record_snapshot(const actf_pkt *pkt)
Check if the packet has a discarded event record snapshot.
struct actf_pkt actf_pkt
A packet.
Definition pkt.h:33
uint64_t actf_pkt_disc_event_record_snapshot(const actf_pkt *pkt)
Get the discarded event record snapshot of a packet.
uint64_t actf_pkt_dstream_id(const actf_pkt *pkt)
Get the data stream id of the packet.
bool actf_pkt_has_end_tstamp(const actf_pkt *pkt)
Check if the packet has an end timestamp.
int64_t actf_pkt_begin_tstamp_ns_from_origin(const actf_pkt *pkt)
Get the timestamp of the beginning of a packet in nanoseconds from origin.
const actf_fld * actf_pkt_prop_fldn(const actf_pkt *pkt, const char *key, size_t len, enum actf_pkt_prop prop)
Same as actf_pkt_prop_fld() but with an explicit key length.
uint64_t actf_pkt_dstream_cls_id(const actf_pkt *pkt)
Get the data stream class id of the packet.
const actf_fld * actf_pkt_prop_fld(const actf_pkt *pkt, const char *key, enum actf_pkt_prop prop)
Search the top-level struct of a packet property for a field with name key.
bool actf_pkt_has_seq_num(const actf_pkt *pkt)
Check if the packet has a sequence number.
uint64_t actf_pkt_begin_tstamp(const actf_pkt *pkt)
Get the timestamp of the beginning of a packet in cycles.
int64_t actf_pkt_end_tstamp_ns_from_origin(const actf_pkt *pkt)
Get the timestamp of the end of a packet in nanoseconds from origin.
bool actf_pkt_has_dstream_id(const actf_pkt *pkt)
Check if the packet has an explicit datastream id.
struct actf_fld actf_fld
A field.
Definition types.h:91