#ifndef _NDPD_DEFS_H
#define _NDPD_DEFS_H
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <errno.h>
#include <sys/types.h>
#include <fcntl.h>
#include <signal.h>
#include <poll.h>
#include <unistd.h>
#include <time.h>
#include <stdarg.h>
#include <syslog.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/ioctl.h>
#include <sys/sockio.h>
#include <net/if.h>
#include <sys/stropts.h>
#include <string.h>
#include <ctype.h>
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netinet/if_ether.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
#include <net/route.h>
#include <libipadm.h>
#include <ipadm_ndpd.h>
#include "tables.h"
#ifdef __cplusplus
extern "C" {
#endif
#define CURHOP_UNSPECIFIED 0
#define PATH_NDPD_CONF "/etc/inet/ndpd.conf"
extern int debug, no_loopback;
extern struct in6_addr all_nodes_mcast;
extern struct in6_addr all_routers_mcast;
extern int rtsock;
extern struct rt_msghdr *rt_msg;
extern struct sockaddr_in6 *rta_gateway;
extern struct sockaddr_dl *rta_ifp;
#define D_ALL 0xffff
#define D_DEFAULTS 0x0001
#define D_CONFIG 0x0002
#define D_PHYINT 0x0004
#define D_PREFIX 0x0008
#define D_ROUTER 0x0010
#define D_STATE 0x0020
#define D_IFSCAN 0x0040
#define D_TIMER 0x0080
#define D_PARSE 0x0100
#define D_PKTIN 0x0200
#define D_PKTBAD 0x0400
#define D_PKTOUT 0x0800
#define D_TMP 0x1000
#define D_DHCP 0x2000
#define IF_SEPARATOR ':'
#define IPV6_MAX_HOPS 255
#define IPV6_MIN_MTU (1024+256)
#define IPV6_ABITS 128
#define TMP_TOKEN_BITS 64
#define TMP_TOKEN_BYTES (TMP_TOKEN_BITS / 8)
#define MAX_DAD_FAILURES 5
#define GET_RANDOM(LOW, HIGH) (random() % ((HIGH) - (LOW) + 1) + (LOW))
#define TIMER_INFINITY 0xFFFFFFFFU
#define PREFIX_INFINITY 0XFFFFFFFFU
#define MIN_VALID_LIFETIME (2*60*60)
#define MIN_REACH_RANDOM_INTERVAL (60*1000)
#define MAX_REACH_RANDOM_INTERVAL (60*60*1000)
#define MAXLINELEN 4096
#define MAXARGSPERLINE 128
void timer_schedule(uint_t delay);
extern void logmsg(int level, const char *fmt, ...);
extern void logperror(const char *str);
extern void logperror_pi(const struct phyint *pi, const char *str);
extern void logperror_pr(const struct prefix *pr, const char *str);
extern int parse_config(char *config_file, boolean_t file_required);
extern int poll_add(int fd);
extern int poll_remove(int fd);
extern char *fmt_lla(char *llabuf, int bufsize, uchar_t *lla, int llalen);
extern int do_dad(char *ifname, struct sockaddr_in6 *testaddr);
#ifdef __cplusplus
}
#endif
#endif