diff options
Diffstat (limited to 'net/libnet')
-rw-r--r-- | net/libnet/Makefile | 24 | ||||
-rw-r--r-- | net/libnet/distinfo | 5 | ||||
-rw-r--r-- | net/libnet/files/patch-Makefile.in | 11 | ||||
-rw-r--r-- | net/libnet/files/patch-configure | 17 | ||||
-rw-r--r-- | net/libnet/files/patch-include-libnet.h.in | 22 | ||||
-rw-r--r-- | net/libnet/files/patch-src-libnet_cq.c | 15 | ||||
-rw-r--r-- | net/libnet/files/patch-src-libnet_if_addr.c | 34 | ||||
-rw-r--r-- | net/libnet/files/patch-src-libnet_link_bpf.c | 32 | ||||
-rw-r--r-- | net/libnet/pkg-descr | 23 | ||||
-rw-r--r-- | net/libnet/pkg-plist | 59 |
10 files changed, 89 insertions, 153 deletions
diff --git a/net/libnet/Makefile b/net/libnet/Makefile index aba081eccef7..a57f23c44747 100644 --- a/net/libnet/Makefile +++ b/net/libnet/Makefile @@ -1,27 +1,22 @@ PORTNAME= libnet -PORTVERSION= 1.1.6 -PORTREVISION= 5 +PORTVERSION= 1.2 PORTEPOCH= 1 CATEGORIES= net -MASTER_SITES= SF/libnet-dev +MASTER_SITES= https://github.com/libnet/libnet/releases/download/v${PORTVERSION}/ MAINTAINER= sunpoet@FreeBSD.org COMMENT= C library for creating IP packets LICENSE= BSD2CLAUSE -LICENSE_FILE= ${WRKSRC}/doc/COPYING +LICENSE_FILE= ${WRKSRC}/LICENSE USES= cpe libtool +CONFIGURE_ARGS= --disable-doxygen-doc --disable-doxygen-dot --disable-doxygen-html --disable-doxygen-man GNU_CONFIGURE= yes INSTALL_TARGET= install-strip -USE_CSTD= gnu89 USE_LDCONFIG= yes -DOCS= CHANGELOG CONTRIB DESIGN_NOTES MIGRATION PACKET_BUILDING PORTED RAWSOCKET_NON_SEQUITUR README TODO -PORTDOCS= * -PORTEXAMPLES= * - CPE_VENDOR= libnet_project OPTIONS_DEFINE= BPF DOCS EXAMPLES @@ -31,17 +26,6 @@ BPF_DESC= link layer bpf BPF_CONFIGURE_OFF= --with-link-layer=none BPF_CONFIGURE_ON= --with-link-layer=bpf -post-patch: - @${MV} ${WRKSRC}/README ${WRKSRC}/doc/ - @${REINPLACE_CMD} \ - -e 's|@LIBNET_CONFIG_LIBS@|@LIBNET_CONFIG_LIBS@ -L@prefix@/lib|' \ - -e 's|@LIBNET_CONFIG_CFLAGS@|@LIBNET_CONFIG_CFLAGS@ -I@prefix@/include|' \ - ${WRKSRC}/libnet-config.in - -post-install-DOCS-on: - ${MKDIR} ${STAGEDIR}${DOCSDIR}/ - cd ${WRKSRC}/doc/ && ${INSTALL_DATA} ${DOCS} ${STAGEDIR}${DOCSDIR}/ - post-install-EXAMPLES-on: ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/ ${INSTALL_DATA} ${WRKSRC}/sample/*.c ${STAGEDIR}${EXAMPLESDIR}/ diff --git a/net/libnet/distinfo b/net/libnet/distinfo index a68fdb318450..a0d48de1fc02 100644 --- a/net/libnet/distinfo +++ b/net/libnet/distinfo @@ -1,2 +1,3 @@ -SHA256 (libnet-1.1.6.tar.gz) = d392bb5825c4b6b672fc93a0268433c86dc964e1500c279dc6d0711ea6ec467a -SIZE (libnet-1.1.6.tar.gz) = 1202970 +TIMESTAMP = 1598091310 +SHA256 (libnet-1.2.tar.gz) = caa4868157d9e5f32e9c7eac9461efeff30cb28357f7f6bf07e73933fb4edaa7 +SIZE (libnet-1.2.tar.gz) = 649191 diff --git a/net/libnet/files/patch-Makefile.in b/net/libnet/files/patch-Makefile.in new file mode 100644 index 000000000000..b872584a1cc2 --- /dev/null +++ b/net/libnet/files/patch-Makefile.in @@ -0,0 +1,11 @@ +--- Makefile.in.orig 2019-10-15 19:00:48 UTC ++++ Makefile.in +@@ -405,7 +405,7 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} + bin_SCRIPTS = libnet-config + pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = libnet.pc +-dist_doc_DATA = README.md ChangeLog.md LICENSE ++dist_doc_DATA = README.md ChangeLog.md # LICENSE + EXTRA_DIST = README.win32 autogen.sh libnet-config.in + SUBDIRS = include src win32 $(am__append_1) $(am__append_2) + MD5 = md5sum diff --git a/net/libnet/files/patch-configure b/net/libnet/files/patch-configure deleted file mode 100644 index 7aff7de28b7f..000000000000 --- a/net/libnet/files/patch-configure +++ /dev/null @@ -1,17 +0,0 @@ ---- configure.orig 2012-03-29 21:18:48 UTC -+++ configure -@@ -12165,13 +12165,12 @@ done - $as_echo "#define LIBNET_BSDISH_OS 1" >>confdefs.h - - --$as_echo "#define LIBNET_BSD_BYTE_SWAP 1" >>confdefs.h - - - $as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h - - -- LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP -DHAVE_SOCKADDR_SA_LEN" -+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DHAVE_SOCKADDR_SA_LEN" - ;; - - *netbsd*) diff --git a/net/libnet/files/patch-include-libnet.h.in b/net/libnet/files/patch-include-libnet.h.in index dc79cc8f36b4..c17a11011c3d 100644 --- a/net/libnet/files/patch-include-libnet.h.in +++ b/net/libnet/files/patch-include-libnet.h.in @@ -1,12 +1,12 @@ ---- include/libnet.h.in.orig 2012-03-06 00:45:46 UTC +--- include/libnet.h.in.orig 2019-10-06 06:18:52 UTC +++ include/libnet.h.in -@@ -81,6 +81,9 @@ extern "C" { - #if !defined(__WIN32__) - # include <sys/socket.h> - # include <net/if.h> -+# if defined (__FreeBSD__) || defined (__DragonFly__) -+# include <netinet/in.h> -+# endif - #else /* __WIN32__ */ - # if (__CYGWIN__) - # include <sys/socket.h> +@@ -75,6 +75,9 @@ extern "C" { + #include <sys/ioctl.h> + #include <sys/socket.h> + #include <net/if.h> ++#if defined (__FreeBSD__) || defined (__DragonFly__) ++#include <netinet/in.h> ++#endif + #include <arpa/inet.h> + #include <sys/time.h> + #include <netdb.h> diff --git a/net/libnet/files/patch-src-libnet_cq.c b/net/libnet/files/patch-src-libnet_cq.c deleted file mode 100644 index 75013612ddeb..000000000000 --- a/net/libnet/files/patch-src-libnet_cq.c +++ /dev/null @@ -1,15 +0,0 @@ -- Reset global cq state after destroying it. - -Obtained from: https://github.com/sam-github/libnet/commit/c9390bf8f3379c280ba8ceec67fbd8e908675d96 - ---- src/libnet_cq.c.orig 2012-03-19 16:59:50 UTC -+++ src/libnet_cq.c -@@ -344,6 +344,8 @@ libnet_cq_destroy() - libnet_destroy(tmp->context); - free(tmp); - } -+ l_cq = NULL; -+ memset(&l_cqd, 0, sizeof(l_cqd)); - } - - libnet_t * diff --git a/net/libnet/files/patch-src-libnet_if_addr.c b/net/libnet/files/patch-src-libnet_if_addr.c deleted file mode 100644 index 723aa9380327..000000000000 --- a/net/libnet/files/patch-src-libnet_if_addr.c +++ /dev/null @@ -1,34 +0,0 @@ -- memory leak fixed, device list needs to freed after use. [2] -- Properly set l->err_buf if libnet_ifaddrlist() fails. [3] - -Obtained from: https://github.com/sam-github/libnet/commit/18cbe497dd84afc471a5320e4ef3a7cde87c2c4e [1] - https://github.com/sam-github/libnet/commit/2e724b2f5cd614d7362f8dcbc57dc1fca6e437b3 [2] - ---- src/libnet_if_addr.c.orig 2012-03-19 16:59:50 UTC -+++ src/libnet_if_addr.c -@@ -330,6 +330,8 @@ register char *errbuf) - ++nipaddr; - } - -+ pcap_freealldevs(alldevs); -+ - *ipaddrp = ifaddrlist; - return (nipaddr); - } -@@ -339,7 +341,6 @@ int - libnet_select_device(libnet_t *l) - { - int c, i; -- char err_buf[LIBNET_ERRBUF_SIZE]; - struct libnet_ifaddr_list *address_list, *al; - uint32_t addr; - -@@ -364,7 +365,7 @@ libnet_select_device(libnet_t *l) - /* - * Number of interfaces. - */ -- c = libnet_ifaddrlist(&address_list, l->device, err_buf); -+ c = libnet_ifaddrlist(&address_list, l->device, l->err_buf); - if (c < 0) - { - /* err msg set in libnet_ifaddrlist() */ diff --git a/net/libnet/files/patch-src-libnet_link_bpf.c b/net/libnet/files/patch-src-libnet_link_bpf.c deleted file mode 100644 index 8e61c05a9ae0..000000000000 --- a/net/libnet/files/patch-src-libnet_link_bpf.c +++ /dev/null @@ -1,32 +0,0 @@ -- Make libnet_get_hwaddr() work with 802.1q interfaces in bpf (BSD). - -Obtained from: https://github.com/sam-github/libnet/commit/408fa2266a4af402152cc0f1e9a40b56477b995a - ---- src/libnet_link_bpf.c.orig 2012-03-19 16:59:50 UTC -+++ src/libnet_link_bpf.c -@@ -316,7 +316,11 @@ libnet_get_hwaddr(libnet_t *l) - if (ifm->ifm_type == RTM_IFINFO) - { - sdl = (struct sockaddr_dl *)(ifm + 1); -- if (sdl->sdl_type != IFT_ETHER) -+ if (sdl->sdl_type != IFT_ETHER -+ && sdl->sdl_type != IFT_FASTETHER -+ && sdl->sdl_type != IFT_FASTETHERFX -+ && sdl->sdl_type != IFT_GIGABITETHERNET -+ && sdl->sdl_type != IFT_L2VLAN) - continue; - if (strncmp(&sdl->sdl_data[0], l->device, sdl->sdl_nlen) == 0) - { -@@ -326,6 +330,12 @@ libnet_get_hwaddr(libnet_t *l) - } - } - free(buf); -+ if (next == end) { -+ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, -+ "%s(): interface %s of known type not found.", -+ __func__, l->device); -+ return NULL; -+ } - return (&ea); - } - diff --git a/net/libnet/pkg-descr b/net/libnet/pkg-descr index cc9b2c0873fa..4003617eebbf 100644 --- a/net/libnet/pkg-descr +++ b/net/libnet/pkg-descr @@ -1,18 +1,7 @@ -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 is an API to help with the construction and injection 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 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 libpcap). - -WWW: https://sourceforge.net/projects/libnet-dev/ -WWW: https://github.com/sam-github/libnet +WWW: https://github.com/libnet/libnet diff --git a/net/libnet/pkg-plist b/net/libnet/pkg-plist index d3c877184b08..6cd47b877925 100644 --- a/net/libnet/pkg-plist +++ b/net/libnet/pkg-plist @@ -8,8 +8,57 @@ include/libnet/libnet-structures.h include/libnet/libnet-types.h lib/libnet.a lib/libnet.so -lib/libnet.so.1 -lib/libnet.so.1.7.0 -man/man3/libnet-functions.h.3.gz -man/man3/libnet-macros.h.3.gz -man/man3/libnet.h.3.gz +lib/libnet.so.9 +lib/libnet.so.9.0.0 +libdata/pkgconfig/libnet.pc +%%PORTDOCS%%%%DOCSDIR%%/ChangeLog.md +%%PORTDOCS%%%%DOCSDIR%%/README.md +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/arp-new.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/arp.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/bgp4_hdr.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/bgp4_notification.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/bgp4_open.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/bgp4_update.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/cdp.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/dhcp_discover.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/dns.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/dot1x.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fddi_tcp1.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fddi_tcp2.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/get_addr.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/gre.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/hsrp.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/icmp6_echoreq.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/icmp6_unreach.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/icmp_echo_cq.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/icmp_redirect.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/icmp_timeexceed.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/icmp_timestamp.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/icmp_unreach.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ieee.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ip_link.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ip_raw.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/isl.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/mpls.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ntp.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ospf_hello.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ospf_lsa.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ping_of_death.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/rpc_tcp.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/rpc_udp.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sebek.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/smurf.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/stp.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/synflood.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/synflood6.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/synflood6_frag.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tcp1.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tcp2.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/test_ipv4.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/test_ipv4_options.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/test_ipv6_icmpv4.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tftp.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tring_tcp1.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tring_tcp2.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/udp1.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/udp2.c |