2 * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
6 #ifndef _ATALK_SERVER_CHILD_H
7 #define _ATALK_SERVER_CHILD_H 1
10 #include <arpa/inet.h>
12 /* useful stuff for child processes. most of this is hidden in
13 * server_child.c to ease changes in implementation */
15 #define CHILD_NFORKS 2
16 #define CHILD_ASPFORK 0
17 #define CHILD_PAPFORK 0
18 #define CHILD_DSIFORK 1
20 typedef struct server_child {
22 int count, nsessions, nforks;
25 typedef struct server_child_data {
26 pid_t pid; /* afpd worker process pid (from the worker afpd process )*/
27 uid_t uid; /* user id of connected client (from the worker afpd process) */
28 int valid; /* 1 if we have a clientid */
29 uint32_t time; /* client boot time (from the mac client) */
30 int killed; /* 1 if we already tried to kill the client */
31 uint32_t idlen; /* clientid len (from the Mac client) */
32 char *clientid; /* clientid (from the Mac client) */
33 int ipc_fds[2]; /* socketpair for IPC bw */
34 struct server_child_data **prevp, *next;
37 extern int parent_or_child;
40 extern server_child *server_child_alloc (const int, const int);
41 extern afp_child_t *server_child_add (server_child *, int, pid_t, uint ipc_fds[2]);
42 extern int server_child_remove (server_child *, const int, const pid_t);
43 extern void server_child_free (server_child *);
45 extern void server_child_kill (server_child *, const int, const int);
46 extern void server_child_kill_one_by_id (server_child *children, const int forkid, const pid_t pid, const uid_t,
47 const u_int32_t len, char *id, u_int32_t boottime);
48 extern int server_child_transfer_session(server_child *children, int forkid, pid_t, uid_t, int, uint16_t);
49 extern void server_child_setup (server_child *, const int, void (*)(const pid_t));
50 extern void server_child_handler (server_child *);
51 extern void server_reset_signal (void);