netatalk 4.4.3
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 (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 <arpa/inet.h>
10#include <pthread.h>
11#include <sys/types.h>
12
18
19#define CHILD_HASHSIZE 32
20
21/* One AFP session child process */
22 typedef struct afp_child {
23 pid_t afpch_pid;
24 uid_t afpch_uid;
25 int afpch_valid;
26 int afpch_killed;
27 uint32_t afpch_boottime;
28 time_t afpch_logintime;
29 uint32_t afpch_idlen;
30 char *afpch_clientid;
31 int afpch_ipc_fd;
32 int16_t afpch_state;
33 char *afpch_volumes;
34 char *afpch_sessiontoken;
35 uint32_t afpch_sessiontoken_len;
36 struct afp_child **afpch_prevp;
37 struct afp_child *afpch_next;
38} afp_child_t;
39
40/* Info and table with all AFP session child processes */
41 typedef struct {
42 pthread_mutex_t servch_lock;
43 int servch_count;
44 int servch_nsessions;
45 afp_child_t *servch_table[CHILD_HASHSIZE];
47} server_child_t;
48
49/* server_child.c */
50 extern server_child_t *server_child_alloc(int);
51 extern afp_child_t *server_child_add(server_child_t *, pid_t, int ipc_fd);
52 extern int server_child_remove(server_child_t *, pid_t);
53 extern void server_child_free(server_child_t *);
54 extern afp_child_t *server_child_resolve(server_child_t *childs, id_t pid);
55 extern void server_child_kill(server_child_t *, int);
56 extern void server_child_kill_one_by_id(server_child_t *children, pid_t pid,
57 uid_t, uint32_t len, char *id,
58 uint32_t boottime);
59 extern int server_child_transfer_session(server_child_t *children,
60 const char *token, uint32_t tokenlen, uid_t, int, uint16_t);
61 extern void server_child_set_token(server_child_t *children, pid_t pid,
62 const char *token, uint32_t tokenlen);
63 extern void server_child_handler(server_child_t *);
64 extern void server_child_login_done(server_child_t *children, pid_t pid,
65 uid_t);
66 extern void server_reset_signal(void);
67
68#endif
childs
static server_child_t * childs
Definition afpstats.c:39
children
static server_child_t * children
Definition asp_getsess.c:43
server_child_kill_one_by_id
void server_child_kill_one_by_id(server_child_t *children, pid_t pid, uid_t, uint32_t len, char *id, uint32_t boottime)
see if there is a process for the same mac
Definition server_child.c:349
server_reset_signal
void server_reset_signal(void)
Definition server_child.c:434
server_child_remove
int server_child_remove(server_child_t *, pid_t)
Definition server_child.c:142
server_child_free
void server_child_free(server_child_t *)
free everything
Definition server_child.c:183
server_child_set_token
void server_child_set_token(server_child_t *children, pid_t pid, const char *token, uint32_t tokenlen)
Definition server_child.c:313
server_child_transfer_session
int server_child_transfer_session(server_child_t *children, const char *token, uint32_t tokenlen, uid_t, int, uint16_t)
Try to find an old session by token and pass socket.
Definition server_child.c:253
CHILD_HASHSIZE
#define CHILD_HASHSIZE
Definition server_child.h:19
server_child_login_done
void server_child_login_done(server_child_t *children, pid_t pid, uid_t)
Definition server_child.c:404
server_child_handler
void server_child_handler(server_child_t *)
server_child_add
afp_child_t * server_child_add(server_child_t *, pid_t, int ipc_fd)
add a child
Definition server_child.c:109
server_child_kill
void server_child_kill(server_child_t *, int)
Definition server_child.c:216
server_child_alloc
server_child_t * server_child_alloc(int)
Definition server_child.c:92
server_child_resolve
afp_child_t * server_child_resolve(server_child_t *childs, id_t pid)
Definition server_child.c:77
afp_child_t
struct afp_child afp_child_t
afp_child
Definition server_child.h:22
afp_child::afpch_next
struct afp_child * afpch_next
Definition server_child.h:37
afp_child::afpch_logintime
time_t afpch_logintime
Definition server_child.h:28
afp_child::afpch_pid
pid_t afpch_pid
Definition server_child.h:23
afp_child::afpch_killed
int afpch_killed
Definition server_child.h:26
afp_child::afpch_prevp
struct afp_child ** afpch_prevp
Definition server_child.h:36
afp_child::afpch_clientid
char * afpch_clientid
Definition server_child.h:30
afp_child::afpch_sessiontoken
char * afpch_sessiontoken
Definition server_child.h:34
afp_child::afpch_idlen
uint32_t afpch_idlen
Definition server_child.h:29
afp_child::afpch_ipc_fd
int afpch_ipc_fd
Definition server_child.h:31
afp_child::afpch_volumes
char * afpch_volumes
Definition server_child.h:33
afp_child::afpch_valid
int afpch_valid
Definition server_child.h:25
afp_child::afpch_sessiontoken_len
uint32_t afpch_sessiontoken_len
Definition server_child.h:35
afp_child::afpch_boottime
uint32_t afpch_boottime
Definition server_child.h:27
afp_child::afpch_state
int16_t afpch_state
Definition server_child.h:32
afp_child::afpch_uid
uid_t afpch_uid
Definition server_child.h:24
server_child_t
Definition server_child.h:41
server_child_t::servch_count
int servch_count
Definition server_child.h:43
server_child_t::servch_nsessions
int servch_nsessions
Definition server_child.h:44
server_child_t::servch_table
afp_child_t * servch_table[CHILD_HASHSIZE]
Definition server_child.h:45
server_child_t::servch_lock
pthread_mutex_t servch_lock
Definition server_child.h:42