Skip to content

Commit dd0351c

Browse files
author
Kirc
committed
Remove load_types_from_xml
1 parent c6a6d56 commit dd0351c

File tree

2 files changed

+0
-89
lines changed

2 files changed

+0
-89
lines changed

plugins/storage/fastbit/fastbit.cpp

-79
Original file line numberDiff line numberDiff line change
@@ -130,80 +130,6 @@ int get_len_from_type(ELEMENT_TYPE type)
130130
return len;
131131
}
132132

133-
/**
134-
* \brief Load elements types from xml to configure structure
135-
*
136-
* This function reads ipfix-elements.xml
137-
* and stores elements data type in configuration structure
138-
*
139-
* @param conf fastbit storage plug-in configuration structure
140-
*/
141-
int load_types_from_xml(struct fastbit_config *conf)
142-
{
143-
pugi::xml_document doc;
144-
pugi::xml_parse_result result;
145-
uint32_t en;
146-
uint16_t id;
147-
int len;
148-
std::string str_value;
149-
150-
result = doc.load_file(ipfix_elements);
151-
152-
/* Check for errors */
153-
if (!result) {
154-
MSG_ERROR(msg_module, "Error while parsing '%s': %s", ipfix_elements, result.description());
155-
return -1;
156-
}
157-
158-
pugi::xpath_node_set elements = doc.select_nodes("/ipfix-elements/element");
159-
for (pugi::xpath_node_set::const_iterator it = elements.begin(); it != elements.end(); ++it)
160-
{
161-
str_value = it->node().child_value("enterprise");
162-
en = strtoul(str_value.c_str(), NULL, 0);
163-
164-
str_value = it->node().child_value("id");
165-
id = strtoul(str_value.c_str(), NULL, 0);
166-
167-
/* Obtain field type */
168-
str_value = it->node().child_value("dataType");
169-
170-
/* Obtain field length */
171-
if (str_value == "unsigned64" \
172-
or str_value == "dateTimeMilliseconds" \
173-
or str_value == "dateTimeMicroseconds" \
174-
or str_value == "dateTimeNanoseconds" \
175-
or str_value == "macAddress" \
176-
or str_value == "float64" \
177-
or str_value == "signed64") {
178-
len = 8;
179-
} else if (str_value == "unsigned32" \
180-
or str_value == "dateTimeSeconds" \
181-
or str_value == "ipv4Address" \
182-
or str_value == "boolean" \
183-
or str_value == "float32" \
184-
or str_value == "signed32") {
185-
len = 4;
186-
} else if (str_value == "unsigned16" \
187-
or str_value == "signed16") {
188-
len = 2;
189-
} else if (str_value == "unsigned8" \
190-
or str_value == "signed8") {
191-
len = 1;
192-
} else if (str_value == "ipv6Address" \
193-
or str_value == "string" \
194-
or str_value == "octetArray" \
195-
or str_value == "basicList" \
196-
or str_value == "subTemplateList" \
197-
or str_value == "subTemplateMultiList") {
198-
len = -1;
199-
}
200-
201-
// (*conf->elements_lengths)[en][id] = len;
202-
}
203-
204-
return 0;
205-
}
206-
207133
void *reorder_index(void *config)
208134
{
209135
struct fastbit_config *conf = static_cast<struct fastbit_config*>(config);
@@ -401,11 +327,6 @@ int process_startup_xml(char *params, struct fastbit_config *c)
401327
doc.load(params);
402328

403329
if (doc) {
404-
/* Load element types from XML */
405-
if (load_types_from_xml(c) != 0) {
406-
return 1;
407-
}
408-
409330
pugi::xpath_node ie = doc.select_single_node("fileWriter");
410331
path = ie.node().child_value("path");
411332

plugins/storage/fastbit/fastbit.h

-10
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,4 @@ struct od_info {
9898
*/
9999
int get_len_from_type(ELEMENT_TYPE type);
100100

101-
/**
102-
* \brief Load elements types from xml to configure structure
103-
*
104-
* This function reads ipfix-elements.xml
105-
* and stores elements data type in configuration structure
106-
*
107-
* @param conf fastbit storage plug-in configuration structure
108-
*/
109-
int load_types_from_xml(struct fastbit_config *conf);
110-
111101
#endif /* FASTBIT_H_ */

0 commit comments

Comments
 (0)