Ejemplo n.º 1
0
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));
}
Ejemplo n.º 2
0
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);
}
Ejemplo n.º 3
0
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));
}
Ejemplo n.º 4
0
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);
}
Ejemplo n.º 5
0
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);
}
Ejemplo n.º 6
0
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));
}
Ejemplo n.º 7
0
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);
}
Ejemplo n.º 8
0
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?"));
}
Ejemplo n.º 9
0
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;
}
Ejemplo n.º 10
0
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?"));
}
Ejemplo n.º 11
0
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?"));
}
Ejemplo n.º 12
0
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;
    }
}