#include <errno.h>#include <pthread.h>#include <signal.h>#include <stdlib.h>#include <string.h>#include <sys/time.h>#include <sys/types.h>#include <sys/wait.h>#include <unistd.h>#include <atalk/errchk.h>#include <atalk/logger.h>#include <atalk/server_child.h>#include <atalk/util.h>Macros | |
| #define | WEXITSTATUS(stat_val) |
| #define | WIFEXITED(stat_val) |
| #define | WIFSTOPPED(status) |
| #define | WIFSIGNALED(status) |
| #define | WTERMSIG(status) |
| #define | HASH(i) |
Functions | |
| static void | hash_child (afp_child_t **htable, afp_child_t *child) |
| static void | unhash_child (afp_child_t *child) |
| afp_child_t * | server_child_resolve (server_child_t *childs, id_t pid) |
| server_child_t * | server_child_alloc (int connections) |
| afp_child_t * | server_child_add (server_child_t *children, pid_t pid, int ipc_fd) |
| add a child | |
| int | server_child_remove (server_child_t *children, pid_t pid) |
| void | server_child_free (server_child_t *children) |
| free everything | |
| void | server_child_kill (server_child_t *children, int sig) |
| static int | kill_child (afp_child_t *child) |
| int | server_child_transfer_session (server_child_t *children, pid_t pid, uid_t uid, int afp_socket, uint16_t DSI_requestID) |
| Try to find an old session and pass socket. | |
| 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 | |
| void | server_child_login_done (server_child_t *children, pid_t pid, uid_t uid) |
| void | server_reset_signal (void) |
| #define HASH | ( | i | ) |
| #define WEXITSTATUS | ( | stat_val | ) |
| #define WIFEXITED | ( | stat_val | ) |
| #define WIFSIGNALED | ( | status | ) |
|
inlinestatic |
|
static |
send kill to a child processes
| afp_child_t * server_child_add | ( | server_child_t * | children, |
| pid_t | pid, | ||
| int | ipc_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_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 ) |
| 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_transfer_session | ( | server_child_t * | children, |
| pid_t | pid, | ||
| uid_t | uid, | ||
| int | afp_socket, | ||
| uint16_t | DSI_requestID ) |
Try to find an old session and pass socket.
| void server_reset_signal | ( | void | ) |
reset children signals
|
inlinestatic |