netatalk 4.4.3
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
server_child.h File Reference
`#include <arpa/inet.h>`
`#include <pthread.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

## 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)
| 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_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.
void | server_child_set_token (server_child_t *children, pid_t pid, const char *token, uint32_t tokenlen)
void | server_child_handler (server_child_t *)
void | server_child_login_done (server_child_t *children, pid_t pid, uid_t)
void | server_reset_signal (void)

## Detailed Description

useful stuff for child processes. most of this is hidden in server_child.c to ease changes in implementation

## Macro Definition Documentation

## ◆ CHILD_HASHSIZE

#define CHILD_HASHSIZE 32

## Typedef Documentation

## ◆ afp_child_t

typedef struct afp_child afp_child_t

## Function Documentation

## ◆ server_child_add()

afp_child_t * server_child_add | ( | server_child_t * | children,
|  | pid_t | pid,
|  | int | ipc_fd )
| extern

add a child

Returns
  pointer to struct server_child_data on success, NULL on error

## ◆ server_child_alloc()

server_child_t * server_child_alloc | ( | int | connections | ) |
| extern

initialize server_child structure

## ◆ server_child_free()

void server_child_free | ( | server_child_t * | children | ) |
| extern

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()

void server_child_handler | ( | server_child_t * |  | ) |
| extern

## ◆ server_child_kill()

void server_child_kill | ( | server_child_t * | children,
|  | int | sig )
| extern

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 )
| extern

## ◆ server_child_remove()

int server_child_remove | ( | server_child_t * | children,
|  | pid_t | pid )
| extern

remove a child and free it

## ◆ server_child_resolve()

afp_child_t * server_child_resolve | ( | server_child_t * | childs,
|  | id_t | pid )
| extern

## ◆ server_child_set_token()

void server_child_set_token | ( | server_child_t * | children,
|  | pid_t | pid,
|  | const char * | token,
|  | uint32_t | tokenlen )
| extern

## ◆ server_child_transfer_session()

int server_child_transfer_session | ( | server_child_t * | children,
|  | const char * | token,
|  | uint32_t | tokenlen,
|  | uid_t | uid,
|  | int | afp_socket,
|  | uint16_t | DSI_requestID )
| extern

Try to find an old session by token 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

reset children signals