There are no "old" versions of them that we're keeping around.
Change-Id: I3c76a14d0ec1a06df39c547da37f4dea9987df4d
Reviewed-on: https://code.wireshark.org/review/25892
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
ncp_nds_verb_vals@Base 2.1.0
new_frame_data_sequence@Base 1.12.0~rc1
new_page@Base 1.12.0~rc1
- new_stat_tap_add_table@Base 1.99.8
- new_stat_tap_by_name@Base 2.3.0
- new_stat_tap_get_field_data@Base 1.99.8
- new_stat_tap_get_filter@Base 1.99.8
- new_stat_tap_init_table@Base 1.99.8
- new_stat_tap_init_table_row@Base 1.99.8
- new_stat_tap_iterate_tables@Base 1.99.8
- new_stat_tap_set_field_data@Base 1.99.8
next_tvb_add_handle@Base 1.9.1
next_tvb_add_string@Base 1.9.1
next_tvb_add_uint@Base 1.9.1
sss_verb_enum@Base 2.1.0
start_requested_stats@Base 1.9.1
stat_node_array_sortcmp@Base 1.12.0~rc1
+ stat_tap_add_table@Base 2.5.1
+ stat_tap_by_name@Base 2.5.1
+ stat_tap_get_field_data@Base 2.5.1
+ stat_tap_get_filter@Base 2.5.1
+ stat_tap_init_table@Base 2.5.1
+ stat_tap_init_table_row@Base 2.5.1
+ stat_tap_iterate_tables@Base 2.5.1
+ stat_tap_set_field_data@Base 2.5.1
stats_tree_branch_max_namelen@Base 1.9.1
stats_tree_create_node@Base 1.9.1
stats_tree_create_node_by_pname@Base 1.9.1
{TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Count", " %d "}, {TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Total Bytes", " %d "},
{TABLE_ITEM_FLOAT, TAP_ALIGN_RIGHT, "Avg Bytes", " %8.2f "}};
-static void ansi_map_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void ansi_map_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
int num_fields = sizeof(stat_fields)/sizeof(stat_tap_table_item);
- stat_tap_table* table = new_stat_tap_init_table("ANSI MAP Operation Statistics", num_fields, 0, "ansi_map.op_code", gui_callback, gui_data);
+ stat_tap_table* table = stat_tap_init_table("ANSI MAP Operation Statistics", num_fields, 0, "ansi_map.op_code", gui_callback, gui_data);
int i = 0;
stat_tap_table_item_type items[sizeof(stat_fields)/sizeof(stat_tap_table_item)];
- new_stat_tap_add_table(new_stat, table);
+ stat_tap_add_table(new_stat, table);
/* Add a fow for each value type */
while (ansi_map_opr_code_strings[i].strptr)
items[AVG_BYTES_COLUMN].type = TABLE_ITEM_FLOAT;
items[AVG_BYTES_COLUMN].value.float_value = 0.0f;
- new_stat_tap_init_table_row(table, ansi_map_opr_code_strings[i].value, num_fields, items);
+ stat_tap_init_table_row(table, ansi_map_opr_code_strings[i].value, num_fields, items);
i++;
}
}
static gboolean
ansi_map_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const ansi_map_tap_rec_t *data_p = (const ansi_map_tap_rec_t *)data;
stat_tap_table* table;
stat_tap_table_item_type* item_data;
table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i);
- item_data = new_stat_tap_get_field_data(table, data_p->message_type, COUNT_COLUMN);
+ item_data = stat_tap_get_field_data(table, data_p->message_type, COUNT_COLUMN);
item_data->value.uint_value++;
count = item_data->value.uint_value;
- new_stat_tap_set_field_data(table, data_p->message_type, COUNT_COLUMN, item_data);
+ stat_tap_set_field_data(table, data_p->message_type, COUNT_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, data_p->message_type, TOTAL_BYTES_COLUMN);
+ item_data = stat_tap_get_field_data(table, data_p->message_type, TOTAL_BYTES_COLUMN);
item_data->value.uint_value += data_p->size;
total_bytes = item_data->value.uint_value;
- new_stat_tap_set_field_data(table, data_p->message_type, TOTAL_BYTES_COLUMN, item_data);
+ stat_tap_set_field_data(table, data_p->message_type, TOTAL_BYTES_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, data_p->message_type, AVG_BYTES_COLUMN);
+ item_data = stat_tap_get_field_data(table, data_p->message_type, AVG_BYTES_COLUMN);
item_data->value.float_value = (float)total_bytes/(float)count;
- new_stat_tap_set_field_data(table, data_p->message_type, AVG_BYTES_COLUMN, item_data);
+ stat_tap_set_field_data(table, data_p->message_type, AVG_BYTES_COLUMN, item_data);
return TRUE;
}
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, COUNT_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, COUNT_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, TOTAL_BYTES_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, TOTAL_BYTES_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, TOTAL_BYTES_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, TOTAL_BYTES_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, AVG_BYTES_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, AVG_BYTES_COLUMN);
item_data->value.float_value = 0.0f;
- new_stat_tap_set_field_data(table, element, AVG_BYTES_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, AVG_BYTES_COLUMN, item_data);
}
}
static stat_tap_table_item camel_stat_fields[] = {{TABLE_ITEM_STRING, TAP_ALIGN_LEFT, "Message Type or Reason", "%-25s"}, {TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Count", "%d"}};
-static void camel_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void camel_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
int num_fields = sizeof(camel_stat_fields)/sizeof(stat_tap_table_item);
- stat_tap_table* table = new_stat_tap_init_table("CAMEL Message Counters", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_table* table = stat_tap_init_table("CAMEL Message Counters", num_fields, 0, NULL, gui_callback, gui_data);
int i;
stat_tap_table_item_type items[sizeof(camel_stat_fields)/sizeof(stat_tap_table_item)];
- new_stat_tap_add_table(new_stat, table);
+ stat_tap_add_table(new_stat, table);
items[MESSAGE_TYPE_COLUMN].type = TABLE_ITEM_STRING;
items[COUNT_COLUMN].type = TABLE_ITEM_UINT;
}
items[MESSAGE_TYPE_COLUMN].value.string_value = col_str;
- new_stat_tap_init_table_row(table, i, num_fields, items);
+ stat_tap_init_table_row(table, i, num_fields, items);
}
}
static gboolean
camel_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *csi_ptr)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const struct camelsrt_info_t *csi = (const struct camelsrt_info_t *) csi_ptr;
stat_tap_table* table;
stat_tap_table_item_type* msg_data;
table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i);
if (csi->opcode >= table->num_elements)
return FALSE;
- msg_data = new_stat_tap_get_field_data(table, csi->opcode, COUNT_COLUMN);
+ msg_data = stat_tap_get_field_data(table, csi->opcode, COUNT_COLUMN);
msg_data->value.uint_value++;
- new_stat_tap_set_field_data(table, csi->opcode, COUNT_COLUMN, msg_data);
+ stat_tap_set_field_data(table, csi->opcode, COUNT_COLUMN, msg_data);
return TRUE;
}
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, COUNT_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, COUNT_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
}
}
{TABLE_ITEM_FLOAT, TAP_ALIGN_RIGHT, "Avg Bytes", "%d"},
};
-static void gsm_map_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void gsm_map_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
int num_fields = sizeof(gsm_map_stat_fields)/sizeof(stat_tap_table_item);
stat_tap_table* table;
items[TOT_BYTES_COLUMN].type = TABLE_ITEM_UINT;
items[AVG_BYTES_COLUMN].type = TABLE_ITEM_FLOAT;
- table = new_stat_tap_init_table("GSM MAP Operation Statistics", num_fields, 0, NULL, gui_callback, gui_data);
- new_stat_tap_add_table(new_stat, table);
+ table = stat_tap_init_table("GSM MAP Operation Statistics", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_add_table(new_stat, table);
/* Add a row for each value type */
for (i = 0; i < GSM_MAP_MAX_NUM_OPR_CODES; i++)
items[ID_COLUMN].value.uint_value = i;
items[OP_CODE_COLUMN].value.string_value = col_str;
- new_stat_tap_init_table_row(table, i, num_fields, items);
+ stat_tap_init_table_row(table, i, num_fields, items);
}
}
static gboolean
gsm_map_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gmtr_ptr)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const gsm_map_tap_rec_t *gmtr = (const gsm_map_tap_rec_t *)gmtr_ptr;
stat_tap_table* table;
stat_tap_table_item_type *invoke_data, *fwd_bytes_data, *result_data, *rev_bytes_data, *avg_data;
table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i);
- invoke_data = new_stat_tap_get_field_data(table, gmtr->opcode, INVOKES_COLUMN);
- fwd_bytes_data = new_stat_tap_get_field_data(table, gmtr->opcode, NUM_BYTES_FWD_COLUMN);
- result_data = new_stat_tap_get_field_data(table, gmtr->opcode, RET_RES_COLUMN);
- rev_bytes_data = new_stat_tap_get_field_data(table, gmtr->opcode, NUM_BYTES_REV_COLUMN);
+ invoke_data = stat_tap_get_field_data(table, gmtr->opcode, INVOKES_COLUMN);
+ fwd_bytes_data = stat_tap_get_field_data(table, gmtr->opcode, NUM_BYTES_FWD_COLUMN);
+ result_data = stat_tap_get_field_data(table, gmtr->opcode, RET_RES_COLUMN);
+ rev_bytes_data = stat_tap_get_field_data(table, gmtr->opcode, NUM_BYTES_REV_COLUMN);
if (gmtr->invoke)
{
invoke_data->value.uint_value++;
- new_stat_tap_set_field_data(table, gmtr->opcode, INVOKES_COLUMN, invoke_data);
+ stat_tap_set_field_data(table, gmtr->opcode, INVOKES_COLUMN, invoke_data);
fwd_bytes_data->value.uint_value += gmtr->size;
- new_stat_tap_set_field_data(table, gmtr->opcode, NUM_BYTES_FWD_COLUMN, fwd_bytes_data);
+ stat_tap_set_field_data(table, gmtr->opcode, NUM_BYTES_FWD_COLUMN, fwd_bytes_data);
}
else
{
result_data->value.uint_value++;
- new_stat_tap_set_field_data(table, gmtr->opcode, RET_RES_COLUMN, result_data);
+ stat_tap_set_field_data(table, gmtr->opcode, RET_RES_COLUMN, result_data);
rev_bytes_data->value.uint_value += gmtr->size;
- new_stat_tap_set_field_data(table, gmtr->opcode, NUM_BYTES_REV_COLUMN, rev_bytes_data);
+ stat_tap_set_field_data(table, gmtr->opcode, NUM_BYTES_REV_COLUMN, rev_bytes_data);
}
invokes = invoke_data->value.uint_value;
if (gmtr->invoke)
{
- avg_data = new_stat_tap_get_field_data(table, gmtr->opcode, AVG_BYTES_FWD_COLUMN);
+ avg_data = stat_tap_get_field_data(table, gmtr->opcode, AVG_BYTES_FWD_COLUMN);
avg_data->value.float_value += (float) fwd_bytes / invokes;
- new_stat_tap_set_field_data(table, gmtr->opcode, AVG_BYTES_FWD_COLUMN, avg_data);
+ stat_tap_set_field_data(table, gmtr->opcode, AVG_BYTES_FWD_COLUMN, avg_data);
}
else
{
- avg_data = new_stat_tap_get_field_data(table, gmtr->opcode, AVG_BYTES_REV_COLUMN);
+ avg_data = stat_tap_get_field_data(table, gmtr->opcode, AVG_BYTES_REV_COLUMN);
avg_data->value.float_value += (float) rev_bytes / results;
- new_stat_tap_set_field_data(table, gmtr->opcode, AVG_BYTES_REV_COLUMN, avg_data);
+ stat_tap_set_field_data(table, gmtr->opcode, AVG_BYTES_REV_COLUMN, avg_data);
}
- avg_data = new_stat_tap_get_field_data(table, gmtr->opcode, AVG_BYTES_COLUMN);
+ avg_data = stat_tap_get_field_data(table, gmtr->opcode, AVG_BYTES_COLUMN);
avg_data->value.float_value += (float) (fwd_bytes + rev_bytes) / (invokes + results);
- new_stat_tap_set_field_data(table, gmtr->opcode, AVG_BYTES_COLUMN, avg_data);
+ stat_tap_set_field_data(table, gmtr->opcode, AVG_BYTES_COLUMN, avg_data);
return TRUE;
}
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, INVOKES_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, INVOKES_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, INVOKES_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, INVOKES_COLUMN, item_data);
}
}
static guint other_idx;
-static void h225_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void h225_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
int num_fields = sizeof(h225_stat_fields)/sizeof(stat_tap_table_item);
- stat_tap_table* table = new_stat_tap_init_table("H.225 Messages and Message Reasons", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_table* table = stat_tap_init_table("H.225 Messages and Message Reasons", num_fields, 0, NULL, gui_callback, gui_data);
int row_idx = 0, msg_idx;
stat_tap_table_item_type items[sizeof(h225_stat_fields)/sizeof(stat_tap_table_item)];
- new_stat_tap_add_table(new_stat, table);
+ stat_tap_add_table(new_stat, table);
items[MESSAGE_TYPE_COLUMN].type = TABLE_ITEM_STRING;
items[COUNT_COLUMN].type = TABLE_ITEM_UINT;
: "Unknown RAS message";
ras_msg_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (h225_RasMessage_vals[msg_idx].strptr);
: "Unknown CS message";
cs_msg_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (T_h323_message_body_vals[msg_idx].strptr);
: "Unknown gatekeeper reject reason";
grj_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (GatekeeperRejectReason_vals[msg_idx].strptr);
: "Unknown registration reject reason";
rrj_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (RegistrationRejectReason_vals[msg_idx].strptr);
: "Unknown unregistration request reason";
urq_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (UnregRequestReason_vals[msg_idx].strptr);
: "Unknown unregistration reject reason";
urj_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (UnregRejectReason_vals[msg_idx].strptr);
: "Unknown admission reject reason";
arj_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (AdmissionRejectReason_vals[msg_idx].strptr);
: "Unknown band reject reason";
brj_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (BandRejectReason_vals[msg_idx].strptr);
: "Unknown disengage reason";
drq_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (DisengageReason_vals[msg_idx].strptr);
: "Unknown disengage reject reason";
drj_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (DisengageRejectReason_vals[msg_idx].strptr);
: "Unknown location reject reason";
lrj_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (LocationRejectReason_vals[msg_idx].strptr);
: "Unknown info request nak reason";
irqnak_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (InfoRequestNakReason_vals[msg_idx].strptr);
: "Unknown release complete reason";
rel_cmp_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (h225_ReleaseCompleteReason_vals[msg_idx].strptr);
: "Unknown facility reason";
facility_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (FacilityReason_vals[msg_idx].strptr);
items[MESSAGE_TYPE_COLUMN].value.string_value = "Unknown H.225 message";
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
other_idx = row_idx;
}
static gboolean
h225_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *hpi_ptr)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const h225_packet_info *hpi = (const h225_packet_info *)hpi_ptr;
int tag_idx = -1;
int reason_idx = -1;
if (tag_idx >= 0) {
stat_tap_table*table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, 0);
- stat_tap_table_item_type* msg_data = new_stat_tap_get_field_data(table, tag_idx, COUNT_COLUMN);;
+ stat_tap_table_item_type* msg_data = stat_tap_get_field_data(table, tag_idx, COUNT_COLUMN);;
msg_data->value.uint_value++;
- new_stat_tap_set_field_data(table, tag_idx, COUNT_COLUMN, msg_data);
+ stat_tap_set_field_data(table, tag_idx, COUNT_COLUMN, msg_data);
if (reason_idx >= 0) {
- msg_data = new_stat_tap_get_field_data(table, reason_idx, COUNT_COLUMN);;
+ msg_data = stat_tap_get_field_data(table, reason_idx, COUNT_COLUMN);;
msg_data->value.uint_value++;
- new_stat_tap_set_field_data(table, reason_idx, COUNT_COLUMN, msg_data);
+ stat_tap_set_field_data(table, reason_idx, COUNT_COLUMN, msg_data);
}
return TRUE;
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, COUNT_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, COUNT_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
}
}
static stat_tap_table_item dtap_stat_fields[] = {{TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "IEI", "0x%02x "}, {TABLE_ITEM_STRING, TAP_ALIGN_LEFT, "Message Name", "%-50s"},
{TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Count", "%d"}};
-static void ansi_a_dtap_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void ansi_a_dtap_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
int num_fields = sizeof(dtap_stat_fields)/sizeof(stat_tap_table_item);
- stat_tap_table* table = new_stat_tap_init_table("ANSI A-I/F DTAP Statistics", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_table* table = stat_tap_init_table("ANSI A-I/F DTAP Statistics", num_fields, 0, NULL, gui_callback, gui_data);
int i = 0;
stat_tap_table_item_type items[sizeof(dtap_stat_fields)/sizeof(stat_tap_table_item)];
- new_stat_tap_add_table(new_stat, table);
+ stat_tap_add_table(new_stat, table);
/* Add a fow for each value type */
while (ansi_a_dtap_strings[i].strptr)
items[COUNT_COLUMN].type = TABLE_ITEM_UINT;
items[COUNT_COLUMN].value.uint_value = 0;
- new_stat_tap_init_table_row(table, i, num_fields, items);
+ stat_tap_init_table_row(table, i, num_fields, items);
i++;
}
}
static gboolean
ansi_a_dtap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const ansi_a_tap_rec_t *data_p = (const ansi_a_tap_rec_t *)data;
stat_tap_table_item_type* dtap_data;
stat_tap_table* table;
table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i);
- dtap_data = new_stat_tap_get_field_data(table, data_p->message_type, COUNT_COLUMN);
+ dtap_data = stat_tap_get_field_data(table, data_p->message_type, COUNT_COLUMN);
dtap_data->value.uint_value++;
- new_stat_tap_set_field_data(table, data_p->message_type, COUNT_COLUMN, dtap_data);
+ stat_tap_set_field_data(table, data_p->message_type, COUNT_COLUMN, dtap_data);
return TRUE;
}
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, COUNT_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, COUNT_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
}
}
static stat_tap_table_item bsmap_stat_fields[] = {{TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "IEI", "0x%02x "}, {TABLE_ITEM_STRING, TAP_ALIGN_LEFT, "Message Name", "%-50s"},
{TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Count", "%d"}};
-static void ansi_a_bsmap_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void ansi_a_bsmap_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
int num_fields = sizeof(bsmap_stat_fields)/sizeof(stat_tap_table_item);
- stat_tap_table* table = new_stat_tap_init_table("ANSI A-I/F BSMAP Statistics", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_table* table = stat_tap_init_table("ANSI A-I/F BSMAP Statistics", num_fields, 0, NULL, gui_callback, gui_data);
int i = 0;
stat_tap_table_item_type items[sizeof(bsmap_stat_fields)/sizeof(stat_tap_table_item)];
- new_stat_tap_add_table(new_stat, table);
+ stat_tap_add_table(new_stat, table);
/* Add a fow for each value type */
while (ansi_a_bsmap_strings[i].strptr)
items[COUNT_COLUMN].type = TABLE_ITEM_UINT;
items[COUNT_COLUMN].value.uint_value = 0;
- new_stat_tap_init_table_row(table, i, num_fields, items);
+ stat_tap_init_table_row(table, i, num_fields, items);
i++;
}
}
static gboolean
ansi_a_bsmap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const ansi_a_tap_rec_t *data_p = (const ansi_a_tap_rec_t *)data;
stat_tap_table_item_type* dtap_data;
stat_tap_table* table;
table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i);
- dtap_data = new_stat_tap_get_field_data(table, data_p->message_type, COUNT_COLUMN);
+ dtap_data = stat_tap_get_field_data(table, data_p->message_type, COUNT_COLUMN);
dtap_data->value.uint_value++;
- new_stat_tap_set_field_data(table, data_p->message_type, COUNT_COLUMN, dtap_data);
+ stat_tap_set_field_data(table, data_p->message_type, COUNT_COLUMN, dtap_data);
return TRUE;
}
{TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Count", " %d "}, {TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Total Bytes", " %d "},
{TABLE_ITEM_FLOAT, TAP_ALIGN_RIGHT, "Avg Bytes", " %8.2f "}};
-static void ansi_map_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void ansi_map_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
int num_fields = sizeof(stat_fields)/sizeof(stat_tap_table_item);
- stat_tap_table* table = new_stat_tap_init_table("ANSI MAP Operation Statistics", num_fields, 0, "ansi_map.op_code", gui_callback, gui_data);
+ stat_tap_table* table = stat_tap_init_table("ANSI MAP Operation Statistics", num_fields, 0, "ansi_map.op_code", gui_callback, gui_data);
int i = 0;
stat_tap_table_item_type items[sizeof(stat_fields)/sizeof(stat_tap_table_item)];
- new_stat_tap_add_table(new_stat, table);
+ stat_tap_add_table(new_stat, table);
/* Add a fow for each value type */
while (ansi_map_opr_code_strings[i].strptr)
items[AVG_BYTES_COLUMN].type = TABLE_ITEM_FLOAT;
items[AVG_BYTES_COLUMN].value.float_value = 0.0f;
- new_stat_tap_init_table_row(table, ansi_map_opr_code_strings[i].value, num_fields, items);
+ stat_tap_init_table_row(table, ansi_map_opr_code_strings[i].value, num_fields, items);
i++;
}
}
static gboolean
ansi_map_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const ansi_map_tap_rec_t *data_p = (const ansi_map_tap_rec_t *)data;
stat_tap_table* table;
stat_tap_table_item_type* item_data;
table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i);
- item_data = new_stat_tap_get_field_data(table, data_p->message_type, COUNT_COLUMN);
+ item_data = stat_tap_get_field_data(table, data_p->message_type, COUNT_COLUMN);
item_data->value.uint_value++;
count = item_data->value.uint_value;
- new_stat_tap_set_field_data(table, data_p->message_type, COUNT_COLUMN, item_data);
+ stat_tap_set_field_data(table, data_p->message_type, COUNT_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, data_p->message_type, TOTAL_BYTES_COLUMN);
+ item_data = stat_tap_get_field_data(table, data_p->message_type, TOTAL_BYTES_COLUMN);
item_data->value.uint_value += data_p->size;
total_bytes = item_data->value.uint_value;
- new_stat_tap_set_field_data(table, data_p->message_type, TOTAL_BYTES_COLUMN, item_data);
+ stat_tap_set_field_data(table, data_p->message_type, TOTAL_BYTES_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, data_p->message_type, AVG_BYTES_COLUMN);
+ item_data = stat_tap_get_field_data(table, data_p->message_type, AVG_BYTES_COLUMN);
item_data->value.float_value = (float)total_bytes/(float)count;
- new_stat_tap_set_field_data(table, data_p->message_type, AVG_BYTES_COLUMN, item_data);
+ stat_tap_set_field_data(table, data_p->message_type, AVG_BYTES_COLUMN, item_data);
return TRUE;
}
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, COUNT_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, COUNT_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, TOTAL_BYTES_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, TOTAL_BYTES_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, TOTAL_BYTES_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, TOTAL_BYTES_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, AVG_BYTES_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, AVG_BYTES_COLUMN);
item_data->value.float_value = 0.0f;
- new_stat_tap_set_field_data(table, element, AVG_BYTES_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, AVG_BYTES_COLUMN, item_data);
}
}
static stat_tap_table_item bootp_stat_fields[] = {{TABLE_ITEM_STRING, TAP_ALIGN_LEFT, "DHCP Message Type", "%-25s"}, {TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Packets", "%d"}};
-static void bootp_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void bootp_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
int num_fields = sizeof(bootp_stat_fields)/sizeof(stat_tap_table_item);
- stat_tap_table* table = new_stat_tap_init_table("DHCP Statistics", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_table* table = stat_tap_init_table("DHCP Statistics", num_fields, 0, NULL, gui_callback, gui_data);
int i = 0;
stat_tap_table_item_type items[sizeof(bootp_stat_fields)/sizeof(stat_tap_table_item)];
- new_stat_tap_add_table(new_stat, table);
+ stat_tap_add_table(new_stat, table);
/* Add a row for each value type */
while (opt53_text[i].strptr)
items[PACKET_COLUMN].type = TABLE_ITEM_UINT;
items[PACKET_COLUMN].value.uint_value = 0;
- new_stat_tap_init_table_row(table, i, num_fields, items);
+ stat_tap_init_table_row(table, i, num_fields, items);
i++;
}
}
static gboolean
bootp_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const char* value = (const char*)data;
stat_tap_table* table;
stat_tap_table_item_type* msg_data;
return FALSE;
table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i);
- msg_data = new_stat_tap_get_field_data(table, idx, PACKET_COLUMN);
+ msg_data = stat_tap_get_field_data(table, idx, PACKET_COLUMN);
msg_data->value.uint_value++;
- new_stat_tap_set_field_data(table, idx, PACKET_COLUMN, msg_data);
+ stat_tap_set_field_data(table, idx, PACKET_COLUMN, msg_data);
return TRUE;
}
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, PACKET_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, PACKET_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, PACKET_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, PACKET_COLUMN, item_data);
}
}
static stat_tap_table_item camel_stat_fields[] = {{TABLE_ITEM_STRING, TAP_ALIGN_LEFT, "Message Type or Reason", "%-25s"}, {TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Count", "%d"}};
-static void camel_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void camel_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
int num_fields = sizeof(camel_stat_fields)/sizeof(stat_tap_table_item);
- stat_tap_table* table = new_stat_tap_init_table("CAMEL Message Counters", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_table* table = stat_tap_init_table("CAMEL Message Counters", num_fields, 0, NULL, gui_callback, gui_data);
int i;
stat_tap_table_item_type items[sizeof(camel_stat_fields)/sizeof(stat_tap_table_item)];
- new_stat_tap_add_table(new_stat, table);
+ stat_tap_add_table(new_stat, table);
items[MESSAGE_TYPE_COLUMN].type = TABLE_ITEM_STRING;
items[COUNT_COLUMN].type = TABLE_ITEM_UINT;
}
items[MESSAGE_TYPE_COLUMN].value.string_value = col_str;
- new_stat_tap_init_table_row(table, i, num_fields, items);
+ stat_tap_init_table_row(table, i, num_fields, items);
}
}
static gboolean
camel_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *csi_ptr)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const struct camelsrt_info_t *csi = (const struct camelsrt_info_t *) csi_ptr;
stat_tap_table* table;
stat_tap_table_item_type* msg_data;
table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i);
if (csi->opcode >= table->num_elements)
return FALSE;
- msg_data = new_stat_tap_get_field_data(table, csi->opcode, COUNT_COLUMN);
+ msg_data = stat_tap_get_field_data(table, csi->opcode, COUNT_COLUMN);
msg_data->value.uint_value++;
- new_stat_tap_set_field_data(table, csi->opcode, COUNT_COLUMN, msg_data);
+ stat_tap_set_field_data(table, csi->opcode, COUNT_COLUMN, msg_data);
return TRUE;
}
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, COUNT_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, COUNT_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
}
}
{TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Count", "%d"}
};
-static void gsm_a_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data, const char *table_title, const value_string *msg_strings)
+static void gsm_a_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data, const char *table_title, const value_string *msg_strings)
{
int num_fields = sizeof(gsm_a_stat_fields)/sizeof(stat_tap_table_item);
stat_tap_table* table;
items[COUNT_COLUMN].type = TABLE_ITEM_UINT;
items[COUNT_COLUMN].value.uint_value = 0;
- table = new_stat_tap_init_table(table_title, num_fields, 0, NULL, gui_callback, gui_data);
- new_stat_tap_add_table(new_stat, table);
+ table = stat_tap_init_table(table_title, num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_add_table(new_stat, table);
/* Add a row for each value type */
for (i = 0; i < 256; i++)
items[IEI_COLUMN].value.uint_value = i;
items[MSG_NAME_COLUMN].value.string_value = col_str;
- new_stat_tap_init_table_row(table, i, num_fields, items);
+ stat_tap_init_table_row(table, i, num_fields, items);
}
}
-static void gsm_a_bssmap_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void gsm_a_bssmap_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
gsm_a_stat_init(new_stat, gui_callback, gui_data,
"GSM A-I/F BSSMAP Statistics", gsm_a_bssmap_msg_strings);
}
-static void gsm_a_dtap_mm_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void gsm_a_dtap_mm_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
gsm_a_stat_init(new_stat, gui_callback, gui_data,
"GSM A-I/F DTAP Mobility Management Statistics", gsm_a_dtap_msg_mm_strings);
}
-static void gsm_a_dtap_rr_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void gsm_a_dtap_rr_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
gsm_a_stat_init(new_stat, gui_callback, gui_data,
"GSM A-I/F DTAP Radio Resource Management Statistics", gsm_a_dtap_msg_rr_strings);
}
-static void gsm_a_dtap_cc_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void gsm_a_dtap_cc_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
gsm_a_stat_init(new_stat, gui_callback, gui_data,
"GSM A-I/F DTAP Call Control Statistics", gsm_a_dtap_msg_cc_strings);
}
-static void gsm_a_dtap_gmm_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void gsm_a_dtap_gmm_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
gsm_a_stat_init(new_stat, gui_callback, gui_data,
"GSM A-I/F DTAP GPRS Mobility Management Statistics", gsm_a_dtap_msg_gmm_strings);
}
-static void gsm_a_dtap_sm_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void gsm_a_dtap_sm_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
gsm_a_stat_init(new_stat, gui_callback, gui_data,
"GSM A-I/F DTAP GPRS Session Management Statistics", gsm_a_dtap_msg_sm_strings);
}
-static void gsm_a_dtap_sms_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void gsm_a_dtap_sms_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
gsm_a_stat_init(new_stat, gui_callback, gui_data,
"GSM A-I/F DTAP Short Message Service Statistics", gsm_a_dtap_msg_sms_strings);
}
-static void gsm_a_dtap_tp_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void gsm_a_dtap_tp_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
gsm_a_stat_init(new_stat, gui_callback, gui_data,
"GSM A-I/F DTAP Special Conformance Testing Functions", gsm_a_dtap_msg_tp_strings);
}
-static void gsm_a_dtap_ss_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void gsm_a_dtap_ss_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
gsm_a_stat_init(new_stat, gui_callback, gui_data,
"GSM A-I/F DTAP Supplementary Services Statistics", gsm_a_dtap_msg_ss_strings);
}
-static void gsm_a_sacch_rr_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void gsm_a_sacch_rr_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
gsm_a_stat_init(new_stat, gui_callback, gui_data,
"GSM A-I/F SACCH Statistics", gsm_a_rr_short_pd_msg_strings);
static gboolean
gsm_a_stat_packet(void *tapdata, const void *gatr_ptr, guint8 pdu_type, int protocol_disc)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const gsm_a_tap_rec_t *gatr = (const gsm_a_tap_rec_t *) gatr_ptr;
stat_tap_table* table;
stat_tap_table_item_type* msg_data;
if (pdu_type == GSM_A_PDU_TYPE_SACCH && gatr->protocol_disc != 0) return FALSE;
table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i);
- msg_data = new_stat_tap_get_field_data(table, gatr->message_type, COUNT_COLUMN);
+ msg_data = stat_tap_get_field_data(table, gatr->message_type, COUNT_COLUMN);
msg_data->value.uint_value++;
- new_stat_tap_set_field_data(table, gatr->message_type, COUNT_COLUMN, msg_data);
+ stat_tap_set_field_data(table, gatr->message_type, COUNT_COLUMN, msg_data);
return TRUE;
}
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, COUNT_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, COUNT_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
}
}
{TABLE_ITEM_FLOAT, TAP_ALIGN_RIGHT, "Avg Bytes", "%d"},
};
-static void gsm_map_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void gsm_map_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
int num_fields = sizeof(gsm_map_stat_fields)/sizeof(stat_tap_table_item);
stat_tap_table* table;
items[TOT_BYTES_COLUMN].type = TABLE_ITEM_UINT;
items[AVG_BYTES_COLUMN].type = TABLE_ITEM_FLOAT;
- table = new_stat_tap_init_table("GSM MAP Operation Statistics", num_fields, 0, NULL, gui_callback, gui_data);
- new_stat_tap_add_table(new_stat, table);
+ table = stat_tap_init_table("GSM MAP Operation Statistics", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_add_table(new_stat, table);
/* Add a row for each value type */
for (i = 0; i < GSM_MAP_MAX_NUM_OPR_CODES; i++)
items[ID_COLUMN].value.uint_value = i;
items[OP_CODE_COLUMN].value.string_value = col_str;
- new_stat_tap_init_table_row(table, i, num_fields, items);
+ stat_tap_init_table_row(table, i, num_fields, items);
}
}
static gboolean
gsm_map_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gmtr_ptr)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const gsm_map_tap_rec_t *gmtr = (const gsm_map_tap_rec_t *)gmtr_ptr;
stat_tap_table* table;
stat_tap_table_item_type *invoke_data, *fwd_bytes_data, *result_data, *rev_bytes_data, *avg_data;
table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i);
- invoke_data = new_stat_tap_get_field_data(table, gmtr->opcode, INVOKES_COLUMN);
- fwd_bytes_data = new_stat_tap_get_field_data(table, gmtr->opcode, NUM_BYTES_FWD_COLUMN);
- result_data = new_stat_tap_get_field_data(table, gmtr->opcode, RET_RES_COLUMN);
- rev_bytes_data = new_stat_tap_get_field_data(table, gmtr->opcode, NUM_BYTES_REV_COLUMN);
+ invoke_data = stat_tap_get_field_data(table, gmtr->opcode, INVOKES_COLUMN);
+ fwd_bytes_data = stat_tap_get_field_data(table, gmtr->opcode, NUM_BYTES_FWD_COLUMN);
+ result_data = stat_tap_get_field_data(table, gmtr->opcode, RET_RES_COLUMN);
+ rev_bytes_data = stat_tap_get_field_data(table, gmtr->opcode, NUM_BYTES_REV_COLUMN);
if (gmtr->invoke)
{
invoke_data->value.uint_value++;
- new_stat_tap_set_field_data(table, gmtr->opcode, INVOKES_COLUMN, invoke_data);
+ stat_tap_set_field_data(table, gmtr->opcode, INVOKES_COLUMN, invoke_data);
fwd_bytes_data->value.uint_value += gmtr->size;
- new_stat_tap_set_field_data(table, gmtr->opcode, NUM_BYTES_FWD_COLUMN, fwd_bytes_data);
+ stat_tap_set_field_data(table, gmtr->opcode, NUM_BYTES_FWD_COLUMN, fwd_bytes_data);
}
else
{
result_data->value.uint_value++;
- new_stat_tap_set_field_data(table, gmtr->opcode, RET_RES_COLUMN, result_data);
+ stat_tap_set_field_data(table, gmtr->opcode, RET_RES_COLUMN, result_data);
rev_bytes_data->value.uint_value += gmtr->size;
- new_stat_tap_set_field_data(table, gmtr->opcode, NUM_BYTES_REV_COLUMN, rev_bytes_data);
+ stat_tap_set_field_data(table, gmtr->opcode, NUM_BYTES_REV_COLUMN, rev_bytes_data);
}
invokes = invoke_data->value.uint_value;
if (gmtr->invoke)
{
- avg_data = new_stat_tap_get_field_data(table, gmtr->opcode, AVG_BYTES_FWD_COLUMN);
+ avg_data = stat_tap_get_field_data(table, gmtr->opcode, AVG_BYTES_FWD_COLUMN);
avg_data->value.float_value += (float) fwd_bytes / invokes;
- new_stat_tap_set_field_data(table, gmtr->opcode, AVG_BYTES_FWD_COLUMN, avg_data);
+ stat_tap_set_field_data(table, gmtr->opcode, AVG_BYTES_FWD_COLUMN, avg_data);
}
else
{
- avg_data = new_stat_tap_get_field_data(table, gmtr->opcode, AVG_BYTES_REV_COLUMN);
+ avg_data = stat_tap_get_field_data(table, gmtr->opcode, AVG_BYTES_REV_COLUMN);
avg_data->value.float_value += (float) rev_bytes / results;
- new_stat_tap_set_field_data(table, gmtr->opcode, AVG_BYTES_REV_COLUMN, avg_data);
+ stat_tap_set_field_data(table, gmtr->opcode, AVG_BYTES_REV_COLUMN, avg_data);
}
- avg_data = new_stat_tap_get_field_data(table, gmtr->opcode, AVG_BYTES_COLUMN);
+ avg_data = stat_tap_get_field_data(table, gmtr->opcode, AVG_BYTES_COLUMN);
avg_data->value.float_value += (float) (fwd_bytes + rev_bytes) / (invokes + results);
- new_stat_tap_set_field_data(table, gmtr->opcode, AVG_BYTES_COLUMN, avg_data);
+ stat_tap_set_field_data(table, gmtr->opcode, AVG_BYTES_COLUMN, avg_data);
return TRUE;
}
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, INVOKES_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, INVOKES_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, INVOKES_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, INVOKES_COLUMN, item_data);
}
}
static guint other_idx;
-static void h225_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void h225_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
int num_fields = sizeof(h225_stat_fields)/sizeof(stat_tap_table_item);
- stat_tap_table* table = new_stat_tap_init_table("H.225 Messages and Message Reasons", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_table* table = stat_tap_init_table("H.225 Messages and Message Reasons", num_fields, 0, NULL, gui_callback, gui_data);
int row_idx = 0, msg_idx;
stat_tap_table_item_type items[sizeof(h225_stat_fields)/sizeof(stat_tap_table_item)];
- new_stat_tap_add_table(new_stat, table);
+ stat_tap_add_table(new_stat, table);
items[MESSAGE_TYPE_COLUMN].type = TABLE_ITEM_STRING;
items[COUNT_COLUMN].type = TABLE_ITEM_UINT;
: "Unknown RAS message";
ras_msg_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (h225_RasMessage_vals[msg_idx].strptr);
: "Unknown CS message";
cs_msg_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (T_h323_message_body_vals[msg_idx].strptr);
: "Unknown gatekeeper reject reason";
grj_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (GatekeeperRejectReason_vals[msg_idx].strptr);
: "Unknown registration reject reason";
rrj_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (RegistrationRejectReason_vals[msg_idx].strptr);
: "Unknown unregistration request reason";
urq_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (UnregRequestReason_vals[msg_idx].strptr);
: "Unknown unregistration reject reason";
urj_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (UnregRejectReason_vals[msg_idx].strptr);
: "Unknown admission reject reason";
arj_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (AdmissionRejectReason_vals[msg_idx].strptr);
: "Unknown band reject reason";
brj_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (BandRejectReason_vals[msg_idx].strptr);
: "Unknown disengage reason";
drq_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (DisengageReason_vals[msg_idx].strptr);
: "Unknown disengage reject reason";
drj_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (DisengageRejectReason_vals[msg_idx].strptr);
: "Unknown location reject reason";
lrj_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (LocationRejectReason_vals[msg_idx].strptr);
: "Unknown info request nak reason";
irqnak_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (InfoRequestNakReason_vals[msg_idx].strptr);
: "Unknown release complete reason";
rel_cmp_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (h225_ReleaseCompleteReason_vals[msg_idx].strptr);
: "Unknown facility reason";
facility_reason_idx[msg_idx] = row_idx;
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
row_idx++;
msg_idx++;
} while (FacilityReason_vals[msg_idx].strptr);
items[MESSAGE_TYPE_COLUMN].value.string_value = "Unknown H.225 message";
- new_stat_tap_init_table_row(table, row_idx, num_fields, items);
+ stat_tap_init_table_row(table, row_idx, num_fields, items);
other_idx = row_idx;
}
static gboolean
h225_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *hpi_ptr)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const h225_packet_info *hpi = (const h225_packet_info *)hpi_ptr;
int tag_idx = -1;
int reason_idx = -1;
if (tag_idx >= 0) {
stat_tap_table*table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, 0);
- stat_tap_table_item_type* msg_data = new_stat_tap_get_field_data(table, tag_idx, COUNT_COLUMN);;
+ stat_tap_table_item_type* msg_data = stat_tap_get_field_data(table, tag_idx, COUNT_COLUMN);;
msg_data->value.uint_value++;
- new_stat_tap_set_field_data(table, tag_idx, COUNT_COLUMN, msg_data);
+ stat_tap_set_field_data(table, tag_idx, COUNT_COLUMN, msg_data);
if (reason_idx >= 0) {
- msg_data = new_stat_tap_get_field_data(table, reason_idx, COUNT_COLUMN);;
+ msg_data = stat_tap_get_field_data(table, reason_idx, COUNT_COLUMN);;
msg_data->value.uint_value++;
- new_stat_tap_set_field_data(table, reason_idx, COUNT_COLUMN, msg_data);
+ stat_tap_set_field_data(table, reason_idx, COUNT_COLUMN, msg_data);
}
return TRUE;
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, COUNT_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, COUNT_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
}
}
{TABLE_ITEM_FLOAT, TAP_ALIGN_RIGHT, "Avg Bytes", "%f"},
};
-static void mtp3_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void mtp3_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
int num_fields = sizeof(mtp3_stat_fields)/sizeof(stat_tap_table_item);
stat_tap_table* table;
- table = new_stat_tap_init_table("MTP3 Statistics", num_fields, 0, NULL, gui_callback, gui_data);
- new_stat_tap_add_table(new_stat, table);
+ table = stat_tap_init_table("MTP3 Statistics", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_add_table(new_stat, table);
}
static gboolean
mtp3_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *m3tr_ptr)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const mtp3_tap_rec_t *m3tr = (const mtp3_tap_rec_t *)m3tr_ptr;
gboolean found = FALSE;
guint element;
for (element = 0; element < table->num_elements; element++)
{
stat_tap_table_item_type *opc_data, *dpc_data, *si_data;
- opc_data = new_stat_tap_get_field_data(table, element, OPC_COLUMN);
- dpc_data = new_stat_tap_get_field_data(table, element, DPC_COLUMN);
- si_data = new_stat_tap_get_field_data(table, element, SI_COLUMN);
+ opc_data = stat_tap_get_field_data(table, element, OPC_COLUMN);
+ dpc_data = stat_tap_get_field_data(table, element, DPC_COLUMN);
+ si_data = stat_tap_get_field_data(table, element, SI_COLUMN);
if (memcmp(&m3tr->addr_opc, opc_data->user_data.ptr_value, sizeof(mtp3_addr_pc_t)) == 0)
{
items[NUM_BYTES_COLUMN].type = TABLE_ITEM_UINT;
items[AVG_BYTES_COLUMN].type = TABLE_ITEM_FLOAT;
- new_stat_tap_init_table_row(table, element, num_fields, items);
+ stat_tap_init_table_row(table, element, num_fields, items);
- item_data = new_stat_tap_get_field_data(table, element, OPC_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, OPC_COLUMN);
mtp3_addr_to_str_buf(&m3tr->addr_opc, str, 256);
item_data->value.string_value = g_strdup(str);
item_data->user_data.ptr_value = g_memdup(&m3tr->addr_opc, sizeof(mtp3_tap_rec_t));
- new_stat_tap_set_field_data(table, element, OPC_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, OPC_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, DPC_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, DPC_COLUMN);
mtp3_addr_to_str_buf(&m3tr->addr_dpc, str, 256);
item_data->value.string_value = g_strdup(str);
item_data->user_data.ptr_value = g_memdup(&m3tr->addr_dpc, sizeof(mtp3_tap_rec_t));
- new_stat_tap_set_field_data(table, element, DPC_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, DPC_COLUMN, item_data);
sis = try_val_to_str(m3tr->mtp3_si_code, mtp3_service_indicator_code_short_vals);
if (sis) {
col_str = g_strdup_printf("Unknown service indicator %d", m3tr->mtp3_si_code);
}
- item_data = new_stat_tap_get_field_data(table, element, SI_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, SI_COLUMN);
item_data->value.string_value = col_str;
item_data->user_data.uint_value = m3tr->mtp3_si_code;
- new_stat_tap_set_field_data(table, element, SI_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, SI_COLUMN, item_data);
}
- item_data = new_stat_tap_get_field_data(table, element, NUM_MSUS_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, NUM_MSUS_COLUMN);
item_data->value.uint_value++;
msu_count = item_data->value.uint_value;
- new_stat_tap_set_field_data(table, element, NUM_MSUS_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, NUM_MSUS_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, NUM_BYTES_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, NUM_BYTES_COLUMN);
item_data->value.uint_value += m3tr->size;
byte_count = item_data->value.uint_value;
- new_stat_tap_set_field_data(table, element, NUM_BYTES_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, NUM_BYTES_COLUMN, item_data);
if (msu_count > 0) {
avg_bytes = (double) byte_count / msu_count;
}
- item_data = new_stat_tap_get_field_data(table, element, AVG_BYTES_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, AVG_BYTES_COLUMN);
item_data->value.float_value = avg_bytes;
- new_stat_tap_set_field_data(table, element, AVG_BYTES_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, AVG_BYTES_COLUMN, item_data);
return TRUE;
}
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, NUM_MSUS_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, NUM_MSUS_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, NUM_MSUS_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, NUM_MSUS_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, NUM_BYTES_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, NUM_BYTES_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, NUM_BYTES_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, NUM_BYTES_COLUMN, item_data);
}
}
{TABLE_ITEM_FLOAT, TAP_ALIGN_RIGHT, "Avg SRT (s)", "%.2f"}
};
-static void rpc_prog_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void rpc_prog_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
int num_fields = sizeof(rpc_prog_stat_fields)/sizeof(stat_tap_table_item);
stat_tap_table* table;
- table = new_stat_tap_init_table("ONC-RPC Program Statistics", num_fields, 0, NULL, gui_callback, gui_data);
- new_stat_tap_add_table(new_stat, table);
+ table = stat_tap_init_table("ONC-RPC Program Statistics", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_add_table(new_stat, table);
}
static gboolean
rpc_prog_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *rciv_ptr)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const rpc_call_info_value *ri = (const rpc_call_info_value *)rciv_ptr;
int num_fields = sizeof(rpc_prog_stat_fields)/sizeof(stat_tap_table_item);
nstime_t delta;
for (element = 0; element < table->num_elements; element++)
{
stat_tap_table_item_type *program_data, *version_data;
- program_data = new_stat_tap_get_field_data(table, element, PROGRAM_NUM_COLUMN);
- version_data = new_stat_tap_get_field_data(table, element, VERSION_COLUMN);
+ program_data = stat_tap_get_field_data(table, element, PROGRAM_NUM_COLUMN);
+ version_data = stat_tap_get_field_data(table, element, VERSION_COLUMN);
if ((ri->prog == program_data->value.uint_value) && (ri->vers == version_data->value.uint_value)) {
found = TRUE;
items[MAX_SRT_COLUMN].type = TABLE_ITEM_FLOAT;
items[AVG_SRT_COLUMN].type = TABLE_ITEM_FLOAT;
- new_stat_tap_init_table_row(table, element, num_fields, items);
+ stat_tap_init_table_row(table, element, num_fields, items);
}
/* we are only interested in reply packets */
return FALSE;
}
- item_data = new_stat_tap_get_field_data(table, element, CALLS_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, CALLS_COLUMN);
item_data->value.uint_value++;
call_count = item_data->value.uint_value;
- new_stat_tap_set_field_data(table, element, CALLS_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, CALLS_COLUMN, item_data);
/* calculate time delta between request and reply */
nstime_delta(&delta, &pinfo->abs_ts, &ri->req_time);
delta_s = nstime_to_sec(&delta);
- item_data = new_stat_tap_get_field_data(table, element, MIN_SRT_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, MIN_SRT_COLUMN);
if (item_data->value.float_value == 0.0 || delta_s < item_data->value.float_value) {
item_data->value.float_value = delta_s;
- new_stat_tap_set_field_data(table, element, MIN_SRT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, MIN_SRT_COLUMN, item_data);
}
- item_data = new_stat_tap_get_field_data(table, element, MAX_SRT_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, MAX_SRT_COLUMN);
if (item_data->value.float_value == 0.0 || delta_s > item_data->value.float_value) {
item_data->value.float_value = delta_s;
- new_stat_tap_set_field_data(table, element, MAX_SRT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, MAX_SRT_COLUMN, item_data);
}
- item_data = new_stat_tap_get_field_data(table, element, AVG_SRT_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, AVG_SRT_COLUMN);
item_data->user_data.float_value += delta_s;
item_data->value.float_value = item_data->user_data.float_value / call_count;
- new_stat_tap_set_field_data(table, element, AVG_SRT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, AVG_SRT_COLUMN, item_data);
return TRUE;
}
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, CALLS_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, CALLS_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, CALLS_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, MIN_SRT_COLUMN);
+ stat_tap_set_field_data(table, element, CALLS_COLUMN, item_data);
+ item_data = stat_tap_get_field_data(table, element, MIN_SRT_COLUMN);
item_data->value.float_value = 0.0;
- new_stat_tap_set_field_data(table, element, MIN_SRT_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, MAX_SRT_COLUMN);
+ stat_tap_set_field_data(table, element, MIN_SRT_COLUMN, item_data);
+ item_data = stat_tap_get_field_data(table, element, MAX_SRT_COLUMN);
item_data->value.float_value = 0.0;
- new_stat_tap_set_field_data(table, element, MAX_SRT_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, AVG_SRT_COLUMN);
+ stat_tap_set_field_data(table, element, MAX_SRT_COLUMN, item_data);
+ item_data = stat_tap_get_field_data(table, element, AVG_SRT_COLUMN);
item_data->value.float_value = 0.0;
- new_stat_tap_set_field_data(table, element, AVG_SRT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, AVG_SRT_COLUMN, item_data);
}
}
{TABLE_ITEM_FLOAT, TAP_ALIGN_RIGHT, "Max Setup (s)", "%8.2f"},
};
-static void sip_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void sip_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
/* XXX Should we have a single request + response table instead? */
int num_fields = sizeof(sip_stat_fields)/sizeof(stat_tap_table_item);
- stat_tap_table *req_table = new_stat_tap_init_table("SIP Requests", num_fields, 0, NULL, gui_callback, gui_data);
- stat_tap_table *resp_table = new_stat_tap_init_table("SIP Responses", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_table *req_table = stat_tap_init_table("SIP Requests", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_table *resp_table = stat_tap_init_table("SIP Responses", num_fields, 0, NULL, gui_callback, gui_data);
stat_tap_table_item_type items[sizeof(sip_stat_fields)/sizeof(stat_tap_table_item)];
guint i;
- new_stat_tap_add_table(new_stat, resp_table);
- new_stat_tap_add_table(new_stat, req_table);
+ stat_tap_add_table(new_stat, resp_table);
+ stat_tap_add_table(new_stat, req_table);
// These values are fixed for all entries.
// For req_table, first column value is method.
for (i = 1; i < array_length(sip_methods); i++) {
items[REQ_RESP_METHOD_COLUMN].value.string_value = g_strdup(sip_methods[i]);
- new_stat_tap_init_table_row(req_table, i-1, num_fields, items);
+ stat_tap_init_table_row(req_table, i-1, num_fields, items);
}
// For responses entries, first column gets code and description.
items[REQ_RESP_METHOD_COLUMN].value.string_value =
g_strdup_printf("%u %s", response_code, response_code_vals[i].strptr);
items[REQ_RESP_METHOD_COLUMN].user_data.uint_value = response_code;
- new_stat_tap_init_table_row(resp_table, i-1, num_fields, items);
+ stat_tap_init_table_row(resp_table, i-1, num_fields, items);
}
}
static gboolean
sip_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *siv_ptr)
{
- new_stat_data_t* stat_data = (new_stat_data_t*) tapdata;
+ stat_data_t* stat_data = (stat_data_t*) tapdata;
const sip_info_value_t *info_value = (const sip_info_value_t *) siv_ptr;
stat_tap_table *cur_table = NULL;
guint cur_row = 0; /* 0 = Unknown for both tables */
cur_table = req_table;
for (element = 0; element < req_table->num_elements; element++) {
- item_data = new_stat_tap_get_field_data(req_table, element, REQ_RESP_METHOD_COLUMN);
+ item_data = stat_tap_get_field_data(req_table, element, REQ_RESP_METHOD_COLUMN);
if (g_ascii_strcasecmp(info_value->request_method, item_data->value.string_value) == 0) {
cur_row = element;
break;
}
for (element = 0; element < resp_table->num_elements; element++) {
- item_data = new_stat_tap_get_field_data(resp_table, element, REQ_RESP_METHOD_COLUMN);
+ item_data = stat_tap_get_field_data(resp_table, element, REQ_RESP_METHOD_COLUMN);
if (item_data->user_data.uint_value == response_code) {
cur_row = element;
break;
if (cur_table) {
stat_tap_table_item_type *item_data;
- item_data = new_stat_tap_get_field_data(cur_table, cur_row, COUNT_COLUMN);
+ item_data = stat_tap_get_field_data(cur_table, cur_row, COUNT_COLUMN);
item_data->value.uint_value++;
- new_stat_tap_set_field_data(cur_table, cur_row, COUNT_COLUMN, item_data);
+ stat_tap_set_field_data(cur_table, cur_row, COUNT_COLUMN, item_data);
if (info_value->resend) {
- item_data = new_stat_tap_get_field_data(cur_table, cur_row, RESENT_COLUMN);
+ item_data = stat_tap_get_field_data(cur_table, cur_row, RESENT_COLUMN);
item_data->value.uint_value++;
- new_stat_tap_set_field_data(cur_table, cur_row, RESENT_COLUMN, item_data);
+ stat_tap_set_field_data(cur_table, cur_row, RESENT_COLUMN, item_data);
}
if (info_value->setup_time > 0) {
- stat_tap_table_item_type *min_item_data = new_stat_tap_get_field_data(cur_table, cur_row, MIN_SETUP_COLUMN);
- stat_tap_table_item_type *avg_item_data = new_stat_tap_get_field_data(cur_table, cur_row, AVG_SETUP_COLUMN);
- stat_tap_table_item_type *max_item_data = new_stat_tap_get_field_data(cur_table, cur_row, MAX_SETUP_COLUMN);
+ stat_tap_table_item_type *min_item_data = stat_tap_get_field_data(cur_table, cur_row, MIN_SETUP_COLUMN);
+ stat_tap_table_item_type *avg_item_data = stat_tap_get_field_data(cur_table, cur_row, AVG_SETUP_COLUMN);
+ stat_tap_table_item_type *max_item_data = stat_tap_get_field_data(cur_table, cur_row, MAX_SETUP_COLUMN);
double setup_time = (double) info_value->setup_time / 1000;
unsigned count;
}
}
- new_stat_tap_set_field_data(cur_table, cur_row, MIN_SETUP_COLUMN, min_item_data);
- new_stat_tap_set_field_data(cur_table, cur_row, AVG_SETUP_COLUMN, avg_item_data);
- new_stat_tap_set_field_data(cur_table, cur_row, MAX_SETUP_COLUMN, max_item_data);
+ stat_tap_set_field_data(cur_table, cur_row, MIN_SETUP_COLUMN, min_item_data);
+ stat_tap_set_field_data(cur_table, cur_row, AVG_SETUP_COLUMN, avg_item_data);
+ stat_tap_set_field_data(cur_table, cur_row, MAX_SETUP_COLUMN, max_item_data);
}
}
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, COUNT_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, COUNT_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, COUNT_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, RESENT_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, RESENT_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, RESENT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, RESENT_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, RESENT_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, RESENT_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, RESENT_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, RESENT_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, MIN_SETUP_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, MIN_SETUP_COLUMN);
item_data->user_data.uint_value = 0;
item_data->value.float_value = 0.0f;
- new_stat_tap_set_field_data(table, element, MIN_SETUP_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, MIN_SETUP_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, AVG_SETUP_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, AVG_SETUP_COLUMN);
item_data->user_data.float_value = 0;
item_data->value.float_value = 0.0f;
- new_stat_tap_set_field_data(table, element, AVG_SETUP_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, AVG_SETUP_COLUMN, item_data);
- item_data = new_stat_tap_get_field_data(table, element, MAX_SETUP_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, MAX_SETUP_COLUMN);
item_data->value.float_value = 0.0f;
- new_stat_tap_set_field_data(table, element, MAX_SETUP_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, MAX_SETUP_COLUMN, item_data);
}
}
static int unknown_pt_idx;
static int unknown_sc_idx;
-static void wsp_stat_init(stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+static void wsp_stat_init(stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
int num_fields = sizeof(wsp_stat_fields)/sizeof(stat_tap_table_item);
- stat_tap_table* pt_table = new_stat_tap_init_table("PDU Types", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_table* pt_table = stat_tap_init_table("PDU Types", num_fields, 0, NULL, gui_callback, gui_data);
stat_tap_table_item_type pt_items[sizeof(wsp_stat_fields)/sizeof(stat_tap_table_item)];
- stat_tap_table* sc_table = new_stat_tap_init_table("Status Codes", num_fields, 0, NULL, gui_callback, gui_data);
+ stat_tap_table* sc_table = stat_tap_init_table("Status Codes", num_fields, 0, NULL, gui_callback, gui_data);
stat_tap_table_item_type sc_items[sizeof(wsp_stat_fields)/sizeof(stat_tap_table_item)];
int table_idx;
- new_stat_tap_add_table(new_stat, pt_table);
- new_stat_tap_add_table(new_stat, sc_table);
+ stat_tap_add_table(new_stat, pt_table);
+ stat_tap_add_table(new_stat, sc_table);
/* Add a row for each PDU type and status code */
table_idx = 0;
pt_items[MESSAGE_TYPE_COLUMN].value.string_value = g_strdup(wsp_vals_pdu_type[table_idx].strptr);
pt_items[MESSAGE_TYPE_COLUMN].user_data.uint_value = wsp_vals_pdu_type[table_idx].value;
- new_stat_tap_init_table_row(pt_table, table_idx, num_fields, pt_items);
+ stat_tap_init_table_row(pt_table, table_idx, num_fields, pt_items);
table_idx++;
}
pt_items[MESSAGE_TYPE_COLUMN].value.string_value = g_strdup("Unknown PDU type");
pt_items[MESSAGE_TYPE_COLUMN].user_data.uint_value = 0;
- new_stat_tap_init_table_row(pt_table, table_idx, num_fields, pt_items);
+ stat_tap_init_table_row(pt_table, table_idx, num_fields, pt_items);
unknown_pt_idx = table_idx;
table_idx = 0;
sc_items[MESSAGE_TYPE_COLUMN].value.string_value = g_strdup(wsp_vals_status[table_idx].strptr);
sc_items[MESSAGE_TYPE_COLUMN].user_data.uint_value = wsp_vals_status[table_idx].value;
- new_stat_tap_init_table_row(sc_table, table_idx, num_fields, sc_items);
+ stat_tap_init_table_row(sc_table, table_idx, num_fields, sc_items);
table_idx++;
}
sc_items[MESSAGE_TYPE_COLUMN].value.string_value = g_strdup("Unknown status code");
sc_items[MESSAGE_TYPE_COLUMN].user_data.uint_value = 0;
- new_stat_tap_init_table_row(sc_table, table_idx, num_fields, sc_items);
+ stat_tap_init_table_row(sc_table, table_idx, num_fields, sc_items);
unknown_sc_idx = table_idx;
}
static gboolean
wsp_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *wiv_ptr)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)tapdata;
+ stat_data_t* stat_data = (stat_data_t*)tapdata;
const wsp_info_value_t *value = (const wsp_info_value_t *)wiv_ptr;
stat_tap_table *pt_table, *sc_table;
guint element;
found = FALSE;
for (element = 0; element < pt_table->num_elements; element++) {
- item_data = new_stat_tap_get_field_data(pt_table, element, MESSAGE_TYPE_COLUMN);
+ item_data = stat_tap_get_field_data(pt_table, element, MESSAGE_TYPE_COLUMN);
if (value->pdut == item_data->user_data.uint_value) {
found = TRUE;
break;
if (!found) {
element = unknown_pt_idx;
}
- item_data = new_stat_tap_get_field_data(pt_table, element, PACKET_COLUMN);
+ item_data = stat_tap_get_field_data(pt_table, element, PACKET_COLUMN);
item_data->value.uint_value++;
- new_stat_tap_set_field_data(pt_table, element, PACKET_COLUMN, item_data);
+ stat_tap_set_field_data(pt_table, element, PACKET_COLUMN, item_data);
if (value->status_code != 0) {
found = FALSE;
for (element = 0; element < sc_table->num_elements; element++) {
- item_data = new_stat_tap_get_field_data(sc_table, element, MESSAGE_TYPE_COLUMN);
+ item_data = stat_tap_get_field_data(sc_table, element, MESSAGE_TYPE_COLUMN);
if (value->status_code == (int) item_data->user_data.uint_value) {
found = TRUE;
break;
if (!found) {
element = unknown_sc_idx;
}
- item_data = new_stat_tap_get_field_data(sc_table, element, PACKET_COLUMN);
+ item_data = stat_tap_get_field_data(sc_table, element, PACKET_COLUMN);
item_data->value.uint_value++;
- new_stat_tap_set_field_data(sc_table, element, PACKET_COLUMN, item_data);
+ stat_tap_set_field_data(sc_table, element, PACKET_COLUMN, item_data);
}
return TRUE;
for (element = 0; element < table->num_elements; element++)
{
- item_data = new_stat_tap_get_field_data(table, element, PACKET_COLUMN);
+ item_data = stat_tap_get_field_data(table, element, PACKET_COLUMN);
item_data->value.uint_value = 0;
- new_stat_tap_set_field_data(table, element, PACKET_COLUMN, item_data);
+ stat_tap_set_field_data(table, element, PACKET_COLUMN, item_data);
}
}
wmem_tree_insert_string(registered_stat_tables, ui->cli_string, ui, 0);
}
-stat_tap_table_ui *new_stat_tap_by_name(const char *name)
+stat_tap_table_ui *stat_tap_by_name(const char *name)
{
return (stat_tap_table_ui *) wmem_tree_lookup_string(registered_stat_tables, name, 0);
}
-void new_stat_tap_iterate_tables(wmem_foreach_func func, gpointer user_data)
+void stat_tap_iterate_tables(wmem_foreach_func func, gpointer user_data)
{
wmem_tree_foreach(registered_stat_tables, func, user_data);
}
-void new_stat_tap_get_filter(stat_tap_table_ui* new_stat, const char *opt_arg, const char **filter, char** err)
+void stat_tap_get_filter(stat_tap_table_ui* new_stat, const char *opt_arg, const char **filter, char** err)
{
guint len = (guint) strlen(new_stat->cli_string);
*filter=NULL;
new_stat->stat_filter_check_cb(opt_arg, filter, err);
}
-stat_tap_table* new_stat_tap_init_table(const char *name, int num_fields, int num_elements,
- const char *filter_string, new_stat_tap_gui_init_cb gui_callback, void* gui_data)
+stat_tap_table* stat_tap_init_table(const char *name, int num_fields, int num_elements,
+ const char *filter_string, stat_tap_gui_init_cb gui_callback, void* gui_data)
{
stat_tap_table* new_table = g_new0(stat_tap_table, 1);
return new_table;
}
-void new_stat_tap_add_table(stat_tap_table_ui* new_stat, stat_tap_table* table)
+void stat_tap_add_table(stat_tap_table_ui* new_stat, stat_tap_table* table)
{
if (new_stat->tables == NULL)
new_stat->tables = g_array_new(FALSE, TRUE, sizeof(stat_tap_table*));
g_array_insert_val(new_stat->tables, new_stat->tables->len, table);
}
-void new_stat_tap_init_table_row(stat_tap_table *stat_table, guint table_index, guint num_fields, const stat_tap_table_item_type* fields)
+void stat_tap_init_table_row(stat_tap_table *stat_table, guint table_index, guint num_fields, const stat_tap_table_item_type* fields)
{
/* we have discovered a new procedure. Extend the table accordingly */
if(table_index>=stat_table->num_elements){
}
-stat_tap_table_item_type* new_stat_tap_get_field_data(const stat_tap_table *stat_table, guint table_index, guint field_index)
+stat_tap_table_item_type* stat_tap_get_field_data(const stat_tap_table *stat_table, guint table_index, guint field_index)
{
stat_tap_table_item_type* field_value;
g_assert(table_index < stat_table->num_elements);
return &field_value[field_index];
}
-void new_stat_tap_set_field_data(stat_tap_table *stat_table, guint table_index, guint field_index, stat_tap_table_item_type* field_data)
+void stat_tap_set_field_data(stat_tap_table *stat_table, guint table_index, guint field_index, stat_tap_table_item_type* field_data)
{
stat_tap_table_item_type* field_value;
g_assert(table_index < stat_table->num_elements);
field_value[field_index] = *field_data;
}
-void reset_stat_table(stat_tap_table_ui* new_stat, new_stat_tap_gui_reset_cb gui_callback, void *callback_data)
+void reset_stat_table(stat_tap_table_ui* new_stat, stat_tap_gui_reset_cb gui_callback, void *callback_data)
{
guint i = 0;
stat_tap_table *stat_table;
}
}
-void free_stat_tables(stat_tap_table_ui* new_stat, new_stat_tap_gui_free_cb gui_callback, void *callback_data)
+void free_stat_tables(stat_tap_table_ui* new_stat, stat_tap_gui_free_cb gui_callback, void *callback_data)
{
guint i = 0, element, field_index;
stat_tap_table *stat_table;
{
for (field_index = 0; field_index < stat_table->num_fields; field_index++)
{
- field_data = new_stat_tap_get_field_data(stat_table, element, field_index);
+ field_data = stat_tap_get_field_data(stat_table, element, field_index);
/* Give dissector a crack at it */
/* XXX Should this be per-row instead? */
if (new_stat->stat_tap_free_table_item_cb)
} stat_tap_table;
-typedef void (*new_stat_tap_gui_init_cb)(stat_tap_table* stat_table, void* gui_data); /* GTK+ only? */
-typedef void (*new_stat_tap_gui_reset_cb)(stat_tap_table* stat_table, void* gui_data); /* GTK+ only? */
-typedef void (*new_stat_tap_gui_free_cb)(stat_tap_table* stat_table, void* gui_data); /* GTK+ only? */
+typedef void (*stat_tap_gui_init_cb)(stat_tap_table* stat_table, void* gui_data); /* GTK+ only? */
+typedef void (*stat_tap_gui_reset_cb)(stat_tap_table* stat_table, void* gui_data); /* GTK+ only? */
+typedef void (*stat_tap_gui_free_cb)(stat_tap_table* stat_table, void* gui_data); /* GTK+ only? */
/*
* UI information for a tap with a table-based UI.
const char *title; /* title of statistic */
const char *tap_name;
const char *cli_string; /* initial part of the "-z" argument for statistic */
- void (* stat_tap_init_cb)(struct _stat_tap_table_ui* new_stat, new_stat_tap_gui_init_cb gui_callback, void* gui_data);
+ void (* stat_tap_init_cb)(struct _stat_tap_table_ui* new_stat, stat_tap_gui_init_cb gui_callback, void* gui_data);
tap_packet_cb packet_func;
void (* stat_tap_reset_table_cb)(stat_tap_table* table);
void (* stat_tap_free_table_item_cb)(stat_tap_table* table, guint row, guint column, stat_tap_table_item_type* field_data);
/** tap data
*/
-typedef struct _new_stat_data_t {
+typedef struct _stat_data_t {
stat_tap_table_ui *stat_tap_data;
void *user_data; /**< "GUI" specifics (if necessary) */
-} new_stat_data_t;
+} stat_data_t;
/** Register UI information for a tap.
WS_DLL_PUBLIC void register_stat_tap_ui(stat_tap_ui *ui, void *userdata);
WS_DLL_PUBLIC void register_stat_tap_table_ui(stat_tap_table_ui *ui);
-WS_DLL_PUBLIC void new_stat_tap_iterate_tables(wmem_foreach_func func, gpointer user_data);
-WS_DLL_PUBLIC void new_stat_tap_get_filter(stat_tap_table_ui* new_stat, const char *opt_arg, const char **filter, char** err);
-WS_DLL_PUBLIC stat_tap_table* new_stat_tap_init_table(const char *name, int num_fields, int num_elements,
- const char *filter_string, new_stat_tap_gui_init_cb gui_callback, void* gui_data);
-WS_DLL_PUBLIC void new_stat_tap_add_table(stat_tap_table_ui* new_stat, stat_tap_table* table);
+WS_DLL_PUBLIC void stat_tap_iterate_tables(wmem_foreach_func func, gpointer user_data);
+WS_DLL_PUBLIC void stat_tap_get_filter(stat_tap_table_ui* new_stat, const char *opt_arg, const char **filter, char** err);
+WS_DLL_PUBLIC stat_tap_table* stat_tap_init_table(const char *name, int num_fields, int num_elements,
+ const char *filter_string, stat_tap_gui_init_cb gui_callback, void* gui_data);
+WS_DLL_PUBLIC void stat_tap_add_table(stat_tap_table_ui* new_stat, stat_tap_table* table);
-WS_DLL_PUBLIC void new_stat_tap_init_table_row(stat_tap_table *stat_table, guint table_index, guint num_fields, const stat_tap_table_item_type* fields);
-WS_DLL_PUBLIC stat_tap_table_item_type* new_stat_tap_get_field_data(const stat_tap_table *stat_table, guint table_index, guint field_index);
-WS_DLL_PUBLIC void new_stat_tap_set_field_data(stat_tap_table *stat_table, guint table_index, guint field_index, stat_tap_table_item_type* field_data);
-WS_DLL_PUBLIC void reset_stat_table(stat_tap_table_ui* new_stat, new_stat_tap_gui_reset_cb gui_callback, void *callback_data);
+WS_DLL_PUBLIC void stat_tap_init_table_row(stat_tap_table *stat_table, guint table_index, guint num_fields, const stat_tap_table_item_type* fields);
+WS_DLL_PUBLIC stat_tap_table_item_type* stat_tap_get_field_data(const stat_tap_table *stat_table, guint table_index, guint field_index);
+WS_DLL_PUBLIC void stat_tap_set_field_data(stat_tap_table *stat_table, guint table_index, guint field_index, stat_tap_table_item_type* field_data);
+WS_DLL_PUBLIC void reset_stat_table(stat_tap_table_ui* new_stat, stat_tap_gui_reset_cb gui_callback, void *callback_data);
-WS_DLL_PUBLIC stat_tap_table_ui *new_stat_tap_by_name(const char *name);
+WS_DLL_PUBLIC stat_tap_table_ui *stat_tap_by_name(const char *name);
/** Free all of the tables associated with a stat_tap_table_ui.
*
* Provided by the UI.
* @param callback_data Data for the per-table callback.
*/
-WS_DLL_PUBLIC void free_stat_tables(stat_tap_table_ui* new_stat, new_stat_tap_gui_free_cb gui_callback, void *callback_data);
+WS_DLL_PUBLIC void free_stat_tables(stat_tap_table_ui* new_stat, stat_tap_gui_free_cb gui_callback, void *callback_data);
WS_DLL_PUBLIC gboolean process_stat_cmd_arg(char *optstr);
static gboolean
sharkd_session_process_info_nstat_cb(const void *key, void *value, void *userdata)
{
- stat_tap_table_ui *new_stat_tap = (stat_tap_table_ui *) value;
+ stat_tap_table_ui *stat_tap = (stat_tap_table_ui *) value;
int *pi = (int *) userdata;
printf("%s{", (*pi) ? "," : "");
- printf("\"name\":\"%s\"", new_stat_tap->title);
+ printf("\"name\":\"%s\"", stat_tap->title);
printf(",\"tap\":\"nstat:%s\"", (const char *) key);
printf("}");
printf(",\"nstat\":[");
i = 0;
- new_stat_tap_iterate_tables(sharkd_session_process_info_nstat_cb, &i);
+ stat_tap_iterate_tables(sharkd_session_process_info_nstat_cb, &i);
printf("]");
printf(",\"convs\":[");
static void
sharkd_session_process_tap_nstat_cb(void *arg)
{
- new_stat_data_t *stat_data = (new_stat_data_t *) arg;
+ stat_data_t *stat_data = (stat_data_t *) arg;
guint i, j, k;
printf("{\"tap\":\"nstat:%s\",\"type\":\"nstat\"", stat_data->stat_tap_data->cli_string);
{
stat_tap_table_item_type *field_data;
- field_data = new_stat_tap_get_field_data(table, j, 0);
+ field_data = stat_tap_get_field_data(table, j, 0);
if (field_data == NULL || field_data->type == TABLE_ITEM_NONE) /* Nothing for us here */
continue;
printf("%s[", sepa);
for (k = 0; k < table->num_fields; k++)
{
- field_data = new_stat_tap_get_field_data(table, j, k);
+ field_data = stat_tap_get_field_data(table, j, k);
if (k)
printf(",");
static void
sharkd_session_free_tap_nstat_cb(void *arg)
{
- new_stat_data_t *stat_data = (new_stat_data_t *) arg;
+ stat_data_t *stat_data = (stat_data_t *) arg;
free_stat_tables(stat_data->stat_tap_data, NULL, NULL);
}
}
else if (!strncmp(tok_tap, "nstat:", 6))
{
- stat_tap_table_ui *stat_tap = new_stat_tap_by_name(tok_tap + 6);
- new_stat_data_t *stat_data;
+ stat_tap_table_ui *stat_tap = stat_tap_by_name(tok_tap + 6);
+ stat_data_t *stat_data;
if (!stat_tap)
{
stat_tap->stat_tap_init_cb(stat_tap, NULL, NULL);
- stat_data = g_new0(new_stat_data_t, 1);
+ stat_data = g_new0(stat_data_t, 1);
stat_data->stat_tap_data = stat_tap;
stat_data->user_data = NULL;
hostlist_table_set_gui_info(init_hostlists);
srt_table_iterate_tables(register_srt_tables, NULL);
rtd_table_iterate_tables(register_rtd_tables, NULL);
- new_stat_tap_iterate_tables(register_simple_stat_tables, NULL);
+ stat_tap_iterate_tables(register_simple_stat_tables, NULL);
/* If invoked with the "-G" flag, we dump out information based on
the argument to the "-G" flag; if no argument is specified,
typedef struct _table_stat_t {
const char *filter;
- new_stat_data_t stats;
+ stat_data_t stats;
} table_stat_t;
static void
simple_draw(void *arg)
{
- new_stat_data_t* stat_data = (new_stat_data_t*)arg;
+ stat_data_t* stat_data = (stat_data_t*)arg;
table_stat_t* stats = (table_stat_t*)stat_data->user_data;
size_t i;
guint table_index, element, field_index;
{
for (field_index = 0, field = stat_data->stat_tap_data->fields; field_index < table->num_fields; field_index++, field++)
{
- field_data = new_stat_tap_get_field_data(table, element, field_index);
+ field_data = stat_tap_get_field_data(table, element, field_index);
if (field_data->type == TABLE_ITEM_NONE) /* Nothing for us here */
break;
}
static void
-init_stat_table(stat_tap_table_ui *new_stat_tap, const char *filter)
+init_stat_table(stat_tap_table_ui *stat_tap, const char *filter)
{
GString *error_string;
table_stat_t* ui;
ui = g_new0(table_stat_t, 1);
ui->filter = g_strdup(filter);
- ui->stats.stat_tap_data = new_stat_tap;
+ ui->stats.stat_tap_data = stat_tap;
ui->stats.user_data = ui;
- new_stat_tap->stat_tap_init_cb(new_stat_tap, NULL, NULL);
+ stat_tap->stat_tap_init_cb(stat_tap, NULL, NULL);
- error_string = register_tap_listener(new_stat_tap->tap_name, &ui->stats, filter, 0, NULL, new_stat_tap->packet_func, simple_draw);
+ error_string = register_tap_listener(stat_tap->tap_name, &ui->stats, filter, 0, NULL, stat_tap->packet_func, simple_draw);
if (error_string) {
/* free_rtd_table(&ui->rtd.stat_table, NULL, NULL); */
fprintf(stderr, "tshark: Couldn't register tap: %s\n", error_string->str);
static void
simple_stat_init(const char *opt_arg, void* userdata)
{
- stat_tap_table_ui *new_stat_tap = (stat_tap_table_ui*)userdata;
+ stat_tap_table_ui *stat_tap = (stat_tap_table_ui*)userdata;
const char *filter=NULL;
char* err = NULL;
- new_stat_tap_get_filter(new_stat_tap, opt_arg, &filter, &err);
+ stat_tap_get_filter(stat_tap, opt_arg, &filter, &err);
if (err != NULL)
{
fprintf(stderr, "tshark: %s\n", err);
exit(1);
}
- init_stat_table(new_stat_tap, filter);
+ init_stat_table(stat_tap, filter);
}
gboolean
register_simple_stat_tables(const void *key, void *value, void *userdata _U_)
{
- stat_tap_table_ui *new_stat_tap = (stat_tap_table_ui*)value;
+ stat_tap_table_ui *stat_tap = (stat_tap_table_ui*)value;
stat_tap_ui ui_info;
- ui_info.group = new_stat_tap->group;
- ui_info.title = new_stat_tap->title; /* construct this from the protocol info? */
+ ui_info.group = stat_tap->group;
+ ui_info.title = stat_tap->title; /* construct this from the protocol info? */
ui_info.cli_string = (char*)key;
ui_info.tap_init_cb = simple_stat_init;
- ui_info.nparams = new_stat_tap->nparams;
- ui_info.params = new_stat_tap->params;
+ ui_info.nparams = stat_tap->nparams;
+ ui_info.params = stat_tap->params;
- register_stat_tap_ui(&ui_info, new_stat_tap);
+ register_stat_tap_ui(&ui_info, stat_tap);
return FALSE;
}
hostlist_table_set_gui_info(init_hostlist_table);
srt_table_iterate_tables(register_service_response_tables, NULL);
rtd_table_iterate_tables(register_response_time_delay_tables, NULL);
- new_stat_tap_iterate_tables(register_simple_stat_tables, NULL);
+ stat_tap_iterate_tables(register_simple_stat_tables, NULL);
splash_update(RA_EXTCAP, NULL, (gpointer)splash_win);
extcap_register_preferences();
typedef struct _simple_stat_t {
const char *filter;
gtk_simplestat_t_t gtk_data;
- stat_tap_table_ui *new_stat_tap;
- new_stat_data_t data;
+ stat_tap_table_ui *stat_tap;
+ stat_data_t data;
} simple_stat_t;
static void
remove_tap_listener(&ss->data);
- free_stat_tables(ss->new_stat_tap, NULL, NULL);
+ free_stat_tables(ss->stat_tap, NULL, NULL);
g_free(ss);
}
init_gtk_simple_stat_table(stat_tap_table* stat_table, void* gui_data)
{
guint i;
- new_stat_data_t* stat_data = (new_stat_data_t*)gui_data;
+ stat_data_t* stat_data = (stat_data_t*)gui_data;
simple_stat_t *ss = (simple_stat_t*)stat_data->user_data;
stat_column *start_columns = g_new(stat_column, stat_table->num_fields),
*columns;
simple_stat_draw(void *arg)
{
GtkListStore *store;
- new_stat_data_t *stats = (new_stat_data_t*)arg;
+ stat_data_t *stats = (stat_data_t*)arg;
simple_stat_t *ss = (simple_stat_t*)stats->user_data;
stat_tap_table* table;
stat_tap_table_item* field;
for (element = 0; element < table->num_elements; element++)
{
field_index = 0;
- field_data = new_stat_tap_get_field_data(table, element, field_index);
+ field_data = stat_tap_get_field_data(table, element, field_index);
if (field_data->type == TABLE_ITEM_NONE) /* Nothing for us here */
continue;
for (field = stats->stat_tap_data->fields; field_index < table->num_fields; field_index++, field++)
{
- field_data = new_stat_tap_get_field_data(table, element, field_index);
+ field_data = stat_tap_get_field_data(table, element, field_index);
switch(field_data->type)
{
static void
simple_stat_reset(void *arg)
{
- new_stat_data_t *stats = (new_stat_data_t*)arg;
+ stat_data_t *stats = (stat_data_t*)arg;
simple_stat_t *ss = (simple_stat_t*)stats->user_data;
reset_stat_table(stats->stat_tap_data, reset_table_data, &ss->gtk_data);
- set_window_title(ss->gtk_data.win, ss->new_stat_tap->title);
+ set_window_title(ss->gtk_data.win, ss->stat_tap->title);
}
static void
-init_simple_stat_tables(stat_tap_table_ui *new_stat_tap, const char *filter)
+init_simple_stat_tables(stat_tap_table_ui *stat_tap, const char *filter)
{
simple_stat_t *ss;
GString *error_string;
ss = g_new0(simple_stat_t, 1);
- ss->gtk_data.win=dlg_window_new(new_stat_tap->title); /* transient_for top_level */
+ ss->gtk_data.win=dlg_window_new(stat_tap->title); /* transient_for top_level */
gtk_window_set_destroy_with_parent (GTK_WINDOW(ss->gtk_data.win), TRUE);
ss->gtk_data.vbox=ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 3, FALSE);
- init_main_stat_window(ss->gtk_data.win, ss->gtk_data.vbox, new_stat_tap->title, filter);
+ init_main_stat_window(ss->gtk_data.win, ss->gtk_data.vbox, stat_tap->title, filter);
/* init a scrolled window*/
ss->gtk_data.scrolled_window = scrolled_window_new(NULL, NULL);
ss->filter = g_strdup(filter);
- ss->new_stat_tap = new_stat_tap;
- ss->data.stat_tap_data = new_stat_tap;
+ ss->stat_tap = stat_tap;
+ ss->data.stat_tap_data = stat_tap;
ss->data.user_data = ss;
- new_stat_tap->stat_tap_init_cb(new_stat_tap, init_gtk_simple_stat_table, &ss->data);
+ stat_tap->stat_tap_init_cb(stat_tap, init_gtk_simple_stat_table, &ss->data);
- error_string = register_tap_listener(new_stat_tap->tap_name, &ss->data, filter, 0, simple_stat_reset, new_stat_tap->packet_func, simple_stat_draw);
+ error_string = register_tap_listener(stat_tap->tap_name, &ss->data, filter, 0, simple_stat_reset, stat_tap->packet_func, simple_stat_draw);
if(error_string){
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
g_string_free(error_string, TRUE);
- free_stat_tables(ss->new_stat_tap, NULL, NULL);
+ free_stat_tables(ss->stat_tap, NULL, NULL);
g_free(ss);
return;
}
static void
gtk_simple_stat_init(const char *opt_arg, void *userdata)
{
- stat_tap_table_ui *new_stat_tap = (stat_tap_table_ui*)userdata;
+ stat_tap_table_ui *stat_tap = (stat_tap_table_ui*)userdata;
const char *filter=NULL;
char* err;
- new_stat_tap_get_filter(new_stat_tap, opt_arg, &filter, &err);
+ stat_tap_get_filter(stat_tap, opt_arg, &filter, &err);
if (err != NULL)
{
return;
}
- init_simple_stat_tables(new_stat_tap, filter);
+ init_simple_stat_tables(stat_tap, filter);
}
gboolean register_simple_stat_tables(const void *key, void *value, void *userdata _U_)
{
- stat_tap_table_ui *new_stat_tap = (stat_tap_table_ui*)value;
+ stat_tap_table_ui *stat_tap = (stat_tap_table_ui*)value;
tap_param_dlg* stat_dlg;
stat_dlg = g_new(tap_param_dlg, 1);
- stat_dlg->win_title = new_stat_tap->title;
+ stat_dlg->win_title = stat_tap->title;
stat_dlg->init_string = (const char*)key;
stat_dlg->tap_init_cb = gtk_simple_stat_init;
stat_dlg->index = -1;
- stat_dlg->nparams = new_stat_tap->nparams;
- stat_dlg->params = new_stat_tap->params;
+ stat_dlg->nparams = stat_tap->nparams;
+ stat_dlg->params = stat_tap->params;
- stat_dlg->user_data = new_stat_tap;
+ stat_dlg->user_data = stat_tap;
- register_param_stat(stat_dlg, new_stat_tap->title, new_stat_tap->group);
+ register_param_stat(stat_dlg, stat_tap->title, stat_tap->group);
return FALSE;
}
return new SimpleStatisticsDialog(parent, cf, stu, filter);
}
-void SimpleStatisticsDialog::addMissingRows(struct _new_stat_data_t *stat_data)
+void SimpleStatisticsDialog::addMissingRows(struct _stat_data_t *stat_data)
{
// Hierarchy:
// - tables (GTK+ UI only supports one currently)
ti = statsTreeWidget()->topLevelItem(table_idx);
}
for (guint element = ti->childCount(); element < st_table->num_elements; element++) {
- stat_tap_table_item_type* fields = new_stat_tap_get_field_data(st_table, element, 0);
+ stat_tap_table_item_type* fields = stat_tap_get_field_data(st_table, element, 0);
SimpleStatisticsTreeWidgetItem *ss_ti = new SimpleStatisticsTreeWidgetItem(ti, st_table->num_fields, fields);
for (int col = 0; col < (int) stu_->nfields; col++) {
if (stu_->fields[col].align == TAP_ALIGN_RIGHT) {
void SimpleStatisticsDialog::tapReset(void *sd_ptr)
{
- new_stat_data_t *sd = (new_stat_data_t*) sd_ptr;
+ stat_data_t *sd = (stat_data_t*) sd_ptr;
SimpleStatisticsDialog *ss_dlg = static_cast<SimpleStatisticsDialog *>(sd->user_data);
if (!ss_dlg) return;
void SimpleStatisticsDialog::tapDraw(void *sd_ptr)
{
- new_stat_data_t *sd = (new_stat_data_t*) sd_ptr;
+ stat_data_t *sd = (stat_data_t*) sd_ptr;
SimpleStatisticsDialog *ss_dlg = static_cast<SimpleStatisticsDialog *>(sd->user_data);
if (!ss_dlg) return;
void SimpleStatisticsDialog::fillTree()
{
- new_stat_data_t stat_data;
+ stat_data_t stat_data;
stat_data.stat_tap_data = stu_;
stat_data.user_data = this;
#include "tap_parameter_dialog.h"
-struct _new_stat_data_t;
+struct _stat_data_t;
class SimpleStatisticsDialog : public TapParameterDialog
{
* @param stat_data The table to add.
*/
// gtk:service_response_table.h:init_srt_table
- void addMissingRows(struct _new_stat_data_t *stat_data);
+ void addMissingRows(struct _stat_data_t *stat_data);
private:
struct _stat_tap_table_ui *stu_;
hostlist_table_set_gui_info(init_endpoint_table);
srt_table_iterate_tables(register_service_response_tables, NULL);
rtd_table_iterate_tables(register_response_time_delay_tables, NULL);
- new_stat_tap_iterate_tables(register_simple_stat_tables, NULL);
+ stat_tap_iterate_tables(register_simple_stat_tables, NULL);
if (ex_opt_count("read_format") > 0) {
in_file_type = open_info_name_to_type(ex_opt_get_next("read_format"));