From 38132d14765368d830ce162b28df8f130f1f0b84 Mon Sep 17 00:00:00 2001 From: Ravi BK Date: Sat, 30 Jul 2016 09:53:59 +0530 Subject: [PATCH] Removing fetch packages for tcpdump Change-Id: I8424090b0ed1884279e572682ac27862d261b289 Closes-bug: #1571507 --- packages.xml | 24 ---------- tcpdump.diff | 122 --------------------------------------------------- 2 files changed, 146 deletions(-) delete mode 100644 tcpdump.diff diff --git a/packages.xml b/packages.xml index 94afda6..45a4e2e 100644 --- a/packages.xml +++ b/packages.xml @@ -376,28 +376,4 @@ openvswitch.diff - - libnl version 3.2.25 - https://github.com/thom311/libnl/releases/download/libnl3_2_25/libnl-3.2.25.tar.gz - libnl-3.2.25.tar.gz - tgz - 03f74d0cd5037cadc8cdfa313bbd195c - - - pcap version 1.4.0 - http://www.tcpdump.org/release/libpcap-1.4.0.tar.gz - libpcap-1.4.0.tar.gz - tgz - 56e88a5aabdd1e04414985ac24f7e76c - - - tcpdump version 4.4.0 - http://www.tcpdump.org/release/tcpdump-4.4.0.tar.gz - tcpdump-4.4.0.tar.gz - tgz - 6f75aabcffd012f73bd7c331bb5d8232 - - tcpdump.diff - - diff --git a/tcpdump.diff b/tcpdump.diff deleted file mode 100644 index 4497f6f..0000000 --- a/tcpdump.diff +++ /dev/null @@ -1,122 +0,0 @@ -diff --git a/tcpdump-4.4.0/print-ether.c b/tcpdump-4.4.0-modified/print-ether.c -index f783341..6244f50 100644 ---- a/tcpdump-4.4.0/print-ether.c -+++ b/tcpdump-4.4.0-modified/print-ether.c -@@ -88,6 +88,20 @@ const struct tok ethertype_values[] = { - { 0, NULL} - }; - -+extern u_int agt_hdr; -+struct agent_hdr { -+ unsigned short hdr_ifindex; -+ unsigned short hdr_vrf; -+ unsigned short hdr_cmd; -+ unsigned int hdr_cmd_param; -+ unsigned int hdr_cmd_param_1; -+ unsigned int hdr_cmd_param_2; -+ unsigned int hdr_cmd_param_3; -+ unsigned int hdr_cmd_param_4; -+ uint8_t hdr_cmd_param_5; -+ uint8_t hdr_cmd_param_5_pack[3]; -+} __attribute__((packed)); -+ - static inline void - ether_hdr_print(netdissect_options *ndo, - const u_char *bp, u_int length) -@@ -238,6 +252,35 @@ recurse: - } - } - -+static int print_agent_header(const u_char *sp) -+{ -+ if (agt_hdr) { -+ /* skip external Ether Hdr */ -+ struct agent_hdr agent_h = *(struct agent_hdr *)(sp + 14); -+ agent_h.hdr_ifindex = EXTRACT_16BITS(&agent_h.hdr_ifindex); -+ agent_h.hdr_vrf = EXTRACT_16BITS(&agent_h.hdr_vrf); -+ agent_h.hdr_cmd = EXTRACT_16BITS(&agent_h.hdr_cmd); -+ agent_h.hdr_cmd_param = EXTRACT_32BITS(&agent_h.hdr_cmd_param); -+ agent_h.hdr_cmd_param_1 = EXTRACT_32BITS(&agent_h.hdr_cmd_param_1); -+ agent_h.hdr_cmd_param_2 = EXTRACT_32BITS(&agent_h.hdr_cmd_param_2); -+ agent_h.hdr_cmd_param_3 = EXTRACT_32BITS(&agent_h.hdr_cmd_param_3); -+ agent_h.hdr_cmd_param_4 = EXTRACT_32BITS(&agent_h.hdr_cmd_param_4); -+ (void)printf("Agent Hdr : intf idx = %d, vrf = %d, cmd = %d, cmd param" -+ " = %d, cmd param 1 = %d , cmd param 2 = %d , cmd param 3 = %d " -+ ", cmd param 4 = %d cmd param 5 = %d, cmd param 5 pack[0] = %d " -+ ", cmd param 5 pack[1] = %d , cmd param 5 pack[2] = %d\n", -+ agent_h.hdr_ifindex, -+ agent_h.hdr_vrf, agent_h.hdr_cmd, -+ agent_h.hdr_cmd_param, agent_h.hdr_cmd_param_1, -+ agent_h.hdr_cmd_param_2, agent_h.hdr_cmd_param_3, -+ agent_h.hdr_cmd_param_4, agent_h.hdr_cmd_param_5, -+ agent_h.hdr_cmd_param_5_pack[0], agent_h.hdr_cmd_param_5_pack[1], -+ agent_h.hdr_cmd_param_5_pack[2]); -+ return 1; -+ } -+ return 0; -+} -+ - /* - * This is the top level routine of the printer. 'p' points - * to the ether header of the packet, 'h->ts' is the timestamp, -@@ -248,7 +291,18 @@ u_int - ether_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, - const u_char *p) - { -- ether_print(ndo, p, h->len, h->caplen, NULL, NULL); -+ int ret = 0, shift_bytes = 0; -+ -+ ret = print_agent_header(p); -+ -+ shift_bytes = 14 + sizeof(struct agent_hdr); -+ -+ if (ret) { -+ ether_print(ndo, p + shift_bytes, h->len, (h->caplen) - shift_bytes, -+ NULL, NULL); -+ } else { -+ ether_print(ndo, p, h->len, h->caplen, NULL, NULL); -+ } - - return (ETHER_HDRLEN); - } -diff --git a/tcpdump-4.4.0/tcpdump.c b/tcpdump-4.4.0-modified/tcpdump.c -index 66d81bb..f43bd11 100644 ---- a/tcpdump-4.4.0/tcpdump.c -+++ b/tcpdump-4.4.0-modified/tcpdump.c -@@ -143,6 +143,7 @@ RETSIGTYPE requestinfo(int); - - static void info(int); - static u_int packets_captured; -+u_int agt_hdr; - - struct printer { - if_printer f; -@@ -735,7 +736,7 @@ main(int argc, char **argv) - #endif - - while ( -- (op = getopt(argc, argv, "aAb" B_FLAG "c:C:d" D_FLAG "eE:fF:G:hHi:" I_FLAG j_FLAG J_FLAG "KlLm:M:nNOpqr:Rs:StT:u" U_FLAG "V:vw:W:xXy:Yz:Z:")) != -1) -+ (op = getopt(argc, argv, "aAb" B_FLAG "c:C:d" D_FLAG "eE:fF:gG:hHi:" I_FLAG j_FLAG J_FLAG "KlLm:M:nNOpqr:Rs:StT:u" U_FLAG "V:vw:W:xXy:Yz:Z:")) != -1) - switch (op) { - - case 'a': -@@ -813,6 +814,10 @@ main(int argc, char **argv) - infile = optarg; - break; - -+ case 'g': -+ agt_hdr = 1; -+ break; -+ - case 'G': - Gflag = atoi(optarg); - if (Gflag < 0) -@@ -2076,7 +2081,7 @@ usage(void) - #endif /* WIN32 */ - #endif /* HAVE_PCAP_LIB_VERSION */ - (void)fprintf(stderr, --"Usage: %s [-aAbd" D_FLAG "efhH" I_FLAG J_FLAG "KlLnNOpqRStu" U_FLAG "vxX]" B_FLAG_USAGE " [ -c count ]\n", program_name); -+"Usage: %s [-aAbd" D_FLAG "efghH" I_FLAG J_FLAG "KlLnNOpqRStu" U_FLAG "vxX]" B_FLAG_USAGE " [ -c count ]\n", program_name); - (void)fprintf(stderr, - "\t\t[ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ]\n"); - (void)fprintf(stderr,