|
Packit |
c22fc9 |
/*
|
|
Packit |
c22fc9 |
* Soft: Keepalived is a failover program for the LVS project
|
|
Packit |
c22fc9 |
* <www.linuxvirtualserver.org>. It monitor & manipulate
|
|
Packit |
c22fc9 |
* a loadbalanced server pool using multi-layer checks.
|
|
Packit |
c22fc9 |
*
|
|
Packit |
c22fc9 |
* Part: check_smtp.c include file.
|
|
Packit |
c22fc9 |
*
|
|
Packit |
c22fc9 |
* Author: Alexandre Cassen, <acassen@linux-vs.org>
|
|
Packit |
c22fc9 |
* Jeremy Rumpf, <jrumpf@heavyload.net>
|
|
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 _CHECK_SMTP_H
|
|
Packit |
c22fc9 |
#define _CHECK_SMTP_H
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
/* system includes */
|
|
Packit |
c22fc9 |
#include <sys/types.h>
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
/* local includes */
|
|
Packit |
c22fc9 |
#include "scheduler.h"
|
|
Packit |
c22fc9 |
#include "check_api.h"
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
#define SMTP_BUFF_MAX 512U
|
|
Packit |
c22fc9 |
|
|
Packit Service |
dfccb1 |
typedef enum {
|
|
Packit Service |
dfccb1 |
SMTP_START,
|
|
Packit Service |
dfccb1 |
SMTP_HAVE_BANNER,
|
|
Packit Service |
dfccb1 |
SMTP_SENT_HELO,
|
|
Packit Service |
dfccb1 |
SMTP_RECV_HELO,
|
|
Packit Service |
dfccb1 |
SMTP_SENT_QUIT,
|
|
Packit Service |
dfccb1 |
SMTP_RECV_QUIT
|
|
Packit Service |
dfccb1 |
} smtp_state_t;
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
#define SMTP_DEFAULT_HELO "smtpchecker.keepalived.org"
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
/* Checker argument structure */
|
|
Packit |
c22fc9 |
typedef struct _smtp_checker {
|
|
Packit |
c22fc9 |
/* non per host config data goes here */
|
|
Packit Service |
dfccb1 |
const char *helo_name;
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
/* data buffer */
|
|
Packit |
c22fc9 |
char buff[SMTP_BUFF_MAX];
|
|
Packit |
c22fc9 |
size_t buff_ctr;
|
|
Packit |
c22fc9 |
|
|
Packit Service |
dfccb1 |
smtp_state_t state;
|
|
Packit |
c22fc9 |
} smtp_checker_t;
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
/* macro utility */
|
|
Packit |
c22fc9 |
#define FMT_SMTP_RS(H) (inet_sockaddrtopair (&(H)->dst))
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
/* Prototypes defs */
|
|
Packit |
c22fc9 |
extern void install_smtp_check_keyword(void);
|
|
Packit |
c22fc9 |
#ifdef THREAD_DUMP
|
|
Packit |
c22fc9 |
extern void register_check_smtp_addresses(void);
|
|
Packit |
c22fc9 |
#endif
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
#endif
|