Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
bf64e60e
Commit
bf64e60e
authored
Jul 02, 2014
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow reading of multiple config files.
parent
5ebf4632
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
13 deletions
+24
-13
babeld.c
babeld.c
+22
-12
babeld.man
babeld.man
+2
-1
No files found.
babeld.c
View file @
bf64e60e
...
...
@@ -101,7 +101,8 @@ main(int argc, char **argv)
struct
sockaddr_in6
sin6
;
int
rc
,
fd
,
i
,
opt
;
time_t
expiry_time
,
source_expiry_time
,
kernel_dump_time
;
const
char
*
config_file
=
NULL
;
const
char
**
config_files
=
NULL
;
int
num_config_files
=
0
;
void
*
vrc
;
unsigned
int
seed
;
struct
interface
*
ifp
;
...
...
@@ -232,7 +233,13 @@ main(int argc, char **argv)
goto
usage
;
break
;
case
'c'
:
config_file
=
optarg
;
config_files
=
realloc
(
config_files
,
(
num_config_files
+
1
)
*
sizeof
(
char
*
));
if
(
config_files
==
NULL
)
{
fprintf
(
stderr
,
"Couldn't allocate config file.
\n
"
);
exit
(
1
);
}
config_files
[
num_config_files
++
]
=
optarg
;
break
;
case
'C'
:
rc
=
parse_config_from_string
(
optarg
);
...
...
@@ -256,24 +263,27 @@ main(int argc, char **argv)
}
}
if
(
!
config_file
)
{
if
(
access
(
"/etc/babeld.conf"
,
F_OK
)
>=
0
)
config_file
=
"/etc/babeld.conf"
;
if
(
num_config_files
==
0
)
{
if
(
access
(
"/etc/babeld.conf"
,
F_OK
)
>=
0
)
{
config_files
=
malloc
(
sizeof
(
char
*
));
if
(
config_files
==
NULL
)
{
fprintf
(
stderr
,
"Couldn't allocate config file.
\n
"
);
exit
(
1
);
}
config_files
[
num_config_files
++
]
=
"/etc/babeld.conf"
;
}
if
(
config_file
)
{
}
for
(
i
=
0
;
i
<
num_config_files
;
i
++
)
{
int
line
;
rc
=
parse_config_from_file
(
config_file
,
&
line
);
rc
=
parse_config_from_file
(
config_file
s
[
i
]
,
&
line
);
if
(
rc
<
0
)
{
fprintf
(
stderr
,
"Couldn't parse configuration from file %s "
"(error at line %d).
\n
"
,
config_file
,
line
);
config_file
s
[
i
]
,
line
);
exit
(
1
);
}
}
else
{
if
(
access
(
"/etc/babel.conf"
,
F_OK
)
>=
0
)
fprintf
(
stderr
,
"Warning: /etc/babel.conf exists, it will be ignored.
\n
"
);
}
if
(
default_wireless_hello_interval
<=
0
)
...
...
babeld.man
View file @
bf64e60e
...
...
@@ -120,7 +120,8 @@ specified multiple times in order to export routes from more than one
table.
.TP
.BI \-c " filename"
Specify the name of the configuration file. The default is
Specify the name of the configuration file. This flag can be repeated
multiple times. The default is
.BR /etc/babeld.conf .
.TP
.BI \-C " statement"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment