Loading...
Searching...
No Matches
qlog.h
Go to the documentation of this file.
1
12
13#ifndef IMQUIC_QLOG_H
14#define IMQUIC_QLOG_H
15
16#include <glib.h>
17
18#include <jansson.h>
19
20#include "../imquic/refcount.h"
21
25
26typedef struct imquic_qlog {
28 char *id;
30 gboolean sequential;
32 gboolean is_server;
36 json_t *root;
38 json_t *common;
40 json_t *events;
42 char *filename;
44 FILE *file;
48 volatile gint destroyed;
52
71imquic_qlog *imquic_qlog_create(char *id, char *cid,
72 char *folder, gboolean sequential, gboolean is_server,
73 gboolean http3, gboolean roq, gboolean roq_packets,
74 gboolean moq, gboolean moq_messages, gboolean moq_objects);
86
90
94json_t *imquic_qlog_event_prepare(const char *name);
98json_t *imquic_qlog_event_add_data(json_t *event);
104void imquic_qlog_event_add_raw(json_t *parent, const char *name, uint8_t *bytes, size_t length);
108void imquic_qlog_append_event(imquic_qlog *qlog, json_t *event);
110
111#endif
GMutex imquic_mutex
imquic mutex implementation
Definition mutex.h:18
int imquic_qlog_save_to_file(imquic_qlog *qlog)
Save the current status of the QLOG structure to JSON.
Definition qlog.c:142
void imquic_qlog_append_event(imquic_qlog *qlog, json_t *event)
Helper to add a complete event object to an existing QLOG instance.
Definition qlog.c:220
json_t * imquic_qlog_event_add_data(json_t *event)
Helper to add a data object to an event and return a pointer to it.
Definition qlog.c:194
json_t * imquic_qlog_event_prepare(const char *name)
Helper to create a new QLOG event by name.
Definition qlog.c:186
void imquic_qlog_event_add_raw(json_t *parent, const char *name, uint8_t *bytes, size_t length)
Helper to add/append a raw object to the specified object or array.
Definition qlog.c:202
void imquic_qlog_destroy(imquic_qlog *qlog)
Helper method to destroy an existing QLOG instance.
Definition qlog.c:131
imquic_qlog * imquic_qlog_create(char *id, char *cid, char *folder, gboolean sequential, gboolean is_server, gboolean http3, gboolean roq, gboolean roq_packets, gboolean moq, gboolean moq_messages, gboolean moq_objects)
Helper method to initialize a new QLOG instance.
Definition qlog.c:37
Reference counter mechanism.
QLOG instance.
Definition qlog.h:26
gboolean is_server
Whether this is for a client or server connection.
Definition qlog.h:32
json_t * root
Jansson JSON instance.
Definition qlog.h:36
FILE * file
File to save the JSON file to.
Definition qlog.h:44
gboolean roq_packets
Definition qlog.h:34
imquic_mutex mutex
Mutex.
Definition qlog.h:46
gboolean moq_messages
Definition qlog.h:34
imquic_refcount ref
Reference counter.
Definition qlog.h:50
gboolean http3
Whether HTTP/3 and/or RoQ and/or MoQT events should be saved.
Definition qlog.h:34
volatile gint destroyed
Whether this instance has been destroyed (reference counting).
Definition qlog.h:48
char * filename
Path to where the JSON file should be saved.
Definition qlog.h:42
gboolean moq_objects
Definition qlog.h:34
json_t * common
Reference to the common fields entry.
Definition qlog.h:38
gboolean sequential
Whether sequential JSON will be used, instead of regular JSON.
Definition qlog.h:30
char * id
Instance ID.
Definition qlog.h:28
gboolean roq
Definition qlog.h:34
gboolean moq
Definition qlog.h:34
json_t * events
Reference to the events array.
Definition qlog.h:40
Definition refcount.h:77