netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
asp_getsess.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <errno.h>`
`#include <signal.h>`
`#include <unistd.h>`
`#include <sys/types.h>`
`#include <sys/time.h>`
`#include <sys/uio.h>`
`#include <sys/socket.h>`
`#include <sys/param.h>`
`#include <sys/wait.h>`
`#include <netatalk/at.h>`
`#include <atalk/logger.h>`
`#include <atalk/compat.h>`
`#include <atalk/atp.h>`
`#include <atalk/asp.h>`
`#include <atalk/server_child.h>`
`#include <atalk/util.h>`
`#include "asp_child.h"`

## Macros
#define | WEXITSTATUS(stat_val)
#define | WIFEXITED(stat_val)

## Functions
static void | tickle_handler (int sig)
| send tickles and check tickle status of connections
void | asp_kill (int sig)
void | asp_stop_tickle (void)
static void | set_asp_ac (int sid, struct asp_child *tmp)
ASP | asp_getsession (ASP asp, server_child_t *server_children, const int tickleval, afp_child_t **childp)
| This call handles open, tickle, and getstatus requests.

## Variables
static ASP | server_asp
static server_child_t * | children = NULL
static struct asp_child ** | asp_ac = NULL

## Macro Definition Documentation

## ◆ WEXITSTATUS

#define WEXITSTATUS | ( |  | stat_val | ) |

Value:
((unsigned)(stat_val) >> 8)

## ◆ WIFEXITED

#define WIFEXITED | ( |  | stat_val | ) |

Value:
(((stat_val) & 255) == 0)

## Function Documentation

## ◆ asp_getsession()

ASP asp_getsession | ( | ASP | asp,
|  | server_child_t * | server_children,
|  | const int | tickleval,
|  | afp_child_t ** | childp )

This call handles open, tickle, and getstatus requests.

Note
  On a successful open, it forks a child process.

Returns
  an ASP to the child and parent and NULL if there is an error.

## ◆ asp_kill()

void asp_kill | ( | int | sig | ) |

kill children

## ◆ asp_stop_tickle()

void asp_stop_tickle | ( | void |  | ) |

## ◆ set_asp_ac()

void set_asp_ac | ( | int | sid,
|  | struct asp_child * | tmp )
| static

## ◆ tickle_handler()

void tickle_handler | ( | int | sig | ) |
| static

send tickles and check tickle status of connections

thoughts on using a hashed list:

- + child_cleanup, finding slots
- - tickle_handler, freeing, tickles

if setup for a large number of connections:

- + space: if actual connections < potential
- - space: actual connections ~ potential

## Variable Documentation

## ◆ asp_ac

struct asp_child** asp_ac = NULL
| static

## ◆ children

server_child_t* children = NULL
| static

## ◆ server_asp

ASP server_asp
| static