Lines Matching refs:pcap
50 static struct pcap_fd *pcap; variable
114 if (!pcap) in monitor_pcap_free()
117 if (pcap->fd >= 0) in monitor_pcap_free()
118 close(pcap->fd); in monitor_pcap_free()
120 g_free(pcap); in monitor_pcap_free()
128 pcap = g_new0(struct pcap_fd, 1); in monitor_pcap_create()
129 pcap->fd = open(pathname, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, in monitor_pcap_create()
131 if (pcap->fd < 0) { in monitor_pcap_create()
133 g_free(pcap); in monitor_pcap_create()
150 len = write(pcap->fd, &hdr, PCAP_FILE_HDR_SIZE); in monitor_pcap_create()
175 if (!pcap) in monitor_pcap_write()
186 len = write(pcap->fd, &frame, PCAP_FRAME_SIZE); in monitor_pcap_write()
192 fsync(pcap->fd); in monitor_pcap_write()
194 len = write(pcap->fd, data, size); in monitor_pcap_write()
200 fsync(pcap->fd); in monitor_pcap_write()