]> arthur.barton.de Git - netatalk.git/blobdiff - include/atalk/server_child.h
First try for a volume defaults config
[netatalk.git] / include / atalk / server_child.h
index aeee9439bc33469ad77f140f759b5910e8dc38b3..262ee201795d6c1e9e3a285394b8c4c98a6d9fab 100644 (file)
@@ -6,9 +6,8 @@
 #ifndef _ATALK_SERVER_CHILD_H
 #define _ATALK_SERVER_CHILD_H 1
 
-#include <sys/cdefs.h>
 #include <sys/types.h>
-#include <netatalk/endian.h>
+#include <arpa/inet.h>
 
 /* useful stuff for child processes. most of this is hidden in 
  * server_child.c to ease changes in implementation */
@@ -23,19 +22,31 @@ typedef struct server_child {
   int count, nsessions, nforks;
 } server_child;
 
+typedef struct server_child_data {
+  pid_t     pid;               /* afpd worker process pid (from the worker afpd process )*/
+  uid_t     uid;               /* user id of connected client (from the worker afpd process) */
+  int       valid;             /* 1 if we have a clientid */
+  int       killed;            /* 1 if we already tried to kill the client */
+  int       disasociated; /* 1 if this is not a child, but a child from a previous afpd master */
+  uint32_t  time;              /* client boot time (from the mac client) */
+  uint32_t  idlen;             /* clientid len (from the Mac client) */
+  char      *clientid;  /* clientid (from the Mac client) */
+  int       ipc_fds[2]; /* socketpair for IPC bw */
+  struct server_child_data **prevp, *next;
+} afp_child_t;
+
 /* server_child.c */
-extern server_child *server_child_alloc __P((const int, const int));
-extern int server_child_add __P((server_child *, const int, const pid_t));
-extern int server_child_remove __P((server_child *, const int, const pid_t));
-extern void server_child_free __P((server_child *));
-
-extern void server_child_kill __P((server_child *, const int, const int));
-extern void server_child_kill_one __P((server_child *children, const int forkid, const pid_t, const uid_t));
-extern void server_child_kill_one_by_id __P((server_child *children, const int forkid, const pid_t pid, const uid_t,
-                                               const u_int32_t len, char *id, u_int32_t boottime));
-
-extern void server_child_setup __P((server_child *, const int, void (*)()));
-extern void server_child_handler __P((server_child *));
-extern void server_reset_signal __P((void));
+extern server_child *server_child_alloc (const int, const int);
+extern afp_child_t *server_child_add (server_child *, int, pid_t, uint ipc_fds[2]);
+extern int  server_child_remove (server_child *, const int, const pid_t);
+extern void server_child_free (server_child *);
+
+extern void server_child_kill (server_child *, const int, const int);
+extern void server_child_kill_one_by_id (server_child *children, const int forkid, const pid_t pid, const uid_t,
+                                               const uint32_t len, char *id, uint32_t boottime);
+extern int  server_child_transfer_session(server_child *children, int forkid, pid_t, uid_t, int, uint16_t);
+extern void server_child_setup (server_child *, const int, void (*)(const pid_t));
+extern void server_child_handler (server_child *);
+extern void server_reset_signal (void);
 
 #endif