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_NTS_MANUAL "NTS_MANUAL"
27 #define ENV_VAR_NTS_BUILD_VERSION "NTS_BUILD_VERSION"
28 #define ENV_VAR_NTS_BUILD_TIME "NTS_BUILD_DATE"
29 #define ENV_VAR_NTS_FUNCTION_TYPE "NTS_FUNCTION_TYPE"
30 #define ENV_VAR_NTS_NF_STANDALONE_START_FEATURES "NTS_NF_STANDALONE_START_FEATURES"
32 #define ENV_VAR_DOCKER_ENGINE_VERSION "DOCKER_ENGINE_VERSION"
33 #define ENV_VAR_HOSTNAME "HOSTNAME"
34 #define ENV_VAR_IPV6ENABLED "IPv6_ENABLED"
35 #define ENV_VAR_SSH_CONNECTIONS "SSH_CONNECTIONS"
36 #define ENV_VAR_TLS_CONNECTIONS "TLS_CONNECTIONS"
38 #define ENV_VAR_HOST_IP "NTS_HOST_IP"
39 #define ENV_VAR_HOST_BASE_PORT "NTS_HOST_BASE_PORT"
40 #define ENV_VAR_HOST_NETCONF_SSH_BASE_PORT "NTS_HOST_NETCONF_SSH_BASE_PORT"
41 #define ENV_VAR_HOST_NETCONF_TLS_BASE_PORT "NTS_HOST_NETCONF_TLS_BASE_PORT"
42 #define ENV_VAR_HOST_TRANSFER_FTP_BASE_PORT "NTS_HOST_TRANSFER_FTP_BASE_PORT"
43 #define ENV_VAR_HOST_TRANSFER_SFTP_BASE_PORT "NTS_HOST_TRANSFER_SFTP_BASE_PORT"
45 #define ENV_VAR_SDN_CONTROLLER_PROTOCOL "SDN_CONTROLLER_PROTOCOL"
46 #define ENV_VAR_SDN_CONTROLLER_IP "SDN_CONTROLLER_IP"
47 #define ENV_VAR_SDN_CONTROLLER_PORT "SDN_CONTROLLER_PORT"
48 #define ENV_VAR_SDN_CONTROLLER_CALLHOME_PORT "SDN_CONTROLLER_CALLHOME_PORT"
49 #define ENV_VAR_SDN_CONTROLLER_USERNAME "SDN_CONTROLLER_USERNAME"
50 #define ENV_VAR_SDN_CONTROLLER_PASSWORD "SDN_CONTROLLER_PASSWORD"
52 #define ENV_VAR_VES_COMMON_HEADER_VERSION "VES_COMMON_HEADER_VERSION"
53 #define ENV_VAR_VES_ENDPOINT_PROTOCOL "VES_ENDPOINT_PROTOCOL"
54 #define ENV_VAR_VES_ENDPOINT_IP "VES_ENDPOINT_IP"
55 #define ENV_VAR_VES_ENDPOINT_PORT "VES_ENDPOINT_PORT"
56 #define ENV_VAR_VES_ENDPOINT_AUTH_METHOD "VES_ENDPOINT_AUTH_METHOD"
57 #define ENV_VAR_VES_ENDPOINT_USERNAME "VES_ENDPOINT_USERNAME"
58 #define ENV_VAR_VES_ENDPOINT_PASSWORD "VES_ENDPOINT_PASSWORD"
59 #define ENV_VAR_VES_ENDPOINT_CERTIFICATE "VES_ENDPOINT_CERTIFICATE"
63 NTS_MODE_CONTAINER_INIT,
66 NTS_MODE_NETWORK_FUNCTION,
67 NTS_MODE_GENERATE_DATA,
75 char **argv; //no-copy
78 unsigned int fixed_seed;
81 bool print_root_paths;
82 char *print_structure_xpath;
83 } framework_arguments_t;
91 char *nf_standalone_start_features;
95 char *docker_engine_version;
101 uint16_t ssh_connections;
102 uint16_t tls_connections;
103 uint16_t ftp_connections;
104 uint16_t sftp_connections;
110 uint16_t ssh_base_port;
111 uint16_t tls_base_port;
112 uint16_t ftp_base_port;
113 uint16_t sftp_base_port;
120 uint16_t callhome_port;
126 char *common_header_version;
136 } framework_environment_t;
147 } supervisor_rules_t;
152 } custom_list_instances_t;
163 int excluded_modules_count;
164 char **excluded_modules;
166 int excluded_features_count;
167 char **excluded_features;
172 supervisor_rules_t *rules;
176 int debug_max_string_size;
178 int excluded_modules_count;
179 char **excluded_modules;
181 int default_list_instances;
183 int custom_list_instances_count;
184 custom_list_instances_t *custom_list_instances;
186 int restrict_schema_count;
187 restrict_schema_t *restrict_schema;
188 } datastore_generate;
191 bool random_generation_enabled;
193 int preg_operational_count;
194 char **preg_operational;
196 int preg_running_count;
198 } datastore_populate;
199 } framework_config_t;
201 extern framework_arguments_t framework_arguments;
202 extern framework_environment_t framework_environment;
203 extern framework_config_t framework_config;
205 volatile sig_atomic_t framework_sigint;
207 int framework_init(int argc, char **argv);
208 void framework_free(void);