aboutsummaryrefslogtreecommitdiff
path: root/src/pies.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-11-26 21:49:15 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-11-26 21:49:15 +0200
commit9de9182e3517c677e2309b0dd58ab4e3af1b3176 (patch)
treea8d2f33ee720591be9212b9cc6a33a5b018f60bd /src/pies.h
parentc0802ebe4ebd7e7bb173c6efa2c6e59dd5440cc3 (diff)
downloadpies-9de9182e3517c677e2309b0dd58ab4e3af1b3176.tar.gz
pies-9de9182e3517c677e2309b0dd58ab4e3af1b3176.tar.bz2
Implement internal inetd services in the pies config.
* src/pies.h (CF_INTERNAL): New flag. (ISCF_TCPMUX): New macro. (struct component): Reorder fields. New field: tcpmux. (progman_lookup_service): Remove proto. (progman_lookup_tcpmux): New proto. (struct inetd_builtin.foo): Change signature. All uses updated. * src/progman.c (progman_lookup_service): Remove. (progman_lookup_tcpmux): New function. (progman_create_sockets): Skip tcpmux subservices. (progman_start): Skip disabled inetd components. * src/inetd-bi.c (tcpmux): Use progman_lookup_tcpmux. * src/inetd.c (tcpmux_service, mktag): New functions. (inetd_conf_file): Minor changes. * src/pies.c (_cb_bitmask, _cb_precious) (_cb_disabled, _cb_wait): Remove. (str_to_cf, _cb_flags): New functions. (component_keywords): Remove keywords: disable, precious, wait. Add keywords: flags, service, tcpmux-master. (component_verify): Improve. * src/url.c (pies_url_destroy): Fix coredump on NULL argument.
Diffstat (limited to 'src/pies.h')
-rw-r--r--src/pies.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/pies.h b/src/pies.h
index 9ec1410..4d2f774 100644
--- a/src/pies.h
+++ b/src/pies.h
@@ -142,6 +142,9 @@ enum pies_comp_mode
#define CF_WAIT 0x04
#define CF_TCPMUX 0x08
#define CF_TCPMUXPLUS 0x10
+#define CF_INTERNAL 0x20
+
+#define ISCF_TCPMUX(f) ((f) & (CF_TCPMUX | CF_TCPMUXPLUS))
struct component
{
@@ -156,23 +159,26 @@ struct component
gl_list_t depend; /* Dependency targets */
int flags; /* CF_ bitmask */
size_t max_instances; /* Maximum number of simultaneously running
- instances (inetd) */
- size_t max_rate; /* Maximum number of invocations per minute
- (inetd) */
- int socket_type; /* Socket type */
- struct inetd_builtin *builtin; /* Builtin function (inetd) */
- char *service;
+ instances */
char *rmfile; /* Try to remove this file before starting */
struct pies_privs privs; /* UID/GIDS+groups to run under */
mode_t umask; /* Umask to install before starting */
limits_record_t limits; /* System limits */
+
+ /* For inetd components */
+ size_t max_rate; /* Maximum number of invocations per minute */
+ int socket_type; /* Socket type */
+ struct inetd_builtin *builtin; /* Builtin function */
+ char *service;
+
struct pies_url *socket_url; /* Socket to listen on
(if mode != pies_comp_exec) */
- char *pass_fd_socket; /* Socket to pass fd on
- (if mode == pies_comp_pass_fd) */
+ char *pass_fd_socket; /* Socket to pass fd on
+ (if mode == pies_comp_pass_fd) */
unsigned pass_fd_timeout; /* Maximum time to wait for pass_fd socket to
become available. */
pies_acl_t acl;
+ char *tcpmux; /* Master service for TCPMUX */
/* Redirectors: */
int facility; /* Syslog facility. */
struct redirector redir[2]; /* Repeaters for stdout and stderr */
@@ -208,7 +214,9 @@ int progman_accept (int socket);
int progman_build_depmap (void);
void progman_create_sockets (void);
struct component *progman_lookup_component (const char *tag);
-struct component *progman_lookup_service (const char *service);
+struct component *progman_lookup_tcpmux (const char *service,
+ const char *master);
+
void progman_run_comp (struct component *comp, int fd);
void progman_iterate_comp (int (*fun) (struct component *, void *),
@@ -353,7 +361,7 @@ struct inetd_builtin
int socktype;
int single_process;
int flags;
- void (*fun) (int);
+ void (*fun) (int, struct component const *);
};
struct inetd_builtin *inetd_builtin_lookup (const char *service, int socktype);

Return to:

Send suggestions and report system problems to the System administrator.