208 |
static void addservice(Service_T); |
static void addservice(Service_T); |
209 |
static void addmail(char *, Mail_T, unsigned int); |
static void addmail(char *, Mail_T, unsigned int); |
210 |
static void createservice(int, char *, char *); |
static void createservice(int, char *, char *); |
|
static void create_remote_service(char *); |
|
211 |
static void adddependant(char *); |
static void adddependant(char *); |
212 |
static void addport(struct PortSet *); |
static void addport(struct PortSet *); |
213 |
static void addresource(struct ResourceSet *); |
static void addresource(struct ResourceSet *); |
320 |
optproc : start |
optproc : start |
321 |
| stop |
| stop |
322 |
| connection |
| connection |
323 |
|
| connectionunix |
324 |
| timeout |
| timeout |
325 |
| alert |
| alert |
326 |
| every |
| every |
393 |
|
|
394 |
opthost : start |
opthost : start |
395 |
| stop |
| stop |
396 |
| remoteconnection |
| connection |
397 |
| timeout |
| timeout |
398 |
| alert |
| alert |
399 |
| every |
| every |
577 |
} |
} |
578 |
; |
; |
579 |
|
|
580 |
checkhost : CHECKHOST STRING { |
checkhost : CHECKHOST SERVICENAME ADDRESS STRING { |
581 |
check_hostname($2); |
check_hostname($4); |
582 |
check_name($<string>2); |
check_name($<string>2); |
583 |
create_remote_service($2); |
createservice(TYPE_REMOTE, $<string>2, $4); |
584 |
} |
} |
585 |
; |
; |
586 |
|
|
615 |
portset.action= $<number>9; |
portset.action= $<number>9; |
616 |
addport(&portset); |
addport(&portset); |
617 |
} |
} |
|
| IF FAILED unixsocket type protocol nettimeout THEN action { |
|
|
portset.timeout= $<number>6; |
|
|
portset.action= $<number>8; |
|
|
addport(&portset); |
|
|
} |
|
618 |
; |
; |
619 |
|
|
620 |
remoteconnection: IF FAILED port type protocol nettimeout THEN action { |
connectionunix : IF FAILED unixsocket type protocol nettimeout THEN action { |
|
ASSERT(current && current->name); |
|
|
portset.hostname= xstrdup(current->name); |
|
621 |
portset.timeout= $<number>6; |
portset.timeout= $<number>6; |
622 |
portset.action= $<number>8; |
portset.action= $<number>8; |
623 |
addport(&portset); |
addport(&portset); |
624 |
} |
} |
625 |
; |
; |
626 |
|
|
627 |
host : /* EMPTY */ { portset.hostname= xstrdup(LOCALHOST); } |
host : /* EMPTY */ { |
628 |
|
if(current->type == TYPE_REMOTE) |
629 |
|
portset.hostname= xstrdup(current->path); |
630 |
|
else |
631 |
|
portset.hostname= xstrdup(LOCALHOST); |
632 |
|
} |
633 |
| HOST STRING { check_hostname($2); portset.hostname= $2; } |
| HOST STRING { check_hostname($2); portset.hostname= $2; } |
634 |
; |
; |
635 |
|
|
1150 |
|
|
1151 |
pthread_mutex_init(¤t->mutex, NULL); |
pthread_mutex_init(¤t->mutex, NULL); |
1152 |
|
|
|
} |
|
|
|
|
|
|
|
|
/* |
|
|
* Create a new remote service object and add any current objects |
|
|
* to the service list. |
|
|
*/ |
|
|
static void create_remote_service(char *hostname) { |
|
|
|
|
|
ASSERT(hostname); |
|
|
|
|
|
if(current) { |
|
|
addservice(current); |
|
|
} |
|
|
else { |
|
|
NEW(current); |
|
|
} |
|
|
|
|
|
/* Reset the current object */ |
|
|
memset(current, 0, sizeof(*current)); |
|
|
|
|
|
/* Set default values */ |
|
|
current->do_monitor= TRUE; |
|
|
current->mode= MODE_ACTIVE; |
|
|
|
|
|
current->type= TYPE_REMOTE; |
|
|
current->name= hostname; /* The remote host name */ |
|
|
|
|
|
pthread_mutex_init(¤t->mutex, NULL); |
|
|
|
|
1153 |
} |
} |
1154 |
|
|
1155 |
|
|