From nobody@FreeBSD.org  Sun Jan 11 01:02:07 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C475F106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 11 Jan 2009 01:02:07 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id B0AF18FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 11 Jan 2009 01:02:07 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n0B1261x004031
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 11 Jan 2009 01:02:06 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n0B126ZO004030;
	Sun, 11 Jan 2009 01:02:06 GMT
	(envelope-from nobody)
Message-Id: <200901110102.n0B126ZO004030@www.freebsd.org>
Date: Sun, 11 Jan 2009 01:02:06 GMT
From: Sevan Janiyan <venture37@geeklan.co.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: New Port: net-mgmt/coovachilli, coova is an access controller, forked from chillispot
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         130357
>Category:       ports
>Synopsis:       New Port: net-mgmt/coovachilli, coova is an access controller, forked from chillispot
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    amdmi3
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 11 01:10:00 UTC 2009
>Closed-Date:    Tue Jan 20 11:58:17 UTC 2009
>Last-Modified:  Tue Jan 20 12:00:02 UTC 2009
>Originator:     Sevan Janiyan
>Release:        7.1 AMD64
>Organization:
>Environment:
>Description:
CoovaChilli is a fork of the now defunct ChilliSpot project. 
Coova builds on the popular features of Chillispot & should be used instead of it.
>How-To-Repeat:

