~ubuntu-branches/ubuntu/trusty/keepalived/trusty

« back to all changes in this revision

Viewing changes to keepalived/include/vrrp.h

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Wirt
  • Date: 2005-04-29 23:22:40 UTC
  • mfrom: (1.1.1 upstream) (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050429232240-a8m3jtpi3cvuyyy2
Tags: 1.1.11-3
Added a warning about sarge kernels to README.Debian and 
the package description 

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 *
7
7
 * Part:        vrrp.c program include file.
8
8
 *
9
 
 * Version:     $Id: vrrp.h,v 1.1.7 2004/04/04 23:28:05 acassen Exp $
 
9
 * Version:     $Id: vrrp.h,v 1.1.11 2005/03/01 01:22:13 acassen Exp $
10
10
 *
11
11
 * Author:      Alexandre Cassen, <acassen@linux-vs.org>
12
12
 *
20
20
 *              as published by the Free Software Foundation; either version
21
21
 *              2 of the License, or (at your option) any later version.
22
22
 *
23
 
 * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
 
23
 * Copyright (C) 2001-2005 Alexandre Cassen, <acassen@linux-vs.org>
24
24
 */
25
25
 
26
26
#ifndef _VRRP_H
65
65
#define VRRP_AUTH_PASS  1       /* password authentification -- rfc2338.5.3.6 */
66
66
#define VRRP_AUTH_AH    2       /* AH(IPSec) authentification - rfc2338.5.3.6 */
67
67
#define VRRP_ADVER_DFL  1       /* advert. interval (in sec) -- rfc2338.5.3.7 */
68
 
#define VRRP_PREEMPT_DFL 1      /* rfc2338.6.1.2.Preempt_Mode */
69
68
#define VRRP_GARP_DELAY (5 * TIMER_HZ)  /* Default delay to launch gratuitous arp */
70
69
 
71
70
/*
75
74
typedef struct _vrrp_sgroup {
76
75
        char *gname;            /* Group name */
77
76
        vector iname;           /* Set of VRRP instances in this group */
78
 
        list index;             /* List of VRRP instances */
 
77
        list index_list;        /* List of VRRP instances */
79
78
        int state;              /* current stable state */
80
79
 
81
80
        /* State transition notification */
92
91
        char *iname;            /* Instance Name */
93
92
        vrrp_sgroup *sync;      /* Sync group we belong to */
94
93
        interface *ifp;         /* Interface we belong to */
 
94
        int dont_track_primary; /* If set ignores ifp faults */
95
95
        list track_ifp;         /* Interface state we monitor */
96
96
        uint32_t mcast_saddr;   /* Src IP address to use in VRRP IP header */
97
97
        char *lvs_syncd_if;     /* handle LVS sync daemon state using this
109
109
                                 */
110
110
        list vroutes;           /* list of virtual routes */
111
111
        int adver_int;          /* delay between advertisements(in sec) */
112
 
        int preempt;            /* true if a higher prio preempt a lower one */
 
112
        int nopreempt;          /* true if higher prio does not preempt lower */
 
113
        long preempt_delay;     /* Seconds*TIMER_HZ after startup until
 
114
                                 * preemption based on higher prio over lower
 
115
                                 * prio is allowed.  0 means no delay.
 
116
                                 */
 
117
        TIMEVAL preempt_time;   /* Time after which preemption can happen */
113
118
        int state;              /* internal state (init/backup/master) */
114
119
        int init_state;         /* the initial state of the instance */
115
120
        int wantstate;          /* user explicitly wants a state (back/mast) */
182
187
#define VRRP_IS_BAD_PRIORITY(p)         ((p)<1 || (p)>255)      /* rfc2338.6.1.prio */
183
188
#define VRRP_IS_BAD_ADVERT_INT(d)       ((d)<1)
184
189
#define VRRP_IS_BAD_DEBUG_INT(d)        ((d)<0 || (d)>4)
 
190
#define VRRP_IS_BAD_PREEMPT_DELAY(d)    ((d)<0 || (d)>TIMER_MAX_SEC)
185
191
#define VRRP_SEND_BUFFER(V)             ((V)->send_buffer)
186
192
#define VRRP_SEND_BUFFER_SIZE(V)        ((V)->send_buffer_size)
187
193
 
193
199
 
194
200
#define VRRP_PKT_SADDR(V) (((V)->mcast_saddr) ? (V)->mcast_saddr : IF_ADDR((V)->ifp))
195
201
 
196
 
#define VRRP_ISUP(V)    (IF_ISUP((V)->ifp) & \
 
202
#define VRRP_ISUP(V)   ((IF_ISUP((V)->ifp) || (V)->dont_track_primary) & \
197
203
                        ((!LIST_ISEMPTY((V)->track_ifp)) ? TRACK_ISUP((V)->track_ifp) : 1))
198
204
 
199
205
/* prototypes */
200
 
extern int open_vrrp_send_socket(const int proto, const int index);
201
 
extern int open_vrrp_socket(const int proto, const int index);
 
206
extern int open_vrrp_send_socket(const int proto, const int idx);
 
207
extern int open_vrrp_socket(const int proto, const int idx);
202
208
extern int new_vrrp_socket(vrrp_rt * vrrp);
203
209
extern void close_vrrp_socket(vrrp_rt * vrrp);
204
210
extern void vrrp_send_gratuitous_arp(vrrp_rt * vrrp);
213
219
extern int vrrp_complete_init(void);
214
220
extern void shutdown_vrrp_instances(void);
215
221
extern void clear_diff_vrrp(void);
 
222
extern void vrrp_restore_interface(vrrp_rt * vrrp, int advF);
216
223
 
217
224
#endif