diff options
author | ume <ume@FreeBSD.org> | 2002-08-07 17:03:14 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2002-08-07 17:03:14 +0000 |
commit | c9b1c6c3c7785ed179bd750d6e398ddbb1bff1c9 (patch) | |
tree | 88891ceb8e2b942dccd7389e9b876a7080525b53 /usr.sbin/inetd/inetd.h | |
parent | 919d00b11333feaf446ac8dbde0e32d08b6f19fb (diff) | |
download | FreeBSD-src-c9b1c6c3c7785ed179bd750d6e398ddbb1bff1c9.zip FreeBSD-src-c9b1c6c3c7785ed179bd750d6e398ddbb1bff1c9.tar.gz |
Add capability for limiting the maximum number of simultaneous
invocations of each service from a single IP address.
Requested by: matusita
Reviewed by: dwmalone
Tested by: matusita on snapshots.jp.FreeBSD.org
MFC after: 2 weeks
Diffstat (limited to 'usr.sbin/inetd/inetd.h')
-rw-r--r-- | usr.sbin/inetd/inetd.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/usr.sbin/inetd/inetd.h b/usr.sbin/inetd/inetd.h index 1e0f088..3293364 100644 --- a/usr.sbin/inetd/inetd.h +++ b/usr.sbin/inetd/inetd.h @@ -36,6 +36,7 @@ #include <sys/time.h> #include <sys/socket.h> #include <sys/un.h> +#include <sys/queue.h> #include <netinet/in.h> @@ -54,6 +55,21 @@ #define ISMUXPLUS(sep) ((sep)->se_type == MUXPLUS_TYPE) #define ISTTCP(sep) ((sep)->se_type == TTCP_TYPE) +struct procinfo { + LIST_ENTRY(procinfo) pr_link; + pid_t pr_pid; /* child pid */ + struct conninfo *pr_conn; +}; + +struct conninfo { + LIST_ENTRY(conninfo) co_link; + struct sockaddr_storage co_addr; /* source address */ + int co_numchild; /* current number of children */ + struct procinfo **co_proc; /* array of child proc entry */ +}; + +#define PERIPSIZE 256 + struct servtab { char *se_service; /* name of service */ int se_socktype; /* type of socket to use */ @@ -105,6 +121,8 @@ struct servtab { u_int se_nomapped : 1; u_int se_reset : 1; } se_flags; + int se_maxperip; /* max number of children per src */ + LIST_HEAD(, conninfo) se_conn[PERIPSIZE]; }; #define se_nomapped se_flags.se_nomapped |