aboutsummaryrefslogtreecommitdiffstats
path: root/tap-iostat.c
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2007-01-18 11:02:26 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2007-01-18 11:02:26 +0000
commit997e5415f9009bd99c96338356c4b5358f04db49 (patch)
tree9889b4a8a5a373f924e1b02ccfcba07755c5d9f2 /tap-iostat.c
parentbb978e75725b3a32918a50a9a9d584fddce1d59b (diff)
Add separate union entries to fvalue.value for signed and unsigned
32-bit numbers. Separate signed and unsigned accessors have been added and used where appropriate. Definitely not for 0.99.5. svn path=/trunk/; revision=20472
Diffstat (limited to 'tap-iostat.c')
-rw-r--r--tap-iostat.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/tap-iostat.c b/tap-iostat.c
index 1ed2019628..758455f006 100644
--- a/tap-iostat.c
+++ b/tap-iostat.c
@@ -120,7 +120,20 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void
gp=proto_get_finfo_ptr_array(edt->tree, it->hf_index);
if(gp){
for(i=0;i<gp->len;i++){
- it->counter+=fvalue_get_integer(&((field_info *)gp->pdata[i])->value);
+ switch(proto_registrar_get_ftype(it->hf_index)){
+ case FT_UINT8:
+ case FT_UINT16:
+ case FT_UINT24:
+ case FT_UINT32:
+ it->counter+=fvalue_get_uinteger(&((field_info *)gp->pdata[i])->value);
+ break;
+ case FT_INT8:
+ case FT_INT16:
+ case FT_INT24:
+ case FT_INT32:
+ it->counter+=fvalue_get_sinteger(&((field_info *)gp->pdata[i])->value);
+ break;
+ }
}
}
break;
@@ -138,7 +151,7 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void
case FT_UINT16:
case FT_UINT24:
case FT_UINT32:
- val=fvalue_get_integer(&((field_info *)gp->pdata[i])->value);
+ val=fvalue_get_uinteger(&((field_info *)gp->pdata[i])->value);
if((it->frames==1)&&(i==0)){
it->counter=val;
} else if(val<it->counter){
@@ -149,12 +162,12 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void
case FT_INT16:
case FT_INT24:
case FT_INT32:
- val=fvalue_get_integer(&((field_info *)gp->pdata[i])->value);
+ val=fvalue_get_sinteger(&((field_info *)gp->pdata[i])->value);
if((it->frames==1)&&(i==0)){
it->counter=val;
} else if((gint32)val<(gint32)(it->counter)){
it->counter=val;
- }
+ }
break;
case FT_RELATIVE_TIME:
new_time=fvalue_get(&((field_info *)gp->pdata[i])->value);
@@ -183,7 +196,7 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void
case FT_UINT16:
case FT_UINT24:
case FT_UINT32:
- val=fvalue_get_integer(&((field_info *)gp->pdata[i])->value);
+ val=fvalue_get_uinteger(&((field_info *)gp->pdata[i])->value);
if((it->frames==1)&&(i==0)){
it->counter=val;
} else if(val>it->counter){
@@ -194,7 +207,7 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void
case FT_INT16:
case FT_INT24:
case FT_INT32:
- val=fvalue_get_integer(&((field_info *)gp->pdata[i])->value);
+ val=fvalue_get_sinteger(&((field_info *)gp->pdata[i])->value);
if((it->frames==1)&&(i==0)){
it->counter=val;
} else if((gint32)val>(gint32)(it->counter)){
@@ -229,11 +242,14 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void
case FT_UINT16:
case FT_UINT24:
case FT_UINT32:
+ val=fvalue_get_uinteger(&((field_info *)gp->pdata[i])->value);
+ it->counter+=val;
+ break;
case FT_INT8:
case FT_INT16:
case FT_INT24:
case FT_INT32:
- val=fvalue_get_integer(&((field_info *)gp->pdata[i])->value);
+ val=fvalue_get_sinteger(&((field_info *)gp->pdata[i])->value);
it->counter+=val;
break;
case FT_RELATIVE_TIME: