Make API CTF-agnostic
[babeltrace.git] / include / babeltrace / ctf-ir / packet.h
CommitLineData
f79cf0f0
PP
1#ifndef BABELTRACE_CTF_IR_PACKET_H
2#define BABELTRACE_CTF_IR_PACKET_H
3
4/*
5 * BabelTrace - CTF IR: Stream packet
6 *
7 * Copyright 2016 Philippe Proulx <pproulx@efficios.com>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to deal
11 * in the Software without restriction, including without limitation the rights
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 * copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 *
27 * The Common Trace Format (CTF) Specification is available at
28 * http://www.efficios.com/ctf
29 */
30
e22b45d0
PP
31#include <stdint.h>
32
44c440bc
PP
33/* For enum bt_property_availability */
34#include <babeltrace/property.h>
094ff7c0 35
44c440bc
PP
36/* For enum bt_clock_value_status */
37#include <babeltrace/ctf-ir/clock-value.h>
f79cf0f0
PP
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
50842bdc 43struct bt_packet;
312c056a
PP
44struct bt_packet_header_field;
45struct bt_packet_context_field;
50842bdc 46struct bt_stream;
e22b45d0 47struct bt_clock_value;
f79cf0f0 48
44c440bc 49extern struct bt_packet *bt_packet_create(struct bt_stream *stream);
f5efa812 50
44c440bc 51extern struct bt_stream *bt_packet_borrow_stream(struct bt_packet *packet);
f5efa812 52
094ff7c0 53extern
44c440bc 54struct bt_field *bt_packet_borrow_header_field(struct bt_packet *packet);
094ff7c0 55
312c056a 56extern
44c440bc 57int bt_packet_move_header_field(struct bt_packet *packet,
312c056a 58 struct bt_packet_header_field *header);
f5efa812 59
312c056a 60extern
44c440bc 61struct bt_field *bt_packet_borrow_context_field(struct bt_packet *packet);
f5efa812 62
312c056a 63extern
44c440bc 64int bt_packet_move_context_field(struct bt_packet *packet,
312c056a 65 struct bt_packet_context_field *context);
f79cf0f0 66
ccf82993 67extern
44c440bc
PP
68enum bt_clock_value_status bt_packet_borrow_default_beginning_clock_value(
69 struct bt_packet *packet, struct bt_clock_value **clock_value);
e22b45d0 70
ccf82993 71extern
44c440bc
PP
72int bt_packet_set_default_beginning_clock_value(struct bt_packet *packet,
73 uint64_t value_cycles);
e22b45d0 74
ccf82993 75extern
44c440bc 76enum bt_clock_value_status bt_packet_borrow_default_end_clock_valeu(
ccf82993
PP
77 struct bt_packet *packet, struct bt_clock_value **clock_value);
78
79extern
44c440bc
PP
80int bt_packet_set_default_end_clock_value(struct bt_packet *packet,
81 uint64_t value_cycles);
ccf82993
PP
82
83extern
44c440bc
PP
84enum bt_property_availability bt_packet_get_discarded_event_counter_snapshot(
85 struct bt_packet *packet, uint64_t *value);
ccf82993
PP
86
87extern
44c440bc
PP
88int bt_packet_set_discarded_event_counter_snapshot(struct bt_packet *packet,
89 uint64_t value);
ccf82993
PP
90
91extern
44c440bc
PP
92enum bt_property_availability bt_packet_get_packet_counter_snapshot(
93 struct bt_packet *packet, uint64_t *value);
e22b45d0 94
44c440bc
PP
95extern
96int bt_packet_set_packet_counter_snapshot(struct bt_packet *packet,
97 uint64_t value);
a0491f93 98
f79cf0f0
PP
99#ifdef __cplusplus
100}
101#endif
102
103#endif /* BABELTRACE_CTF_IR_PACKET_H */
This page took 0.045481 seconds and 4 git commands to generate.