int wtap_register_encap_type(const char* name, const char* short_name) { struct encap_type_info e; wtap_init_encap_types(); e.name = g_strdup(name); e.short_name = g_strdup(short_name); g_array_append_val(encap_table_arr,e); return wtap_num_encap_types++; }
/* * Initialize the library. */ void wtap_init(gboolean load_wiretap_plugins) { init_open_routines(); wtap_opttypes_initialize(); wtap_init_encap_types(); if (load_wiretap_plugins) { #ifdef HAVE_PLUGINS libwiretap_plugins = plugins_init(WS_PLUGIN_WIRETAP); g_slist_foreach(wtap_plugins, call_plugin_register_wtap_module, NULL); #endif } }
int wtap_get_num_encap_types(void) { wtap_init_encap_types(); return wtap_num_encap_types; }