1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-20 00:21:35 +00:00

The European Installation Bus (EIB) is a field bus system for home and building

automation. This package contains the EIBnet/IP tunneling and routing daemon
which is part of the BCU SDK. It provides access to an EIB bus over TCP/IP and
Unix domain sockets.

WWW: http://www.auto.tuwien.ac.at/~mkoegler/index.php/eibd

PR:		ports/118471
Submitted by:	Björn König <bkoenig at alpha-tierchen.de>
This commit is contained in:
Martin Wilke 2007-12-17 23:29:05 +00:00
parent 8fafddb8d0
commit ad83624b21
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=203956
15 changed files with 387 additions and 0 deletions

View File

@ -50,6 +50,7 @@
SUBDIR += b2bua
SUBDIR += balance
SUBDIR += bbsnet
SUBDIR += bcusdk-eibd
SUBDIR += beacon
SUBDIR += bfilter
SUBDIR += bindtest

66
net/bcusdk-eibd/Makefile Normal file
View File

@ -0,0 +1,66 @@
# New ports collection makefile for: bcusdk-eibd
# Date Created: 6 December 2007
# Whom: Björn König <bkoenig@alpha-tierchen.de>
#
# $FreeBSD$
#
PORTNAME= bcusdk
PORTVERSION= 0.0.3
CATEGORIES= net
MASTER_SITES= http://www.auto.tuwien.ac.at/~mkoegler/eib/
PKGNAMESUFFIX= -eibd
DISTFILES= ${PORTNAME}_${PORTVERSION}${EXTRACT_SUFX}
MAINTAINER= bkoenig@alpha-tierchen.de
COMMENT= The EIBnet/IP server of the BCU SDK
LIB_DEPENDS= pthsem.20:${PORTSDIR}/devel/pthsem
BUILD_DEPENDS= ${LOCALBASE}/lib/libargp.a:${PORTSDIR}/devel/argp-standalone
GNU_CONFIGURE= yes
USE_GMAKE= yes
CONFIGURE_ARGS+=--enable-onlyeibd \
--disable-usb \
--enable-eibnetip \
--enable-eibnetipserver \
--enable-eibnetiptunnel \
--enable-groupcache
CPPFLAGS= "-I${LOCALBASE}/include -L${LOCALBASE}/lib"
CFLAGS= "-I${LOCALBASE}/include -L${LOCALBASE}/lib ${CFLAGS}"
OPTIONS= JAVA "Install Java client library" off \
EXAMPLES "Install example client applications" on
.include <bsd.port.pre.mk>
.if defined(WITH_JAVA)
CONFIGURE_ARGS+=--enable-java
USE_JAVA= yes
PLIST_SUB+= JAVA=""
.else
PLIST_SUB+= JAVA="@comment "
.endif
.if defined(WITH_EXAMPLES)
PLIST_SUB+= EXAMPLES=""
.else
PLIST_SUB+= EXAMPLES="@comment "
.endif
pre-patch:
@${REINPLACE_CMD} "s,-ri,-Ei.bak," ${WRKSRC}/eibd/client/php/Makefile.in
@${REINPLACE_CMD} "s, bcu,," ${WRKSRC}/eibd/Makefile.in
@${REINPLACE_CMD} "s, php,," ${WRKSRC}/eibd/client/Makefile.in
.if !defined(WITH_EXAMPLES)
@${REINPLACE_CMD} "s, examples,," ${WRKSRC}/eibd/Makefile.in
.else
@${REINPLACE_CMD} -e "s,^\(examplesdir = \).*,\1${EXAMPLESDIR}," \
-e "s,^\(bindir = \).*,\1${EXAMPLESDIR}/bin," \
${WRKSRC}/eibd/examples/Makefile.in
.endif
.if defined(WITH_JAVA)
@${REINPLACE_CMD} "s,^\(javadir = \).*,\1${JAVASHAREDIR}," ${WRKSRC}/eibd/client/java/Makefile.in
.endif
.include <bsd.port.post.mk>

3
net/bcusdk-eibd/distinfo Normal file
View File

@ -0,0 +1,3 @@
MD5 (bcusdk_0.0.3.tar.gz) = 62f660e6b9b56f6926bffb99922ffaa5
SHA256 (bcusdk_0.0.3.tar.gz) = f431d251478f4a69a9fc89cb5f2ef70e5929bbf7147fc8019cb083d559363035
SIZE (bcusdk_0.0.3.tar.gz) = 547053

View File

@ -0,0 +1,11 @@
--- configure.orig 2007-11-08 15:31:54.000000000 +0000
+++ configure 2007-12-08 14:37:29.000000000 +0000
@@ -5332,7 +5332,7 @@
fi
-have_source_info=no
+have_source_info=yes
have_linux_api=no
echo "$as_me:$LINENO: checking for linux/rtnetlink.h" >&5
echo $ECHO_N "checking for linux/rtnetlink.h... $ECHO_C" >&6

View File

@ -0,0 +1,10 @@
--- eibd/client/c/eibclient-int.h.orig 2007-11-08 15:31:32.000000000 +0000
+++ eibd/client/c/eibclient-int.h 2007-12-08 15:18:31.000000000 +0000
@@ -30,7 +30,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <errno.h>
#include "eibclient.h"

View File

@ -0,0 +1,10 @@
--- eibd/client/c/openremote.c.orig 2007-11-08 15:31:32.000000000 +0000
+++ eibd/client/c/openremote.c 2007-12-08 15:23:07.000000000 +0000
@@ -25,6 +25,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>

View File

@ -0,0 +1,10 @@
--- eibd/eibnet/eibnetdescribe.cpp.orig 2007-11-08 15:31:33.000000000 +0000
+++ eibd/eibnet/eibnetdescribe.cpp 2007-12-08 15:37:00.000000000 +0000
@@ -19,7 +19,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <stdarg.h>
#include <arpa/inet.h>
#include "eibnetip.h"

View File

@ -0,0 +1,10 @@
--- eibd/eibnet/eibnetsearch.cpp.orig 2007-11-08 15:31:33.000000000 +0000
+++ eibd/eibnet/eibnetsearch.cpp 2007-12-08 15:37:52.000000000 +0000
@@ -19,7 +19,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <stdarg.h>
#include <arpa/inet.h>
#include "eibnetip.h"

View File

@ -0,0 +1,10 @@
--- eibd/examples/common.c.orig 2007-11-08 15:31:33.000000000 +0000
+++ eibd/examples/common.c 2007-12-08 15:26:19.000000000 +0000
@@ -17,7 +17,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "common.h"
-#include <string.h>
#include <stdlib.h>
#include <stdarg.h>

View File

@ -0,0 +1,10 @@
--- eibd/examples/common.h.orig 2007-11-08 15:31:33.000000000 +0000
+++ eibd/examples/common.h 2007-12-08 15:00:10.000000000 +0000
@@ -19,6 +19,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
+#include <unistd.h>
#include "eibclient.h"
/** unsigned char*/

View File

@ -0,0 +1,11 @@
--- eibd/libserver/apdu.cpp.orig 2007-11-08 15:31:33.000000000 +0000
+++ eibd/libserver/apdu.cpp 2007-12-08 15:08:18.000000000 +0000
@@ -18,8 +18,7 @@
*/
#include <stdio.h>
-#include <string.h>
#include "apdu.h"
APDU *
APDU::fromPacket (const CArray & c)

View File

