473,326 Members | 2,196 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,326 software developers and data experts.

Raw IP packets on Linux


I am trying to compose raw IP packets on Linux, then send them out a chosen
interface. So I do:

sock = socket.socket( socket.AF_PACKET, socket.SOCK_DGRAM )
sock.bind(( '192.168.1.3' ))

So far so good. I create a packet (pkt) which contains the complete IP
datagram. ID is set to 0 to tell the kernel to stamp it for me. However, I am
so far unable to send the packet (pretend ']' is '>'):

]]] sock.sendto( pkt, ('192.168.1.4', 0))
Traceback (most recent call last):
File "<stdin>", line 1, in ?
socket.error: (19, 'No such device')
What am I getting wrong here? What address type does this socket expect?
Thanks,

/|/|ike
Jul 18 '05 #1
0 1634

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

Similar topics

1
by: yawnmoth | last post by:
so... i'm trying to send some FTP packets, via PHP, and... i'm not really sure how to construct 'em. HTTP 1.0 packets have the following structure: GET http://whatever.com/ HTTP/1.0 Accept:...
4
by: billie | last post by:
Hi all. I'd need to build spoofed IP packets. Do you know something about a python implementation? For low level packet building I already used Impacket module but if I specify a spoofed src...
1
by: ygy | last post by:
When I receive the UDP packets,and then Set the image pixel using Image::Setpixel(),but When I invalidate the interface to show the image,the UDP packets missed.How to solve the problem? thank you...
0
by: Fraser Dickson | last post by:
I am building a web based system using ASP.NET and VB.NET which has to interact with a web service which uses XML WDDX packets. I have been given the XML Packet Specification by the Web Service...
6
by: Ryan | last post by:
Hi, I am confused with how NetworkStream works. My application needs to handle heavy requests sent through TCP socket connection. I use NetworkStream.Read method to get the stream...
0
by: Dev | last post by:
I want to create a program with help of C and Socket Program which can capture the mail send by the sendmail in Linux. I want to store the header information after capturing the packets. How can...
6
by: White Spirit | last post by:
I can send data over a raw socket in C#. The part that is currently a problem is constructing the packet to be sent. To construct the packet, is it necessary to construct the packet 'by hand' and...
3
by: mostafijur | last post by:
Hi, I need Source code in C/C++ to capture packets from a LAN using Linux (Mandriva) OS.Packets are like TCP,UDP,HTTP. Thanks
5
by: jaco.versfeld | last post by:
Hi There, I have a basic TCP client and TCP server in C++. The TCP client connects to the server, and after a setup phase starts to transmit a file to the TCP server using multiple packets...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.