Hi Bruno,
there's a packet capture library called libpcap which
supportsthe reading of packets of the datalink layer. It is provided in
source code at the following URL ftp://ftp.ee.lbl.gov/libpcap.tar.Z.
Without too much problem you could also be able to modify it to add the
support to also write packets.
I think it's the best library of this kind you can find. It's used by
various sniffers (e.g. tcpdump), so you can be sure it works well and
it's a very stable piece of software, it's very largely used so you can
find also a bit of help in using and hacking it's code, other than
developed from the smart guys
at LBL.
Bye, Marco
Bruno Randolf wrote:
> hi there!
>
> can anybody here tell me how can i send and receive ethernet packets
> directly on layer 2 under linux?
>
> i need that for the following project: one linux machine, two ethernet
> nics. we want to some kind of bridging function between the two nics
with
> the additional features of controlling bandwidht, delay, error-rate
and so
> on. this should make up something like a link-simulator: you could for
> example simulate the behaviour of a satelite-link.
>
> i'm afraid, the kernel bridging option wouldn't help very much,
because i
> cannot manipulate the buffers (or at least i don't know how to), so i
> thought about implementig a program which does the bridging by itself.
> are there any calls to get the ethernet-frames or do i have to hack
around
> in the kernel?
>
> any other suggsetions?
> help would be greatly appreciated!
>
> Br1
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-net"
in
> the body of a message to [EMAIL PROTECTED]
My email addresses are:
[EMAIL PROTECTED] (home)
[EMAIL PROTECTED] (University of Bologna at Bologna)
[EMAIL PROTECTED] (University of Bologna at Cesena)
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]