netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
netatalk.c File Reference
#include <errno.h>
#include <poll.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/uio.h>
#include <sys/wait.h>
#include <bstrlib.h>
#include <event2/event.h>
#include <atalk/adouble.h>
#include <atalk/afp.h>
#include <atalk/compat.h>
#include <atalk/dsi.h>
#include <atalk/errchk.h>
#include <atalk/globals.h>
#include <atalk/iniparser_util.h>
#include <atalk/logger.h>
#include <atalk/netatalk_conf.h>
#include <atalk/server_child.h>
#include <atalk/server_ipc.h>
#include <atalk/util.h>
#include "afp_zeroconf.h"

Macros

#define KILL_GRACETIME   5
#define NETATALK_SRV_NEEDED   -1
#define NETATALK_SRV_OPTIONAL   0
#define NETATALK_SRV_ERROR   NETATALK_SRV_NEEDED
#define MYARVSIZE   64

Functions

static pid_t run_process (const char *path,...)
static void kill_childs (int sig,...)
static bool service_running (pid_t pid)
static void libevent_logmsg_cb (int severity, const char *msg)
static void sigterm_cb (evutil_socket_t fd _U_, short what _U_, void *arg _U_)
static void sigquit_cb (evutil_socket_t fd _U_, short what _U_, void *arg _U_)
static void sighup_cb (evutil_socket_t fd _U_, short what _U_, void *arg _U_)
static void sigchld_cb (evutil_socket_t fd _U_, short what _U_, void *arg _U_)
static void timer_cb (evutil_socket_t fd _U_, short what _U_, void *arg _U_)
static void netatalk_exit (int ret)
static void show_netatalk_version (void)
static void show_netatalk_paths (void)
static void usage (void)
int main (int argc, char **argv)

Variables

static AFPObj obj
static pid_t afpd_pid = NETATALK_SRV_NEEDED
static pid_t cnid_metad_pid = NETATALK_SRV_OPTIONAL
static pid_t dbus_pid = NETATALK_SRV_OPTIONAL
static uint afpd_restarts
static uint cnid_metad_restarts
static uint dbus_restarts _U_
static struct event_base * base
struct event * sigterm_ev
struct event * sigquit_ev
struct event * sigchld_ev
struct event * sighup_ev
struct event * timer_ev
static int in_shutdown

Macro Definition Documentation

◆ KILL_GRACETIME

#define KILL_GRACETIME   5

◆ MYARVSIZE

#define MYARVSIZE   64

◆ NETATALK_SRV_ERROR

#define NETATALK_SRV_ERROR   NETATALK_SRV_NEEDED

◆ NETATALK_SRV_NEEDED

#define NETATALK_SRV_NEEDED   -1

◆ NETATALK_SRV_OPTIONAL

#define NETATALK_SRV_OPTIONAL   0

Function Documentation

◆ kill_childs()

void kill_childs ( int sig,
... )
static

◆ libevent_logmsg_cb()

void libevent_logmsg_cb ( int severity,
const char * msg )
static

◆ main()

int main ( int argc ,
char ** argv )

◆ netatalk_exit()

void netatalk_exit ( int ret)
static

◆ run_process()

pid_t run_process ( const char * path,
... )
static

◆ service_running()

bool service_running ( pid_t pid)
static

◆ show_netatalk_paths()

void show_netatalk_paths ( void )
static

◆ show_netatalk_version()

void show_netatalk_version ( void )
static

◆ sigchld_cb()

void sigchld_cb ( evutil_socket_t fd _U_,
short what _U_,
void *arg _U_ )
static

◆ sighup_cb()

void sighup_cb ( evutil_socket_t fd _U_,
short what _U_,
void *arg _U_ )
static

◆ sigquit_cb()

void sigquit_cb ( evutil_socket_t fd _U_,
short what _U_,
void *arg _U_ )
static

◆ sigterm_cb()

void sigterm_cb ( evutil_socket_t fd _U_,
short what _U_,
void *arg _U_ )
static

◆ timer_cb()

void timer_cb ( evutil_socket_t fd _U_,
short what _U_,
void *arg _U_ )
static

◆ usage()

void usage ( void )
static

Variable Documentation

◆ _U_

const char *dbus_path _U_
static

◆ afpd_pid

pid_t afpd_pid = NETATALK_SRV_NEEDED
static

◆ afpd_restarts

uint afpd_restarts
static

◆ base

struct event_base* base
static

◆ cnid_metad_pid

pid_t cnid_metad_pid = NETATALK_SRV_OPTIONAL
static

◆ cnid_metad_restarts

uint cnid_metad_restarts
static

◆ dbus_pid

pid_t dbus_pid = NETATALK_SRV_OPTIONAL
static

◆ in_shutdown

int in_shutdown
static

◆ obj

AFPObj obj
static

◆ sigchld_ev

struct event * sigchld_ev

◆ sighup_ev

struct event * sighup_ev

◆ sigquit_ev

struct event * sigquit_ev

◆ sigterm_ev

struct event* sigterm_ev

◆ timer_ev

struct event * timer_ev