netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
main.c File Reference
`#include <sys/param.h>`
`#include <sys/socket.h>`
`#include <sys/file.h>`
`#include <sys/time.h>`
`#include <sys/resource.h>`
`#include <sys/ioctl.h>`
`#include <sys/types.h>`
`#include <sys/wait.h>`
`#include <errno.h>`
`#include <net/if.h>`
`#include <net/route.h>`
`#include <netinet/in.h>`
`#include <signal.h>`
`#include <atalk/logger.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <netdb.h>`
`#include <fcntl.h>`
`#include <unistd.h>`
`#include <netatalk/at.h>`
`#include <atalk/compat.h>`
`#include <atalk/zip.h>`
`#include <atalk/rtmp.h>`
`#include <atalk/nbp.h>`
`#include <atalk/ddp.h>`
`#include <atalk/atp.h>`
`#include <atalk/util.h>`
`#include "interface.h"`
`#include "gate.h"`
`#include "list.h"`
`#include "rtmp.h"`
`#include "zip.h"`
`#include "nbp.h"`
`#include "atserv.h"`
`#include "main.h"`

## Macros
#define | elements(a)
#define | PKTSZ 1024
#define | MACCHARSET "MAC_ROMAN"

## Functions
int | ifconfig (const char *iname, unsigned long cmd, struct sockaddr_at *sa)
int | aep_packet (struct atport *ap, struct sockaddr_at *from, char *data, int len)
int | readconf (char *)
int | getifconf (void)
int | writeconf (char *)
static void | consistency (void)
static void | atalkd_exit (const int i)
static ssize_t | sendto_iface (struct interface *iface, int sockfd, const void *buf, size_t len, const struct sockaddr_at *dest_addr)
static void | as_timer (int sig)
static void | as_debug (int sig)
static void | as_down (int sig)
int | main (int ac, char **av)
void | bootaddr (struct interface *iface)
void | setaddr (struct interface *iface, uint8_t phase, uint16_t net, uint8_t nodenode, uint16_t first, uint16_t last)
void | dumpconfig (struct interface *iface)

## Variables
int | rtfd
int | transition = 0
int | stabletimer
int | newrtmpdata = 0
static struct atserv | atserv []
static int | atservNATSERV = elements(atserv)
struct interface * | interfaces = NULL
struct interface * | ciface = NULL
int | debug = 0
static char * | configfile = NULL
static int | ziptimeout = 0
static int | stable = 0
static int | noparent = 0
static int | ninterfaces
static int | defphase = IFACE_PHASE2
static int | nfds = 0
static fd_set | fds
static char | Packet [PKTSZ]
static char * | version = VERSION
static char * | pidfile = PATH_ATALKD_LOCK

## Macro Definition Documentation

## ◆ elements

#define elements | ( |  | a | ) |

Value:
(sizeof(a)/sizeof((a)[0]))

## ◆ MACCHARSET

#define MACCHARSET "MAC_ROMAN"

## ◆ PKTSZ

#define PKTSZ 1024

## Function Documentation

## ◆ aep_packet()

int aep_packet | ( | struct atport * | ap,
|  | struct sockaddr_at * | from,
|  | char * | data,
|  | int | len )
| extern

## ◆ as_debug()

void as_debug | ( | int | sig | ) |
| static

## ◆ as_down()

void as_down | ( | int | sig | ) |
| static

## ◆ as_timer()

void as_timer | ( | int | sig | ) |
| static

## ◆ atalkd_exit()

void atalkd_exit | ( | const int | i | ) |
| static

## ◆ bootaddr()

void bootaddr | ( | struct interface * | iface | ) |

## ◆ consistency()

void consistency | ( | void |  | ) |
| static

## ◆ dumpconfig()

void dumpconfig | ( | struct interface * | iface | ) |

## ◆ getifconf()

int getifconf | ( | void |  | ) |

## ◆ ifconfig()

int ifconfig | ( | const char * | iname,
|  | unsigned long | cmd,
|  | struct sockaddr_at * | sa )

## ◆ main()

int main | ( | int | ac,
|  | char ** | av )

## ◆ readconf()

int readconf | ( | char * | cf | ) |

## ◆ sendto_iface()

ssize_t sendto_iface | ( | struct interface * | iface,
|  | int | sockfd,
|  | const void * | buf,
|  | size_t | len,
|  | const struct sockaddr_at * | dest_addr )
| static

## ◆ setaddr()

void setaddr | ( | struct interface * | iface,
|  | uint8_t | phase,
|  | uint16_t | net,
|  | uint8_t | node,
|  | uint16_t | first,
|  | uint16_t | last )

## ◆ writeconf()

int writeconf | ( | char * | cf | ) |

## Variable Documentation

## ◆ atserv

struct atserv atserv[]
| static

Initial value:
= {
{ "rtmp", 1, rtmp_packet },
{ "nbp", 2, nbp_packet },
{ "echo", 4, aep_packet },
{ "zip", 6, zip_packet },
}
aep_packet
int aep_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
Definition aep.c:22
nbp_packet
int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
Definition nbp.c:61
rtmp_packet
int rtmp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
Definition rtmp.c:508
zip_packet
int zip_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
Definition zip.c:85

## ◆ atservNATSERV

int atservNATSERV = elements(atserv)
| static

## ◆ ciface

struct interface * ciface = NULL

## ◆ configfile

char* configfile = NULL
| static

## ◆ debug

int debug = 0

## ◆ defphase

int defphase = IFACE_PHASE2
| static

## ◆ fds

fd_set fds
| static

## ◆ interfaces

struct interface* interfaces = NULL

## ◆ newrtmpdata

int newrtmpdata = 0

## ◆ nfds

int nfds = 0
| static

## ◆ ninterfaces

int ninterfaces
| static

## ◆ noparent

int noparent = 0
| static

## ◆ Packet

char Packet[PKTSZ]
| static

## ◆ pidfile

char* pidfile = PATH_ATALKD_LOCK
| static

## ◆ rtfd

int rtfd

## ◆ stable

int stable = 0
| static

## ◆ stabletimer

int stabletimer

## ◆ transition

int transition = 0

## ◆ version

char* version = VERSION
| static

## ◆ ziptimeout

int ziptimeout = 0
| static