@ -0,0 +1,114 @@
--- eibd/libserver/eibnetip.cpp.orig Thu Nov 8 16:31:33 2007
+++ eibd/libserver/eibnetip.cpp Tue Dec 11 10:11:47 2007
@@ -17,11 +17,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <string.h>
#include <netdb.h>
#include <sys/socket.h>
#include <unistd.h>
-#include <asm/types.h>
#include "eibnetip.h"
#include "config.h"
#ifdef HAVE_LINUX_NETLINK
@@ -34,6 +32,11 @@
#include <iphlpapi.h>
#undef Array
#endif
+#if defined(__FreeBSD__)
+#include <netinet/in.h>
+#include <net/if.h>
+#include <net/route.h>
+#endif
int
GetHostIP (struct sockaddr_in *sock, const char *Name)
@@ -45,6 +48,7 @@
h = gethostbyname (Name);
if (!h)
return 0;
+ sock->sin_len = sizeof (*sock);
sock->sin_family = h->h_addrtype;
sock->sin_addr.s_addr = (*((unsigned long *) h->h_addr_list[0]));
return 1;
@@ -144,6 +148,53 @@
}
#endif
+#if defined(__FreeBSD__)
+typedef struct
+{
+ struct rt_msghdr hdr;
+ char data[1000];
+} r_req;
+
+int
+GetSourceAddress (const struct sockaddr_in *dest, struct sockaddr_in *src)
+{
+ int s;
+ r_req req;
+ char *cp = req.data;
+ memset(&req, 0, sizeof(req));
+ memset(src, 0, sizeof (*src));
+ s = socket(PF_ROUTE, SOCK_RAW, 0);
+ if (s == -1)
+ return 0;
+ req.hdr.rtm_msglen = sizeof(req) + sizeof(*dest);
+ req.hdr.rtm_version = RTM_VERSION;
+ req.hdr.rtm_flags = RTF_UP;
+ req.hdr.rtm_type = RTM_GET;
+ req.hdr.rtm_addrs = RTA_DST | RTA_IFP;
+ memcpy(cp, dest, sizeof(*dest));
+ if (write (s, (char *)&req, req.hdr.rtm_msglen) < 0)
+ return 0;
+ if (read(s, (char *)&req, sizeof(req)) < 0)
+ return 0;
+ close(s);
+ int i;
+ cp = (char *)(&req.hdr + 1);
+ for (i = 1; i; i <<= 1)
+ if (i & req.hdr.rtm_addrs)
+ {
+ struct sockaddr *sa = (struct sockaddr *) cp;
+ if (i == RTA_IFA)
+ {
+ src->sin_family = AF_INET;
+ src->sin_addr.s_addr = ((struct sockaddr_in *)sa)->sin_addr.s_addr;
+ return 1;
+ }
+ cp += SA_SIZE(sa);
+ }
+ return 0;
+}
+#endif
+
EIBNetIPPacket::EIBNetIPPacket ()
{
service = 0;
@@ -208,6 +259,7 @@
return 1;
ip = (buf[2] << 24) | (buf[3] << 16) | (buf[4] << 8) | (buf[5]);
port = (buf[6] << 8) | (buf[7]);
+ a->sin_len = sizeof (*a);
a->sin_family = AF_INET;
a->sin_port = htons (port);
a->sin_addr.s_addr = htonl (ip);
@@ -254,7 +306,7 @@
if (fd != -1)
{
if (multicast)
- setsockopt (fd, SOL_IP, IP_DROP_MEMBERSHIP, &maddr, sizeof (maddr));
+ setsockopt (fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &maddr, sizeof (maddr));
close (fd);
}
}
@@ -265,7 +317,7 @@
if (multicast)
throw Exception (DEV_OPEN_FAIL);
maddr = multicastaddr;
- if (setsockopt (fd, SOL_IP, IP_ADD_MEMBERSHIP, &maddr, sizeof (maddr)) ==
+ if (setsockopt (fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &maddr, sizeof (maddr)) ==
-1)
throw Exception (DEV_OPEN_FAIL);
multicast = 1;

View File

@ -0,0 +1,15 @@
--- eibd/libserver/inetserver.cpp.orig 2007-11-08 15:31:33.000000000 +0000
+++ eibd/libserver/inetserver.cpp 2007-12-08 15:29:25.000000000 +0000
@@ -17,11 +17,11 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <unistd.h>
-#include <string.h>
#include "inetserver.h"
InetServer::InetServer (Layer3 * la3, Trace * tr, int port):

View File

@ -0,0 +1,6 @@
The European Installation Bus (EIB) is a field bus system for home and building
automation. This package contains the EIBnet/IP tunneling and routing daemon
which is part of the BCU SDK. It provides access to an EIB bus over TCP/IP and
Unix domain sockets.
WWW: http://www.auto.tuwien.ac.at/~mkoegler/index.php/eibd

100
net/bcusdk-eibd/pkg-plist Normal file
View File

@ -0,0 +1,100 @@
bin/eibd
bin/eibnetdescribe
bin/eibnetsearch
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/busmonitor1
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/busmonitor2
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/groupcacheclear
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/groupcachedisable
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/groupcacheenable
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/groupcacheread
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/groupcachereadsync
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/groupcacheremove
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/grouplisten
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/groupread
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/groupreadresponse
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/groupresponse
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/groupsocketlisten
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/groupsocketread
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/groupsresponse
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/groupswrite
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/groupwrite
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/madcread
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/maskver
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mmaskver
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mpeitype
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mprogmodeoff
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mprogmodeon
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mprogmodestatus
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mprogmodetoggle
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mpropdesc
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mpropread
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mpropscan
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mpropscanpoll
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mpropwrite
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mread
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mrestart
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/msetkey
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mwrite
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/mwriteplain
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/progmodeoff
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/progmodeon
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/progmodestatus
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/progmodetoggle
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/readindividual
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/vbusmonitor1
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/vbusmonitor1poll
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/vbusmonitor2
%%EXAMPLES%%%%EXAMPLESDIR%%/bin/writeaddress
%%EXAMPLES%%%%EXAMPLESDIR%%/busmonitor1.c
%%EXAMPLES%%%%EXAMPLESDIR%%/busmonitor2.c
%%EXAMPLES%%%%EXAMPLESDIR%%/common.c
%%EXAMPLES%%%%EXAMPLESDIR%%/common.h
%%EXAMPLES%%%%EXAMPLESDIR%%/groupcacheclear.c
%%EXAMPLES%%%%EXAMPLESDIR%%/groupcachedisable.c
%%EXAMPLES%%%%EXAMPLESDIR%%/groupcacheenable.c
%%EXAMPLES%%%%EXAMPLESDIR%%/groupcacheread.c
%%EXAMPLES%%%%EXAMPLESDIR%%/groupcachereadsync.c
%%EXAMPLES%%%%EXAMPLESDIR%%/groupcacheremove.c
%%EXAMPLES%%%%EXAMPLESDIR%%/grouplisten.c
%%EXAMPLES%%%%EXAMPLESDIR%%/groupread.c
%%EXAMPLES%%%%EXAMPLESDIR%%/groupreadresponse.c
%%EXAMPLES%%%%EXAMPLESDIR%%/groupresponse.c
%%EXAMPLES%%%%EXAMPLESDIR%%/groupsocketlisten.c
%%EXAMPLES%%%%EXAMPLESDIR%%/groupsocketread.c
%%EXAMPLES%%%%EXAMPLESDIR%%/groupsresponse.c
%%EXAMPLES%%%%EXAMPLESDIR%%/groupswrite.c
%%EXAMPLES%%%%EXAMPLESDIR%%/groupwrite.c
%%EXAMPLES%%%%EXAMPLESDIR%%/madcread.c
%%EXAMPLES%%%%EXAMPLESDIR%%/maskver.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mmaskver.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mpeitype.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mprogmodeoff.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mprogmodeon.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mprogmodestatus.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mprogmodetoggle.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mpropdesc.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mpropread.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mpropscan.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mpropscanpoll.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mpropwrite.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mread.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mrestart.c
%%EXAMPLES%%%%EXAMPLESDIR%%/msetkey.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mwrite.c
%%EXAMPLES%%%%EXAMPLESDIR%%/mwriteplain.c
%%EXAMPLES%%%%EXAMPLESDIR%%/progmodeoff.c
%%EXAMPLES%%%%EXAMPLESDIR%%/progmodeon.c
%%EXAMPLES%%%%EXAMPLESDIR%%/progmodestatus.c
%%EXAMPLES%%%%EXAMPLESDIR%%/progmodetoggle.c
%%EXAMPLES%%%%EXAMPLESDIR%%/readindividual.c
%%EXAMPLES%%%%EXAMPLESDIR%%/vbusmonitor1.c
%%EXAMPLES%%%%EXAMPLESDIR%%/vbusmonitor1poll.c
%%EXAMPLES%%%%EXAMPLESDIR%%/vbusmonitor2.c
%%EXAMPLES%%%%EXAMPLESDIR%%/writeaddress.c
%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/bin
%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%
%%JAVA%%%%JAVASHAREDIR%%/eibclient.jar
include/eibclient.h
include/eibloadresult.h
include/eibtypes.h
lib/libeibclient.a