2 * simulator-operations.h
4 * Created on: Mar 9, 2019
8 #ifndef SRC_NTSIMULATOR_MANAGER_SIMULATOR_OPERATIONS_H_
9 #define SRC_NTSIMULATOR_MANAGER_SIMULATOR_OPERATIONS_H_
11 #include <curl/curl.h>
17 #include "sysrepo/values.h"
19 #include <cjson/cJSON.h>
21 #define CURL_MEM_SIZE 2048
25 * Storing the device information
28 typedef struct device {
32 char *operational_state;
36 typedef struct device_stack {
41 #define URL_AND_CREDENTIALS_MAX_LEN 400
43 typedef struct controller
45 char url[URL_AND_CREDENTIALS_MAX_LEN];
46 char credentials[URL_AND_CREDENTIALS_MAX_LEN];
47 char url_for_keystore_add[URL_AND_CREDENTIALS_MAX_LEN];
48 char url_for_private_key_add[URL_AND_CREDENTIALS_MAX_LEN];
49 char url_for_trusted_ca_add[URL_AND_CREDENTIALS_MAX_LEN];
53 device_stack_t *new_device_stack(void);
54 void push_device(device_stack_t *theStack, char *dev_id, int port);
55 void pop_device(device_stack_t *theStack);
56 int get_netconf_port_next(device_stack_t *theStack);
57 int get_netconf_port_base(void);
58 char *get_id_last_device(device_stack_t *theStack);
59 int get_current_number_of_devices(device_stack_t *theStack);
60 int get_current_number_of_mounted_devices(device_stack_t *theStack);
73 int cleanup_curl(void);
75 int _init_curl_odl(void);
76 int cleanup_curl_odl(void);
78 int start_device(device_stack_t *theStack);
79 int stop_device(device_stack_t *theStack);
81 int mount_device(device_stack_t *theStack, controller_t controller_details);
82 int unmount_device(device_stack_t *theStack, controller_t controller_details);
84 char* get_docker_container_operational_state(device_stack_t *theStack, char *container_id);
85 int get_docker_containers_operational_state_curl(device_stack_t *theStack);
87 char* get_docker_container_resource_stats();
89 int notification_delay_period_changed(int period);
90 int ves_heartbeat_period_changed(int period);
91 int ves_ip_changed(char *new_ip);
92 int ves_port_changed(int new_port);
93 int ves_registration_changed(cJSON_bool new_bool);
94 int is_netconf_available_changed(cJSON_bool new_bool);
95 int is_ves_available_changed(cJSON_bool new_bool);
99 int add_key_pair_to_odl(controller_t *controller_list, int controller_list_size);
102 #endif /* SRC_NTSIMULATOR_MANAGER_SIMULATOR_OPERATIONS_H_ */