Deleted Added
full compact
inetd.h (50479) inetd.h (56590)
1/*
2 * Copyright (c) 1983, 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
1/*
2 * Copyright (c) 1983, 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * $FreeBSD: head/usr.sbin/inetd/inetd.h 50479 1999-08-28 01:35:59Z peter $
33 * $FreeBSD: head/usr.sbin/inetd/inetd.h 56590 2000-01-25 14:52:10Z shin $
34 */
35
36#include <sys/time.h>
37#include <sys/socket.h>
38
39#include <netinet/in.h>
40
41#include <stdio.h>
42
43#define BUFSIZE 8192
44#define LINESIZ 72
45
46#define NORM_TYPE 0
47#define MUX_TYPE 1
48#define MUXPLUS_TYPE 2
49#define TTCP_TYPE 3
34 */
35
36#include <sys/time.h>
37#include <sys/socket.h>
38
39#include <netinet/in.h>
40
41#include <stdio.h>
42
43#define BUFSIZE 8192
44#define LINESIZ 72
45
46#define NORM_TYPE 0
47#define MUX_TYPE 1
48#define MUXPLUS_TYPE 2
49#define TTCP_TYPE 3
50#define FAITH_TYPE 4
50#define ISMUX(sep) (((sep)->se_type == MUX_TYPE) || \
51 ((sep)->se_type == MUXPLUS_TYPE))
52#define ISMUXPLUS(sep) ((sep)->se_type == MUXPLUS_TYPE)
53#define ISTTCP(sep) ((sep)->se_type == TTCP_TYPE)
54
55struct servtab {
56 char *se_service; /* name of service */
57 int se_socktype; /* type of socket to use */
51#define ISMUX(sep) (((sep)->se_type == MUX_TYPE) || \
52 ((sep)->se_type == MUXPLUS_TYPE))
53#define ISMUXPLUS(sep) ((sep)->se_type == MUXPLUS_TYPE)
54#define ISTTCP(sep) ((sep)->se_type == TTCP_TYPE)
55
56struct servtab {
57 char *se_service; /* name of service */
58 int se_socktype; /* type of socket to use */
59 int se_family; /* address family */
58 char *se_proto; /* protocol used */
59 int se_maxchild; /* max number of children */
60 int se_maxcpm; /* max connects per IP per minute */
61 int se_numchild; /* current number of children */
62 pid_t *se_pids; /* array of child pids */
63 char *se_user; /* user name to run as */
64 char *se_group; /* group name to run as */
65#ifdef LOGIN_CAP
66 char *se_class; /* login class name to run with */
67#endif
68 struct biltin *se_bi; /* if built-in, description */
69 char *se_server; /* server program */
70 char *se_server_name; /* server program without path */
71#define MAXARGV 20
72 char *se_argv[MAXARGV+1]; /* program arguments */
60 char *se_proto; /* protocol used */
61 int se_maxchild; /* max number of children */
62 int se_maxcpm; /* max connects per IP per minute */
63 int se_numchild; /* current number of children */
64 pid_t *se_pids; /* array of child pids */
65 char *se_user; /* user name to run as */
66 char *se_group; /* group name to run as */
67#ifdef LOGIN_CAP
68 char *se_class; /* login class name to run with */
69#endif
70 struct biltin *se_bi; /* if built-in, description */
71 char *se_server; /* server program */
72 char *se_server_name; /* server program without path */
73#define MAXARGV 20
74 char *se_argv[MAXARGV+1]; /* program arguments */
75#ifdef IPSEC
76 char *se_policy; /* IPsec poilcy string */
77#endif
73 int se_fd; /* open descriptor */
78 int se_fd; /* open descriptor */
74 struct sockaddr_in se_ctrladdr;/* bound address */
79 union { /* bound address */
80 struct sockaddr se_un_ctrladdr;
81 struct sockaddr_in se_un_ctrladdr4;
82 struct sockaddr_in6 se_un_ctrladdr6;
83 } se_un;
84#define se_ctrladdr se_un.se_un_ctrladdr
85#define se_ctrladdr4 se_un.se_un_ctrladdr4
86#define se_ctrladdr6 se_un.se_un_ctrladdr6
87 int se_ctrladdr_size;
75 u_char se_type; /* type: normal, mux, or mux+ */
76 u_char se_checked; /* looked at during merge */
77 u_char se_accept; /* i.e., wait/nowait mode */
78 u_char se_rpc; /* ==1 if RPC service */
79 int se_rpc_prog; /* RPC program number */
80 u_int se_rpc_lowvers; /* RPC low version */
81 u_int se_rpc_highvers; /* RPC high version */
82 int se_count; /* number started since se_time */
83 struct timeval se_time; /* start of se_count */
84 struct servtab *se_next;
88 u_char se_type; /* type: normal, mux, or mux+ */
89 u_char se_checked; /* looked at during merge */
90 u_char se_accept; /* i.e., wait/nowait mode */
91 u_char se_rpc; /* ==1 if RPC service */
92 int se_rpc_prog; /* RPC program number */
93 u_int se_rpc_lowvers; /* RPC low version */
94 u_int se_rpc_highvers; /* RPC high version */
95 int se_count; /* number started since se_time */
96 struct timeval se_time; /* start of se_count */
97 struct servtab *se_next;
98 struct se_flags {
99 u_int se_nomapped : 1;
100 u_int se_ctladdrinitok : 1;
101 u_int se_reset : 1;
102 } se_flags;
85};
86
103};
104
105#define se_nomapped se_flags.se_nomapped
106#define se_ctladdrinitok se_flags.se_ctladdrinitok
107#define se_reset se_flags.se_reset
108
87void chargen_dg __P((int, struct servtab *));
88void chargen_stream __P((int, struct servtab *));
89void close_sep __P((struct servtab *));
90void flag_signal __P((char));
91void flag_config __P((int));
92void config __P((void));
93void daytime_dg __P((int, struct servtab *));
94void daytime_stream __P((int, struct servtab *));

