netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
server_child.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 1997 Adrian Sun ([email protected])
3 * All rights reserved.
4 */
5
6#ifndef _ATALK_SERVER_CHILD_H
7#define _ATALK_SERVER_CHILD_H 1
8
9#include <arpa/inet.h>
10#include <pthread.h>
11#include <sys/types.h>
12
13/* useful stuff for child processes. most of this is hidden in
14 * server_child.c to ease changes in implementation */
15
16#define CHILD_HASHSIZE 32
17
18/* One AFP session child process */
19typedef struct afp_child {
20 /* afpd worker process pid (from the worker afpd process )*/
21 pid_t afpch_pid;
22 /* user id of connected client (from the worker afpd process) */
23 uid_t afpch_uid;
24 /* 1 if we have a clientid */
26 /* 1 if we already tried to kill the client */
28 /* client boot time (from the mac client) */
30 /* time the child was added */
32 /* clientid len (from the Mac client) */
33 uint32_t afpch_idlen;
34 /* clientid (from the Mac client) */
36 /* socket for IPC bw afpd parent and childs */
38 /* state of AFP session (eg active, sleeping, disconnected) */
39 int16_t afpch_state;
40 /* mounted volumes */
45
46/* Info and table with all AFP session child processes */
47typedef struct {
48 /* Lock */
49 pthread_mutex_t servch_lock;
50 /* Current count of active AFP sessions */
52 /* Number of allowed AFP sessions */
54 /* Hashtable with data of AFP sesssions */
57
58/* server_child.c */
60extern afp_child_t *server_child_add(server_child_t *, pid_t, int ipc_fd);
61extern int server_child_remove(server_child_t *, pid_t);
64extern void server_child_kill(server_child_t *, int);
66 uid_t, uint32_t len, char *id,
67 uint32_t boottime);
69 uid_t, int, uint16_t);
71extern void server_child_login_done(server_child_t *children, pid_t pid,
72 uid_t);
73extern void server_reset_signal(void);
74
75#endif
static server_child_t * childs
Definition afpstats.c:39
static server_child_t * children
Definition asp_getsess.c:43
void server_child_kill_one_by_id(server_child_t *children, pid_t pid, uid_t, uint32_t len, char *id, uint32_t boottime)
Definition server_child.c:296
void server_reset_signal(void)
Definition server_child.c:382
int server_child_transfer_session(server_child_t *children, pid_t, uid_t, int, uint16_t)
Definition server_child.c:240
int server_child_remove(server_child_t *, pid_t)
Definition server_child.c:142
void server_child_free(server_child_t *)
Definition server_child.c:174
#define CHILD_HASHSIZE
Definition server_child.h:16
void server_child_login_done(server_child_t *children, pid_t pid, uid_t)
Definition server_child.c:352
void server_child_handler(server_child_t *)
afp_child_t * server_child_add(server_child_t *, pid_t, int ipc_fd)
Definition server_child.c:109
void server_child_kill(server_child_t *, int)
Definition server_child.c:203
server_child_t * server_child_alloc(int)
Definition server_child.c:92
afp_child_t * server_child_resolve(server_child_t *childs, id_t pid)
Definition server_child.c:77
struct afp_child afp_child_t
Definition server_child.h:19
struct afp_child * afpch_next
Definition server_child.h:43
time_t afpch_logintime
Definition server_child.h:31
pid_t afpch_pid
Definition server_child.h:21
int afpch_killed
Definition server_child.h:27
struct afp_child ** afpch_prevp
Definition server_child.h:42
char * afpch_clientid
Definition server_child.h:35
uint32_t afpch_idlen
Definition server_child.h:33
int afpch_ipc_fd
Definition server_child.h:37
char * afpch_volumes
Definition server_child.h:41
int afpch_valid
Definition server_child.h:25
uint32_t afpch_boottime
Definition server_child.h:29
int16_t afpch_state
Definition server_child.h:39
uid_t afpch_uid
Definition server_child.h:23
Definition server_child.h:47
int servch_count
Definition server_child.h:51
int servch_nsessions
Definition server_child.h:53
afp_child_t * servch_table[CHILD_HASHSIZE]
Definition server_child.h:55
pthread_mutex_t servch_lock
Definition server_child.h:49