/usr/include/sml/sml_tree.h is in libsml-dev 0.1.1+git20170608-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | // Copyright 2011 Juri Glass, Mathias Runge, Nadim El Sayed
// DAI-Labor, TU-Berlin
//
// This file is part of libSML.
//
// libSML is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// libSML is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.
#ifndef SML_TREE_H_
#define SML_TREE_H_
#include "sml_shared.h"
#include "sml_octet_string.h"
#include "sml_value.h"
#include "sml_time.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SML_PROC_PAR_VALUE_TAG_VALUE 0x01
#define SML_PROC_PAR_VALUE_TAG_PERIOD_ENTRY 0x02
#define SML_PROC_PAR_VALUE_TAG_TUPEL_ENTRY 0x03
#define SML_PROC_PAR_VALUE_TAG_TIME 0x04
// what a messy tupel ...
typedef struct {
octet_string *server_id;
sml_time *sec_index;
u64 *status;
sml_unit *unit_pA;
i8 *scaler_pA;
i64 *value_pA;
sml_unit *unit_R1;
i8 *scaler_R1;
i64 *value_R1;
sml_unit *unit_R4;
i8 *scaler_R4;
i64 *value_R4;
octet_string *signature_pA_R1_R4;
sml_unit *unit_mA;
i8 *scaler_mA;
i64 *value_mA;
sml_unit *unit_R2;
i8 *scaler_R2;
i64 *value_R2;
sml_unit *unit_R3;
i8 *scaler_R3;
i64 *value_R3;
octet_string *signature_mA_R2_R3;
} sml_tupel_entry;
typedef struct {
octet_string *obj_name;
sml_unit *unit;
i8 *scaler;
sml_value *value;
octet_string *value_signature;
} sml_period_entry;
typedef struct {
u8 *tag;
union {
sml_value *value;
sml_period_entry *period_entry;
sml_tupel_entry *tupel_entry;
sml_time *time;
} data;
} sml_proc_par_value;
typedef struct s_tree{
octet_string *parameter_name;
sml_proc_par_value *parameter_value; // optional
struct s_tree **child_list; // optional
int child_list_len;
} sml_tree;
typedef struct {
int path_entries_len;
octet_string **path_entries;
} sml_tree_path;
// sml_tree;
sml_tree *sml_tree_init();
sml_tree *sml_tree_parse(sml_buffer *buf);
void sml_tree_add_tree(sml_tree *base_tree, sml_tree *tree);
void sml_tree_write(sml_tree *tree, sml_buffer *buf);
void sml_tree_free(sml_tree *tree);
// sml_tree_path;
sml_tree_path *sml_tree_path_init();
sml_tree_path *sml_tree_path_parse(sml_buffer *buf);
void sml_tree_path_add_path_entry(sml_tree_path *tree_path, octet_string *entry);
void sml_tree_path_write(sml_tree_path *tree_path, sml_buffer *buf);
void sml_tree_path_free(sml_tree_path *tree_path);
// sml_proc_par_value;
sml_proc_par_value *sml_proc_par_value_init();
sml_proc_par_value *sml_proc_par_value_parse(sml_buffer *buf);
void sml_proc_par_value_write(sml_proc_par_value *value, sml_buffer *buf);
void sml_proc_par_value_free(sml_proc_par_value *value);
// sml_tupel_entry;
sml_tupel_entry *sml_tupel_entry_init();
sml_tupel_entry *sml_tupel_entry_parse(sml_buffer *buf);
void sml_tupel_entry_write(sml_tupel_entry *tupel, sml_buffer *buf);
void sml_tupel_entry_free(sml_tupel_entry *tupel);
// sml_period_entry;
sml_period_entry *sml_period_entry_init();
sml_period_entry *sml_period_entry_parse(sml_buffer *buf);
void sml_period_entry_write(sml_period_entry *period, sml_buffer *buf);
void sml_period_entry_free(sml_period_entry *period);
#ifdef __cplusplus
}
#endif
#endif /* SML_TREE_H_ */
|