netatalk 4.5.0
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 <stddef.h>
11#include <sys/types.h>
12
19
20#define CHILD_HASHSIZE 32
21
22/* The other afpch_state values are the DSI_* flags from dsi.h */
23#define ASP_RUNNING (1 << 10)
24
25/* One AFP session child process */
26 typedef struct afp_child {
27 pid_t afpch_pid;
28 uid_t afpch_uid;
29 int afpch_valid;
30 int afpch_killed;
31 uint32_t afpch_boottime;
32 time_t afpch_logintime;
33 uint32_t afpch_idlen;
34 char *afpch_clientid;
35 size_t afpch_sessiontoken_len;
36 char *afpch_sessiontoken;
37 int afpch_ipc_fd;
38 int afpch_hint_fd;
39 char *afpch_hostname;
40 int16_t afpch_state;
41 char *afpch_volumes;
42 struct afp_child **afpch_prevp;
43 struct afp_child *afpch_next;
44} afp_child_t;
45
46/* Info and table with all AFP session child processes */
47 typedef struct {
48 int servch_count;
49 int servch_nsessions;
50 afp_child_t *servch_table[CHILD_HASHSIZE];
52} server_child_t;
53
54/* server_child.c */
55 extern server_child_t *server_child_alloc(int);
56 extern afp_child_t *server_child_add(server_child_t *, pid_t, int ipc_fd,
57 int hint_fd);
58 extern int server_child_remove(server_child_t *, pid_t);
59 extern void server_child_free(server_child_t *);
60 extern afp_child_t *server_child_resolve(server_child_t *childs, id_t pid);
61 extern void server_child_kill(server_child_t *, int);
62 extern void server_child_kill_one_by_id(server_child_t *children, pid_t pid,
63 uid_t, uint32_t len, char *id,
64 uint32_t boottime);
65 extern int server_child_set_session_token(server_child_t *children, pid_t pid,
66 uid_t uid, const void *token, size_t token_len);
67 extern int server_child_transfer_session(server_child_t *children, uid_t uid,
68 const void *token, size_t token_len, int afp_socket,
69 uint16_t DSI_requestID);
70 extern void server_child_handler(server_child_t *);
71 extern void server_child_login_done(server_child_t *children, pid_t pid,
72 uid_t, const char *client_address);
73 extern void server_reset_signal(void);
74
75#endif
client_address
static const char * client_address(AFPObj *obj)
Definition afpd/auth.c:86
childs
static server_child_t * childs
Definition afpstats.c:41
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:406
server_reset_signal
void server_reset_signal(void)
Definition server_child.c:493
server_child_remove
int server_child_remove(server_child_t *, pid_t)
Definition server_child.c:157
server_child_free
void server_child_free(server_child_t *)
free everything
Definition server_child.c:207
server_child_transfer_session
int server_child_transfer_session(server_child_t *children, uid_t uid, const void *token, size_t token_len, int afp_socket, uint16_t DSI_requestID)
Try to find an old session and pass socket.
Definition server_child.c:341
CHILD_HASHSIZE
#define CHILD_HASHSIZE
Definition server_child.h:20
server_child_add
afp_child_t * server_child_add(server_child_t *, pid_t, int ipc_fd, int hint_fd)
add a child
Definition server_child.c:116
server_child_handler
void server_child_handler(server_child_t *)
server_child_kill
void server_child_kill(server_child_t *, int)
Definition server_child.c:250
server_child_alloc
server_child_t * server_child_alloc(int)
Definition server_child.c:100
server_child_login_done
void server_child_login_done(server_child_t *children, pid_t pid, uid_t, const char *client_address)
Definition server_child.c:458
server_child_resolve
afp_child_t * server_child_resolve(server_child_t *childs, id_t pid)
Definition server_child.c:85
afp_child_t
struct afp_child afp_child_t
server_child_set_session_token
int server_child_set_session_token(server_child_t *children, pid_t pid, uid_t uid, const void *token, size_t token_len)
Store an opaque reconnect token for a child session.
Definition server_child.c:287
pid
pid_t pid
Definition server_ipc.c:93
afp_child
Definition server_child.h:26
afp_child::afpch_next
struct afp_child * afpch_next
Definition server_child.h:43
afp_child::afpch_logintime
time_t afpch_logintime
Definition server_child.h:32
afp_child::afpch_pid
pid_t afpch_pid
Definition server_child.h:27
afp_child::afpch_killed
int afpch_killed
Definition server_child.h:30
afp_child::afpch_prevp
struct afp_child ** afpch_prevp
Definition server_child.h:42
afp_child::afpch_clientid
char * afpch_clientid
Definition server_child.h:34
afp_child::afpch_sessiontoken
char * afpch_sessiontoken
Definition server_child.h:36
afp_child::afpch_sessiontoken_len
size_t afpch_sessiontoken_len
Definition server_child.h:35
afp_child::afpch_idlen
uint32_t afpch_idlen
Definition server_child.h:33
afp_child::afpch_ipc_fd
int afpch_ipc_fd
Definition server_child.h:37
afp_child::afpch_volumes
char * afpch_volumes
Definition server_child.h:41
afp_child::afpch_hostname
char * afpch_hostname
Definition server_child.h:39
afp_child::afpch_valid
int afpch_valid
Definition server_child.h:29
afp_child::afpch_hint_fd
int afpch_hint_fd
Definition server_child.h:38
afp_child::afpch_boottime
uint32_t afpch_boottime
Definition server_child.h:31
afp_child::afpch_state
int16_t afpch_state
Definition server_child.h:40
afp_child::afpch_uid
uid_t afpch_uid
Definition server_child.h:28
server_child_t
Definition server_child.h:47
server_child_t::servch_count
int servch_count
Definition server_child.h:48
server_child_t::servch_nsessions
int servch_nsessions
Definition server_child.h:49
server_child_t::servch_table
afp_child_t * servch_table[CHILD_HASHSIZE]
Definition server_child.h:50