8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / libvrrpadm / common / netinet / vrrp.h
blob30cb8eeee5930e9ca2316481d9cb2019e7a73edf
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _VRRP_H
28 #define _VRRP_H
30 #include <stdint.h>
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 typedef struct vrrp_pkt_s {
37 uint8_t vp_vers_type;
38 uint8_t vp_vrid;
39 uint8_t vp_prio;
40 uint8_t vp_ipnum;
41 uint16_t vp_rsvd_adver_int;
42 uint16_t vp_chksum;
43 /* then follows <vp_ipnum> IPvX addresses */
44 /* then follows NO authentification data */
45 } vrrp_pkt_t;
47 #define IPPROTO_VRRP 112 /* IP protocol number */
48 #define VRRP_AUTH_LEN 0 /* XXX length of a chunk of Auth Data */
50 #define VRRP_IP_TTL 255 /* IPv4 TTL, IPv6 hop limit */
51 #define VRRP_VERSION 3 /* current version */
52 #define VRRP_PKT_ADVERT 1 /* packet type */
53 #define VRRP_VER_MASK 0xf0 /* version mask */
54 #define VRRP_TYPE_MASK 0x0f /* packet type mask */
56 #define VRRP_PRI_OWNER 255 /* priority of IP address owner */
57 #define VRRP_PRI_MIN 1 /* minimum priority */
58 #define VRRP_PRIO_ZERO 0 /* stop participating VRRP */
59 #define VRRP_PRI_DEFAULT VRRP_PRI_OWNER /* default priority */
61 #define VRRP_VRID_NONE 0
62 #define VRRP_VRID_MIN 1
63 #define VRRP_VRID_MAX 255
65 #define CENTISEC2MSEC(centisec) ((centisec) * 10)
66 #define MSEC2CENTISEC(msec) ((msec) / 10)
68 /* Max advertisement interval, in msec */
69 #define VRRP_MAX_ADVER_INT_MIN CENTISEC2MSEC(1)
70 #define VRRP_MAX_ADVER_INT_MAX CENTISEC2MSEC(4095) /* (2^12 -1) */
71 #define VRRP_MAX_ADVER_INT_DFLT CENTISEC2MSEC(100) /* 1 sec */
73 #ifdef __cplusplus
75 #endif
77 #endif /* _VRRP_H */