(At least some (gcc ?) compilers give a "shadow" warning for these).
svn path=/trunk/; revision=46402
break;
case SP_BAD_FILTER: {
char *ch;
- int index;
+ int indx;
ch = strtok(buffer, ":");
- index = (int)strtol(ch, NULL, 10);
+ indx = (int)strtol(ch, NULL, 10);
ch = strtok(NULL, ":");
- capture_input_cfilter_error_message(capture_opts, index, ch);
+ capture_input_cfilter_error_message(capture_opts, indx, ch);
/* the capture child will close the sync_pipe, nothing to do for now */
break;
}
}
static size_t file_input(char* buf, size_t max) {
- size_t read;
+ size_t read_cnt;
- read = fread(buf,1,max,yyin);
+ read_cnt = fread(buf,1,max,yyin);
- if ( read == max ) {
+ if ( read_cnt == max ) {
return max;
- } else if (read > 0) {
- return read;
+ } else if (read_cnt > 0) {
+ return read_cnt;
} else {
return YY_NULL;
}
if (length >= 6 && length <= 20 && modifier >= 0 && modifier <= 2) {
guint number = tvb_get_ntohs (tvb, offset + length - 6);
guint8 number_len = modifier + 2;
- time_t time = tvb_get_ntohl(tvb, offset + length - 4);
- struct tm *tmp = gmtime(&time);
+ time_t timev = tvb_get_ntohl(tvb, offset + length - 4);
+ struct tm *tmp = gmtime(&timev);
if (modifier == 1 && number >= 1024) {
/* The number is in the range 65536-99999 */
dissect_epl_sdo_command_write_by_index(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 segmented, gboolean response)
{
gint size;
- guint16 index;
- guint8 subindex;
+ guint16 indx;
+ guint8 subindx;
guint32 val;
proto_item* item;
{ /* request */
if (segmented <= EPL_ASND_SDO_CMD_SEGMENTATION_INITIATE_TRANSFER)
{
- index = tvb_get_letohs(tvb, offset);
+ indx = tvb_get_letohs(tvb, offset);
if (epl_tree)
{
- proto_tree_add_uint(epl_tree, hf_epl_asnd_sdo_cmd_write_by_index_index, tvb, offset, 2, index);
+ proto_tree_add_uint(epl_tree, hf_epl_asnd_sdo_cmd_write_by_index_index, tvb, offset, 2, indx);
}
offset += 2;
- subindex = tvb_get_guint8(tvb, offset);
+ subindx = tvb_get_guint8(tvb, offset);
if (epl_tree)
{
- proto_tree_add_uint(epl_tree, hf_epl_asnd_sdo_cmd_write_by_index_subindex, tvb, offset, 1, subindex);
+ proto_tree_add_uint(epl_tree, hf_epl_asnd_sdo_cmd_write_by_index_subindex, tvb, offset, 1, subindx);
}
offset += 2;
if (check_col(pinfo->cinfo, COL_INFO))
{
- col_append_fstr(pinfo->cinfo, COL_INFO, "Write 0x%04X/%d", index, subindex);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "Write 0x%04X/%d", indx, subindx);
}
}
else if (check_col(pinfo->cinfo, COL_INFO))
dissect_epl_sdo_command_read_by_index(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, gint offset, guint8 segmented, gboolean response)
{
gint size;
- guint16 index;
- guint8 subindex;
+ guint16 indx;
+ guint8 subindx;
guint32 val;
proto_item* item;
if (!response)
{ /* request */
- index = tvb_get_letohs(tvb, offset);
+ indx = tvb_get_letohs(tvb, offset);
if (epl_tree)
{
- proto_tree_add_uint(epl_tree, hf_epl_asnd_sdo_cmd_read_by_index_index, tvb, offset, 2, index);
+ proto_tree_add_uint(epl_tree, hf_epl_asnd_sdo_cmd_read_by_index_index, tvb, offset, 2, indx);
}
offset += 2;
- subindex = tvb_get_guint8(tvb, offset);
+ subindx = tvb_get_guint8(tvb, offset);
if (epl_tree)
{
- proto_tree_add_uint(epl_tree, hf_epl_asnd_sdo_cmd_read_by_index_subindex, tvb, offset, 1, subindex);
+ proto_tree_add_uint(epl_tree, hf_epl_asnd_sdo_cmd_read_by_index_subindex, tvb, offset, 1, subindx);
}
offset += 1;
if (check_col(pinfo->cinfo, COL_INFO))
{
- col_append_fstr(pinfo->cinfo, COL_INFO, "Read 0x%04X/%d", index, subindex);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "Read 0x%04X/%d", indx, subindx);
}
}
guint offset = 0;
guint32 orig_crc, new_crc, comp_crc;
guint16 port_num;
- nstime_t gmtime;
+ nstime_t gmtimev;
struct tm *tm = NULL;
offset += 4;
port_num = tvb_get_ntohs(tvb, offset);
offset += 2;
- gmtime.secs = tvb_get_ntohl(tvb, offset);
+ gmtimev.secs = tvb_get_ntohl(tvb, offset);
offset += 4;
- gmtime.nsecs = tvb_get_ntohl(tvb, offset);
+ gmtimev.nsecs = tvb_get_ntohl(tvb, offset);
- tm = localtime(&gmtime.secs);
- proto_item_append_text(ti, ", Port: %d, Timestamp: %d:%d:%d.%d", port_num, tm->tm_hour, tm->tm_min, tm->tm_sec, gmtime.nsecs);
+ tm = localtime(&gmtimev.secs);
+ proto_item_append_text(ti, ", Port: %d, Timestamp: %d:%d:%d.%d", port_num, tm->tm_hour, tm->tm_min, tm->tm_sec, gmtimev.nsecs);
}
offset = 0;
int offset;
guint32 msgcode, msglen, did;
guint16 status;
- guint8 *devname;
+ guint8 *devname_p;
offset = 0;
did = 0;
if(tree) {
proto_tree_add_item(prism_tree, hf_ieee80211_prism_devname, tvb, offset, 16, ENC_ASCII|ENC_NA);
}
- devname = tvb_get_ephemeral_string(tvb, offset, 16);
+ devname_p = tvb_get_ephemeral_string(tvb, offset, 16);
offset += 16;
- col_add_fstr(pinfo->cinfo, COL_INFO, "Device: %s, Message 0x%x, Length %d", devname, msgcode, msglen);
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Device: %s, Message 0x%x, Length %d", devname_p, msgcode, msglen);
while(offset < PRISM_HEADER_LENGTH)
proto_tree *tree, mysql_conn_data_t *conn_data)
{
gint protocol;
- gint strlen;
+ gint lenstr;
int ver_offset;
proto_item *tf;
offset += 1;
/* version string */
- strlen = tvb_strsize(tvb,offset);
+ lenstr = tvb_strsize(tvb,offset);
if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " version=%s", tvb_get_ephemeral_string(tvb, offset, strlen));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " version=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
}
- proto_tree_add_item(greeting_tree, hf_mysql_version, tvb, offset, strlen, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(greeting_tree, hf_mysql_version, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
conn_data->major_version = 0;
- for (ver_offset = 0; ver_offset < strlen; ver_offset++) {
+ for (ver_offset = 0; ver_offset < lenstr; ver_offset++) {
guint8 ver_char = tvb_get_guint8(tvb, offset + ver_offset);
if (ver_char == '.') break;
conn_data->major_version = conn_data->major_version * 10 + ver_char - '0';
}
- offset += strlen;
+ offset += lenstr;
/* 4 bytes little endian thread_id */
proto_tree_add_item(greeting_tree, hf_mysql_thread_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset += 4;
/* salt string */
- strlen = tvb_strsize(tvb,offset);
- proto_tree_add_item(greeting_tree, hf_mysql_salt, tvb, offset, strlen, ENC_ASCII|ENC_NA);
- offset += strlen;
+ lenstr = tvb_strsize(tvb,offset);
+ proto_tree_add_item(greeting_tree, hf_mysql_salt, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
+ offset += lenstr;
/* rest is optional */
if (!tvb_reported_length_remaining(tvb, offset)) return offset;
/* 4.1+ server: rest of salt */
if (tvb_reported_length_remaining(tvb, offset)) {
- strlen = tvb_strsize(tvb,offset);
- proto_tree_add_item(greeting_tree, hf_mysql_salt2, tvb, offset, strlen, ENC_ASCII|ENC_NA);
- offset += strlen;
+ lenstr = tvb_strsize(tvb,offset);
+ proto_tree_add_item(greeting_tree, hf_mysql_salt2, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
+ offset += lenstr;
}
return offset;
mysql_dissect_login(tvbuff_t *tvb, packet_info *pinfo, int offset,
proto_tree *tree, mysql_conn_data_t *conn_data)
{
- gint strlen;
+ gint lenstr;
proto_item *tf;
proto_item *login_tree= NULL;
}
/* User name */
- strlen = my_tvb_strsize(tvb, offset);
+ lenstr = my_tvb_strsize(tvb, offset);
if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " user=%s", tvb_get_ephemeral_string(tvb, offset, strlen));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " user=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
}
- proto_tree_add_item(login_tree, hf_mysql_user, tvb, offset, strlen, ENC_ASCII|ENC_NA);
- offset += strlen;
+ proto_tree_add_item(login_tree, hf_mysql_user, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
+ offset += lenstr;
/* rest is optional */
if (!tvb_reported_length_remaining(tvb, offset)) return offset;
/* password: asciiz or length+ascii */
if (conn_data->clnt_caps & MYSQL_CAPS_SC) {
- strlen = tvb_get_guint8(tvb, offset);
+ lenstr = tvb_get_guint8(tvb, offset);
offset += 1;
} else {
- strlen = my_tvb_strsize(tvb, offset);
+ lenstr = my_tvb_strsize(tvb, offset);
}
- if (tree && strlen > 1) {
- proto_tree_add_item(login_tree, hf_mysql_passwd, tvb, offset, strlen, ENC_NA);
+ if (tree && lenstr > 1) {
+ proto_tree_add_item(login_tree, hf_mysql_passwd, tvb, offset, lenstr, ENC_NA);
}
- offset += strlen;
+ offset += lenstr;
/* optional: initial schema */
if (conn_data->clnt_caps & MYSQL_CAPS_CD)
{
- strlen= my_tvb_strsize(tvb,offset);
- if(strlen<0){
+ lenstr= my_tvb_strsize(tvb,offset);
+ if(lenstr<0){
return offset;
}
if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " db=%s", tvb_get_ephemeral_string(tvb, offset, strlen));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " db=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
}
- proto_tree_add_item(login_tree, hf_mysql_schema, tvb, offset, strlen, ENC_ASCII|ENC_NA);
- offset += strlen;
+ proto_tree_add_item(login_tree, hf_mysql_schema, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
+ offset += lenstr;
}
return offset;
proto_tree *tree, mysql_conn_data_t *conn_data)
{
gint opcode;
- gint strlen;
+ gint lenstr;
proto_item *tf = NULL, *ti;
proto_item *req_tree = NULL;
guint32 stmt_id;
case MYSQL_INIT_DB:
case MYSQL_CREATE_DB:
case MYSQL_DROP_DB:
- strlen = my_tvb_strsize(tvb, offset);
- proto_tree_add_item(req_tree, hf_mysql_schema, tvb, offset, strlen, ENC_ASCII|ENC_NA);
- offset += strlen;
+ lenstr = my_tvb_strsize(tvb, offset);
+ proto_tree_add_item(req_tree, hf_mysql_schema, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
+ offset += lenstr;
conn_data->state = RESPONSE_OK;
break;
case MYSQL_QUERY:
- strlen = my_tvb_strsize(tvb, offset);
- proto_tree_add_item(req_tree, hf_mysql_query, tvb, offset, strlen, ENC_ASCII|ENC_NA);
+ lenstr = my_tvb_strsize(tvb, offset);
+ proto_tree_add_item(req_tree, hf_mysql_query, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
if (mysql_showquery) {
if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, " { %s } ", tvb_get_ephemeral_string(tvb, offset, strlen));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " { %s } ", tvb_get_ephemeral_string(tvb, offset, lenstr));
}
- offset += strlen;
+ offset += lenstr;
conn_data->state = RESPONSE_TABULAR;
break;
case MYSQL_STMT_PREPARE:
- strlen = my_tvb_strsize(tvb, offset);
- proto_tree_add_item(req_tree, hf_mysql_query, tvb, offset, strlen, ENC_ASCII|ENC_NA);
- offset += strlen;
+ lenstr = my_tvb_strsize(tvb, offset);
+ proto_tree_add_item(req_tree, hf_mysql_query, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
+ offset += lenstr;
conn_data->state = RESPONSE_PREPARE;
break;
break;
case MYSQL_FIELD_LIST:
- strlen = my_tvb_strsize(tvb, offset);
- proto_tree_add_item(req_tree, hf_mysql_table_name, tvb, offset, strlen, ENC_ASCII|ENC_NA);
- offset += strlen;
+ lenstr = my_tvb_strsize(tvb, offset);
+ proto_tree_add_item(req_tree, hf_mysql_table_name, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
+ offset += lenstr;
conn_data->state = RESPONSE_SHOW_FIELDS;
break;
break;
case MYSQL_CHANGE_USER:
- strlen = tvb_strsize(tvb, offset);
- proto_tree_add_item(req_tree, hf_mysql_user, tvb, offset, strlen, ENC_ASCII|ENC_NA);
- offset += strlen;
+ lenstr = tvb_strsize(tvb, offset);
+ proto_tree_add_item(req_tree, hf_mysql_user, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
+ offset += lenstr;
- strlen = tvb_strsize(tvb, offset);
- proto_tree_add_item(req_tree, hf_mysql_passwd, tvb, offset, strlen, ENC_NA);
- offset += strlen;
+ lenstr = tvb_strsize(tvb, offset);
+ proto_tree_add_item(req_tree, hf_mysql_passwd, tvb, offset, lenstr, ENC_NA);
+ offset += lenstr;
- strlen = my_tvb_strsize(tvb, offset);
- proto_tree_add_item(req_tree, hf_mysql_schema, tvb, offset, strlen, ENC_ASCII|ENC_NA);
- offset += strlen;
+ lenstr = my_tvb_strsize(tvb, offset);
+ proto_tree_add_item(req_tree, hf_mysql_schema, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
+ offset += lenstr;
conn_data->state= RESPONSE_OK;
break;
offset += 2;
/* rest is data */
- strlen = tvb_reported_length_remaining(tvb, offset);
- if (tree && strlen > 0) {
- proto_tree_add_item(req_tree, hf_mysql_payload, tvb, offset, strlen, ENC_NA);
+ lenstr = tvb_reported_length_remaining(tvb, offset);
+ if (tree && lenstr > 0) {
+ proto_tree_add_item(req_tree, hf_mysql_payload, tvb, offset, lenstr, ENC_NA);
}
- offset += strlen;
+ offset += lenstr;
conn_data->state = REQUEST;
break;
}
}
} else {
- strlen = tvb_reported_length_remaining(tvb, offset);
- if (tree && strlen > 0) {
- ti = proto_tree_add_item(req_tree, hf_mysql_payload, tvb, offset, strlen, ENC_NA);
+ lenstr = tvb_reported_length_remaining(tvb, offset);
+ if (tree && lenstr > 0) {
+ ti = proto_tree_add_item(req_tree, hf_mysql_payload, tvb, offset, lenstr, ENC_NA);
expert_add_info_format(pinfo, ti, PI_UNDECODED, PI_WARN,
"PREPARE Response packet is needed to dissect the payload");
}
- offset += strlen;
+ offset += lenstr;
}
#if 0
/* FIXME: rest needs metadata about statement */
#else
- strlen = tvb_reported_length_remaining(tvb, offset);
- if (tree && strlen > 0) {
- ti = proto_tree_add_item(req_tree, hf_mysql_payload, tvb, offset, strlen, ENC_NA);
+ lenstr = tvb_reported_length_remaining(tvb, offset);
+ if (tree && lenstr > 0) {
+ ti = proto_tree_add_item(req_tree, hf_mysql_payload, tvb, offset, lenstr, ENC_NA);
expert_add_info_format(pinfo, ti, PI_UNDECODED, PI_WARN, "FIXME: execute dissector incomplete");
}
- offset += strlen;
+ offset += lenstr;
#endif
conn_data->state= RESPONSE_TABULAR;
break;
offset += 4;
/* binlog file name ? */
- strlen = tvb_reported_length_remaining(tvb, offset);
- if (tree && strlen > 0) {
- proto_tree_add_item(req_tree, hf_mysql_binlog_file_name, tvb, offset, strlen, ENC_ASCII|ENC_NA);
+ lenstr = tvb_reported_length_remaining(tvb, offset);
+ if (tree && lenstr > 0) {
+ proto_tree_add_item(req_tree, hf_mysql_binlog_file_name, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
}
- offset += strlen;
+ offset += lenstr;
conn_data->state = REQUEST;
break;
proto_tree *tree, mysql_conn_data_t *conn_data)
{
gint response_code;
- gint strlen;
+ gint lenstr;
gint server_status = 0;
proto_item *ti;
else {
switch (conn_data->state) {
case RESPONSE_MESSAGE:
- if ((strlen = tvb_reported_length_remaining(tvb, offset))) {
- proto_tree_add_item(tree, hf_mysql_message, tvb, offset, strlen, ENC_ASCII|ENC_NA);
- offset += strlen;
+ if ((lenstr = tvb_reported_length_remaining(tvb, offset))) {
+ proto_tree_add_item(tree, hf_mysql_message, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
+ offset += lenstr;
}
conn_data->state = REQUEST;
break;
mysql_dissect_ok_packet(tvbuff_t *tvb, packet_info *pinfo, int offset,
proto_tree *tree, mysql_conn_data_t *conn_data)
{
- gint strlen;
+ gint lenstr;
guint64 affected_rows;
guint64 insert_id;
int fle;
/* optional: message string */
if (tvb_reported_length_remaining(tvb, offset) > 0) {
- strlen = tvb_reported_length_remaining(tvb, offset);
- proto_tree_add_item(tree, hf_mysql_message, tvb, offset, strlen, ENC_ASCII|ENC_NA);
- offset += strlen;
+ lenstr = tvb_reported_length_remaining(tvb, offset);
+ proto_tree_add_item(tree, hf_mysql_message, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
+ offset += lenstr;
}
conn_data->state = REQUEST;
void radius_integer(radius_attr_info_t* a, proto_tree* tree, packet_info *pinfo _U_, tvbuff_t* tvb, int offset, int len, proto_item* avp_item) {
- guint32 uint;
+ guint32 uintv;
switch (len) {
case 1:
- uint = tvb_get_guint8(tvb,offset);
+ uintv = tvb_get_guint8(tvb,offset);
break;
case 2:
- uint = tvb_get_ntohs(tvb,offset);
+ uintv = tvb_get_ntohs(tvb,offset);
break;
case 3:
- uint = tvb_get_ntoh24(tvb,offset);
+ uintv = tvb_get_ntoh24(tvb,offset);
break;
case 4:
- uint = tvb_get_ntohl(tvb,offset);
+ uintv = tvb_get_ntohl(tvb,offset);
break;
case 8: {
- guint64 uint64 = tvb_get_ntoh64(tvb,offset);
- proto_tree_add_uint64(tree,a->hf_alt,tvb,offset,len,uint64);
- proto_item_append_text(avp_item, "%" G_GINT64_MODIFIER "u", uint64);
+ guint64 uintv64 = tvb_get_ntoh64(tvb,offset);
+ proto_tree_add_uint64(tree,a->hf_alt,tvb,offset,len,uintv64);
+ proto_item_append_text(avp_item, "%" G_GINT64_MODIFIER "u", uintv64);
return;
}
default:
proto_tree_add_item(tree,a->hf,tvb, offset, len, ENC_BIG_ENDIAN);
if (a->vs) {
- proto_item_append_text(avp_item, "%s(%u)", val_to_str_const(uint, a->vs, "Unknown"),uint);
+ proto_item_append_text(avp_item, "%s(%u)", val_to_str_const(uintv, a->vs, "Unknown"),uintv);
} else {
- proto_item_append_text(avp_item, "%u", uint);
+ proto_item_append_text(avp_item, "%u", uintv);
}
}
void radius_signed(radius_attr_info_t* a, proto_tree* tree, packet_info *pinfo _U_, tvbuff_t* tvb, int offset, int len, proto_item* avp_item) {
- guint32 uint;
+ guint32 uintv;
switch (len) {
case 1:
- uint = tvb_get_guint8(tvb,offset);
+ uintv = tvb_get_guint8(tvb,offset);
break;
case 2:
- uint = tvb_get_ntohs(tvb,offset);
+ uintv = tvb_get_ntohs(tvb,offset);
break;
case 3:
- uint = tvb_get_ntoh24(tvb,offset);
+ uintv = tvb_get_ntoh24(tvb,offset);
break;
case 4:
- uint = tvb_get_ntohl(tvb,offset);
+ uintv = tvb_get_ntohl(tvb,offset);
break;
case 8: {
- guint64 uint64 = tvb_get_ntoh64(tvb,offset);
- proto_tree_add_int64(tree,a->hf_alt,tvb,offset,len,uint64);
- proto_item_append_text(avp_item, "%" G_GINT64_MODIFIER "u", uint64);
+ guint64 uintv64 = tvb_get_ntoh64(tvb,offset);
+ proto_tree_add_int64(tree,a->hf_alt,tvb,offset,len,uintv64);
+ proto_item_append_text(avp_item, "%" G_GINT64_MODIFIER "u", uintv64);
return;
}
default:
return;
}
- proto_tree_add_int(tree,a->hf,tvb,offset,len,uint);
+ proto_tree_add_int(tree,a->hf,tvb,offset,len,uintv);
if (a->vs) {
- proto_item_append_text(avp_item, "%s(%d)", val_to_str_const(uint, a->vs, "Unknown"),uint);
+ proto_item_append_text(avp_item, "%s(%d)", val_to_str_const(uintv, a->vs, "Unknown"),uintv);
} else {
- proto_item_append_text(avp_item, "%d", uint);
+ proto_item_append_text(avp_item, "%d", uintv);
}
}
{
guint32 received;
int last_received = -1;
- int index = 0;
+ int indx = 0;
proto_tree *received_tree;
proto_item *ti_parsed_received = NULL;
received = tvb_get_ntohl(tvb, offset);
- while ((received<<index) != 0) {
- if (index>=32) break;
- if (received &(0x1<<(31-index))) {
- if (index==0) {
+ while ((received<<indx) != 0) {
+ if (indx>=32) break;
+ if (received &(0x1<<(31-indx))) {
+ if (indx==0) {
received_tree = proto_item_add_subtree(ti_received, ett_reload_framing_received);
ti_parsed_received = proto_tree_add_item(received_tree, hf_reload_framing_parsed_received, tvb, offset, 4, ENC_NA);
- proto_item_append_text(ti_parsed_received, "[%u", (sequence -32+index));
- last_received = index;
+ proto_item_append_text(ti_parsed_received, "[%u", (sequence -32+indx));
+ last_received = indx;
}
else {
- if (received &(0x1<<(31-index+1))) {
- index++;
+ if (received &(0x1<<(31-indx+1))) {
+ indx++;
/* range: skip */
continue;
}
/* 1st acked ever */
received_tree = proto_item_add_subtree(ti_received, ett_reload_framing_received);
ti_parsed_received = proto_tree_add_item(received_tree, hf_reload_framing_parsed_received, tvb, offset, 4, ENC_NA);
- proto_item_append_text(ti_parsed_received, "[%u",(sequence-32+index));
+ proto_item_append_text(ti_parsed_received, "[%u",(sequence-32+indx));
}
else {
- proto_item_append_text(ti_parsed_received, ",%u",(sequence-32+index));
+ proto_item_append_text(ti_parsed_received, ",%u",(sequence-32+indx));
}
- last_received = index;
+ last_received = indx;
}
}
}
- else if (index>0) {
- if ((received &(0x1<<(31-index+1))) && (received &(0x1<<(31-index+2)))) {
+ else if (indx>0) {
+ if ((received &(0x1<<(31-indx+1))) && (received &(0x1<<(31-indx+2)))) {
/* end of a series */
- if ((received &(0x1<<(31-index+3)))) {
- proto_item_append_text(ti_parsed_received,"-%u",(sequence-32+index-1));
+ if ((received &(0x1<<(31-indx+3)))) {
+ proto_item_append_text(ti_parsed_received,"-%u",(sequence-32+indx-1));
}
else {
/* just a pair */
- proto_item_append_text(ti_received, ",%u", (sequence-32+index-1));
+ proto_item_append_text(ti_received, ",%u", (sequence-32+indx-1));
}
}
else {
- index++;
+ indx++;
continue;
}
}
- index++;
+ indx++;
}
if (last_received>=0) {
- if ((received &(0x1<<(31-index+1))) && (received &(0x1<<(31-index+2)))) {
+ if ((received &(0x1<<(31-indx+1))) && (received &(0x1<<(31-indx+2)))) {
/* end of a series */
- if ((received &(0x1<<(31-index+3)))) {
- proto_item_append_text(ti_parsed_received,"-%u",(sequence-32+index-1));
+ if ((received &(0x1<<(31-indx+3)))) {
+ proto_item_append_text(ti_parsed_received,"-%u",(sequence-32+indx-1));
}
else {
/* just a pair */
- proto_item_append_text(ti_parsed_received, ",%u", (sequence-32+index-1));
+ proto_item_append_text(ti_parsed_received, ",%u", (sequence-32+indx-1));
}
}
proto_item_append_text(ti_parsed_received, "]");
local_tree = proto_item_add_subtree(ti_local, ett_reload_pingans);
proto_tree_add_item(local_tree, hf_reload_ping_response_id, tvb, offset, 8, ENC_BIG_ENDIAN);
{
- guint64 time;
+ guint64 timev;
guint32 remaining_ms;
time_t time_sec;
nstime_t l_nsTime;
- time = tvb_get_ntoh64(tvb, offset+8);
- time_sec = (time_t)time/1000;
- remaining_ms = (guint32)(time % 1000);
+ timev = tvb_get_ntoh64(tvb, offset+8);
+ time_sec = (time_t)timev/1000;
+ remaining_ms = (guint32)(timev % 1000);
l_nsTime.secs = time_sec;
l_nsTime.nsecs = remaining_ms*1000*1000;
for(i = 0; i< tvb_length(tvb)-header_size; i++ ){
out[i+header_size] = tvb_get_guint8(tvb, header_size+i);
}
- /*Call KASUMI confidentiality function, note that rbid is zero indexed*/
+ /*Call KASUMI confidentiality function, note that rbid is zero indxed*/
f8( key_in, counter, rbid-1, dir, &out[header_size], (tvb_length(tvb)-header_size)*8 );
/*Restore header in tvb*/
rlc_info * rlcinf, guint16 seq, enum rlc_mode mode)
{
rrc_ciphering_info * c_inf;
- guint8 index, header_size, hfn_shift;
+ guint8 indx, header_size, hfn_shift;
gint16 pos;
- index = fpinf->is_uplink ? 1 : 0;
+ indx = fpinf->is_uplink ? 1 : 0;
pos = fpinf->cur_tb;
if (mode ==RLC_UM) {
header_size = 1;
/*TODO: This doesnt really work for all packets..*/
/*Check if we have ciphering info and that this frame is ciphered*/
- if(c_inf!=NULL && ( (c_inf->setup_frame > 0 && c_inf->setup_frame < pinfo->fd->num && c_inf->seq_no[rlcinf->rbid[pos]][index] == -1) ||
- (c_inf->setup_frame < pinfo->fd->num && c_inf->seq_no[rlcinf->rbid[pos]][index] >= 0 && c_inf->seq_no[rlcinf->rbid[pos]][index] <= seq) )){
+ if(c_inf!=NULL && ( (c_inf->setup_frame > 0 && c_inf->setup_frame < pinfo->fd->num && c_inf->seq_no[rlcinf->rbid[pos]][indx] == -1) ||
+ (c_inf->setup_frame < pinfo->fd->num && c_inf->seq_no[rlcinf->rbid[pos]][indx] >= 0 && c_inf->seq_no[rlcinf->rbid[pos]][indx] <= seq) )){
tvbuff_t *t;
/*Check if this counter has been initialized*/
- if(!counter_init[rlcinf->rbid[pos]][index] ){
+ if(!counter_init[rlcinf->rbid[pos]][indx] ){
guint32 frame_num = pinfo->fd->num;
/*Initializes counter*/
g_tree_foreach(c_inf->start_ps, (GTraverseFunc)iter_same, &frame_num);
/*Set COUNTER value accordingly as specified by 6.4.8 in 3GPP TS 33.102 */
- if(max_counter +2 > frame_num && c_inf->seq_no[rlcinf->rbid[pos]][index] == -1){
+ if(max_counter +2 > frame_num && c_inf->seq_no[rlcinf->rbid[pos]][indx] == -1){
ps_counter[rlcinf->rbid[pos]][0] = (max_counter+2) << hfn_shift;
ps_counter[rlcinf->rbid[pos]][1] = (max_counter+2) << hfn_shift;
}else{
}
/*Update the maximal COUNTER value seen so far*/
- max_counter = MAX(max_counter,((ps_counter[rlcinf->rbid[pos]][index]) | seq) >> hfn_shift);
+ max_counter = MAX(max_counter,((ps_counter[rlcinf->rbid[pos]][indx]) | seq) >> hfn_shift);
/*XXX:Since RBID in umts isnt configured properly..*/
if(rlcinf->rbid[pos] == 9 ){
frame_num[0] = pinfo->fd->num;
/*Find the correct counter value*/
g_tree_foreach(counter_map, (GTraverseFunc)rlc_find_old_counter, &frame_num[0]);
- t = rlc_decipher_tvb(tvb, pinfo, (frame_num[index+1] | seq),16,!fpinf->is_uplink,header_size);
+ t = rlc_decipher_tvb(tvb, pinfo, (frame_num[indx+1] | seq),16,!fpinf->is_uplink,header_size);
}else{
- t = rlc_decipher_tvb(tvb, pinfo, ((ps_counter[rlcinf->rbid[pos]][index]) | seq),16,!fpinf->is_uplink,header_size);
+ t = rlc_decipher_tvb(tvb, pinfo, ((ps_counter[rlcinf->rbid[pos]][indx]) | seq),16,!fpinf->is_uplink,header_size);
}
}else{
if(tree){
guint32 frame_num[3];
frame_num[0] = pinfo->fd->num;
g_tree_foreach(counter_map, (GTraverseFunc)rlc_find_old_counter, &frame_num[0]);
- t = rlc_decipher_tvb(tvb, pinfo, (frame_num[index+1] | seq),rlcinf->rbid[pos],!fpinf->is_uplink,header_size);
+ t = rlc_decipher_tvb(tvb, pinfo, (frame_num[indx+1] | seq),rlcinf->rbid[pos],!fpinf->is_uplink,header_size);
}else
- t = rlc_decipher_tvb(tvb, pinfo, ((ps_counter[rlcinf->rbid[pos]][index]) | seq),rlcinf->rbid[pos],!fpinf->is_uplink,header_size);
+ t = rlc_decipher_tvb(tvb, pinfo, ((ps_counter[rlcinf->rbid[pos]][indx]) | seq),rlcinf->rbid[pos],!fpinf->is_uplink,header_size);
}
/*Update the hyperframe number*/
if(seq == 4095){
- ps_counter[rlcinf->rbid[pos]][index] += 1 << hfn_shift;
+ ps_counter[rlcinf->rbid[pos]][indx] += 1 << hfn_shift;
if(!tree){/*Preserve counter for second packet analysis run*/
guint32 * ciph;
static guint crc_calc (guint crc, guint val)
{
- int index;
+ int indx;
guint ncrc;
- index = (((crc >> 8) ^ val) & 0xff);
- ncrc = crc_table[index] ^ ((crc << 8) & 0xffff);
+ indx = (((crc >> 8) ^ val) & 0xff);
+ ncrc = crc_table[indx] ^ ((crc << 8) & 0xffff);
return ncrc;
}
proto_item *nlp_item, *bf_item;
guint8 nhdr_0, nhdr_1, nhdr_x, thdr_8, thdr_9, fid;
guint32 thdr_len, thdr_dlf;
- guint16 subindex;
+ guint16 subindx;
- int index = 0, counter = 0;
+ int indx = 0, counter = 0;
nlp_tree = NULL;
nlp_item = NULL;
- nhdr_0 = tvb_get_guint8(tvb, index);
- nhdr_1 = tvb_get_guint8(tvb, index+1);
+ nhdr_0 = tvb_get_guint8(tvb, indx);
+ nhdr_1 = tvb_get_guint8(tvb, indx+1);
col_set_str(pinfo->cinfo, COL_INFO, "HPR NLP Packet");
/* Don't bother setting length. We'll set it later after we
* find the lengths of NHDR */
nlp_item = proto_tree_add_item(tree, hf_sna_nlp_nhdr, tvb,
- index, -1, ENC_NA);
+ indx, -1, ENC_NA);
nlp_tree = proto_item_add_subtree(nlp_item, ett_sna_nlp_nhdr);
bf_item = proto_tree_add_uint(nlp_tree, hf_sna_nlp_nhdr_0, tvb,
- index, 1, nhdr_0);
+ indx, 1, nhdr_0);
bf_tree = proto_item_add_subtree(bf_item, ett_sna_nlp_nhdr_0);
- proto_tree_add_uint(bf_tree, hf_sna_nlp_sm, tvb, index, 1,
+ proto_tree_add_uint(bf_tree, hf_sna_nlp_sm, tvb, indx, 1,
nhdr_0);
- proto_tree_add_uint(bf_tree, hf_sna_nlp_tpf, tvb, index, 1,
+ proto_tree_add_uint(bf_tree, hf_sna_nlp_tpf, tvb, indx, 1,
nhdr_0);
bf_item = proto_tree_add_uint(nlp_tree, hf_sna_nlp_nhdr_1, tvb,
- index+1, 1, nhdr_1);
+ indx+1, 1, nhdr_1);
bf_tree = proto_item_add_subtree(bf_item, ett_sna_nlp_nhdr_1);
proto_tree_add_uint(bf_tree, hf_sna_nlp_ft, tvb,
- index+1, 1, nhdr_1);
+ indx+1, 1, nhdr_1);
proto_tree_add_boolean(bf_tree, hf_sna_nlp_tspi, tvb,
- index+1, 1, nhdr_1);
+ indx+1, 1, nhdr_1);
proto_tree_add_boolean(bf_tree, hf_sna_nlp_slowdn1, tvb,
- index+1, 1, nhdr_1);
+ indx+1, 1, nhdr_1);
proto_tree_add_boolean(bf_tree, hf_sna_nlp_slowdn2, tvb,
- index+1, 1, nhdr_1);
+ indx+1, 1, nhdr_1);
}
/* ANR or FR lists */
- index += 2;
+ indx += 2;
counter = 0;
if ((nhdr_0 & 0xe0) == 0xa0) {
do {
- nhdr_x = tvb_get_guint8(tvb, index + counter);
+ nhdr_x = tvb_get_guint8(tvb, indx + counter);
counter ++;
} while (nhdr_x != 0xff);
if (tree)
proto_tree_add_item(nlp_tree,
- hf_sna_nlp_fra, tvb, index, counter, ENC_NA);
- index += counter;
+ hf_sna_nlp_fra, tvb, indx, counter, ENC_NA);
+ indx += counter;
if (tree)
- proto_tree_add_text(nlp_tree, tvb, index, 1,
+ proto_tree_add_text(nlp_tree, tvb, indx, 1,
"Reserved");
- index++;
+ indx++;
if (tree)
- proto_item_set_len(nlp_item, index);
+ proto_item_set_len(nlp_item, indx);
if ((nhdr_1 & 0xf0) == 0x10) {
- nhdr_x = tvb_get_guint8(tvb, index);
+ nhdr_x = tvb_get_guint8(tvb, indx);
if (tree)
proto_tree_add_uint(tree, hf_sna_nlp_frh,
- tvb, index, 1, nhdr_x);
- index ++;
+ tvb, indx, 1, nhdr_x);
+ indx ++;
- if (tvb_offset_exists(tvb, index))
+ if (tvb_offset_exists(tvb, indx))
call_dissector(data_handle,
- tvb_new_subset_remaining(tvb, index),
+ tvb_new_subset_remaining(tvb, indx),
pinfo, parent_tree);
return;
}
}
if ((nhdr_0 & 0xe0) == 0xc0) {
do {
- nhdr_x = tvb_get_guint8(tvb, index + counter);
+ nhdr_x = tvb_get_guint8(tvb, indx + counter);
counter ++;
} while (nhdr_x != 0xff);
if (tree)
proto_tree_add_item(nlp_tree, hf_sna_nlp_anr,
- tvb, index, counter, ENC_NA);
- index += counter;
+ tvb, indx, counter, ENC_NA);
+ indx += counter;
if (tree)
- proto_tree_add_text(nlp_tree, tvb, index, 1,
+ proto_tree_add_text(nlp_tree, tvb, indx, 1,
"Reserved");
- index++;
+ indx++;
if (tree)
- proto_item_set_len(nlp_item, index);
+ proto_item_set_len(nlp_item, indx);
}
- thdr_8 = tvb_get_guint8(tvb, index+8);
- thdr_9 = tvb_get_guint8(tvb, index+9);
- thdr_len = tvb_get_ntohs(tvb, index+10);
- thdr_dlf = tvb_get_ntohl(tvb, index+12);
+ thdr_8 = tvb_get_guint8(tvb, indx+8);
+ thdr_9 = tvb_get_guint8(tvb, indx+9);
+ thdr_len = tvb_get_ntohs(tvb, indx+10);
+ thdr_dlf = tvb_get_ntohl(tvb, indx+12);
if (tree) {
nlp_item = proto_tree_add_item(tree, hf_sna_nlp_thdr, tvb,
- index, thdr_len << 2, ENC_NA);
+ indx, thdr_len << 2, ENC_NA);
nlp_tree = proto_item_add_subtree(nlp_item, ett_sna_nlp_thdr);
proto_tree_add_item(nlp_tree, hf_sna_nlp_tcid, tvb,
- index, 8, ENC_NA);
+ indx, 8, ENC_NA);
bf_item = proto_tree_add_uint(nlp_tree, hf_sna_nlp_thdr_8, tvb,
- index+8, 1, thdr_8);
+ indx+8, 1, thdr_8);
bf_tree = proto_item_add_subtree(bf_item, ett_sna_nlp_thdr_8);
proto_tree_add_boolean(bf_tree, hf_sna_nlp_setupi, tvb,
- index+8, 1, thdr_8);
- proto_tree_add_boolean(bf_tree, hf_sna_nlp_somi, tvb, index+8,
+ indx+8, 1, thdr_8);
+ proto_tree_add_boolean(bf_tree, hf_sna_nlp_somi, tvb, indx+8,
1, thdr_8);
- proto_tree_add_boolean(bf_tree, hf_sna_nlp_eomi, tvb, index+8,
+ proto_tree_add_boolean(bf_tree, hf_sna_nlp_eomi, tvb, indx+8,
1, thdr_8);
- proto_tree_add_boolean(bf_tree, hf_sna_nlp_sri, tvb, index+8,
+ proto_tree_add_boolean(bf_tree, hf_sna_nlp_sri, tvb, indx+8,
1, thdr_8);
proto_tree_add_boolean(bf_tree, hf_sna_nlp_rasapi, tvb,
- index+8, 1, thdr_8);
+ indx+8, 1, thdr_8);
proto_tree_add_boolean(bf_tree, hf_sna_nlp_retryi, tvb,
- index+8, 1, thdr_8);
+ indx+8, 1, thdr_8);
bf_item = proto_tree_add_uint(nlp_tree, hf_sna_nlp_thdr_9, tvb,
- index+9, 1, thdr_9);
+ indx+9, 1, thdr_9);
bf_tree = proto_item_add_subtree(bf_item, ett_sna_nlp_thdr_9);
- proto_tree_add_boolean(bf_tree, hf_sna_nlp_lmi, tvb, index+9,
+ proto_tree_add_boolean(bf_tree, hf_sna_nlp_lmi, tvb, indx+9,
1, thdr_9);
- proto_tree_add_boolean(bf_tree, hf_sna_nlp_cqfi, tvb, index+9,
+ proto_tree_add_boolean(bf_tree, hf_sna_nlp_cqfi, tvb, indx+9,
1, thdr_9);
- proto_tree_add_boolean(bf_tree, hf_sna_nlp_osi, tvb, index+9,
+ proto_tree_add_boolean(bf_tree, hf_sna_nlp_osi, tvb, indx+9,
1, thdr_9);
- proto_tree_add_uint(nlp_tree, hf_sna_nlp_offset, tvb, index+10,
+ proto_tree_add_uint(nlp_tree, hf_sna_nlp_offset, tvb, indx+10,
2, thdr_len);
- proto_tree_add_uint(nlp_tree, hf_sna_nlp_dlf, tvb, index+12,
+ proto_tree_add_uint(nlp_tree, hf_sna_nlp_dlf, tvb, indx+12,
4, thdr_dlf);
- proto_tree_add_item(nlp_tree, hf_sna_nlp_bsn, tvb, index+16,
+ proto_tree_add_item(nlp_tree, hf_sna_nlp_bsn, tvb, indx+16,
4, ENC_BIG_ENDIAN);
}
- subindex = 20;
+ subindx = 20;
- if (((thdr_9 & 0x18) == 0x08) && ((thdr_len << 2) > subindex)) {
- counter = tvb_get_guint8(tvb, index + subindex);
- if (tvb_get_guint8(tvb, index+subindex+1) == 5)
- dissect_control(tvb, index + subindex, counter+2, nlp_tree, 1, LT);
+ if (((thdr_9 & 0x18) == 0x08) && ((thdr_len << 2) > subindx)) {
+ counter = tvb_get_guint8(tvb, indx + subindx);
+ if (tvb_get_guint8(tvb, indx+subindx+1) == 5)
+ dissect_control(tvb, indx + subindx, counter+2, nlp_tree, 1, LT);
else
call_dissector(data_handle,
- tvb_new_subset(tvb, index + subindex, counter+2,
+ tvb_new_subset(tvb, indx + subindx, counter+2,
-1), pinfo, nlp_tree);
- subindex += (counter+2);
+ subindx += (counter+2);
}
- if ((thdr_9 & 0x04) && ((thdr_len << 2) > subindex))
+ if ((thdr_9 & 0x04) && ((thdr_len << 2) > subindx))
dissect_optional(
- tvb_new_subset(tvb, index + subindex,
- (thdr_len << 2) - subindex, -1),
+ tvb_new_subset(tvb, indx + subindx,
+ (thdr_len << 2) - subindx, -1),
pinfo, nlp_tree);
- index += (thdr_len << 2);
+ indx += (thdr_len << 2);
if (((thdr_8 & 0x20) == 0) && thdr_dlf) {
col_set_str(pinfo->cinfo, COL_INFO, "HPR Fragment");
- if (tvb_offset_exists(tvb, index)) {
+ if (tvb_offset_exists(tvb, indx)) {
call_dissector(data_handle,
- tvb_new_subset_remaining(tvb, index), pinfo,
+ tvb_new_subset_remaining(tvb, indx), pinfo,
parent_tree);
}
return;
}
- if (tvb_offset_exists(tvb, index)) {
+ if (tvb_offset_exists(tvb, indx)) {
/* Transmission Header Format Identifier */
- fid = hi_nibble(tvb_get_guint8(tvb, index));
+ fid = hi_nibble(tvb_get_guint8(tvb, indx));
if (fid == 5) /* Only FID5 allowed for HPR */
- dissect_fid(tvb_new_subset_remaining(tvb, index), pinfo,
+ dissect_fid(tvb_new_subset_remaining(tvb, indx), pinfo,
tree, parent_tree);
else {
- if (tvb_get_ntohs(tvb, index+2) == 0x12ce) {
+ if (tvb_get_ntohs(tvb, indx+2) == 0x12ce) {
/* Route Setup */
col_set_str(pinfo->cinfo, COL_INFO, "HPR Route Setup");
- dissect_gds(tvb_new_subset_remaining(tvb, index),
+ dissect_gds(tvb_new_subset_remaining(tvb, indx),
pinfo, tree, parent_tree);
} else
call_dissector(data_handle,
- tvb_new_subset_remaining(tvb, index),
+ tvb_new_subset_remaining(tvb, indx),
pinfo, parent_tree);
}
}
proto_tree *mptcp_flags_tree;
guint8 subtype;
- guint8 index;
+ guint8 indx;
guint8 flags;
guint8 ipver;
case 24:
offset += 2;
- for (index = 0; index < 5; index++) {
+ for (indx = 0; indx < 5; indx++) {
proto_tree_add_item(mptcp_tree,
hf_tcp_option_mptcp_sender_mac, tvb, offset,
4, ENC_BIG_ENDIAN);
/*check if desegment
* now it checks that last char is '>',
* TODO checks that first element in packet is closed*/
- int index;
+ int indx;
gchar last_char;
if (xmpp_desegment)
{
- index = tvb_reported_length(tvb) - 1;
- if (index >= 0)
+ indx = tvb_reported_length(tvb) - 1;
+ if (indx >= 0)
{
- last_char = tvb_get_guint8(tvb, index);
+ last_char = tvb_get_guint8(tvb, indx);
- while ((last_char <= ' ') && (index - 1 >= 0))
+ while ((last_char <= ' ') && (indx - 1 >= 0))
{
- index--;
- last_char = tvb_get_guint8(tvb, index);
+ indx--;
+ last_char = tvb_get_guint8(tvb, indx);
}
- if ((index >= 0) && (last_char != '>'))
+ if ((indx >= 0) && (last_char != '>'))
{
pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT;
return;
return TRUE;
}
-/* select a tcp stream to follow via it's index */
+/* select a tcp stream to follow via its index */
gboolean
-follow_tcp_index(guint32 index)
+follow_tcp_index(guint32 indx)
{
if (find_tcp_index || find_tcp_addr) {
return FALSE;
}
find_tcp_addr = TRUE;
- tcp_stream_to_follow = index;
+ tcp_stream_to_follow = indx;
memset(ip_address, 0, sizeof ip_address);
port[0] = port[1] = 0;
g_hash_table_insert(dict->vendors_by_name, (gpointer) v->name, v);
}
-static void add_attribute(const gchar* name, const gchar* codestr, radius_attr_dissector_t type, const gchar* vendor, guint crypt, gboolean tagged, const gchar* attr) {
+static void add_attribute(const gchar* name, const gchar* codestr, radius_attr_dissector_t type, const gchar* vendor, guint encrypted_flag, gboolean tagged, const gchar* attr) {
radius_attr_info_t* a;
GHashTable* by_id;
guint32 code;
}
a->code = code;
- a->encrypt = crypt;
+ a->encrypt = encrypted_flag;
a->tagged = tagged;
a->type = type;
a->vs = NULL;
/* Creates a new NSTime object */
#define WSLUA_OPTARG_NSTime_new_SECONDS 1 /* Seconds */
#define WSLUA_OPTARG_NSTime_new_NSECONDS 2 /* Nano seconds */
- NSTime time = g_malloc(sizeof(nstime_t));
+ NSTime nstime = g_malloc(sizeof(nstime_t));
- if (!time) return 0;
+ if (!nstime) return 0;
- time->secs = (time_t) luaL_optint(L,WSLUA_OPTARG_NSTime_new_SECONDS,0);
- time->nsecs = luaL_optint(L,WSLUA_OPTARG_NSTime_new_NSECONDS,0);
+ nstime->secs = (time_t) luaL_optint(L,WSLUA_OPTARG_NSTime_new_SECONDS,0);
+ nstime->nsecs = luaL_optint(L,WSLUA_OPTARG_NSTime_new_NSECONDS,0);
- pushNSTime(L,time);
+ pushNSTime(L,nstime);
WSLUA_RETURN(1); /* The new NSTime object. */
}
} nstime_actions_t;
static int NSTime_get_secs(lua_State* L) {
- NSTime time = toNSTime(L,1);
+ NSTime nstime = toNSTime(L,1);
- lua_pushnumber (L,(lua_Number)(time->secs));
+ lua_pushnumber (L,(lua_Number)(nstime->secs));
return 1;
}
static int NSTime_set_secs(lua_State* L)
{
- NSTime time = toNSTime(L,1);
+ NSTime nstime = toNSTime(L,1);
time_t secs = luaL_checkint(L,3);
- time->secs = secs;
+ nstime->secs = secs;
return 0;
}
static int NSTime_get_nsecs(lua_State* L) {
- NSTime time = toNSTime(L,1);
+ NSTime nstime = toNSTime(L,1);
- lua_pushnumber (L,(lua_Number)(time->nsecs));
+ lua_pushnumber (L,(lua_Number)(nstime->nsecs));
return 1;
}
static int NSTime_set_nsecs(lua_State* L) {
- NSTime time = toNSTime(L,1);
+ NSTime nstime = toNSTime(L,1);
int nsecs = luaL_checkint(L,3);
- time->nsecs = nsecs;
+ nstime->nsecs = nsecs;
return 0;
}
};
static int NSTime__index(lua_State* L) {
- NSTime time = checkNSTime(L,1);
+ NSTime nstime = checkNSTime(L,1);
const gchar* name = luaL_checkstring(L,2);
const nstime_actions_t* pa;
- if (! (time && name) ) return 0;
+ if (! (nstime && name) ) return 0;
for (pa = nstime_actions; pa->name; pa++) {
if ( g_str_equal(name,pa->name) ) {
}
static int NSTime__newindex(lua_State* L) {
- NSTime time = checkNSTime(L,1);
+ NSTime nstime = checkNSTime(L,1);
const gchar* name = luaL_checkstring(L,2);
const nstime_actions_t* pa;
- if (! (time && name) ) return 0;
+ if (! (nstime && name) ) return 0;
for (pa = nstime_actions; pa->name; pa++) {
if ( g_str_equal(name,pa->name) ) {
static int
resp_getspeeds(tvbuff_t *tvb, int offset, proto_tree *pt)
{
- int index,
+ int indx,
size = tvb_get_guint8(tvb, offset+8),
number = tvb_get_guint8(tvb, offset+9);
proto_tree_add_item(pt, hf_gryphon_getspeeds_preset, tvb, offset+9, 1, ENC_BIG_ENDIAN);
offset += 10;
- for (index = 1; index <= number; index++) {
+ for (indx = 1; indx <= number; indx++) {
proto_tree_add_bytes_format(pt, hf_gryphon_getspeeds_data, tvb, offset, size,
- tvb_get_ptr(tvb, offset, size), "Data for preset %d", index);
+ tvb_get_ptr(tvb, offset, size), "Data for preset %d", indx);
offset += size;
}
return offset;
cmd_init_strat (tvbuff_t *tvb, int offset, proto_tree *pt)
{
guint32 reset_limit;
- int msglen, index;
+ int msglen, indx;
float value;
msglen = tvb_reported_length_remaining(tvb, offset);
reset_limit, "Reset Limit = %u messages", reset_limit);
offset += 4;
msglen -= 4;
- for (index = 1; msglen; index++, offset++, msglen--) {
+ for (indx = 1; msglen; indx++, offset++, msglen--) {
value = tvb_get_guint8(tvb, offset);
if (value)
proto_tree_add_float_format_value(pt, hf_gryphon_init_strat_delay, tvb, offset, 1,
- value/4, "Delay %d = %.2f seconds", index, value/4);
+ value/4, "Delay %d = %.2f seconds", indx, value/4);
else
proto_tree_add_float_format_value(pt, hf_gryphon_init_strat_delay, tvb, offset, 1,
- 0, "Delay %d = infinite", index);
+ 0, "Delay %d = infinite", indx);
}
return offset;
/* display the service type in addition to the message type */
if (iServiceId != -1)
{
- int index = 0;
- while (index < g_NumServices)
+ int indx = 0;
+ while (indx < g_NumServices)
{
- if (g_requesttypes[index].value == (guint32)iServiceId)
+ if (g_requesttypes[indx].value == (guint32)iServiceId)
{
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", g_szMessageTypes[msgtype], g_requesttypes[index].strptr);
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", g_szMessageTypes[msgtype], g_requesttypes[indx].strptr);
break;
}
- index++;
+ indx++;
}
}
}
void dispatchExtensionObjectType(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, int TypeId)
{
gint iOffset = *pOffset;
- int index = 0;
+ int indx = 0;
int bFound = 0;
gint32 iLen = 0;
iLen = tvb_get_letohl(tvb, iOffset);
iOffset += 4;
- while (index < g_NumTypes)
+ while (indx < g_NumTypes)
{
- if (g_arExtensionObjectParserTable[index].iRequestId == TypeId)
+ if (g_arExtensionObjectParserTable[indx].iRequestId == TypeId)
{
bFound = 1;
- (*g_arExtensionObjectParserTable[index].pParser)(tree, tvb, &iOffset, g_arExtensionObjectParserTable[index].typeName);
+ (*g_arExtensionObjectParserTable[indx].pParser)(tree, tvb, &iOffset, g_arExtensionObjectParserTable[indx].typeName);
break;
}
- index++;
+ indx++;
}
/* display contained object as ByteString if unknown type */
**
** Copyright (C) 2006-2009 ascolab GmbH. All Rights Reserved.
** Web: http://www.ascolab.com
-**
+**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** of the License, or (at your option) any later version.
-**
+**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
+**
** Project: OpcUa Wireshark Plugin
**
** Description: Service table and service dispatcher.
/** Dispatch all services to a special parser function. */
void dispatchService(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, int ServiceId)
{
- int index = 0;
+ int indx = 0;
- while (index < g_NumServices)
+ while (indx < g_NumServices)
{
- if (g_arParserTable[index].iRequestId == ServiceId)
+ if (g_arParserTable[indx].iRequestId == ServiceId)
{
- (*g_arParserTable[index].pParser)(tree, tvb, pOffset);
+ (*g_arParserTable[indx].pParser)(tree, tvb, pOffset);
break;
}
- index++;
+ indx++;
}
}
{
guint offset = 0;
guint tvb_len, payload_type, report_type;
- guint number_of_frequencies, index;
+ guint number_of_frequencies, indx;
proto_item *aas_beam_item = NULL;
proto_tree *aas_beam_tree = NULL;
/* calculate the total number of frequencies */
number_of_frequencies = (tvb_len - offset) / 2 - 1;
/* display the frequency */
- for(index = 0; index < number_of_frequencies; index++)
+ for(indx = 0; indx < number_of_frequencies; indx++)
{ /* display the Frequency Value (real part) */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_freq_value_re, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next field */
{
&hf_aas_beam_message_type,
{
- "MAC Management Message Type", "wmx.macmgtmsgtype.aas_beam",
+ "MAC Management Message Type", "wmx.macmgtmsgtype.aas_beam",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_aas_beam_select_index,
{
- "AAS Beam Index", "wmx.aas_beam.aas_beam_index",
+ "AAS Beam Index", "wmx.aas_beam.aas_beam_index",
FT_UINT8, BASE_DEC, NULL, AAS_BEAM_SELECT_AAS_BEAM_INDEX_MASK, NULL, HFILL
}
},
{
&hf_aas_beam_beam_bit_mask,
{
- "Beam Bit Mask", "wmx.aas_beam.beam_bit_mask",
+ "Beam Bit Mask", "wmx.aas_beam.beam_bit_mask",
FT_UINT8, BASE_HEX, NULL, AAS_BEAM_BEAM_BIT_MASK_MASK, NULL, HFILL
}
},
{
&hf_aas_beam_cinr_value,
{
- "CINR Mean Value", "wmx.aas_beam.cinr_mean_value",
+ "CINR Mean Value", "wmx.aas_beam.cinr_mean_value",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_aas_beam_feedback_request_number,
{
- "Feedback Request Number", "wmx.aas_beam.feedback_request_number",
+ "Feedback Request Number", "wmx.aas_beam.feedback_request_number",
FT_UINT8, BASE_DEC, NULL, AAS_BEAM_FEEDBACK_REQUEST_NUMBER_MASK, NULL, HFILL
}
},
{
&hf_aas_beam_frame_number,
{
- "Frame Number", "wmx.aas_beam.frame_number",
+ "Frame Number", "wmx.aas_beam.frame_number",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_aas_beam_freq_value_im,
{
- "Frequency Value (imaginary part)", "wmx.aas_beam.freq_value_im",
+ "Frequency Value (imaginary part)", "wmx.aas_beam.freq_value_im",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_aas_beam_freq_value_re,
{
- "Frequency Value (real part)", "wmx.aas_beam.freq_value_re",
+ "Frequency Value (real part)", "wmx.aas_beam.freq_value_re",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_aas_beam_measurement_report_type,
{
- "Measurement Report Type", "wmx.aas_beam.measurement_report_type",
+ "Measurement Report Type", "wmx.aas_beam.measurement_report_type",
FT_UINT8, BASE_DEC, VALS(vals_report_types), AAS_BEAM_MEASUREMENT_REPORT_TYPE_MASK, NULL, HFILL
}
},
{
&hf_aas_beam_select_reserved,
{
- "Reserved", "wmx.aas_beam.reserved",
+ "Reserved", "wmx.aas_beam.reserved",
FT_UINT8, BASE_HEX, NULL, AAS_BEAM_SELECT_RESERVED_MASK, NULL, HFILL
}
},
{
&hf_aas_beam_resolution_parameter,
{
- "Resolution Parameter", "wmx.aas_beam.resolution_parameter",
+ "Resolution Parameter", "wmx.aas_beam.resolution_parameter",
FT_UINT8, BASE_DEC, VALS(vals_resolution_parameter), AAS_BEAM_RESOLUTION_PARAMETER_MASK, NULL, HFILL
}
},
{
&hf_aas_beam_rssi_value,
{
- "RSSI Mean Value", "wmx.aas_beam.rssi_mean_value",
+ "RSSI Mean Value", "wmx.aas_beam.rssi_mean_value",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_aas_beam_unknown_type,
{
- "Unknown TLV type", "wmx.aas_beam.unknown_type",
+ "Unknown TLV type", "wmx.aas_beam.unknown_type",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
}
}
static size_t file_input(gchar *buf, size_t max) {
- size_t read;
+ size_t read_cnt;
- read = fread(buf,1,max,yyin);
+ read_cnt = fread(buf,1,max,yyin);
- if ( read == max ) {
+ if ( read_cnt == max ) {
return max;
- } else if (read > 0) {
- return read;
+ } else if (read_cnt > 0) {
+ return read_cnt;
} else {
return YY_NULL;
}
#define HEXTOASCII(x) (((x) < 10) ? ((x) + '0') : ((x) - 10 + 'a'))
#define MAXFILELEN 255
-static GString *eo_rename(GString *gstr, int dup)
+static GString *eo_rename(GString *gstr, int dupn)
{
GString *gstr_tmp;
gchar *tmp_ptr;
GString *ext_str;
gstr_tmp = g_string_new("(");
- g_string_append_printf (gstr_tmp, "%d)", dup);
+ g_string_append_printf (gstr_tmp, "%d)", dupn);
if ( (tmp_ptr = strrchr(gstr->str, '.')) != NULL ) {
/* Retain the extension */
ext_str = g_string_new(tmp_ptr);
}
GString *
-eo_massage_str(const gchar *in_str, gsize maxlen, int dup)
+eo_massage_str(const gchar *in_str, gsize maxlen, int dupn)
{
gchar *tmp_ptr;
/* The characters in "reject" come from:
else
out_str = g_string_truncate(out_str, maxlen);
}
- if ( dup != 0 )
- out_str = eo_rename(out_str, dup);
+ if ( dupn != 0 )
+ out_str = eo_rename(out_str, dupn);
return out_str;
}
static void
-gtk_afpstat_init(const char *optarg, void *userdata _U_)
+gtk_afpstat_init(const char *opt_arg, void *userdata _U_)
{
afpstat_t *ss;
const char *filter=NULL;
GtkWidget *bbox;
GtkWidget *close_bt;
- if(!strncmp(optarg,"afp,srt,",8)){
- filter=optarg+8;
+ if(!strncmp(opt_arg,"afp,srt,",8)){
+ filter=opt_arg+8;
} else {
filter=NULL;
}
static void
ansi_map_stat_gtk_init(
- const char *optarg _U_,
+ const char *opt_arg _U_,
void* userdata _U_ )
{
ansi_map_stat_gtk_cb(NULL, NULL);
/* When called, this function will create a new instance of gtk2-dhcpstat.
*/
static void
-dhcpstat_init(const char *optarg, void *userdata _U_)
+dhcpstat_init(const char *opt_arg, void *userdata _U_)
{
dhcpstat_t *sp;
const char *filter;
GtkWidget *bt_close;
GtkWidget *bbox;
- if (strncmp(optarg, "bootp,stat,", 11) == 0) {
- filter = optarg+11;
+ if (strncmp(opt_arg, "bootp,stat,", 11) == 0) {
+ filter = opt_arg+11;
} else {
filter = NULL;
}
const void *phi);
static void gtk_camelcounter_draw(void *phs);
static void win_destroy_cb(GtkWindow *win _U_, gpointer data);
-static void gtk_camelcounter_init(const char *optarg, void *userdata _U_);
+static void gtk_camelcounter_init(const char *opt_arg, void *userdata _U_);
void register_tap_listener_gtk_camelcounter(void);
/* following values represent the size of their valuestring arrays */
{G_TYPE_UINT, RIGHT, "Count" }
};
-static void gtk_camelcounter_init(const char *optarg, void *userdata _U_)
+static void gtk_camelcounter_init(const char *opt_arg, void *userdata _U_)
{
struct camelcounter_t *p_camelcounter;
const char *filter=NULL;
GtkWidget *bbox;
GtkWidget *close_bt;
- if(strncmp(optarg,"camel,counter,",14) == 0){
- filter=optarg+14;
+ if(strncmp(opt_arg,"camel,counter,",14) == 0){
+ filter=opt_arg+14;
} else {
filter=NULL;
}
static void camelsrt_draw(void *phs);
static void win_destroy_cb(GtkWindow *win _U_, gpointer data);
-static void gtk_camelsrt_init(const char *optarg, void *userdata _U_);
+static void gtk_camelsrt_init(const char *opt_arg, void *userdata _U_);
void register_tap_listener_gtk_camelsrt(void);
/*
g_free(hs);
}
-static void gtk_camelsrt_init(const char *optarg, void *userdata _U_)
+static void gtk_camelsrt_init(const char *opt_arg, void *userdata _U_)
{
struct camelsrt_t * p_camelsrt;
const char *filter=NULL;
GtkWidget *close_bt;
int i;
- if(strncmp(optarg,"camel,srt,",10) == 0){
- filter=optarg+10;
+ if(strncmp(opt_arg,"camel,srt,",10) == 0){
+ filter=opt_arg+10;
} else {
filter=NULL;
}
update_visible_columns_menu (void);
static void
-update_options_table(gint index);
+update_options_table(gint indx);
static gboolean
query_tooltip_tree_view_cb (GtkWidget *widget,
gpointer data);
static
-gchar *col_index_to_name(gint index)
+gchar *col_index_to_name(gint indx)
{
gchar *col_name;
- switch (index)
+ switch (indx)
{
case INTERFACE: col_name = g_strdup("INTERFACE");
break;
}
static void
-update_options_table(gint index)
+update_options_table(gint indx)
{
interface_t device;
GtkTreePath *path;
}
if (cap_open_w) {
if_cb = (GtkTreeView *) g_object_get_data(G_OBJECT(cap_open_w), E_CAP_IFACE_KEY);
- path_str = g_strdup_printf("%d", index);
+ path_str = g_strdup_printf("%d", indx);
path = gtk_tree_path_new_from_string(path_str);
model = gtk_tree_view_get_model(if_cb);
gtk_tree_model_get_iter(model, &iter, path);
GtkWidget *pcap_ng_cb, *filter_cm;
interface_t device;
gchar *name;
- gint index = -1;
+ gint indx = -1;
guint i;
if_cb = (GtkTreeView *) g_object_get_data(G_OBJECT(cap_open_w), E_CAP_IFACE_KEY);
for (i = 0; i < global_capture_opts.all_ifaces->len; i++) {
device = g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (strcmp(device.name, name) == 0) {
- index = i;
+ indx = i;
break;
}
}
}
device.locked = TRUE;
}
- if (index != -1) {
- global_capture_opts.all_ifaces = g_array_remove_index(global_capture_opts.all_ifaces, index);
- g_array_insert_val(global_capture_opts.all_ifaces, index, device);
+ if (indx != -1) {
+ global_capture_opts.all_ifaces = g_array_remove_index(global_capture_opts.all_ifaces, indx);
+ g_array_insert_val(global_capture_opts.all_ifaces, indx, device);
pcap_ng_cb = (GtkWidget *) g_object_get_data(G_OBJECT(cap_open_w), E_CAP_PCAP_NG_KEY);
if (global_capture_opts.num_selected >= 2) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pcap_ng_cb), TRUE);
}
}
device.locked = FALSE;
- global_capture_opts.all_ifaces = g_array_remove_index(global_capture_opts.all_ifaces, index);
- g_array_insert_val(global_capture_opts.all_ifaces, index, device);
+ global_capture_opts.all_ifaces = g_array_remove_index(global_capture_opts.all_ifaces, indx);
+ g_array_insert_val(global_capture_opts.all_ifaces, indx, device);
gtk_tree_path_free (path);
filter_cm = (GtkWidget *)g_object_get_data(G_OBJECT(cap_open_w), E_ALL_CFILTER_CM_KEY);
if (strcmp(gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT(filter_cm)),"") != 0) {
add_pipe_cb(gpointer w _U_)
{
interface_t device;
- gint index;
+ gint indx;
GtkTreeView *if_cb;
GtkTreeModel *model;
GtkTreeIter iter;
#endif
global_capture_opts.num_selected++;
- index = global_capture_opts.all_ifaces->len;
+ indx = global_capture_opts.all_ifaces->len;
temp = g_strdup_printf("<b>%s</b>", device.display_name);
if (device.has_snaplen) {
}
if_cb = (GtkTreeView *) g_object_get_data(G_OBJECT(cap_open_w), E_CAP_IFACE_KEY);
- path_str = g_strdup_printf("%d", index);
+ path_str = g_strdup_printf("%d", indx);
model = gtk_tree_view_get_model(if_cb);
gtk_tree_model_get_iter_from_string(model, &iter, path_str);
g_array_append_val(global_capture_opts.all_ifaces, device);
{
interface_t device;
GtkTreePath *path = gtk_tree_model_get_path(tree_model, iter);
- int index = atoi(gtk_tree_path_to_string(path));
+ int indx = atoi(gtk_tree_path_to_string(path));
- device = g_array_index(global_capture_opts.all_ifaces, interface_t, index);
+ device = g_array_index(global_capture_opts.all_ifaces, interface_t, indx);
if (device.monitor_mode_supported == TRUE) {
g_object_set(G_OBJECT(renderer), "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL);
/* add a capture filter coming from the user's recent file to the cfilter combo box */
gboolean
cfilter_combo_add_recent(gchar *s) {
- gchar *dup;
+ gchar *dupstr;
if (s) {
- dup = g_strdup(s);
- if (!cfilter_combo_add(dup)) {
- g_free(dup);
+ dupstr = g_strdup(s);
+ if (!cfilter_combo_add(dupstr)) {
+ g_free(dupstr);
return FALSE;
}
}
/* when called, this function will create a new instance of gtk2-comparestat.
*/
static void
-gtk_comparestat_init(const char *optarg, void* userdata _U_)
+gtk_comparestat_init(const char *opt_arg, void* userdata _U_)
{
compstat_t *cs;
char *display_name;
const char *filter=NULL;
GString *error_string;
- if(sscanf(optarg,"compare,%d,%d,%d,%d,%lf%n",&start, &stop, &ttl, &order, &variance, &pos)==5){
+ if(sscanf(opt_arg,"compare,%d,%d,%d,%d,%lf%n",&start, &stop, &ttl, &order, &variance, &pos)==5){
if(pos){
- if(*(optarg+pos)==',')
- filter=optarg+pos+1;
+ if(*(opt_arg+pos)==',')
+ filter=opt_arg+pos+1;
else
- filter=optarg+pos;
+ filter=opt_arg+pos;
} else {
filter=NULL;
}
static void
-eth_conversation_init(const char *optarg, void* userdata _U_)
+eth_conversation_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"conv,eth,",9)){
- filter=optarg+9;
+ if(!strncmp(opt_arg,"conv,eth,",9)){
+ filter=opt_arg+9;
} else {
filter=NULL;
}
static void
-fc_conversation_init(const char *optarg, void* userdata _U_)
+fc_conversation_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"conv,fc,",8)){
- filter=optarg+8;
+ if(!strncmp(opt_arg,"conv,fc,",8)){
+ filter=opt_arg+8;
} else {
filter=NULL;
}
static void
-fddi_conversation_init(const char *optarg, void* userdata _U_ )
+fddi_conversation_init(const char *opt_arg, void* userdata _U_ )
{
const char *filter=NULL;
- if(!strncmp(optarg,"conv,fddi,",10)){
- filter=optarg+10;
+ if(!strncmp(opt_arg,"conv,fddi,",10)){
+ filter=opt_arg+10;
} else {
filter=NULL;
}
}
static void
-ip_conversation_init(const char *optarg, void* userdata _U_)
+ip_conversation_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"conv,ip,",8)){
- filter=optarg+8;
+ if(!strncmp(opt_arg,"conv,ip,",8)){
+ filter=opt_arg+8;
} else {
filter=NULL;
}
static void
-ipv6_conversation_init(const char *optarg, void *userdata _U_)
+ipv6_conversation_init(const char *opt_arg, void *userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg, "conv,ipv6,", 10)) {
- filter = optarg + 10;
+ if(!strncmp(opt_arg, "conv,ipv6,", 10)) {
+ filter = opt_arg + 10;
}
else {
filter = NULL;
static void
-ipx_conversation_init(const char *optarg, void* userdata _U_)
+ipx_conversation_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"conv,ipx,",9)){
- filter=optarg+9;
+ if(!strncmp(opt_arg,"conv,ipx,",9)){
+ filter=opt_arg+9;
} else {
filter=NULL;
}
}
static void
-jxta_conversation_init(const char *optarg, void* userdata _U_)
+jxta_conversation_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"conv,jxta,",10)){
- filter=optarg+10;
+ if(!strncmp(opt_arg,"conv,jxta,",10)){
+ filter=opt_arg+10;
} else {
filter=NULL;
}
}
static void
-ncp_conversation_init(const char *optarg, void* userdata _U_)
+ncp_conversation_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"conv,ncp,",9)){
- filter=optarg+9;
+ if(!strncmp(opt_arg,"conv,ncp,",9)){
+ filter=opt_arg+9;
} else {
filter=NULL;
}
}
static void
-rsvp_conversation_init(const char *optarg, void* userdata _U_)
+rsvp_conversation_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"conv,rsvp,",10)){
- filter=optarg+10;
+ if(!strncmp(opt_arg,"conv,rsvp,",10)){
+ filter=opt_arg+10;
} else {
filter=NULL;
}
static void
-sctp_conversation_init(const char *optarg, void* userdata _U_)
+sctp_conversation_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"conv,sctp,",10)){
- filter=optarg+10;
+ if(!strncmp(opt_arg,"conv,sctp,",10)){
+ filter=opt_arg+10;
} else {
filter=NULL;
}
static void
-tcpip_conversation_init(const char *optarg, void* userdata _U_)
+tcpip_conversation_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"conv,tcp,",9)){
- filter=optarg+9;
+ if(!strncmp(opt_arg,"conv,tcp,",9)){
+ filter=opt_arg+9;
} else {
filter=NULL;
}
static void
-tr_conversation_init(const char *optarg, void* userdata _U_)
+tr_conversation_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"conv,tr,",8)){
- filter=optarg+8;
+ if(!strncmp(opt_arg,"conv,tr,",8)){
+ filter=opt_arg+8;
} else {
filter=NULL;
}
static void
-udpip_conversation_init(const char *optarg, void* userdata _U_)
+udpip_conversation_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"conv,udp,",9)){
- filter=optarg+9;
+ if(!strncmp(opt_arg,"conv,udp,",9)){
+ filter=opt_arg+9;
} else {
filter=NULL;
}
static void
-usb_conversation_init(const char *optarg, void* userdata _U_)
+usb_conversation_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if (!strncmp(optarg, "conv,usb,", 9)) {
- filter = optarg + 9;
+ if (!strncmp(opt_arg, "conv,usb,", 9)) {
+ filter = opt_arg + 9;
} else {
filter = NULL;
}
static void
-wlan_conversation_init(const char *optarg, void* userdata _U_)
+wlan_conversation_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"conv,wlan,",10)){
- filter=optarg+10;
+ if(!strncmp(opt_arg,"conv,wlan,",10)){
+ filter=opt_arg+10;
} else {
filter=NULL;
}
/* When called, this function will create a new instance of gtk-dcerpcstat.
*/
static void
-gtk_dcerpcstat_init(const char *optarg, void* userdata _U_)
+gtk_dcerpcstat_init(const char *opt_arg, void* userdata _U_)
{
dcerpcstat_t *rs;
guint32 i, max_procs;
* if it's omitted?
*/
if(sscanf(
- optarg,
+ opt_arg,
"dcerpc,srt,%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x,%d.%d,%n",
&d1,&d2,&d3,&d40,&d41,&d42,&d43,&d44,&d45,&d46,&d47,&major,&minor,&pos)
== 13) {
uuid.Data4[6] = d46;
uuid.Data4[7] = d47;
if(pos) {
- filter = optarg+pos;
+ filter = opt_arg+pos;
} else {
filter = NULL;
}
static void
-gtk_diameterstat_init(const char *optarg, void *userdata _U_)
+gtk_diameterstat_init(const char *opt_arg, void *userdata _U_)
{
diameterstat_t *diameter;
const char *filter=NULL;
GtkWidget *close_bt;
int* idx;
- if(!strncmp(optarg,"diameter,",9)){
- filter=optarg+9;
+ if(!strncmp(opt_arg,"diameter,",9)){
+ filter=opt_arg+9;
} else {
filter="diameter"; /*NULL doesn't work here like in LDAP. Too little time/lazy to find out why ?*/
}
const gchar *cap_details = NULL;
#endif
const gchar *clear = NULL;
- const gchar *close = NULL;
+ const gchar *closex = NULL;
const gchar *copy = NULL;
const gchar *create_stat = NULL;
const gchar *delete = NULL;
} else if (strcmp(stock_id, GTK_STOCK_CANCEL) == 0) {
cancel = stock_id;
} else if (strcmp(stock_id, GTK_STOCK_CLOSE) == 0) {
- close = stock_id;
+ closex = stock_id;
} else if (strcmp(stock_id, GTK_STOCK_CLEAR) == 0) {
clear = stock_id;
} else if (strcmp(stock_id, GTK_STOCK_REFRESH) == 0) {
dlg_button_new(hbox, button_hbox, ok);
return hbox;
}
- if (save && close) {
- dlg_button_new(hbox, button_hbox, close);
+ if (save && closex) {
+ dlg_button_new(hbox, button_hbox, closex);
dlg_button_new(hbox, button_hbox, save);
return hbox;
}
}
}
if (buttons == 3) {
- if (ok && save && close) {
+ if (ok && save && closex) {
dlg_button_new(hbox, button_hbox, save);
- dlg_button_new(hbox, button_hbox, close);
+ dlg_button_new(hbox, button_hbox, closex);
dlg_button_new(hbox, button_hbox, ok);
return hbox;
}
dlg_button_new(hbox, button_hbox, ok);
return hbox;
}
- if (apply && save && close) {
+ if (apply && save && closex) {
dlg_button_new(hbox, button_hbox, save);
- dlg_button_new(hbox, button_hbox, close);
+ dlg_button_new(hbox, button_hbox, closex);
dlg_button_new(hbox, button_hbox, apply);
return hbox;
}
dlg_button_new(hbox, button_hbox, ok);
return hbox;
}
- if (ok && apply && save && close) {
+ if (ok && apply && save && closex) {
dlg_button_new(hbox, button_hbox, save);
dlg_button_new(hbox, button_hbox, apply);
- dlg_button_new(hbox, button_hbox, close);
+ dlg_button_new(hbox, button_hbox, closex);
dlg_button_new(hbox, button_hbox, ok);
return hbox;
}
if (follow_stream != NULL) dlg_button_new(hbox, button_hbox, follow_stream);
if (graph_a_b != NULL) dlg_button_new(hbox, button_hbox, graph_a_b);
if (graph_b_a != NULL) dlg_button_new(hbox, button_hbox, graph_b_a);
- if (close != NULL) dlg_button_new(hbox, button_hbox, close);
+ if (closex != NULL) dlg_button_new(hbox, button_hbox, closex);
if (cancel != NULL) dlg_button_new(hbox, button_hbox, cancel);
return hbox;
}
static void
-expert_comp_init(const char *optarg _U_, void* userdata _U_)
+expert_comp_init(const char *opt_arg _U_, void* userdata _U_)
{
expert_comp_dlg_t *ss;
const char *filter=NULL;
static void
-gtk_fcstat_init(const char *optarg, void *userdata _U_)
+gtk_fcstat_init(const char *opt_arg, void *userdata _U_)
{
fcstat_t *fc;
const char *filter=NULL;
GtkWidget *bbox;
GtkWidget *close_bt;
- if(!strncmp(optarg,"fc,srt,",7)){
- filter=optarg+7;
+ if(!strncmp(opt_arg,"fc,srt,",7)){
+ filter=opt_arg+7;
} else {
filter=NULL;
}
}
if ((what & FILTER_EXPRESSION_REINIT_CREATE) != 0) {
- gint maxindex = -1, index;
+ gint maxindx = -1, indx;
fe = *pfilter_expression_head;
while (fe != NULL) {
- maxindex = MAX(maxindex, fe->index);
+ maxindx = MAX(maxindx, fe->index);
fe = fe->next;
}
* The list should be in the order identified by the
* index member.
*/
- for (index = 0; index <= maxindex; index++) {
+ for (indx = 0; indx <= maxindx; indx++) {
if (prevhead != NULL) {
fe = prevhead;
- while (fe != NULL && fe->index != index)
+ while (fe != NULL && fe->index != indx)
fe = fe->next;
}
if (fe == NULL)
static void
gsm_a_stat_gtk_bssmap_init(
- const char *optarg _U_,
+ const char *opt_arg _U_,
void* userdata _U_)
{
gsm_a_stat_gtk_bssmap_cb(NULL, NULL);
}
static void
-gsm_a_stat_gtk_dtap_mm_init(const char *optarg _U_,
+gsm_a_stat_gtk_dtap_mm_init(const char *opt_arg _U_,
void* userdata _U_)
{
gsm_a_stat_gtk_dtap_mm_cb(NULL, NULL);
}
static void
-gsm_a_stat_gtk_dtap_rr_init(const char *optarg _U_,
+gsm_a_stat_gtk_dtap_rr_init(const char *opt_arg _U_,
void* userdata _U_)
{
gsm_a_stat_gtk_dtap_rr_cb(NULL, NULL);
}
static void
-gsm_a_stat_gtk_dtap_cc_init(const char *optarg _U_,
+gsm_a_stat_gtk_dtap_cc_init(const char *opt_arg _U_,
void* userdata _U_)
{
gsm_a_stat_gtk_dtap_cc_cb(NULL, NULL);
}
static void
-gsm_a_stat_gtk_dtap_gmm_init(const char *optarg _U_,
+gsm_a_stat_gtk_dtap_gmm_init(const char *opt_arg _U_,
void* userdata _U_)
{
gsm_a_stat_gtk_dtap_gmm_cb(NULL, NULL);
}
static void
-gsm_a_stat_gtk_dtap_sms_init(const char *optarg _U_,
+gsm_a_stat_gtk_dtap_sms_init(const char *opt_arg _U_,
void* userdata _U_)
{
gsm_a_stat_gtk_dtap_sms_cb(NULL, NULL);
}
static void
-gsm_a_stat_gtk_dtap_sm_init(const char *optarg _U_,
+gsm_a_stat_gtk_dtap_sm_init(const char *opt_arg _U_,
void* userdata _U_)
{
gsm_a_stat_gtk_dtap_sm_cb(NULL, NULL);
static void
gsm_a_stat_gtk_dtap_ss_init(
- const char *optarg _U_,
+ const char *opt_arg _U_,
void *userdata _U_)
{
gsm_a_stat_gtk_dtap_ss_cb(NULL, NULL);
static void
gsm_a_stat_gtk_dtap_tp_init(
- const char *optarg _U_,
+ const char *opt_arg _U_,
void *userdata _U_)
{
gsm_a_stat_gtk_dtap_tp_cb(NULL, NULL);
static void
gsm_a_stat_gtk_sacch_rr_init(
- const char *optarg _U_,
+ const char *opt_arg _U_,
void* userdata _U_)
{
gsm_a_stat_gtk_sacch_rr_cb(NULL, NULL);
static void
-gsm_map_stat_gtk_init(const char *optarg _U_,
+gsm_map_stat_gtk_init(const char *opt_arg _U_,
void* userdata _U_)
{
gsm_map_stat_gtk_cb(NULL, NULL);
static void
-gtk_gtpstat_init(const char *optarg, void *userdata _U_)
+gtk_gtpstat_init(const char *opt_arg, void *userdata _U_)
{
gtpstat_t *gtp;
const char *filter=NULL;
GtkWidget *bbox;
GtkWidget *close_bt;
- if(!strncmp(optarg,"gtp,",4)){
- filter=optarg+4;
+ if(!strncmp(opt_arg,"gtp,",4)){
+ filter=opt_arg+4;
} else {
filter="gtp"; /*NULL doesn't work here like in LDAP. Too little time/lazy to find out why ?*/
}
#include "ui/gtk/old-gtk-compat.h"
-static void gtk_h225counter_init(const char *optarg, void *userdata);
+static void gtk_h225counter_init(const char *opt_arg, void *userdata);
static tap_param h225_counter_params[] = {
{ PARAM_FILTER, "Filter", NULL }
};
static void
-gtk_h225counter_init(const char *optarg, void *userdata _U_)
+gtk_h225counter_init(const char *opt_arg, void *userdata _U_)
{
h225counter_t *hs;
GString *error_string;
hs=g_malloc(sizeof(h225counter_t));
- if(strncmp(optarg,"h225,counter,",13) == 0){
- hs->filter=g_strdup(optarg+13);
+ if(strncmp(opt_arg,"h225,counter,",13) == 0){
+ hs->filter=g_strdup(opt_arg+13);
} else {
hs->filter=NULL;
}
#include "ui/gtk/old-gtk-compat.h"
-static void gtk_h225rassrt_init(const char *optarg, void *userdata);
+static void gtk_h225rassrt_init(const char *opt_arg, void *userdata);
static tap_param h225_rassrt_params[] = {
{ PARAM_FILTER, "Filter", NULL }
};
static void
-gtk_h225rassrt_init(const char *optarg, void *userdata _U_)
+gtk_h225rassrt_init(const char *opt_arg, void *userdata _U_)
{
h225rassrt_t *hs;
GString *error_string;
hs=g_malloc(sizeof(h225rassrt_t));
- if(strncmp(optarg,"h225,srt,",9) == 0){
- hs->filter=g_strdup(optarg+9);
+ if(strncmp(opt_arg,"h225,srt,",9) == 0){
+ hs->filter=g_strdup(opt_arg+9);
} else {
hs->filter=NULL;
}
static void
-gtk_eth_hostlist_init(const char *optarg,
+gtk_eth_hostlist_init(const char *opt_arg,
void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"hosts,eth,",10)){
- filter=optarg+10;
+ if(!strncmp(opt_arg,"hosts,eth,",10)){
+ filter=opt_arg+10;
} else {
filter=NULL;
}
static void
-gtk_fc_hostlist_init(const char *optarg, void* userdata _U_)
+gtk_fc_hostlist_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"hosts,fc,",9)){
- filter=optarg+9;
+ if(!strncmp(opt_arg,"hosts,fc,",9)){
+ filter=opt_arg+9;
} else {
filter=NULL;
}
static void
-gtk_fddi_hostlist_init(const char *optarg, void* userdata _U_)
+gtk_fddi_hostlist_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"hosts,fddi,",11)){
- filter=optarg+11;
+ if(!strncmp(opt_arg,"hosts,fddi,",11)){
+ filter=opt_arg+11;
} else {
filter=NULL;
}
}
static void
-gtk_ip_hostlist_init(const char *optarg, void* userdata _U_)
+gtk_ip_hostlist_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"hosts,ip,",9)){
- filter=optarg+9;
+ if(!strncmp(opt_arg,"hosts,ip,",9)){
+ filter=opt_arg+9;
} else {
filter=NULL;
}
static void
-gtk_ipv6_hostlist_init(const char *optarg, void* userdata _U_)
+gtk_ipv6_hostlist_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"hosts,ipv6,",10)){
- filter = optarg + 10;
+ if(!strncmp(opt_arg,"hosts,ipv6,",10)){
+ filter = opt_arg + 10;
} else {
filter = NULL;
}
static void
-gtk_ipx_hostlist_init(const char *optarg, void* userdata _U_)
+gtk_ipx_hostlist_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"hosts,ipx,",10)){
- filter=optarg+10;
+ if(!strncmp(opt_arg,"hosts,ipx,",10)){
+ filter=opt_arg+10;
} else {
filter=NULL;
}
}
static void
-gtk_jxta_hostlist_init(const char *optarg, void* userdata _U_)
+gtk_jxta_hostlist_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"hosts,jxta,",11)){
- filter=optarg+11;
+ if(!strncmp(opt_arg,"hosts,jxta,",11)){
+ filter=opt_arg+11;
} else {
filter=NULL;
}
}
static void
-gtk_ncp_hostlist_init(const char *optarg, void* userdata _U_)
+gtk_ncp_hostlist_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"hosts,ncp,",10)){
- filter=optarg+10;
+ if(!strncmp(opt_arg,"hosts,ncp,",10)){
+ filter=opt_arg+10;
} else {
filter=NULL;
}
}
static void
-gtk_rsvp_hostlist_init(const char *optarg, void* userdata _U_)
+gtk_rsvp_hostlist_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"hosts,rsvp,",11)){
- filter=optarg+11;
+ if(!strncmp(opt_arg,"hosts,rsvp,",11)){
+ filter=opt_arg+11;
} else {
filter=NULL;
}
}
static void
-gtk_sctp_hostlist_init(const char *optarg, void* userdata _U_)
+gtk_sctp_hostlist_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"hosts,sctp,",11)){
- filter=optarg+11;
+ if(!strncmp(opt_arg,"hosts,sctp,",11)){
+ filter=opt_arg+11;
} else {
filter=NULL;
}
static void
-gtk_tcpip_hostlist_init(const char *optarg, void* userdata _U_)
+gtk_tcpip_hostlist_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"endpoints,tcp,",14)){
- filter=optarg+14;
+ if(!strncmp(opt_arg,"endpoints,tcp,",14)){
+ filter=opt_arg+14;
} else {
filter=NULL;
}
static void
-gtk_tr_hostlist_init(const char *optarg, void* userdata _U_)
+gtk_tr_hostlist_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"hosts,tr,",9)){
- filter=optarg+9;
+ if(!strncmp(opt_arg,"hosts,tr,",9)){
+ filter=opt_arg+9;
} else {
filter=NULL;
}
static void
-gtk_udpip_hostlist_init(const char *optarg, void* userdata _U_)
+gtk_udpip_hostlist_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"endpoints,udp,",14)){
- filter=optarg+14;
+ if(!strncmp(opt_arg,"endpoints,udp,",14)){
+ filter=opt_arg+14;
} else {
filter=NULL;
}
}
static void
-gtk_usb_hostlist_init(const char *optarg, void* userdata _U_)
+gtk_usb_hostlist_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if (!strncmp(optarg, "hosts,usb," ,10)) {
- filter = optarg + 10;
+ if (!strncmp(opt_arg, "hosts,usb," ,10)) {
+ filter = opt_arg + 10;
} else {
filter = NULL;
}
}
static void
-gtk_wlan_hostlist_init(const char *optarg, void* userdata _U_)
+gtk_wlan_hostlist_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
- if(!strncmp(optarg,"hosts,wlan,",11)){
- filter=optarg+11;
+ if(!strncmp(opt_arg,"hosts,wlan,",11)){
+ filter=opt_arg+11;
} else {
filter=NULL;
}
}
static void
-iostat_init(const char *optarg _U_, void* userdata _U_)
+iostat_init(const char *opt_arg _U_, void* userdata _U_)
{
io_stat_t *io;
int i=0, j=0;
static void
-gtk_ldapstat_init(const char *optarg, void *userdata _U_)
+gtk_ldapstat_init(const char *opt_arg, void *userdata _U_)
{
ldapstat_t *ldap;
const char *filter=NULL;
GtkWidget *bbox;
GtkWidget *close_bt;
- if(!strncmp(optarg,"ldap,srt,",9)){
- filter=optarg+9;
+ if(!strncmp(opt_arg,"ldap,srt,",9)){
+ filter=opt_arg+9;
} else {
filter=NULL;
}
}
static
-void add_channel_type(char *type, int oldtype, int index )
+void add_channel_type(char *type, int oldtype, int indx )
{
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(tb80211_chan_type_box), type);
if (oldtype != -1 && oldtype == ws80211_str_to_chan_type(type)) {
- gtk_combo_box_set_active(GTK_COMBO_BOX(tb80211_chan_type_box), index);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(tb80211_chan_type_box), indx);
tb80211_current_type = oldtype;
}
}
}
static gboolean
-dfilter_entry_match(GtkWidget *filter_cm, char *s, int *index)
+dfilter_entry_match(GtkWidget *filter_cm, char *s, int *indx)
{
GtkTreeModel *model = gtk_combo_box_get_model (GTK_COMBO_BOX(filter_cm));
GtkTreeIter iter;
i = -1;
if (!gtk_tree_model_get_iter_first (model, &iter)) {
- *index = i;
+ *indx = i;
return FALSE;
}
do {
if(filter_str) {
if(strcmp(s, filter_str) == 0) {
g_value_unset (&value);
- *index = i;
+ *indx = i;
return TRUE;
}
}
g_value_unset (&value);
} while (gtk_tree_model_iter_next (model, &iter));
- *index = -1;
+ *indx = -1;
return FALSE;
}
/* Note: a new filter string will not replace an old identical one */
static gboolean
dfilter_combo_add(GtkWidget *filter_cm, char *s) {
- int index;
+ int indx;
- if(!dfilter_entry_match(filter_cm,s, &index))
+ if(!dfilter_entry_match(filter_cm,s, &indx))
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(filter_cm), s);
g_free(s);
gboolean
dfilter_combo_add_recent(gchar *s) {
GtkWidget *filter_cm = g_object_get_data(G_OBJECT(top_level), E_DFILTER_CM_KEY);
- char *dup;
+ char *dupstr;
- dup = g_strdup(s);
+ dupstr = g_strdup(s);
- return dfilter_combo_add(filter_cm, dup);
+ return dfilter_combo_add(filter_cm, dupstr);
}
/* call cf_filter_packets() and add this filter string to the recent filter list */
our own filter list, and feed it to gtk_combo_set_popdown_strings when
a new filter is added. */
if (cf_status == CF_OK && strlen(s) > 0) {
- int index;
+ int indx;
- if(!dfilter_entry_match(filter_cm,s, &index) || index > -1) {
+ if(!dfilter_entry_match(filter_cm,s, &indx) || indx > -1) {
/* If the filter is already there but not the first entry, remove it */
- if (index > -1) {
- gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(filter_cm), index);
- index--;
+ if (indx > -1) {
+ gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(filter_cm), indx);
+ indx--;
}
/* Add the filter (at the head of the list) */
gtk_combo_box_text_prepend_text(GTK_COMBO_BOX_TEXT(filter_cm), s);
- index++;
+ indx++;
}
/* If we have too many entries, remove some */
- while ((guint)index >= prefs.gui_recent_df_entries_max) {
- gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(filter_cm), index);
- index--;
+ while ((guint)indx >= prefs.gui_recent_df_entries_max) {
+ gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(filter_cm), indx);
+ indx--;
}
}
if (free_filter)
#ifdef HAVE_LIBPCAP
void
-change_interface_name(gchar *oldname, guint index)
+change_interface_name(gchar *oldname, guint indx)
{
GtkWidget *view;
GtkTreeModel *model;
entry = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
- device = g_array_index(global_capture_opts.all_ifaces, interface_t, index);
+ device = g_array_index(global_capture_opts.all_ifaces, interface_t, indx);
if (gtk_tree_model_get_iter_first (model, &iter)) {
do {
gtk_tree_model_get(model, &iter, IFACE_NAME, &optname, -1);
#ifdef HAVE_PCAP_REMOTE
void
-add_interface_to_list(guint index)
+add_interface_to_list(guint indx)
{
GtkWidget *view, *icon;
GtkTreeModel *model;
gchar *lines;
interface_t device;
- device = g_array_index(global_capture_opts.all_ifaces, interface_t, index);
+ device = g_array_index(global_capture_opts.all_ifaces, interface_t, indx);
icon = pixbuf_to_widget(remote_sat_pb_data);
view = g_object_get_data(G_OBJECT(welcome_hb), TREE_VIEW_INTERFACES);
model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
GtkListStore *store;
struct filter_expression *fe;
gint first_row = TRUE;
- gint index = 0;
+ gint indx = 0;
column_l = (GtkTreeView *)g_object_get_data(G_OBJECT(w),
E_FILTER_EXPRESSION_COLUMNL);
while (items_left) {
gtk_tree_model_get(model, &iter, DATA_COLUMN, &fe, -1);
if (fe != NULL)
- fe->index = index++;
+ fe->index = indx++;
items_left = gtk_tree_model_iter_next (model, &iter);
}
/****************************************************************************/
static void
-set_sensitive_check_bt(gchar *key _U_ , rtp_channel_info_t *rci, guint *stop _U_ )
+set_sensitive_check_bt(gchar *key _U_ , rtp_channel_info_t *rci, guint *stop_p )
{
- gtk_widget_set_sensitive(rci->check_bt, !(*stop));
+ gtk_widget_set_sensitive(rci->check_bt, !(*stop_p));
}
/****************************************************************************/
static void
-bt_state(gboolean decode, gboolean play, gboolean pause, gboolean stop)
+bt_state(gboolean decode, gboolean play_state, gboolean pause_state, gboolean stop_state)
{
gboolean new_jitter_value = FALSE;
gboolean false_val = FALSE;
}
/* set the sensitive state of play only if there is a channel selected */
- if ( play && (rtp_channels->rci[0] || rtp_channels->rci[1]) && !new_jitter_value) {
+ if ( play_state && (rtp_channels->rci[0] || rtp_channels->rci[1]) && !new_jitter_value) {
gtk_widget_set_sensitive(bt_play, TRUE);
} else {
gtk_widget_set_sensitive(bt_play, FALSE);
}
if (!new_jitter_value) {
- gtk_widget_set_sensitive(bt_pause, pause);
- gtk_widget_set_sensitive(bt_stop, stop);
+ gtk_widget_set_sensitive(bt_pause, pause_state);
+ gtk_widget_set_sensitive(bt_stop, stop_state);
/* Set sensitive to the check buttons based on the STOP state */
if (rtp_channels_hash)
- g_hash_table_foreach( rtp_channels_hash, (GHFunc)set_sensitive_check_bt, &stop);
+ g_hash_table_foreach( rtp_channels_hash, (GHFunc)set_sensitive_check_bt, &stop_state);
} else {
gtk_widget_set_sensitive(bt_pause, FALSE);
gtk_widget_set_sensitive(bt_stop, FALSE);
GList *list=NULL, *tlist;
guint16 gap_start=0, gap_end=0, i, j, nr, dup_nr;
guint8 type;
- guint32 tsnumber, dup;
+ guint32 tsnumber, dupx;
gint xvalue, yvalue;
GdkColor red_color = {0, 65535, 0, 0};
GdkColor green_color = {0, 0, 65535, 0};
dup_list = &sack_header->a_rwnd + 2 + nr;
for (i = 0; i < dup_nr; i++)
{
- dup = g_ntohl(dup_list[i]);
- if (dup >= min_tsn)
+ dupx = g_ntohl(dup_list[i]);
+ if (dupx >= min_tsn)
{
if (u_data->io->uoff)
diff = sack->secs - u_data->io->min_x;
else
diff=sack->secs*1000000+sack->usecs-u_data->io->min_x;
xvalue = (guint32)(LEFT_BORDER+u_data->io->offset+u_data->io->x_interval*diff);
- yvalue = (guint32)(u_data->io->surface_height-BOTTOM_BORDER-POINT_SIZE -u_data->io->offset-((SUB_32(dup,min_tsn))*u_data->io->y_interval));
+ yvalue = (guint32)(u_data->io->surface_height-BOTTOM_BORDER-POINT_SIZE -u_data->io->offset-((SUB_32(dupx,min_tsn))*u_data->io->y_interval));
if (xvalue >= LEFT_BORDER+u_data->io->offset &&
xvalue <= u_data->io->surface_width-RIGHT_BORDER+u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset-POINT_SIZE &&
}
void
-init_srt_table_row(srt_stat_table *rst, int index, const char *procedure)
+init_srt_table_row(srt_stat_table *rst, int indx, const char *procedure)
{
/* we have discovered a new procedure. Extend the table accordingly */
- if(index>=rst->num_procs){
+ if(indx>=rst->num_procs){
int old_num_procs=rst->num_procs;
int i;
- rst->num_procs=index+1;
+ rst->num_procs=indx+1;
rst->procedures=g_realloc(rst->procedures, sizeof(srt_procedure_t)*(rst->num_procs));
for(i=old_num_procs;i<rst->num_procs;i++){
time_stat_init(&rst->procedures[i].stats);
rst->procedures[i].procedure=NULL;
}
}
- rst->procedures[index].index = index;
- rst->procedures[index].procedure=g_strdup(procedure);
+ rst->procedures[indx].index = indx;
+ rst->procedures[indx].procedure=g_strdup(procedure);
}
void
-add_srt_table_data(srt_stat_table *rst, int index, const nstime_t *req_time, packet_info *pinfo)
+add_srt_table_data(srt_stat_table *rst, int indx, const nstime_t *req_time, packet_info *pinfo)
{
srt_procedure_t *rp;
nstime_t t, delta;
- g_assert(index >= 0 && index < rst->num_procs);
- rp=&rst->procedures[index];
+ g_assert(indx >= 0 && indx < rst->num_procs);
+ rp=&rst->procedures[indx];
/*
* If the count of calls for this procedure is currently zero, it's
g->grab.grabbed = FALSE;
if (event->button == MOUSE_BUTTON_LEFT) {
- int x1 = zoomrect.x;
- int x2 = (int)event->x;
- int y1 = zoomrect.y;
- int y2 = (int)event->y;
- zoomrect.x = MIN(x1, x2);
- zoomrect.width = abs(x1 - x2);
- zoomrect.y = MIN(y1, y2);
- zoomrect.height = abs(y1 - y2);
+ int xx1 = zoomrect.x;
+ int xx2 = (int)event->x;
+ int yy1 = zoomrect.y;
+ int yy2 = (int)event->y;
+ zoomrect.x = MIN(xx1, xx2);
+ zoomrect.width = abs(xx1 - xx2);
+ zoomrect.y = MIN(yy1, yy2);
+ zoomrect.height = abs(yy1 - yy2);
/* Finish selecting a region to zoom in on.
Take care not to choose a too-small area (by accident?) */
*adjtime_rb, *undo_rb,
*bbox, *apply_bt, *close_bt, *help_bt;
-
+
if (time_shift_frame_w != NULL) {
/* There's already a "Time Shift" dialog box; reactivate it. */
reactivate_window(time_shift_frame_w);
return;
}
-
+
time_shift_frame_w = dlg_window_new("Wireshark: Time Shift");
-
+
/* Container for each row of widgets */
main_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 3, FALSE);
gtk_container_set_border_width(GTK_CONTAINER(main_vb), 5);
gtk_widget_set_tooltip_text(settime_time_text_box,
"The time for the frame in the format of [YYYY-MM-DD] "
"hh:mm:ss[.ddddddddd]");
-
+
/*
* Set two Packet Numbers to Time frame and extrapolate
*/
gtk_widget_show(undo_rb);
gtk_widget_set_tooltip_text(undo_rb,
"Undo all the Time Shift offsets on the frames.");
-
+
/*
* Button row
*/
modify_time_perform(fd, neg, &offset, SHIFT_KEEPOFFSET);
}
packet_list_queue_draw();
-
+
return(0);
}
long packetnumber;
GtkWidget *time_te;
const gchar *time_text;
- nstime_t settime, difftime, packettime;
+ nstime_t set_time, diff_time, packet_time;
frame_data *fd, *packetfd;
guint32 i;
*/
if ((packetfd = frame_data_sequence_find(cfile.frames, packetnumber)) == NULL)
return;
- nstime_delta(&packettime, &(packetfd->abs_ts), &(packetfd->shift_offset));
+ nstime_delta(&packet_time, &(packetfd->abs_ts), &(packetfd->shift_offset));
- if (timestring2nstime(time_text, &packettime, &settime) != 0)
+ if (timestring2nstime(time_text, &packet_time, &set_time) != 0)
return;
/* Calculate difference between packet time and requested time */
- nstime_delta(&difftime, &settime, &packettime);
+ nstime_delta(&diff_time, &set_time, &packet_time);
/* Up to here nothing is changed */
for (i = 1; i <= cfile.count; i++) {
if ((fd = frame_data_sequence_find(cfile.frames, i)) == NULL)
continue; /* Shouldn't happen */
- modify_time_perform(fd, SHIFT_POS, &difftime, SHIFT_SETTOZERO);
+ modify_time_perform(fd, SHIFT_POS, &diff_time, SHIFT_SETTOZERO);
}
packet_list_queue_draw();
/*
* If the line between (OT1, NT1) and (OT2, NT2) is a straight line
* and (OT3, NT3) is on that line,
- * then (NT2 - NT1) / (OT2 - OT2) = (NT3 - NT1) / (OT3 - OT1) and
+ * then (NT2 - NT1) / (OT2 - OT2) = (NT3 - NT1) / (OT3 - OT1) and
* then (OT3 - OT1) * (NT2 - NT1) / (OT2 - OT2) = (NT3 - NT1) and
* then NT1 + (OT3 - OT1) * (NT2 - NT1) / (OT2 - OT2) = NT3 and
- * then NT3 = NT1 + (OT3 - OT1) * (NT2 - NT1) / (OT2 - OT2) and
+ * then NT3 = NT1 + (OT3 - OT1) * (NT2 - NT1) / (OT2 - OT2) and
* thus NT3 = NT1 + (OT3 - OT1) * (NT2 - NT1) / (OT2 - OT1)
* or NT3 = NT1 + (OT3 - OT1) * ( deltaNT12 / deltaOT12)
*
if (timestring2nstime(time2_text, &ot2, &nt2) != 0)
return;
-
+
nstime_copy(&dot, &ot2);
nstime_subtract(&dot, &ot1);
memset(&packet_buf[prefix_length+curr_offset], 0, eth_trailer_length);
}
- HDR_TCP.seq_num = g_htonl(g_ntohl(HDR_TCP.seq_num) + curr_offset);
+ HDR_TCP.seq_num = g_ntohl(HDR_TCP.seq_num) + curr_offset;
+ HDR_TCP.seq_num = g_htonl(HDR_TCP.seq_num);
{
/* Write the packet */