--- 17 unchanged lines hidden (view full) ---

112void flag_reapchild __P((int));
113void reapchild __P((void));
114void enable __P((struct servtab *));
115void disable __P((struct servtab *));
116void flag_retry __P((int));
117void retry __P((void));
118int setconfig __P((void));
119void setup __P((struct servtab *));
109void chargen_dg __P((int, struct servtab *));
110void chargen_stream __P((int, struct servtab *));
111void close_sep __P((struct servtab *));
112void flag_signal __P((char));
113void flag_config __P((int));
114void config __P((void));
115void daytime_dg __P((int, struct servtab *));
116void daytime_stream __P((int, struct servtab *));

--- 17 unchanged lines hidden (view full) ---

134void flag_reapchild __P((int));
135void reapchild __P((void));
136void enable __P((struct servtab *));
137void disable __P((struct servtab *));
138void flag_retry __P((int));
139void retry __P((void));
140int setconfig __P((void));
141void setup __P((struct servtab *));
142#ifdef IPSEC
143void ipsecsetup __P((struct servtab *));
144#endif
120char *sskip __P((char **));
121char *skip __P((char **));
122struct servtab *tcpmux __P((int));
123int cpmip __P((struct servtab *, int));
124void inetd_setproctitle __P((char *, int));
125
126void unregisterrpc __P((register struct servtab *sep));
127
128struct biltin {
129 char *bi_service; /* internally provided service name */
130 int bi_socktype; /* type of socket supported */
131 short bi_fork; /* 1 if should fork before call */
132 int bi_maxchild; /* max number of children, -1=default */
133 void (*bi_fn)(); /* function which performs it */
134};
145char *sskip __P((char **));
146char *skip __P((char **));
147struct servtab *tcpmux __P((int));
148int cpmip __P((struct servtab *, int));
149void inetd_setproctitle __P((char *, int));
150
151void unregisterrpc __P((register struct servtab *sep));
152
153struct biltin {
154 char *bi_service; /* internally provided service name */
155 int bi_socktype; /* type of socket supported */
156 short bi_fork; /* 1 if should fork before call */
157 int bi_maxchild; /* max number of children, -1=default */
158 void (*bi_fn)(); /* function which performs it */
159};