$darkmode
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.
Data Structures | |
| struct | afp_child |
| struct | server_child_t |
Macros | |
| #define | CHILD_HASHSIZE 32 |
| #define | ASP_RUNNING (1 << 10) |
Typedefs | |
| typedef struct afp_child | afp_child_t |
Functions | |
| 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 More... | |
| int | server_child_remove (server_child_t *, pid_t) |
| void | server_child_free (server_child_t *) |
| free everything More... | |
| 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 More... | |
| 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. More... | |
| 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. More... | |
| 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
| #define ASP_RUNNING (1 << 10) |
| #define CHILD_HASHSIZE 32 |
| typedef struct afp_child afp_child_t |
| afp_child_t * server_child_add | ( | server_child_t * | children, |
| pid_t | pid, | ||
| int | ipc_fd, | ||
| int | hint_fd | ||
| ) |
add a child
| server_child_t * server_child_alloc | ( | int | connections | ) |
initialize server_child structure
| void server_child_free | ( | server_child_t * | children | ) |
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
| void server_child_handler | ( | server_child_t * | ) |
| void server_child_kill | ( | server_child_t * | children, |
| int | sig | ||
| ) |
send signal to all child processes
| 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 | ||
| ) |
see if there is a process for the same mac
if the times don't match mac has been rebooted
| void server_child_login_done | ( | server_child_t * | children, |
| pid_t | pid, | ||
| uid_t | uid, | ||
| const char * | client_address | ||
| ) |
| int server_child_remove | ( | server_child_t * | children, |
| pid_t | pid | ||
| ) |
remove a child and free it
| afp_child_t * server_child_resolve | ( | server_child_t * | childs, |
| id_t | pid | ||
| ) |
| 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_reset_signal | ( | void | ) |
reset children signals