Questions tagged [libpcap]

Libpcap, a portable C/C++ library for network traffic capture. Provides a common interface across various OS-specific backends like BPF, packet filter, netfilter, and NPF.

Libpcap was originally developed by the tcpdump developers in the Network Research Group at Lawrence Berkeley Laboratory. The low-level packet capture, capture file reading, and capture file writing code of tcpdump was extracted and made into a library, with which tcpdump was linked.

796 questions
0
votes
1 answer

Packet sniffering by jpcap

I am sniffering packets on ethernet (eth0) in java with the help of jpcap library... So, In my project I have a JpcapCaptor ... //Open an interface with openDevice(NetworkInterface intrface, int snaplen, boolean promics, int to_ms) …
timonvlad
  • 1,046
  • 3
  • 13
  • 31
0
votes
1 answer

blocking pcap and multiple I/O `select `

I want to use pcap to capture packets and then send the captured packets to another host my source code snippets are like: for(;;){ pcap_packet = pcap_next(pcap_handler, &pcap_header); …
user1944267
  • 1,557
  • 5
  • 20
  • 27
0
votes
1 answer

How to print PCAPNG metadata in Python?

I'm attempting my first Python program and could use a little help. My script on github I need a way to print the metadata in a PCAPNG file. I want to print the application and version, OS, and interface for starters. The Section Header Block and…
jonschipp
  • 781
  • 2
  • 9
  • 21
0
votes
2 answers

usng libpcap to implement tcp listen()

I have a research work which requires tcp modification and I want to implement my version of TCP listen() function my idea is to use libpcap to capture all TCP SYN packet from a specific port and then use raw socket to create/send SYN/ACK and the…
misteryes
  • 2,167
  • 4
  • 32
  • 58
0
votes
1 answer

Compiler Warning libpcap

Having followed the examples http://www.tcpdump.org/pcap.htm, and exploring the documentation, I can't see what I have done wrong with the following code // main.c void got_packet(u_char *args, struct pcap_pkthdr *header, const u_char *packet); ///…
Lee Hambley
  • 6,270
  • 5
  • 49
  • 81
0
votes
2 answers

Build libpcap for Python 2.7.x in windows 7

I've tried several different things and crawled around on lots of forums looking for an answer to this question. My goal is to simply parse through a wireshark .pcap-ng trace file using Python. From what I can gather, it seems like I need a libpcap…
Kyte
  • 834
  • 2
  • 12
  • 27
0
votes
1 answer

generate statistics during pcap_loop every second

I am writing a PERL script, which captures packets, and then generate statistics in every second about all the TCP streams, which were online in that second. I am using NET::Pcap, and I want somehow to implement this, and if it's possible without…
molnarg
  • 445
  • 4
  • 8
0
votes
1 answer

Mirror network traffic for traffic interception

I want to develop an application where all traffic from network segment gets mirrored onto a windows station in order to be able to see all tcp-ip request/response data (filtering). I know that it should be possible using WinPcap to capture all…
Gmt
  • 569
  • 1
  • 5
  • 19
0
votes
1 answer

pcap_next() function should be put before the packet transmission or after?

I want to capture the ACK packet in a tcp-3way handshake using libpcap the code snippet is as below pcap_packet = pcap_next(pcap_handler, &pcap_header); if(pcap_packet !=NULL) printf("capture one packet with length of %d\n",…
user1944267
  • 1,557
  • 5
  • 20
  • 27
0
votes
1 answer

packet sniffer - trace back to where content originated

I used sniffex.c as my starting point, and I've spent a few months working on getting the packet sniffer working the way I would like. It is a good tool for providing a summary of traffic flow in and out of each computer on my network, but I find…
nomadicME
  • 1,389
  • 5
  • 15
  • 35
0
votes
0 answers

segmentation fault when using libpcap

This is Valgrind output for my program which I use for parsing .pcap files. I may not paste the source of the program here, unfortunately... The thing is, that I do not have any memcpy(...) call in plugin_input_get_flow(...) When I run the program…
Tomáš Šíma
  • 834
  • 7
  • 26
0
votes
1 answer

How will I be able to printout the captured packets using pcap.loop() with a parameter of Pcap.LOOP_INFINITE into the JTextArea?

I'm quite new to JNetPcap and I'm still finding my way around with it, I'm trying to build a Packet sniffer for my project, Lately I'm trying printout packet information into a JTextArea by appending the information from a pcap.loop() that I am…
Rojee
  • 43
  • 8
0
votes
1 answer

pcap - Proper capitalization when referring to the file standard?

How does one properly refer to a Packet Capture file in short hand when writing about it for documentation? I see a mix between PCAP, PCap and pcap in various areas and wikis.
RyPeck
  • 7,830
  • 3
  • 38
  • 58
0
votes
1 answer

tcpdump - Maximum amount of packets in a pcap file?

Is there a maximum amount of packets for pcap file (beyond OS limits? Looking at the specification I don't see anything in the pcap file format that would limit the number of packets. Perhaps will libpcap or tcpdump limit the number of packets…
RyPeck
  • 7,830
  • 3
  • 38
  • 58
0
votes
1 answer

C program prints wrong output to file

I'm a newbie with C language and I'm trying to write an Idle port monitor application for ethernet networks, the application measures broadcast traffic by protocol and generates a text file report, however the output it prints to the file is…
Dimeji
  • 1
  • 1