2 * OLSR ad-hoc routing table management protocol config parser
3 * Copyright (C) 2004 Andreas Tønnesen (andreto@olsr.org)
5 * This file is part of the olsr.org OLSR daemon.
7 * olsr.org is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * olsr.org is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with olsr.org; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * $Id: olsr_cfg.h,v 1.11 2004/11/20 17:37:25 tlopatic Exp $
27 #ifndef _OLSRD_CFGPARSER_H
28 #define _OLSRD_CFGPARSER_H
30 #include "olsr_protocol.h"
32 /* Default valuse not declared in olsr_protocol.h */
33 #define DEF_POLLRATE 0.05
34 #define DEF_WILL_AUTO OLSR_TRUE
35 #define DEF_ALLOW_NO_INTS OLSR_TRUE
37 #define DEF_DEBUGLVL 1
38 #define DEF_IPC_CONNECTIONS 0
39 #define DEF_USE_HYST OLSR_TRUE
40 #define DEF_LQ_LEVEL 0
41 #define DEF_LQ_WSIZE 10
42 #define DEF_CLEAR_SCREEN OLSR_FALSE
45 #ifndef IPV6_ADDR_SITELOCAL
46 #define IPV6_ADDR_SITELOCAL 0x0040U
70 #include "interfaces.h"
76 struct olsr_msg_params
78 float emission_interval;
82 struct if_config_options
84 union olsr_ip_addr ipv4_broadcast;
86 union olsr_ip_addr ipv6_multi_site;
87 union olsr_ip_addr ipv6_multi_glbl;
88 struct olsr_msg_params hello_params;
89 struct olsr_msg_params tc_params;
90 struct olsr_msg_params mid_params;
91 struct olsr_msg_params hna_params;
92 struct if_config_options *next;
102 olsr_bool configured;
103 struct interface *interf;
104 struct if_config_options *cnf;
105 struct olsr_if *next;
110 union olsr_ip_addr net;
111 union olsr_ip_addr netmask;
112 struct hna4_entry *next;
117 union olsr_ip_addr net;
118 olsr_u16_t prefix_len;
119 struct hna6_entry *next;
133 struct plugin_param *next;
139 struct plugin_param *params;
140 struct plugin_entry *next;
145 union olsr_ip_addr host;
146 struct ipc_host *next;
151 union olsr_ip_addr net;
152 union olsr_ip_addr mask;
153 struct ipc_net *next;
164 olsr_bool allow_no_interfaces;
166 olsr_bool willingness_auto;
167 olsr_u8_t willingness;
170 olsr_bool use_hysteresis;
171 struct hyst_param hysteresis_param;
173 olsr_u8_t tc_redundancy;
174 olsr_u8_t mpr_coverage;
175 olsr_bool clear_screen;
178 struct plugin_entry *plugins;
179 struct hna4_entry *hna4_entries;
180 struct hna6_entry *hna6_entries;
181 struct ipc_host *ipc_hosts;
182 struct ipc_net *ipc_nets;
183 struct olsr_if *interfaces;
189 * Interface to parser
192 struct olsrd_config *
193 olsrd_parse_cnf(char *);
196 olsrd_free_cnf(struct olsrd_config *);
199 olsrd_print_cnf(struct olsrd_config *);
202 olsrd_write_cnf(struct olsrd_config *, char *);
204 struct if_config_options *
205 get_default_if_config(void);
207 struct olsrd_config *
208 olsrd_get_default_cnf(void);
211 olsrd_cnf_malloc(unsigned int);
214 olsrd_cnf_free(void *);