2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A#ifndef _VRRP_H
2N/A#define _VRRP_H
2N/A
2N/A#include <stdint.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/Atypedef struct vrrp_pkt_s {
2N/A uint8_t vp_vers_type;
2N/A uint8_t vp_vrid;
2N/A uint8_t vp_prio;
2N/A uint8_t vp_ipnum;
2N/A uint16_t vp_rsvd_adver_int;
2N/A uint16_t vp_chksum;
2N/A /* then follows <vp_ipnum> IPvX addresses */
2N/A /* then follows NO authentification data */
2N/A} vrrp_pkt_t;
2N/A
2N/A#define IPPROTO_VRRP 112 /* IP protocol number */
2N/A#define VRRP_AUTH_LEN 0 /* XXX length of a chunk of Auth Data */
2N/A
2N/A#define VRRP_IP_TTL 255 /* IPv4 TTL, IPv6 hop limit */
2N/A#define VRRP_VERSION 3 /* current version */
2N/A#define VRRP_PKT_ADVERT 1 /* packet type */
2N/A#define VRRP_VER_MASK 0xf0 /* version mask */
2N/A#define VRRP_TYPE_MASK 0x0f /* packet type mask */
2N/A
2N/A#define VRRP_PRI_OWNER 255 /* priority of IP address owner */
2N/A#define VRRP_PRI_MIN 1 /* minimum priority */
2N/A#define VRRP_PRIO_ZERO 0 /* stop participating VRRP */
2N/A#define VRRP_PRI_DEFAULT VRRP_PRI_OWNER /* default priority */
2N/A
2N/A#define VRRP_VRID_NONE 0
2N/A#define VRRP_VRID_MIN 1
2N/A#define VRRP_VRID_MAX 255
2N/A
2N/A#define CENTISEC2MSEC(centisec) ((centisec) * 10)
2N/A#define MSEC2CENTISEC(msec) ((msec) / 10)
2N/A
2N/A/* Max advertisement interval, in msec */
2N/A#define VRRP_MAX_ADVER_INT_MIN CENTISEC2MSEC(1)
2N/A#define VRRP_MAX_ADVER_INT_MAX CENTISEC2MSEC(4095) /* (2^12 -1) */
2N/A#define VRRP_MAX_ADVER_INT_DFLT CENTISEC2MSEC(100) /* 1 sec */
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _VRRP_H */