dgramop / libcrafter

Automatically exported from code.google.com/p/libcrafter
0 stars 0 forks source link

Support SLL data link layer #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently, Ethernet is the only data link layer supported by libcrafter. A very 
common data link layer (pseudo) protocol is SLL (Linux cooked-mode capture), 
which is used, for example, when capturing from the "any" device using libpcap. 
It also appears with other types of devices, such as PPP or virtual network 
cards in virtual hosts.

Currently, it is possible to parse packets obtained from libpcap from this kind 
of interface with the following code:

---- snip ----
#define SLL_HEADER_LEN 16
/* ... do something ... */
char* data;
int len;
/* ... obtain data ... */
Packet p;
p.PacketFromIP(data + SLL_HEADER_LEN, len - SLL_HEADER_LEN);
/* ... do something ... */
---- snip ----

It would be good to have a Packet::PacketFromSLL(...) or even a more generic 
Packet::PacketFromDatalinkLayer (which would need to figure out what kind of 
interface the packet came from).

Original issue reported on code.google.com by brunon...@brunonery.com on 27 Apr 2012 at 4:49

GoogleCodeExporter commented 8 years ago

Original comment by pellegre...@gmail.com on 27 Apr 2012 at 6:08

GoogleCodeExporter commented 8 years ago

Original comment by pellegre...@gmail.com on 5 Jun 2012 at 5:24