C.16. The VRRP Daemon—Sample Main Routine

 #include <stdio.h> #include <assert.h> #include <net/ethernet.h> #include <netinet/ip.h> #include <stdlib.h> #include <unistd.h> #include <signal.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/time.h> #include <netinet/in.h> #include <arpa/inet.h> #include <time.h> #include <sys/errno.h> #include <net/if.h> #include <net/if_arp.h> #include <net/ethernet.h> #include <sys/ioctl.h> #include <ctype.h> #include <string.h> /* local include */ #include "vrrpd.h" #include "ipaddr.h" int ip_id = 0; static char vrrp_hwaddr[6]; /* hardcoded for Ethernet */ static vrrp_rt glob_vsrv; /* a global - used in the signal handler*/ static char PidDir[FILENAME_MAX+1]; /********************************************************* ...

Get VRRP: Increasing Reliability and Failover with the Virtual Router Redundance Protocol now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.