Stephane Barbarie | 1408896 | 2017-06-01 16:56:55 -0400 | [diff] [blame] | 1 | /* |
Zack Williams | 41513bf | 2018-07-07 20:08:35 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
| 3 | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | /* |
Stephane Barbarie | 1408896 | 2017-06-01 16:56:55 -0400 | [diff] [blame] | 17 | * This is automatically generated callbacks file |
| 18 | * It contains 3 parts: Configuration callbacks, RPC callbacks and state data callbacks. |
| 19 | * Do NOT alter function signatures or any structures unless you know exactly what you are doing. |
| 20 | */ |
| 21 | |
| 22 | #include <stdlib.h> |
| 23 | #include <sys/inotify.h> |
| 24 | #include <libxml/tree.h> |
| 25 | #include <libxml/xmlsave.h> |
| 26 | #include <libxml/xmlwriter.h> |
| 27 | #include <libnetconf_xml.h> |
| 28 | #include <voltha-netconf-model.h> |
| 29 | #include <voltha.h> |
| 30 | #include <string.h> |
| 31 | |
| 32 | |
| 33 | /* transAPI version which must be compatible with libnetconf */ |
| 34 | int transapi_version = 6; |
| 35 | |
| 36 | /* Signal to libnetconf that configuration data were modified by any callback. |
| 37 | * 0 - data not modified |
| 38 | * 1 - data have been modified |
| 39 | */ |
| 40 | int config_modified = 0; |
| 41 | |
| 42 | /* |
| 43 | * Determines the callbacks order. |
| 44 | * Set this variable before compilation and DO NOT modify it in runtime. |
| 45 | * TRANSAPI_CLBCKS_LEAF_TO_ROOT (default) |
| 46 | * TRANSAPI_CLBCKS_ROOT_TO_LEAF |
| 47 | */ |
| 48 | const TRANSAPI_CLBCKS_ORDER_TYPE callbacks_order = TRANSAPI_CLBCKS_ORDER_DEFAULT; |
| 49 | |
| 50 | /* Do not modify or set! This variable is set by libnetconf to announce edit-config's error-option |
| 51 | Feel free to use it to distinguish module behavior for different error-option values. |
| 52 | * Possible values: |
| 53 | * NC_EDIT_ERROPT_STOP - Following callback after failure are not executed, all successful callbacks executed till |
| 54 | failure point must be applied to the device. |
| 55 | * NC_EDIT_ERROPT_CONT - Failed callbacks are skipped, but all callbacks needed to apply configuration changes are executed |
| 56 | * NC_EDIT_ERROPT_ROLLBACK - After failure, following callbacks are not executed, but previous successful callbacks are |
| 57 | executed again with previous configuration data to roll it back. |
| 58 | */ |
| 59 | NC_EDIT_ERROPT_TYPE erropt = NC_EDIT_ERROPT_NOTSET; |
| 60 | |
| 61 | /** |
| 62 | * @brief Initialize plugin after loaded and before any other functions are called. |
| 63 | |
| 64 | * This function should not apply any configuration data to the controlled device. If no |
| 65 | * running is returned (it stays *NULL), complete startup configuration is consequently |
| 66 | * applied via module callbacks. When a running configuration is returned, libnetconf |
| 67 | * then applies (via module's callbacks) only the startup configuration data that |
| 68 | * differ from the returned running configuration data. |
| 69 | |
| 70 | * Please note, that copying startup data to the running is performed only after the |
| 71 | * libnetconf's system-wide close - see nc_close() function documentation for more |
| 72 | * information. |
| 73 | |
| 74 | * @param[out] running Current configuration of managed device. |
| 75 | |
| 76 | * @return EXIT_SUCCESS or EXIT_FAILURE |
| 77 | */ |
| 78 | int transapi_init(xmlDocPtr *running) { |
| 79 | return EXIT_SUCCESS; |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * @brief Free all resources allocated on plugin runtime and prepare plugin for removal. |
| 84 | */ |
| 85 | void transapi_close(void) { |
| 86 | return; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * @brief Retrieve state data from device and return them as XML document |
| 91 | * |
| 92 | * @param model Device data model. libxml2 xmlDocPtr. |
| 93 | * @param running Running datastore content. libxml2 xmlDocPtr. |
| 94 | * @param[out] err Double pointer to error structure. Fill error when some occurs. |
| 95 | * @return State data as libxml2 xmlDocPtr or NULL in case of error. |
| 96 | */ |
| 97 | xmlDocPtr get_state_data(xmlDocPtr model, xmlDocPtr running, struct nc_err **err) { |
| 98 | return(NULL); |
| 99 | } |
| 100 | /* |
| 101 | * Mapping prefixes with namespaces. |
| 102 | * Do NOT modify this structure! |
| 103 | */ |
| 104 | struct ns_pair namespace_mapping[] = {{NULL, NULL}}; |
| 105 | |
| 106 | /* |
| 107 | * CONFIGURATION callbacks |
| 108 | * Here follows set of callback functions run every time some change in associated part of running datastore occurs. |
| 109 | * You can safely modify the bodies of all function as well as add new functions for better lucidity of code. |
| 110 | */ |
| 111 | |
| 112 | /* |
| 113 | * Structure transapi_config_callbacks provide mapping between callback and path in configuration datastore. |
| 114 | * It is used by libnetconf library to decide which callbacks will be run. |
| 115 | * DO NOT alter this structure |
| 116 | */ |
| 117 | struct transapi_data_callbacks clbks = { |
| 118 | .callbacks_count = 0, |
| 119 | .data = NULL, |
| 120 | .callbacks = { |
| 121 | } |
| 122 | }; |
| 123 | |
| 124 | /** |
| 125 | * @brief Get a node from the RPC input. The first found node is returned, so if traversing lists, |
| 126 | * call repeatedly with result->next as the node argument. |
| 127 | * |
| 128 | * @param name Name of the node to be retrieved. |
| 129 | * @param node List of nodes that will be searched. |
| 130 | * @return Pointer to the matching node or NULL |
| 131 | */ |
| 132 | xmlNodePtr get_rpc_node(const char *name, const xmlNodePtr node) { |
| 133 | xmlNodePtr ret = NULL; |
| 134 | |
| 135 | for (ret = node; ret != NULL; ret = ret->next) { |
| 136 | if (xmlStrEqual(BAD_CAST name, ret->name)) { |
| 137 | break; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | return ret; |
| 142 | } |
| 143 | |
| 144 | void walk_nodes(const xmlNodePtr node) { |
| 145 | xmlNodePtr ret = NULL; |
| 146 | |
| 147 | /* |
| 148 | walk through the document |
| 149 | what to do with nodes ... pass to a channel? |
| 150 | to construct a map at the other end? |
| 151 | |
| 152 | */ |
| 153 | for (ret = node; ret != NULL; ret = ret->next) { |
| 154 | if (xmlNodeIsText(ret)) { |
| 155 | nc_verb_verbose("content : %s", (char*)xmlNodeGetContent(ret)); |
| 156 | } else { |
| 157 | nc_verb_verbose("name : %s", ret->name); |
| 158 | } |
| 159 | if (ret->children != NULL) { |
| 160 | walk_nodes(ret->children); |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | /* |
| 166 | * RPC callbacks |
| 167 | * Here follows set of callback functions run every time RPC specific for this device arrives. |
| 168 | * You can safely modify the bodies of all function as well as add new functions for better lucidity of code. |
| 169 | * Every function takes an libxml2 list of inputs as an argument. |
| 170 | * If input was not set in RPC message argument is set to NULL. To retrieve each argument, preferably use get_rpc_node(). |
| 171 | */ |
| 172 | |
| 173 | /* |
| 174 | * Local service functions |
| 175 | */ |
| 176 | |
| 177 | nc_reply *rpc_VolthaLocalService_GetVolthaInstance(xmlNodePtr input) { |
| 178 | return NULL; |
| 179 | } |
| 180 | nc_reply *rpc_VolthaLocalService_GetHealth(xmlNodePtr input) { |
| 181 | HealthStatus health; |
| 182 | health = (HealthStatus) GetHealthStatus(); |
| 183 | |
| 184 | char* data; |
| 185 | data = (char*) TranslateHealthStatus(health); |
| 186 | |
| 187 | return nc_reply_data(data); |
| 188 | } |
| 189 | nc_reply *rpc_VolthaLocalService_ListAdapters(xmlNodePtr input) { |
| 190 | return NULL; |
| 191 | } |
| 192 | nc_reply *rpc_VolthaLocalService_ListLogicalDevices(xmlNodePtr input) { |
| 193 | return NULL; |
| 194 | } |
| 195 | nc_reply *rpc_VolthaLocalService_GetLogicalDevice(xmlNodePtr input) { |
| 196 | return NULL; |
| 197 | } |
| 198 | nc_reply *rpc_VolthaLocalService_ListLogicalDevicePorts(xmlNodePtr input) { |
| 199 | return NULL; |
| 200 | } |
| 201 | nc_reply *rpc_VolthaLocalService_ListLogicalDeviceFlows(xmlNodePtr input) { |
| 202 | return NULL; |
| 203 | } |
| 204 | nc_reply *rpc_VolthaLocalService_UpdateLogicalDeviceFlowTable(xmlNodePtr input) { |
| 205 | return NULL; |
| 206 | } |
| 207 | nc_reply *rpc_VolthaLocalService_ListLogicalDeviceFlowGroups(xmlNodePtr input) { |
| 208 | return NULL; |
| 209 | } |
| 210 | nc_reply *rpc_VolthaLocalService_UpdateLogicalDeviceFlowGroupTable(xmlNodePtr input) { |
| 211 | return NULL; |
| 212 | } |
| 213 | nc_reply *rpc_VolthaLocalService_ListDevices(xmlNodePtr input) { |
| 214 | DeviceArray devices; |
| 215 | devices = (DeviceArray) ListDevices(); |
| 216 | |
| 217 | char* data; |
| 218 | data = (char*) TranslateDevices(devices); |
| 219 | |
| 220 | return nc_reply_data(data); |
| 221 | } |
| 222 | nc_reply *rpc_VolthaLocalService_GetDevice(xmlNodePtr input) { |
| 223 | return NULL; |
| 224 | } |
| 225 | nc_reply *rpc_VolthaLocalService_CreateDevice(xmlNodePtr input) { |
| 226 | Device d; |
| 227 | xmlNodePtr ret = NULL; |
| 228 | |
| 229 | if ((ret = get_rpc_node("type", input)) != NULL) { |
| 230 | d.Type = (char*)xmlNodeGetContent(ret); |
| 231 | } |
| 232 | |
| 233 | if ((ret = get_rpc_node("host_and_port", input)) != NULL) { |
| 234 | d.Address.Type = (int)HOST_AND_PORT; |
| 235 | d.Address.Value = (char*)xmlNodeGetContent(ret); |
| 236 | } else if ((ret = get_rpc_node("mac_address", input)) != NULL) { |
| 237 | d.Address.Type = (int)MAC; |
| 238 | d.Address.Value = (char*)xmlNodeGetContent(ret); |
| 239 | } else if ((ret = get_rpc_node("ipv4_address", input)) != NULL) { |
| 240 | d.Address.Type = (int)IPV4; |
| 241 | d.Address.Value = (char*)xmlNodeGetContent(ret); |
| 242 | } else if ((ret = get_rpc_node("ipv6_address", input)) != NULL) { |
| 243 | d.Address.Type = (int)IPV6; |
| 244 | d.Address.Value = (char*)xmlNodeGetContent(ret); |
| 245 | } |
| 246 | |
| 247 | Device d_created; |
| 248 | nc_verb_verbose("Issuing call to create"); |
| 249 | d_created = (Device) CreateDevice(d); |
| 250 | nc_verb_verbose("Created device"); |
| 251 | |
| 252 | char* data; |
| 253 | data = (char*) TranslateDevice(d_created); |
| 254 | |
| 255 | return nc_reply_data((char*)data); |
| 256 | } |
| 257 | nc_reply *rpc_VolthaLocalService_EnableDevice(xmlNodePtr input) { |
| 258 | return NULL; |
| 259 | } |
| 260 | nc_reply *rpc_VolthaLocalService_DisableDevice(xmlNodePtr input) { |
| 261 | return NULL; |
| 262 | } |
| 263 | nc_reply *rpc_VolthaLocalService_RebootDevice(xmlNodePtr input) { |
| 264 | return NULL; |
| 265 | } |
| 266 | nc_reply *rpc_VolthaLocalService_DeleteDevice(xmlNodePtr input) { |
| 267 | return NULL; |
| 268 | } |
| 269 | nc_reply *rpc_VolthaLocalService_ListDevicePorts(xmlNodePtr input) { |
| 270 | return NULL; |
| 271 | } |
| 272 | nc_reply *rpc_VolthaLocalService_ListDevicePmConfigs(xmlNodePtr input) { |
| 273 | return NULL; |
| 274 | } |
| 275 | nc_reply *rpc_VolthaLocalService_UpdateDevicePmConfigs(xmlNodePtr input) { |
| 276 | return NULL; |
| 277 | } |
| 278 | nc_reply *rpc_VolthaLocalService_ListDeviceFlows(xmlNodePtr input) { |
| 279 | return NULL; |
| 280 | } |
| 281 | nc_reply *rpc_VolthaLocalService_ListDeviceFlowGroups(xmlNodePtr input) { |
| 282 | return NULL; |
| 283 | } |
| 284 | nc_reply *rpc_VolthaLocalService_ListDeviceTypes(xmlNodePtr input) { |
| 285 | return NULL; |
| 286 | } |
| 287 | nc_reply *rpc_VolthaLocalService_GetDeviceType(xmlNodePtr input) { |
| 288 | return NULL; |
| 289 | } |
| 290 | nc_reply *rpc_VolthaLocalService_ListDeviceGroups(xmlNodePtr input) { |
| 291 | return NULL; |
| 292 | } |
| 293 | nc_reply *rpc_VolthaLocalService_GetDeviceGroup(xmlNodePtr input) { |
| 294 | return NULL; |
| 295 | } |
| 296 | nc_reply *rpc_VolthaLocalService_StreamPacketsOut(xmlNodePtr input) { |
| 297 | return NULL; |
| 298 | } |
| 299 | nc_reply *rpc_VolthaLocalService_ReceivePacketsIn(xmlNodePtr input) { |
| 300 | return NULL; |
| 301 | } |
| 302 | nc_reply *rpc_VolthaLocalService_ReceiveChangeEvents(xmlNodePtr input) { |
| 303 | return NULL; |
| 304 | } |
| 305 | nc_reply *rpc_VolthaLocalService_CreateAlarmFilter(xmlNodePtr input) { |
| 306 | return NULL; |
| 307 | } |
| 308 | nc_reply *rpc_VolthaLocalService_GetAlarmFilter(xmlNodePtr input) { |
| 309 | return NULL; |
| 310 | } |
| 311 | nc_reply *rpc_VolthaLocalService_UpdateAlarmFilter(xmlNodePtr input) { |
| 312 | return NULL; |
| 313 | } |
| 314 | nc_reply *rpc_VolthaLocalService_DeleteAlarmFilter(xmlNodePtr input) { |
| 315 | return NULL; |
| 316 | } |
| 317 | nc_reply *rpc_VolthaLocalService_ListAlarmFilters(xmlNodePtr input) { |
| 318 | return NULL; |
| 319 | } |
| 320 | |
| 321 | /* |
| 322 | * Global service functions |
| 323 | * |
| 324 | */ |
| 325 | nc_reply *rpc_HealthService_GetHealthStatus(xmlNodePtr input) { |
| 326 | return rpc_VolthaLocalService_GetHealth(input); |
| 327 | } |
| 328 | nc_reply *rpc_VolthaGlobalService_GetVoltha(xmlNodePtr input) { |
| 329 | Voltha voltha; |
| 330 | voltha = (Voltha) GetVoltha(); |
| 331 | |
| 332 | nc_verb_verbose("version : %s", (char*)voltha.Version); |
| 333 | nc_verb_verbose("log_level : %s", (char*)voltha.LogLevel); |
| 334 | |
| 335 | char* data; |
| 336 | data = (char*) TranslateVoltha(voltha); |
| 337 | |
| 338 | return nc_reply_data(data); |
| 339 | } |
| 340 | nc_reply *rpc_VolthaGlobalService_ListVolthaInstances(xmlNodePtr input) { |
| 341 | return NULL; |
| 342 | } |
| 343 | nc_reply *rpc_VolthaGlobalService_GetVolthaInstance(xmlNodePtr input) { |
| 344 | return rpc_VolthaLocalService_GetVolthaInstance(input); |
| 345 | } |
| 346 | nc_reply *rpc_VolthaGlobalService_ListLogicalDevices(xmlNodePtr input) { |
| 347 | return rpc_VolthaLocalService_ListLogicalDevices(input); |
| 348 | } |
| 349 | nc_reply *rpc_VolthaGlobalService_GetLogicalDevice(xmlNodePtr input) { |
| 350 | return rpc_VolthaLocalService_GetLogicalDevice(input); |
| 351 | } |
| 352 | nc_reply *rpc_VolthaGlobalService_ListLogicalDevicePorts(xmlNodePtr input) { |
| 353 | return rpc_VolthaLocalService_ListLogicalDevicePorts(input); |
| 354 | } |
| 355 | nc_reply *rpc_VolthaGlobalService_ListLogicalDeviceFlows(xmlNodePtr input) { |
| 356 | return rpc_VolthaLocalService_ListLogicalDeviceFlows(input); |
| 357 | } |
| 358 | nc_reply *rpc_VolthaGlobalService_UpdateLogicalDeviceFlowTable(xmlNodePtr input) { |
| 359 | return rpc_VolthaLocalService_UpdateLogicalDeviceFlowTable(input); |
| 360 | } |
| 361 | nc_reply *rpc_VolthaGlobalService_ListLogicalDeviceFlowGroups(xmlNodePtr input) { |
| 362 | return rpc_VolthaLocalService_ListLogicalDeviceFlowGroups(input); |
| 363 | } |
| 364 | nc_reply *rpc_VolthaGlobalService_UpdateLogicalDeviceFlowGroupTable(xmlNodePtr input) { |
| 365 | return rpc_VolthaLocalService_UpdateLogicalDeviceFlowGroupTable(input); |
| 366 | } |
| 367 | nc_reply *rpc_VolthaGlobalService_ListDevices(xmlNodePtr input) { |
| 368 | return rpc_VolthaLocalService_ListDevices(input); |
| 369 | } |
| 370 | nc_reply *rpc_VolthaGlobalService_GetDevice(xmlNodePtr input) { |
| 371 | return rpc_VolthaLocalService_GetDevice(input); |
| 372 | } |
| 373 | nc_reply *rpc_VolthaGlobalService_CreateDevice(xmlNodePtr input) { |
| 374 | return rpc_VolthaLocalService_CreateDevice(input); |
| 375 | } |
| 376 | nc_reply *rpc_VolthaGlobalService_EnableDevice(xmlNodePtr input) { |
| 377 | return rpc_VolthaLocalService_EnableDevice(input); |
| 378 | } |
| 379 | nc_reply *rpc_VolthaGlobalService_DisableDevice(xmlNodePtr input) { |
| 380 | return rpc_VolthaLocalService_DisableDevice(input); |
| 381 | } |
| 382 | nc_reply *rpc_VolthaGlobalService_RebootDevice(xmlNodePtr input) { |
| 383 | return rpc_VolthaLocalService_RebootDevice(input); |
| 384 | } |
| 385 | nc_reply *rpc_VolthaGlobalService_DeleteDevice(xmlNodePtr input) { |
| 386 | return rpc_VolthaLocalService_DeleteDevice(input); |
| 387 | } |
| 388 | nc_reply *rpc_VolthaGlobalService_ListDevicePorts(xmlNodePtr input) { |
| 389 | return rpc_VolthaLocalService_ListDevicePorts(input); |
| 390 | } |
| 391 | nc_reply *rpc_VolthaGlobalService_ListDevicePmConfigs(xmlNodePtr input) { |
| 392 | return rpc_VolthaLocalService_ListDevicePmConfigs(input); |
| 393 | } |
| 394 | nc_reply *rpc_VolthaGlobalService_UpdateDevicePmConfigs(xmlNodePtr input) { |
| 395 | return rpc_VolthaLocalService_UpdateDevicePmConfigs(input); |
| 396 | } |
| 397 | nc_reply *rpc_VolthaGlobalService_ListDeviceFlows(xmlNodePtr input) { |
| 398 | return rpc_VolthaLocalService_ListDeviceFlows(input); |
| 399 | } |
| 400 | nc_reply *rpc_VolthaGlobalService_ListDeviceFlowGroups(xmlNodePtr input) { |
| 401 | return rpc_VolthaLocalService_ListDeviceFlowGroups(input); |
| 402 | } |
| 403 | nc_reply *rpc_VolthaGlobalService_ListDeviceTypes(xmlNodePtr input) { |
| 404 | return rpc_VolthaLocalService_ListDeviceTypes(input); |
| 405 | } |
| 406 | nc_reply *rpc_VolthaGlobalService_GetDeviceType(xmlNodePtr input) { |
| 407 | return rpc_VolthaLocalService_GetDeviceType(input); |
| 408 | } |
| 409 | nc_reply *rpc_VolthaGlobalService_ListDeviceGroups(xmlNodePtr input) { |
| 410 | return rpc_VolthaLocalService_ListDeviceGroups(input); |
| 411 | } |
| 412 | nc_reply *rpc_VolthaGlobalService_GetDeviceGroup(xmlNodePtr input) { |
| 413 | return rpc_VolthaLocalService_GetDeviceGroup(input); |
| 414 | } |
| 415 | nc_reply *rpc_VolthaGlobalService_CreateAlarmFilter(xmlNodePtr input) { |
| 416 | return rpc_VolthaLocalService_CreateAlarmFilter(input); |
| 417 | } |
| 418 | nc_reply *rpc_VolthaGlobalService_GetAlarmFilter(xmlNodePtr input) { |
| 419 | return rpc_VolthaLocalService_GetAlarmFilter(input); |
| 420 | } |
| 421 | nc_reply *rpc_VolthaGlobalService_UpdateAlarmFilter(xmlNodePtr input) { |
| 422 | return rpc_VolthaLocalService_UpdateAlarmFilter(input); |
| 423 | } |
| 424 | nc_reply *rpc_VolthaGlobalService_DeleteAlarmFilter(xmlNodePtr input) { |
| 425 | return rpc_VolthaLocalService_DeleteAlarmFilter(input); |
| 426 | } |
| 427 | nc_reply *rpc_VolthaGlobalService_ListAlarmFilters(xmlNodePtr input) { |
| 428 | return rpc_VolthaLocalService_ListAlarmFilters(input); |
| 429 | } |
| 430 | |
| 431 | /* |
| 432 | * Structure transapi_rpc_callbacks provides mapping between callbacks and RPC messages. |
| 433 | * It is used by libnetconf library to decide which callbacks will be run when RPC arrives. |
| 434 | * DO NOT alter this structure |
| 435 | */ |
| 436 | struct transapi_rpc_callbacks rpc_clbks = { |
| 437 | .callbacks_count = 66, |
| 438 | .callbacks = { |
| 439 | {.name="HealthService-GetHealthStatus", .func=rpc_HealthService_GetHealthStatus}, |
| 440 | {.name="VolthaGlobalService-GetVoltha", .func=rpc_VolthaGlobalService_GetVoltha}, |
| 441 | {.name="VolthaGlobalService-ListVolthaInstances", .func=rpc_VolthaGlobalService_ListVolthaInstances}, |
| 442 | {.name="VolthaGlobalService-GetVolthaInstance", .func=rpc_VolthaGlobalService_GetVolthaInstance}, |
| 443 | {.name="VolthaGlobalService-ListLogicalDevices", .func=rpc_VolthaGlobalService_ListLogicalDevices}, |
| 444 | {.name="VolthaGlobalService-GetLogicalDevice", .func=rpc_VolthaGlobalService_GetLogicalDevice}, |
| 445 | {.name="VolthaGlobalService-ListLogicalDevicePorts", .func=rpc_VolthaGlobalService_ListLogicalDevicePorts}, |
| 446 | {.name="VolthaGlobalService-ListLogicalDeviceFlows", .func=rpc_VolthaGlobalService_ListLogicalDeviceFlows}, |
| 447 | {.name="VolthaGlobalService-UpdateLogicalDeviceFlowTable", .func=rpc_VolthaGlobalService_UpdateLogicalDeviceFlowTable}, |
| 448 | {.name="VolthaGlobalService-ListLogicalDeviceFlowGroups", .func=rpc_VolthaGlobalService_ListLogicalDeviceFlowGroups}, |
| 449 | {.name="VolthaGlobalService-UpdateLogicalDeviceFlowGroupTable", .func=rpc_VolthaGlobalService_UpdateLogicalDeviceFlowGroupTable}, |
| 450 | {.name="VolthaGlobalService-ListDevices", .func=rpc_VolthaGlobalService_ListDevices}, |
| 451 | {.name="VolthaGlobalService-GetDevice", .func=rpc_VolthaGlobalService_GetDevice}, |
| 452 | {.name="VolthaGlobalService-CreateDevice", .func=rpc_VolthaGlobalService_CreateDevice}, |
| 453 | {.name="VolthaGlobalService-EnableDevice", .func=rpc_VolthaGlobalService_EnableDevice}, |
| 454 | {.name="VolthaGlobalService-DisableDevice", .func=rpc_VolthaGlobalService_DisableDevice}, |
| 455 | {.name="VolthaGlobalService-RebootDevice", .func=rpc_VolthaGlobalService_RebootDevice}, |
| 456 | {.name="VolthaGlobalService-DeleteDevice", .func=rpc_VolthaGlobalService_DeleteDevice}, |
| 457 | {.name="VolthaGlobalService-ListDevicePorts", .func=rpc_VolthaGlobalService_ListDevicePorts}, |
| 458 | {.name="VolthaGlobalService-ListDevicePmConfigs", .func=rpc_VolthaGlobalService_ListDevicePmConfigs}, |
| 459 | {.name="VolthaGlobalService-UpdateDevicePmConfigs", .func=rpc_VolthaGlobalService_UpdateDevicePmConfigs}, |
| 460 | {.name="VolthaGlobalService-ListDeviceFlows", .func=rpc_VolthaGlobalService_ListDeviceFlows}, |
| 461 | {.name="VolthaGlobalService-ListDeviceFlowGroups", .func=rpc_VolthaGlobalService_ListDeviceFlowGroups}, |
| 462 | {.name="VolthaGlobalService-ListDeviceTypes", .func=rpc_VolthaGlobalService_ListDeviceTypes}, |
| 463 | {.name="VolthaGlobalService-GetDeviceType", .func=rpc_VolthaGlobalService_GetDeviceType}, |
| 464 | {.name="VolthaGlobalService-ListDeviceGroups", .func=rpc_VolthaGlobalService_ListDeviceGroups}, |
| 465 | {.name="VolthaGlobalService-GetDeviceGroup", .func=rpc_VolthaGlobalService_GetDeviceGroup}, |
| 466 | {.name="VolthaGlobalService-CreateAlarmFilter", .func=rpc_VolthaGlobalService_CreateAlarmFilter}, |
| 467 | {.name="VolthaGlobalService-GetAlarmFilter", .func=rpc_VolthaGlobalService_GetAlarmFilter}, |
| 468 | {.name="VolthaGlobalService-UpdateAlarmFilter", .func=rpc_VolthaGlobalService_UpdateAlarmFilter}, |
| 469 | {.name="VolthaGlobalService-DeleteAlarmFilter", .func=rpc_VolthaGlobalService_DeleteAlarmFilter}, |
| 470 | {.name="VolthaGlobalService-ListAlarmFilters", .func=rpc_VolthaGlobalService_ListAlarmFilters}, |
| 471 | {.name="VolthaLocalService-GetVolthaInstance", .func=rpc_VolthaLocalService_GetVolthaInstance}, |
| 472 | {.name="VolthaLocalService-GetHealth", .func=rpc_VolthaLocalService_GetHealth}, |
| 473 | {.name="VolthaLocalService-ListAdapters", .func=rpc_VolthaLocalService_ListAdapters}, |
| 474 | {.name="VolthaLocalService-ListLogicalDevices", .func=rpc_VolthaLocalService_ListLogicalDevices}, |
| 475 | {.name="VolthaLocalService-GetLogicalDevice", .func=rpc_VolthaLocalService_GetLogicalDevice}, |
| 476 | {.name="VolthaLocalService-ListLogicalDevicePorts", .func=rpc_VolthaLocalService_ListLogicalDevicePorts}, |
| 477 | {.name="VolthaLocalService-ListLogicalDeviceFlows", .func=rpc_VolthaLocalService_ListLogicalDeviceFlows}, |
| 478 | {.name="VolthaLocalService-UpdateLogicalDeviceFlowTable", .func=rpc_VolthaLocalService_UpdateLogicalDeviceFlowTable}, |
| 479 | {.name="VolthaLocalService-ListLogicalDeviceFlowGroups", .func=rpc_VolthaLocalService_ListLogicalDeviceFlowGroups}, |
| 480 | {.name="VolthaLocalService-UpdateLogicalDeviceFlowGroupTable", .func=rpc_VolthaLocalService_UpdateLogicalDeviceFlowGroupTable}, |
| 481 | {.name="VolthaLocalService-ListDevices", .func=rpc_VolthaLocalService_ListDevices}, |
| 482 | {.name="VolthaLocalService-GetDevice", .func=rpc_VolthaLocalService_GetDevice}, |
| 483 | {.name="VolthaLocalService-CreateDevice", .func=rpc_VolthaLocalService_CreateDevice}, |
| 484 | {.name="VolthaLocalService-EnableDevice", .func=rpc_VolthaLocalService_EnableDevice}, |
| 485 | {.name="VolthaLocalService-DisableDevice", .func=rpc_VolthaLocalService_DisableDevice}, |
| 486 | {.name="VolthaLocalService-RebootDevice", .func=rpc_VolthaLocalService_RebootDevice}, |
| 487 | {.name="VolthaLocalService-DeleteDevice", .func=rpc_VolthaLocalService_DeleteDevice}, |
| 488 | {.name="VolthaLocalService-ListDevicePorts", .func=rpc_VolthaLocalService_ListDevicePorts}, |
| 489 | {.name="VolthaLocalService-ListDevicePmConfigs", .func=rpc_VolthaLocalService_ListDevicePmConfigs}, |
| 490 | {.name="VolthaLocalService-UpdateDevicePmConfigs", .func=rpc_VolthaLocalService_UpdateDevicePmConfigs}, |
| 491 | {.name="VolthaLocalService-ListDeviceFlows", .func=rpc_VolthaLocalService_ListDeviceFlows}, |
| 492 | {.name="VolthaLocalService-ListDeviceFlowGroups", .func=rpc_VolthaLocalService_ListDeviceFlowGroups}, |
| 493 | {.name="VolthaLocalService-ListDeviceTypes", .func=rpc_VolthaLocalService_ListDeviceTypes}, |
| 494 | {.name="VolthaLocalService-GetDeviceType", .func=rpc_VolthaLocalService_GetDeviceType}, |
| 495 | {.name="VolthaLocalService-ListDeviceGroups", .func=rpc_VolthaLocalService_ListDeviceGroups}, |
| 496 | {.name="VolthaLocalService-GetDeviceGroup", .func=rpc_VolthaLocalService_GetDeviceGroup}, |
| 497 | {.name="VolthaLocalService-StreamPacketsOut", .func=rpc_VolthaLocalService_StreamPacketsOut}, |
| 498 | {.name="VolthaLocalService-ReceivePacketsIn", .func=rpc_VolthaLocalService_ReceivePacketsIn}, |
| 499 | {.name="VolthaLocalService-ReceiveChangeEvents", .func=rpc_VolthaLocalService_ReceiveChangeEvents}, |
| 500 | {.name="VolthaLocalService-CreateAlarmFilter", .func=rpc_VolthaLocalService_CreateAlarmFilter}, |
| 501 | {.name="VolthaLocalService-GetAlarmFilter", .func=rpc_VolthaLocalService_GetAlarmFilter}, |
| 502 | {.name="VolthaLocalService-UpdateAlarmFilter", .func=rpc_VolthaLocalService_UpdateAlarmFilter}, |
| 503 | {.name="VolthaLocalService-DeleteAlarmFilter", .func=rpc_VolthaLocalService_DeleteAlarmFilter}, |
| 504 | {.name="VolthaLocalService-ListAlarmFilters", .func=rpc_VolthaLocalService_ListAlarmFilters} |
| 505 | } |
| 506 | }; |
| 507 | |
| 508 | /* |
| 509 | * Structure transapi_file_callbacks provides mapping between specific files |
| 510 | * (e.g. configuration file in /etc/) and the callback function executed when |
| 511 | * the file is modified. |
| 512 | * The structure is empty by default. Add items, as in example, as you need. |
| 513 | * |
| 514 | * Example: |
| 515 | * int example_callback(const char *filepath, xmlDocPtr *edit_config, int *exec) { |
| 516 | * // do the job with changed file content |
| 517 | * // if needed, set edit_config parameter to the edit-config data to be applied |
| 518 | * // if needed, set exec to 1 to perform consequent transapi callbacks |
| 519 | * return 0; |
| 520 | * } |
| 521 | * |
| 522 | * struct transapi_file_callbacks file_clbks = { |
| 523 | * .callbacks_count = 1, |
| 524 | * .callbacks = { |
| 525 | * {.path = "/etc/my_cfg_file", .func = example_callback} |
| 526 | * } |
| 527 | * } |
| 528 | */ |
| 529 | struct transapi_file_callbacks file_clbks = { |
| 530 | .callbacks_count = 0, |
| 531 | .callbacks = {{NULL}} |
| 532 | }; |
| 533 | |