data structures and utility functions for child processes
More...
#include <arpa/inet.h>
#include <stddef.h>
#include <sys/types.h>
Go to the source code of this file.
|
| server_child_t * | server_child_alloc (int) |
| |
| afp_child_t * | server_child_add (server_child_t *, pid_t, int ipc_fd, int hint_fd) |
| | add a child
|
| |
| int | server_child_remove (server_child_t *, pid_t) |
| |
| void | server_child_free (server_child_t *) |
| | free everything
|
| |
| afp_child_t * | server_child_resolve (server_child_t *childs, id_t pid) |
| |
| void | server_child_kill (server_child_t *, int) |
| |
| 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
|
| |
| 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.
|
| |
| 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.
|
| |
| void | server_child_handler (server_child_t *) |
| |
| void | server_child_login_done (server_child_t *children, pid_t pid, uid_t, const char *client_address) |
| |
| void | server_reset_signal (void) |
| |
data structures and utility functions for child processes
most of the implementation is in libatalk/util/server_child.c
◆ ASP_RUNNING
| #define ASP_RUNNING (1 << 10) |
◆ CHILD_HASHSIZE
| #define CHILD_HASHSIZE 32 |
◆ afp_child_t
◆ server_child_add()
add a child
- Returns
- pointer to struct server_child_data on success, NULL on error
◆ server_child_alloc()
initialize server_child structure
◆ server_child_free()
free everything
by using a hash table, this increases the cost of this part over a linked list by the size of the hash table
◆ server_child_handler()
◆ server_child_kill()
send signal to all child processes
◆ server_child_kill_one_by_id()
| void server_child_kill_one_by_id |
( |
server_child_t * |
children, |
|
|
pid_t |
pid, |
|
|
uid_t |
uid, |
|
|
uint32_t |
idlen, |
|
|
char * |
id, |
|
|
uint32_t |
boottime |
|
) |
| |
|
extern |
see if there is a process for the same mac
if the times don't match mac has been rebooted
◆ server_child_login_done()
| void server_child_login_done |
( |
server_child_t * |
children, |
|
|
pid_t |
pid, |
|
|
uid_t |
uid, |
|
|
const char * |
client_address |
|
) |
| |
|
extern |
◆ server_child_remove()
remove a child and free it
◆ server_child_resolve()
◆ 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 |
|
) |
| |
|
extern |
Store an opaque reconnect token for a child session.
- Returns
- 0 on success, -1 on error
◆ 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 |
|
) |
| |
|
extern |
Try to find an old session and pass socket.
- Returns
- -1 on error, 0 if no matching session was found, 1 if session was found and socket passed
◆ server_reset_signal()
| void server_reset_signal |
( |
void |
| ) |
|
|
extern |