Fork me on GitHub
text2pcap.h
Go to the documentation of this file.
1 
36 #ifndef JANUS_TEXT2PCAP_H
37 #define JANUS_TEXT2PCAP_H
38 
39 #include <glib.h>
40 
41 #include <inttypes.h>
42 #include <string.h>
43 #include <stdio.h>
44 #include <stdlib.h>
45 
46 #include "mutex.h"
47 
49 typedef struct janus_text2pcap {
51  char *filename;
53  FILE *file;
55  int truncate;
57  gboolean text;
59  volatile int writable;
63 
65 typedef enum janus_text2pcap_packet {
71 
80 janus_text2pcap *janus_text2pcap_create(const char *dir, const char *filename, int truncate, gboolean text);
81 
91  janus_text2pcap_packet type, gboolean incoming, char *buf, int len, const char *format, ...) G_GNUC_PRINTF(6, 7);
92 
97 
100 void janus_text2pcap_free(janus_text2pcap *instance);
101 
102 #endif
janus_text2pcap::filename
char * filename
Absolute path to where the text2pcap file is stored.
Definition: text2pcap.h:51
JANUS_TEXT2PCAP_RTP
@ JANUS_TEXT2PCAP_RTP
Definition: text2pcap.h:66
janus_text2pcap::file
FILE * file
Pointer to the file handle.
Definition: text2pcap.h:53
janus_text2pcap::writable
volatile int writable
Whether we can write to this file or not.
Definition: text2pcap.h:59
janus_text2pcap_create
janus_text2pcap * janus_text2pcap_create(const char *dir, const char *filename, int truncate, gboolean text)
Create a text2pcap recorder.
Definition: text2pcap.c:155
janus_text2pcap_dump
int janus_text2pcap_dump(janus_text2pcap *instance, janus_text2pcap_packet type, gboolean incoming, char *buf, int len, const char *format,...) G_GNUC_PRINTF(6
Dump an RTP or RTCP packet.
janus_text2pcap_packet_string
const char * janus_text2pcap_packet_string(janus_text2pcap_packet type)
Definition: text2pcap.c:58
JANUS_TEXT2PCAP_DATA
@ JANUS_TEXT2PCAP_DATA
Definition: text2pcap.h:68
janus_text2pcap::mutex
janus_mutex mutex
Mutex to lock/unlock this recorder instance.
Definition: text2pcap.h:61
janus_text2pcap::text
gboolean text
Whether we'll save as text, or directly to pcap.
Definition: text2pcap.h:57
janus_text2pcap_close
int int janus_text2pcap_close(janus_text2pcap *instance)
Close a text2pcap recorder.
Definition: text2pcap.c:312
janus_text2pcap_free
void janus_text2pcap_free(janus_text2pcap *instance)
Free a text2pcap instance.
Definition: text2pcap.c:326
janus_text2pcap
struct janus_text2pcap janus_text2pcap
Instance of a text2pcap recorder.
mutex.h
Semaphors, Mutexes and Conditions.
JANUS_TEXT2PCAP_RTCP
@ JANUS_TEXT2PCAP_RTCP
Definition: text2pcap.h:67
janus_text2pcap_packet
janus_text2pcap_packet
Packet types we can dump.
Definition: text2pcap.h:65
janus_mutex
GMutex janus_mutex
Janus mutex implementation.
Definition: mutex.h:61
janus_text2pcap::truncate
int truncate
Number of bytes to truncate at.
Definition: text2pcap.h:55
janus_text2pcap
Instance of a text2pcap recorder.
Definition: text2pcap.h:49