2016-01-18 12:04:31 +01:00
|
|
|
/*
|
|
|
|
* vrrp_ctrl.h - control fifo header
|
|
|
|
*
|
|
|
|
* Copyright (C) 2016 Arnaud Andre
|
|
|
|
*
|
|
|
|
* This file is part of uvrrpd.
|
|
|
|
*
|
|
|
|
* uvrrpd 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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* uvrrpd 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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with uvrrpd. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _VRRP_CTRL_H_
|
|
|
|
#define _VRRP_CTRL_H_
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
/* from vrrp.h */
|
|
|
|
struct vrrp;
|
2016-01-18 12:13:19 +01:00
|
|
|
struct vrrp_net;
|
2016-01-18 12:04:31 +01:00
|
|
|
typedef enum _vrrp_event_type vrrp_event_t;
|
|
|
|
|
|
|
|
#define CTRL_MAXCHAR 64
|
2016-01-18 12:13:19 +01:00
|
|
|
#define CTRL_CMD_NTOKEN 3
|
2016-01-18 12:04:31 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* vrrp_ctrl - infos about control fifo
|
|
|
|
*/
|
|
|
|
struct vrrp_ctrl {
|
|
|
|
/* control fifo fd */
|
|
|
|
int fd;
|
|
|
|
|
|
|
|
/* control fifo msg */
|
|
|
|
char msg[CTRL_MAXCHAR];
|
|
|
|
|
|
|
|
/* reformated command */
|
|
|
|
char **cmd;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int vrrp_ctrl_init(struct vrrp_ctrl *ctrl);
|
|
|
|
void vrrp_ctrl_cleanup(struct vrrp_ctrl *ctrl);
|
2016-01-18 12:13:19 +01:00
|
|
|
vrrp_event_t vrrp_ctrl_read(struct vrrp *vrrp, struct vrrp_net *vnet);
|
2016-01-18 12:04:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* _VRRP_CTRL_H_ */
|