~ubuntu-branches/ubuntu/trusty/keepalived/trusty

« back to all changes in this revision

Viewing changes to keepalived/core/global_parser.c

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Wirt
  • Date: 2005-04-29 23:22:40 UTC
  • mfrom: (1.1.1 upstream) (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050429232240-a8m3jtpi3cvuyyy2
Tags: 1.1.11-3
Added a warning about sarge kernels to README.Debian and 
the package description 

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 *              data structure representation the conf file representing
8
8
 *              the loadbalanced server pool.
9
9
 *  
10
 
 * Version:     $Id: global_parser.c,v 1.1.7 2004/04/04 23:28:05 acassen Exp $
 
10
 * Version:     $Id: global_parser.c,v 1.1.11 2005/03/01 01:22:13 acassen Exp $
11
11
 * 
12
12
 * Author:      Alexandre Cassen, <acassen@linux-vs.org>
13
13
 *              
21
21
 *              as published by the Free Software Foundation; either version
22
22
 *              2 of the License, or (at your option) any later version.
23
23
 *
24
 
 * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
 
24
 * Copyright (C) 2001-2005 Alexandre Cassen, <acassen@linux-vs.org>
25
25
 */
26
26
 
27
27
#include "global_parser.h"
28
28
#include "global_data.h"
 
29
#include "check_data.h"
29
30
#include "parser.h"
30
31
#include "memory.h"
31
32
#include "utils.h"
32
33
 
33
 
/* External vars */
34
 
extern conf_data *data;
35
 
 
36
34
/* data handlers */
37
35
/* Global def handlers */
38
36
static void
39
 
lvsid_handler(vector strvec)
40
 
{
41
 
        FREE_PTR(data->lvs_id);
42
 
        data->lvs_id = set_value(strvec);
 
37
routerid_handler(vector strvec)
 
38
{
 
39
        FREE_PTR(data->router_id);
 
40
        data->router_id = set_value(strvec);
 
41
}
 
42
static void
 
43
plugin_handler(vector strvec)
 
44
{
 
45
        data->plugin_dir = set_value(strvec);
43
46
}
44
47
static void
45
48
emailfrom_handler(vector strvec)
60
63
static void
61
64
email_handler(vector strvec)
62
65
{
63
 
        vector email = read_value_block();
 
66
        vector email_vec = read_value_block();
64
67
        int i;
65
68
        char *str;
66
69
 
67
 
        for (i = 0; i < VECTOR_SIZE(email); i++) {
68
 
                str = VECTOR_SLOT(email, i);
 
70
        for (i = 0; i < VECTOR_SIZE(email_vec); i++) {
 
71
                str = VECTOR_SLOT(email_vec, i);
69
72
                alloc_email(str);
70
73
        }
71
74
 
72
 
        free_strvec(email);
 
75
        free_strvec(email_vec);
73
76
}
74
77
 
75
78
void
77
80
{
78
81
        /* global definitions mapping */
79
82
        install_keyword_root("global_defs", NULL);
80
 
        install_keyword("lvs_id", &lvsid_handler);
 
83
        install_keyword("router_id", &routerid_handler);
 
84
        install_keyword("plugin_dir", &plugin_handler);
81
85
        install_keyword("notification_email_from", &emailfrom_handler);
82
86
        install_keyword("smtp_server", &smtpip_handler);
83
87
        install_keyword("smtp_connect_timeout", &smtpto_handler);