diff options
Diffstat (limited to 'dns/dualserver')
-rw-r--r-- | dns/dualserver/Makefile | 36 | ||||
-rw-r--r-- | dns/dualserver/distinfo | 2 | ||||
-rw-r--r-- | dns/dualserver/files/dualserver.in | 28 | ||||
-rw-r--r-- | dns/dualserver/files/patch-dualserverd.cpp | 211 | ||||
-rw-r--r-- | dns/dualserver/files/patch-dualserverd.h | 41 | ||||
-rw-r--r-- | dns/dualserver/pkg-descr | 6 |
6 files changed, 0 insertions, 324 deletions
diff --git a/dns/dualserver/Makefile b/dns/dualserver/Makefile deleted file mode 100644 index bfd6dba80bb1..000000000000 --- a/dns/dualserver/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# Created by: Gabor Kovesdan -# $FreeBSD$ - -PORTNAME= dualserver -PORTVERSION= 6.94 -PORTREVISION= 1 -PORTEPOCH= 1 -CATEGORIES= dns net -MASTER_SITES= http://rodrigo.osorio.free.fr/freebsd/distfiles/ -DISTNAME= ${PORTNAME}V${PORTVERSION} - -MAINTAINER= rodrigo@FreeBSD.org -COMMENT= Combined DHCP/DNS server for small LANs - -LICENSE= GPLv2 - -DEPRECATED= Please migrate to dns/dnsmasq. Over the years dualserver becomes unmaintenaible. -EXPIRATION_DATE= 2018-01-01 - -USES= dos2unix -USE_RC_SUBR= dualserver -PLIST_FILES= sbin/dualserver etc/dualserver.conf.sample - -post-extract: - @${MV} ${WRKDIR}/${PORTNAME} ${WRKSRC} - -do-build: - ${CXX} ${CXXFLAGS} -o ${WRKSRC}/dualserver \ - ${WRKSRC}/dualserverd.cpp -lpthread - -do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/sbin - ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.ini \ - ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample - -.include <bsd.port.mk> diff --git a/dns/dualserver/distinfo b/dns/dualserver/distinfo deleted file mode 100644 index 261bb379d301..000000000000 --- a/dns/dualserver/distinfo +++ /dev/null @@ -1,2 +0,0 @@ -SHA256 (dualserverV6.94.tar.gz) = 3007e6508eb95d06f3c8764951ff6d3276733409e2119f6299c9485060b9445c -SIZE (dualserverV6.94.tar.gz) = 796893 diff --git a/dns/dualserver/files/dualserver.in b/dns/dualserver/files/dualserver.in deleted file mode 100644 index b094232a491b..000000000000 --- a/dns/dualserver/files/dualserver.in +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -# $FreeBSD$ -# -# PROVIDE: dualserver -# REQUIRE: SERVERS -# BEFORE: -# KEYWORD: shutdown - -. /etc/rc.subr - -name="dualserver" -rcvar=dualserver_enable -start_cmd="dualserver_startcmd" -stop_cmd="dualserver_stopcmd" - -dualserver_startcmd () -{ -%%PREFIX%%/sbin/dualserver -} - -dualserver_stopcmd () -{ -killall dualserver -} - -load_rc_config $name -run_rc_command "$1" diff --git a/dns/dualserver/files/patch-dualserverd.cpp b/dns/dualserver/files/patch-dualserverd.cpp deleted file mode 100644 index 8e3bc32b0b0c..000000000000 --- a/dns/dualserver/files/patch-dualserverd.cpp +++ /dev/null @@ -1,211 +0,0 @@ ---- dualserverd.cpp.orig 2015-07-27 19:41:31.000000000 +0000 -+++ dualserverd.cpp 2015-07-27 19:46:28.000000000 +0000 -@@ -22,10 +22,16 @@ - #include <math.h> - #include <sys/types.h> - #include <sys/ioctl.h> -+#ifdef __FreeBSD__ -+#include <sys/socket.h> -+#endif - #include <limits.h> - #include <sys/socket.h> - #include <netinet/in.h> - #include <net/if.h> -+#ifdef __FreeBSD__ -+#include <net/if_dl.h> -+#endif - #include <arpa/inet.h> - #include <netdb.h> - #include <unistd.h> -@@ -39,6 +45,9 @@ - #include <syslog.h> - #include <pthread.h> - #include <map> -+#ifdef __FreeBSD__ -+#include <ifaddrs.h> -+#endif - using namespace std; - #include "dualserverd.h" - -@@ -84,7 +93,11 @@ - const char send200[] = "HTTP/1.1 200 OK\r\nDate: %s\r\nLast-Modified: %s\r\nContent-Type: text/html\r\nConnection: Close\r\nContent-Length: \r\n\r\n"; - //const char send200[] = "HTTP/1.1 200 OK\r\nDate: %s\r\nLast-Modified: %s\r\nContent-Type: text/html\r\nConnection: Close\r\nTransfer-Encoding: chunked\r\n"; - const char line200[] = "<td>%s</td>"; -+#ifdef __FreeBSD__ -+const char sVersion[] = "Dual DHCP DNS Server Version 6.94 for FreeBSD"; -+#else - const char sVersion[] = "Dual DHCP DNS Server Version 6.94 Linux Build 7011"; -+#endif - const data4 opData[] = - { - { "SubnetMask", DHCP_OPTION_NETMASK, 3 }, -@@ -261,7 +274,7 @@ - strcpy(leaFile, "/tmp/dualserver.state"); - - if (!iniFile[0]) -- strcpy(iniFile, "/etc/dualserver.ini"); -+ strcpy(iniFile, "/usr/local/etc/dualserver.conf"); - - if (verbatim) - { -@@ -4002,7 +4015,13 @@ - else if (req->dhcpp.header.bp_broadcast || !req->remote.sin_addr.s_addr || req->reqIP) - { - req->remote.sin_port = htons(IPPORT_DHCPC); -+#ifdef __FreeBSD__ -+ req->remote.sin_addr.s_addr = network.dhcpConn[req->sockInd].addr.sin_addr.s_addr | -+ (~network.dhcpConn[req->sockInd].mask); -+ //printf("broadcast dhcp response to %s\n",inet_ntoa(req->remote.sin_addr)); -+#else - req->remote.sin_addr.s_addr = INADDR_BROADCAST; -+#endif - req->dhcpp.header.bp_broadcast = 1; - } - else -@@ -8983,6 +9002,10 @@ - newNetwork.dhcpConn[i].broadCastSize = sizeof(newNetwork.dhcpConn[i].broadCastVal); - - setsockopt(newNetwork.dhcpConn[i].sock, SOL_SOCKET, SO_BROADCAST, (char*)&newNetwork.dhcpConn[i].broadCastVal, newNetwork.dhcpConn[i].broadCastSize); -+#ifdef __FreeBSD__ -+ // See man ip -+ setsockopt(newNetwork.dhcpConn[i].sock,IPPROTO_IP, IP_ONESBCAST,(char*)&newNetwork.dhcpConn[i].broadCastVal, newNetwork.dhcpConn[i].broadCastSize); -+#endif - int nRet = bind(newNetwork.dhcpConn[i].sock, (sockaddr*)&newNetwork.dhcpConn[i].addr, sizeof(struct sockaddr_in)); - - if (nRet == SOCKET_ERROR) -@@ -9034,7 +9057,11 @@ - setsockopt(newNetwork.dhcpListener.sock, SOL_SOCKET, SO_REUSEADDR, (char*)&newNetwork.dhcpListener.reUseVal, newNetwork.dhcpListener.reUseSize); - newNetwork.dhcpListener.pktinfoVal = true; - newNetwork.dhcpListener.pktinfoSize = sizeof(newNetwork.dhcpListener.pktinfoVal); -+#ifdef __FreeBSD__ -+ setsockopt(newNetwork.dhcpListener.sock, IPPROTO_IP, IP_RECVIF, &newNetwork.dhcpListener.pktinfoVal, newNetwork.dhcpListener.pktinfoSize); -+#else - setsockopt(newNetwork.dhcpListener.sock, IPPROTO_IP, IP_PKTINFO, &newNetwork.dhcpListener.pktinfoVal, newNetwork.dhcpListener.pktinfoSize); -+#endif - - newNetwork.dhcpListener.addr.sin_family = AF_INET; - newNetwork.dhcpListener.addr.sin_addr.s_addr = INADDR_ANY; -@@ -9458,6 +9485,10 @@ - else - return false; - } -+#define MAX(a,b) ((a)>(b)?(a):(b)) -+#define NEXTIFR(i) \ -+ ((struct ifreq *)((char *)&(i)->ifr_addr \ -+ + MAX((i)->ifr_addr.sa_len, sizeof((i)->ifr_addr))) ) - - void getInterfaces(data1 *network) - { -@@ -9469,14 +9500,16 @@ - if (ioctl(cfig.fixedSocket, SIOCGIFCONF, &Ifc) >= 0) - { - -+ struct ifreq *ifrp, *ifen; - MYDWORD addr, mask; - short flags; - struct ifreq pIfr; -- MYBYTE numInterfaces = Ifc.ifc_len / sizeof(ifreq); -+ ifrp = (struct ifreq *)Ifc.ifc_buf; -+ ifen = (struct ifreq *)((char *)Ifc.ifc_buf + Ifc.ifc_len); - -- for (MYBYTE i = 0 ; i < numInterfaces; i++) -- { -- memcpy(&pIfr, &(IfcBuf[i]), sizeof(ifreq)); -+ for (; ifrp < ifen;) { -+ memcpy(&pIfr, ifrp, sizeof(ifreq)); -+ ifrp = NEXTIFR(ifrp); - - if (!ioctl(cfig.fixedSocket, SIOCGIFADDR, &pIfr)) - addr = ((struct sockaddr_in*)&pIfr.ifr_addr)->sin_addr.s_addr; -@@ -9496,8 +9529,11 @@ - - if (addr && !(flags & IFF_LOOPBACK)) - addServer(network->allServers, addr); -- -+#ifdef __FreeBSD__ -+ if (addr && mask && !(flags & IFF_POINTOPOINT) && !(flags & IFF_LOOPBACK)) -+#else - if (addr && mask && !(flags & IFF_POINTOPOINT) && !(flags & IFF_LOOPBACK) && !(flags & IFF_DYNAMIC)) -+#endif - { - if ((flags & IFF_RUNNING) && (flags & IFF_UP)) - { -@@ -9656,6 +9692,12 @@ - - MYWORD gdmess(data9 *req, MYBYTE sockInd) - { -+#ifdef __FreeBSD__ -+ struct cmsghdr *cmsg; -+ struct sockaddr_dl * isdl; -+ struct sockaddr_in *isin; -+ struct ifaddrs *ifap, *ifa; -+#endif - //sprintf(logBuff, "Socket=%u", sockInd); - //logDHCPMess(logBuff, 1); - memset(req, 0, sizeof(data9)); -@@ -9671,7 +9713,11 @@ - req->msg.msg_name = &req->remote; - req->msg.msg_namelen = sizeof(sockaddr_in); - req->msg.msg_control = &req->msgcontrol; -+#ifdef __FreeBSD__ -+ req->msg.msg_controllen = sizeof(req->msgcontrol); -+#else - req->msg.msg_controllen = sizeof(msg_control); -+#endif - req->msg.msg_flags = msgflags; - - int flags = 0; -@@ -9680,6 +9726,45 @@ - if (errno || req->bytes <= 0) - return 0; - -+#ifdef __FreeBSD__ -+ isdl = NULL; -+ isin = NULL; -+ MYDWORD addr=0; -+ bool found_addr = false; -+ -+ if (req->msg.msg_controllen>0){ -+ for (cmsg=CMSG_FIRSTHDR(&req->msg);cmsg;cmsg=CMSG_NXTHDR(&req->msg,cmsg)){ -+ if (cmsg->cmsg_type==IP_RECVIF) { -+ isdl=(struct sockaddr_dl *)CMSG_DATA(cmsg); -+ } -+ } -+ } -+ -+ if (!isdl || getifaddrs(&ifap)) -+ return 0; -+ -+ for (ifa = ifap; ifa; ifa = ifa->ifa_next) { -+ if(ifa->ifa_addr->sa_family == AF_INET && -+ strcmp(ifa->ifa_name,isdl->sdl_data) == 0){ -+ isin = (struct sockaddr_in *)ifa->ifa_addr; -+ addr = isin->sin_addr.s_addr; -+ for (int i = 0; (i < MAX_SERVERS || !network.dhcpConn[i].server);i++){ -+ if (addr == network.dhcpConn[i].server){ -+ found_addr = true; -+ req->sockInd = i; -+ break; -+ } -+ } -+ } -+ } -+ freeifaddrs(ifap); -+ -+ if(!found_addr) return 0; -+ -+ //printf("IF = %s\n", isdl->sdl_data); -+ //printf("RADDR = %s\n", inet_ntoa(isin->sin_addr)); -+ -+#else - //printf("%u\n", req->msg.msg_controllen); - //msgcontrol = (msg_control*)msg.msg_control; - -@@ -9711,6 +9796,7 @@ - break; - } - } -+#endif - } - else - { diff --git a/dns/dualserver/files/patch-dualserverd.h b/dns/dualserver/files/patch-dualserverd.h deleted file mode 100644 index 319c64ef9e15..000000000000 --- a/dns/dualserver/files/patch-dualserverd.h +++ /dev/null @@ -1,41 +0,0 @@ ---- dualserverd.h 2012-11-09 15:45:52.000000000 +0100 -+++ dualserverd.h 2012-11-09 15:55:00.000000000 +0100 -@@ -52,9 +52,11 @@ - #define INADDR_NONE ULONG_MAX - #endif - -+#ifndef __FreeBSD__ - #ifndef IFF_DYNAMIC - #define IFF_DYNAMIC 0x8000 - #endif -+#endif - - #define MYWORD unsigned short - #define MYBYTE unsigned char -@@ -594,10 +596,15 @@ - - struct msg_control - { -- ulong cmsg_len; -+ u_long cmsg_len; - int cmsg_level; - int cmsg_type; -- in_pktinfo pktinfo; -+ #ifdef __FreeBSD__ -+ // Arbitrary size, when the size is required we use sizeof -+ unsigned char pktinfo[100]; -+ #else -+ in_pktinfo pktinfo; -+ #endif - }; - - #if defined(__hppa__) || \ -@@ -713,7 +720,7 @@ - union - { - int broadCastVal; -- bool pktinfoVal; -+ int pktinfoVal; - }; - union - { diff --git a/dns/dualserver/pkg-descr b/dns/dualserver/pkg-descr deleted file mode 100644 index fffc05ab8d45..000000000000 --- a/dns/dualserver/pkg-descr +++ /dev/null @@ -1,6 +0,0 @@ -Combined DHCP/DNS Server for Small LAN. Dynamic DHCP allocates/renew host -addresses while Caching DNS Server first try resolving from DHCP allotted -names then from Cache then only forwarding to External DNS Servers. Auto -Config and auto Dynamic DNS update. - -WWW: https://sourceforge.net/projects/dhcp-dns-server/ |