TR181-XPON  1.4.0
TR-181 PON manager.
dm_info.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** SPDX-License-Identifier: BSD-2-Clause-Patent
4 **
5 ** SPDX-FileCopyrightText: Copyright (c) 2022 SoftAtHome
6 **
7 ** Redistribution and use in source and binary forms, with or
8 ** without modification, are permitted provided that the following
9 ** conditions are met:
10 **
11 ** 1. Redistributions of source code must retain the above copyright
12 ** notice, this list of conditions and the following disclaimer.
13 **
14 ** 2. Redistributions in binary form must reproduce the above
15 ** copyright notice, this list of conditions and the following
16 ** disclaimer in the documentation and/or other materials provided
17 ** with the distribution.
18 **
19 ** Subject to the terms and conditions of this license, each
20 ** copyright holder and contributor hereby grants to those receiving
21 ** rights under this license a perpetual, worldwide, non-exclusive,
22 ** no-charge, royalty-free, irrevocable (except for failure to
23 ** satisfy the conditions of this license) patent license to make,
24 ** have made, use, offer to sell, sell, import, and otherwise
25 ** transfer this software, where such license applies only to those
26 ** patent claims, already acquired or hereafter acquired, licensable
27 ** by such copyright holder or contributor that are necessarily
28 ** infringed by:
29 **
30 ** (a) their Contribution(s) (the licensed copyrights of copyright
31 ** holders and non-copyrightable additions of contributors, in
32 ** source or binary form) alone; or
33 **
34 ** (b) combination of their Contribution(s) with the work of
35 ** authorship to which such Contribution(s) was added by such
36 ** copyright holder or contributor, if, at the time the Contribution
37 ** is added, such addition causes such combination to be necessarily
38 ** infringed. The patent license shall not apply to any other
39 ** combinations which include the Contribution.
40 **
41 ** Except as expressly stated above, no rights or licenses from any
42 ** copyright holder or contributor is granted under this license,
43 ** whether expressly, by implication, estoppel or otherwise.
44 **
45 ** DISCLAIMER
46 **
47 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
48 ** CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
49 ** INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
50 ** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
51 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
52 ** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
53 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
54 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
55 ** USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
56 ** AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
58 ** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
59 ** POSSIBILITY OF SUCH DAMAGE.
60 **
61 ****************************************************************************/
62 
63 #ifndef __dm_info_h__
64 #define __dm_info_h__
65 
71 #include <stdbool.h>
72 #include <stdint.h>
73 
74 #define ENABLE_PARAM "Enable"
75 
76 #define NAME_PARAM "Name"
77 #define NAME_PARAM_LEN 4
78 
79 typedef enum _xpon_object_id {
93 
94 typedef struct _param_info {
95  const char* name;
96  uint32_t type; /* One of the AMXC_VAR_ID values */
98 
99 
122 typedef struct _object_info {
124  const char* name;
125  const char* generic_path;
126  const char* key_name;
127  uint32_t key_max_value;
128  const char* singletons;
129  const char* templates;
131  uint32_t n_params;
134 
135 bool dm_info_init(void);
136 
137 object_id_t dm_get_object_id(const char* path);
138 
140 
141 bool dm_get_object_param_info(object_id_t id, const param_info_t** param_info,
142  uint32_t* size);
143 
144 #endif
bool dm_info_init(void)
Definition: dm_info.c:297
struct _object_info object_info_t
bool dm_get_object_param_info(object_id_t id, const param_info_t **param_info, uint32_t *size)
Definition: dm_info.c:429
object_id_t dm_get_object_id(const char *path)
Definition: dm_info.c:380
enum _xpon_object_id object_id_t
_xpon_object_id
Definition: dm_info.h:79
@ obj_id_ani
Definition: dm_info.h:83
@ obj_id_nbr
Definition: dm_info.h:90
@ obj_id_gem_port
Definition: dm_info.h:84
@ obj_id_onu
Definition: dm_info.h:80
@ obj_id_ani_tc_authentication
Definition: dm_info.h:87
@ obj_id_ethernet_uni
Definition: dm_info.h:82
@ obj_id_ani_tc_alarms
Definition: dm_info.h:89
@ obj_id_software_image
Definition: dm_info.h:81
@ obj_id_unknown
Definition: dm_info.h:91
@ obj_id_ani_tc_performance_thresholds
Definition: dm_info.h:88
@ obj_id_transceiver
Definition: dm_info.h:85
@ obj_id_ani_tc_onu_activation
Definition: dm_info.h:86
struct _param_info param_info_t
const object_info_t * dm_get_object_info(object_id_t id)
Definition: dm_info.c:410
const char * name
Definition: dm_info.h:124
const param_info_t * params
Definition: dm_info.h:130
uint32_t n_params
Definition: dm_info.h:131
const char * singletons
Definition: dm_info.h:128
object_id_t id
Definition: dm_info.h:123
const char * templates
Definition: dm_info.h:129
bool has_rw_enable
Definition: dm_info.h:132
uint32_t key_max_value
Definition: dm_info.h:127
const char * key_name
Definition: dm_info.h:126
const char * generic_path
Definition: dm_info.h:125
const char * name
Definition: dm_info.h:95
uint32_t type
Definition: dm_info.h:96