This library provides simple read-only access to the local computer's

networking configuration. It is currently capable of getting a list of
all the network interfaces and their respective IPv4, IPv6 and MAC
addresses.

From David Schaefer, some small changes to patches/patch-cbits_network_h
from me, also discussed with dcoppa@

ok dcoppa@
This commit is contained in:
kili 2014-03-31 21:41:13 +00:00
parent 5089ca204a
commit b75230deea
5 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,19 @@
# $OpenBSD: Makefile,v 1.1.1.1 2014/03/31 21:41:13 kili Exp $
COMMENT = obtain getifaddrs(3) information from Haskell
DISTNAME = network-info-0.2.0.3
CATEGORIES = net
HOMEPAGE = https://github.com/jystic/network-info
MAINTAINER = David Schaefer <dawedawe@gmx.de>
# BSD3
PERMIT_PACKAGE_CDROM = Yes
MODULES = lang/ghc
MODGHC_BUILD = cabal hackage haddock register
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (ghc/network-info-0.2.0.3.tar.gz) = QueRRoKLPn3+yohKS+T+efeoS8RHHYzx7PfqPFWh3BI=
SIZE (ghc/network-info-0.2.0.3.tar.gz) = 5644

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-cbits_network_h,v 1.1.1.1 2014/03/31 21:41:13 kili Exp $
Don't double the size of ip addresses on LP64 architectures to avoid
posssible memory corruption.
A better solution seems to be contained in the pull request at
https://github.com/jystic/network-info/pull/5; but until it didn't
make it into a new relaese of hs-network-info, we use the quick
hack below.
--- cbits/network.h.orig Wed Oct 17 04:25:56 2012
+++ cbits/network.h Sun Mar 30 23:53:21 2014
@@ -1,8 +1,10 @@
+#include <sys/types.h>
+
#define NAME_SIZE (128+4)
#define MAC_SIZE 6
-typedef long ipv4;
-typedef long ipv6[4];
+typedef int32_t ipv4;
+typedef int32_t ipv6[4];
struct network_interface {
wchar_t name[NAME_SIZE];

View File

@ -0,0 +1,4 @@
This library provides simple read-only access to the local computer's
networking configuration. It is currently capable of getting a list of
all the network interfaces and their respective IPv4, IPv6 and MAC
addresses.

View File

@ -0,0 +1,28 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2014/03/31 21:41:13 kili Exp $
lib/ghc/${DISTNAME}/
lib/ghc/${DISTNAME}/HS${DISTNAME}.o
lib/ghc/${DISTNAME}/Network/
lib/ghc/${DISTNAME}/Network/Info.hi
lib/ghc/${DISTNAME}/Network/Info.p_hi
lib/ghc/${DISTNAME}/libHS${DISTNAME}.a
lib/ghc/${DISTNAME}/libHS${DISTNAME}_p.a
lib/ghc/${DISTNAME}/register.sh
share/doc/hs-${DISTNAME}/
share/doc/hs-${DISTNAME}/LICENSE
share/doc/hs-${DISTNAME}/html/
share/doc/hs-${DISTNAME}/html/Network-Info.html
share/doc/hs-${DISTNAME}/html/doc-index.html
share/doc/hs-${DISTNAME}/html/frames.html
share/doc/hs-${DISTNAME}/html/haddock-util.js
share/doc/hs-${DISTNAME}/html/hslogo-16.png
share/doc/hs-${DISTNAME}/html/index-frames.html
share/doc/hs-${DISTNAME}/html/index.html
share/doc/hs-${DISTNAME}/html/mini_Network-Info.html
share/doc/hs-${DISTNAME}/html/minus.gif
share/doc/hs-${DISTNAME}/html/network-info.haddock
share/doc/hs-${DISTNAME}/html/ocean.css
share/doc/hs-${DISTNAME}/html/plus.gif
share/doc/hs-${DISTNAME}/html/synopsis.png
@exec /usr/bin/env HOME=/nonexistent %D/lib/ghc/${DISTNAME}/register.sh -v0
@unexec /usr/bin/env HOME=/nonexistent %D/lib/ghc/${DISTNAME}/unregister.sh -v0 --force
lib/ghc/${DISTNAME}/unregister.sh