diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-analyzer/dhcpdump |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-analyzer/dhcpdump')
-rw-r--r-- | net-analyzer/dhcpdump/Manifest | 8 | ||||
-rw-r--r-- | net-analyzer/dhcpdump/dhcpdump-1.8.ebuild | 35 | ||||
-rw-r--r-- | net-analyzer/dhcpdump/files/dhcpdump-1.8-Makefile.patch | 22 | ||||
-rw-r--r-- | net-analyzer/dhcpdump/files/dhcpdump-1.8-debian.patch | 103 | ||||
-rw-r--r-- | net-analyzer/dhcpdump/files/dhcpdump-1.8-endianness.patch | 12 | ||||
-rw-r--r-- | net-analyzer/dhcpdump/metadata.xml | 12 |
6 files changed, 192 insertions, 0 deletions
diff --git a/net-analyzer/dhcpdump/Manifest b/net-analyzer/dhcpdump/Manifest new file mode 100644 index 000000000000..ab0e714a2d0b --- /dev/null +++ b/net-analyzer/dhcpdump/Manifest @@ -0,0 +1,8 @@ +AUX dhcpdump-1.8-Makefile.patch 483 SHA256 d1b9bc187dc73ab23f101f5d7f6d67ef292fba20e92b6e52960735fc02ddb0e1 SHA512 88c6931f1520eea0638fd9b2b25ea7b5701e642adc34cbb7cde66c6c771bc6b7482687a09e7e65f1f0d467565a352397035ac7355748292673bebafadbe73ef5 WHIRLPOOL 8ae45b27fcddf6fb100cb71c64cbdedd1375f99f379cccc942b5a1a01f7c57abdac8e7d98bf39ee9757daf560c08828fe09d35f4d35f885a8c9fca10eacb3045 +AUX dhcpdump-1.8-debian.patch 2850 SHA256 4931e78ff5fded4f88f99a8335a7cb57b0c3530e7ce12e228551e5bf78d724eb SHA512 ccc97bb8c8f6dfa09d22407c8a9dec249860118ff9fc09af9488f1d4c8679f94ef6850040535048ba0bdde273a2a8c7759f02742ece0e409a020277349bedbac WHIRLPOOL 13d24d7ecd15dccfadfa92c79554c905c3de0858a622cc6b24fea0276c5b00b37f901322edbe893418678af6174b94983f4a124ead55a4e16e13c082794d0295 +AUX dhcpdump-1.8-endianness.patch 259 SHA256 56e88b6adf1c0782d9ef3aa38391fd3415dc998a1c98b17143a6a92471d5a197 SHA512 7a04bb0933fe6d54f696f18d7d1cbc1090a6f2bb92061bca0e52311264e35ec3884a2ddbdef2b31de7f81a652189fa9617de754d02aaaf17c1212c92106f07d2 WHIRLPOOL 3e3650148a986a8d20ded47db7ccd82673dc39feadeb0880285ab36b633cbe046a0c6f5b0b40ec787266cb54d4652f100465acb280bca4c3e20fe870c60c78e8 +DIST dhcpdump-1.8.tar.gz 10740 SHA256 6d5eb9418162fb738bc56e4c1682ce7f7392dd96e568cc996e44c28de7f77190 SHA512 52cd63d581a3c530c2f5baa66808d5b0241853651c720bd513b769b8301b4dff9c87243787014aea98a5b3ebed86ec317b58d262bf5031015141a4da50fb76e6 WHIRLPOOL 4741d6242a16c45beb84c5d5e29d0245954703d40a688cc35af41c42bfc09d8977f01a7e1c96879004ab7b230097457d251ed1c2bb6b15c506cf5fe913e75ccf +EBUILD dhcpdump-1.8.ebuild 689 SHA256 323e5eee720e78583f6de4c2bbe089c721c4431dc31c9a157ae329061bdf2247 SHA512 9abf80278a31c479401bb62455be9fb5a75bfc9cc0a0f256bba30c608beb809a77a2e1548c118369ca390519535948a244960cf91cb118be4d0961630dc189e5 WHIRLPOOL 48907fce0ddd77b999cf0063204ce74f10419093e35c2a7773ae98aa5c5afd4224c74b27fa44f0e10ec206099808f9d69f10ac84232faf9af640b3792b218966 +MISC ChangeLog 2826 SHA256 6347054433af2974482b09fd81ce01f0813b86f6b83b0a0994a7670a0e218eb4 SHA512 5968ba45937fb8554b4646cfd42e76a0f1fbdf5da9cc61c7422c393b03c4ca603c420a00a9891c458c2191ad232f19e041f34d07ae05caf013d9a1a063dff755 WHIRLPOOL ceaa51acbbb574749c436a38bec6cbc2352488127946dfef51258c3745657c6eff92fa4836c3c4d773df264081a5bdb4ac98b2bceba48eef0b6095204c7415eb +MISC ChangeLog-2015 1454 SHA256 e499943342f006a9218acacc4d16f4fd30ce6eaefb38a9e61c04829478491909 SHA512 3f07f5d1d0b4689b06e98d9288ce9763cc0c3a6b2e5273c3ab4a452e848aff02ad4c6a7aa6c236a01c3028c46a6b984ad867abc9242e082fa13ee600c94a775f WHIRLPOOL ad30d58504271fad6b1035453edda1d2e77acb5be41808cd9040718ae75b5884914048909562c57cd0718e8514a09d100f2e2c14d7cbfae0a0796a6696364e7b +MISC metadata.xml 418 SHA256 8c29b767acb85d40acb22bb8aa5521647165f7f457b79d1585a45d45d601785a SHA512 776319938dbf31831e5b8655726ee04d2c8cbd3d43163c2ba9d3d9126608de9ca6e49df2c0f9fedfffacdbd2149f792b592d5d5e1881c226f0cb2eaba00a1fa4 WHIRLPOOL a08ac0cae1c37a1894c8cb84016c3c74c1d00852c7fcd51a6c77c2fd9ec793e5174e52927117fa67a21230b370cf86dd063012693c76fafcd7f205a6d9124d03 diff --git a/net-analyzer/dhcpdump/dhcpdump-1.8.ebuild b/net-analyzer/dhcpdump/dhcpdump-1.8.ebuild new file mode 100644 index 000000000000..2973a6344152 --- /dev/null +++ b/net-analyzer/dhcpdump/dhcpdump-1.8.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +inherit eutils toolchain-funcs + +DESCRIPTION="DHCP Packet Analyzer/tcpdump postprocessor" +HOMEPAGE="http://www.mavetju.org/unix/general.php" +SRC_URI="http://www.mavetju.org/download/${P}.tar.gz" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="amd64 ~mips x86 arm" + +RDEPEND="net-libs/libpcap" +DEPEND=" + ${RDEPEND} + dev-lang/perl +" + +src_prepare() { + epatch "${FILESDIR}"/${P}-Makefile.patch + epatch "${FILESDIR}"/${P}-debian.patch + epatch "${FILESDIR}"/${P}-endianness.patch +} + +src_compile() { + emake CC=$(tc-getCC) +} + +src_install () { + dobin ${PN} + doman ${PN}.8 + dodoc CHANGES CONTACT +} diff --git a/net-analyzer/dhcpdump/files/dhcpdump-1.8-Makefile.patch b/net-analyzer/dhcpdump/files/dhcpdump-1.8-Makefile.patch new file mode 100644 index 000000000000..690f60779b87 --- /dev/null +++ b/net-analyzer/dhcpdump/files/dhcpdump-1.8-Makefile.patch @@ -0,0 +1,22 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ +-CFLAGS= -Wall -g +-LDFLAGS= -g +-LIBS= -lpcap ++#CFLAGS = -Wall -g ++#LDFLAGS = -g ++LIBS = -lpcap + + all: dhcpdump dhcpdump.8 + +@@ -15,7 +15,7 @@ + dhcpdump.pod dhcpdump.8 + + dhcpdump: dhcpdump.o +- ${CC} ${LDFLAGS} -o $@ dhcpdump.o ${LIBS} ++ $(CC) -DHAVE_STRSEP $(LDFLAGS) -o $@ dhcpdump.o $(LIBS) + + dhcpdump.o: dhcpdump.c dhcp_options.h Makefile +- ${CC} ${CFLAGS} -c -o $@ dhcpdump.c ++ $(CC) -DHAVE_STRSEP $(CFLAGS) -c -o $@ dhcpdump.c diff --git a/net-analyzer/dhcpdump/files/dhcpdump-1.8-debian.patch b/net-analyzer/dhcpdump/files/dhcpdump-1.8-debian.patch new file mode 100644 index 000000000000..7c5304bb0bca --- /dev/null +++ b/net-analyzer/dhcpdump/files/dhcpdump-1.8-debian.patch @@ -0,0 +1,103 @@ +--- a/dhcpdump.c ++++ b/dhcpdump.c +@@ -16,11 +16,13 @@ + #include <netinet/in.h> + #include <netinet/ip.h> + #include <netinet/udp.h> ++#include <netinet/ether.h> + #include <arpa/inet.h> + #include <stdio.h> + #include <stdlib.h> + #include <string.h> + #include <ctype.h> ++#include <time.h> + #include <pcap.h> + #include <err.h> + #include <regex.h> +@@ -38,11 +40,11 @@ + #define LARGESTRING 1024 + + // header variables +-u_char timestamp[40]; // timestamp on header +-u_char mac_origin[40]; // mac address of origin +-u_char mac_destination[40]; // mac address of destination +-u_char ip_origin[40]; // ip address of origin +-u_char ip_destination[40]; // ip address of destination ++char timestamp[40]; // timestamp on header ++char mac_origin[40]; // mac address of origin ++char mac_destination[40]; // mac address of destination ++char ip_origin[40]; // ip address of origin ++char ip_destination[40]; // ip address of destination + int max_data_len; // maximum size of a packet + + int tcpdump_style = -1; +@@ -160,13 +162,21 @@ + strcpy(mac_destination, + ether_ntoa((struct ether_addr *)eh->ether_dhost)); + +- strcpy(ip_origin, (u_char *)inet_ntoa(ip->ip_src)); +- strcpy(ip_destination, (u_char *)inet_ntoa(ip->ip_dst)); ++ strcpy(ip_origin, (char *)inet_ntoa(ip->ip_src)); ++ strcpy(ip_destination, (char *)inet_ntoa(ip->ip_dst)); + ++#ifdef __linux__ ++ if (hmask && check_ch((u_char *)(sp + offset), ntohs(udp->len))) ++ return; ++ ++ printdata((u_char *)(sp + offset), ntohs(udp->len)); ++#else + if (hmask && check_ch((u_char *)(sp + offset), ntohs(udp->uh_ulen))) + return; + + printdata((u_char *)(sp + offset), ntohs(udp->uh_ulen)); ++#endif ++ + } + + // check for matching CHADDR (Peter Apian-Bennewitz <apian@ise.fhg.de>) +@@ -301,7 +311,7 @@ + // print the header and the options. + int printdata(u_char *data, int data_len) { + int j, i; +- u_char buf[LARGESTRING]; ++ char buf[LARGESTRING]; + + if (data_len == 0) + return 0; +@@ -364,7 +374,7 @@ + case 60: // Domain name + case 86: // NDS Tree name + case 87: // NDS context +- strncpy(buf, &data[j + 2], data[j + 1]); ++ strncpy(buf, (char *)&data[j + 2], data[j + 1]); + buf[data[j + 1]] = 0; + printf("%s", buf); + break; +@@ -510,7 +520,7 @@ + printf("-"); + print8bits(data + j + 4); + printf(" "); +- strncpy(buf, &data[j + 5], data[j + 1] - 3); ++ strncpy(buf, (char *)&data[j + 5], data[j + 1] - 3); + buf[data[j + 1] - 3]=0; + printf("%s", buf); + break; +@@ -518,6 +528,9 @@ + case 82: // Relay Agent Information + printf("\n"); + for (i = j + 2; i < j + data[j + 1]; ) { ++ if (i != j+2) { ++ printf("\n"); ++ } + printf("%-17s %-13s ", " ", + data[i] > sizeof(relayagent_suboptions) ? + "*wrong value*" : +@@ -527,7 +540,7 @@ + break; + } + printHexColon(data + i + 2, data[i + 1]); +- i += data[i + 1]; ++ i += data[i + 1] + 2; + } + break; + diff --git a/net-analyzer/dhcpdump/files/dhcpdump-1.8-endianness.patch b/net-analyzer/dhcpdump/files/dhcpdump-1.8-endianness.patch new file mode 100644 index 000000000000..2a6f7822c2b3 --- /dev/null +++ b/net-analyzer/dhcpdump/files/dhcpdump-1.8-endianness.patch @@ -0,0 +1,12 @@ +--- a/dhcpdump.c ++++ b/dhcpdump.c +@@ -130,7 +130,7 @@ + offset += ETHER_HDR_LEN; + + // Check for IPv4 packets +- if (eh->ether_type != 8) { ++ if (eh->ether_type != htons(0x0800)) { + printf("Ignored non IPv4 packet: %d\n", eh->ether_type); + return; + } + diff --git a/net-analyzer/dhcpdump/metadata.xml b/net-analyzer/dhcpdump/metadata.xml new file mode 100644 index 000000000000..f34967c0f990 --- /dev/null +++ b/net-analyzer/dhcpdump/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="project"> + <email>netmon@gentoo.org</email> + <name>Gentoo network monitoring and analysis project</name> +</maintainer> +<longdescription> +This command parses the output of tcpdump to display the +dhcp-packets for easier checking and debugging. +</longdescription> +</pkgmetadata> |