sample code that sends raw Ethernet packets?

sample code that sends raw Ethernet packets?

Post by Richard L. Hamilt » Mon, 17 Oct 2005 23:52:06



Looking for something not too tricky that's a sample of how
to do this on Solaris.  I'd like to eventually port or
recreate etherwake to run on Solaris, to be able to send
Wake-on-LAN packets to (presumably non-Solaris) systems.

--

Lasik/PRK theme music:
    "In the Hall of the Mountain King", from "Peer Gynt"

 
 
 

sample code that sends raw Ethernet packets?

Post by Robert Poulio » Tue, 18 Oct 2005 00:17:16



Quote:> Looking for something not too tricky that's a sample of how
> to do this on Solaris.  I'd like to eventually port or
> recreate etherwake to run on Solaris, to be able to send
> Wake-on-LAN packets to (presumably non-Solaris) systems.

To do something like this you'll probably need to use DLPI.
DLPI is standard accross most Unix, with a few variations accross each
unfortunately and somes (Unixware) allow only one DLPI  provider only (the
IP stack).
Hopefully Solaris was one of the easier implementation of DLPI to work
with.
Under Solaris you need to open the device directly to use DLPI (/dev/eri,
/dev/bge0, ...)
You can find the complete list of interfaces with the SIOCGIFCONF ioctl().
If you need more help, just ask on this newsgroup (or find my e-mail).

--
A high IQ is like a Jeep; you will still get stuck, just farther from help!


 
 
 

sample code that sends raw Ethernet packets?

Post by Casper H.S. Di » Tue, 18 Oct 2005 18:51:07



Quote:>Looking for something not too tricky that's a sample of how
>to do this on Solaris.  I'd like to eventually port or
>recreate etherwake to run on Solaris, to be able to send
>Wake-on-LAN packets to (presumably non-Solaris) systems.

There's no need to send raw ethernet frames in order to
implement Wake-ON-Lan.  The magic packet can be a standard
UDP packet (link-level broadcast) with the appropriate
content.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

sample code that sends raw Ethernet packets?

Post by hans m4 » Thu, 20 Oct 2005 06:18:07




Quote:>Looking for something not too tricky that's a sample of how
>to do this on Solaris.  I'd like to eventually port or
>recreate etherwake to run on Solaris, to be able to send
>Wake-on-LAN packets to (presumably non-Solaris) systems.

if you really want to assemble your frames by hand, look at nemesis

best regards
hans

--

 
 
 

sample code that sends raw Ethernet packets?

Post by Richard L. Hamilt » Thu, 20 Oct 2005 08:53:01





>>recreate etherwake to run on Solaris, to be able to send
>>Wake-on-LAN packets to (presumably non-Solaris) systems.

> Why not just use the perl script wakeonlan which sends
> sends suitable Wake-on-LAN packets to ethernet addresses
> you specify ? I use it on a Solaris 9 machine as an unpriv'ed
> user to wake up a Mac I've got.

> You can the script from:
>   http://gsd.di.uminho.pt/jpo/software/wakeonlan/

Works great, thanks.

--

Lasik/PRK theme music:
    "In the Hall of the Mountain King", from "Peer Gynt"

 
 
 

1. Send/Recv of ethernet packets useing raw sockets

Greetings Everyone !

Im looking for a tutorial, or explanations on useing raw sockets to
send and receive raw ethernet packets on linux.

Ive found some example of the basics, but there are caveats to the
process that dont seem to be documented. For example, how to
get the interface index given the ethernet device name, whether the
socket needs to be in blocking/non-blocking mode, can I simply
stuff a socket buffer on an interfaces outgoing queue without useing
the socket functions, relevant ioctls, etc, etc.

If anyone has any information or knows where I can find a tutorial
on this, please let me know.

Thanks !

Mike

p.s. I need to send raw ethernet frames for a new protocol im
developing. IP/UDP/TCP packets just doesnt cut it in this case.

2. reminder file

3. Sending raw ethernet packets

4. Advice sought on text mode UI software

5. How to send raw Ethernet packets?

6. WANTED: UNIX BENCH MARK UTILITIES

7. Sending Raw Ethernet Packets

8. Media Problem with Exabyte AME drive?

9. Send raw ethernet packet

10. assemble and send raw ethernet packets

11. Sample raw disk code?

12. SPAK(Send PAcKets)- tools to send arbitrary packets

13. sending Raw IP Packets