]> arthur.barton.de Git - netatalk.git/blob - include/atalk/server_child.h
First try for a volume defaults config
[netatalk.git] / include / atalk / server_child.h
1 /*
2  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
3  * All rights reserved.
4  */
5
6 #ifndef _ATALK_SERVER_CHILD_H
7 #define _ATALK_SERVER_CHILD_H 1
8
9 #include <sys/types.h>
10 #include <arpa/inet.h>
11
12 /* useful stuff for child processes. most of this is hidden in 
13  * server_child.c to ease changes in implementation */
14
15 #define CHILD_NFORKS   2
16 #define CHILD_ASPFORK  0
17 #define CHILD_PAPFORK  0
18 #define CHILD_DSIFORK  1
19
20 typedef struct server_child {
21   void *fork;
22   int count, nsessions, nforks;
23 } server_child;
24
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   int       killed;             /* 1 if we already tried to kill the client */
30   int       disasociated; /* 1 if this is not a child, but a child from a previous afpd master */
31   uint32_t  time;               /* client boot time (from the mac client) */
32   uint32_t  idlen;              /* clientid len (from the Mac client) */
33   char      *clientid;  /* clientid (from the Mac client) */
34   int       ipc_fds[2]; /* socketpair for IPC bw */
35   struct server_child_data **prevp, *next;
36 } afp_child_t;
37
38 /* server_child.c */
39 extern server_child *server_child_alloc (const int, const int);
40 extern afp_child_t *server_child_add (server_child *, int, pid_t, uint ipc_fds[2]);
41 extern int  server_child_remove (server_child *, const int, const pid_t);
42 extern void server_child_free (server_child *);
43
44 extern void server_child_kill (server_child *, const int, const int);
45 extern void server_child_kill_one_by_id (server_child *children, const int forkid, const pid_t pid, const uid_t,
46                                                const uint32_t len, char *id, uint32_t boottime);
47 extern int  server_child_transfer_session(server_child *children, int forkid, pid_t, uid_t, int, uint16_t);
48 extern void server_child_setup (server_child *, const int, void (*)(const pid_t));
49 extern void server_child_handler (server_child *);
50 extern void server_reset_signal (void);
51
52 #endif