#include "capture_traffic.h" void traffic_capture_init(struct capture_ctx* ctx, char* filename) { ctx->activated = filename == NULL ? 0 : 1; if (!ctx->activated) return; ctx->filename = strdup(filename); ctx->capture_in = g_queue_new (); ctx->capture_out = g_queue_new (); } void traffic_capture_stop(struct capture_ctx* ctx) { if (!ctx->activated) return; FILE* fd = NULL; if ((fd = fopen(ctx->filename, "w")) == NULL) { } free(ctx->filename); }