summaryrefslogtreecommitdiffabout
path: root/src/pies.h
authorSergey Poznyakoff <gray@gnu.org.ua>2015-10-29 11:09:26 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2015-10-30 08:12:05 (GMT)
commit9861a788306d5f742e633ff6a8a26a913f5e3fd1 (patch) (side-by-side diff)
tree803ba61295468becef3df24f10fade8cacf44efc /src/pies.h
parent4683f7830491d1d50c5097466d9a066cb41286c7 (diff)
downloadpies-9861a788306d5f742e633ff6a8a26a913f5e3fd1.tar.gz
pies-9861a788306d5f742e633ff6a8a26a913f5e3fd1.tar.bz2
Introduce control connection.
* src/ctl.c: New file. * src/Makefile.am (pies_SOURCES): Add ctl.c * src/pies.c: New configuration statement "control" * src/pies.h (instance, ctl_url): New externs. (register_socket): Change signature. (update_socket,ctl_open): New protos. * src/socket.c (listenset): Remove. (fdset): New static. (sockinst)<handler>: Array of three pointers: handlers for read, write, and exception, correspondingly. (find_socket_handler): Remove. (register_socket): Take three function pointers as arguments. Update corresponding elements of fdset. (update_socket): New function. (pies_pause): Handle all three I/O operations. (deregister_socket) (register_program_socket) (disable_socket,enable_socket): Reflect the changes. * src/sysvinit.c (create_fifo): Update call to register_socket.
Diffstat (limited to 'src/pies.h') (more/less context) (ignore whitespace changes)
-rw-r--r--src/pies.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/pies.h b/src/pies.h
index b627b47..a4e1a1b 100644
--- a/src/pies.h
+++ b/src/pies.h
@@ -276,6 +276,7 @@ enum pies_action {
ACTION_KBREQUEST
};
+extern char *instance;
extern char *log_tag;
extern int log_facility;
extern unsigned long shutdown_timeout;
@@ -393,9 +394,25 @@ int pies_url_create (struct pies_url **purl, const char *str);
void pies_url_destroy (struct pies_url **purl);
const char * pies_url_get_arg (struct pies_url *url, const char *argname);
+
void pies_pause (void);
-void *register_socket (int fd, int (*handler) (int, void *), void *data);
+
+enum
+ {
+ PIES_EVT_RD,
+ PIES_EVT_WR,
+ PIES_EVT_EX
+ };
+
+typedef int (*socket_handler_t) (int, void *);
+
+void *register_socket (int fd,
+ socket_handler_t rd,
+ socket_handler_t wr,
+ socket_handler_t ex,
+ void *data);
void deregister_socket (int fd);
+void update_socket (int fd, int evt, socket_handler_t f);
int register_program_socket (int socktype, int fd, void *data);
int pass_fd (const char *socket, int fd, unsigned time_out);
@@ -537,3 +554,15 @@ struct sysvinit_request {
void sysvinit_acct (int what, const char *user, const char *id, pid_t pid,
const char *line);
+
+/* ctl.c */
+struct control
+{
+ struct pies_url *url;
+ pies_acl_t acl;
+ unsigned int idle_timeout;
+};
+
+extern struct control control;
+
+void ctl_open(void);

Return to:

Send suggestions and report system problems to the System administrator.