473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

C# supports only LAN packet sniffing

Why does C# only supports LAN packet sniffing?
Should I have to use WinPCap if I want to capture the outgoing packets
on xp pro also?
Why this limitation?

Here's the source for capturing the packets (with dial-up and xp pro
connections it also gets me the incoming packets):

public void Run()
{
int len_receive_buf=4096;
int len_send_buf=4096;
byte[] receive_buf=new byte[len_receive_buf];
byte[] send_buf=new byte[len_send_buf];
int cout_receive_bytes;
Socket socket=new
Socket(AddressFamily.InterNetwork,SocketType.Raw,P rotocolType.IP);
socket.Blocking=false;
socket.Bind(new IPEndPoint(IPAddress.Parse(DefaultIPComboBox.Text) ,0));
socket.SetSocketOption(SocketOptionLevel.IP,Socket OptionName.HeaderIncluded,1);
byte[] IN=new byte[4]{1,0,0,0};
byte[] OUT=new byte[4];
int SIO_RCVALL=unchecked((int)0x98000001);
int ret_code=socket.IOControl(SIO_RCVALL,IN,OUT);
while(true)
{
IAsyncResult
ar=socket.BeginReceive(receive_buf,0,len_receive_b uf,SocketFlags.None,null,this);
cout_receive_bytes=socket.EndReceive(ar);
Receive(receive_buf);
}
}

Nov 17 '05 #1
0 1365

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

Similar topics

2
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...
2
by: Anony | last post by:
Hi All, I used raw socket to sniff packet data. Now it can sniff only incoming packet, not outgoing data anymore. I don't know if it's due to the installation of XP SP2, firewall or other...
4
by: Dusan Micuch | last post by:
Hi, What's best way for Watching my Packet TCP and UDP ? Socket ? Some external DLL ? What I need to use for build programs like this? I want measure data on specific or anyone port at Real Time....
1
by: anton07 | last post by:
im a final year undergrad student..and i want to develop a packet sniffing software..but ive got no idea about what software's to use..hope i can get some help here..thanks so much.. or if there's...
3
by: nexus024 | last post by:
I am trying to write a program that will continuously sniff eth0 for a specific UDP packet thats being sent to a specific destination IP, alter the data of the packet, and finally transmit it to the...
0
by: shoi | last post by:
Hi, I am a newer to this field. I am writing the codes to sniff packets sent out by routers. The sample provided in Code Project seems not able to capture any multicasting packets? Is it possible to...
1
by: sangith | last post by:
Hi, I tried the packet capture module program. I did a file transfer using ftp from this host to another server. But when I ran the program, it was just hanging off and it did not print the...
3
by: T00l | last post by:
Hi All I have found the simple script that sniffs ICMP packets using Impacket and pcapy. At the moment it is capturing the packet header and data, I was just wondering if anyone knows a way to get...
1
by: Ken Fine | last post by:
I have been investigating programmatically downloading FLV content from various sites ("video scraping"??) Many interactive GUI tools do this, such as the Orbit downloader. At the heart of them...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.