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
-1
votes
1 answer

JNetPcap open pcap from InputStream

Is there a way to open an offline Pcap from an InputStream and not from a local file? In the documentation it say that you can use pcap_fopen_offline() to open Pcap from an open stream but I don't know how to use it.
Amir Rossert
  • 1,003
  • 2
  • 13
  • 33
-1
votes
1 answer

Libpcap: Packet Filtration at word level

Using Libpcap I am trying to filter the Packet at word level. E.g I want to drop the packet if it has word "Hello". How will I write the expression for that???
-1
votes
2 answers

Extract packet length from libpcap capture

i am working with libpcap(gcc, linux) and for some reason i want to extract the packet length from the u_char packet[], saving it in an integer; say the packet length stored in packet[38] packet[39] . something like: #include #include…
V1R4N64R
  • 23
  • 1
  • 8
-1
votes
2 answers

How to program pcap with Objective-C and get HTTP request and response values in text format

I am working with pcap in an OS X application to understand packet analysis. I am working with a app https://github.com/jpiccari/MacAlyzer but I am getting only raw data but I want to differentiate every domain request into separate and clear way…
Retro
  • 3,985
  • 2
  • 17
  • 41
-1
votes
1 answer

porting wireshark to qnx based system

I am a newbie to industry and as a part of my internship I have been assigned the above project.I have no experience in how to go about porting a particular application to a different OS. So far,i have tried to understand the basic structure of a…
Ankit
  • 49
  • 2
-1
votes
2 answers

Size of 802.11 packet

Given the below declaration for pcap callback: void my_callback(u_char *args, const struct pcap_pkthdr *header, const u_char *packet) How to ascertain the total number of bytes present in the packet? I need that value so that I can pass it to…
bengaluriga
  • 319
  • 2
  • 5
  • 9
-2
votes
2 answers

Cannot open include file: 'pcap.h'

I am trying to do one small pcap program in c++ and I am getting an error mentioned above. Below is the program I have written. #include #include #include #include void got_packet(u_char *args, const struct…
-2
votes
1 answer

trace tcp flow using XOR of the connection tuple per packet

I'm using libpcap (pcap crate) and I want to reconstruct individual tcp flows from packets. I have to match those packets to a flow, in a way that works for packets going in both directions (client->server and server-client) with as little overhead…
thek33per
  • 132
  • 4
-2
votes
1 answer

Install libpcap

Can someone explain me how to install libpcap? I downloaded libpcap-1.9.1 from official site (tcpdump). There are a lot of files and i cant understand what to do. i tried: project(test) set(CMAKE_CXX_STANDARD…
Qada
  • 119
  • 6
-2
votes
1 answer

How to het Source port no. in decimal form

I got the source port No. in hexa decimal no from the for loop as show in the code.. The Source port is 01 bb in this case.. I want to show it as 443 i.e. decimal how to show that... printf("\nSource Port Number: "); a = packet[34]; b =…
-2
votes
1 answer

static const uint8_t inside function changes value

I am writing a small analysis tool using libpcap that sniffs traffic on an ethernet device and performs some sort of analysis on the received packets. In order to do so, I have the obvious libpcap loop: void packet_loop(u_char *args, const struct…
TacoVox
  • 141
  • 10
-2
votes
1 answer

All received VLAN packets are becoming Error Vlan Packets

I am trying to send and receive VLAN packets, But every packet I am receiving on that mac becoming an error packet. Can some one explain me the reasons for a packet to be received as error. here is the status... Information about Ethernet interface…
-2
votes
1 answer

pcap_if_t : how to pick an element from this structure

: The result of pcap_findalldevs function : Finding available devices ... 1:eth0 -- (null) 2:wlan0 -- (null) 3:nflog -- Linux netfilter log (NFLOG) interface 4:any -- Pseudo-device that captures on all interfaces 5:lo -- (null) I want to…
N.B
  • 31
  • 1
  • 8
-3
votes
1 answer

Could someone explain these code snippets?

In the following code, could someone explain to me how the following works? /* * sniffex.c * * Sniffer example of TCP/IP packet capture using libpcap. * * Version 0.1.1 (2005-07-05) * Copyright (c) 2005 The Tcpdump Group * * This software…
Quintin
  • 109
  • 1
  • 7
-3
votes
1 answer

what limitations wifi packet capturing imposes?

What are the limitations of capturing wifi traffic using libpcap? In terms of packet size, speed, packet loss, impact on the network, etc... Thanks in advance,
1 2 3
53
54