-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.h
65 lines (58 loc) · 1.71 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* This file is part of BIRD-RTRlib-CLI.
*
* BIRD-RTRlib-CLI is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* BIRD-RTRlib-CLI is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BIRD-RTRlib-CLI; see the file COPYING.
*
* written by Mehmet Ceyran, in cooperation with:
* CST group, Freie Universitaet Berlin
* Website: https://github.com/rtrlib/bird-rtrlib-cli
*/
#ifndef BIRD_RTRLIB_CLI__CONFIG_H
#define BIRD_RTRLIB_CLI__CONFIG_H
/// Specifies a type of server connection to be used.
enum connection_type {
tcp, // Plain TCP connection
ssh // SSH connection
};
typedef enum { false, true } bool;
/**
* Application configuration structure.
*/
struct config {
char *bird_socket_path;
char *bird_roa_table;
enum connection_type rtr_connection_type;
char *rtr_host;
char *rtr_port;
char *rtr_bind_addr;
char *rtr_ssh_username;
char *rtr_ssh_hostkey_file;
char *rtr_ssh_privkey_file;
char *ip_version;
bool quiet;
bool daemon;
char *pidfile;
};
/**
* Checks the specified application configuration for errors.
* @param
* @return
*/
int config_check(const struct config *);
/**
* Initializes the specified application configuration.
* @param
*/
void config_init(struct config *);
#endif