Blame keepalived/include/vrrp_snmp.h

Packit c22fc9
/*
Packit c22fc9
 * Soft:        Vrrpd is an implementation of VRRPv2 as specified in rfc2338.
Packit c22fc9
 *              VRRP is a protocol which elect a master server on a LAN. If the
Packit c22fc9
 *              master fails, a backup server takes over.
Packit c22fc9
 *              The original implementation has been made by jerome etienne.
Packit c22fc9
 *
Packit c22fc9
 * Part:        vrrp_snmp.c program include file.
Packit c22fc9
 *
Packit c22fc9
 * Author:      Vincent Bernat <bernat@luffy.cx>
Packit c22fc9
 *
Packit c22fc9
 *              This program is distributed in the hope that it will be useful,
Packit c22fc9
 *              but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit c22fc9
 *              MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Packit c22fc9
 *              See the GNU General Public License for more details.
Packit c22fc9
 *
Packit c22fc9
 *              This program is free software; you can redistribute it and/or
Packit c22fc9
 *              modify it under the terms of the GNU General Public License
Packit c22fc9
 *              as published by the Free Software Foundation; either version
Packit c22fc9
 *              2 of the License, or (at your option) any later version.
Packit c22fc9
 *
Packit c22fc9
 * Copyright (C) 2001-2017 Alexandre Cassen, <acassen@gmail.com>
Packit c22fc9
 */
Packit c22fc9
Packit c22fc9
#ifndef _VRRP_SNMP_H
Packit c22fc9
#define _VRRP_SNMP_H
Packit c22fc9
Packit c22fc9
#include "config.h"
Packit c22fc9
Packit c22fc9
#ifdef _WITH_SNMP_RFC_
Packit c22fc9
#include "timer.h"
Packit c22fc9
#endif
Packit c22fc9
#include "vrrp.h"
Packit c22fc9
Packit c22fc9
#ifdef _WITH_SNMP_RFCV2_
Packit c22fc9
enum rfcv2_trap_auth_error_type {
Packit c22fc9
	invalidAuthType = 1,
Packit c22fc9
#ifdef _WITH_VRRP_AUTH_
Packit c22fc9
	authTypeMismatch,
Packit c22fc9
	authFailure
Packit c22fc9
#endif
Packit c22fc9
};
Packit c22fc9
#endif
Packit c22fc9
Packit c22fc9
#ifdef _WITH_SNMP_RFCV3_
Packit c22fc9
enum rfcv3_notify_proto_error_type {
Packit c22fc9
	noError = 0,
Packit c22fc9
	ipTtlError,
Packit c22fc9
	versionError,
Packit c22fc9
	checksumError,
Packit c22fc9
	vrIdError
Packit c22fc9
};
Packit c22fc9
Packit c22fc9
/* RFC6527 isn't clear about the meaning of the following. However,
Packit c22fc9
 * the only meaning I can see is that PRIORITY means became master
Packit c22fc9
 * after receiving a priority 0 advert, preempted means that we were
Packit c22fc9
 * receiving lower priority adverts or we are the address owner, and
Packit c22fc9
 * so transitioned to master, and MASTER_NO_RESPONSE means that we
Packit c22fc9
 * didn't receive any adverts for 3 * master advert interval + skew time.
Packit c22fc9
 * However, it is possible the PRIORITY is meant to mean priority 255
Packit c22fc9
 * (i.e. the address owner), in which case we don't have a specific
Packit c22fc9
 * reason for transition following receiving a priority 0 advert. */
Packit c22fc9
enum rfcv3_master_reason_type {
Packit c22fc9
	VRRPV3_MASTER_REASON_NOT_MASTER = 0,
Packit c22fc9
	VRRPV3_MASTER_REASON_PRIORITY,
Packit c22fc9
	VRRPV3_MASTER_REASON_PREEMPTED,
Packit c22fc9
	VRRPV3_MASTER_REASON_MASTER_NO_RESPONSE
Packit c22fc9
};
Packit c22fc9
#endif
Packit c22fc9
Packit c22fc9
#ifdef _WITH_SNMP_RFC_
Packit c22fc9
/* Global vars */
Packit Service dfccb1
extern timeval_t snmp_vrrp_start_time;
Packit c22fc9
#endif
Packit c22fc9
Packit c22fc9
/* Prototypes */
Packit c22fc9
extern void vrrp_snmp_agent_init(const char *);
Packit c22fc9
extern void vrrp_snmp_agent_close(void);
Packit c22fc9
Packit c22fc9
#ifdef _WITH_SNMP_VRRP_
Packit c22fc9
extern void vrrp_snmp_instance_trap(vrrp_t *);
Packit c22fc9
extern void vrrp_snmp_group_trap(vrrp_sgroup_t *);
Packit c22fc9
#endif
Packit c22fc9
Packit c22fc9
#ifdef _WITH_SNMP_RFCV2_
Packit c22fc9
extern void vrrp_rfcv2_snmp_new_master_trap(vrrp_t *);
Packit c22fc9
extern void vrrp_rfcv2_snmp_auth_err_trap(vrrp_t *, struct in_addr, enum rfcv2_trap_auth_error_type);
Packit c22fc9
#endif
Packit c22fc9
#ifdef _WITH_SNMP_RFCV3_
Packit c22fc9
extern void vrrp_rfcv3_snmp_new_master_notify(vrrp_t *);
Packit c22fc9
extern void vrrp_rfcv3_snmp_proto_err_notify(vrrp_t *);
Packit c22fc9
#endif
Packit c22fc9
Packit c22fc9
#endif