>Fix:
attached

Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	coovachilli
#	coovachilli/Makefile
#	coovachilli/pkg-descr
#	coovachilli/distinfo
#	coovachilli/pkg-plist
#	coovachilli/files
#	coovachilli/files/patch-coova-chilli.spec.in
#	coovachilli/files/patch-conf_Makefile.in
#	coovachilli/files/patch-conf_Makefile.am
#	coovachilli/files/patch-src_chilli.c
#	coovachilli/files/patch-src_system.h
#	coovachilli/files/patch-src_redir.h
#	coovachilli/files/patch-src_redir.c
#	coovachilli/files/patch-src_msgstat.c
#	coovachilli/files/patch-src_main-query.c
#	coovachilli/files/patch-src_dhcp.c
#	coovachilli/files/patch-src_tun.c
#	coovachilli/files/patch-www_Makefile.am
#	coovachilli/files/main.conf.sample
#	coovachilli/files/pf.conf.sample
#	coovachilli/files/ipfw-config.sample
#	coovachilli/files/patch-conf_up.sh.in
#	coovachilli/files/patch-conf_functions.in
#	coovachilli/files/patch-conf_down.sh.in
#	coovachilli/files/coovachilli.in
#	coovachilli/pkg-message
#
echo c - coovachilli
mkdir -p coovachilli > /dev/null 2>&1
echo x - coovachilli/Makefile
sed 's/^X//' >coovachilli/Makefile << 'f6b4bc22749f01cda653c7708fc56205'
X# New ports collection makefile for:	CoovaChilli
X# Date created:		24 December 2006
X# Whom:			Sevan Janiyan <venture37@geeklan.co.uk>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	coovachilli
XPORTVERSION=	1.0.12
XCATEGORIES=	net-mgmt
XMASTER_SITES=	http://ap.coova.org/chilli/ \
X		http://www.geeklan.co.uk/files/ \
X		http://www.venture37.com/files/
XDISTNAME=	coova-chilli-${PORTVERSION}
X
XMAINTAINER=	venture37@geeklan.co.uk
XCOMMENT=	CoovaChilli is a fork of the popular ChilliSpot project
X
XCONFLICTS=	chillispot-1.*
X
XMAN1=		chilli_query.1 chilli_radconfig.1 chilli_response.1
XMAN5=		chilli.conf.5 chilli-radius.5
XMAN8=		chilli.8
X
XCONFIGURE_ARGS=-localstatedir=/var
XGNU_CONFIGURE=	yes
XUSE_LDCONFIG=	yes
XUSE_RC_SUBR=	coovachilli
XUSE_AUTOTOOLS=	automake:19
X
Xpost-install:
X.if !defined(NOPORTDATA)
X	${MKDIR} ${DATADIR}
X	${INSTALL_MAN} ${FILESDIR}/main.conf.sample ${DATADIR}
X	${INSTALL_MAN} ${FILESDIR}/pf.conf.sample ${DATADIR}
X	${INSTALL_MAN} ${FILESDIR}/ipfw-config.sample ${DATADIR}
X.endif
X	@${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.mk>
f6b4bc22749f01cda653c7708fc56205
echo x - coovachilli/pkg-descr
sed 's/^X//' >coovachilli/pkg-descr << '04b48427a5c9ef36abc67104b072fe70'
XCoovaChilli is a fork of the now defunct ChilliSpot project. 
XCoova builds on the popular features of Chillispot.
X
X
XWWW: http://www.coova.org/
04b48427a5c9ef36abc67104b072fe70
echo x - coovachilli/distinfo
sed 's/^X//' >coovachilli/distinfo << '06c0acc829d40edbbbb901212b9b61c6'
XMD5 (coova-chilli-1.0.12.tar.gz) = 365f46fe79b3d76432544d6bc5f37939
XSHA256 (coova-chilli-1.0.12.tar.gz) = fcd16fc043351e39ef9fc929f3ae83a838305ee14c173c444b8655d415baca68
XSIZE (coova-chilli-1.0.12.tar.gz) = 552537
06c0acc829d40edbbbb901212b9b61c6
echo x - coovachilli/pkg-plist
sed 's/^X//' >coovachilli/pkg-plist << '20a234b13ad2e374289bfb2fb0e471ca'
X@stopdaemon coovachilli
Xetc/chilli.conf
Xetc/chilli/defaults
Xetc/chilli/down.sh
Xetc/chilli/functions
Xetc/chilli/up.sh
Xwww/chilli/ChilliLibrary.js
Xwww/chilli/chilliController.js
Xwww/chilli/chilliform.chi
Xwww/chilli/chilliform.chi.sh
Xwww/chilli/chillijs.chi
Xwww/chilli/chillijs.chi.sh
Xwww/chilli/config.sh
Xwww/chilli/coova.html
Xwww/chilli/coova.jpg
Xwww/chilli/coova.png
Xwww/chilli/json_html.tmpl
Xwww/chilli/openid.gif
Xwww/chilli/wait.gif
Xetc/chilli/wwwsh
Xlib/libbstring.a
Xlib/libbstring.la
Xlib/libbstring.so
Xlib/libbstring.so.0
Xlib/libchilli.a
Xlib/libchilli.la
Xlib/libchilli.so
Xlib/libchilli.so.0
Xsbin/chilli
Xsbin/chilli_query
Xsbin/chilli_radconfig
Xsbin/chilli_response
Xsbin/test_radius
X@dirrm www/chilli
X@dirrm etc/chilli
X%%PORTDATA%%%%DATADIR%%/pf.conf.sample
X%%PORTDATA%%%%DATADIR%%/ipfw-config.sample
X%%PORTDATA%%%%DATADIR%%/main.conf.sample
X%%PORTDATA%%@dirrm %%DATADIR%%
20a234b13ad2e374289bfb2fb0e471ca
echo c - coovachilli/files
mkdir -p coovachilli/files > /dev/null 2>&1
echo x - coovachilli/files/patch-coova-chilli.spec.in
sed 's/^X//' >coovachilli/files/patch-coova-chilli.spec.in << '22ca43fa801179b4535f3ea94dd7a288'
X--- coova-chilli.spec.in.orig	2008-06-18 01:17:20.000000000 +0100
X+++ coova-chilli.spec.in	2008-06-18 01:17:28.000000000 +0100
X@@ -51,7 +51,6 @@
X %defattr(-,root,root)
X %{_sbindir}/*
X %{_libdir}/*.so*
X-%{_sysconfdir}/init.d/chilli
X %doc AUTHORS COPYING ChangeLog INSTALL README doc/dictionary.chillispot doc/hotspotlogin.cgi
X %config %{_sysconfdir}/chilli.conf
X %config(noreplace) %{_sysconfdir}/chilli/defaults
22ca43fa801179b4535f3ea94dd7a288
echo x - coovachilli/files/patch-conf_Makefile.in
sed 's/^X//' >coovachilli/files/patch-conf_Makefile.in << '33f8605f634b761f6d592c448f201831'
X--- conf/Makefile.in.orig	2008-06-08 05:49:09.000000000 +0100
X+++ conf/Makefile.in	2008-06-18 01:17:58.000000000 +0100
X@@ -46,11 +46,10 @@
X mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
X CONFIG_HEADER = $(top_builddir)/config.h
X CONFIG_CLEAN_FILES =
X-am__installdirs = "$(DESTDIR)$(chillidir)" "$(DESTDIR)$(initdir)" \
X-	"$(DESTDIR)$(chillidir)" "$(DESTDIR)$(sysconfdir)"
X+am__installdirs = "$(DESTDIR)$(chillidir)" "$(DESTDIR)$(chillidir)" \
X+	"$(DESTDIR)$(sysconfdir)"
X chilliSCRIPT_INSTALL = $(INSTALL_SCRIPT)
X-initSCRIPT_INSTALL = $(INSTALL_SCRIPT)
X-SCRIPTS = $(chilli_SCRIPTS) $(init_SCRIPTS)
X+SCRIPTS = $(chilli_SCRIPTS)
X SOURCES =
X DIST_SOURCES =
X am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
X@@ -163,14 +162,11 @@
X chillidir = $(sysconfdir)/chilli
X chilli_SCRIPTS = functions up.sh down.sh
X chilli_DATA = defaults 
X-initdir = $(sysconfdir)/init.d
X-init_SCRIPTS = chilli
X-EXTRA_DIST = $(init_SCRIPTS:=.in) \
X+EXTRA_DIST = \
X $(chilli_SCRIPTS:=.in) chilli.conf.in defaults.in
X 
X edit = sed \
X 	-e 's,@SBINDIR\@,$(sbindir),g' \
X-	-e 's,@INITDIR\@,$(initrddir),g' \
X 	-e 's,@VARRUN\@,$(localstatedir)/run,g' \
X 	-e 's,@ETCCHILLI\@,$(sysconfdir)/chilli,g' \
X 	-e 's,@SYSCONFDIR\@,$(sysconfdir),g' \
X@@ -227,25 +223,6 @@
X 	  echo " rm -f '$(DESTDIR)$(chillidir)/$$f'"; \
X 	  rm -f "$(DESTDIR)$(chillidir)/$$f"; \
X 	done
X-install-initSCRIPTS: $(init_SCRIPTS)
X-	@$(NORMAL_INSTALL)
X-	test -z "$(initdir)" || $(mkdir_p) "$(DESTDIR)$(initdir)"
X-	@list='$(init_SCRIPTS)'; for p in $$list; do \
X-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
X-	  if test -f $$d$$p; then \
X-	    f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
X-	    echo " $(initSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(initdir)/$$f'"; \
X-	    $(initSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(initdir)/$$f"; \
X-	  else :; fi; \
X-	done
X-
X-uninstall-initSCRIPTS:
X-	@$(NORMAL_UNINSTALL)
X-	@list='$(init_SCRIPTS)'; for p in $$list; do \
X-	  f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
X-	  echo " rm -f '$(DESTDIR)$(initdir)/$$f'"; \
X-	  rm -f "$(DESTDIR)$(initdir)/$$f"; \
X-	done
X 
X mostlyclean-libtool:
X 	-rm -f *.lo
X@@ -328,7 +305,7 @@
X check: check-am
X all-am: Makefile $(SCRIPTS) $(DATA)
X installdirs:
X-	for dir in "$(DESTDIR)$(chillidir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(chillidir)" "$(DESTDIR)$(sysconfdir)"; do \
X+	for dir in "$(DESTDIR)$(chillidir)" "$(DESTDIR)$(chillidir)" "$(DESTDIR)$(sysconfdir)"; do \
X 	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
X 	done
X install: install-am
X@@ -373,8 +350,7 @@
X 
X info-am:
X 
X-install-data-am: install-chilliDATA install-chilliSCRIPTS \
X-	install-initSCRIPTS
X+install-data-am: install-chilliDATA install-chilliSCRIPTS
X 
X install-exec-am: install-sysconfDATA
X 
X@@ -401,20 +377,20 @@
X ps-am:
X 
X uninstall-am: uninstall-chilliDATA uninstall-chilliSCRIPTS \
X-	uninstall-info-am uninstall-initSCRIPTS uninstall-sysconfDATA
X+	uninstall-info-am uninstall-sysconfDATA
X 
X .PHONY: all all-am check check-am clean clean-generic clean-libtool \
X 	distclean distclean-generic distclean-libtool distdir dvi \
X 	dvi-am html html-am info info-am install install-am \
X 	install-chilliDATA install-chilliSCRIPTS install-data \
X 	install-data-am install-exec install-exec-am install-info \
X-	install-info-am install-initSCRIPTS install-man install-strip \
X+	install-info-am install-man install-strip \
X 	install-sysconfDATA installcheck installcheck-am installdirs \
X 	maintainer-clean maintainer-clean-generic mostlyclean \
X 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
X 	uninstall uninstall-am uninstall-chilliDATA \
X 	uninstall-chilliSCRIPTS uninstall-info-am \
X-	uninstall-initSCRIPTS uninstall-sysconfDATA
X+	uninstall-sysconfDATA
X 
X 
X functions: Makefile functions.in
33f8605f634b761f6d592c448f201831
echo x - coovachilli/files/patch-conf_Makefile.am
sed 's/^X//' >coovachilli/files/patch-conf_Makefile.am << 'df3d70df8496a42bb48d247fd2996333'
X--- conf/Makefile.am.orig	2007-08-20 15:05:54.000000000 +0100
X+++ conf/Makefile.am	2008-06-18 01:17:58.000000000 +0100
X@@ -6,15 +6,11 @@
X chilli_SCRIPTS = functions up.sh down.sh
X chilli_DATA = defaults 
X 
X-initdir = $(sysconfdir)/init.d
X-init_SCRIPTS = chilli
X-
X-EXTRA_DIST = $(init_SCRIPTS:=.in) \
X+EXTRA_DIST = \
X $(chilli_SCRIPTS:=.in) chilli.conf.in defaults.in
X 
X edit = sed \
X 	-e 's,@SBINDIR\@,$(sbindir),g' \
X-	-e 's,@INITDIR\@,$(initrddir),g' \
X 	-e 's,@VARRUN\@,$(localstatedir)/run,g' \
X 	-e 's,@ETCCHILLI\@,$(sysconfdir)/chilli,g' \
X 	-e 's,@SYSCONFDIR\@,$(sysconfdir),g' \
X@@ -35,12 +31,6 @@
X 	$(edit) down.sh.in >down.sh.tmp
X 	mv down.sh.tmp down.sh
X 
X-chilli: Makefile chilli.in
X-	rm -f chilli chilli.tmp
X-	$(edit) chilli.in >chilli.tmp
X-	chmod +x chilli.tmp
X-	mv chilli.tmp chilli
X-
X chilli.conf: Makefile chilli.conf.in
X 	rm -f chilli.conf chilli.conf.tmp
X 	$(edit) chilli.conf.in >chilli.conf.tmp
df3d70df8496a42bb48d247fd2996333
echo x - coovachilli/files/patch-src_chilli.c
sed 's/^X//' >coovachilli/files/patch-src_chilli.c << '47805ff6ff1aee75ba2a8d7e9c699f42'
Xdiff -urN src/chilli.c.orig src/chilli.c
X--- src/chilli.c.orig	2008-06-28 17:38:35.000000000 +0100
X+++ src/chilli.c	2008-06-29 16:17:48.000000000 +0100
X@@ -3422,7 +3422,6 @@
X     exit(1);
X   }
X 
X-  /*tun_setaddr(tun, &options.dhcplisten,  &options.net, &options.mask);*/
X   tun_setaddr(tun, &options.dhcplisten,  &options.dhcplisten, &options.mask);
X   tun_set_cb_ind(tun, cb_tun_ind);
X 
X@@ -3638,8 +3637,7 @@
X     mainclock = time(0);
X 
X     if ((msgresult = 
X-	 TEMP_FAILURE_RETRY(msgrcv(redir->msgid, (struct msgbuf *)&msg, 
X-				   sizeof(msg.mdata), 0, IPC_NOWAIT)))  == -1) {
X+	 TEMP_FAILURE_RETRY(msgrcv(redir->msgid, (void *)&msg, sizeof(msg.mdata), 0, IPC_NOWAIT)))  == -1) {
X       if ((errno != EAGAIN) && (errno != ENOMSG))
X 	log_err(errno, "msgrcv() failed!");
X     }
X@@ -3669,7 +3667,7 @@
X 
X #elif defined (__FreeBSD__)  || defined (__APPLE__) || defined (__OpenBSD__)
X 
X-	if (net_isset(&dhcp->ipif, &fds) && dhcp_decaps(dhcp) < 0)
X+	if (net_isset(&dhcp->ipif, &fds) && dhcp_receive(dhcp) < 0)
X 	  log_err(0, "dhcp_decaps() failed!");
X 
X #endif
X
47805ff6ff1aee75ba2a8d7e9c699f42
echo x - coovachilli/files/patch-src_system.h
sed 's/^X//' >coovachilli/files/patch-src_system.h << 'da26471ff622d59d21ab1ddac0e4d86c'
Xdiff -urN src/system.h.orig src/system.h
X--- src/system.h.orig	2008-06-28 17:38:35.000000000 +0100
X+++ src/system.h	2008-06-29 16:17:48.000000000 +0100
X@@ -191,6 +191,8 @@
X     })
X #endif
X 
X+#define offsetof(TYPE, MEMBER) ((int)&((TYPE *)0)->MEMBER)
X+
X #include "bstrlib.h"
X 
X #endif
X
da26471ff622d59d21ab1ddac0e4d86c
echo x - coovachilli/files/patch-src_redir.h
sed 's/^X//' >coovachilli/files/patch-src_redir.h << '9ab5a46dedbd9f52358f4fcc901be0bc'
Xdiff -urN src/redir.h src/redir.h
X--- src/redir.h.orig	2008-06-28 17:38:35.000000000 +0100
X+++ src/redir.h	2008-06-29 16:17:48.000000000 +0100
X@@ -124,17 +124,18 @@
X 		      struct redir_conn_t *conn);
X };
X 
X+struct redir_msg_data {
X+  uint16_t opt;
X+  struct in_addr addr;
X+  struct redir_state redir;
X+  struct session_params params;
X+} __attribute__((packed));
X+
X struct redir_msg_t {
X   long mtype;
X-  struct redir_msg_data {
X-    uint16_t opt;
X-    struct in_addr addr;
X-    struct redir_state redir;
X-    struct session_params params;
X-  } mdata;
X+  struct redir_msg_data mdata;
X };
X 
X-
X int redir_new(struct redir_t **redir, struct in_addr *addr, int port, int uiport);
X 
X
9ab5a46dedbd9f52358f4fcc901be0bc
echo x - coovachilli/files/patch-src_redir.c
sed 's/^X//' >coovachilli/files/patch-src_redir.c << '4859e24927ab0f6e378df5965085bfec'
Xdiff -urN src/redir.c.orig src/redir.c
X--- src/redir.c.orig	2008-06-28 17:38:35.000000000 +0100
X+++ src/redir.c	2008-06-29 16:17:48.000000000 +0100
X@@ -479,7 +479,7 @@
X 
X   if ((conn->s_params.flags & REQUIRE_UAM_SPLASH) && 
X       conn->s_params.url[0]) {
X-    redir_url = conn->s_params.url;
X+    redir_url = (char *)conn->s_params.url;
X   }
X 
X   bassignformat(str, "%s%cres=%s&uamip=%s&uamport=%d", 
X@@ -1939,8 +1939,8 @@
X   msg.mdata.addr = address->sin_addr; \
X   memcpy(&msg.mdata.params, &conn.s_params, sizeof(msg.mdata.params)); \
X   memcpy(&msg.mdata.redir, &conn.s_state.redir, sizeof(msg.mdata.redir)); \
X-  if (msgsnd(redir->msgid, (struct msgbuf *)&msg, sizeof(msg.mdata), 0) < 0) { \
X-    log_err(errno, "msgsnd() failed!"); \
X+  if (msgsnd(redir->msgid, (void *)&msg, sizeof(msg.mdata), 0) < 0) { \
X+    log_err(errno, "msgsnd() failed! msgid=%d type=%d len=%d", redir->msgid, msg.mtype, sizeof(msg.mdata)); \
X     redir_close(infd, outfd); \
X   } 
X 
X
4859e24927ab0f6e378df5965085bfec
echo x - coovachilli/files/patch-src_msgstat.c
sed 's/^X//' >coovachilli/files/patch-src_msgstat.c << '281b23a126700944231d7e22cb88215e'
Xdiff -urN src/msgstat.c.orig src/msgstat.c
X--- src/msgstat.c.orig	1970-01-01 01:00:00.000000000 +0100
X+++ src/msgstat.c	2008-06-29 16:17:48.000000000 +0100
X@@ -0,0 +1,83 @@
X+#include <stdio.h>
X+#include <sys/types.h>
X+#include <sys/ipc.h>
X+#include <sys/msg.h>
X+#include <errno.h>
X+
X+
X+main()
X+{
X+	int uid, gid, mode, bytes;
X+	int rtrn, msqid, command, choice;
X+	struct msqid_ds msqid_ds, *buf;
X+
X+	buf = &msqid_ds;
X+
X+	printf("Enter the msqid: ");
X+	scanf("%i", &msqid);
X+
X+	printf("\n1 = IPC_STAT\n2 = IPC_SET\n3 = IPC_RMID\n");
X+	printf("Enter command number: ");
X+	scanf("%i", &command);
X+
X+	printf("\n\nmsqid = %d, command = %d\n", msqid, command);
X+
X+	switch (command) {
X+		case 1:
X+			rtrn = msgctl(msqid, IPC_STAT, buf);
X+			if (rtrn != -1) {
X+				printf("User %d, group %d, perms 0%o\n",
X+					buf->msg_perm.uid, buf->msg_perm.gid,
X+					buf->msg_perm.mode);
X+				printf("cbytes: %d, qnum: %d, qbytes %d\n",
X+					buf->msg_cbytes, buf->msg_qnum, 
X+					buf->msg_qbytes);
X+			}
X+			break;
X+
X+		case 2:
X+			rtrn = msgctl(msqid, IPC_STAT, buf);
X+			if (rtrn == -1)
X+				break;
X+			printf("\n1 = uid, 2 = gid, 3 = mode, 4 = qbytes\n");
X+			printf("Number of field to change: ");
X+			scanf("%i", &choice);
X+			switch (choice) {
X+				case 1:
X+					printf("\nUser id: ");
X+					scanf("%i", &uid);
X+					buf->msg_perm.uid = uid;
X+					printf("User = %d\n", buf->msg_perm.uid);
X+					break;
X+				case 2:
X+					printf("\nGroup id: ");
X+					scanf("%i", &gid);
X+					buf->msg_perm.gid = gid;
X+					printf("Group = %d\n", buf->msg_perm.gid);
X+					break;
X+				case 3:
X+					printf("\nMode: ");
X+					scanf("%i", &mode);
X+					buf->msg_perm.mode = mode;
X+					printf("Mode = 0%o\n", buf->msg_perm.mode);
X+					break;
X+				case 4:
X+					printf("\nQbytes: ");
X+					scanf("%i", &bytes);
X+					buf->msg_qbytes = bytes;
X+					printf("Qbytes = %d\n", buf->msg_qbytes);
X+					break;
X+			}
X+			rtrn = msgctl(msqid, IPC_SET, buf);
X+			break;
X+
X+		case 3:
X+			rtrn = msgctl(msqid, IPC_RMID, NULL);
X+			break;
X+	}
X+
X+	if (rtrn == -1)
X+		perror("msgctl");
X+
X+	exit(0);
X+}
X
281b23a126700944231d7e22cb88215e
echo x - coovachilli/files/patch-src_main-query.c
sed 's/^X//' >coovachilli/files/patch-src_main-query.c << 'd3149ccc627c9bcbfdf0f4c9740a1123'
Xdiff -urN src/main-query.c.orig src/main-query.c
X--- src/main-query.c.orig	2008-06-28 17:38:35.000000000 +0100
X+++ src/main-query.c	2008-06-29 16:17:48.000000000 +0100
X@@ -304,7 +304,13 @@
X 
X   remote.sun_family = AF_UNIX;
X   strcpy(remote.sun_path, cmdsock);
X-  len = strlen(remote.sun_path) + sizeof(remote.sun_family);
X+
X+#if defined (__FreeBSD__)  || defined (__APPLE__) || defined (__OpenBSD__)
X+  remote.sun_len = strlen(remote.sun_path) + 1;
X+#endif
X+
X+  len = offsetof(struct sockaddr_un, sun_path) + strlen(remote.sun_path);
X+
X   if (connect(s, (struct sockaddr *)&remote, len) == -1) {
X     perror("connect");
X     exit(1);
X
d3149ccc627c9bcbfdf0f4c9740a1123
echo x - coovachilli/files/patch-src_dhcp.c
sed 's/^X//' >coovachilli/files/patch-src_dhcp.c << '0301b609dfed824a16753406c36d4637'
Xdiff -urN src/dhcp.c.orig src/dhcp.c
X--- src/dhcp.c.orig	2008-06-28 17:38:35.000000000 +0100
X+++ src/dhcp.c	2008-06-29 16:17:48.000000000 +0100
X@@ -625,7 +625,7 @@
X }
X 
X /**
X- * dhcp_se()
X+ * dhcp_set()
X  * Set dhcp parameters which can be altered at runtime.
X  **/
X int
X@@ -713,7 +713,7 @@
X int dhcp_nakDNS(struct dhcp_conn_t *conn, struct pkt_ippacket_t *pack, size_t len) {
X   struct dhcp_t *this = conn->parent;
X   struct pkt_udphdr_t *udph = (struct pkt_udphdr_t *)pack->payload;
X-  struct dns_packet_t *dnsp = (struct dns_packet_t *)((char*)pack->payload + sizeof(struct pkt_udphdr_t));
X+  /*struct dns_packet_t *dnsp = (struct dns_packet_t *)((char*)pack->payload + sizeof(struct pkt_udphdr_t));*/
X   struct dns_fullpacket_t answer;
X 
X   memcpy(&answer, pack, len); 
X@@ -1023,7 +1023,7 @@
X   struct dhcp_t *this = conn->parent;
X   struct pkt_tcphdr_t *tcph = (struct pkt_tcphdr_t *)pack->payload;
X   struct pkt_udphdr_t *udph = (struct pkt_udphdr_t *)pack->payload;
X-  size_t len = *plen;
X+  /*size_t len = *plen;*/
X   int i;
X 
X   /* Allow localhost through network... */
X@@ -2592,7 +2592,7 @@
X   struct pkt_ethhdr_t *ethhdr;
X   
X   if (this->rbuf_offset == this->rbuf_len) {
X-    length = read(this->ipif.fd, this->rbuf, this->rbuf_max);
X+    length = net_read(&this->ipif, this->rbuf, this->rbuf_max);
X 
X     if (length <= 0)
X       return length;
X
0301b609dfed824a16753406c36d4637
echo x - coovachilli/files/patch-src_tun.c
sed 's/^X//' >coovachilli/files/patch-src_tun.c << '57c4a911d9e987290bcb1f80a5bfcc4e'
Xdiff -urN src/tun.c.orig src/tun.c
X--- src/tun.c.orig	2008-06-28 17:38:35.000000000 +0100
X+++ src/tun.c	2008-06-29 16:17:48.000000000 +0100
X@@ -1,7 +1,7 @@
X /* 
X  * Tunnel Interface Functions.
X  * Copyright (C) 2002, 2003, 2004 Mondru AB.
X- * Copyright (c) 2006-2007 David Bird <david@coova.com>
X+ * Copyright (c) 2006-2008 David Bird <david@coova.com>
X  * 
X  * The contents of this file may be used under the terms of the GNU
X  * General Public License Version 2, provided that the above copyright
X@@ -226,7 +226,7 @@
X   return 0;
X }
X 
X-int tun_gifindex(struct tun_t *this, int *index) {
X+int tun_gifindex(struct tun_t *this, uint32_t *index) {
X   struct ifreq ifr;
X   int fd;
X 
X@@ -423,7 +423,7 @@
X   return 0;
X }
X 
X-static int tuntap_interface(struct _net_interface *netif) {
X+int tuntap_interface(struct _net_interface *netif) {
X #if defined(__linux__)
X   struct ifreq ifr;
X 
X@@ -443,7 +443,6 @@
X #error  "Unknown platform!"
X #endif
X 
X-
X #if defined(__linux__)
X   /* Open the actual tun device */
X   if ((netif->fd  = open("/dev/net/tun", O_RDWR)) < 0) {
X@@ -520,7 +519,6 @@
X   /* Find suitable device */
X   for (devnum = 0; devnum < 255; devnum++) { /* TODO 255 */ 
X     snprintf(devname, sizeof(devname), "/dev/tun%d", devnum);
X-    devname[sizeof(devname)] = 0;
X     if ((netif->fd = open(devname, O_RDWR)) >= 0) break;
X     if (errno != EBUSY) break;
X   } 
X@@ -530,7 +528,6 @@
X   }
X 
X   snprintf(netif->devname, sizeof(netif->devname), "tun%d", devnum);
X-  netif->devname[sizeof(netif->devname)-1] = 0;
X 
X   /* The tun device we found might have "old" IP addresses allocated */
X   /* We need to delete those. This problem is not present on Linux */
X@@ -538,13 +535,11 @@
X   memset(&areq, 0, sizeof(areq));
X 
X   /* Set up interface name */
X-  strncpy(areq.ifra_name, netif->devname, IFNAMSIZ);
X-  areq.ifra_name[IFNAMSIZ-1] = 0; /* Make sure to terminate */
X+  strncpy(areq.ifra_name, netif->devname, sizeof(areq.ifra_name));
X 
X   /* Create a channel to the NET kernel. */
X   if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
X-    log_err(errno,
X-	    "socket() failed");
X+    log_err(errno,"socket() failed");
X     return -1;
X   }
X   
X@@ -703,14 +698,15 @@
X 
X   if (this->cb_ind)
X     return this->cb_ind(this, &packet, sbuf.len);
X-
X   return 0;
X   
X #endif
X }
X 
X+/*
X static uint32_t dnatip[1024];
X static uint16_t dnatport[1024];
X+*/
X 
X int tun_encaps(struct tun_t *tun, void *pack, size_t len, int idx) {
X 
X
57c4a911d9e987290bcb1f80a5bfcc4e
echo x - coovachilli/files/patch-www_Makefile.am
sed 's/^X//' >coovachilli/files/patch-www_Makefile.am << '7696a874b8b1a505932b40c8a77885fd'
X--- www/Makefile.am.orig	2008-06-29 17:44:26.000000000 +0000
X+++ www/Makefile.am	2008-06-29 17:44:48.000000000 +0000
X@@ -3,7 +3,7 @@
X chillidir = $(sysconfdir)/chilli
X chilli_SCRIPTS = wwwsh
X 
X-wwwdir = $(chillidir)/www
X+wwwdir = $(prefix)/www/chilli
X 
X wwwDATAFILES = \
X chillijs.chi chillijs.chi.sh chilliform.chi chilliform.chi.sh \
7696a874b8b1a505932b40c8a77885fd
echo x - coovachilli/files/main.conf.sample
sed 's/^X//' >coovachilli/files/main.conf.sample << '6c9f8ec9737f2ad9fb460a0c74905c53'
Xcmdsocket       /var/run/chilli.sock
Xpidfile         /var/run/chilli.pid
Xnet		10.1.0.0/255.255.255.0
Xuamlisten	10.1.0.1
Xuamport         3990
Xdhcpif		em1
Xadminuser       chillispot
Xadminpasswd     chillispot
Xuamallowed	coova.org,coova.org,rad01.coova.org,coova.org
Xuamanydns
X
Xdomain lan
Xdns1 208.67.222.222
Xuamhomepage http://10.1.0.1:3990/www/coova.html
Xwisprlogin https://coova.org/app/uam/auth
Xwwwdir /usr/local/www/chilli 
Xwwwbin /etc/chilli/wwwsh
Xlocationname "My HotSpot"
Xradiuslocationname My_HotSpot
Xradiuslocationid isocc=,cc=,ac=,network=Coova,
Xradiusserver1	rad01.coova.org
Xradiusserver2	rad01.coova.org
Xradiussecret	coova-anonymous
Xradiusauthport  1812
Xradiusacctport  1813
Xuamserver	https://coova.org/app/uam/chilli
Xradiusnasid	nas01
X
Xpapalwaysok
6c9f8ec9737f2ad9fb460a0c74905c53
echo x - coovachilli/files/pf.conf.sample
sed 's/^X//' >coovachilli/files/pf.conf.sample << '08da1ec053477643a23ed3fdc892731e'
X#
X# Basic Chillispot PF Config
X# A tweak of Example 1 from the PF FAQ
X# http://www.openbsd.org/faq/pf/example1.html
X# By Venture37 
X# venture37@geeklan.co.uk
X# http://www.geeklan.co.uk
X
X# macros
Xint_if = "ral0"
Xext_if = "fxp0"
Xchilli_if = "tun0"
X
Xtcp_services = "{ 22, 113 }"
Xicmp_types = "echoreq"
X
Xpriv_nets = "{ 127.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 }"
X        
X# options
Xset block-policy return
Xset loginterface $ext_if
X
X# scrub
Xscrub in all
X
X# nat/rdr
Xnat on $ext_if from $chilli_if:network to any -> ($ext_if)
X
X# filter rules
Xblock all
X
Xpass quick on lo0 all
X
Xblock drop in  quick on $ext_if from $priv_nets to any
Xblock drop out quick on $ext_if from any to $priv_nets
Xblock drop on $int_if all
X
Xpass in on $ext_if inet proto tcp from any to ($ext_if) \
X   port $tcp_services flags S/SA keep state
X
Xpass in inet proto icmp all icmp-type $icmp_types keep state
X
Xpass in  on $chilli_if from $chilli_if:network to any keep state
Xpass out on $chilli_if from any to $chilli_if:network keep state
X
Xpass out on $ext_if proto tcp all modulate state flags S/SA
Xpass out on $ext_if proto { udp, icmp } all keep state
08da1ec053477643a23ed3fdc892731e
echo x - coovachilli/files/ipfw-config.sample
sed 's/^X//' >coovachilli/files/ipfw-config.sample << '52fb9aae3cde7d138a30ae7eeb230c2f'
Xnetwork inetrface
X
Xfxp0 : 11.11.11.1
Xfxp1 : 10.14.1.254
X
X/etc/ipnat.rules
X
X# NAT
X#
Xmap fxp0 192.168.182.0/24 -> 11.11.11.1/32 portmap tcp/udp auto
X
X--------------------------------------------------------
X
X/usr/local/etc/rc.d/ipfw.sh
X
X#!/bin/sh
X
XRULENO="1500"
X
XEXT_IF="fxp0"
XINT_IF="fxp1"
X
XEXT_IP="11.11.11.1"
X#INT_IP="10.14.1.0/24"
X
X# flush rules
X#
Xipfw -f flush
X
X## setup loopback
X##
Xipfw $RULENO add pass all from any to any via lo0
Xipfw add deny all from any to 127.0.0.0/8
Xipfw add deny ip from 127.0.0.0/8 to any
X
X# allow related and established on all interfaces
X#
Xipfw add pass ip from any to any established
X
X# allow SA connect to me , deny any others use ssh
X#
Xipfw add pass tcp from 11.11.11.5 to any setup
Xipfw add deny tcp from any to ${EXT_IP} 22
X
X## allow me (firewall) to access anywhere
X##
Xipfw add pass tcp from ${EXT_IP} to any setup
Xipfw add pass udp from ${EXT_IP} to any keep-state
X
X## allow tun0 device to connect to anywhere
X##
Xipfw add pass tcp from any to any via tun0 setup
Xipfw add pass udp from any to any via tun0 keep-state
X
X# allow icmp
X#
Xipfw add pass icmp from any to any icmptypes 0,3,8,11
X
X# allow http , https and dns on internal interface
X#
Xipfw add pass tcp from any to any 80 via ${INT_IF} setup
Xipfw add pass tcp from any to any 443 via ${INT_IF} setup
Xipfw add pass udp from any to any 53 via ${INT_IF} keep-state
X
X# allow tcp port 3990 on internal interface for chillispot redirection
X#
Xipfw add pass tcp from any to any 3990 via ${INT_IF} setup
X
X# except for any condition above , reject everything on all interfaces
X#
Xipfw add deny all from any to any 
52fb9aae3cde7d138a30ae7eeb230c2f
echo x - coovachilli/files/patch-conf_up.sh.in
sed 's/^X//' >coovachilli/files/patch-conf_up.sh.in << '82e545af6a9653a2d3028dc0b0a8eab3'
X--- conf/up.sh.in.orig	2009-01-10 17:54:55.000000000 +0000
X+++ conf/up.sh.in	2009-01-10 18:03:23.000000000 +0000
X@@ -5,52 +5,5 @@
X 
X . @ETCCHILLI@/functions
X 
X-[ -e "@VARRUN@/chilli.iptables" ] && sh @VARRUN@/chilli.iptables 2>/dev/null
X-rm -f @VARRUN@/chilli.iptables 2>/dev/null
X-
X-IF=$(basename $DEV)
X-
X-ipt() {
X-    opt=$1; shift
X-    echo "iptables -D $*" >> @VARRUN@/chilli.iptables
X-    iptables $opt $*
X-}
X-
X-ipt_in() {
X-    ipt -A INPUT -i $IF $*
X-}
X-
X-[ -n "$DHCPIF" ] && {
X-
X-    [ -n "$UAMPORT" -a "$UAMPORT" != "0" ] && \
X-	ipt_in -p tcp -m tcp --dport $UAMPORT --dst $ADDR -j ACCEPT
X-
X-    [ -n "$UAMUIPORT" -a "$UAMUIPORT" != "0" ] && \
X-	ipt_in -p tcp -m tcp --dport $UAMUIPORT --dst $ADDR -j ACCEPT
X-
X-    [ -n "HS_TCP_PORTS" ] && {
X-	for port in $HS_TCP_PORTS; do
X-	    ipt_in -p tcp -m tcp --dport $port --dst $ADDR -j ACCEPT
X-	done
X-    }
X-    
X-    ipt_in -p udp -d 255.255.255.255 --destination-port 67:68 -j ACCEPT
X-    ipt_in -p udp --dst $ADDR --dport 53 -j ACCEPT
X-
X-    ipt -A INPUT -i $IF --dst $ADDR -j DROP
X-    ipt -A INPUT -i $IF -j DROP
X-
X-    ipt -I FORWARD -i $DHCPIF -j DROP
X-    ipt -I FORWARD -o $DHCPIF -j DROP
X-    ipt -I FORWARD -i $IF -j ACCEPT
X-    ipt -I FORWARD -o $IF -j ACCEPT
X-
X-    [ "$HS_LAN_ACCESS" != "on" -a "$HS_LAN_ACCESS" != "allow" ] && \
X-	ipt -I FORWARD -i $IF -o \! $HS_WANIF -j DROP
X-
X-    [ "$HS_LOCAL_DNS" = "on" ] && \
X-	ipt -I PREROUTING -t nat -i $IF -p udp --dport 53 -j DNAT --to-destination $ADDR
X-}
X-
X # site specific stuff optional
X [ -e @ETCCHILLI@/ipup.sh ] && . @ETCCHILLI@/ipup.sh
82e545af6a9653a2d3028dc0b0a8eab3
echo x - coovachilli/files/patch-conf_functions.in
sed 's/^X//' >coovachilli/files/patch-conf_functions.in << 'f254c22064006db46dc741f1a65c31ab'
X--- conf/functions.in.orig	2009-01-10 17:55:30.000000000 +0000
X+++ conf/functions.in	2009-01-10 17:56:42.000000000 +0000
X@@ -4,7 +4,6 @@
X # Licensed under GPL. See http://coova.org/
X #
X 
X-IPTABLES=/sbin/iptables
X IFCONFIG=/sbin/ifconfig
X 
X CHILLI=@ETCCHILLI@
X@@ -22,8 +21,6 @@
X [ -f $CHILLI/defaults ] && . $CHILLI/defaults
X [ -f $CHILLI/config ]   && . $CHILLI/config
X 
X-[ -f /etc/sysconfig/chilli ] && . /etc/sysconfig/chilli
X-
X HS_UAMPORT=${HS_UAMPORT:-3990}
X HS_RADIUS=${HS_RADIUS:-$HS_UAMSERVER}
X HS_RADSECRET=${HS_RADSECRET:-$HS_UAMSECRET}
f254c22064006db46dc741f1a65c31ab
echo x - coovachilli/files/patch-conf_down.sh.in
sed 's/^X//' >coovachilli/files/patch-conf_down.sh.in << 'dd1a9b9b2ecb238b0e1eb90da1af13b2'
X--- conf/down.sh.in.orig	2009-01-10 18:04:37.000000000 +0000
X+++ conf/down.sh.in	2009-01-10 18:04:52.000000000 +0000
X@@ -5,8 +5,5 @@
X 
X . @ETCCHILLI@/functions
X 
X-[ -e "@VARRUN@/chilli.iptables" ] && sh @VARRUN@/chilli.iptables 2>/dev/null
X-rm -f @VARRUN@/chilli.iptables 2>/dev/null
X-
X # site specific stuff optional
X [ -e @ETCCHILLI@/ipdown.sh ] && . @ETCCHILLI@/ipdown.sh
dd1a9b9b2ecb238b0e1eb90da1af13b2
echo x - coovachilli/files/coovachilli.in
sed 's/^X//' >coovachilli/files/coovachilli.in << '57791b14aff4e72ddb8508ae8ef7b6b4'
X#!/bin/sh
X
X# PROVIDE: coovachilli
X# REQUIRE: netif
X# BEFORE: pf ipfw
X# KEYWORD: nojail
X#
X# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
X# to enable this service:
X#
X# coovachilli_enable (bool):   Set to NO by default.
X#               Set it to YES to enable coova-chilli.
X
X
X. %%RC_SUBR%%
X
Xname=coovachilli
Xrcvar=coovachilli_enable
X
Xcommand=%%PREFIX%%/sbin/chilli
Xpidfile=/var/run/chilli.pid
X
Xload_rc_config $name
X
Xrun_rc_command "$1"
57791b14aff4e72ddb8508ae8ef7b6b4
echo x - coovachilli/pkg-message
sed 's/^X//' >coovachilli/pkg-message << 'bd0b445112914f5e44c92f0001493f9f'
X| Add coovachilli_enable="YES" to /etc/rc.conf
X|
X| You'll need to tweak your kernel settings
X| add the following to /boot/loader.conf
X| kern.ipc.msgseg=16000
X| kern.ipc.msgmnb=16000
X|
X| Sample config files located in %%DATADIR%%
X| copy the sample main.conf file to your
X| chilli directory & create an empty
X| hs.conf & local.conf to get going.
bd0b445112914f5e44c92f0001493f9f
exit



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->amdmi3 
Responsible-Changed-By: amdmi3 
Responsible-Changed-When: Sun Jan 11 01:36:21 UTC 2009 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=130357 

From: Venture37 <venture37@geeklan.co.uk>
To: bug-followup@FreeBSD.org, venture37@geeklan.co.uk
Cc:  
Subject: Re: ports/130357: New Port: net-mgmt/coovachilli, coova is an access
 controller, forked from chillispot
Date: Sun, 18 Jan 2009 17:18:41 +0000

 This is a multi-part message in MIME format.
 --------------080205060002060007080703
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Update to the port after discussion with amdmi3 via email
 use EXAMPLESDIR instead of DATADIR for sample configs
 provide better discription in Makefile comment & pkg-descr
 
 --------------080205060002060007080703
 Content-Type: application/x-shar;
  name="coovachilli.shar"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="coovachilli.shar"
 
 # This is a shell archive.  Save it in a file, remove anything before
 # this line, and then unpack it by entering "sh file".  Note, it may
 # create directories; files and directories will be owned by you and
 # have default permissions.
 #
 # This archive contains:
 #
 #	coovachilli
 #	coovachilli/Makefile
 #	coovachilli/pkg-descr
 #	coovachilli/distinfo
 #	coovachilli/pkg-plist
 #	coovachilli/files
 #	coovachilli/files/patch-coova-chilli.spec.in
 #	coovachilli/files/patch-conf_Makefile.in
 #	coovachilli/files/patch-conf_Makefile.am
 #	coovachilli/files/patch-src_chilli.c
 #	coovachilli/files/patch-src_system.h
 #	coovachilli/files/patch-src_redir.h
 #	coovachilli/files/patch-src_redir.c
 #	coovachilli/files/patch-src_msgstat.c
 #	coovachilli/files/patch-src_main-query.c
 #	coovachilli/files/patch-src_dhcp.c
 #	coovachilli/files/patch-src_tun.c
 #	coovachilli/files/patch-www_Makefile.am
 #	coovachilli/files/main.conf.sample
 #	coovachilli/files/pf.conf.sample
 #	coovachilli/files/ipfw-config.sample
 #	coovachilli/files/patch-conf_up.sh.in
 #	coovachilli/files/patch-conf_functions.in
 #	coovachilli/files/patch-conf_down.sh.in
 #	coovachilli/files/coovachilli.in
 #	coovachilli/pkg-message
 #
 echo c - coovachilli
 mkdir -p coovachilli > /dev/null 2>&1
 echo x - coovachilli/Makefile
 sed 's/^X//' >coovachilli/Makefile << 'f6b4bc22749f01cda653c7708fc56205'
 X# New ports collection makefile for:	CoovaChilli
 X# Date created:		24 December 2006
 X# Whom:			Sevan Janiyan <venture37@geeklan.co.uk>
 X#
 X# $FreeBSD$
 X#
 X
 XPORTNAME=	coovachilli
 XPORTVERSION=	1.0.12
 XCATEGORIES=	net-mgmt
 XMASTER_SITES=	http://ap.coova.org/chilli/ \
 X		http://www.geeklan.co.uk/files/ \
 X		http://www.venture37.com/files/
 XDISTNAME=	coova-chilli-${PORTVERSION}
 X
 XMAINTAINER=	venture37@geeklan.co.uk
 XCOMMENT=	An access controller for wired & wireless clients
 X
 XCONFLICTS=	chillispot-1.*
 X
 XMAN1=		chilli_query.1 chilli_radconfig.1 chilli_response.1
 XMAN5=		chilli.conf.5 chilli-radius.5
 XMAN8=		chilli.8
 X
 XCONFIGURE_ARGS=-localstatedir=/var
 XGNU_CONFIGURE=	yes
 XUSE_LDCONFIG=	yes
 XUSE_RC_SUBR=	coovachilli
 XUSE_AUTOTOOLS=	automake:19
 X
 Xpost-install:
 X.if !defined(NOPORTEXAMPLES)
 X	${MKDIR} ${EXAMPLESDIR}
 X	${INSTALL_MAN} ${FILESDIR}/main.conf.sample ${EXAMPLESDIR}
 X	${INSTALL_MAN} ${FILESDIR}/pf.conf.sample ${EXAMPLESDIR}
 X	${INSTALL_MAN} ${FILESDIR}/ipfw-config.sample ${EXAMPLESDIR}
 X.endif
 X	@${CAT} ${PKGMESSAGE}
 X
 X.include <bsd.port.mk>
 f6b4bc22749f01cda653c7708fc56205
 echo x - coovachilli/pkg-descr
 sed 's/^X//' >coovachilli/pkg-descr << '04b48427a5c9ef36abc67104b072fe70'
 XCoovaChilli is an access controller 
 XIt provides a captive portal / walled garden environment. 
 XCoova builds on the popular features of the now defunct Chillispot.
 X
 X
 XWWW: http://www.coova.org/
 04b48427a5c9ef36abc67104b072fe70
 echo x - coovachilli/distinfo
 sed 's/^X//' >coovachilli/distinfo << '06c0acc829d40edbbbb901212b9b61c6'
 XMD5 (coova-chilli-1.0.12.tar.gz) = 365f46fe79b3d76432544d6bc5f37939
 XSHA256 (coova-chilli-1.0.12.tar.gz) = fcd16fc043351e39ef9fc929f3ae83a838305ee14c173c444b8655d415baca68
 XSIZE (coova-chilli-1.0.12.tar.gz) = 552537
 06c0acc829d40edbbbb901212b9b61c6
 echo x - coovachilli/pkg-plist
 sed 's/^X//' >coovachilli/pkg-plist << '20a234b13ad2e374289bfb2fb0e471ca'
 X@stopdaemon coovachilli
 Xetc/chilli.conf
 Xetc/chilli/defaults
 Xetc/chilli/down.sh
 Xetc/chilli/functions
 Xetc/chilli/up.sh
 Xwww/chilli/ChilliLibrary.js
 Xwww/chilli/chilliController.js
 Xwww/chilli/chilliform.chi
 Xwww/chilli/chilliform.chi.sh
 Xwww/chilli/chillijs.chi
 Xwww/chilli/chillijs.chi.sh
 Xwww/chilli/config.sh
 Xwww/chilli/coova.html
 Xwww/chilli/coova.jpg
 Xwww/chilli/coova.png
 Xwww/chilli/json_html.tmpl
 Xwww/chilli/openid.gif
 Xwww/chilli/wait.gif
 Xetc/chilli/wwwsh
 Xlib/libbstring.a
 Xlib/libbstring.la
 Xlib/libbstring.so
 Xlib/libbstring.so.0
 Xlib/libchilli.a
 Xlib/libchilli.la
 Xlib/libchilli.so
 Xlib/libchilli.so.0
 Xsbin/chilli
 Xsbin/chilli_query
 Xsbin/chilli_radconfig
 Xsbin/chilli_response
 Xsbin/test_radius
 X@dirrm www/chilli
 X@dirrm etc/chilli
 X%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pf.conf.sample
 X%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ipfw-config.sample
 X%%PORTEXAMPLES%%%%EXAMPLESDIR%%/main.conf.sample
 X%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
 20a234b13ad2e374289bfb2fb0e471ca
 echo c - coovachilli/files
 mkdir -p coovachilli/files > /dev/null 2>&1
 echo x - coovachilli/files/patch-coova-chilli.spec.in
 sed 's/^X//' >coovachilli/files/patch-coova-chilli.spec.in << '22ca43fa801179b4535f3ea94dd7a288'
 X--- coova-chilli.spec.in.orig	2008-06-18 01:17:20.000000000 +0100
 X+++ coova-chilli.spec.in	2008-06-18 01:17:28.000000000 +0100
 X@@ -51,7 +51,6 @@
 X %defattr(-,root,root)
 X %{_sbindir}/*
 X %{_libdir}/*.so*
 X-%{_sysconfdir}/init.d/chilli
 X %doc AUTHORS COPYING ChangeLog INSTALL README doc/dictionary.chillispot doc/hotspotlogin.cgi
 X %config %{_sysconfdir}/chilli.conf
 X %config(noreplace) %{_sysconfdir}/chilli/defaults
 22ca43fa801179b4535f3ea94dd7a288
 echo x - coovachilli/files/patch-conf_Makefile.in
 sed 's/^X//' >coovachilli/files/patch-conf_Makefile.in << '33f8605f634b761f6d592c448f201831'
 X--- conf/Makefile.in.orig	2008-06-08 05:49:09.000000000 +0100
 X+++ conf/Makefile.in	2008-06-18 01:17:58.000000000 +0100
 X@@ -46,11 +46,10 @@
 X mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 X CONFIG_HEADER = $(top_builddir)/config.h
 X CONFIG_CLEAN_FILES =
 X-am__installdirs = "$(DESTDIR)$(chillidir)" "$(DESTDIR)$(initdir)" \
 X-	"$(DESTDIR)$(chillidir)" "$(DESTDIR)$(sysconfdir)"
 X+am__installdirs = "$(DESTDIR)$(chillidir)" "$(DESTDIR)$(chillidir)" \
 X+	"$(DESTDIR)$(sysconfdir)"
 X chilliSCRIPT_INSTALL = $(INSTALL_SCRIPT)
 X-initSCRIPT_INSTALL = $(INSTALL_SCRIPT)
 X-SCRIPTS = $(chilli_SCRIPTS) $(init_SCRIPTS)
 X+SCRIPTS = $(chilli_SCRIPTS)
 X SOURCES =
 X DIST_SOURCES =
 X am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 X@@ -163,14 +162,11 @@
 X chillidir = $(sysconfdir)/chilli
 X chilli_SCRIPTS = functions up.sh down.sh
 X chilli_DATA = defaults 
 X-initdir = $(sysconfdir)/init.d
 X-init_SCRIPTS = chilli
 X-EXTRA_DIST = $(init_SCRIPTS:=.in) \
 X+EXTRA_DIST = \
 X $(chilli_SCRIPTS:=.in) chilli.conf.in defaults.in
 X 
 X edit = sed \
 X 	-e 's,@SBINDIR\@,$(sbindir),g' \
 X-	-e 's,@INITDIR\@,$(initrddir),g' \
 X 	-e 's,@VARRUN\@,$(localstatedir)/run,g' \
 X 	-e 's,@ETCCHILLI\@,$(sysconfdir)/chilli,g' \
 X 	-e 's,@SYSCONFDIR\@,$(sysconfdir),g' \
 X@@ -227,25 +223,6 @@
 X 	  echo " rm -f '$(DESTDIR)$(chillidir)/$$f'"; \
 X 	  rm -f "$(DESTDIR)$(chillidir)/$$f"; \
 X 	done
 X-install-initSCRIPTS: $(init_SCRIPTS)
 X-	@$(NORMAL_INSTALL)
 X-	test -z "$(initdir)" || $(mkdir_p) "$(DESTDIR)$(initdir)"
 X-	@list='$(init_SCRIPTS)'; for p in $$list; do \
 X-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 X-	  if test -f $$d$$p; then \
 X-	    f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
 X-	    echo " $(initSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(initdir)/$$f'"; \
 X-	    $(initSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(initdir)/$$f"; \
 X-	  else :; fi; \
 X-	done
 X-
 X-uninstall-initSCRIPTS:
 X-	@$(NORMAL_UNINSTALL)
 X-	@list='$(init_SCRIPTS)'; for p in $$list; do \
 X-	  f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
 X-	  echo " rm -f '$(DESTDIR)$(initdir)/$$f'"; \
 X-	  rm -f "$(DESTDIR)$(initdir)/$$f"; \
 X-	done
 X 
 X mostlyclean-libtool:
 X 	-rm -f *.lo
 X@@ -328,7 +305,7 @@
 X check: check-am
 X all-am: Makefile $(SCRIPTS) $(DATA)
 X installdirs:
 X-	for dir in "$(DESTDIR)$(chillidir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(chillidir)" "$(DESTDIR)$(sysconfdir)"; do \
 X+	for dir in "$(DESTDIR)$(chillidir)" "$(DESTDIR)$(chillidir)" "$(DESTDIR)$(sysconfdir)"; do \
 X 	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
 X 	done
 X install: install-am
 X@@ -373,8 +350,7 @@
 X 
 X info-am:
 X 
 X-install-data-am: install-chilliDATA install-chilliSCRIPTS \
 X-	install-initSCRIPTS
 X+install-data-am: install-chilliDATA install-chilliSCRIPTS
 X 
 X install-exec-am: install-sysconfDATA
 X 
 X@@ -401,20 +377,20 @@
 X ps-am:
 X 
 X uninstall-am: uninstall-chilliDATA uninstall-chilliSCRIPTS \
 X-	uninstall-info-am uninstall-initSCRIPTS uninstall-sysconfDATA
 X+	uninstall-info-am uninstall-sysconfDATA
 X 
 X .PHONY: all all-am check check-am clean clean-generic clean-libtool \
 X 	distclean distclean-generic distclean-libtool distdir dvi \
 X 	dvi-am html html-am info info-am install install-am \
 X 	install-chilliDATA install-chilliSCRIPTS install-data \
 X 	install-data-am install-exec install-exec-am install-info \
 X-	install-info-am install-initSCRIPTS install-man install-strip \
 X+	install-info-am install-man install-strip \
 X 	install-sysconfDATA installcheck installcheck-am installdirs \
 X 	maintainer-clean maintainer-clean-generic mostlyclean \
 X 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 X 	uninstall uninstall-am uninstall-chilliDATA \
 X 	uninstall-chilliSCRIPTS uninstall-info-am \
 X-	uninstall-initSCRIPTS uninstall-sysconfDATA
 X+	uninstall-sysconfDATA
 X 
 X 
 X functions: Makefile functions.in
 33f8605f634b761f6d592c448f201831
 echo x - coovachilli/files/patch-conf_Makefile.am
 sed 's/^X//' >coovachilli/files/patch-conf_Makefile.am << 'df3d70df8496a42bb48d247fd2996333'
 X--- conf/Makefile.am.orig	2007-08-20 15:05:54.000000000 +0100
 X+++ conf/Makefile.am	2008-06-18 01:17:58.000000000 +0100
 X@@ -6,15 +6,11 @@
 X chilli_SCRIPTS = functions up.sh down.sh
 X chilli_DATA = defaults 
 X 
 X-initdir = $(sysconfdir)/init.d
 X-init_SCRIPTS = chilli
 X-
 X-EXTRA_DIST = $(init_SCRIPTS:=.in) \
 X+EXTRA_DIST = \
 X $(chilli_SCRIPTS:=.in) chilli.conf.in defaults.in
 X 
 X edit = sed \
 X 	-e 's,@SBINDIR\@,$(sbindir),g' \
 X-	-e 's,@INITDIR\@,$(initrddir),g' \
 X 	-e 's,@VARRUN\@,$(localstatedir)/run,g' \
 X 	-e 's,@ETCCHILLI\@,$(sysconfdir)/chilli,g' \
 X 	-e 's,@SYSCONFDIR\@,$(sysconfdir),g' \
 X@@ -35,12 +31,6 @@
 X 	$(edit) down.sh.in >down.sh.tmp
 X 	mv down.sh.tmp down.sh
 X 
 X-chilli: Makefile chilli.in
 X-	rm -f chilli chilli.tmp
 X-	$(edit) chilli.in >chilli.tmp
 X-	chmod +x chilli.tmp
 X-	mv chilli.tmp chilli
 X-
 X chilli.conf: Makefile chilli.conf.in
 X 	rm -f chilli.conf chilli.conf.tmp
 X 	$(edit) chilli.conf.in >chilli.conf.tmp
 df3d70df8496a42bb48d247fd2996333
 echo x - coovachilli/files/patch-src_chilli.c
 sed 's/^X//' >coovachilli/files/patch-src_chilli.c << '47805ff6ff1aee75ba2a8d7e9c699f42'
 Xdiff -urN src/chilli.c.orig src/chilli.c
 X--- src/chilli.c.orig	2008-06-28 17:38:35.000000000 +0100
 X+++ src/chilli.c	2008-06-29 16:17:48.000000000 +0100
 X@@ -3422,7 +3422,6 @@
 X     exit(1);
 X   }
 X 
 X-  /*tun_setaddr(tun, &options.dhcplisten,  &options.net, &options.mask);*/
 X   tun_setaddr(tun, &options.dhcplisten,  &options.dhcplisten, &options.mask);
 X   tun_set_cb_ind(tun, cb_tun_ind);
 X 
 X@@ -3638,8 +3637,7 @@
 X     mainclock = time(0);
 X 
 X     if ((msgresult = 
 X-	 TEMP_FAILURE_RETRY(msgrcv(redir->msgid, (struct msgbuf *)&msg, 
 X-				   sizeof(msg.mdata), 0, IPC_NOWAIT)))  == -1) {
 X+	 TEMP_FAILURE_RETRY(msgrcv(redir->msgid, (void *)&msg, sizeof(msg.mdata), 0, IPC_NOWAIT)))  == -1) {
 X       if ((errno != EAGAIN) && (errno != ENOMSG))
 X 	log_err(errno, "msgrcv() failed!");
 X     }
 X@@ -3669,7 +3667,7 @@
 X 
 X #elif defined (__FreeBSD__)  || defined (__APPLE__) || defined (__OpenBSD__)
 X 
 X-	if (net_isset(&dhcp->ipif, &fds) && dhcp_decaps(dhcp) < 0)
 X+	if (net_isset(&dhcp->ipif, &fds) && dhcp_receive(dhcp) < 0)
 X 	  log_err(0, "dhcp_decaps() failed!");
 X 
 X #endif
 X
 47805ff6ff1aee75ba2a8d7e9c699f42
 echo x - coovachilli/files/patch-src_system.h
 sed 's/^X//' >coovachilli/files/patch-src_system.h << 'da26471ff622d59d21ab1ddac0e4d86c'
 Xdiff -urN src/system.h.orig src/system.h
 X--- src/system.h.orig	2008-06-28 17:38:35.000000000 +0100
 X+++ src/system.h	2008-06-29 16:17:48.000000000 +0100
 X@@ -191,6 +191,8 @@
 X     })
 X #endif
 X 
 X+#define offsetof(TYPE, MEMBER) ((int)&((TYPE *)0)->MEMBER)
 X+
 X #include "bstrlib.h"
 X 
 X #endif
 X
 da26471ff622d59d21ab1ddac0e4d86c
 echo x - coovachilli/files/patch-src_redir.h
 sed 's/^X//' >coovachilli/files/patch-src_redir.h << '9ab5a46dedbd9f52358f4fcc901be0bc'
 Xdiff -urN src/redir.h src/redir.h
 X--- src/redir.h.orig	2008-06-28 17:38:35.000000000 +0100
 X+++ src/redir.h	2008-06-29 16:17:48.000000000 +0100
 X@@ -124,17 +124,18 @@
 X 		      struct redir_conn_t *conn);
 X };
 X 
 X+struct redir_msg_data {
 X+  uint16_t opt;
 X+  struct in_addr addr;
 X+  struct redir_state redir;
 X+  struct session_params params;
 X+} __attribute__((packed));
 X+
 X struct redir_msg_t {
 X   long mtype;
 X-  struct redir_msg_data {
 X-    uint16_t opt;
 X-    struct in_addr addr;
 X-    struct redir_state redir;
 X-    struct session_params params;
 X-  } mdata;
 X+  struct redir_msg_data mdata;
 X };
 X 
 X-
 X int redir_new(struct redir_t **redir, struct in_addr *addr, int port, int uiport);
 X 
 X
 9ab5a46dedbd9f52358f4fcc901be0bc
 echo x - coovachilli/files/patch-src_redir.c
 sed 's/^X//' >coovachilli/files/patch-src_redir.c << '4859e24927ab0f6e378df5965085bfec'
 Xdiff -urN src/redir.c.orig src/redir.c
 X--- src/redir.c.orig	2008-06-28 17:38:35.000000000 +0100
 X+++ src/redir.c	2008-06-29 16:17:48.000000000 +0100
 X@@ -479,7 +479,7 @@
 X 
 X   if ((conn->s_params.flags & REQUIRE_UAM_SPLASH) && 
 X       conn->s_params.url[0]) {
 X-    redir_url = conn->s_params.url;
 X+    redir_url = (char *)conn->s_params.url;
 X   }
 X 
 X   bassignformat(str, "%s%cres=%s&uamip=%s&uamport=%d", 
 X@@ -1939,8 +1939,8 @@
 X   msg.mdata.addr = address->sin_addr; \
 X   memcpy(&msg.mdata.params, &conn.s_params, sizeof(msg.mdata.params)); \
 X   memcpy(&msg.mdata.redir, &conn.s_state.redir, sizeof(msg.mdata.redir)); \
 X-  if (msgsnd(redir->msgid, (struct msgbuf *)&msg, sizeof(msg.mdata), 0) < 0) { \
 X-    log_err(errno, "msgsnd() failed!"); \
 X+  if (msgsnd(redir->msgid, (void *)&msg, sizeof(msg.mdata), 0) < 0) { \
 X+    log_err(errno, "msgsnd() failed! msgid=%d type=%d len=%d", redir->msgid, msg.mtype, sizeof(msg.mdata)); \
 X     redir_close(infd, outfd); \
 X   } 
 X 
 X
 4859e24927ab0f6e378df5965085bfec
 echo x - coovachilli/files/patch-src_msgstat.c
 sed 's/^X//' >coovachilli/files/patch-src_msgstat.c << '281b23a126700944231d7e22cb88215e'
 Xdiff -urN src/msgstat.c.orig src/msgstat.c
 X--- src/msgstat.c.orig	1970-01-01 01:00:00.000000000 +0100
 X+++ src/msgstat.c	2008-06-29 16:17:48.000000000 +0100
 X@@ -0,0 +1,83 @@
 X+#include <stdio.h>
 X+#include <sys/types.h>
 X+#include <sys/ipc.h>
 X+#include <sys/msg.h>
 X+#include <errno.h>
 X+
 X+
 X+main()
 X+{
 X+	int uid, gid, mode, bytes;
 X+	int rtrn, msqid, command, choice;
 X+	struct msqid_ds msqid_ds, *buf;
 X+
 X+	buf = &msqid_ds;
 X+
 X+	printf("Enter the msqid: ");
 X+	scanf("%i", &msqid);
 X+
 X+	printf("\n1 = IPC_STAT\n2 = IPC_SET\n3 = IPC_RMID\n");
 X+	printf("Enter command number: ");
 X+	scanf("%i", &command);
 X+
 X+	printf("\n\nmsqid = %d, command = %d\n", msqid, command);
 X+
 X+	switch (command) {
 X+		case 1:
 X+			rtrn = msgctl(msqid, IPC_STAT, buf);
 X+			if (rtrn != -1) {
 X+				printf("User %d, group %d, perms 0%o\n",
 X+					buf->msg_perm.uid, buf->msg_perm.gid,
 X+					buf->msg_perm.mode);
 X+				printf("cbytes: %d, qnum: %d, qbytes %d\n",
 X+					buf->msg_cbytes, buf->msg_qnum, 
 X+					buf->msg_qbytes);
 X+			}
 X+			break;
 X+
 X+		case 2:
 X+			rtrn = msgctl(msqid, IPC_STAT, buf);
 X+			if (rtrn == -1)
 X+				break;
 X+			printf("\n1 = uid, 2 = gid, 3 = mode, 4 = qbytes\n");
 X+			printf("Number of field to change: ");
 X+			scanf("%i", &choice);
 X+			switch (choice) {
 X+				case 1:
 X+					printf("\nUser id: ");
 X+					scanf("%i", &uid);
 X+					buf->msg_perm.uid = uid;
 X+					printf("User = %d\n", buf->msg_perm.uid);
 X+					break;
 X+				case 2:
 X+					printf("\nGroup id: ");
 X+					scanf("%i", &gid);
 X+					buf->msg_perm.gid = gid;
 X+					printf("Group = %d\n", buf->msg_perm.gid);
 X+					break;
 X+				case 3:
 X+					printf("\nMode: ");
 X+					scanf("%i", &mode);
 X+					buf->msg_perm.mode = mode;
 X+					printf("Mode = 0%o\n", buf->msg_perm.mode);
 X+					break;
 X+				case 4:
 X+					printf("\nQbytes: ");
 X+					scanf("%i", &bytes);
 X+					buf->msg_qbytes = bytes;
 X+					printf("Qbytes = %d\n", buf->msg_qbytes);
 X+					break;
 X+			}
 X+			rtrn = msgctl(msqid, IPC_SET, buf);
 X+			break;
 X+
 X+		case 3:
 X+			rtrn = msgctl(msqid, IPC_RMID, NULL);
 X+			break;
 X+	}
 X+
 X+	if (rtrn == -1)
 X+		perror("msgctl");
 X+
 X+	exit(0);
 X+}
 X
 281b23a126700944231d7e22cb88215e
 echo x - coovachilli/files/patch-src_main-query.c
 sed 's/^X//' >coovachilli/files/patch-src_main-query.c << 'd3149ccc627c9bcbfdf0f4c9740a1123'
 Xdiff -urN src/main-query.c.orig src/main-query.c
 X--- src/main-query.c.orig	2008-06-28 17:38:35.000000000 +0100
 X+++ src/main-query.c	2008-06-29 16:17:48.000000000 +0100
 X@@ -304,7 +304,13 @@
 X 
 X   remote.sun_family = AF_UNIX;
 X   strcpy(remote.sun_path, cmdsock);
 X-  len = strlen(remote.sun_path) + sizeof(remote.sun_family);
 X+
 X+#if defined (__FreeBSD__)  || defined (__APPLE__) || defined (__OpenBSD__)
 X+  remote.sun_len = strlen(remote.sun_path) + 1;
 X+#endif
 X+
 X+  len = offsetof(struct sockaddr_un, sun_path) + strlen(remote.sun_path);
 X+
 X   if (connect(s, (struct sockaddr *)&remote, len) == -1) {
 X     perror("connect");
 X     exit(1);
 X
 d3149ccc627c9bcbfdf0f4c9740a1123
 echo x - coovachilli/files/patch-src_dhcp.c
 sed 's/^X//' >coovachilli/files/patch-src_dhcp.c << '0301b609dfed824a16753406c36d4637'
 Xdiff -urN src/dhcp.c.orig src/dhcp.c
 X--- src/dhcp.c.orig	2008-06-28 17:38:35.000000000 +0100
 X+++ src/dhcp.c	2008-06-29 16:17:48.000000000 +0100
 X@@ -625,7 +625,7 @@
 X }
 X 
 X /**
 X- * dhcp_se()
 X+ * dhcp_set()
 X  * Set dhcp parameters which can be altered at runtime.
 X  **/
 X int
 X@@ -713,7 +713,7 @@
 X int dhcp_nakDNS(struct dhcp_conn_t *conn, struct pkt_ippacket_t *pack, size_t len) {
 X   struct dhcp_t *this = conn->parent;
 X   struct pkt_udphdr_t *udph = (struct pkt_udphdr_t *)pack->payload;
 X-  struct dns_packet_t *dnsp = (struct dns_packet_t *)((char*)pack->payload + sizeof(struct pkt_udphdr_t));
 X+  /*struct dns_packet_t *dnsp = (struct dns_packet_t *)((char*)pack->payload + sizeof(struct pkt_udphdr_t));*/
 X   struct dns_fullpacket_t answer;
 X 
 X   memcpy(&answer, pack, len); 
 X@@ -1023,7 +1023,7 @@
 X   struct dhcp_t *this = conn->parent;
 X   struct pkt_tcphdr_t *tcph = (struct pkt_tcphdr_t *)pack->payload;
 X   struct pkt_udphdr_t *udph = (struct pkt_udphdr_t *)pack->payload;
 X-  size_t len = *plen;
 X+  /*size_t len = *plen;*/
 X   int i;
 X 
 X   /* Allow localhost through network... */
 X@@ -2592,7 +2592,7 @@
 X   struct pkt_ethhdr_t *ethhdr;
 X   
 X   if (this->rbuf_offset == this->rbuf_len) {
 X-    length = read(this->ipif.fd, this->rbuf, this->rbuf_max);
 X+    length = net_read(&this->ipif, this->rbuf, this->rbuf_max);
 X 
 X     if (length <= 0)
 X       return length;
 X
 0301b609dfed824a16753406c36d4637
 echo x - coovachilli/files/patch-src_tun.c
 sed 's/^X//' >coovachilli/files/patch-src_tun.c << '57c4a911d9e987290bcb1f80a5bfcc4e'
 Xdiff -urN src/tun.c.orig src/tun.c
 X--- src/tun.c.orig	2008-06-28 17:38:35.000000000 +0100
 X+++ src/tun.c	2008-06-29 16:17:48.000000000 +0100
 X@@ -1,7 +1,7 @@
 X /* 
 X  * Tunnel Interface Functions.
 X  * Copyright (C) 2002, 2003, 2004 Mondru AB.
 X- * Copyright (c) 2006-2007 David Bird <david@coova.com>
 X+ * Copyright (c) 2006-2008 David Bird <david@coova.com>
 X  * 
 X  * The contents of this file may be used under the terms of the GNU
 X  * General Public License Version 2, provided that the above copyright
 X@@ -226,7 +226,7 @@
 X   return 0;
 X }
 X 
 X-int tun_gifindex(struct tun_t *this, int *index) {
 X+int tun_gifindex(struct tun_t *this, uint32_t *index) {
 X   struct ifreq ifr;
 X   int fd;
 X 
 X@@ -423,7 +423,7 @@
 X   return 0;
 X }
 X 
 X-static int tuntap_interface(struct _net_interface *netif) {
 X+int tuntap_interface(struct _net_interface *netif) {
 X #if defined(__linux__)
 X   struct ifreq ifr;
 X 
 X@@ -443,7 +443,6 @@
 X #error  "Unknown platform!"
 X #endif
 X 
 X-
 X #if defined(__linux__)
 X   /* Open the actual tun device */
 X   if ((netif->fd  = open("/dev/net/tun", O_RDWR)) < 0) {
 X@@ -520,7 +519,6 @@
 X   /* Find suitable device */
 X   for (devnum = 0; devnum < 255; devnum++) { /* TODO 255 */ 
 X     snprintf(devname, sizeof(devname), "/dev/tun%d", devnum);
 X-    devname[sizeof(devname)] = 0;
 X     if ((netif->fd = open(devname, O_RDWR)) >= 0) break;
 X     if (errno != EBUSY) break;
 X   } 
 X@@ -530,7 +528,6 @@
 X   }
 X 
 X   snprintf(netif->devname, sizeof(netif->devname), "tun%d", devnum);
 X-  netif->devname[sizeof(netif->devname)-1] = 0;
 X 
 X   /* The tun device we found might have "old" IP addresses allocated */
 X   /* We need to delete those. This problem is not present on Linux */
 X@@ -538,13 +535,11 @@
 X   memset(&areq, 0, sizeof(areq));
 X 
 X   /* Set up interface name */
 X-  strncpy(areq.ifra_name, netif->devname, IFNAMSIZ);
 X-  areq.ifra_name[IFNAMSIZ-1] = 0; /* Make sure to terminate */
 X+  strncpy(areq.ifra_name, netif->devname, sizeof(areq.ifra_name));
 X 
 X   /* Create a channel to the NET kernel. */
 X   if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
 X-    log_err(errno,
 X-	    "socket() failed");
 X+    log_err(errno,"socket() failed");
 X     return -1;
 X   }
 X   
 X@@ -703,14 +698,15 @@
 X 
 X   if (this->cb_ind)
 X     return this->cb_ind(this, &packet, sbuf.len);
 X-
 X   return 0;
 X   
 X #endif
 X }
 X 
 X+/*
 X static uint32_t dnatip[1024];
 X static uint16_t dnatport[1024];
 X+*/
 X 
 X int tun_encaps(struct tun_t *tun, void *pack, size_t len, int idx) {
 X 
 X
 57c4a911d9e987290bcb1f80a5bfcc4e
 echo x - coovachilli/files/patch-www_Makefile.am
 sed 's/^X//' >coovachilli/files/patch-www_Makefile.am << '7696a874b8b1a505932b40c8a77885fd'
 X--- www/Makefile.am.orig	2008-06-29 17:44:26.000000000 +0000
 X+++ www/Makefile.am	2008-06-29 17:44:48.000000000 +0000
 X@@ -3,7 +3,7 @@
 X chillidir = $(sysconfdir)/chilli
 X chilli_SCRIPTS = wwwsh
 X 
 X-wwwdir = $(chillidir)/www
 X+wwwdir = $(prefix)/www/chilli
 X 
 X wwwDATAFILES = \
 X chillijs.chi chillijs.chi.sh chilliform.chi chilliform.chi.sh \
 7696a874b8b1a505932b40c8a77885fd
 echo x - coovachilli/files/main.conf.sample
 sed 's/^X//' >coovachilli/files/main.conf.sample << '6c9f8ec9737f2ad9fb460a0c74905c53'
 Xcmdsocket       /var/run/chilli.sock
 Xpidfile         /var/run/chilli.pid
 Xnet		10.1.0.0/255.255.255.0
 Xuamlisten	10.1.0.1
 Xuamport         3990
 Xdhcpif		em1
 Xadminuser       chillispot
 Xadminpasswd     chillispot
 Xuamallowed	coova.org,coova.org,rad01.coova.org,coova.org
 Xuamanydns
 X
 Xdomain lan
 Xdns1 208.67.222.222
 Xuamhomepage http://10.1.0.1:3990/www/coova.html
 Xwisprlogin https://coova.org/app/uam/auth
 Xwwwdir /usr/local/www/chilli 
 Xwwwbin /etc/chilli/wwwsh
 Xlocationname "My HotSpot"
 Xradiuslocationname My_HotSpot
 Xradiuslocationid isocc=,cc=,ac=,network=Coova,
 Xradiusserver1	rad01.coova.org
 Xradiusserver2	rad01.coova.org
 Xradiussecret	coova-anonymous
 Xradiusauthport  1812
 Xradiusacctport  1813
 Xuamserver	https://coova.org/app/uam/chilli
 Xradiusnasid	nas01
 X
 Xpapalwaysok
 6c9f8ec9737f2ad9fb460a0c74905c53
 echo x - coovachilli/files/pf.conf.sample
 sed 's/^X//' >coovachilli/files/pf.conf.sample << '08da1ec053477643a23ed3fdc892731e'
 X#
 X# Basic Chillispot PF Config
 X# A tweak of Example 1 from the PF FAQ
 X# http://www.openbsd.org/faq/pf/example1.html
 X# By Venture37 
 X# venture37@geeklan.co.uk
 X# http://www.geeklan.co.uk
 X
 X# macros
 Xint_if = "ral0"
 Xext_if = "fxp0"
 Xchilli_if = "tun0"
 X
 Xtcp_services = "{ 22, 113 }"
 Xicmp_types = "echoreq"
 X
 Xpriv_nets = "{ 127.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 }"
 X        
 X# options
 Xset block-policy return
 Xset loginterface $ext_if
 X
 X# scrub
 Xscrub in all
 X
 X# nat/rdr
 Xnat on $ext_if from $chilli_if:network to any -> ($ext_if)
 X
 X# filter rules
 Xblock all
 X
 Xpass quick on lo0 all
 X
 Xblock drop in  quick on $ext_if from $priv_nets to any
 Xblock drop out quick on $ext_if from any to $priv_nets
 Xblock drop on $int_if all
 X
 Xpass in on $ext_if inet proto tcp from any to ($ext_if) \
 X   port $tcp_services flags S/SA keep state
 X
 Xpass in inet proto icmp all icmp-type $icmp_types keep state
 X
 Xpass in  on $chilli_if from $chilli_if:network to any keep state
 Xpass out on $chilli_if from any to $chilli_if:network keep state
 X
 Xpass out on $ext_if proto tcp all modulate state flags S/SA
 Xpass out on $ext_if proto { udp, icmp } all keep state
 08da1ec053477643a23ed3fdc892731e
 echo x - coovachilli/files/ipfw-config.sample
 sed 's/^X//' >coovachilli/files/ipfw-config.sample << '52fb9aae3cde7d138a30ae7eeb230c2f'
 Xnetwork inetrface
 X
 Xfxp0 : 11.11.11.1
 Xfxp1 : 10.14.1.254
 X
 X/etc/ipnat.rules
 X
 X# NAT
 X#
 Xmap fxp0 192.168.182.0/24 -> 11.11.11.1/32 portmap tcp/udp auto
 X
 X--------------------------------------------------------
 X
 X/usr/local/etc/rc.d/ipfw.sh
 X
 X#!/bin/sh
 X
 XRULENO="1500"
 X
 XEXT_IF="fxp0"
 XINT_IF="fxp1"
 X
 XEXT_IP="11.11.11.1"
 X#INT_IP="10.14.1.0/24"
 X
 X# flush rules
 X#
 Xipfw -f flush
 X
 X## setup loopback
 X##
 Xipfw $RULENO add pass all from any to any via lo0
 Xipfw add deny all from any to 127.0.0.0/8
 Xipfw add deny ip from 127.0.0.0/8 to any
 X
 X# allow related and established on all interfaces
 X#
 Xipfw add pass ip from any to any established
 X
 X# allow SA connect to me , deny any others use ssh
 X#
 Xipfw add pass tcp from 11.11.11.5 to any setup
 Xipfw add deny tcp from any to ${EXT_IP} 22
 X
 X## allow me (firewall) to access anywhere
 X##
 Xipfw add pass tcp from ${EXT_IP} to any setup
 Xipfw add pass udp from ${EXT_IP} to any keep-state
 X
 X## allow tun0 device to connect to anywhere
 X##
 Xipfw add pass tcp from any to any via tun0 setup
 Xipfw add pass udp from any to any via tun0 keep-state
 X
 X# allow icmp
 X#
 Xipfw add pass icmp from any to any icmptypes 0,3,8,11
 X
 X# allow http , https and dns on internal interface
 X#
 Xipfw add pass tcp from any to any 80 via ${INT_IF} setup
 Xipfw add pass tcp from any to any 443 via ${INT_IF} setup
 Xipfw add pass udp from any to any 53 via ${INT_IF} keep-state
 X
 X# allow tcp port 3990 on internal interface for chillispot redirection
 X#
 Xipfw add pass tcp from any to any 3990 via ${INT_IF} setup
 X
 X# except for any condition above , reject everything on all interfaces
 X#
 Xipfw add deny all from any to any 
 52fb9aae3cde7d138a30ae7eeb230c2f
 echo x - coovachilli/files/patch-conf_up.sh.in
 sed 's/^X//' >coovachilli/files/patch-conf_up.sh.in << '82e545af6a9653a2d3028dc0b0a8eab3'
 X--- conf/up.sh.in.orig	2009-01-10 17:54:55.000000000 +0000
 X+++ conf/up.sh.in	2009-01-10 18:03:23.000000000 +0000
 X@@ -5,52 +5,5 @@
 X 
 X . @ETCCHILLI@/functions
 X 
 X-[ -e "@VARRUN@/chilli.iptables" ] && sh @VARRUN@/chilli.iptables 2>/dev/null
 X-rm -f @VARRUN@/chilli.iptables 2>/dev/null
 X-
 X-IF=$(basename $DEV)
 X-
 X-ipt() {
 X-    opt=$1; shift
 X-    echo "iptables -D $*" >> @VARRUN@/chilli.iptables
 X-    iptables $opt $*
 X-}
 X-
 X-ipt_in() {
 X-    ipt -A INPUT -i $IF $*
 X-}
 X-
 X-[ -n "$DHCPIF" ] && {
 X-
 X-    [ -n "$UAMPORT" -a "$UAMPORT" != "0" ] && \
 X-	ipt_in -p tcp -m tcp --dport $UAMPORT --dst $ADDR -j ACCEPT
 X-
 X-    [ -n "$UAMUIPORT" -a "$UAMUIPORT" != "0" ] && \
 X-	ipt_in -p tcp -m tcp --dport $UAMUIPORT --dst $ADDR -j ACCEPT
 X-
 X-    [ -n "HS_TCP_PORTS" ] && {
 X-	for port in $HS_TCP_PORTS; do
 X-	    ipt_in -p tcp -m tcp --dport $port --dst $ADDR -j ACCEPT
 X-	done
 X-    }
 X-    
 X-    ipt_in -p udp -d 255.255.255.255 --destination-port 67:68 -j ACCEPT
 X-    ipt_in -p udp --dst $ADDR --dport 53 -j ACCEPT
 X-
 X-    ipt -A INPUT -i $IF --dst $ADDR -j DROP
 X-    ipt -A INPUT -i $IF -j DROP
 X-
 X-    ipt -I FORWARD -i $DHCPIF -j DROP
 X-    ipt -I FORWARD -o $DHCPIF -j DROP
 X-    ipt -I FORWARD -i $IF -j ACCEPT
 X-    ipt -I FORWARD -o $IF -j ACCEPT
 X-
 X-    [ "$HS_LAN_ACCESS" != "on" -a "$HS_LAN_ACCESS" != "allow" ] && \
 X-	ipt -I FORWARD -i $IF -o \! $HS_WANIF -j DROP
 X-
 X-    [ "$HS_LOCAL_DNS" = "on" ] && \
 X-	ipt -I PREROUTING -t nat -i $IF -p udp --dport 53 -j DNAT --to-destination $ADDR
 X-}
 X-
 X # site specific stuff optional
 X [ -e @ETCCHILLI@/ipup.sh ] && . @ETCCHILLI@/ipup.sh
 82e545af6a9653a2d3028dc0b0a8eab3
 echo x - coovachilli/files/patch-conf_functions.in
 sed 's/^X//' >coovachilli/files/patch-conf_functions.in << 'f254c22064006db46dc741f1a65c31ab'
 X--- conf/functions.in.orig	2009-01-10 17:55:30.000000000 +0000
 X+++ conf/functions.in	2009-01-10 17:56:42.000000000 +0000
 X@@ -4,7 +4,6 @@
 X # Licensed under GPL. See http://coova.org/
 X #
 X 
 X-IPTABLES=/sbin/iptables
 X IFCONFIG=/sbin/ifconfig
 X 
 X CHILLI=@ETCCHILLI@
 X@@ -22,8 +21,6 @@
 X [ -f $CHILLI/defaults ] && . $CHILLI/defaults
 X [ -f $CHILLI/config ]   && . $CHILLI/config
 X 
 X-[ -f /etc/sysconfig/chilli ] && . /etc/sysconfig/chilli
 X-
 X HS_UAMPORT=${HS_UAMPORT:-3990}
 X HS_RADIUS=${HS_RADIUS:-$HS_UAMSERVER}
 X HS_RADSECRET=${HS_RADSECRET:-$HS_UAMSECRET}
 f254c22064006db46dc741f1a65c31ab
 echo x - coovachilli/files/patch-conf_down.sh.in
 sed 's/^X//' >coovachilli/files/patch-conf_down.sh.in << 'dd1a9b9b2ecb238b0e1eb90da1af13b2'
 X--- conf/down.sh.in.orig	2009-01-10 18:04:37.000000000 +0000
 X+++ conf/down.sh.in	2009-01-10 18:04:52.000000000 +0000
 X@@ -5,8 +5,5 @@
 X 
 X . @ETCCHILLI@/functions
 X 
 X-[ -e "@VARRUN@/chilli.iptables" ] && sh @VARRUN@/chilli.iptables 2>/dev/null
 X-rm -f @VARRUN@/chilli.iptables 2>/dev/null
 X-
 X # site specific stuff optional
 X [ -e @ETCCHILLI@/ipdown.sh ] && . @ETCCHILLI@/ipdown.sh
 dd1a9b9b2ecb238b0e1eb90da1af13b2
 echo x - coovachilli/files/coovachilli.in
 sed 's/^X//' >coovachilli/files/coovachilli.in << '57791b14aff4e72ddb8508ae8ef7b6b4'
 X#!/bin/sh
 X
 X# PROVIDE: coovachilli
 X# REQUIRE: netif
 X# BEFORE: pf ipfw
 X# KEYWORD: nojail
 X#
 X# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
 X# to enable this service:
 X#
 X# coovachilli_enable (bool):   Set to NO by default.
 X#               Set it to YES to enable coova-chilli.
 X
 X
 X. %%RC_SUBR%%
 X
 Xname=coovachilli
 Xrcvar=coovachilli_enable
 X
 Xcommand=%%PREFIX%%/sbin/chilli
 Xpidfile=/var/run/chilli.pid
 X
 Xload_rc_config $name
 X
 Xrun_rc_command "$1"
 57791b14aff4e72ddb8508ae8ef7b6b4
 echo x - coovachilli/pkg-message
 sed 's/^X//' >coovachilli/pkg-message << 'bd0b445112914f5e44c92f0001493f9f'
 X| Add coovachilli_enable="YES" to /etc/rc.conf
 X|
 X| You'll need to tweak your kernel settings
 X| add the following to /boot/loader.conf
 X| kern.ipc.msgseg=16000
 X| kern.ipc.msgmnb=16000
 X|
 X| Sample config files located in %%EXAMPLESDIR%%
 X| copy the sample main.conf file to your
 X| chilli directory & create an empty
 X| hs.conf & local.conf to get going.
 bd0b445112914f5e44c92f0001493f9f
 exit
 
 
 --------------080205060002060007080703--
State-Changed-From-To: open->closed 
State-Changed-By: amdmi3 
State-Changed-When: Tue Jan 20 11:58:15 UTC 2009 
State-Changed-Why:  
New port added, with minor changes. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=130357 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/130357: commit references a PR
Date: Tue, 20 Jan 2009 11:58:12 +0000 (UTC)

 amdmi3      2009-01-20 11:58:00 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net-mgmt             Makefile 
   Added files:
     net-mgmt/coovachilli Makefile distinfo pkg-descr pkg-message 
                          pkg-plist 
     net-mgmt/coovachilli/files coovachilli.in ipfw-config.sample 
                                main.conf.sample 
                                patch-conf_Makefile.am 
                                patch-conf_Makefile.in 
                                patch-conf_down.sh.in 
                                patch-conf_functions.in 
                                patch-conf_up.sh.in 
                                patch-coova-chilli.spec.in 
                                patch-src_chilli.c patch-src_dhcp.c 
                                patch-src_main-query.c 
                                patch-src_msgstat.c 
                                patch-src_redir.c patch-src_redir.h 
                                patch-src_system.h patch-src_tun.c 
                                patch-www_Makefile.am 
                                pf.conf.sample 
   Log:
   CoovaChilli is an access controller
   It provides a captive portal / walled garden environment.
   Coova builds on the popular features of the now defunct Chillispot.
   
   WWW: http://www.coova.org/
   
   PR:             130357
   Submitted by:   Sevan Janiyan <venture37 at geeklan dot co dot uk>
   
   Revision  Changes    Path
   1.177     +1 -0      ports/net-mgmt/Makefile
   1.1       +40 -0     ports/net-mgmt/coovachilli/Makefile (new)
   1.1       +3 -0      ports/net-mgmt/coovachilli/distinfo (new)
   1.1       +25 -0     ports/net-mgmt/coovachilli/files/coovachilli.in (new)
   1.1       +71 -0     ports/net-mgmt/coovachilli/files/ipfw-config.sample (new)
   1.1       +29 -0     ports/net-mgmt/coovachilli/files/main.conf.sample (new)
   1.1       +32 -0     ports/net-mgmt/coovachilli/files/patch-conf_Makefile.am (new)
   1.1       +102 -0    ports/net-mgmt/coovachilli/files/patch-conf_Makefile.in (new)
   1.1       +11 -0     ports/net-mgmt/coovachilli/files/patch-conf_down.sh.in (new)
   1.1       +19 -0     ports/net-mgmt/coovachilli/files/patch-conf_functions.in (new)
   1.1       +55 -0     ports/net-mgmt/coovachilli/files/patch-conf_up.sh.in (new)
   1.1       +10 -0     ports/net-mgmt/coovachilli/files/patch-coova-chilli.spec.in (new)
   1.1       +31 -0     ports/net-mgmt/coovachilli/files/patch-src_chilli.c (new)
   1.1       +40 -0     ports/net-mgmt/coovachilli/files/patch-src_dhcp.c (new)
   1.1       +19 -0     ports/net-mgmt/coovachilli/files/patch-src_main-query.c (new)
   1.1       +88 -0     ports/net-mgmt/coovachilli/files/patch-src_msgstat.c (new)
   1.1       +24 -0     ports/net-mgmt/coovachilli/files/patch-src_redir.c (new)
   1.1       +29 -0     ports/net-mgmt/coovachilli/files/patch-src_redir.h (new)
   1.1       +13 -0     ports/net-mgmt/coovachilli/files/patch-src_system.h (new)
   1.1       +88 -0     ports/net-mgmt/coovachilli/files/patch-src_tun.c (new)
   1.1       +11 -0     ports/net-mgmt/coovachilli/files/patch-www_Makefile.am (new)
   1.1       +47 -0     ports/net-mgmt/coovachilli/files/pf.conf.sample (new)
   1.1       +5 -0      ports/net-mgmt/coovachilli/pkg-descr (new)
   1.1       +11 -0     ports/net-mgmt/coovachilli/pkg-message (new)
   1.1       +39 -0     ports/net-mgmt/coovachilli/pkg-plist (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
