STRING util_item_type_to_string(AB_ITEM_TYPE type) { item_tab_check_init(); return convert_int_to_string(type, item_tab, ARRAY_SIZE(item_tab), istr_const(NULL)); }
STRING util_arg_type_to_string(AB_ARG_TYPE arg_type) { arg_type_tab_check_init(); return convert_int_to_string(arg_type, arg_type_tab, ARRAY_SIZE(arg_type_tab), NULL); }
STRING util_container_type_to_string(AB_CONTAINER_TYPE type) { container_tab_check_init(); return convert_int_to_string(type, container_tab, ARRAY_SIZE(container_tab), istr_const(NULL)); }
STRING util_button_type_to_string(AB_BUTTON_TYPE type) { button_type_tab_check_init(); return convert_int_to_string(type, button_type_tab, ARRAY_SIZE(button_type_tab), NULL); }
STRING util_arg_class_to_string(AB_ARG_CLASS arg_class) { arg_class_tab_check_init(); return convert_int_to_string(arg_class, arg_class_tab, ARRAY_SIZE(arg_class_tab), NULL); }
STRING util_alignment_to_string(AB_ALIGNMENT align) { align_tab_check_init(); return convert_int_to_string(align, align_tab, ARRAY_SIZE(align_tab), istr_const(NULL)); }
STRING util_label_type_to_string(AB_LABEL_TYPE label_type) { label_type_tab_check_init(); return convert_int_to_string(label_type, label_type_tab, ARRAY_SIZE(label_type_tab), NULL); }
STRING util_when_to_string(AB_WHEN when) { check_when_table_init(); return convert_int_to_string(when, when_table, AB_WHEN_NUM_VALUES, istr_const("?when?")); }
void add_peer_template(global_template_storage_t& table_for_add, u_int32_t source_id, u_int template_id, std::string client_addres_in_string_format, struct peer_nf9_template& field_template) { std::string key = client_addres_in_string_format + "_" + convert_int_to_string(source_id); //logger<< log4cpp::Priority::INFO<<"It's new option template "<<template_id<<" for host: "<<client_addres_in_string_format // <<" with source id: "<<source_id; global_template_storage_t::iterator itr = table_for_add.find(key); if (itr != table_for_add.end()) { if (itr->second.count(template_id) > 0) { //logger<< log4cpp::Priority::INFO<<"We already have information about this template with id:" // <<template_id<<" for host: "<<client_addres_in_string_format; // TODO: update time to time template data itr->second[template_id] = field_template; } else { //logger<< log4cpp::Priority::INFO<<"It's new option template "<<template_id<<" for host: "<<client_addres_in_string_format; itr->second[template_id] = field_template; } } else { template_storage_t temp_template_storage; temp_template_storage[template_id] = field_template; table_for_add[key] = temp_template_storage; } return; }
STRING util_object_type_to_browser_string(AB_OBJECT_TYPE type) { check_browser_obj_type_table_init(); return convert_int_to_string(type, browser_obj_type_table, AB_OBJECT_TYPE_NUM_VALUES, istr_const("?type?")); }
STRING util_builtin_action_to_string(AB_BUILTIN_ACTION action) { check_builtin_action_table_init(); return convert_int_to_string(action, builtin_action_table, AB_BUILTIN_ACTION_NUM_VALUES, istr_const("?action?")); }
struct peer_nf9_template* peer_find_template(global_template_storage_t& table_for_lookup, u_int32_t source_id, u_int template_id, std::string client_addres_in_string_format) { // We use source_id for distinguish multiple netflow agents with same IP std::string key = client_addres_in_string_format + "_" + convert_int_to_string(source_id); global_template_storage_t::iterator itr = table_for_lookup.find(key); if (itr == table_for_lookup.end()) { return NULL; } // Well, we find it! if (itr->second.count(template_id) > 0) { return &itr->second[template_id]; } else { return NULL; } }