From owner-svn-src-user@FreeBSD.ORG Sun Oct 11 11:00:15 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 130581065670; Sun, 11 Oct 2009 11:00:15 +0000 (UTC) (envelope-from eri@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 013A68FC1C; Sun, 11 Oct 2009 11:00:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9BB0EAQ009537; Sun, 11 Oct 2009 11:00:14 GMT (envelope-from eri@svn.freebsd.org) Received: (from eri@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9BB0E0w009528; Sun, 11 Oct 2009 11:00:14 GMT (envelope-from eri@svn.freebsd.org) Message-Id: <200910111100.n9BB0E0w009528@svn.freebsd.org> From: Ermal Luçi Date: Sun, 11 Oct 2009 11:00:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197954 - in user/eri/pf45/head/contrib/pf: authpf ftp-proxy pflogd tftp-proxy X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2009 11:00:15 -0000 Author: eri Date: Sun Oct 11 11:00:14 2009 New Revision: 197954 URL: http://svn.freebsd.org/changeset/base/197954 Log: Fix compilation of all userland utilities of pf(4). Modified: user/eri/pf45/head/contrib/pf/authpf/authpf.c user/eri/pf45/head/contrib/pf/ftp-proxy/filter.c user/eri/pf45/head/contrib/pf/ftp-proxy/ftp-proxy.c user/eri/pf45/head/contrib/pf/pflogd/pflogd.c user/eri/pf45/head/contrib/pf/pflogd/privsep.c user/eri/pf45/head/contrib/pf/pflogd/privsep_fdpass.c user/eri/pf45/head/contrib/pf/tftp-proxy/filter.c user/eri/pf45/head/contrib/pf/tftp-proxy/tftp-proxy.c Modified: user/eri/pf45/head/contrib/pf/authpf/authpf.c ============================================================================== --- user/eri/pf45/head/contrib/pf/authpf/authpf.c Sun Oct 11 07:03:56 2009 (r197953) +++ user/eri/pf45/head/contrib/pf/authpf/authpf.c Sun Oct 11 11:00:14 2009 (r197954) @@ -16,6 +16,11 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef __FreeBSD__ +#include +__FBSDID("$FreeBSD$"); +#endif + #include #include #include @@ -68,7 +73,11 @@ struct timeval Tstart, Tend; /* start an volatile sig_atomic_t want_death; static void need_death(int signo); +#ifdef __FreeBSD__ +static void do_death(int); +#else static __dead void do_death(int); +#endif extern char *__progname; /* program name */ /* @@ -912,7 +921,11 @@ need_death(int signo) /* * function that removes our stuff when we go away. */ +#ifdef __FreeBSD__ +static void +#else static __dead void +#endif do_death(int active) { int ret = 0; Modified: user/eri/pf45/head/contrib/pf/ftp-proxy/filter.c ============================================================================== --- user/eri/pf45/head/contrib/pf/ftp-proxy/filter.c Sun Oct 11 07:03:56 2009 (r197953) +++ user/eri/pf45/head/contrib/pf/ftp-proxy/filter.c Sun Oct 11 11:00:14 2009 (r197954) @@ -16,6 +16,11 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef __FreeBSD__ +#include +__FBSDID("$FreeBSD$"); +#endif + #include #include #include Modified: user/eri/pf45/head/contrib/pf/ftp-proxy/ftp-proxy.c ============================================================================== --- user/eri/pf45/head/contrib/pf/ftp-proxy/ftp-proxy.c Sun Oct 11 07:03:56 2009 (r197953) +++ user/eri/pf45/head/contrib/pf/ftp-proxy/ftp-proxy.c Sun Oct 11 11:00:14 2009 (r197954) @@ -16,6 +16,11 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef __FreeBSD__ +#include +__FBSDID("$FreeBSD$"); +#endif + #include #include #include @@ -44,6 +49,10 @@ #include "filter.h" +#ifdef __FreeBSD__ +#define LIST_END(s) NULL +#endif + #define CONNECT_TIMEOUT 30 #define MIN_PORT 1024 #define MAX_LINE 500 @@ -574,7 +583,11 @@ logmsg(int pri, const char *message, ... /* We don't care about truncation. */ vsnprintf(buf, sizeof buf, message, ap); +#ifdef __FreeBSD__ + strvis(visbuf, buf, VIS_CSTYLE | VIS_NL); +#else strnvis(visbuf, buf, sizeof visbuf, VIS_CSTYLE | VIS_NL); +#endif fprintf(stderr, "%s\n", visbuf); } Modified: user/eri/pf45/head/contrib/pf/pflogd/pflogd.c ============================================================================== --- user/eri/pf45/head/contrib/pf/pflogd/pflogd.c Sun Oct 11 07:03:56 2009 (r197953) +++ user/eri/pf45/head/contrib/pf/pflogd/pflogd.c Sun Oct 11 11:00:14 2009 (r197954) @@ -30,12 +30,21 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#ifdef __FreeBSD__ +#include +__FBSDID("$FreeBSD$"); + +#include +#endif #include #include #include #include #include #include +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -48,7 +57,11 @@ #include #include #include +#ifdef __FreeBSD__ +#include "pidfile.h" +#else #include +#endif #include "pflogd.h" pcap_t *hpcap; @@ -153,7 +166,11 @@ logmsg(int pri, const char *message, ... va_end(ap); } +#ifdef __FreeBSD__ +void +#else __dead void +#endif usage(void) { fprintf(stderr, "usage: pflogd [-Dx] [-d delay] [-f filename]"); @@ -214,7 +231,11 @@ if_exists(char *ifname) sizeof(ifr.ifr_name)) errx(1, "main ifr_name: strlcpy"); ifr.ifr_data = (caddr_t)&ifrdat; +#ifdef __FreeBSD__ + if (ioctl(s, DIOCGIFSPEED, (caddr_t)&ifr) == -1) +#else if (ioctl(s, SIOCGIFDATA, (caddr_t)&ifr) == -1) +#endif return (0); if (close(s)) err(1, "close"); Modified: user/eri/pf45/head/contrib/pf/pflogd/privsep.c ============================================================================== --- user/eri/pf45/head/contrib/pf/pflogd/privsep.c Sun Oct 11 07:03:56 2009 (r197953) +++ user/eri/pf45/head/contrib/pf/pflogd/privsep.c Sun Oct 11 11:00:14 2009 (r197954) @@ -16,6 +16,12 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifdef __FreeBSD__ +#include +__FBSDID("$FreeBSD$"); +#endif + #include #include #include @@ -28,13 +34,20 @@ #include #include #include +#ifndef __FreeBSD__ #include #include +#endif #include #include #include #include #include +#ifdef __FreeBSD__ +/* XXX: pcap pollutes namespace with strlcpy if not present previously */ +#include +#include +#endif #include #include #include "pflogd.h" @@ -69,7 +82,11 @@ priv_init(void) int snaplen, ret, olderrno; struct passwd *pw; +#ifdef __FreeBSD__ + for (i = 1; i < NSIG; i++) +#else for (i = 1; i < _NSIG; i++) +#endif signal(i, SIG_DFL); /* Create sockets */ Modified: user/eri/pf45/head/contrib/pf/pflogd/privsep_fdpass.c ============================================================================== --- user/eri/pf45/head/contrib/pf/pflogd/privsep_fdpass.c Sun Oct 11 07:03:56 2009 (r197953) +++ user/eri/pf45/head/contrib/pf/pflogd/privsep_fdpass.c Sun Oct 11 11:00:14 2009 (r197954) @@ -31,6 +31,12 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef __FreeBSD__ +#include +__FBSDID("$FreeBSD$"); +#endif + #include #include #include Modified: user/eri/pf45/head/contrib/pf/tftp-proxy/filter.c ============================================================================== --- user/eri/pf45/head/contrib/pf/tftp-proxy/filter.c Sun Oct 11 07:03:56 2009 (r197953) +++ user/eri/pf45/head/contrib/pf/tftp-proxy/filter.c Sun Oct 11 11:00:14 2009 (r197954) @@ -16,6 +16,11 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef __FreeBSD__ +#include +__FBSDID("$FreeBSD$"); +#endif + #include #include Modified: user/eri/pf45/head/contrib/pf/tftp-proxy/tftp-proxy.c ============================================================================== --- user/eri/pf45/head/contrib/pf/tftp-proxy/tftp-proxy.c Sun Oct 11 07:03:56 2009 (r197953) +++ user/eri/pf45/head/contrib/pf/tftp-proxy/tftp-proxy.c Sun Oct 11 11:00:14 2009 (r197954) @@ -27,6 +27,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef __FreeBSD__ +#include +__FBSDID("$FreeBSD$"); +#endif + #include #include #include