Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically write IP packet bytes into PCAP file format? [closed]

Tags:

java

c

networking

Assuming that I have a set of buffers that represents an IP packet, how can generate a PCAP file? I'm looking for an API to do this in C/C++ or Java.

like image 710
lairtech Avatar asked Oct 03 '13 22:10

lairtech


1 Answers

jnetpcap includes the class PcapDumper which will write an array of bytes to a pcap file as documented here.

[note to original questioner: this answer was downvoted because i answered your question, and criticised others for closing a reasonable question, not because the answer is actually wrong in any way]

like image 147
andrew cooke Avatar answered Sep 18 '22 01:09

andrew cooke