diff options
Diffstat (limited to 'net-analyzer/nbtscan')
-rw-r--r-- | net-analyzer/nbtscan/Manifest | 8 | ||||
-rw-r--r-- | net-analyzer/nbtscan/files/nbtscan-1.5.1-gentoo.patch | 15 | ||||
-rw-r--r-- | net-analyzer/nbtscan/files/nbtscan-1.5.1-includes-declarations.patch | 42 | ||||
-rw-r--r-- | net-analyzer/nbtscan/files/nbtscan-1.5.1-script-whitespace.patch | 119 | ||||
-rw-r--r-- | net-analyzer/nbtscan/metadata.xml | 8 | ||||
-rw-r--r-- | net-analyzer/nbtscan/nbtscan-1.5.1-r3.ebuild | 29 |
6 files changed, 221 insertions, 0 deletions
diff --git a/net-analyzer/nbtscan/Manifest b/net-analyzer/nbtscan/Manifest new file mode 100644 index 000000000000..15c3b1d977e0 --- /dev/null +++ b/net-analyzer/nbtscan/Manifest @@ -0,0 +1,8 @@ +AUX nbtscan-1.5.1-gentoo.patch 407 SHA256 e593b36df5c01d091633f31b665c7a47cfcb536bb86b01002f7395771e6f76f9 SHA512 3bdfb90ac71eb599ec2eb3a8f83c3ba7d821da8cff9b5692aa03047f8212a88a9730c6ef3f20eb9aa250500aed5b49d287859be1d5b3fd4542a1cdb90c796d9b WHIRLPOOL 6871d1cf94c8a579baab3292fe6558485f7d78d4de817e00d9c0d184b56cb685c625542edc114c68de54cff3903078722a0ec4da3e5aadfa5e4ed71d98a55a33 +AUX nbtscan-1.5.1-includes-declarations.patch 954 SHA256 71628668cb76191302e0e1fb9b8c96532b6190bd135332a755683c0c6fab3181 SHA512 793499744b91621462802a6c53c1ba3e53de0537549b1f48047b81f7b34aeb1d1fa4b6dbe3c99048139061b05c2b5db19d9bbd9cb4a74c735a756dfb52843cc3 WHIRLPOOL 74c7d68af93d197254d76c18a0532fef7119ded618177e13b94e59aa4b82207c46727a5adf3f77861b127865802155afee91ccf324928d5727b81ef6c7e65d4e +AUX nbtscan-1.5.1-script-whitespace.patch 3784 SHA256 e2b0cfce5ec77b44012971fc9762290c9938a172451c861e5d26e5f12c1a1070 SHA512 38c7450809d876f347b17e3b60809ae408168766c2e8898f56495b33e158168e98b5d2f74208f2927af1dea68bf9956bde4bf3a0cbbceb21bae9dd8cee6ec3f6 WHIRLPOOL 368c0e360a1235693880ea9f535a1d6c851cee39cefaa4f666365f54fe83cccc1ad5c012a0f501c9c750d274daf964a73badbcc06ba506f524059e3bc7d08fd4 +DIST nbtscan-1.5.1.tar.gz 82107 SHA256 f9f95d5555356c8d467a576e69d9d348bf2a821ded9a85f895b5e6d21e2aa7eb SHA512 2e2ac6a3ce7b188552c4f5f82b1e2bb99049bd0cd6f69361c59066c0b262d9311186aabc0c03c3096b7d2c48276052b1ddf230eba43051e221019c9bf223ae3e WHIRLPOOL 21c41ed7f21bc60d1949b814eb3e38d45971c9eff67b2dfc6054b3b9f16310733252ae5e75a15b6c698a194dc5c4f4fab0fc754ffddbe36957662d6c109e1b1c +EBUILD nbtscan-1.5.1-r3.ebuild 736 SHA256 beca9b731f592218f6f66e03c758e8f0f8733da0536d512e7174f44c9debfbbf SHA512 0f198cff62bcc53416031c3bdb2382ed2ad65570e5c6e7c14a4e7d8bb5f88c2e72d0509494208f1bc5758cff23eae0d4baa111c7187f90d47911a59933e01a0b WHIRLPOOL 57805c059f8637d8826e7fe5eb8c862c53d2c01443220622d633df62e6be00700eb02fb6493e270be1e69b9e5ed505ec24c7b07edad4c3823d9e8174b0da23b2 +MISC ChangeLog 2574 SHA256 efcce7fe6b5f10f0b1a110a0ddf791f7f34d5db683118de68f53aa6de2fcdcea SHA512 b69dd0d5d4d401e34d5db66b76c754a6cd18aeb157c1e35a28bc73d1a5698a17c7576da41a9962d0ff8e70c11d820a251e3cddea6aeede9a0d20faf48a9b1113 WHIRLPOOL 8df4d05401f0069dc38aa5c96b96cb35f6baad491297028615bc9b5504e86c2fded8cc33e5e05e00997e14a8782ef80ecd0bc8b17ddf3e21c649484cd12defa3 +MISC ChangeLog-2015 4841 SHA256 e7a6cbdbbc7e0eb05612ee41c5e2b0fe8d02efc7c806a211f79a96e0206bc88c SHA512 2798621b600686c23b2f7d294e655426c26b6cd5d588f523b0e77dc20f9c4cabd92176d70ee2c6a85508bd419422339634077347178b0a2c1bc9f8bb689803d5 WHIRLPOOL 0a50f419355761a8a0dfe62854e94f8d7d7850b2eb9fd909c8c51b047246da2ad619cbe22354278c2b5bd65d564c29e6311b472042608f661174c7702988abe3 +MISC metadata.xml 276 SHA256 d15d6b6bd9ffc8a642c7469d01788ba9158efb4ca27fcf3324d9e52d1b70ec93 SHA512 f0e6c6bc89659e01e157d9bf30d0a2f3fd2d71bc26c8d12489c4a44fc5237159946e25b46e7295ab4676aea63559194977a0b1e76aced31d81cf6387dd0f4250 WHIRLPOOL 26b9e81575f613b751f76234013c30a8da84a1c0dd75c12b8df32706ee753691bbc889a2dec5001cc8c4b05c47aca49ed9fabbb5a6fefed74aaa86d6c3f56cee diff --git a/net-analyzer/nbtscan/files/nbtscan-1.5.1-gentoo.patch b/net-analyzer/nbtscan/files/nbtscan-1.5.1-gentoo.patch new file mode 100644 index 000000000000..dbf2457bc29f --- /dev/null +++ b/net-analyzer/nbtscan/files/nbtscan-1.5.1-gentoo.patch @@ -0,0 +1,15 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -11,10 +11,10 @@ + BINDIR = @bindir@ + + nbtscan: $(OBJECTS) +- $(CC) $(CFLAGS) -o nbtscan $(OBJECTS) $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o nbtscan $(OBJECTS) $(LIBS) + + install: +- $(INSTALL) $(TARGET) $(BINDIR)/$(TARGET) ++ $(INSTALL) $(TARGET) $(DESTDIR)/$(BINDIR)/$(TARGET) + + nbtscan.o: nbtscan.c statusq.h range.h list.h + $(CC) $(CFLAGS) $(DEFS) -c nbtscan.c diff --git a/net-analyzer/nbtscan/files/nbtscan-1.5.1-includes-declarations.patch b/net-analyzer/nbtscan/files/nbtscan-1.5.1-includes-declarations.patch new file mode 100644 index 000000000000..a585d4495fb5 --- /dev/null +++ b/net-analyzer/nbtscan/files/nbtscan-1.5.1-includes-declarations.patch @@ -0,0 +1,42 @@ +--- a/list.h ++++ b/list.h +@@ -19,3 +19,5 @@ + int compare(struct list_item* item1, struct list_item* item2); + + int insert(struct list* lst, unsigned long content); ++ ++int in_list(struct list* lst, unsigned long content); +--- a/nbtscan.c ++++ b/nbtscan.c +@@ -5,6 +5,8 @@ + #include <stdlib.h> + #include <sys/time.h> + #include <string.h> ++#include <ctype.h> ++#include <unistd.h> + #if HAVE_STDINT_H + #include <stdint.h> + #endif +--- a/statusq.h ++++ b/statusq.h +@@ -103,4 +103,10 @@ + char* service_name; + } nb_service_t ; + ++char* getnbservicename(my_uint8_t service, int unique, char* name); ++ ++struct nb_host_info* parse_response(char* buff, int buffsize); ++ ++int send_query(int sock, struct in_addr dest_addr, my_uint32_t rtt_base); ++ + #endif /* STATUSQ_H */ +--- a/statusq.c ++++ b/statusq.c +@@ -29,6 +29,7 @@ + #include <sys/time.h> + #include "statusq.h" + #include <string.h> ++#include <ctype.h> + #include <stdio.h> + #include <stddef.h> + #include "errors.h" diff --git a/net-analyzer/nbtscan/files/nbtscan-1.5.1-script-whitespace.patch b/net-analyzer/nbtscan/files/nbtscan-1.5.1-script-whitespace.patch new file mode 100644 index 000000000000..4aca976dcd38 --- /dev/null +++ b/net-analyzer/nbtscan/files/nbtscan-1.5.1-script-whitespace.patch @@ -0,0 +1,119 @@ +--- a/nbtscan.c ++++ b/nbtscan.c +@@ -86,7 +86,7 @@ + int d_print_hostinfo(struct in_addr addr, const struct nb_host_info* hostinfo) { + int i; + unsigned char service; /* 16th byte of NetBIOS name */ +- char name[16]; ++ char comp_name[16]; + + printf("\nPacket dump for Host %s:\n\n", inet_ntoa(addr)); + if(hostinfo->is_broken) printf("Incomplete packet, %d bytes long.\n", hostinfo->is_broken); +@@ -110,9 +110,9 @@ + printf("Names received:\n"); + for(i=0; i< hostinfo->header->number_of_names; i++) { + service = hostinfo->names[i].ascii_name[15]; +- strncpy(name, hostinfo->names[i].ascii_name, 15); +- name[16]=0; +- printf("%-17s Service: 0x%02x Flags: 0x%04x\n", name, service, hostinfo->names[i].rr_flags); ++ strncpy(comp_name, hostinfo->names[i].ascii_name, 15); ++ comp_name[15]=0; ++ printf("%-17s Service: 0x%02x Flags: 0x%04x\n", comp_name, service, hostinfo->names[i].rr_flags); + } + }; + +@@ -147,9 +147,9 @@ + + + int v_print_hostinfo(struct in_addr addr, const struct nb_host_info* hostinfo, char* sf, int hr) { +- int i, unique; ++ int i, j, unique; + my_uint8_t service; /* 16th byte of NetBIOS name */ +- char name[16]; ++ char comp_name[16]; + char* sname; + + if(!sf) { +@@ -163,20 +163,27 @@ + if(hostinfo->header && hostinfo->names) { + for(i=0; i< hostinfo->header->number_of_names; i++) { + service = hostinfo->names[i].ascii_name[15]; +- strncpy(name, hostinfo->names[i].ascii_name, 15); +- name[16]=0; ++ strncpy(comp_name, hostinfo->names[i].ascii_name, 15); ++ ++ // Eliminate trailing spaces ++ for(j=0; j < 15; j++) { ++ if (comp_name[j] == ' ') ++ break; ++ } ++ comp_name[j] = 0; ++ + unique = !(hostinfo->names[i].rr_flags & 0x0080); + if(sf) { +- printf("%s%s%s%s", inet_ntoa(addr), sf, name, sf); +- if(hr) printf("%s\n", (char*)getnbservicename(service, unique, name)); ++ printf("%s%s%s%s", inet_ntoa(addr), sf, comp_name, sf); ++ if(hr) printf("%s\n", (char*)getnbservicename(service, unique, comp_name)); + else { + printf("%02x", service); + if(unique) printf("U\n"); + else printf("G\n"); + } + } else { +- printf("%-17s", name); +- if(hr) printf("%s\n", (char*)getnbservicename(service, unique, name)); ++ printf("%-17s", comp_name); ++ if(hr) printf("%s\n", (char*)getnbservicename(service, unique, comp_name)); + else { + printf("<%02x>", service); + if(unique) printf(" UNIQUE\n"); +@@ -199,7 +206,7 @@ + }; + + int print_hostinfo(struct in_addr addr, struct nb_host_info* hostinfo, char* sf) { +- int i; ++ int i,j; + unsigned char service; /* 16th byte of NetBIOS name */ + char comp_name[16], user_name[16]; + int is_server=0; +@@ -215,7 +222,13 @@ + if(service == 0 && unique && first_name) { + /* Unique name, workstation service - this is computer name */ + strncpy(comp_name, hostinfo->names[i].ascii_name, 15); +- comp_name[15] = 0; ++ ++ // Eliminate trailing spaces ++ for(j=0; j < 15; j++) { ++ if (comp_name[j] == ' ') ++ break; ++ } ++ comp_name[j] = 0; + first_name = 0; + }; + if(service == 0x20 && unique) { +@@ -252,7 +265,7 @@ + /* If l is true adds #PRE to each line of output (for lmhosts) */ + + int l_print_hostinfo(struct in_addr addr, struct nb_host_info* hostinfo, int l) { +- int i; ++ int i,j; + unsigned char service; /* 16th byte of NetBIOS name */ + char comp_name[16]; + int is_server=0; +@@ -268,7 +281,13 @@ + if(service == 0 && unique && first_name) { + /* Unique name, workstation service - this is computer name */ + strncpy(comp_name, hostinfo->names[i].ascii_name, 15); +- comp_name[15]=0; ++ ++ // Eliminate trailing spaces ++ for(j=0; j < 15; j++) { ++ if (comp_name[j] == ' ') ++ break; ++ } ++ comp_name[j] = 0; + first_name = 0; + }; + }; + diff --git a/net-analyzer/nbtscan/metadata.xml b/net-analyzer/nbtscan/metadata.xml new file mode 100644 index 000000000000..74c2baebb4ec --- /dev/null +++ b/net-analyzer/nbtscan/metadata.xml @@ -0,0 +1,8 @@ +<?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> +</pkgmetadata> diff --git a/net-analyzer/nbtscan/nbtscan-1.5.1-r3.ebuild b/net-analyzer/nbtscan/nbtscan-1.5.1-r3.ebuild new file mode 100644 index 000000000000..a44802134398 --- /dev/null +++ b/net-analyzer/nbtscan/nbtscan-1.5.1-r3.ebuild @@ -0,0 +1,29 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit eutils + +DESCRIPTION="NBTscan is a program for scanning IP networks for NetBIOS name information" +HOMEPAGE="http://www.inetcat.net/software/nbtscan.html" +SRC_URI="http://www.sourcefiles.org/Networking/Tools/Miscellanenous/${P}.tar.gz" +SRC_URI="http://www.inetcat.net/software/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos" + +S=${WORKDIR}/${P}a + +src_prepare() { + epatch \ + "${FILESDIR}"/${P}-includes-declarations.patch \ + "${FILESDIR}"/${P}-gentoo.patch \ + "${FILESDIR}"/${P}-script-whitespace.patch +} + +src_install () { + dobin ${PN} + dodoc ChangeLog README +} |