# 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: # # hoststated # hoststated/files # hoststated/files/patch-hoststated_check__http.c # hoststated/files/patch-hoststated_log.c # hoststated/files/patch-hoststated.c # hoststated/files/patch-hoststated_pfe__filter.c # hoststated/files/hoststated.sh.in # hoststated/files/patch-hoststatectl_parser.c # hoststated/files/patch-hoststated_parse.y # hoststated/files/patch-hoststatectl_hoststatectl.c # hoststated/Makefile # hoststated/distinfo # hoststated/pkg-descr # hoststated/pkg-install # hoststated/pkg-plist # echo c - hoststated mkdir -p hoststated > /dev/null 2>&1 echo c - hoststated/files mkdir -p hoststated/files > /dev/null 2>&1 echo x - hoststated/files/patch-hoststated_check__http.c sed 's/^X//' >hoststated/files/patch-hoststated_check__http.c << 'END-of-hoststated/files/patch-hoststated_check__http.c' X--- hoststated/check_http.c.orig 29 Jan 2007 14:23:31 -0000 1.11 X+++ hoststated/check_http.c 31 Jan 2007 16:47:43 -0000 X@@ -21,7 +21,7 @@ X #include X X #include X-#include X+//#include X #include X #include X #include X@@ -35,6 +35,9 @@ X X #include "hoststated.h" X X+/* XXX: filthy */ X+char *SHA1_Data(const void *, unsigned int, char *); X+ X int X check_http_code(struct ctl_tcp_event *cte) X { X@@ -84,7 +87,7 @@ X { X char *head; X u_char *b; X- char digest[(SHA1_DIGEST_LENGTH*2)+1]; X+ char digest[(SHA_DIGEST_LENGTH*2)+1]; X X /* X * ensure string is nul-terminated. X@@ -102,7 +105,7 @@ X return (1); X } X head += strlen("\r\n\r\n"); X- SHA1Data(head, strlen(head), digest); X+ SHA1_Data(head, strlen(head), digest); X X if (strcmp(cte->table->digest, digest)) { X log_warnx("check_http_digest: wrong digest for host %u", END-of-hoststated/files/patch-hoststated_check__http.c echo x - hoststated/files/patch-hoststated_log.c sed 's/^X//' >hoststated/files/patch-hoststated_log.c << 'END-of-hoststated/files/patch-hoststated_log.c' X--- hoststated/log.c.orig 16 Dec 2006 17:48:27 -0000 1.2 X+++ hoststated/log.c 31 Jan 2007 16:47:43 -0000 X@@ -22,6 +22,7 @@ X #include X #include X #include X+#include X X /* prototypes */ X void log_init(int); END-of-hoststated/files/patch-hoststated_log.c echo x - hoststated/files/patch-hoststated.c sed 's/^X//' >hoststated/files/patch-hoststated.c << 'END-of-hoststated/files/patch-hoststated.c' X--- hoststated/hoststated.c.orig 29 Jan 2007 14:23:31 -0000 1.13 X+++ hoststated/hoststated.c 31 Jan 2007 16:47:43 -0000 X@@ -37,7 +37,7 @@ X X #include "hoststated.h" X X-__dead void usage(void); X+void usage(void); X X void main_sig_handler(int, short, void *); X void main_shutdown(void); X@@ -85,7 +85,7 @@ X } X X /* __dead is for lint */ X-__dead void X+void X usage(void) X { X extern char *__progname; END-of-hoststated/files/patch-hoststated.c echo x - hoststated/files/patch-hoststated_pfe__filter.c sed 's/^X//' >hoststated/files/patch-hoststated_pfe__filter.c << 'END-of-hoststated/files/patch-hoststated_pfe__filter.c' X--- hoststated/pfe_filter.c.orig 29 Jan 2007 14:23:31 -0000 1.10 X+++ hoststated/pfe_filter.c 31 Jan 2007 16:47:43 -0000 X@@ -280,7 +280,7 @@ X rio.rule.dst.addr.type = PF_ADDR_ADDRMASK; X rio.rule.dst.port_op = PF_OP_EQ; X rio.rule.dst.port[0] = address->port; X- rio.rule.rtableid = -1; /* stay in the main routing table */ X+ //rio.rule.rtableid = -1; /* stay in the main routing table */ X rio.rule.action = PF_RDR; X if (strlen(service->tag)) X (void)strlcpy(rio.rule.tagname, service->tag, END-of-hoststated/files/patch-hoststated_pfe__filter.c echo x - hoststated/files/hoststated.sh.in sed 's/^X//' >hoststated/files/hoststated.sh.in << 'END-of-hoststated/files/hoststated.sh.in' X#!/bin/sh X# X# $FreeBSD$ X# X X# PROVIDE: hoststated X# REQUIRE: LOGIN abi X# BEFORE: securelevel X# KEYWORD: shutdown X X# Add the following line to /etc/rc.conf to enable `hoststated': X# X# hoststated_enable="YES" X# X# See hoststated(8) for hoststated_flags X# X X. "%%RC_SUBR%%" X Xname="hoststated" Xrcvar=`set_rcvar` X Xextra_commands="reload" Xcommand="%%PREFIX%%/sbin/hoststated" Xrequired_files="%%PREFIX%%/etc/hoststated.conf" X Xload_rc_config "$name" X: ${hoststated_enable="NO"} X: ${hoststated_flags=""} X Xrun_rc_command "$1" END-of-hoststated/files/hoststated.sh.in echo x - hoststated/files/patch-hoststatectl_parser.c sed 's/^X//' >hoststated/files/patch-hoststatectl_parser.c << 'END-of-hoststated/files/patch-hoststatectl_parser.c' X--- hoststatectl/parser.c.orig Wed Jan 31 21:57:41 2007 X+++ hoststatectl/parser.c Wed Jan 31 22:08:27 2007 X@@ -19,6 +19,7 @@ X */ X X #include X+#include X #include X #include X #include X@@ -65,9 +66,9 @@ X static const struct token t_main[] = { X {KEYWORD, "show", SHOW_SUM, NULL}, X {KEYWORD, "stop", SHUTDOWN, NULL}, X- {KEYWORD, "service", NULL, t_service}, X- {KEYWORD, "table", NULL, t_table}, X- {KEYWORD, "host", NULL, t_host}, X+ {KEYWORD, "service", 0, t_service}, X+ {KEYWORD, "table", 0, t_table}, X+ {KEYWORD, "host", 0, t_host}, X {ENDTOKEN, "", NONE, NULL} X }; X END-of-hoststated/files/patch-hoststatectl_parser.c echo x - hoststated/files/patch-hoststated_parse.y sed 's/^X//' >hoststated/files/patch-hoststated_parse.y << 'END-of-hoststated/files/patch-hoststated_parse.y' X--- hoststated/parse.y.orig 30 Jan 2007 10:12:06 -0000 1.20 X+++ hoststated/parse.y 31 Jan 2007 16:47:43 -0000 X@@ -983,7 +983,7 @@ X hints.ai_family = PF_UNSPEC; X hints.ai_socktype = SOCK_DGRAM; /* DUMMY */ X error = getaddrinfo(s, NULL, &hints, &res0); X- if (error == EAI_AGAIN || error == EAI_NODATA || error == EAI_NONAME) X+ if (error == EAI_AGAIN || error == EAI_NONAME) X return (0); X if (error) { X log_warnx("host_dns: could not parse \"%s\": %s", s, END-of-hoststated/files/patch-hoststated_parse.y echo x - hoststated/files/patch-hoststatectl_hoststatectl.c sed 's/^X//' >hoststated/files/patch-hoststatectl_hoststatectl.c << 'END-of-hoststated/files/patch-hoststatectl_hoststatectl.c' X--- hoststatectl/hoststatectl.c.orig Wed Jan 31 21:54:59 2007 X+++ hoststatectl/hoststatectl.c Wed Jan 31 21:55:11 2007 X@@ -20,6 +20,7 @@ X */ X X #include X+#include X #include X #include X #include END-of-hoststated/files/patch-hoststatectl_hoststatectl.c echo x - hoststated/Makefile sed 's/^X//' >hoststated/Makefile << 'END-of-hoststated/Makefile' X# New ports collection makefile for: hoststated X# Date created: Jan 31 2007 X# Whom: Florent Thoumie X# X# $FreeBSD$ X# X XPORTNAME= hoststated XPORTVERSION= 4.0.${SNAPSHOT} XCATEGORIES= net XMASTER_SITES= ${MASTER_SITE_LOCAL} XMASTER_SITE_SUBDIR= flz/hoststated/ XDISTFILES= ${PORTNAME}-${SNAPSHOT}.tgz XEXTRACT_ONLY= ${PORTNAME}-${SNAPSHOT}.tgz XSNAPSHOT= 20070131 X XMAINTAINER= flz@FreeBSD.org XCOMMENT= Host state daemon for server load-balancing X XLIB_DEPENDS= event-1.2a.1:${PORTSDIR}/devel/libevent X XWRKSRC= ${WRKDIR} XMANCOMPRESSED= yes XUSE_RC_SUBR= hoststated.sh XBUILD_ENV= BINDIR="${PREFIX}/sbin" \ X MANDIR="${PREFIX}/man/man" X XMAN5= hoststated.conf.5 XMAN8= hoststatectl.8 \ X hoststated.8 X XSUBDIRS= hoststated \ X hoststatectl X X.include X Xpost-patch: X @${REINPLACE_CMD} -e 's|-Wbounded|-I/usr/local/include|' \ X ${WRKSRC}/hoststated/Makefile \ X ${WRKSRC}/hoststatectl/Makefile X @${REINPLACE_CMD} -e 's|-levent|-L/usr/local/lib -levent -lmd|' \ X ${WRKSRC}/hoststated/Makefile X @${REINPLACE_CMD} -e 's|__dead||' ${WRKSRC}/hoststatectl/hoststatectl.c X @${REINPLACE_CMD} -e 's|/etc/host|${PREFIX}/etc/host|' \ X ${WRKSRC}/hoststated/hoststated.conf.5 \ X ${WRKSRC}/hoststated/hoststated.8 \ X ${WRKSRC}/hoststated/hoststated.h X Xdo-build: X.for i in ${SUBDIRS} X cd ${WRKSRC}/$i; ${SETENV} ${BUILD_ENV} make all X.endfor X Xdo-install: X.for i in ${SUBDIRS} X cd ${WRKSRC}/$i; ${SETENV} ${BUILD_ENV} make install X.endfor X ${INSTALL_DATA} ${WRKSRC}/hoststated/hoststated.conf ${PREFIX}/etc/hoststated.conf.sample X Xpost-install: X @if [ ! -f ${PREFIX}/etc/hoststated.conf ]; then \ X ${CP} ${PREFIX}/etc/hoststated.conf.sample ${PREFIX}/etc/hoststated.conf; \ X fi X @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL X X.include END-of-hoststated/Makefile echo x - hoststated/distinfo sed 's/^X//' >hoststated/distinfo << 'END-of-hoststated/distinfo' XMD5 (hoststated-20070131.tgz) = 077f32316f8797d0b3a4780067a9ae4b XSHA256 (hoststated-20070131.tgz) = e438f1746033821addd2d95fafa66cc5a79d94277421041d10992dc272f5303a XSIZE (hoststated-20070131.tgz) = 33957 END-of-hoststated/distinfo echo x - hoststated/pkg-descr sed 's/^X//' >hoststated/pkg-descr << 'END-of-hoststated/pkg-descr' Xhoststated is the host status daemon for server load balancing. Its Xmain purpose is to keep pf(4) tables up to date as well as any related Xpf rdr rules. To communicate with pf, hoststated uses the anchor Xfacility. To enable hoststated to install rulesets through the anchor, Xthe following line is required in the NAT section of pf.conf(5). X XWWW: http://www.openbsd.org/ X X- Florent Thoumie Xflz@FreeBSD.org END-of-hoststated/pkg-descr echo x - hoststated/pkg-install sed 's/^X//' >hoststated/pkg-install << 'END-of-hoststated/pkg-install' X#!/bin/sh X Xcase $2 in XPOST-INSTALL) X USER=_hoststated X GROUP=${USER} X UID=132 X GID=${UID} X PW=/usr/sbin/pw X X if ${PW} group show "${GROUP}" 2>/dev/null; then X echo "You already have a group \"${GROUP}\", so I will use it." X else X if ${PW} groupadd ${GROUP} -g ${GID}; then X echo "Added group \"${GROUP}\"." X else X echo "Adding group \"${GROUP}\" failed..." X exit 1 X fi X fi X X if ${PW} user show "${USER}" 2>/dev/null; then X echo "You already have a user \"${USER}\", so I will use it." X else X if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \ X -d "/var/empty" -s /sbin/nologin -c "HostState Daemon" X then X echo "Added user \"${USER}\"." X else X echo "Adding user \"${USER}\" failed..." X exit 1 X fi X fi X exit 0 X ;; Xesac END-of-hoststated/pkg-install echo x - hoststated/pkg-plist sed 's/^X//' >hoststated/pkg-plist << 'END-of-hoststated/pkg-plist' X@unexec if cmp -s %D/etc/hoststated.conf %D/etc/hoststated.conf.sample; then rm -f %D/etc/hoststated.conf; fi Xetc/hoststated.conf.sample X@exec [ -f %B/hoststated.conf ] || cp %B/%f %B/hoststated.conf Xsbin/hoststated Xsbin/hoststatectl END-of-hoststated/pkg-plist exit