netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
server_child.h File Reference

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

## Detailed Description

data structures and utility functions for child processes

most of the implementation is in libatalk/util/server_child.c

## Macro Definition Documentation

## ◆ ASP_RUNNING

#define ASP_RUNNING (1 << 10)

## ◆ 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,
|  | int | hint_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,
|  | const char * | client_address )
| 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_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

reset children signals