Fork me on GitHub
text2pcap.h
Go to the documentation of this file.
1 
34 #ifndef _JANUS_TEXT2PCAP_H
35 #define _JANUS_TEXT2PCAP_H
36 
37 #include <glib.h>
38 
39 #include <inttypes.h>
40 #include <string.h>
41 #include <stdio.h>
42 #include <stdlib.h>
43 
44 #include "mutex.h"
45 
47 typedef struct janus_text2pcap {
49  char *filename;
51  FILE *file;
53  int truncate;
55  volatile int writable;
59 
61 typedef enum janus_text2pcap_packet {
67 
75 janus_text2pcap *janus_text2pcap_create(const char *dir, const char *filename, int truncate);
76 
86  janus_text2pcap_packet type, gboolean incoming, char *buf, int len, const char *format, ...) G_GNUC_PRINTF(6, 7);
87 
92 
96 
97 #endif
const char * janus_text2pcap_packet_string(janus_text2pcap_packet type)
Definition: text2pcap.c:42
int truncate
Number of bytes to truncate at.
Definition: text2pcap.h:53
janus_text2pcap_packet
Packet types we can dump.
Definition: text2pcap.h:61
Definition: text2pcap.h:62
volatile int writable
Whether we can write to this file or not.
Definition: text2pcap.h:55
GMutex janus_mutex
Janus mutex implementation.
Definition: mutex.h:61
void janus_text2pcap_free(janus_text2pcap *instance)
Free a text2pcap instance.
Definition: text2pcap.c:172
Instance of a text2pcap recorder.
Definition: text2pcap.h:47
Definition: text2pcap.h:64
struct janus_text2pcap janus_text2pcap
Instance of a text2pcap recorder.
janus_mutex mutex
Mutex to lock/unlock this recorder instance.
Definition: text2pcap.h:57
Semaphors, Mutexes and Conditions.
int int janus_text2pcap_close(janus_text2pcap *instance)
Close a text2pcap recorder.
Definition: text2pcap.c:158
Definition: text2pcap.h:63
janus_text2pcap * janus_text2pcap_create(const char *dir, const char *filename, int truncate)
Create a text2pcap recorder.
Definition: text2pcap.c:53
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.
char * filename
Absolute path to where the text2pcap file is stored.
Definition: text2pcap.h:49
FILE * file
Pointer to the file handle.
Definition: text2pcap.h:51