473,657 Members | 2,582 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pcapy listen on multiple devices

Hi all. I noticed that with the original pcap sniffing library it is
possible to listen on multiple devices by using "select()" or "poll()"
function.
These function aren't present in pcapy module. Do you got any suggestion to
avoid this problem?
Sep 12 '05 #1
1 2517
On Mon, 12 Sep 2005 17:02:31 +0200, billiejoex <bi********@fas twebnet.it> wrote:
Hi all. I noticed that with the original pcap sniffing library it is
possible to listen on multiple devices by using "select()" or "poll()"
function.
Yes; you can ask pcap for the file descriptor which corresponds to your
sniffed device. That works at least on Unixes.

(There is also the 'any' pseudo-interface, if you are on Linux (and other
Unixes?). You get to listen /everywhere/ in one session.)
These function aren't present in pcapy module. Do you got any suggestion to
avoid this problem?


Modify pcapy so you can get the file descriptor from it. Pcapy is great, but
it doesn't expose libpcap literally. Maybe the original authors had no use
for getfd().

I've been meaning to write The Pcap Bindings To End All Pcap Bindings for
almost a year now, but I never seem to get around to it ;-)

/Jorgen

--
// Jorgen Grahn <jgrahn@ Ph'nglui mglw'nafh Cthulhu
\X/ algonet.se> R'lyeh wgah'nagl fhtagn!
Sep 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
4659
by: Claudio Grondi | last post by:
I would like to save time copying the same file (>6 GByte) to various different target storage media connected to the system via USB. Is there a (Python or other) tool able to help me to do this, so that I don't need to copy the source file first to the first media, then to the second, etc.? Claudio
2
2406
by: billiejoex | last post by:
Hi. I'm trying to use pcapy module on Windows XP prof sp2 but it doesn't work. The example source reported on the site (http://oss.coresecurity.com/impacket/sniff.py) works only on *unix machines. On Windows machines the findalldevs() function (an output on the bottom) gives an unicode object that can't be processed by open_live function that tipically accept strings. This not happens on linux machines where findalldev() function gives a...
2
4863
by: billiejoex | last post by:
Hi all. I'm using pcapy module to sniff some ICMP packets. I would like to modify this source: http://www.google.it/search?hl=it&q=pcapy&btnG=Cerca+con+Google&meta= and visualize only the DATA filed of the sniffed packets instead of all fields that are generally visualized (for example: ip src, ip dest, packet type...) For example in this sniffing output: ICMP type: ECHOREPLY code: UNKNOWN
0
1581
by: billiejoex | last post by:
Hi all. The source below is a simple icmp sniffer made with pcapy. To decode packets I'm using the EthDecoder() function that returns a rapresentation of the packet including ICMP type, ICMP code, IP source and IP destination. All I need, now, is to get the ip src and ip dst only but I don't know how to do it. I tried to use the IPDecoder instead of EthDecoder to decode packets but misteriously it doesn't works. Does anybody have a good...
0
1026
by: billie | last post by:
Hi all. Because of pcapy sniffng library doesn't permit to listen on multiple interfaces I'm trying to use threads to avoid this problem. In the source below I tried to start a thread for every NIC installed on my system (I got 2 NICs) but once I started the first thread the program can't go further. Note that the first trhread works properly (I can sniff traffic) but the problem is that the second thread regarding the other NIC never...
9
43135
by: mBird | last post by:
I wrote a service that listens for broadcast messages from my firewall (UDP snmp trap messages) and parses and puts the data in an database. I'd also like to write an app that is a simple form that can listen in when it runs (so I can see messages in a form as they occur.) So I need the ability to listen to a UDP port with two apps at the same time (the service and my app). But when I do that I get an error:...
1
3401
by: gregory_may | last post by:
I want to bind multiple UDPClients to the same port on the same machine. I want them to all listen for broadcast messages & respond accordingly. Multiple client bindings "under normal circumstances" doesn't work (That's the error I am getting). But, it seems very reasonable to set up many UDPclients to receive the same broadcast messages off the same port on the same machine. Is there some way to passively bind multiple UDPclients...
6
2074
by: Orgun | last post by:
Hi, I sent this message to the moderated c++ group too but it is waiting for moderator approval and I wanted to send here too. I am new to Design Patterns. I want to write a simple DeviceManager which is only interested in CD/DVD devices. I want to get the list of CD/DVD devices and "be informed when a disc inserted into a device". I am developing this on Linux. So, I used HAL API and read some system (actually /proc) files to gather...
2
9654
by: T00l | last post by:
I'm a newbie to python and for my first project i'm trying to create a packet filter. Having looked around i think pcapy will be the best way, there is a sniffer script available that incorporates a filter function here .. http://oss.coresecurity.com/impacket/sniff.py I want to filter all SYN packets into a dump file, can anyone tell me how I need to configure the filter string to do this? Thanks
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7324
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.