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
Original issue reported on code.google.com by
brunon...@brunonery.com
on 27 Apr 2012 at 4:49