diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2012-03-05 13:10:46 -0800 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2012-03-05 13:32:22 -0800 |
commit | 580206f1f65687f58f0d82fb90ea7ca2a187afe4 (patch) | |
tree | b13193495d1bae15f6fbc8508f7e2434fad833c1 | |
parent | 434b33d1b06f39125a2d8fa841b0b7d31d85a687 (diff) | |
download | libnet-580206f1f65687f58f0d82fb90ea7ca2a187afe4.tar.gz |
Remove old unmerged patches.
-rw-r--r-- | unmerged/libnet-001-aix.patch | 17 | ||||
-rw-r--r-- | unmerged/libnet-1.1.4-icmpv6-unreach.patch | 413 | ||||
-rw-r--r-- | unmerged/libnet-config.1 | 33 | ||||
-rw-r--r-- | unmerged/libnet-diff.rar | bin | 9714 -> 0 bytes |
4 files changed, 0 insertions, 463 deletions
diff --git a/unmerged/libnet-001-aix.patch b/unmerged/libnet-001-aix.patch deleted file mode 100644 index c396fd4..0000000 --- a/unmerged/libnet-001-aix.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -urNp libnet-1.1.4.org/include/libnet.h.in libnet-1.1.4/include/libnet.h.in ---- libnet-1.1.4.org/include/libnet.h.in 2010-03-01 21:57:18.000000000 +0200 -+++ libnet-1.1.4/include/libnet.h.in 2010-03-06 22:02:14.898423826 +0200 -@@ -113,6 +113,13 @@ extern "C" { - #include <errno.h> - #include <stdarg.h> - -+/* workaround symbol conflict (found in AIX 5.3) */ -+#undef ip_len -+#undef ip_v -+#undef ip_hl -+#undef ip_tos -+#undef th_win -+ - #define LIBNET_VERSION "@PACKAGE_VERSION@" - - #define @ENDIANESS@ 1 diff --git a/unmerged/libnet-1.1.4-icmpv6-unreach.patch b/unmerged/libnet-1.1.4-icmpv6-unreach.patch deleted file mode 100644 index d6105cb..0000000 --- a/unmerged/libnet-1.1.4-icmpv6-unreach.patch +++ /dev/null @@ -1,413 +0,0 @@ -diff -uNr libnet-1.1.4/include/libnet/libnet-functions.h libnet-1.1.4-patched/include/libnet/libnet-functions.h ---- libnet-1.1.4/include/libnet/libnet-functions.h 2009-06-04 19:31:36.000000000 -0500 -+++ libnet-1.1.4-patched/include/libnet/libnet-functions.h 2009-09-28 18:39:04.000000000 -0500 -@@ -778,6 +778,23 @@ - u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag); - - /** -+ * Builds an IP version 6 RFC 4443 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_ipv6(). -+ * @param type type of ICMP packet (should be ICMP6_UNREACH) -+ * @param code code of ICMP packet (should be one of the 5 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_icmpv6_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 RFC 1112 Internet Group Memebership Protocol (IGMP) header. - * @param type packet type - * @param code packet code (should be 0) -diff -uNr libnet-1.1.4/include/libnet/libnet-headers.h libnet-1.1.4-patched/include/libnet/libnet-headers.h ---- libnet-1.1.4/include/libnet/libnet-headers.h 2009-06-04 19:31:36.000000000 -0500 -+++ libnet-1.1.4-patched/include/libnet/libnet-headers.h 2009-09-28 18:39:04.000000000 -0500 -@@ -64,6 +64,7 @@ - #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_ICMPV6_UNREACH_H 0x08 /**< ICMP6 unreach 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 */ -@@ -841,6 +842,21 @@ - #define ICMP6_PARAMPROB 4 - #endif - u_int8_t icmp_code; /* ICMP code */ -+#ifndef ICMPV6_NOROUTE -+#define ICMPV6_NOROUTE 0 -+#endif -+#ifndef ICMPV6_ADM_PROHIBITED -+#define ICMPV6_ADM_PROHIBITED 1 -+#endif -+#ifndef ICMPV6_NOT_NEIGHBOUR -+#define ICMPV6_NOT_NEIGHBOUR 2 -+#endif -+#ifndef ICMPV6_ADDR_UNREACH -+#define ICMPV6_ADDR_UNREACH 3 -+#endif -+#ifndef ICMPV6_PORT_UNREACH -+#define ICMPV6_PORT_UNREACH 4 -+#endif - u_int16_t icmp_sum; /* ICMP Checksum */ - u_int16_t id; /* ICMP id */ - u_int16_t seq; /* ICMP sequence number */ -diff -uNr libnet-1.1.4/include/libnet/libnet-structures.h libnet-1.1.4-patched/include/libnet/libnet-structures.h ---- libnet-1.1.4/include/libnet/libnet-structures.h 2009-06-04 19:31:36.000000000 -0500 -+++ libnet-1.1.4-patched/include/libnet/libnet-structures.h 2009-09-28 18:39:04.000000000 -0500 -@@ -158,6 +158,8 @@ - #define LIBNET_PBLOCK_IPV6_HBHOPTS_H 0x3e /* IPv6 hop/hop opts header */ - #define LIBNET_PBLOCK_SEBEK_H 0x3f /* Sebek header */ - #define LIBNET_PBLOCK_HSRP_H 0x40 /* HSRP header */ -+#define LIBNET_PBLOCK_ICMPV6_H 0x41 /* ICMPv6 header */ -+#define LIBNET_PBLOCK_ICMPV6_UNREACH_H 0x42 /* ICMPv6 unreach header */ - u_int8_t flags; /* control flags */ - #define LIBNET_PBLOCK_DO_CHECKSUM 0x01 /* needs a checksum */ - libnet_ptag_t ptag; /* protocol block tag */ -diff -uNr libnet-1.1.4/sample/icmp6_unreach.c libnet-1.1.4-patched/sample/icmp6_unreach.c ---- libnet-1.1.4/sample/icmp6_unreach.c 1969-12-31 18:00:00.000000000 -0600 -+++ libnet-1.1.4-patched/sample/icmp6_unreach.c 2009-09-28 18:51:11.000000000 -0500 -@@ -0,0 +1,193 @@ -+/* -+ * $Id: icmp6_unreach.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; -+ 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 unreach/admin prohibited 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_icmpv6_unreach ( -+ ICMP6_UNREACH, /* type */ -+ ICMPV6_ADM_PROHIBITED, /* code */ -+ 0, /* checksum */ -+ payload, /* payload */ -+ sizeof(payload), /* payload length */ -+ l, /* libnet context */ -+ t); /* libnet ptag */ -+ -+ -+ -+ 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 -uNr libnet-1.1.4/sample/Makefile.am libnet-1.1.4-patched/sample/Makefile.am ---- libnet-1.1.4/sample/Makefile.am 2009-04-30 17:42:13.000000000 -0500 -+++ libnet-1.1.4-patched/sample/Makefile.am 2009-09-28 19:13:57.000000000 -0500 -@@ -8,7 +8,7 @@ - - include $(top_srcdir)/Makefile.am.common - --noinst_PROGRAMS = arp cdp dhcp_discover get_addr icmp_timestamp icmp_unreach \ -+noinst_PROGRAMS = arp cdp dhcp_discover get_addr icmp_timestamp icmp_unreach icmp6_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 \ -@@ -32,6 +32,7 @@ - icmp_timestamp_SOURCES = icmp_timestamp.c - icmp_timeexceed_SOURCES = icmp_timeexceed.c - icmp_unreach_SOURCES = icmp_unreach.c -+icmp6_unreach_SOURCES = icmp6_unreach.c - ieee_SOURCES = ieee.c - isl_SOURCES = isl.c - ntp_SOURCES = ntp.c -diff -uNr libnet-1.1.4/src/libnet_build_icmp.c libnet-1.1.4-patched/src/libnet_build_icmp.c ---- libnet-1.1.4/src/libnet_build_icmp.c 2009-06-04 19:31:44.000000000 -0500 -+++ libnet-1.1.4-patched/src/libnet_build_icmp.c 2009-09-28 18:39:04.000000000 -0500 -@@ -395,4 +395,52 @@ - return (-1); - } - -+ -+libnet_ptag_t -+libnet_build_icmpv6_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_icmpv6_hdr icmp_hdr; -+ -+ if (l == NULL) -+ { -+ return (-1); -+ } -+ n = LIBNET_ICMPV6_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_ICMPV6_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_ICMPV6_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.id = 0; /* must be 0 */ -+ icmp_hdr.seq = 0; /* must be 0 */ -+ -+ LIBNET_BUILD_ICMP_ERR_FINISH(LIBNET_ICMPV6_UNREACH_H); -+ -+ return (ptag ? ptag : libnet_pblock_update(l, p, h, -+ LIBNET_PBLOCK_ICMPV6_UNREACH_H)); -+bad: -+ libnet_pblock_delete(l, p); -+ return (-1); -+} -+ - /* EOF */ -diff -uNr libnet-1.1.4/src/libnet_checksum.c libnet-1.1.4-patched/src/libnet_checksum.c ---- libnet-1.1.4/src/libnet_checksum.c 2009-06-04 19:31:44.000000000 -0500 -+++ libnet-1.1.4-patched/src/libnet_checksum.c 2009-09-28 18:39:04.000000000 -0500 -@@ -146,7 +146,8 @@ - * 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) -+ -+ if (iph_p && ((buf[0] & 0xf0) >> 4) == 6) - { - ip6h_p = (struct libnet_ipv6_hdr *)buf; - is_ipv6 = 1; -@@ -236,6 +237,21 @@ - icmph_p->icmp_sum = LIBNET_CKSUM_CARRY(sum); - break; - } -+ case IPPROTO_ICMPV6: -+ { -+ struct libnet_icmpv6_hdr *icmph_p = -+ (struct libnet_icmpv6_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 = -diff -uNr libnet-1.1.4/src/libnet_internal.c libnet-1.1.4-patched/src/libnet_internal.c ---- libnet-1.1.4/src/libnet_internal.c 2009-06-04 19:31:44.000000000 -0500 -+++ libnet-1.1.4-patched/src/libnet_internal.c 2009-09-28 18:39:04.000000000 -0500 -@@ -198,6 +198,10 @@ - return ("icmpv4 redirect header"); - case LIBNET_PBLOCK_ICMPV4_TS_H: - return ("icmpv4 timestamp header"); -+ case LIBNET_PBLOCK_ICMPV6_H: -+ return ("icmpv6 header"); -+ case LIBNET_PBLOCK_ICMPV6_UNREACH_H: -+ return ("icmpv6 unreachable header"); - case LIBNET_PBLOCK_IGMP_H: - return ("igmp header"); - case LIBNET_PBLOCK_IPV4_H: -diff -uNr libnet-1.1.4/src/libnet_pblock.c libnet-1.1.4-patched/src/libnet_pblock.c ---- libnet-1.1.4/src/libnet_pblock.c 2009-06-04 19:31:44.000000000 -0500 -+++ libnet-1.1.4-patched/src/libnet_pblock.c 2009-09-28 18:39:04.000000000 -0500 -@@ -477,10 +477,15 @@ - case LIBNET_PBLOCK_ICMPV4_REDIRECT_H: - case LIBNET_PBLOCK_ICMPV4_TS_H: - return (IPPROTO_ICMP); -+ case LIBNET_PBLOCK_ICMPV6_H: -+ case LIBNET_PBLOCK_ICMPV6_UNREACH_H: -+ return (IPPROTO_ICMPV6); - case LIBNET_PBLOCK_IGMP_H: - return (IPPROTO_IGMP); - case LIBNET_PBLOCK_IPV4_H: - return (IPPROTO_IP); -+ case LIBNET_PBLOCK_IPV6_H: -+ return (IPPROTO_IPV6); - case LIBNET_ISL_H: - return (LIBNET_PROTO_ISL); - case LIBNET_PBLOCK_OSPF_H: diff --git a/unmerged/libnet-config.1 b/unmerged/libnet-config.1 deleted file mode 100644 index 28b74ea..0000000 --- a/unmerged/libnet-config.1 +++ /dev/null @@ -1,33 +0,0 @@ -.\" Written by Domenico Andreoli for Debian GNU/Linux. -.\" Do whatever you want with this file. -.\" NO warranty is provided. -.TH libnet-config 1 "18 November 2002" "Libnet 1.1.0" "libnet-config manual" -.SH NAME -libnet-config \- Get information about a libnet installation -.SH SYNOPSIS -.B libnet-config [options] -.SH DESCRIPTION -.B libnet-config -displays information about a previous libnet installation. -.SH OPTIONS -.IP "--cflags" -Set of compiler options (CFLAGS) to use when compiling files that use -libnet. -.IP "--libs" -Shows the complete set of libs and other linker options you will need in order -to link your application with libnet. -.IP "--defines" -Set of compiler defines used to compile libnet. -.SH "EXAMPLES" -What linker options do I need when I link with libnet? - - libnet-config \-\-libs - -What compiler options do I need when I compile using libnet functions? - - libnet-config \-\-cflags -.SH SEE ALSO -.BR libnet (3) -.SH AUTHOR -This manual page was written by Domenico Andreoli <cavok@debian.org> -for the Debian GNU/Linux system (but may be used by others). diff --git a/unmerged/libnet-diff.rar b/unmerged/libnet-diff.rar Binary files differdeleted file mode 100644 index 382faa2..0000000 --- a/unmerged/libnet-diff.rar +++ /dev/null |