1 /*************************************************************************
3 * Copyright 2020 highstreet technologies GmbH and others
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 ***************************************************************************/
26 #define ENV_VAR_HOSTNAME "HOSTNAME"
27 #define ENV_VAR_DOCKER_ENGINE_VERSION "DOCKER_ENGINE_VERSION"
28 #define ENV_VAR_IPV6ENABLED "IPv6_ENABLED"
29 #define ENV_VAR_HOST_IP "NETCONF_NTS_HOST_IP"
30 #define ENV_VAR_HOST_BASE_PORT "NETCONF_NTS_HOST_BASE_PORT"
31 #define ENV_VAR_SSH_CONNECTIONS "SSH_CONNECTIONS"
32 #define ENV_VAR_TLS_CONNECTIONS "TLS_CONNECTIONS"
34 #define ENV_VAR_SDN_CONTROLLER_IP "SDN_CONTROLLER_IP"
35 #define ENV_VAR_SDN_CONTROLLER_PORT "SDN_CONTROLLER_PORT"
36 #define ENV_VAR_SDN_CONTROLLER_CALLHOME_PORT "SDN_CONTROLLER_CALLHOME_PORT"
37 #define ENV_VAR_SDN_CONTROLLER_USERNAME "SDN_CONTROLLER_USERNAME"
38 #define ENV_VAR_SDN_CONTROLLER_PASSWORD "SDN_CONTROLLER_PASSWORD"
40 #define ENV_VAR_VES_ENDPOINT_PROTOCOL "VES_ENDPOINT_PROTOCOL"
41 #define ENV_VAR_VES_ENDPOINT_IP "VES_ENDPOINT_IP"
42 #define ENV_VAR_VES_ENDPOINT_PORT "VES_ENDPOINT_PORT"
43 #define ENV_VAR_VES_ENDPOINT_AUTH_METHOD "VES_ENDPOINT_AUTH_METHOD"
44 #define ENV_VAR_VES_ENDPOINT_USERNAME "VES_ENDPOINT_USERNAME"
45 #define ENV_VAR_VES_ENDPOINT_PASSWORD "VES_ENDPOINT_PASSWORD"
46 #define ENV_VAR_VES_ENDPOINT_CERTIFICATE "VES_ENDPOINT_CERTIFICATE"
51 } custom_list_instances_t;
65 unsigned int fixed_seed;
66 bool operational_only;
72 bool network_function;
75 bool print_root_paths;
76 char *print_structure_xpath;
79 } framework_arguments_t;
82 int docker_excluded_modules_count;
83 char **docker_excluded_modules;
85 int docker_excluded_features_count;
86 char **docker_excluded_features;
88 int debug_max_string_size;
90 int populate_excluded_modules_count;
91 char **populate_excluded_modules;
93 int default_list_instances;
95 int custom_list_instances_count;
96 custom_list_instances_t *custom_list_instances;
98 int restrict_schema_count;
99 restrict_schema_t *restrict_schema;
100 } framework_config_t;
103 char *docker_engine_version;
111 uint16_t host_base_port;
112 uint16_t ssh_connections;
113 uint16_t tls_connections;
114 uint16_t ftp_connections;
115 uint16_t sftp_connections;
117 char *sdn_controller_ip;
118 uint16_t sdn_controller_port;
119 uint16_t sdn_controller_callhome_port;
120 char *sdn_controller_username;
121 char *sdn_controller_password;
123 char *ves_endpoint_protocol;
124 char *ves_endpoint_ip;
125 uint16_t ves_endpoint_port;
126 char *ves_endpoint_auth_method;
127 char *ves_endpoint_username;
128 char *ves_endpoint_password;
129 char *ves_endpoint_certificate;
130 } framework_environment_t;
132 extern framework_arguments_t framework_arguments;
133 extern framework_config_t framework_config;
134 extern framework_environment_t framework_environment;
136 volatile sig_atomic_t framework_sigint;
138 void framework_init(int argc, char **argv);
139 void framework_free(void);
141 //docker-related functions
142 bool framework_is_docker_excluded_module(const char *module);
143 bool framework_is_docker_excluded_feature(const char *feature);
145 //populate-related functions
146 bool framework_is_populate_excluded_module(const char *module);
148 int framework_populate_get_instance_count(const char *path);
149 char *framework_populate_get_restrict_schema(const char *path); //returns null if there is no restricted entry, value otherwise. value must be freed