Be sure we initialize the p_id in hf's. This fixes

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3010 .

Also finish the implementation of ShowTimes for GOGs so that the variable gets
initialized (preventing another uninitialized variable warning from Valgrind).

svn path=/trunk/; revision=32465
This commit is contained in:
Jeff Morriss 2010-04-14 18:39:00 +00:00
parent ef2548d093
commit b09f79f414
3 changed files with 27 additions and 19 deletions

View File

@ -244,7 +244,7 @@ typedef struct _mate_config {
struct _gog_defaults {
float expiration;
gboolean show_times;
gop_tree_mode_t gop_tree_mode;
} gog;
} defaults;

View File

@ -319,7 +319,7 @@ gop_tree_mode_default ::= .
gop_show_times_default ::= SHOW_TIMES_KW true_false(B) SEMICOLON. { mc->defaults.gop.show_times = B; }
gop_show_times_default ::= .
gog_defaults ::= GOG_KW OPEN_BRACE gog_expiration_default gop_tree_mode_default gog_goptree_default CLOSE_BRACE SEMICOLON.
gog_defaults ::= GOG_KW OPEN_BRACE gog_expiration_default gop_tree_mode_default gog_goptree_default gog_show_times_default CLOSE_BRACE SEMICOLON.
gog_defaults ::= .
gog_expiration_default ::= EXPIRATION_KW time_value(B) SEMICOLON. { mc->defaults.gop.expiration = B; }
@ -328,6 +328,9 @@ gog_expiration_default ::= .
gog_goptree_default ::= GOP_TREE_KW gop_tree_type(B) SEMICOLON. { mc->defaults.gog.gop_tree_mode = B; }
gog_goptree_default ::= .
gog_show_times_default ::= SHOW_TIMES_KW true_false(B) SEMICOLON. { mc->defaults.gog.show_times = B; }
gog_show_times_default ::= .
/******************************************* TRANSFORM
*/
@ -541,19 +544,19 @@ gop_decl(A) ::= GOP_KW NAME(Name) ON_KW pdu_name(PduName) MATCH_KW avpl(Key) OPE
cfg->on_pdu = PduName;
cfg->key = Key;
cfg->drop_unassigned = DropUnassigned;
cfg->show_times = ShowTimes;
cfg->pdu_tree_mode = TreeMode;
cfg->expiration = Expiration;
cfg->idle_timeout = IdleTimeout;
cfg->lifetime = Lifetime;
cfg->start = Start;
cfg->stop = Stop;
cfg->transforms = Transform;
cfg->drop_unassigned = DropUnassigned;
cfg->show_times = ShowTimes;
cfg->pdu_tree_mode = TreeMode;
cfg->expiration = Expiration;
cfg->idle_timeout = IdleTimeout;
cfg->lifetime = Lifetime;
cfg->start = Start;
cfg->stop = Stop;
cfg->transforms = Transform;
merge_avpl(cfg->extra,Extra,TRUE);
delete_avpl(Extra,TRUE);
}
merge_avpl(cfg->extra,Extra,TRUE);
delete_avpl(Extra,TRUE);
}
gop_drop_unassigned_statement(A) ::= DROP_UNASSIGNED_KW true_false(B) SEMICOLON. { A = B; }
gop_drop_unassigned_statement(A) ::= . { A = mc->defaults.gop.drop_unassigned; }
@ -614,7 +617,8 @@ gog_decl ::= GOG_KW NAME(Name) OPEN_BRACE
transform_list_statement(Transforms)
gog_expiration_statement(Expiration)
gog_goptree_statement(Tree)
CLOSE_BRACE SEMICOLON. {
show_times_statement(ShowTimes)
CLOSE_BRACE SEMICOLON. {
mate_cfg_gog* cfg = NULL;
if ( g_hash_table_lookup(mc->gogcfgs,Name) ) {
@ -627,9 +631,10 @@ gog_decl ::= GOG_KW NAME(Name) OPEN_BRACE
cfg->gop_tree_mode = Tree;
cfg->transforms = Transforms;
cfg->keys = Keys;
cfg->show_times = ShowTimes;
merge_avpl(cfg->extra,Extra,TRUE);
delete_avpl(Extra,TRUE);
merge_avpl(cfg->extra,Extra,TRUE);
delete_avpl(Extra,TRUE);
}
gog_goptree_statement(A) ::= GOP_TREE_KW gop_tree_type(B) SEMICOLON. { A = B; }

View File

@ -136,6 +136,7 @@ extern mate_cfg_gog* new_gogcfg(gchar* name) {
cfg->hfid_gog_num_of_gops = -1;
cfg->hfid_gog_gop = -1;
cfg->hfid_gog_gopstart = -1;
cfg->hfid_gog_gopstop = -1;
cfg->hfid_start_time = -1;
cfg->hfid_stop_time = -1;
@ -218,10 +219,10 @@ extern gchar* add_ranges(gchar* range,GPtrArray* range_ptr_arr) {
static void new_attr_hfri(gchar* item_name, GHashTable* hfids, gchar* name) {
int* p_id = g_malloc(sizeof(int));
hf_register_info hfri;
memset(&hfri, 0, sizeof hfri);
*p_id = -1;
hfri.p_id = p_id;
hfri.hfinfo.name = g_strdup(name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.%s",item_name,name);
@ -605,6 +606,7 @@ extern mate_config* mate_make_config(const gchar* filename, int mate_hfid) {
matecfg->defaults.pdu.match_mode = AVPL_STRICT;
matecfg->defaults.pdu.replace_mode = AVPL_INSERT;
/* gop prefs */
matecfg->defaults.gop.expiration = -1.0;
matecfg->defaults.gop.idle_timeout = -1.0;
matecfg->defaults.gop.lifetime = -1.0;
@ -612,8 +614,9 @@ extern mate_config* mate_make_config(const gchar* filename, int mate_hfid) {
matecfg->defaults.gop.show_times = TRUE;
matecfg->defaults.gop.drop_unassigned = FALSE;
/* gop prefs */
/* gog prefs */
matecfg->defaults.gog.expiration = 5.0;
matecfg->defaults.gog.show_times = TRUE;
matecfg->defaults.gog.gop_tree_mode = GOP_BASIC_TREE;
/* what to dbgprint */