vrrpd (1.0-2) vrrpd.h

Summary

 vrrpd.h |   62 +++++++++++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 45 insertions(+), 17 deletions(-)

    
download this patch

Patch contents

--- vrrpd-1.0.orig/vrrpd.h
+++ vrrpd-1.0/vrrpd.h
@@ -1,27 +1,46 @@
-/*==========================[ (c) GURU SOFT ]===================================
-FILE        : [vrrp.h]
-CREATED     : 00/02/02 12:12:06		LAST SAVE    : 00/10/04 21:59:46
-WHO         : jerome@mycpu Linux 2.2.14
-REMARK      :
-================================================================================
-- This program is free software; you can redistribute it and/or
-  modify it under the terms of the GNU General Public License
-  as published by the Free Software Foundation; either version
-  2 of the License, or (at your option) any later version.
-==============================================================================*/
+/*
+ * Soft:        Vrrpd is an implementation of VRRPv2 as specified in rfc2338.
+ *              VRRP is a protocol which elect a master server on a LAN. If the
+ *              master fails, a backup server takes over.
+ *              The original implementation has been made by jerome etienne.
+ *
+ * Version:     $Id: vrrpd.h,v 0.7 2002/02/04 12:00:00 dhunter Exp $
+ *
+ * Author:      Jerome Etienne, <jetienne@arobas.net>
+ *
+ * Contributor: Alexandre Cassen, <acassen@linux-vs.org>
+ *
+ * Changes:
+ *              David Hunter : 2002/02/04 :
+ *               <+> Added orig_prio & delt_prio in vrrp_rt.
+ *              Alexandre Cassen : 2001/05/23 :
+ *               <+> Added IPSEC AH sequence number counter in vrrp_rt.
+ *
+ *              This program is distributed in the hope that it will be useful, 
+ *              but WITHOUT ANY WARRANTY; without even the implied warranty of 
+ *              MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ *              See the GNU General Public License for more details.
+ *
+ *              This program is free software; you can redistribute it and/or
+ *              modify it under the terms of the GNU General Public License
+ *              as published by the Free Software Foundation; either version
+ *              2 of the License, or (at your option) any later version.
+ */
 
 #ifndef __VRRP_H__
 #define __VRRP_H__
 
 /* system include */
 #include <stdint.h>
-
-#define VRRPD_VERSION	"0.4"
-/* Scott added 9-4-02 */
 #include <syslog.h>
 #define vrrpd_log syslog
 
+#define VRRPD_VERSION	"1.0"
+
 /* local include */
+#include "iproute.h"
+#include "ipaddr.h"
+#include "ipsecah.h"
 
 typedef struct {	/* rfc2338.5.1 */
 	uint8_t		vers_type;	/* 0-3=type, 4-7=version */
@@ -53,6 +72,7 @@
 /* implementation specific */
 #define VRRP_PIDDIR_DFL	"/var/run"		/* dir to store the pid file */
 #define VRRP_PID_FORMAT	"vrrpd_%s_%d.pid"	/* pid file format */
+#define VRIDNAME_MAX 20				/* name for logging */
 
 typedef struct {	/* parameters per interface -- rfc2338.6.1.1 */
 	int		auth_type;	/* authentification type. VRRP_AUTH_* */
@@ -61,6 +81,7 @@
 	uint32_t	ipaddr;		/* the address of the interface */
 	char		hwaddr[6];	/* WORK: lame hardcoded for ethernet !!!! */
 	char		*ifname;	/* the device name for this ipaddr */
+	struct		rt_entry *rt;  /* device routing table */
 } vrrp_if;
 
 typedef struct {
@@ -94,9 +115,19 @@
 	uint32_t	ms_down_timer;
 	uint32_t	adver_timer;
 
+	/* IPSEC AH counter def --rfc2402.3.3.2 */
+	seq_counter ipsecah_counter;
+
+	/* interface parameters */
 	vrrp_if	vif;
+
+	/* Monitored Interface values */
+	int     orig_prio;
+	int     delt_prio;
 } vrrp_rt;
 
+#define VRRP_DELTA_DFL 50      /* Default priority delta */
+
 /* VRRP state machine -- rfc2338.6.4 */
 #define VRRP_STATE_INIT	1	/* rfc2338.6.4.1 */
 #define VRRP_STATE_BACK	2	/* rfc2338.6.4.2 */
@@ -110,8 +141,6 @@
 #define VRRP_IS_BAD_PRIORITY(p) ((p)<1 || (p)>255)	/* rfc2338.6.1.prio */
 #define VRRP_IS_BAD_ADVERT_INT(d) ((d)<1)
 
-
-
 /* use the 'tcp sequence number arithmetic' to handle the wraparound.
 ** VRRP_TIMER_SUB: <0 if t1 precedes t2, =0 if t1 equals t2, >0 if t1 follows t2
 */
@@ -129,7 +158,6 @@
         return tv.tv_sec*VRRP_TIMER_HZ+tv.tv_usec;
 }
               
-
 #define VRRP_TIMER_SKEW( srv ) ((256-(srv)->priority)*VRRP_TIMER_HZ/256) 
 
 #define VRRP_MIN( a , b )	( (a) < (b) ? (a) : (b) )