libnet4r 0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +15 -0
- data/LICENSE +28 -0
- data/README +187 -0
- data/Rakefile +110 -0
- data/ext/extconf.rb +60 -0
- data/ext/libnet.c +705 -0
- data/ext/libnet_arp.c +152 -0
- data/ext/libnet_ethernet.c +115 -0
- data/ext/libnet_ipv4.c +140 -0
- data/ext/libnet_ipv6.c +138 -0
- data/ext/libnet_udp.c +112 -0
- data/ext/libnet_vlan.c +131 -0
- data/lib/libnet4r/header.rb +609 -0
- data/lib/libnet4r/helpers.rb +19 -0
- data/lib/libnet4r/libnet.rb +39 -0
- data/libnet/CVS/Entries +24 -0
- data/libnet/CVS/Repository +1 -0
- data/libnet/CVS/Root +1 -0
- data/libnet/Makefile.am +15 -0
- data/libnet/Makefile.am.common +10 -0
- data/libnet/Makefile.in +443 -0
- data/libnet/README +21 -0
- data/libnet/VERSION +1 -0
- data/libnet/acconfig.h +36 -0
- data/libnet/acinclude.m4 +463 -0
- data/libnet/aclocal.m4 +1337 -0
- data/libnet/autom4te.cache/CVS/Entries +1 -0
- data/libnet/autom4te.cache/CVS/Repository +1 -0
- data/libnet/autom4te.cache/CVS/Root +1 -0
- data/libnet/autom4te.cache/output.0 +6225 -0
- data/libnet/autom4te.cache/requests +111 -0
- data/libnet/autom4te.cache/traces.0 +272 -0
- data/libnet/config.guess +1314 -0
- data/libnet/config.sub +1410 -0
- data/libnet/configure +6225 -0
- data/libnet/configure.in +235 -0
- data/libnet/doc/BUGS +19 -0
- data/libnet/doc/CHANGELOG +527 -0
- data/libnet/doc/CONTRIB +53 -0
- data/libnet/doc/COPYING +31 -0
- data/libnet/doc/CVS/Entries +12 -0
- data/libnet/doc/CVS/Repository +1 -0
- data/libnet/doc/CVS/Root +1 -0
- data/libnet/doc/DESIGN_NOTES +134 -0
- data/libnet/doc/MIGRATION +172 -0
- data/libnet/doc/PACKET_BUILDING +161 -0
- data/libnet/doc/PORTED +45 -0
- data/libnet/doc/RAWSOCKET_NON_SEQUITUR +41 -0
- data/libnet/doc/TODO +96 -0
- data/libnet/doc/html/acconfig_8h-source.html +49 -0
- data/libnet/doc/html/annotated.html +17 -0
- data/libnet/doc/html/bpf_8h-source.html +277 -0
- data/libnet/doc/html/config_8h-source.html +125 -0
- data/libnet/doc/html/doxygen.css +169 -0
- data/libnet/doc/html/doxygen.png +0 -0
- data/libnet/doc/html/files.html +29 -0
- data/libnet/doc/html/functions.html +26 -0
- data/libnet/doc/html/functions_vars.html +26 -0
- data/libnet/doc/html/getopt_8h-source.html +97 -0
- data/libnet/doc/html/globals.html +219 -0
- data/libnet/doc/html/globals_defs.html +104 -0
- data/libnet/doc/html/globals_func.html +136 -0
- data/libnet/doc/html/gnuc_8h-source.html +56 -0
- data/libnet/doc/html/graph_legend.dot +22 -0
- data/libnet/doc/html/graph_legend.html +75 -0
- data/libnet/doc/html/ifaddrlist_8h-source.html +65 -0
- data/libnet/doc/html/in__systm_8h-source.html +90 -0
- data/libnet/doc/html/index.html +17 -0
- data/libnet/doc/html/libnet-asn1_8h-source.html +268 -0
- data/libnet/doc/html/libnet-functions_8h-source.html +742 -0
- data/libnet/doc/html/libnet-functions_8h.html +8844 -0
- data/libnet/doc/html/libnet-headers_8h-source.html +1655 -0
- data/libnet/doc/html/libnet-headers_8h.html +3053 -0
- data/libnet/doc/html/libnet-macros_8h-source.html +161 -0
- data/libnet/doc/html/libnet-macros_8h.html +358 -0
- data/libnet/doc/html/libnet-structures_8h-source.html +233 -0
- data/libnet/doc/html/libnet-types_8h-source.html +58 -0
- data/libnet/doc/html/libnet_8h-source.html +119 -0
- data/libnet/doc/html/libnet_8h.html +24 -0
- data/libnet/doc/html/structlibnet__802__1q__hdr.html +145 -0
- data/libnet/doc/html/structlibnet__802__1x__hdr.html +97 -0
- data/libnet/doc/libnet.doxygen.conf +1102 -0
- data/libnet/doc/man/CVS/Entries +1 -0
- data/libnet/doc/man/CVS/Repository +1 -0
- data/libnet/doc/man/CVS/Root +1 -0
- data/libnet/doc/man/man3/libnet-functions.h.3 +3136 -0
- data/libnet/doc/man/man3/libnet-headers.h.3 +1872 -0
- data/libnet/doc/man/man3/libnet-macros.h.3 +172 -0
- data/libnet/doc/man/man3/libnet.h.3 +17 -0
- data/libnet/doc/man/man3/libnet_802_1q_hdr.3 +53 -0
- data/libnet/doc/man/man3/libnet_802_1x_hdr.3 +41 -0
- data/libnet/include/CVS/Entries +10 -0
- data/libnet/include/CVS/Repository +1 -0
- data/libnet/include/CVS/Root +1 -0
- data/libnet/include/Makefile.am +7 -0
- data/libnet/include/Makefile.in +395 -0
- data/libnet/include/bpf.h +264 -0
- data/libnet/include/config.h.in +118 -0
- data/libnet/include/gnuc.h +43 -0
- data/libnet/include/ifaddrlist.h +52 -0
- data/libnet/include/libnet/CVS/Entries +9 -0
- data/libnet/include/libnet/CVS/Repository +1 -0
- data/libnet/include/libnet/CVS/Root +1 -0
- data/libnet/include/libnet/Makefile.am +12 -0
- data/libnet/include/libnet/Makefile.in +294 -0
- data/libnet/include/libnet/libnet-asn1.h +255 -0
- data/libnet/include/libnet/libnet-functions.h +2157 -0
- data/libnet/include/libnet/libnet-headers.h +1662 -0
- data/libnet/include/libnet/libnet-macros.h +186 -0
- data/libnet/include/libnet/libnet-structures.h +222 -0
- data/libnet/include/libnet/libnet-types.h +45 -0
- data/libnet/include/libnet.h.in +132 -0
- data/libnet/include/stamp-h.in +1 -0
- data/libnet/include/win32/CVS/Entries +5 -0
- data/libnet/include/win32/CVS/Repository +1 -0
- data/libnet/include/win32/CVS/Root +1 -0
- data/libnet/include/win32/config.h +112 -0
- data/libnet/include/win32/getopt.h +84 -0
- data/libnet/include/win32/in_systm.h +77 -0
- data/libnet/include/win32/libnet.h +106 -0
- data/libnet/install-sh +250 -0
- data/libnet/libnet-config.in +62 -0
- data/libnet/libnet.doxygen.conf +1102 -0
- data/libnet/man/CVS/Entries +1 -0
- data/libnet/man/CVS/Repository +1 -0
- data/libnet/man/CVS/Root +1 -0
- data/libnet/missing +283 -0
- data/libnet/mkinstalldirs +40 -0
- data/libnet/sample/CVS/Entries +47 -0
- data/libnet/sample/CVS/Repository +1 -0
- data/libnet/sample/CVS/Root +1 -0
- data/libnet/sample/Makefile.am +63 -0
- data/libnet/sample/Makefile.in +729 -0
- data/libnet/sample/arp-new.c +144 -0
- data/libnet/sample/arp.c +151 -0
- data/libnet/sample/bgp4_hdr.c +225 -0
- data/libnet/sample/bgp4_notification.c +242 -0
- data/libnet/sample/bgp4_open.c +266 -0
- data/libnet/sample/bgp4_update.c +337 -0
- data/libnet/sample/cdp.c +187 -0
- data/libnet/sample/dhcp_discover.c +257 -0
- data/libnet/sample/dns.c +260 -0
- data/libnet/sample/dot1x.c +113 -0
- data/libnet/sample/fddi_tcp1.c +213 -0
- data/libnet/sample/fddi_tcp2.c +209 -0
- data/libnet/sample/get_addr.c +112 -0
- data/libnet/sample/gre.c +410 -0
- data/libnet/sample/icmp6_echoreq.c +184 -0
- data/libnet/sample/icmp_echo_cq.c +201 -0
- data/libnet/sample/icmp_redirect.c +200 -0
- data/libnet/sample/icmp_timeexceed.c +190 -0
- data/libnet/sample/icmp_timestamp.c +157 -0
- data/libnet/sample/icmp_unreach.c +204 -0
- data/libnet/sample/ieee.c +177 -0
- data/libnet/sample/ip_link.c +201 -0
- data/libnet/sample/ip_raw.c +180 -0
- data/libnet/sample/isl.c +167 -0
- data/libnet/sample/libnet_test.h +60 -0
- data/libnet/sample/mpls.c +251 -0
- data/libnet/sample/ntp.c +193 -0
- data/libnet/sample/ospf_hello.c +179 -0
- data/libnet/sample/ospf_lsa.c +190 -0
- data/libnet/sample/ping_of_death.c +171 -0
- data/libnet/sample/rpc_tcp.c +214 -0
- data/libnet/sample/rpc_udp.c +213 -0
- data/libnet/sample/sebek.c +299 -0
- data/libnet/sample/smurf.c +194 -0
- data/libnet/sample/stp.c +227 -0
- data/libnet/sample/synflood.c +200 -0
- data/libnet/sample/synflood6.c +209 -0
- data/libnet/sample/synflood6_frag.c +234 -0
- data/libnet/sample/tcp1.c +227 -0
- data/libnet/sample/tcp2.c +192 -0
- data/libnet/sample/tftp.c +207 -0
- data/libnet/sample/tring_tcp1.c +214 -0
- data/libnet/sample/tring_tcp2.c +210 -0
- data/libnet/sample/udp1.c +223 -0
- data/libnet/sample/udp2.c +232 -0
- data/libnet/sample/win32/CVS/Entries +9 -0
- data/libnet/sample/win32/CVS/Repository +1 -0
- data/libnet/sample/win32/CVS/Root +1 -0
- data/libnet/sample/win32/arp/CVS/Entries +2 -0
- data/libnet/sample/win32/arp/CVS/Repository +1 -0
- data/libnet/sample/win32/arp/CVS/Root +1 -0
- data/libnet/sample/win32/arp/arp.vcproj +136 -0
- data/libnet/sample/win32/cdp/CVS/Entries +2 -0
- data/libnet/sample/win32/cdp/CVS/Repository +1 -0
- data/libnet/sample/win32/cdp/CVS/Root +1 -0
- data/libnet/sample/win32/cdp/cdp.vcproj +136 -0
- data/libnet/sample/win32/dhcp_discover/CVS/Entries +2 -0
- data/libnet/sample/win32/dhcp_discover/CVS/Repository +1 -0
- data/libnet/sample/win32/dhcp_discover/CVS/Root +1 -0
- data/libnet/sample/win32/dhcp_discover/dhcp_discover.vcproj +139 -0
- data/libnet/sample/win32/dns/CVS/Entries +2 -0
- data/libnet/sample/win32/dns/CVS/Repository +1 -0
- data/libnet/sample/win32/dns/CVS/Root +1 -0
- data/libnet/sample/win32/dns/dns.vcproj +139 -0
- data/libnet/sample/win32/get_addr/CVS/Entries +2 -0
- data/libnet/sample/win32/get_addr/CVS/Repository +1 -0
- data/libnet/sample/win32/get_addr/CVS/Root +1 -0
- data/libnet/sample/win32/get_addr/get_addr.vcproj +139 -0
- data/libnet/sample/win32/getopt.c +121 -0
- data/libnet/sample/win32/icmp_echo_cq/CVS/Entries +2 -0
- data/libnet/sample/win32/icmp_echo_cq/CVS/Repository +1 -0
- data/libnet/sample/win32/icmp_echo_cq/CVS/Root +1 -0
- data/libnet/sample/win32/icmp_echo_cq/icmp_echo_cq.vcproj +139 -0
- data/libnet/sample/win32/tcp1/CVS/Entries +2 -0
- data/libnet/sample/win32/tcp1/CVS/Repository +1 -0
- data/libnet/sample/win32/tcp1/CVS/Root +1 -0
- data/libnet/sample/win32/tcp1/tcp1.vcproj +142 -0
- data/libnet/sample/win32/udp1/CVS/Entries +3 -0
- data/libnet/sample/win32/udp1/CVS/Repository +1 -0
- data/libnet/sample/win32/udp1/CVS/Root +1 -0
- data/libnet/sample/win32/udp1/dns.vcproj +125 -0
- data/libnet/sample/win32/udp1/udp1.vcproj +139 -0
- data/libnet/src/CVS/Entries +60 -0
- data/libnet/src/CVS/Repository +1 -0
- data/libnet/src/CVS/Root +1 -0
- data/libnet/src/Makefile.am +71 -0
- data/libnet/src/Makefile.in +428 -0
- data/libnet/src/libnet_advanced.c +136 -0
- data/libnet/src/libnet_asn1.c +436 -0
- data/libnet/src/libnet_build_802.1q.c +115 -0
- data/libnet/src/libnet_build_802.1x.c +103 -0
- data/libnet/src/libnet_build_802.2.c +167 -0
- data/libnet/src/libnet_build_802.3.c +101 -0
- data/libnet/src/libnet_build_arp.c +169 -0
- data/libnet/src/libnet_build_bgp.c +350 -0
- data/libnet/src/libnet_build_cdp.c +191 -0
- data/libnet/src/libnet_build_data.c +90 -0
- data/libnet/src/libnet_build_dhcp.c +156 -0
- data/libnet/src/libnet_build_dns.c +129 -0
- data/libnet/src/libnet_build_ethernet.c +173 -0
- data/libnet/src/libnet_build_fddi.c +191 -0
- data/libnet/src/libnet_build_gre.c +427 -0
- data/libnet/src/libnet_build_icmp.c +437 -0
- data/libnet/src/libnet_build_igmp.c +112 -0
- data/libnet/src/libnet_build_ip.c +892 -0
- data/libnet/src/libnet_build_ipsec.c +232 -0
- data/libnet/src/libnet_build_isl.c +113 -0
- data/libnet/src/libnet_build_link.c +90 -0
- data/libnet/src/libnet_build_mpls.c +112 -0
- data/libnet/src/libnet_build_ntp.c +121 -0
- data/libnet/src/libnet_build_ospf.c +699 -0
- data/libnet/src/libnet_build_rip.c +108 -0
- data/libnet/src/libnet_build_rpc.c +138 -0
- data/libnet/src/libnet_build_sebek.c +108 -0
- data/libnet/src/libnet_build_snmp.c +52 -0
- data/libnet/src/libnet_build_stp.c +222 -0
- data/libnet/src/libnet_build_tcp.c +365 -0
- data/libnet/src/libnet_build_token_ring.c +193 -0
- data/libnet/src/libnet_build_udp.c +111 -0
- data/libnet/src/libnet_build_vrrp.c +117 -0
- data/libnet/src/libnet_checksum.c +376 -0
- data/libnet/src/libnet_cq.c +395 -0
- data/libnet/src/libnet_crc.c +113 -0
- data/libnet/src/libnet_dll.c +47 -0
- data/libnet/src/libnet_error.c +55 -0
- data/libnet/src/libnet_if_addr.c +415 -0
- data/libnet/src/libnet_init.c +234 -0
- data/libnet/src/libnet_internal.c +310 -0
- data/libnet/src/libnet_link_bpf.c +348 -0
- data/libnet/src/libnet_link_dlpi.c +785 -0
- data/libnet/src/libnet_link_linux.c +310 -0
- data/libnet/src/libnet_link_nit.c +125 -0
- data/libnet/src/libnet_link_none.c +66 -0
- data/libnet/src/libnet_link_pf.c +179 -0
- data/libnet/src/libnet_link_snit.c +149 -0
- data/libnet/src/libnet_link_snoop.c +166 -0
- data/libnet/src/libnet_link_win32.c +346 -0
- data/libnet/src/libnet_pblock.c +511 -0
- data/libnet/src/libnet_port_list.c +295 -0
- data/libnet/src/libnet_prand.c +106 -0
- data/libnet/src/libnet_raw.c +257 -0
- data/libnet/src/libnet_resolve.c +414 -0
- data/libnet/src/libnet_version.c +54 -0
- data/libnet/src/libnet_write.c +502 -0
- data/libnet/version.h.in +6 -0
- data/libnet/win32/CVS/Entries +15 -0
- data/libnet/win32/CVS/Repository +1 -0
- data/libnet/win32/CVS/Root +1 -0
- data/libnet/win32/Libnet-1.1.1-2002.sln +77 -0
- data/libnet/win32/Libnet-1.1.1-2003.ncb +0 -0
- data/libnet/win32/Libnet-1.1.1-2003.sln +84 -0
- data/libnet/win32/Libnet-1.1.1-2003.suo +0 -0
- data/libnet/win32/Libnet-1.1.1.vcproj +311 -0
- data/libnet/win32/Libnet-latest.ncb +0 -0
- data/libnet/win32/Libnet-latest.opt +0 -0
- data/libnet/win32/Libnet-latest.sln +77 -0
- data/libnet/win32/Libnet-latest.suo +0 -0
- data/libnet/win32/Libnet-latest.vcproj +311 -0
- data/libnet/win32/Libnet.dsp +337 -0
- data/libnet/win32/Libnet.dsw +32 -0
- data/libnet/win32/README.txt +57 -0
- data/libnet/win32/libnet_dll.def +164 -0
- data/test/tc_arp.rb +169 -0
- data/test/tc_class.rb +219 -0
- data/test/tc_ethernet.rb +97 -0
- data/test/tc_header.rb +163 -0
- data/test/tc_init.rb +25 -0
- data/test/tc_ipv4.rb +219 -0
- data/test/tc_ipv6.rb +235 -0
- data/test/tc_udp.rb +229 -0
- data/test/tc_vlan.rb +118 -0
- data/test/ts_all.rb +15 -0
- metadata +401 -0
@@ -0,0 +1,134 @@
|
|
1
|
+
===============================================================================
|
2
|
+
$Id: DESIGN_NOTES,v 1.3 2004/01/17 07:51:19 mike Exp $
|
3
|
+
LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
|
4
|
+
http://www.packetfactory.net/libnet
|
5
|
+
===============================================================================
|
6
|
+
|
7
|
+
|
8
|
+
DESIGN NOTES
|
9
|
+
|
10
|
+
In order to remove most of the decisions a user had to make (how much
|
11
|
+
memory to allocate for a packet, where to build the packet headers, where
|
12
|
+
to do the checksums, how to inject the packet, etc) I decided to move ALL
|
13
|
+
of that logic into the library, behind the scenes. To initialize
|
14
|
+
things and get an initial libnet context, the applications programmer
|
15
|
+
calls:
|
16
|
+
|
17
|
+
libnet_t *l;
|
18
|
+
l = libnet_init(INJECTION_TYPE, PROTOCOL, DEVICE, ERRBUFFER);
|
19
|
+
|
20
|
+
where:
|
21
|
+
|
22
|
+
INJECTION_TYPE = LIBNET_RAW4 (ipv4 raw socket)
|
23
|
+
LIBNET_RAW6 (ipv6 raw socket)
|
24
|
+
LIBNET_LINK (link-layer socket)
|
25
|
+
LIBNET_RAW4_ADV (advanced mode)
|
26
|
+
LIBNET_RAW6_ADV (advanced mode)
|
27
|
+
LIBNET_LINK_ADV (advanced mode)
|
28
|
+
|
29
|
+
PROTOCOL = IP protocol to be used for the raw socket. This is
|
30
|
+
ignored for the link-layer, and almost always
|
31
|
+
IPPROTO_RAW for ipv4.
|
32
|
+
|
33
|
+
DEVICE = The canoical name of the device, used only with the link
|
34
|
+
layer stuff. For ipv4 raw socket, you can leave this
|
35
|
+
NULL. If it's NULL with the link-layer, libnet will try
|
36
|
+
to find a suitable device.
|
37
|
+
|
38
|
+
ERRBUFFER = Until we have our libnet context l, this is where
|
39
|
+
errors will be.
|
40
|
+
|
41
|
+
Inside of this newly created context we have a ton of stuff including a
|
42
|
+
file descriptor for the packet device the injection type, the device name
|
43
|
+
(if applicable) a pointer to the libnet protocol block structure and some
|
44
|
+
other ancillary data.
|
45
|
+
|
46
|
+
Additionally, we will soon be supporting context manipulation functions
|
47
|
+
that will allow the user to set certain flags inside the context. This
|
48
|
+
interface will be akin to libnet_toggle_checksum() for those of you who
|
49
|
+
care.
|
50
|
+
|
51
|
+
When a packet is first constructed, the protocol block (pblock) stuff comes
|
52
|
+
into play. On the outside, to an applications programmer, a packet is
|
53
|
+
constructed more or less like normal (with a few notable exceptions):
|
54
|
+
|
55
|
+
libnet_ptag_t ip_tag;
|
56
|
+
ip_tag = libnet_build_ipv4(
|
57
|
+
LIBNET_UDP_H,
|
58
|
+
0,
|
59
|
+
242,
|
60
|
+
0,
|
61
|
+
64,
|
62
|
+
IPPROTO_UDP,
|
63
|
+
0, /* NEW: checksum */
|
64
|
+
src_ip,
|
65
|
+
dst_ip,
|
66
|
+
NULL,
|
67
|
+
0,
|
68
|
+
l, /* NEW: libnet context */
|
69
|
+
0 /* NEW: libnet ptag */
|
70
|
+
);
|
71
|
+
|
72
|
+
The checksum allows an applications programmer to decide if he wants to
|
73
|
+
specify his own random value (useful in NIDS fooling) or precompute the
|
74
|
+
sum elsewhere, or leave it zero and by default libnet will take care of it
|
75
|
+
(although this is over-ridable). The libnet context is the opague
|
76
|
+
pointer we allocated earlier and will show up in just about every libnet
|
77
|
+
function call from here on out. The libnet ptag is a way to reference an
|
78
|
+
ALREADY BUILT protocol block. This is necessary if you want to change
|
79
|
+
some values of a header inside of a packet injection loop.
|
80
|
+
|
81
|
+
So, when you call a build function, internally, it's a completely new
|
82
|
+
system. If the item you're constructing is NEW, a new pblock will be
|
83
|
+
allocated and linked onto the end of the list. It may be helpful to think
|
84
|
+
of this as a "protocol stack" because you MUST build your packets IN
|
85
|
+
ORDER, from the top of the protocol stack on down (i.e.: tcp -> ip ->
|
86
|
+
ethernet). Once you build a new protocol block, it's "pushed down on the
|
87
|
+
stack" and you move on to the next. However, this analogy breaks down
|
88
|
+
because you can modify any one of these items and when they're assembled
|
89
|
+
for the final packet, libnet starts at the head of the list. It may be
|
90
|
+
MORE helpful to think of the pblock chain as a doubly linked FIFO
|
91
|
+
queue, because that's what it is. :)
|
92
|
+
|
93
|
+
For example:
|
94
|
+
|
95
|
+
libnet_ptag_t 1;
|
96
|
+
libnet_ptag_t 2;
|
97
|
+
libnet_ptag_t 3;
|
98
|
+
|
99
|
+
1 = libnet_build_data(blah, l, 0);
|
100
|
+
2 = libnet_build_tcp(blah, l, 0);
|
101
|
+
3 = libnet_build_ipv4(blah, l, 0);
|
102
|
+
|
103
|
+
Will result in:
|
104
|
+
---------- ---------- ----------
|
105
|
+
l->protocol_blocks--->| data |----->| tcp |----->| ip |
|
106
|
+
| pblock |<-----| pblock |<-----| pblock |----|
|
107
|
+
--| ptag: 1| | ptag: 2| | ptag: 3| |
|
108
|
+
| ---------- ---------- ---------- v
|
109
|
+
| -----
|
110
|
+
|-------------------------------------------> ---
|
111
|
+
-
|
112
|
+
|
113
|
+
To access and change the ip header, an additional call to libnet_build_ipv4
|
114
|
+
with the ptag argument would be made:
|
115
|
+
|
116
|
+
libnet_build_ipv4(blah..., l, 3);
|
117
|
+
|
118
|
+
Note that the ptag DOES NOT CHANGE. Once a pblock is built, its tag is
|
119
|
+
set in stone.
|
120
|
+
|
121
|
+
When it comes time to write the packet to the wire,
|
122
|
+
libnet_pblock_coalesce() is called to assemble the packet fragments.
|
123
|
+
|
124
|
+
1) Gather up all of the pblock sizes in order to allocate one
|
125
|
+
contiguous block of memory.
|
126
|
+
2) Copy over the packet fragments.
|
127
|
+
3) Check each pblock to see which items need checksums, then perform
|
128
|
+
that checksum over each portion (the entire packet is needed for
|
129
|
+
some checksums).
|
130
|
+
|
131
|
+
So that's a quick description of what's going on under the hood. There's
|
132
|
+
more, but this should be enough to get you started.
|
133
|
+
|
134
|
+
EOF
|
@@ -0,0 +1,172 @@
|
|
1
|
+
===============================================================================
|
2
|
+
$Id: MIGRATION,v 1.2 2004/01/03 20:31:00 mike Exp $
|
3
|
+
LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
|
4
|
+
http://www.packetfactory.net/libnet
|
5
|
+
===============================================================================
|
6
|
+
|
7
|
+
|
8
|
+
MIGRATING YOUR CODE AND QUICKSTART
|
9
|
+
|
10
|
+
Using Libnet 1.1 you will find it MUCH simpler to build and write packets
|
11
|
+
than before. Instead of the previous five steps (initialize memory,
|
12
|
+
initialize network, build packet, do checksums, write packet) there are
|
13
|
+
now only three steps (initialize library, build packet, write packet).
|
14
|
+
In order to port your existing code, you will mainly be REMOVING
|
15
|
+
function calls and variables.
|
16
|
+
|
17
|
+
1) Start with code removal:
|
18
|
+
|
19
|
+
- Remove all calls to libnet_init_packet() / packet malloc()ing and
|
20
|
+
all associated variables.
|
21
|
+
- Remove all calls to libnet_open_raw_sock() / libnet_open_link_layer()
|
22
|
+
and all associated variables.
|
23
|
+
- Remove all calls to libnet_do_checksum() and all associated
|
24
|
+
variables.
|
25
|
+
|
26
|
+
2) Continue with code addition and modification:
|
27
|
+
|
28
|
+
- You will need a single "libnet_t *l" which is your libnet file
|
29
|
+
context and an error buffer:
|
30
|
+
|
31
|
+
libnet_t *l
|
32
|
+
char errbuf[LIBNET_ERRBUF_SIZE];
|
33
|
+
|
34
|
+
l = libnet_init(
|
35
|
+
LIBNET_RAW4, /* or LIBNET_LINK or LIBNET_RAW6 */
|
36
|
+
NULL, /* or device if you using LIBNET_LINK */
|
37
|
+
errbuf);
|
38
|
+
|
39
|
+
- The libnet_build functions are largely unchanged with a few
|
40
|
+
important differences:
|
41
|
+
|
42
|
+
1) Packets headers MUST be stacked IN ORDER. This is
|
43
|
+
intuitive and shouldn't be a problem. Due to the way
|
44
|
+
individual packet header memory is allocated and how
|
45
|
+
packet pieces are combined to build a packet they HAVE to
|
46
|
+
be built IN ORDER, from the high end of the protocol stack
|
47
|
+
on down. ie: using the raw interface to build a NTP
|
48
|
+
packet, you would:
|
49
|
+
libnet_build_ntp(...)
|
50
|
+
libnet_build_udp(...)
|
51
|
+
libnet_build_ipv4(...)
|
52
|
+
To build the same packet using the LINK interface on
|
53
|
+
top of ethernet you would:
|
54
|
+
libnet_build_ntp(...)
|
55
|
+
libnet_build_udp(...)
|
56
|
+
libnet_build_ipv4(...)
|
57
|
+
libnet_build_ethernet(...)
|
58
|
+
1a) There is the option now of using libnet_autobuild_ipv4()
|
59
|
+
and libnet_autobuild_ethernet() which have fewer
|
60
|
+
arguments and smaller stack frames and are a bit more
|
61
|
+
convenient.
|
62
|
+
2) The libnet_build functions return a libnet_ptag_t datatype
|
63
|
+
on success or -1 on error. This ptag is your
|
64
|
+
"protocol/packet tag" so you can find this header again
|
65
|
+
if you needed to modify it later on. If you don't need
|
66
|
+
to modify the packet header you can throw this value
|
67
|
+
away. You should definitely check for error now on
|
68
|
+
your build functions. Alot's going on down there fellas.
|
69
|
+
2a) NOTE that after packets are built, they may accessed
|
70
|
+
independently of construction order via the saved ptag.
|
71
|
+
3) They NO LONGER ACCEPT BUFFER ARGUMENTS. This is ALL
|
72
|
+
done internally. The last TWO arguments are the libnet
|
73
|
+
context you created in your call to libnet_init() and
|
74
|
+
an OPTIONAL ptag argument. The ptag argument, if non-zero,
|
75
|
+
specifes a packet tag to an ALREADY EXISTING packet header
|
76
|
+
that will be OVERWRITTEN with the values specified in
|
77
|
+
this libnet_build function call. This is how you modify
|
78
|
+
existing packet header pieces. If this ptag is 0,
|
79
|
+
a new protocol block is allocated and the packet is
|
80
|
+
pushed down on the "protocol stack".
|
81
|
+
4) For the functions that build headers that have checksums
|
82
|
+
these are NOW SPECIFIED AS AN ARGUMENT. This adds more
|
83
|
+
flexibility in how checksums are done (you can leave the
|
84
|
+
field 0, put in a random value, precompute it on your own,
|
85
|
+
or let the library do it). By default, when you build
|
86
|
+
a header, a "DO_CHECKSUM" flag will be set. This means
|
87
|
+
the library will compute the checksum for the header
|
88
|
+
and possibly over the data before the packet is written.
|
89
|
+
To clear this flag, there is a special macro you
|
90
|
+
can call on the ptag refering to that header.
|
91
|
+
5) For the functions that have a length, it now specifies
|
92
|
+
the TOTAL packet length from that protocol unit on down.
|
93
|
+
For IP, that would be the entire packet length. For
|
94
|
+
TCP, that would be TCP and any possible data.
|
95
|
+
6) Nomenclature support for the eventual support of ipv6
|
96
|
+
has been added.
|
97
|
+
|
98
|
+
libnet_ptag_t ip_tag;
|
99
|
+
libnet_ptag_t tcp_tag;
|
100
|
+
|
101
|
+
tcp_tag = libnet_build_tcp(
|
102
|
+
src_prt, /* source TCP port */
|
103
|
+
dst_prt, /* destination TCP port */
|
104
|
+
0xffff, /* sequence number */
|
105
|
+
0x53, /* acknowledgement number */
|
106
|
+
TH_SYN, /* control flags */
|
107
|
+
1024, /* window size */
|
108
|
+
0xd00d, /* checksum */
|
109
|
+
0, /* urgent pointer */
|
110
|
+
LIBNET_TCP_H /* TCP packet size */
|
111
|
+
NULL, /* payload (none) */
|
112
|
+
0, /* payload length */
|
113
|
+
l, /* libnet context */
|
114
|
+
0); /* ptag */
|
115
|
+
|
116
|
+
ip_tag = libnet_build_ipv4(
|
117
|
+
LIBNET_TCP_H + LIBNET_IPV4_H,/* total packet len */
|
118
|
+
IPTOS_LOWDELAY, /* tos */
|
119
|
+
ip_id, /* IP ID */
|
120
|
+
0, /* IP Frag */
|
121
|
+
64, /* TTL */
|
122
|
+
IPPROTO_TCP, /* protocol */
|
123
|
+
0, /* checksum */
|
124
|
+
src_ip, /* source ip */
|
125
|
+
dst_ip, /* dest ip */
|
126
|
+
NULL, /* payload (none) */
|
127
|
+
0, /* payload size */
|
128
|
+
l, /* libnet context */
|
129
|
+
0); /* ptag */
|
130
|
+
|
131
|
+
Now, if you wanted to modify one of these headers in a loop
|
132
|
+
somewhere you would:
|
133
|
+
|
134
|
+
int i;
|
135
|
+
for (ip_tag, tcp_tag = LIBNET_PTAG_INITIALIZER, i = 0; i < 10; i++)
|
136
|
+
{
|
137
|
+
tcp_tag = libnet_build_tcp(++src_prt, ..., l, tcp_tag);
|
138
|
+
ip_tag = libnet_build_ipv4(..., ++ip_id, ..., l, ip_tag);
|
139
|
+
/* do something */
|
140
|
+
}
|
141
|
+
Since we are specifying a ptag for an existing header, the
|
142
|
+
build function will NOT create a new header and append it to
|
143
|
+
the list, it will FIND the one referenced by the ptag and UPDATE
|
144
|
+
it. Since there is nothing new being created, order is NOT
|
145
|
+
important here.
|
146
|
+
|
147
|
+
Also note that it's perfectly fine to wrap the loop around the
|
148
|
+
initial building of the packets. Since we're initializing the
|
149
|
+
ptags (to be zero), the first call into the builder functions
|
150
|
+
will allocate the memory and create the packet blocks. These
|
151
|
+
calls will return ptag values. The next calls will modify
|
152
|
+
these headers since the ptags will not be NULL.
|
153
|
+
|
154
|
+
- Finally, we write the packet. Checksums are computed, by default
|
155
|
+
for each protocol header that requires one. If the user specifies
|
156
|
+
a non-zero value, by default, this will be used INSTEAD of a
|
157
|
+
libnet computed checksum. This behavior is overridable with:
|
158
|
+
|
159
|
+
Turn ON checksums for header referenced by ptag:
|
160
|
+
libnet_toggle_checksum(l, ptag, 1)
|
161
|
+
|
162
|
+
Turn OFF checksums for header referenced by ptag:
|
163
|
+
libnet_toggle_checksum(l, ptag, 0)
|
164
|
+
|
165
|
+
Note, the packet header MUST exist before you can toggle this setting.
|
166
|
+
|
167
|
+
int c;
|
168
|
+
c = libnet_write(l);
|
169
|
+
|
170
|
+
Boom. You're done. Now go read the sample code.
|
171
|
+
|
172
|
+
EOF
|
@@ -0,0 +1,161 @@
|
|
1
|
+
===============================================================================
|
2
|
+
$Id: PACKET_BUILDING,v 1.2 2004/01/03 20:31:00 mike Exp $
|
3
|
+
LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
|
4
|
+
http://www.packetfactory.net/libnet
|
5
|
+
===============================================================================
|
6
|
+
|
7
|
+
|
8
|
+
ADDING A NEW PACKET BUILDER
|
9
|
+
|
10
|
+
Adding a new packet building module is usually pretty simple. It depends
|
11
|
+
completely on the complexity of the protocol. The following document
|
12
|
+
shows you how to add a packet builder for a simple protocol with a
|
13
|
+
static header size, but these concepts can be extended to a complex
|
14
|
+
protocol also.
|
15
|
+
|
16
|
+
1) Start by defining your protocol header format in libnet-headers.h:
|
17
|
+
|
18
|
+
#define LIBNET_XXX_H 0xSIZE
|
19
|
+
|
20
|
+
struct XXX_hdr
|
21
|
+
{
|
22
|
+
u_char field1;
|
23
|
+
u_short field2;
|
24
|
+
u_long field3;
|
25
|
+
};
|
26
|
+
|
27
|
+
2) Add a pblock definition to libnet-structures.h (appened to the list):
|
28
|
+
|
29
|
+
#define LIBNET_PBLOCK_XXX_H 0xNUMBER
|
30
|
+
|
31
|
+
3) Then work from the following template for libnet_build_XXX.c:
|
32
|
+
|
33
|
+
#if (HAVE_CONFIG_H)
|
34
|
+
#include "../include/config.h"
|
35
|
+
#endif
|
36
|
+
#include "../include/libnet.h"
|
37
|
+
|
38
|
+
|
39
|
+
libnet_ptag_t
|
40
|
+
libnet_build_XXX(u_char arg1, u_short arg2, u_long arg3, u_char *payload,
|
41
|
+
u_long payload_s, libnet_t *l, libnet_ptag_t ptag)
|
42
|
+
{
|
43
|
+
/*
|
44
|
+
* n is the size of the protocol unit. This is usually the header size
|
45
|
+
* plus the payload size. This is also how many bytes are allocated on
|
46
|
+
* the heap to hold this protocol unit.
|
47
|
+
*/
|
48
|
+
u_long n;
|
49
|
+
|
50
|
+
/*
|
51
|
+
* h is used inside the pblock structure to let libnet know how big
|
52
|
+
* much data to checksum. This is different for different protocols.
|
53
|
+
* The IPv4 checksum covers the IP header only, while TCP and UDP
|
54
|
+
* checksums cover header and data.
|
55
|
+
*/
|
56
|
+
u_short h;
|
57
|
+
|
58
|
+
/*
|
59
|
+
* p will be used to refer to the protocol block that will either be
|
60
|
+
* allocated if the function's pt argument is 0, or located if ptag refers
|
61
|
+
* to a previously created protocol unit.
|
62
|
+
*/
|
63
|
+
libnet_pblock_t *p;
|
64
|
+
|
65
|
+
/*
|
66
|
+
* XXX_hdr is the header structure that will be overlaid onto the
|
67
|
+
* allocated memory by way of a memcpy.
|
68
|
+
*/
|
69
|
+
struct libnet_XXX_hdr XXX_hdr;
|
70
|
+
|
71
|
+
/*
|
72
|
+
* Here we sanity check to make sure we have a live l.
|
73
|
+
*/
|
74
|
+
if (l == NULL)
|
75
|
+
{
|
76
|
+
return (-1);
|
77
|
+
}
|
78
|
+
|
79
|
+
n = LIBNET_XXX_H + payload_s;
|
80
|
+
h = 0; /* no checksum by default */
|
81
|
+
|
82
|
+
/*
|
83
|
+
* Find the existing protocol block if a ptag is specified, or create
|
84
|
+
* a new one.
|
85
|
+
*/
|
86
|
+
p = libnet_pblock_probe(l, pt, n, LIBNET_PBLOCK_XXX_H);
|
87
|
+
if (p == NULL)
|
88
|
+
{
|
89
|
+
return (-1);
|
90
|
+
}
|
91
|
+
|
92
|
+
/*
|
93
|
+
* Build your packet here. Be sure to call appropriate endian conversion
|
94
|
+
* routines.
|
95
|
+
*/
|
96
|
+
XXX_hdr.field1 = arg1;
|
97
|
+
XXX_hdr.field2 = htons(arg2);
|
98
|
+
XXX_hdr.field3 = htonl(arg3);
|
99
|
+
|
100
|
+
/*
|
101
|
+
* Appened the protocol unit to the list.
|
102
|
+
*/
|
103
|
+
n = libnet_pblock_append(l, p, (u_char *)&XXX_hdr, LIBNET_XXX_H);
|
104
|
+
if (n == -1)
|
105
|
+
{
|
106
|
+
goto bad;
|
107
|
+
}
|
108
|
+
|
109
|
+
/*
|
110
|
+
* Sanity check the payload arguments.
|
111
|
+
*/
|
112
|
+
if ((payload && !payload_s) || (!payload && payload_s))
|
113
|
+
{
|
114
|
+
sprintf(l->err_buf, "%s(): payload inconsistency\n", __FUNCTION__);
|
115
|
+
goto bad;
|
116
|
+
}
|
117
|
+
|
118
|
+
/*
|
119
|
+
* Append the payload to the list if it exists.
|
120
|
+
*/
|
121
|
+
if (payload && payload_s)
|
122
|
+
{
|
123
|
+
n = libnet_pblock_append(l, p, payload, payload_s);
|
124
|
+
if (n == -1)
|
125
|
+
{
|
126
|
+
goto bad;
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
/*
|
131
|
+
* If this packet header has a checksum field, you'll add this
|
132
|
+
* and you'll have to edit libnet_checksum.c to add it to the switch
|
133
|
+
* table. You might have to define the protocol number too.
|
134
|
+
*/
|
135
|
+
if (sum == 0 && l->injection_type != LIBNET_RAW4)
|
136
|
+
{
|
137
|
+
/*
|
138
|
+
* If checksum is zero, by default libnet will compute a checksum
|
139
|
+
* for the user. The programmer can override this by calling
|
140
|
+
* libnet_toggle_checksum(l, ptag, 1);
|
141
|
+
*/
|
142
|
+
libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
|
143
|
+
}
|
144
|
+
|
145
|
+
/*
|
146
|
+
* Update the protocol block's meta information and return the protocol
|
147
|
+
* tag id of this pblock. This tag will be used to locate the pblock
|
148
|
+
* in order to modify the protocol header in subsequent calls.
|
149
|
+
*/
|
150
|
+
return (pt ? pt : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_XXX_H));
|
151
|
+
bad:
|
152
|
+
libnet_pblock_delete(l, p);
|
153
|
+
return (-1);
|
154
|
+
|
155
|
+
}
|
156
|
+
4) Add it to src/Makefile.am and then automake from the TLD.
|
157
|
+
5) Test the shit out of it.
|
158
|
+
6) Send it over to mike@infonexus.com.
|
159
|
+
|
160
|
+
|
161
|
+
EOF
|
data/libnet/doc/PORTED
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
===============================================================================
|
2
|
+
$Id: PORTED,v 1.2 2004/01/03 20:31:00 mike Exp $
|
3
|
+
LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
|
4
|
+
http://www.packetfactory.net/libnet
|
5
|
+
===============================================================================
|
6
|
+
|
7
|
+
|
8
|
+
1.1.0 PORTED OPERATING SYSTEMS
|
9
|
+
|
10
|
+
If you verify libnet building and running successfully (sample code works)
|
11
|
+
on a platform not listed here please send email to mike@infonexus.com.
|
12
|
+
|
13
|
+
- BSD/OS
|
14
|
+
4.x
|
15
|
+
|
16
|
+
- Cygwin
|
17
|
+
- requires winpcap (http://netgroup-serv.polito.it/winpcap) and pcap
|
18
|
+
header files copied to /usr/include/pcap/ and the library files to
|
19
|
+
be copied to /usr/lib/
|
20
|
+
|
21
|
+
- FreeBSD
|
22
|
+
version?
|
23
|
+
|
24
|
+
- HPUX
|
25
|
+
11.0
|
26
|
+
|
27
|
+
- Linux
|
28
|
+
2.0.x
|
29
|
+
2.2.x
|
30
|
+
2.4.x
|
31
|
+
|
32
|
+
- OpenBSD
|
33
|
+
2.x
|
34
|
+
3.x
|
35
|
+
|
36
|
+
- OS/X
|
37
|
+
version?
|
38
|
+
|
39
|
+
- Solaris
|
40
|
+
2.x
|
41
|
+
7
|
42
|
+
8
|
43
|
+
9
|
44
|
+
|
45
|
+
EOF
|
@@ -0,0 +1,41 @@
|
|
1
|
+
===============================================================================
|
2
|
+
$Id: RAWSOCKET_NON_SEQUITUR,v 1.2 2004/01/03 20:31:00 mike Exp $
|
3
|
+
LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
|
4
|
+
http://www.packetfactory.net/libnet
|
5
|
+
===============================================================================
|
6
|
+
|
7
|
+
Raw sockets are horribly non-standard across implementations. Here is
|
8
|
+
an incomplete list of some of the differences (corrections welcomed):
|
9
|
+
|
10
|
+
Linux 2.2+:
|
11
|
+
|
12
|
+
IP fragmentation: performed if packet is larger than MTU
|
13
|
+
IP checksum: always filled in
|
14
|
+
IP total length: always filled in
|
15
|
+
IP ID: filled in when zero
|
16
|
+
IP source address: filled in when zero
|
17
|
+
IP destination address: filled in when zero
|
18
|
+
Max packet size before kernel complains: 1500 bytes
|
19
|
+
|
20
|
+
Solaris 2.6+:
|
21
|
+
|
22
|
+
IP fragmentation bits: can't specify
|
23
|
+
IP fragmentation: performed if packet is larger than MTU
|
24
|
+
IP DF bit: always set
|
25
|
+
IP checksum: always filled in
|
26
|
+
Max packet size before kernel complains: ?
|
27
|
+
|
28
|
+
OpenBSD 2.8+:
|
29
|
+
|
30
|
+
IP fragmentation: performed if packet is larger than MTU
|
31
|
+
Max packet size before kernel complains: 8192 bytes
|
32
|
+
|
33
|
+
Solaris,
|
34
|
+
for example, has terrible support for this packet interface. Older OpenBSD
|
35
|
+
versions and recent FreeBSD versions have the BSD_BYTE_SWAP issue where
|
36
|
+
the ip_len and ip_frag fields need to be in little endian order. Linux
|
37
|
+
apparently doesn't allow for the injection of broadcast IP datagrams.
|
38
|
+
Whenever complete control over the IP header is desired, use the link
|
39
|
+
layer API.
|
40
|
+
|
41
|
+
EOF
|
data/libnet/doc/TODO
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
===============================================================================
|
2
|
+
$Id: TODO,v 1.2 2004/01/03 20:31:00 mike Exp $
|
3
|
+
LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
|
4
|
+
http://www.packetfactory.net/libnet
|
5
|
+
===============================================================================
|
6
|
+
|
7
|
+
|
8
|
+
1.1.x TODO LIST
|
9
|
+
|
10
|
+
* Update the man page!
|
11
|
+
|
12
|
+
- Add a programmer's man page detailing the pblock architecture.
|
13
|
+
|
14
|
+
- Fix plist memory leak.
|
15
|
+
|
16
|
+
- Fix IPv6. According to RFC 2992:
|
17
|
+
"Another difference from IPv4 raw sockets is that complete packets
|
18
|
+
(that is, IPv6 packets with extension headers) cannot be read or
|
19
|
+
written using the IPv6 raw sockets API. Instead, ancillary data
|
20
|
+
objects are used to transfer the extension headers, as described
|
21
|
+
later in this document. Should an application need access to the
|
22
|
+
complete IPv6 packet, some other technique, such as the datalink
|
23
|
+
interfaces BPF or DLPI, must be used.
|
24
|
+
|
25
|
+
All fields in the IPv6 header that an application might want to
|
26
|
+
change (i.e., everything other than the version number) can be
|
27
|
+
modified using ancillary data and/or socket options by the
|
28
|
+
application for output. All fields in a received IPv6 header (other
|
29
|
+
than the version number and Next Header fields) and all extension
|
30
|
+
headers are also made available to the application as ancillary data
|
31
|
+
on input. Hence there is no need for a socket option similar to the
|
32
|
+
IPv4 IP_HDRINCL socket option."
|
33
|
+
|
34
|
+
- Add self-throttling logic to libnet_write()/libnet_init()? Advanced
|
35
|
+
mode thing?
|
36
|
+
|
37
|
+
- Prune the include list in libnet.h.in. Also add conditionals
|
38
|
+
around the headers we use for building the library, but not when
|
39
|
+
using it.
|
40
|
+
|
41
|
+
- Data marshalling API for unaligned structures (like STP).
|
42
|
+
|
43
|
+
- Make cisco ISL work. The issue is that we have build our Ethernet
|
44
|
+
frame first, then encapsulate it inside of an ISL envelope.
|
45
|
+
- We have to compute CRCs for both Ethernet and ISL.
|
46
|
+
|
47
|
+
- Tune advanced interface functionality that allow the application
|
48
|
+
programmer to get inside libnet_t.
|
49
|
+
|
50
|
+
- Test HPUX 11 port.
|
51
|
+
|
52
|
+
- Test cywin32 port.
|
53
|
+
|
54
|
+
- Flesh out the advanced mode.
|
55
|
+
|
56
|
+
- Consider making a flag for "strict mode" where libnet will check
|
57
|
+
things like when you build an IP options list there is an IP
|
58
|
+
header preceding it (likewise for TCP)... Other "smart" things
|
59
|
+
could happen in this mode too. When in non-strict mode, libnet
|
60
|
+
will be less rigid but prone to user-error mode.
|
61
|
+
|
62
|
+
- If we have a problem building a header we might end up freeing it
|
63
|
+
creating a NULL entry on the list and preventing us from getting to
|
64
|
+
entries beyond it (to free or whatever). Maybe we should mark it
|
65
|
+
bad or something and rely on the cleanup at the end to free it up?
|
66
|
+
|
67
|
+
- Fix checksum support for CDP
|
68
|
+
|
69
|
+
- Verify Checksuming:
|
70
|
+
Currently verified working on OpenBSD/Linux/Solaris:
|
71
|
+
- raw IP/UDP [with and without data]
|
72
|
+
- raw IP/TCP [with and without data]
|
73
|
+
- raw IP/ICMP [with and without data]
|
74
|
+
- raw IP/OSPF
|
75
|
+
- hello packet [with no auth data]
|
76
|
+
- hello packet [with no auth data and LSA sub-header (LSA check = bad)]
|
77
|
+
- link IP/UDP [with and without data]
|
78
|
+
- link IP/TCP [with and without data]
|
79
|
+
|
80
|
+
- Update the rest of the libnet_link_* files for the new format, already
|
81
|
+
ported:
|
82
|
+
- bpf [works]
|
83
|
+
- linux packet socket [works]
|
84
|
+
- linux sock packet [works]
|
85
|
+
- dlpi [works]
|
86
|
+
|
87
|
+
- Port link stuff to use writev() in libnet_write() (sendto can't hang).
|
88
|
+
|
89
|
+
- Get IPsec code working.
|
90
|
+
|
91
|
+
- Add the following packet builders:
|
92
|
+
- SNMP
|
93
|
+
|
94
|
+
- Update __libnet_handle_dump to dump everything in l verbosely.
|
95
|
+
|
96
|
+
EOF
|