| 1 |
. |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
#include "config.h" |
| 8 |
#include "librist_config.h" |
| 9 |
|
| 10 |
typedef struct rist_tools_config_object { |
| 11 |
int buffer; |
| 12 |
int encryption_type; |
| 13 |
int profile; |
| 14 |
int stats_interval; |
| 15 |
int verbose_level; |
| 16 |
char * remote_log_address; |
| 17 |
char * secret; |
| 18 |
char * input_url; |
| 19 |
char * output_url; |
| 20 |
int null_packet_deletion; |
| 21 |
int fast_start; |
| 22 |
char * tunnel_interface; |
| 23 |
int tun_mode; |
| 24 |
#ifdef HAVE_SRP_SUPPORT |
| 25 |
char * srp_file; |
| 26 |
#endif |
| 27 |
#ifdef HAVE_PROMETHEUS_SUPPORT |
| 28 |
int enable_metrics; |
| 29 |
char * metrics_tags; |
| 30 |
int metrics_multipoint; |
| 31 |
int metrics_nocreated; |
| 32 |
#ifdef HAVE_LIBMICROHTTPD |
| 33 |
int metrics_http; |
| 34 |
int metrics_port; |
| 35 |
char * metrics_ip; |
| 36 |
#endif |
| 37 |
#if HAVE_SOCK_UN_H |
| 38 |
char * metrics_unix; |
| 39 |
#endif |
| 40 |
#endif |
| 41 |
} rist_tools_config_object; |
| 42 |
|
| 43 |
typedef struct yaml_node { |
| 44 |
char *key; |
| 45 |
char *value; |
| 46 |
struct yaml_node *next; |
| 47 |
} yaml_node; |
| 48 |
|
| 49 |
#ifndef strndup |
| 50 |
char *strndup (const char *str, size_t max); |
| 51 |
#endif |
| 52 |
size_t rist_findchar(const char* str, int c, size_t max); |
| 53 |
yaml_node *parse_yaml_value(char *str, size_t *index, size_t *max); |
| 54 |
yaml_node *parse_yaml_string(char *yaml_str); |
| 55 |
void print_yaml_node(yaml_node *node); |
| 56 |
void parse_config_file(rist_tools_config_object *config, char *current_key, yaml_node *node); |
| 57 |
void strapp(char ** original, char * newstr); |
| 58 |
rist_tools_config_object *parse_yaml(char * file); |
| 59 |
void cleanup_tools_config(rist_tools_config_object * config); |