67 |
#include "engine.h" |
#include "engine.h" |
68 |
#include "alert.h" |
#include "alert.h" |
69 |
#include "monit_process.h" |
#include "monit_process.h" |
70 |
|
#include "ssl.h" |
71 |
|
|
72 |
|
|
73 |
struct IHavePrecedence { |
struct IHavePrecedence { |
92 |
int port; |
int port; |
93 |
int type; |
int type; |
94 |
int family; |
int family; |
95 |
|
int ssl; |
96 |
char *request; |
char *request; |
97 |
char *pathname; |
char *pathname; |
98 |
Protocol_T protocol; |
Protocol_T protocol; |
123 |
static struct IHavePrecedence ihp= { FALSE, FALSE }; |
static struct IHavePrecedence ihp= { FALSE, FALSE }; |
124 |
static struct MailFilter mtf= { NULL, NULL, NULL, FALSE, FALSE, FALSE, |
static struct MailFilter mtf= { NULL, NULL, NULL, FALSE, FALSE, FALSE, |
125 |
FALSE, FALSE }; |
FALSE, FALSE }; |
126 |
static struct PortSet portset= { -1, NULL, 0, SOCK_STREAM, AF_INET, NULL, |
static struct PortSet portset= { -1, NULL, 0, SOCK_STREAM, AF_INET, FALSE, |
127 |
NULL, NULL }; |
NULL, NULL, NULL }; |
128 |
static struct ResourceSet resourceset= { 0, 0, RESOURCE_OPERATOR_GREATER, |
static struct ResourceSet resourceset= { 0, 0, RESOURCE_OPERATOR_GREATER, |
129 |
1, RESOURCE_ACTION_ALERT }; |
1, RESOURCE_ACTION_ALERT }; |
130 |
|
|
163 |
|
|
164 |
%token SET LOGFILE DAEMON SYSLOG MAILSERVER HTTPD ALLOW ADDRESS INIT |
%token SET LOGFILE DAEMON SYSLOG MAILSERVER HTTPD ALLOW ADDRESS INIT |
165 |
%token CHECK PIDFILE START STOP |
%token CHECK PIDFILE START STOP |
166 |
%token HOST PORT TYPE UDP TCP PROTOCOL |
%token HOST PORT TYPE UDP TCP TCPSSL PROTOCOL |
167 |
%token ALERT MAILFORMAT UNIXSOCKET |
%token ALERT MAILFORMAT UNIXSOCKET |
168 |
%token TIMEOUT RESTART CHECKSUM EXPECT EVERY |
%token TIMEOUT RESTART CHECKSUM EXPECT EVERY |
169 |
%token DEFAULT HTTP FTP SMTP POP IMAP NNTP |
%token DEFAULT HTTP FTP SMTP POP IMAP NNTP |
341 |
|
|
342 |
type : /* EMPTY */ { portset.type= SOCK_STREAM; } |
type : /* EMPTY */ { portset.type= SOCK_STREAM; } |
343 |
| TYPE TCP { portset.type= SOCK_STREAM; } |
| TYPE TCP { portset.type= SOCK_STREAM; } |
344 |
|
| TYPE TCPSSL { portset.type= SOCK_STREAM; |
345 |
|
portset.ssl= TRUE; } |
346 |
| TYPE UDP { portset.type= SOCK_DGRAM; } |
| TYPE UDP { portset.type= SOCK_DGRAM; } |
347 |
; |
; |
348 |
|
|
708 |
snprintf(address, STRLEN, "UNIX[%s]", pp->pathname); |
snprintf(address, STRLEN, "UNIX[%s]", pp->pathname); |
709 |
} |
} |
710 |
|
|
711 |
|
if ( pp->ssl == TRUE ) { |
712 |
|
|
713 |
|
p->ssl= new_ssl_connection(); |
714 |
|
|
715 |
|
} else { |
716 |
|
|
717 |
|
p->ssl= NULL; |
718 |
|
|
719 |
|
} |
720 |
|
|
721 |
p->address= xstrdup(address); |
p->address= xstrdup(address); |
722 |
|
|
723 |
p->next= current->portlist; |
p->next= current->portlist; |
960 |
portset.port= 0; |
portset.port= 0; |
961 |
portset.type= SOCK_STREAM; |
portset.type= SOCK_STREAM; |
962 |
portset.family= AF_INET; |
portset.family= AF_INET; |
963 |
|
portset.ssl= FALSE; |
964 |
portset.request= NULL; |
portset.request= NULL; |
965 |
portset.protocol= NULL; |
portset.protocol= NULL; |
966 |
portset.pathname= NULL; |
portset.pathname= NULL; |