As Christian Brunner said:
>
> Here is my first cut on sending arbitrary packets (the diff is against
> todays CVS version). I know that it still has edges and it supports only
> three types of packets (Generic, IPv4, TCP) at the moment, but I want to
> put it out now, because I have to hack some other stuff for a while.
>
> Another issue is, that sending out packets only works only with Linux. The
> rest of you should be able to look at the user interface, but... (The
> actual send-function is called genpacket_send(). - You will find it in
> "gen-common.c".)
This looks very good. I am currently looking at ways of producing packets
on Linux token-ring interfaces, but the code path for Linux 2.0 TR acts
differently than for ethernet. The 802.5 code path doesn't copy the source
hwaddr to the 802.5 header, so it's up to the individual NIC drivers to put
this address in. Unfortunately, at the device level, the code doesn't know
if you want that hwaddr copied into the 802.5 header or not; it just copies
it blindly.
I'm in conversation right now with the Linux TR people to see how I can
change this, as I'd really like to generate arbitrary packets too.
I haven't looked very closely at your code yet; is it pretty easy to stick
in a different data-link type so that (eventually) token-ring packets can
be generated as well as ethernet? (like the switch statement in
dissect_packet() )?
--gilbert
--
Gilbert Ramirez Voice: +1 210 358 4032
Technical Services Fax: +1 210 358 1122
University Health System San Antonio, Texas, USA