|
Packit |
03b34a |
===============================================================================
|
|
Packit |
03b34a |
$Id: RAWSOCKET_NON_SEQUITUR,v 1.2 2004/01/03 20:31:00 mike Exp $
|
|
Packit |
03b34a |
LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
|
|
Packit |
03b34a |
http://www.packetfactory.net/libnet
|
|
Packit |
03b34a |
===============================================================================
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
Raw sockets are horribly non-standard across implementations. Here is
|
|
Packit |
03b34a |
an incomplete list of some of the differences (corrections welcomed):
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
Linux 2.2+:
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
IP fragmentation: performed if packet is larger than MTU
|
|
Packit |
03b34a |
IP checksum: always filled in
|
|
Packit |
03b34a |
IP total length: always filled in
|
|
Packit |
03b34a |
IP ID: filled in when zero
|
|
Packit |
03b34a |
IP source address: filled in when zero
|
|
Packit |
03b34a |
IP destination address: filled in when zero
|
|
Packit |
03b34a |
Max packet size before kernel complains: 1500 bytes
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
Solaris 2.6+:
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
IP fragmentation bits: can't specify
|
|
Packit |
03b34a |
IP fragmentation: performed if packet is larger than MTU
|
|
Packit |
03b34a |
IP DF bit: always set
|
|
Packit |
03b34a |
IP checksum: always filled in
|
|
Packit |
03b34a |
Max packet size before kernel complains: ?
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
OpenBSD 2.8+:
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
IP fragmentation: performed if packet is larger than MTU
|
|
Packit |
03b34a |
Max packet size before kernel complains: 8192 bytes
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
Solaris,
|
|
Packit |
03b34a |
for example, has terrible support for this packet interface. Older OpenBSD
|
|
Packit |
03b34a |
versions and recent FreeBSD versions have the BSD_BYTE_SWAP issue where
|
|
Packit |
03b34a |
the ip_len and ip_frag fields need to be in little endian order. Linux
|
|
Packit |
03b34a |
apparently doesn't allow for the injection of broadcast IP datagrams.
|
|
Packit |
03b34a |
Whenever complete control over the IP header is desired, use the link
|
|
Packit |
03b34a |
layer API.
|
|
Packit |
03b34a |
|
|
Packit |
03b34a |
EOF
|