b10532a581
modified to use kqueue/kevent and sysctl. The ifstated daemon runs commands in response to network state changes, which it determines by monitoring interface link state or running exter- nal tests. For example, it can be used with carp(4) to change running services or to ensure that carp(4) interfaces stay in sync, or with pf(4) to test server or link availability and modify translation or routing rules. PR: ports/74096 Submitted by: Matthew George <mdg@secureworks.net>
35 lines
1006 B
C
35 lines
1006 B
C
--- ifstated.h 18 Nov 2004 21:43:12 -0000 1.1.1.1
|
|
+++ ifstated.h 18 Nov 2004 21:48:39 -0000 1.2
|
|
@@ -1,4 +1,5 @@
|
|
/* $OpenBSD: ifstated.h,v 1.4 2004/03/10 00:13:38 deraadt Exp $ */
|
|
+/* $Id: ifstated.h,v 1.2 2004/11/18 21:48:39 mdg Exp $ */
|
|
|
|
/*
|
|
* Copyright (c) 2004 Ryan McBride
|
|
@@ -47,7 +48,7 @@
|
|
|
|
struct ifsd_external {
|
|
TAILQ_ENTRY(ifsd_external) entries;
|
|
- struct event ev;
|
|
+ struct kevent kev;
|
|
struct ifsd_expression_list expressions;
|
|
char *command;
|
|
int prevstatus;
|
|
@@ -107,7 +108,7 @@
|
|
TAILQ_HEAD(ifsd_external_list, ifsd_external);
|
|
|
|
struct ifsd_state {
|
|
- struct event ev;
|
|
+ struct kevent kev;
|
|
struct ifsd_ifstate_list interface_states;
|
|
struct ifsd_external_list external_tests;
|
|
TAILQ_ENTRY(ifsd_state) entries;
|
|
@@ -138,6 +139,7 @@
|
|
};
|
|
|
|
enum { IFSD_EVTIMER_ADD, IFSD_EVTIMER_DEL };
|
|
+enum { IFSD_EVTIMER_STARTUP, IFSD_EVTIMER_EXTERNAL };
|
|
struct ifsd_config *parse_config(char *, int);
|
|
int cmdline_symset(char *);
|
|
void clear_config(struct ifsd_config *);
|