[Glibc-bsd-commits] r1857 - in trunk: freebsd-utils
kfreebsd-kernel-headers/debian
Petr Salinger
ps-guest at alioth.debian.org
Tue Jan 9 10:28:19 CET 2007
Author: ps-guest
Date: 2007-01-09 10:28:18 +0100 (Tue, 09 Jan 2007)
New Revision: 1857
Added:
trunk/freebsd-utils/pf.txt
Modified:
trunk/kfreebsd-kernel-headers/debian/includes.list
Log:
* write down notes for preliminary buildable version for pf from RELENG_6
Added: trunk/freebsd-utils/pf.txt
===================================================================
--- trunk/freebsd-utils/pf.txt 2007-01-08 19:02:19 UTC (rev 1856)
+++ trunk/freebsd-utils/pf.txt 2007-01-09 09:28:18 UTC (rev 1857)
@@ -0,0 +1,225 @@
+
+preliminary (buildable) version for pf from RELENG_6
+====================================================
+
+* fix up into debian/rules:
+
+ set -e ; find build-tree/src/contrib/pf/ -type f | (while read i ; do \
+ sed -i $$i \
+ -e 's/defined\( \|\t\)*(\( \|\t\)*__FreeBSD__\( \|\t\)*)/defined(__FreeBSD_kernel__)/g' \
+ -e 's/#\( \|\t\)*ifdef\( \|\t\)*__FreeBSD__/#ifdef __FreeBSD_kernel__/g' \
+ -e 's/#\( \|\t\)*ifndef\( \|\t\)*__FreeBSD__/#ifndef __FreeBSD_kernel__/g' \
+ ; done)
+
+* will need <sys/tree.h> in kfreebsd-kernel-headers
+
+* will need whole kfreebsd-6-6.2/src/sys/contrib/pf/ available during build
+
+* content of <bsd/bsd.h> and <bsd/ip_icmp.h> (from libbsd-dev)
+ should be checked against 6.x kernel sources, may be completely revamped
+
+* check for missing prototypes of function, include appropriate headers
+
+* preliminary patch, path for kernel headers in Makefiles should be addapted:
+
+
+diff -urN build-tree/src/contrib/pf/authpf/authpf.c build-tree/src/contrib/pf/authpf/authpf.c
+--- build-tree/src/contrib/pf/authpf/authpf.c 2007-01-09 11:00:24.000000000 +0100
++++ build-tree/src/contrib/pf/authpf/authpf.c 2007-01-09 09:52:19.000000000 +0100
+@@ -44,7 +44,7 @@
+ #ifdef __FreeBSD_kernel__
+ #include <inttypes.h>
+ #endif
+-#include <login_cap.h>
++//#include <login_cap.h>
+ #include <pwd.h>
+ #include <signal.h>
+ #include <stdio.h>
+@@ -82,7 +82,7 @@
+ volatile sig_atomic_t want_death;
+ static void need_death(int signo);
+ #ifdef __FreeBSD_kernel__
+-staticvoid do_death(int);
++static void do_death(int);
+ #else
+ static __dead void do_death(int);
+ #endif
+@@ -103,8 +103,9 @@
+ char *cp;
+ uid_t uid;
+ char *shell;
++#if 0
+ login_cap_t *lc;
+-
++#endif
+ config = fopen(PATH_CONFFILE, "r");
+
+ if ((cp = getenv("SSH_TTY")) == NULL) {
+@@ -147,15 +148,16 @@
+ syslog(LOG_ERR, "cannot find user for uid %u", uid);
+ goto die;
+ }
+-
++#if 0
+ if ((lc = login_getclass(pw->pw_class)) != NULL)
+ shell = (char *)login_getcapstr(lc, "shell", pw->pw_shell,
+ pw->pw_shell);
+ else
++#endif
+ shell = pw->pw_shell;
+-
++#if 0
+ login_close(lc);
+-
++#endif
+ if (strcmp(shell, PATH_AUTHPF_SHELL)) {
+ syslog(LOG_ERR, "wrong shell for user %s, uid %u",
+ pw->pw_name, pw->pw_uid);
+@@ -313,7 +315,9 @@
+ while (1) {
+ printf("\r\nHello %s. ", luser);
+ printf("You are authenticated from host \"%s\"\r\n", ipsrc);
++#if 0
+ setproctitle("%s@%s", luser, ipsrc);
++#endif
+ print_message(PATH_MESSAGE);
+ while (1) {
+ sleep(10);
+@@ -823,7 +827,7 @@
+ * function that removes our stuff when we go away.
+ */
+ #ifdef __FreeBSD_kernel__
+-staticvoid
++static void
+ #else
+ static __dead void
+ #endif
+diff -urN build-tree/src/contrib/pf/pfctl/parse.y build-tree/src/contrib/pf/pfctl/parse.y
+--- build-tree/src/contrib/pf/pfctl/parse.y 2007-01-09 11:00:24.000000000 +0100
++++ build-tree/src/contrib/pf/pfctl/parse.y 2007-01-09 10:18:46.000000000 +0100
+@@ -35,7 +35,7 @@
+ #include <netinet/in.h>
+ #include <netinet/in_systm.h>
+ #include <netinet/ip.h>
+-#include <netinet/ip_icmp.h>
++//#include <netinet/ip_icmp.h>
+ #include <netinet/icmp6.h>
+ #include <net/pfvar.h>
+ #include <arpa/inet.h>
+@@ -56,7 +56,9 @@
+ #include <limits.h>
+ #include <pwd.h>
+ #include <grp.h>
+-#include <md5.h>
++#include <bsd/md5.h>
++#define __BSD_VISIBLE 1
++#include <sys/limits.h>
+
+ #include "pfctl_parser.h"
+ #include "pfctl.h"
+@@ -394,6 +396,7 @@
+ } v;
+ int lineno;
+ } YYSTYPE;
++#define YYSTYPE_IS_DECLARED 1
+
+ #define DYNIF_MULTIADDR(addr) ((addr).type == PF_ADDR_DYNIFTL && \
+ (!((addr).iflags & PFI_AFLAG_NOALIAS) || \
+diff -urN build-tree/src/contrib/pf/pfctl/pf_print_state.c build-tree/src/contrib/pf/pfctl/pf_print_state.c
+--- build-tree/src/contrib/pf/pfctl/pf_print_state.c 2007-01-09 11:00:24.000000000 +0100
++++ build-tree/src/contrib/pf/pfctl/pf_print_state.c 2007-01-09 10:15:37.000000000 +0100
+@@ -34,7 +34,21 @@
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
++
++#ifdef __GLIBC__
++#include <stdint.h>
++#include <endian.h>
++#include <byteswap.h>
++# if __BYTE_ORDER == __LITTLE_ENDIAN
++# define be64toh(x) bswap_64(x)
++# elif __BYTE_ORDER == __BIG_ENDIAN
++# define be64toh(x) ((uint64_t)(x))
++# else
++# error Unknown endian
++# endif
++#else
+ #include <sys/endian.h>
++#endif
+ #include <net/if.h>
+ #define TCPSTATES
+ #include <netinet/tcp_fsm.h>
+diff -urN build-tree/src/contrib/pf/pfctl/pfctl.h build-tree/src/contrib/pf/pfctl/pfctl.h
+--- build-tree/src/contrib/pf/pfctl/pfctl.h 2007-01-09 11:00:24.000000000 +0100
++++ build-tree/src/contrib/pf/pfctl/pfctl.h 2007-01-09 10:06:36.000000000 +0100
+@@ -34,6 +34,8 @@
+ #ifndef _PFCTL_H_
+ #define _PFCTL_H_
+
++#include <bsd/bsd.h>
++
+ enum { PFRB_TABLES = 1, PFRB_TSTATS, PFRB_ADDRS, PFRB_ASTATS,
+ PFRB_IFACES, PFRB_TRANS, PFRB_MAX };
+ struct pfr_buffer {
+diff -urN build-tree/src/contrib/pf/pfctl/pfctl_parser.c build-tree/src/contrib/pf/pfctl/pfctl_parser.c
+--- build-tree/src/contrib/pf/pfctl/pfctl_parser.c 2007-01-09 11:00:24.000000000 +0100
++++ build-tree/src/contrib/pf/pfctl/pfctl_parser.c 2007-01-09 10:04:29.000000000 +0100
+@@ -42,7 +42,7 @@
+ #include <netinet/in.h>
+ #include <netinet/in_systm.h>
+ #include <netinet/ip.h>
+-#include <netinet/ip_icmp.h>
++//#include <netinet/ip_icmp.h>
+ #include <netinet/icmp6.h>
+ #include <net/pfvar.h>
+ #include <arpa/inet.h>
+@@ -58,6 +58,9 @@
+ #include <err.h>
+ #include <ifaddrs.h>
+
++#include <bsd/ip_icmp.h>
++#include <bsd/bsd.h>
++
+ #include "pfctl_parser.h"
+ #include "pfctl.h"
+
+diff -urN build-tree/src/sbin/pfctl/Makefile build-tree/src/sbin/pfctl/Makefile
+--- build-tree/src/sbin/pfctl/Makefile 2007-01-09 10:59:51.000000000 +0100
++++ build-tree/src/sbin/pfctl/Makefile 2007-01-09 09:48:06.000000000 +0100
+@@ -11,7 +11,7 @@
+ SRCS+= pfctl_optimize.c
+
+ CFLAGS+= -Wall -Wmissing-prototypes -Wno-uninitialized
+-CFLAGS+= -Wstrict-prototypes -I${.CURDIR}/../../contrib/pf/pfctl
++CFLAGS+= -Wstrict-prototypes -I${.CURDIR}/../../contrib/pf/pfctl -I/build/extra/freebsd-utils/kernel
+
+ # XXX ALTQ
+ CFLAGS+= -DENABLE_ALTQ
+@@ -19,7 +19,7 @@
+
+ YFLAGS=
+
+-LDADD+= -lm -lmd
++LDADD+= -lm
+ DPADD+= ${LIBM}
+
+ .include <bsd.prog.mk>
+diff -urN build-tree/src/usr.sbin/authpf/Makefile build-tree/src/usr.sbin/authpf/Makefile
+--- build-tree/src/usr.sbin/authpf/Makefile 2007-01-09 10:59:54.000000000 +0100
++++ build-tree/src/usr.sbin/authpf/Makefile 2007-01-09 09:45:02.000000000 +0100
+@@ -11,12 +11,12 @@
+
+ SRCS= authpf.c
+
+-CFLAGS+= -I${.CURDIR}/../../contrib/pf/pfctl -Wall -Werror
++CFLAGS+= -I${.CURDIR}/../../contrib/pf/pfctl -Wall -I/build/extra/freebsd-utils/kernel
+
+ # XXX ALTQ:
+ CFLAGS+= -DENABLE_ALTQ
+
+-LDADD+= -lm -lmd -lutil
++LDADD+= -lm -lutil
+ DPADD+= ${LIBM} ${LIBMD} ${LIBUTIL}
+
+ .include <bsd.prog.mk>
Modified: trunk/kfreebsd-kernel-headers/debian/includes.list
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/includes.list 2007-01-08 19:02:19 UTC (rev 1856)
+++ trunk/kfreebsd-kernel-headers/debian/includes.list 2007-01-09 09:28:18 UTC (rev 1857)
@@ -222,6 +222,7 @@
sys/timespec.h
sys/_timeval.h
sys/timex.h
+sys/tree.h
sys/ttycom.h
sys/ttydev.h
sys/tty.h
More information about the Glibc-bsd-commits
mailing list