|
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
At 3:17 PM +0200 7/22/04, Enrico lupsyn Del Zotto wrote:I must send a packet ( eth header, and arp packet ) over the en0.Enrico,
In linux i use the sockaddr_ll struct and a PF_Packet. Now in bsd i don't know how do it ,
can someone help me ?
thx,bye
For this, you want to open a PF_NDRV socket to send out a raw ethernet packet. Take a look at the sample code BSDLLCTest
<http://developer.apple.com/samplecode/BSDLLCTest/BSDLLCTest.html>
This sample demonstrates the technique to open a PF_NDRV socket, which requires root access, then demonstrates both the send and receive of packets using this socket.
Sending raw packets is straightforward, but the sample is designed to receive LLC Ethernet frames. You'll need to tweak the sample to receive a phase I Ethernet frame for a tcp packet, if this is within the scope of your project.
--
Sincerely,
Rich Kubota
email@hidden
(408) 974-6212
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.
| References: | |
| >PF_PACKET (From: Enrico "lupsyn" Del Zotto <email@hidden>) | |
| >Re: PF_PACKET (From: Rich Kubota <email@hidden>) |
| Home | Archives | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2011 Apple Inc. All rights reserved.