#include <sys/types.h>#include <sys/param.h>#include <sys/socket.h>#include <sys/time.h>#include <sys/uio.h>#include <netatalk/at.h>#include <atalk/aep.h>#include <atalk/ddp.h>#include <atalk/atp.h>#include <atalk/zip.h>#include <signal.h>#include <stdio.h>#include <stdint.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <netdb.h>#include <errno.h>#include <netinet/in_systm.h>#include <netinet/in.h>#include <netinet/ip.h>#include <netinet/ip_icmp.h>#include "atp_input.h"#include "nbp_lkup_async.h"#include "common.h"#include "macip.h"#include "util.h"Data Structures | |
| struct | macip_req_control |
| struct | macip_req_data |
| struct | macip_req |
| struct | ipent |
| struct | macip_data |
| struct | zones |
Macros | |
| #define | DDPTYPE_MACIP (22) |
| #define | MACIP_ASSIGN (1) |
| #define | MACIP_SERVER (3) |
| #define | MACIP_PORT (72) |
| #define | MACIP_MAXMTU (586) |
| #define | MACIP_NODETYPE "IPADDRESS" |
| #define | MACIP_GATETYPE "IPGATEWAY" |
| #define | MACIP_ATPRETRIES (5) |
| #define | MACIP_ATPWAIT (5) |
| #define | MACIP_NBPRETRIES (5) |
| #define | MACIP_NBPWAIT (5) |
| #define | ARPTIMEOUT (30) |
| #define | ARPRETRIES (10) |
| #define | ASSIGN_FREE (0) |
| #define | ASSIGN_LEASED (1) |
| #define | ASSIGN_FIXED (2) |
| #define | IPADDR(e) |
| #define | MAXZONES 256 |
Functions | |
| static uint16_t | cksum (char *buffer, int len) |
| static void | icmp_echo (uint32_t src, uint32_t dst) |
| static long | now (void) |
| struct ipent * | get_ipent (uint32_t ip) |
| static uint32_t | lease_ip () |
| static int | arp_lookup (struct sockaddr_at *sat, uint32_t ip) |
| static void | arp_set (uint32_t ip, struct sockaddr_at *sat) |
| static void | arp_input (struct sockaddr_at *sat, char *buffer, int len) |
| static void | ip_input (struct sockaddr_at *sat, char *buffer, int len) |
| void | macip_output (char *buffer, int len) |
| static void | config_input (ATP atp, struct sockaddr_at *faddr, char *packet, int len) |
| void | macip_input (void) |
| static int | init_ip (uint32_t net, uint32_t mask, uint32_t nameserver) |
| static void | add_zones (short n, char *buf) |
| static int | get_zones (void) |
| void | macip_idle (void) |
| int | macip_open (char *zone, uint32_t net, uint32_t mask, uint32_t ns, outputfunc_t o) |
| void | macip_close (void) |
Variables | |
| static struct macip_data | gMacip |
| static struct zones | gZones |
| static outputfunc_t | gOutput |
| #define ARPRETRIES (10) |
| #define ARPTIMEOUT (30) |
| #define ASSIGN_FIXED (2) |
| #define ASSIGN_FREE (0) |
| #define ASSIGN_LEASED (1) |
| #define DDPTYPE_MACIP (22) |
| #define IPADDR | ( | e | ) |
| #define MACIP_ASSIGN (1) |
| #define MACIP_ATPRETRIES (5) |
| #define MACIP_ATPWAIT (5) |
| #define MACIP_GATETYPE "IPGATEWAY" |
| #define MACIP_MAXMTU (586) |
| #define MACIP_NBPRETRIES (5) |
| #define MACIP_NBPWAIT (5) |
| #define MACIP_NODETYPE "IPADDRESS" |
| #define MACIP_PORT (72) |
| #define MACIP_SERVER (3) |
| #define MAXZONES 256 |
|
static |
|
static |
handle name lookup replies, add to arp table
|
static |
find AT address for an IP address
|
static |
Set AT address from received packet
|
static |
|
static |
handle configuration ATP request
| struct ipent * get_ipent | ( | uint32_t | ip | ) |
|
static |
|
static |
|
static |
|
static |
handle incoming IP packet
|
static |
aquire a new ip address from the pool
| void macip_close | ( | void | ) |
| void macip_idle | ( | void | ) |
time out old arp entries
| void macip_input | ( | void | ) |
Handle incoming AT packet
| int macip_open | ( | char * | zone, |
| uint32_t | net, | ||
| uint32_t | mask, | ||
| uint32_t | ns, | ||
| outputfunc_t | o ) |
| void macip_output | ( | char * | buffer, |
| int | len ) |
send IP packet through AT
|
static |
|
static |
|
static |
|
static |