forked from osmocom/wireshark
Replace g_snprintf() with snprintf() (dissectors)
Use macros from inttypes.h with format strings.
This commit is contained in:
parent
fe5248717f
commit
22ee2764a7
|
@ -116,7 +116,7 @@ ieee1609dot2_Time64_fmt(gchar *s, guint64 v)
|
|||
time_t secs = v / 1000000 + 1072915200 - 5;
|
||||
guint32 usecs = v % 1000000;
|
||||
struct tm *tm = gmtime(&secs);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%u-%02u-%02u %02u:%02u:%02u.%06u (%" G_GUINT64_FORMAT ")",
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%u-%02u-%02u %02u:%02u:%02u.%06u (%" PRIu64 ")",
|
||||
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, usecs, v
|
||||
);
|
||||
}
|
||||
|
|
|
@ -885,13 +885,13 @@ static void parseheader(void)
|
|||
FPRINTF(NULL,"Interface:%s\n",ifname);
|
||||
|
||||
/* opnum */
|
||||
g_snprintf(hf_status, BASE_BUFFER_SIZE, "hf_%s_opnum", ifname);
|
||||
g_snprintf(filter_name, BASE_BUFFER_SIZE, "%s.opnum", ifname);
|
||||
snprintf(hf_status, BASE_BUFFER_SIZE, "hf_%s_opnum", ifname);
|
||||
snprintf(filter_name, BASE_BUFFER_SIZE, "%s.opnum", ifname);
|
||||
register_hf_field(hf_status, "Operation", filter_name, "FT_UINT16", "BASE_DEC", "NULL", "0", "");
|
||||
|
||||
/* status */
|
||||
g_snprintf(hf_status, BASE_BUFFER_SIZE, "hf_%s_rc", ifname);
|
||||
g_snprintf(filter_name, BASE_BUFFER_SIZE, "%s.rc", ifname);
|
||||
snprintf(hf_status, BASE_BUFFER_SIZE, "hf_%s_rc", ifname);
|
||||
snprintf(filter_name, BASE_BUFFER_SIZE, "%s.rc", ifname);
|
||||
register_hf_field(hf_status, "Return code", filter_name, "FT_UINT32", "BASE_HEX", "VALS(NT_errors)", "0", "");
|
||||
|
||||
FPRINTF(eth_ett, "static gint ett_%s = -1;\n", ifname);
|
||||
|
@ -1090,7 +1090,7 @@ find_type(char *name)
|
|||
if(!tmptype){
|
||||
char dissectorname[DISSECTORNAME_MAXLEN];
|
||||
if(!g_strcmp0(name,"uint16")){
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1102,7 +1102,7 @@ find_type(char *name)
|
|||
FPRINTF(eth_code, "\n");
|
||||
tmptype=register_new_type("uint16", dissectorname, "FT_UINT16", "BASE_DEC", "0", "NULL", 2);
|
||||
} else if(!g_strcmp0(name,"int16")){
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1114,7 +1114,7 @@ find_type(char *name)
|
|||
FPRINTF(eth_code, "\n");
|
||||
tmptype=register_new_type("int16", dissectorname, "FT_INT16", "BASE_DEC", "0", "NULL", 2);
|
||||
} else if(!g_strcmp0(name,"uint32")){
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1127,7 +1127,7 @@ find_type(char *name)
|
|||
tmptype=register_new_type("uint32", dissectorname, "FT_UINT32", "BASE_DEC", "0", "NULL", 4);
|
||||
} else if( (!g_strcmp0(name,"int32"))
|
||||
|| (!g_strcmp0(name,"long")) ){
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1142,7 +1142,7 @@ find_type(char *name)
|
|||
else
|
||||
tmptype=register_new_type("long", dissectorname, "FT_INT32", "BASE_DEC", "0", "NULL", 4);
|
||||
} else if( (!g_strcmp0(name,"uint8")) ){
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1155,7 +1155,7 @@ find_type(char *name)
|
|||
tmptype=register_new_type("uint8", dissectorname, "FT_UINT8", "BASE_DEC", "0", "NULL", 1);
|
||||
} else if( (!g_strcmp0(name,"int8"))
|
||||
|| (!g_strcmp0(name, "char")) ){
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1170,7 +1170,7 @@ find_type(char *name)
|
|||
else
|
||||
tmptype=register_new_type("char", dissectorname, "FT_INT8", "BASE_DEC", "0", "NULL", 1);
|
||||
} else if(!g_strcmp0(name,"bool8")){
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1182,7 +1182,7 @@ find_type(char *name)
|
|||
FPRINTF(eth_code, "\n");
|
||||
tmptype=register_new_type("bool8", dissectorname, "FT_INT8", "BASE_DEC", "0", "NULL", 1);
|
||||
} else if(!g_strcmp0(name,"unistr")){
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1194,7 +1194,7 @@ find_type(char *name)
|
|||
FPRINTF(eth_code, "\n");
|
||||
tmptype=register_new_type("unistr", dissectorname, "FT_STRING", "BASE_NONE", "0", "NULL", 4);
|
||||
} else if(!g_strcmp0(name,"ascstr")){
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1207,7 +1207,7 @@ find_type(char *name)
|
|||
tmptype=register_new_type("ascstr", dissectorname, "FT_STRING", "BASE_NONE", "0", "NULL", 4);
|
||||
} else if(!g_strcmp0(name,"GUID")
|
||||
||!g_strcmp0(name,"uuid_t")){
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1219,7 +1219,7 @@ find_type(char *name)
|
|||
FPRINTF(eth_code, "\n");
|
||||
tmptype=register_new_type(name, dissectorname, "FT_GUID", "BASE_NONE", "0", "NULL", 4);
|
||||
} else if(!g_strcmp0(name,"policy_handle")){
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static e_ctx_hnd policy_hnd;\n");
|
||||
|
@ -1238,7 +1238,7 @@ find_type(char *name)
|
|||
tmptype=register_new_type("policy_handle", dissectorname, "FT_BYTES", "BASE_NONE", "0", "NULL", 4);
|
||||
} else if(!g_strcmp0(name,"NTTIME")){
|
||||
/* 8 bytes, aligned to 4 bytes */
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1253,7 +1253,7 @@ find_type(char *name)
|
|||
tmptype=register_new_type("NTTIME", dissectorname, "FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", "0", "NULL", 4);
|
||||
} else if(!g_strcmp0(name,"NTTIME_hyper")){
|
||||
/* 8 bytes, aligned to 8 bytes */
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1269,7 +1269,7 @@ find_type(char *name)
|
|||
tmptype=register_new_type("NTTIME_hyper", dissectorname, "FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", "0", "NULL", 4);
|
||||
} else if(!g_strcmp0(name,"NTTIME_1sec")){
|
||||
/* 8 bytes, aligned to 8 bytes */
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1285,7 +1285,7 @@ find_type(char *name)
|
|||
tmptype=register_new_type("NTTIME_1sec", dissectorname, "FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", "0", "NULL", 4);
|
||||
} else if(!g_strcmp0(name,"udlong")){
|
||||
/* 8 bytes, aligned to 4 bytes */
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1300,7 +1300,7 @@ find_type(char *name)
|
|||
tmptype=register_new_type("udlong", dissectorname, "FT_UINT64", "BASE_DEC", "0", "NULL", 4);
|
||||
} else if(!g_strcmp0(name,"dlong")){
|
||||
/* 8 bytes, aligned to 4 bytes */
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1315,7 +1315,7 @@ find_type(char *name)
|
|||
tmptype=register_new_type("dlong", dissectorname, "FT_INT64", "BASE_DEC", "0", "NULL", 4);
|
||||
} else if(!g_strcmp0(name,"uint64")){
|
||||
/* 8 bytes, aligned to 8 bytes */
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1330,7 +1330,7 @@ find_type(char *name)
|
|||
FPRINTF(eth_code, "\n");
|
||||
tmptype=register_new_type("uint64", dissectorname, "FT_UINT64", "BASE_DEC", "0", "NULL", 8);
|
||||
} else if(!g_strcmp0(name,"time_t")){
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1344,7 +1344,7 @@ find_type(char *name)
|
|||
FPRINTF(eth_code, "\n");
|
||||
tmptype=register_new_type("time_t", dissectorname, "FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", "0", "NULL", 4);
|
||||
} else if(!g_strcmp0(name,"SID")){
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1358,7 +1358,7 @@ find_type(char *name)
|
|||
FPRINTF(eth_code, "\n");
|
||||
tmptype=register_new_type("SID", dissectorname, "FT_STRING", "BASE_NONE", "0", "NULL", 4);
|
||||
} else if(!g_strcmp0(name,"WERROR")){
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name);
|
||||
FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name);
|
||||
FPRINTF(eth_code, "\n");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -1537,7 +1537,7 @@ static void parsetypedefstruct(int pass)
|
|||
}
|
||||
|
||||
struct_name=tmpti->next->str;
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, struct_name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, struct_name);
|
||||
|
||||
FPRINTF(NULL,"\nSTRUCT:%s pass:%d\n-------\n",struct_name,pass);
|
||||
|
||||
|
@ -1668,7 +1668,7 @@ static void parsetypedefstruct(int pass)
|
|||
FPRINTF(stderr, "ERROR: invalid integer: %s\n", ti->str);
|
||||
Exit(10);
|
||||
}
|
||||
g_snprintf(fss, BASE_BUFFER_SIZE, "%d", fixed_array_size);
|
||||
snprintf(fss, BASE_BUFFER_SIZE, "%d", fixed_array_size);
|
||||
|
||||
if(!g_strcmp0("]", ti->str)){
|
||||
/* this is just a normal [] array */
|
||||
|
@ -1693,17 +1693,17 @@ static void parsetypedefstruct(int pass)
|
|||
ti=ti->next;
|
||||
}
|
||||
|
||||
g_snprintf(hf_index, BASE_BUFFER_SIZE, "hf_%s_%s_%s", ifname, struct_name, field_name);
|
||||
snprintf(hf_index, BASE_BUFFER_SIZE, "hf_%s_%s_%s", ifname, struct_name, field_name);
|
||||
/* pass 0 generate subdissectors */
|
||||
if(pass==0){
|
||||
char filter_name[BASE_BUFFER_SIZE];
|
||||
const char *hf;
|
||||
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, struct_name, field_name);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, struct_name, field_name);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
|
||||
if(check_if_to_emit(tmpstr)){
|
||||
g_snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, struct_name, field_name);
|
||||
snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, struct_name, field_name);
|
||||
hf=register_hf_field(hf_index, field_name, filter_name, type_item->ft_type, type_item->base_type, type_item->vals, type_item->mask, "");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", ptmpstr);
|
||||
|
@ -1720,7 +1720,7 @@ static void parsetypedefstruct(int pass)
|
|||
if(is_array_of_pointers){
|
||||
pointer_type=pi->type;
|
||||
pi=pi->next;
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr);
|
||||
if(check_if_to_emit(tmpstr)){
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr);
|
||||
|
@ -1735,7 +1735,7 @@ static void parsetypedefstruct(int pass)
|
|||
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
} else if(fixed_array_size){
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "fixedarray_%s", ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "fixedarray_%s", ptmpstr);
|
||||
if(check_if_to_emit(tmpstr)){
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr);
|
||||
|
@ -1760,7 +1760,7 @@ static void parsetypedefstruct(int pass)
|
|||
case 0:
|
||||
break;
|
||||
case BI_SIZE_IS:
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr);
|
||||
if(check_if_to_emit(tmpstr)){
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr);
|
||||
|
@ -1775,7 +1775,7 @@ static void parsetypedefstruct(int pass)
|
|||
ptmpstr=g_strdup(tmpstr);
|
||||
break;
|
||||
case BI_LENGTH_IS:
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "uvarray_%s", ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "uvarray_%s", ptmpstr);
|
||||
if(check_if_to_emit(tmpstr)){
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr);
|
||||
|
@ -1790,7 +1790,7 @@ static void parsetypedefstruct(int pass)
|
|||
ptmpstr=g_strdup(tmpstr);
|
||||
break;
|
||||
case BI_SIZE_IS|BI_LENGTH_IS:
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr);
|
||||
if(check_if_to_emit(tmpstr)){
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr);
|
||||
|
@ -1814,7 +1814,7 @@ static void parsetypedefstruct(int pass)
|
|||
while(num_pointers--){
|
||||
pointer_type=pi->type;
|
||||
pi=pi->next;
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr);
|
||||
if(check_if_to_emit(tmpstr)){
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr);
|
||||
|
@ -1832,17 +1832,17 @@ static void parsetypedefstruct(int pass)
|
|||
}
|
||||
|
||||
if(pass==1){
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, struct_name, field_name);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, struct_name, field_name);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
|
||||
/* handle fixedsizearrays */
|
||||
if(is_array_of_pointers){
|
||||
pointer_type=pi->type;
|
||||
pi=pi->next;
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
} else if(fixed_array_size){
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "fixedarray_%s", ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "fixedarray_%s", ptmpstr);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
}
|
||||
|
||||
|
@ -1852,15 +1852,15 @@ static void parsetypedefstruct(int pass)
|
|||
case 0:
|
||||
break;
|
||||
case BI_SIZE_IS:
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
break;
|
||||
case BI_LENGTH_IS:
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "uvarray_%s", ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "uvarray_%s", ptmpstr);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
break;
|
||||
case BI_SIZE_IS|BI_LENGTH_IS:
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
break;
|
||||
default:
|
||||
|
@ -1873,7 +1873,7 @@ static void parsetypedefstruct(int pass)
|
|||
while(num_pointers--){
|
||||
pointer_type=pi->type;
|
||||
pi=pi->next;
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
}
|
||||
|
||||
|
@ -1999,7 +1999,7 @@ static void parsetypedefbitmap(int pass)
|
|||
Exit(10);
|
||||
}
|
||||
bitmap_name=tmpti->next->str;
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, bitmap_name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, bitmap_name);
|
||||
|
||||
FPRINTF(NULL,"\nBITMAP:%s pass:%d\n-------\n",bitmap_name,pass);
|
||||
|
||||
|
@ -2062,7 +2062,7 @@ static void parsetypedefbitmap(int pass)
|
|||
|
||||
name=ti->str;
|
||||
ti=ti->next;
|
||||
g_snprintf(hf_bitname, BASE_BUFFER_SIZE, "hf_%s_%s_%s", ifname, bitmap_name, name);
|
||||
snprintf(hf_bitname, BASE_BUFFER_SIZE, "hf_%s_%s_%s", ifname, bitmap_name, name);
|
||||
|
||||
if(g_strcmp0(ti->str, "=")){
|
||||
FPRINTF(stderr, "ERROR: typedefbitmap i expected a '=' here\n");
|
||||
|
@ -2088,9 +2088,9 @@ static void parsetypedefbitmap(int pass)
|
|||
if(pass==0){
|
||||
char filter_name[BASE_BUFFER_SIZE], base_name[BASE_BUFFER_SIZE], tfs_name[BASE_BUFFER_SIZE];
|
||||
|
||||
g_snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, bitmap_name, name);
|
||||
g_snprintf(base_name, BASE_BUFFER_SIZE, "%d", alignment*8);
|
||||
g_snprintf(tfs_name, BASE_BUFFER_SIZE, "TFS(&%s_tfs)", name);
|
||||
snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, bitmap_name, name);
|
||||
snprintf(base_name, BASE_BUFFER_SIZE, "%d", alignment*8);
|
||||
snprintf(tfs_name, BASE_BUFFER_SIZE, "TFS(&%s_tfs)", name);
|
||||
register_hf_field(hf_bitname, name, filter_name, "FT_BOOLEAN", base_name, tfs_name, value, "");
|
||||
|
||||
FPRINTF(eth_code, "static const true_false_string %s_tfs = {\n",name);
|
||||
|
@ -2247,7 +2247,7 @@ static void parsetypedefunion(int pass)
|
|||
Exit(10);
|
||||
}
|
||||
union_name=tmpti->next->str;
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_union_%s", ifname, union_name);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_union_%s", ifname, union_name);
|
||||
|
||||
FPRINTF(NULL,"\nUNION:%s pass:%d\n-------\n",union_name,pass);
|
||||
|
||||
|
@ -2401,16 +2401,16 @@ static void parsetypedefunion(int pass)
|
|||
alignment=item_alignment;
|
||||
}
|
||||
|
||||
g_snprintf(hf_index, BASE_BUFFER_SIZE, "hf_%s_%s_%s_%s", ifname, union_name, case2str(bi->case_name), ti->str);
|
||||
snprintf(hf_index, BASE_BUFFER_SIZE, "hf_%s_%s_%s_%s", ifname, union_name, case2str(bi->case_name), ti->str);
|
||||
/* pass 0 generate subdissectors */
|
||||
if(pass==0){
|
||||
char filter_name[BASE_BUFFER_SIZE];
|
||||
const char *hf;
|
||||
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_union_%s_%s_%s", ifname, union_name, case2str(bi->case_name), ti->str);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_union_%s_%s_%s", ifname, union_name, case2str(bi->case_name), ti->str);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
|
||||
g_snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, union_name, ti->str);
|
||||
snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, union_name, ti->str);
|
||||
hf=register_hf_field(hf_index, ti->str, filter_name, type_item->ft_type, type_item->base_type, type_item->vals, type_item->mask, "");
|
||||
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -2424,7 +2424,7 @@ static void parsetypedefunion(int pass)
|
|||
|
||||
/* handle pointers */
|
||||
while(num_pointers--){
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", ptmpstr, "unique");
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", ptmpstr, "unique");
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr);
|
||||
FPRINTF(eth_code, "{\n");
|
||||
|
@ -2440,10 +2440,10 @@ static void parsetypedefunion(int pass)
|
|||
|
||||
if(pass==1){
|
||||
/* handle pointers */
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_union_%s_%s_%s", ifname, union_name, case2str(bi->case_name), ti->str);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_union_%s_%s_%s", ifname, union_name, case2str(bi->case_name), ti->str);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
while(num_pointers--){
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", ptmpstr, "unique");
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", ptmpstr, "unique");
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
}
|
||||
|
||||
|
@ -2642,16 +2642,16 @@ static void parsefunction(int pass)
|
|||
*/
|
||||
pi=prepend_pointer_list(bi->pointer_list, num_pointers);
|
||||
|
||||
g_snprintf(hf_index, BASE_BUFFER_SIZE, "hf_%s_%s_%s", ifname, function_name, ti->str);
|
||||
snprintf(hf_index, BASE_BUFFER_SIZE, "hf_%s_%s_%s", ifname, function_name, ti->str);
|
||||
/* pass 0 generate subdissectors */
|
||||
if(pass==0){
|
||||
char filter_name[BASE_BUFFER_SIZE];
|
||||
const char *hf;
|
||||
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, function_name, ti->str);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, function_name, ti->str);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
|
||||
g_snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, function_name, ti->str);
|
||||
snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, function_name, ti->str);
|
||||
hf=register_hf_field(hf_index, ti->str, filter_name, type_item->ft_type, type_item->base_type, type_item->vals, type_item->mask, "");
|
||||
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
|
@ -2670,7 +2670,7 @@ static void parsefunction(int pass)
|
|||
case 0:
|
||||
break;
|
||||
case BI_SIZE_IS|BI_LENGTH_IS:
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr);
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr);
|
||||
FPRINTF(eth_code, "{\n");
|
||||
|
@ -2681,7 +2681,7 @@ static void parsefunction(int pass)
|
|||
ptmpstr=g_strdup(tmpstr);
|
||||
break;
|
||||
case BI_SIZE_IS:
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr);
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr);
|
||||
FPRINTF(eth_code, "{\n");
|
||||
|
@ -2701,7 +2701,7 @@ static void parsefunction(int pass)
|
|||
while(num_pointers--){
|
||||
pointer_type=pi->type;
|
||||
pi=pi->next;
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr);
|
||||
FPRINTF(eth_code, "static int\n");
|
||||
FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr);
|
||||
FPRINTF(eth_code, "{\n");
|
||||
|
@ -2716,7 +2716,7 @@ static void parsefunction(int pass)
|
|||
}
|
||||
|
||||
if((pass==1)||(pass==2)){
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, function_name, ti->str);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, function_name, ti->str);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
|
||||
if(bi){
|
||||
|
@ -2724,11 +2724,11 @@ static void parsefunction(int pass)
|
|||
case 0:
|
||||
break;
|
||||
case BI_SIZE_IS|BI_LENGTH_IS:
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
break;
|
||||
case BI_SIZE_IS:
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
break;
|
||||
default:
|
||||
|
@ -2741,7 +2741,7 @@ static void parsefunction(int pass)
|
|||
while(num_pointers--){
|
||||
pointer_type=pi->type;
|
||||
pi=pi->next;
|
||||
g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr);
|
||||
snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr);
|
||||
ptmpstr=g_strdup(tmpstr);
|
||||
}
|
||||
|
||||
|
@ -2928,8 +2928,8 @@ static void parsetypedefenum(void)
|
|||
Exit(10);
|
||||
}
|
||||
|
||||
g_snprintf(valsstring, BASE_BUFFER_SIZE, "%s_%s_vals", ifname, ti->str);
|
||||
g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, ti->str);
|
||||
snprintf(valsstring, BASE_BUFFER_SIZE, "%s_%s_vals", ifname, ti->str);
|
||||
snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, ti->str);
|
||||
|
||||
FPRINTF(NULL,"\nENUM:%s\n-------\n",ti->str);
|
||||
|
||||
|
@ -2972,7 +2972,7 @@ static void parsetypedefenum(void)
|
|||
FPRINTF(eth_code, "\n");
|
||||
|
||||
|
||||
g_snprintf(hfvalsstring, BASE_BUFFER_SIZE, "VALS(%s)", valsstring);
|
||||
snprintf(hfvalsstring, BASE_BUFFER_SIZE, "VALS(%s)", valsstring);
|
||||
switch(enumsize){
|
||||
case 16:
|
||||
register_new_type(ti->str, dissectorname, "FT_INT16", "BASE_DEC", "0", hfvalsstring, 2);
|
||||
|
@ -3248,14 +3248,14 @@ int main(int argc, char *argv[])
|
|||
eth_ft=g_fopen("ETH_FT", "w");
|
||||
eth_handoff=g_fopen("ETH_HANDOFF", "w");
|
||||
|
||||
g_snprintf(idlfile, BASE_BUFFER_SIZE, "%s.cnf", argv[1]);
|
||||
snprintf(idlfile, BASE_BUFFER_SIZE, "%s.cnf", argv[1]);
|
||||
fh=g_fopen(idlfile,"r");
|
||||
if(fh){
|
||||
readcnffile(fh);
|
||||
fclose(fh);
|
||||
}
|
||||
|
||||
g_snprintf(idlfile, BASE_BUFFER_SIZE, "%s.idl", argv[1]);
|
||||
snprintf(idlfile, BASE_BUFFER_SIZE, "%s.idl", argv[1]);
|
||||
fh=g_fopen(idlfile,"r");
|
||||
if(!fh){
|
||||
FPRINTF(stderr, "ERROR: could not open idl-file:%s\n", idlfile);
|
||||
|
@ -3278,7 +3278,7 @@ int main(int argc, char *argv[])
|
|||
search through the tokenlist and g_remove all such
|
||||
prefixes
|
||||
*/
|
||||
g_snprintf(prefix_str, BASE_BUFFER_SIZE, "%s_", ifname);
|
||||
snprintf(prefix_str, BASE_BUFFER_SIZE, "%s_", ifname);
|
||||
preparetrimprefix(prefix_str);
|
||||
trimprefix();
|
||||
|
||||
|
@ -3405,9 +3405,9 @@ int main(int argc, char *argv[])
|
|||
check_hf_rename_refcount();
|
||||
|
||||
/* merge code and template into dissector */
|
||||
g_snprintf(line, 4 * BASE_BUFFER_SIZE, "packet-dcerpc-%s.c", ifname);
|
||||
snprintf(line, 4 * BASE_BUFFER_SIZE, "packet-dcerpc-%s.c", ifname);
|
||||
fh=g_fopen(line, "w");
|
||||
g_snprintf(tmplfile, BASE_BUFFER_SIZE, "packet-dcerpc-%s-template.c", argv[1]);
|
||||
snprintf(tmplfile, BASE_BUFFER_SIZE, "packet-dcerpc-%s-template.c", argv[1]);
|
||||
tfh=g_fopen(tmplfile, "r");
|
||||
if(!tfh){
|
||||
FPRINTF(stderr, "ERROR: could not find %s\n", tmplfile);
|
||||
|
@ -3441,9 +3441,9 @@ int main(int argc, char *argv[])
|
|||
fclose(fh);
|
||||
fclose(tfh);
|
||||
|
||||
g_snprintf(line, 4 * BASE_BUFFER_SIZE, "packet-dcerpc-%s.h", ifname);
|
||||
snprintf(line, 4 * BASE_BUFFER_SIZE, "packet-dcerpc-%s.h", ifname);
|
||||
fh=g_fopen(line, "w");
|
||||
g_snprintf(tmplfile, BASE_BUFFER_SIZE, "packet-dcerpc-%s-template.h", argv[1]);
|
||||
snprintf(tmplfile, BASE_BUFFER_SIZE, "packet-dcerpc-%s-template.h", argv[1]);
|
||||
tfh=g_fopen(tmplfile, "r");
|
||||
if(!tfh){
|
||||
FPRINTF(stderr, "ERROR: could not find %s\n", tmplfile);
|
||||
|
|
|
@ -141,7 +141,7 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
|
|||
if (show_file_off) {
|
||||
proto_tree_add_int64_format_value(fh_tree, hf_frame_file_off, tvb,
|
||||
0, 0, pinfo->fd->file_off,
|
||||
"%" G_GINT64_MODIFIER "d (0x%" G_GINT64_MODIFIER "x)",
|
||||
"%" PRId64 " (0x%" PRIx64 ")",
|
||||
pinfo->fd->file_off, pinfo->fd->file_off);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -290,12 +290,12 @@ dissect_mp4_mvhd_body(tvbuff_t *tvb, gint offset, gint len _U_,
|
|||
if (mvhd_timescale == 0) {
|
||||
proto_tree_add_uint64_format(tree, hf_mp4_mvhd_duration,
|
||||
tvb, offset, time_len, duration,
|
||||
"Duration: no timescale (%" G_GUINT64_FORMAT ")",
|
||||
"Duration: no timescale (%" PRIu64 ")",
|
||||
duration);
|
||||
} else {
|
||||
proto_tree_add_uint64_format(tree, hf_mp4_mvhd_duration,
|
||||
tvb, offset, time_len, duration,
|
||||
"Duration: %f seconds (%" G_GUINT64_FORMAT ")",
|
||||
"Duration: %f seconds (%" PRIu64 ")",
|
||||
(double) duration / mvhd_timescale, duration);
|
||||
}
|
||||
offset += time_len;
|
||||
|
@ -785,7 +785,7 @@ dissect_mp4_elst_body(tvbuff_t *tvb, gint offset, gint len,
|
|||
segment_duration_str = timescaled_val_to_str(pinfo->pool, segment_duration);
|
||||
proto_tree_add_uint64_format(subtree, hf_mp4_elst_segment_duration,
|
||||
tvb, offset, field_length, segment_duration,
|
||||
"Segment duration: %s (%" G_GUINT64_FORMAT ")",
|
||||
"Segment duration: %s (%" PRIu64 ")",
|
||||
segment_duration_str, segment_duration);
|
||||
offset += field_length;
|
||||
|
||||
|
@ -797,7 +797,7 @@ dissect_mp4_elst_body(tvbuff_t *tvb, gint offset, gint len,
|
|||
media_time_str = timescaled_val_to_str(pinfo->pool, media_time);
|
||||
proto_tree_add_int64_format(subtree, hf_mp4_elst_media_time,
|
||||
tvb, offset, field_length, media_time,
|
||||
"Media time: %s (%" G_GINT64_FORMAT ")",
|
||||
"Media time: %s (%" PRId64 ")",
|
||||
media_time_str, media_time);
|
||||
offset += field_length;
|
||||
|
||||
|
|
|
@ -837,7 +837,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo,
|
|||
} else if (value_u64 == 1000000000) {
|
||||
const_str = "1 Gbps";
|
||||
} else {
|
||||
const_str = wmem_strdup_printf(pinfo->pool, "%"G_GUINT64_FORMAT, value_u64);
|
||||
const_str = wmem_strdup_printf(pinfo->pool, "%"PRIu64, value_u64);
|
||||
}
|
||||
proto_item_append_text(p_item, "%s", const_str);
|
||||
proto_item_append_text(option_item, " = %s", const_str);
|
||||
|
@ -1018,7 +1018,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo,
|
|||
|
||||
proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_interface_timestamp_offset, tvb, offset, 8, encoding, &value_u64);
|
||||
offset += 8;
|
||||
proto_item_append_text(option_item, " = %"G_GUINT64_FORMAT, value_u64);
|
||||
proto_item_append_text(option_item, " = %"PRIu64, value_u64);
|
||||
|
||||
if (interface_description) {
|
||||
interface_description->timestamp_offset = value_u64;
|
||||
|
@ -1151,7 +1151,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo,
|
|||
}
|
||||
|
||||
proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_interface_received, tvb, offset, 8, encoding, &value_u64);
|
||||
proto_item_append_text(option_item, " = %"G_GUINT64_FORMAT, value_u64);
|
||||
proto_item_append_text(option_item, " = %"PRIu64, value_u64);
|
||||
offset += 8;
|
||||
|
||||
break;
|
||||
|
@ -1163,7 +1163,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo,
|
|||
}
|
||||
|
||||
proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_interface_dropped, tvb, offset, 8, encoding, &value_u64);
|
||||
proto_item_append_text(option_item, " = %"G_GUINT64_FORMAT, value_u64);
|
||||
proto_item_append_text(option_item, " = %"PRIu64, value_u64);
|
||||
offset += 8;
|
||||
|
||||
break;
|
||||
|
@ -1175,7 +1175,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo,
|
|||
}
|
||||
|
||||
proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_interface_accepted_by_filter, tvb, offset, 8, encoding, &value_u64);
|
||||
proto_item_append_text(option_item, " = %"G_GUINT64_FORMAT, value_u64);
|
||||
proto_item_append_text(option_item, " = %"PRIu64, value_u64);
|
||||
offset += 8;
|
||||
|
||||
break;
|
||||
|
@ -1187,7 +1187,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo,
|
|||
}
|
||||
|
||||
proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_interface_dropped_by_os, tvb, offset, 8, encoding, &value_u64);
|
||||
proto_item_append_text(option_item, " = %"G_GUINT64_FORMAT, value_u64);
|
||||
proto_item_append_text(option_item, " = %"PRIu64, value_u64);
|
||||
offset += 8;
|
||||
|
||||
break;
|
||||
|
@ -1199,7 +1199,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo,
|
|||
}
|
||||
|
||||
proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_interface_delivered_to_user, tvb, offset, 8, encoding, &value_u64);
|
||||
proto_item_append_text(option_item, " = %"G_GUINT64_FORMAT, value_u64);
|
||||
proto_item_append_text(option_item, " = %"PRIu64, value_u64);
|
||||
offset += 8;
|
||||
|
||||
break;
|
||||
|
@ -1249,7 +1249,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo,
|
|||
}
|
||||
|
||||
proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_packet_drop_count, tvb, offset, 8, encoding, &value_u64);
|
||||
proto_item_append_text(option_item, " = %"G_GUINT64_FORMAT, value_u64);
|
||||
proto_item_append_text(option_item, " = %"PRIu64, value_u64);
|
||||
offset += 8;
|
||||
|
||||
break;
|
||||
|
@ -1261,7 +1261,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo,
|
|||
}
|
||||
|
||||
proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_packet_id, tvb, offset, 8, encoding, &value_u64);
|
||||
proto_item_append_text(option_item, " = 0x%016"G_GINT64_MODIFIER"x", value_u64);
|
||||
proto_item_append_text(option_item, " = 0x%016"PRIx64, value_u64);
|
||||
offset += 8;
|
||||
|
||||
break;
|
||||
|
|
|
@ -878,7 +878,7 @@ dispType( gchar *result, guint32 type)
|
|||
{
|
||||
int nValueH = (type>>16) & 0xFFFF;
|
||||
int nValueL = (type & 0xFFFF);
|
||||
g_snprintf( result, 18, "%d.%d (%.4X.%.4X)", nValueH, nValueL, nValueH, nValueL);
|
||||
snprintf( result, 18, "%d.%d (%.4X.%.4X)", nValueH, nValueL, nValueH, nValueL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -888,7 +888,7 @@ dispVersion( gchar *result, guint32 version)
|
|||
{
|
||||
int nValueH = (version>>16) & 0xFFFF;
|
||||
int nValueL = (version & 0xFFFF);
|
||||
g_snprintf( result, 11, "FW: %d.%d", nValueH, nValueL);
|
||||
snprintf( result, 11, "FW: %d.%d", nValueH, nValueL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -896,7 +896,7 @@ dispVersion( gchar *result, guint32 version)
|
|||
int nHWLow = (version>>16) & 0xFF;
|
||||
int nFWHigh = (version>>8) & 0xFF;
|
||||
int nFWLow = (version>>8) & 0xFF;
|
||||
g_snprintf( result, 25, "HW: %d.%d / FW: %d.%d", nHWHigh, nHWLow, nFWHigh, nFWLow);
|
||||
snprintf( result, 25, "HW: %d.%d / FW: %d.%d", nHWHigh, nHWLow, nFWHigh, nFWLow);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -904,7 +904,7 @@ static void dispMAC( gchar *result, guint64 mac)
|
|||
{
|
||||
guint8 *pData = (guint8*)(&mac);
|
||||
|
||||
g_snprintf( result, 18, "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", pData[5], pData[4], pData[3], pData[2],
|
||||
snprintf( result, 18, "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", pData[5], pData[4], pData[3], pData[2],
|
||||
pData[1], pData[0]);
|
||||
}
|
||||
|
||||
|
@ -912,22 +912,22 @@ static void dispIP( gchar *result, guint32 ip)
|
|||
{
|
||||
guint8 *pData = (guint8*)(&ip);
|
||||
|
||||
g_snprintf( result, 15, "%d.%d.%d.%d", pData[3], pData[2], pData[1], pData[0]);
|
||||
snprintf( result, 15, "%d.%d.%d.%d", pData[3], pData[2], pData[1], pData[0]);
|
||||
}
|
||||
|
||||
static void dispMask( gchar *result, guint32 mask)
|
||||
{
|
||||
guint8 *pData = (guint8*)(&mask);
|
||||
|
||||
g_snprintf( result, 15, "%d.%d.%d.%d", pData[3], pData[2], pData[1], pData[0]);
|
||||
snprintf( result, 15, "%d.%d.%d.%d", pData[3], pData[2], pData[1], pData[0]);
|
||||
}
|
||||
|
||||
static void dispTimeout( gchar *result, guint32 timeout)
|
||||
{
|
||||
if (timeout != 0)
|
||||
g_snprintf( result, 12, "%d secondes", timeout);
|
||||
snprintf( result, 12, "%d secondes", timeout);
|
||||
else
|
||||
g_snprintf( result, 8, "Disabled");
|
||||
snprintf( result, 8, "Disabled");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -2115,7 +2115,7 @@ static void dissect_9P_qid(tvbuff_t *tvb, proto_tree *tree, int offset)
|
|||
path = tvb_get_letoh64(tvb, offset+1+4);
|
||||
|
||||
qid_tree = proto_tree_add_subtree_format(tree, tvb, offset, 13, ett_9P_qid, NULL,
|
||||
"Qid type=0x%02x vers=%d path=%" G_GINT64_MODIFIER "u", type, vers, path);
|
||||
"Qid type=0x%02x vers=%d path=%" PRIu64, type, vers, path);
|
||||
|
||||
qidtype_item = proto_tree_add_item(qid_tree, hf_9P_qidtype, tvb, offset, 1, ENC_LITTLE_ENDIAN);
|
||||
qidtype_tree = proto_item_add_subtree(qidtype_item, ett_9P_qidtype);
|
||||
|
|
|
@ -99,7 +99,7 @@ tvb_atalkid_to_str(tvbuff_t *tvb, gint offset)
|
|||
|
||||
cur=(gchar *)wmem_alloc(wmem_packet_scope(), 16);
|
||||
node=tvb_get_guint8(tvb, offset+1)<<8|tvb_get_guint8(tvb, offset+2);
|
||||
g_snprintf(cur, 16, "%d.%d",node,tvb_get_guint8(tvb, offset+3));
|
||||
snprintf(cur, 16, "%d.%d",node,tvb_get_guint8(tvb, offset+3));
|
||||
return cur;
|
||||
}
|
||||
|
||||
|
|
|
@ -432,7 +432,7 @@ create_full_session_id_subtree(proto_tree *tree, tvbuff_t *tvb, int offset, guin
|
|||
session_int = tvb_get_ntoh40(tvb, offset + 4);
|
||||
|
||||
if (session_int != 0)
|
||||
session_ext = wmem_strdup_printf(wmem_packet_scope(), ":%" G_GINT64_MODIFIER "u", session_int);
|
||||
session_ext = wmem_strdup_printf(wmem_packet_scope(), ":%" PRIu64, session_int);
|
||||
str = wmem_strdup_printf(wmem_packet_scope(), "%x:%d%s", board_id, reset_counter, session_ext);
|
||||
}
|
||||
|
||||
|
|
|
@ -5531,7 +5531,7 @@ dissect_acn_dmx_data_pdu(guint32 protocol_id, tvbuff_t *tvb, packet_info *pinfo,
|
|||
proto_tree_add_string(pdu_tree, hf_acn_dmx_data, tvb, data_offset, dmx_count, buffer);
|
||||
|
||||
/* start our line */
|
||||
g_snprintf(buffer, BUFFER_SIZE, "001-%03d: ", perline);
|
||||
snprintf(buffer, BUFFER_SIZE, "001-%03d: ", perline);
|
||||
buf_ptr = buffer + 9;
|
||||
|
||||
total_cnt = 0;
|
||||
|
@ -5553,7 +5553,7 @@ dissect_acn_dmx_data_pdu(guint32 protocol_id, tvbuff_t *tvb, packet_info *pinfo,
|
|||
/* add leader... */
|
||||
proto_tree_add_string_format(pdu_tree, hf_acn_dmx_data, tvb, data_offset, item_cnt, buffer, "%s", buffer);
|
||||
data_offset += perline;
|
||||
g_snprintf(buffer, BUFFER_SIZE, "%03d-%03d: ",total_cnt, total_cnt+perline);
|
||||
snprintf(buffer, BUFFER_SIZE, "%03d-%03d: ",total_cnt, total_cnt+perline);
|
||||
buf_ptr = buffer + 9;
|
||||
item_cnt = 0;
|
||||
} else {
|
||||
|
|
|
@ -180,19 +180,19 @@ void proto_reg_handoff_acr122(void);
|
|||
|
||||
static void
|
||||
duration_base(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%03u s", value * 100 / 1000, value * 100 % 1000);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u.%03u s", value * 100 / 1000, value * 100 % 1000);
|
||||
}
|
||||
|
||||
static void
|
||||
timeout_base(gchar *buf, guint32 value) {
|
||||
if (value == 0x00)
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "No timeout check");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "No timeout check");
|
||||
else if (value == 0xFF)
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Wait until the contactless chip responds");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Wait until the contactless chip responds");
|
||||
else if (value < 12)
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u [s]", value * 5);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u [s]", value * 5);
|
||||
else
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u:%02u [mm:ss]", value * 5 / 60, value * 5 % 60);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u:%02u [mm:ss]", value * 5 / 60, value * 5 % 60);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -676,11 +676,11 @@ static char * aeron_format_transport_uri(const aeron_conversation_info_t * cinfo
|
|||
switch (cinfo->addr2->type)
|
||||
{
|
||||
case AT_IPv6:
|
||||
wmem_strbuf_append_printf(uri, "group=[%s]:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2);
|
||||
wmem_strbuf_append_printf(uri, "group=[%s]:%" PRIu16, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2);
|
||||
break;
|
||||
case AT_IPv4:
|
||||
default:
|
||||
wmem_strbuf_append_printf(uri, "group=%s:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2);
|
||||
wmem_strbuf_append_printf(uri, "group=%s:%" PRIu16, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -689,11 +689,11 @@ static char * aeron_format_transport_uri(const aeron_conversation_info_t * cinfo
|
|||
switch (cinfo->addr2->type)
|
||||
{
|
||||
case AT_IPv6:
|
||||
wmem_strbuf_append_printf(uri, "remote=[%s]:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2);
|
||||
wmem_strbuf_append_printf(uri, "remote=[%s]:%" PRIu16, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2);
|
||||
break;
|
||||
case AT_IPv4:
|
||||
default:
|
||||
wmem_strbuf_append_printf(uri, "remote=%s:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2);
|
||||
wmem_strbuf_append_printf(uri, "remote=%s:%" PRIu16, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1546,11 +1546,11 @@ static void aeron_sequence_report_frame(tvbuff_t * tvb, proto_tree * tree, aeron
|
|||
|
||||
if ((finfo->flags & AERON_FRAME_INFO_FLAGS_RETRANSMISSION) != 0)
|
||||
{
|
||||
item = proto_tree_add_uint_format_value(tree, hf_aeron_sequence_analysis_term_offset_frame, tvb, 0, 0, finfo->frame, "%" G_GUINT32_FORMAT " (RX)", finfo->frame);
|
||||
item = proto_tree_add_uint_format_value(tree, hf_aeron_sequence_analysis_term_offset_frame, tvb, 0, 0, finfo->frame, "%" PRIu32 " (RX)", finfo->frame);
|
||||
}
|
||||
else if ((finfo->flags & AERON_FRAME_INFO_FLAGS_KEEPALIVE) != 0)
|
||||
{
|
||||
item = proto_tree_add_uint_format_value(tree, hf_aeron_sequence_analysis_term_offset_frame, tvb, 0, 0, finfo->frame, "%" G_GUINT32_FORMAT " (KA)", finfo->frame);
|
||||
item = proto_tree_add_uint_format_value(tree, hf_aeron_sequence_analysis_term_offset_frame, tvb, 0, 0, finfo->frame, "%" PRIu32 " (KA)", finfo->frame);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1704,7 +1704,7 @@ static void aeron_sequence_report(tvbuff_t * tvb, packet_info * pinfo, proto_tre
|
|||
if (rx != NULL)
|
||||
{
|
||||
rx_item = proto_tree_add_uint_format_value(rx_tree, hf_aeron_sequence_analysis_nak_rx_frame, tvb, 0, 0, rx->frame_info->frame,
|
||||
"%" G_GUINT32_FORMAT ", Term offset=%" G_GUINT32_FORMAT " (0x%08x), Length=%" G_GUINT32_FORMAT, rx->frame_info->frame, rx->term_offset, rx->term_offset, rx->length);
|
||||
"%" PRIu32 ", Term offset=%" PRIu32 " (0x%08x), Length=%" PRIu32, rx->frame_info->frame, rx->term_offset, rx->term_offset, rx->length);
|
||||
proto_item_set_generated(rx_item);
|
||||
}
|
||||
lf = wmem_list_frame_next(lf);
|
||||
|
@ -1864,7 +1864,7 @@ static void aeron_info_stream_progress_report(packet_info * pinfo, guint16 msgty
|
|||
}
|
||||
else
|
||||
{
|
||||
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "%s (0x%08x:%" G_GUINT32_FORMAT ")",
|
||||
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "%s (0x%08x:%" PRIu32 ")",
|
||||
type_string, term_id, term_offset);
|
||||
}
|
||||
break;
|
||||
|
@ -1877,12 +1877,12 @@ static void aeron_info_stream_progress_report(packet_info * pinfo, guint16 msgty
|
|||
{
|
||||
if (finfo->stream_analysis->high.term_id == finfo->stream_analysis->completed.term_id)
|
||||
{
|
||||
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "%s (%" G_GUINT32_FORMAT "/%" G_GUINT32_FORMAT " [%" G_GUINT32_FORMAT "])",
|
||||
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "%s (%" PRIu32 "/%" PRIu32 " [%" PRIu32 "])",
|
||||
type_string, finfo->stream_analysis->high.term_offset, finfo->stream_analysis->completed.term_offset, finfo->stream_analysis->outstanding_bytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "%s (0x%08x:%" G_GUINT32_FORMAT "/0x%08x:%" G_GUINT32_FORMAT " [%" G_GUINT32_FORMAT "])",
|
||||
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "%s (0x%08x:%" PRIu32 "/0x%08x:%" PRIu32 " [%" PRIu32 "])",
|
||||
type_string, finfo->stream_analysis->high.term_id, finfo->stream_analysis->high.term_offset, finfo->stream_analysis->completed.term_id, finfo->stream_analysis->completed.term_offset, finfo->stream_analysis->outstanding_bytes);
|
||||
}
|
||||
}
|
||||
|
@ -2255,7 +2255,7 @@ static int dissect_aeron_pad(tvbuff_t * tvb, int offset, packet_info * pinfo, pr
|
|||
return 0;
|
||||
|
||||
aeron_info_stream_progress_report(pinfo, HDR_TYPE_PAD, pktinfo.flags, term_id, term_offset, finfo);
|
||||
pad_item = proto_tree_add_none_format(tree, hf_aeron_pad, tvb, offset, -1, "Pad Frame: Term 0x%x, Ofs %" G_GUINT32_FORMAT ", Len %" G_GUINT32_FORMAT "(%d)",
|
||||
pad_item = proto_tree_add_none_format(tree, hf_aeron_pad, tvb, offset, -1, "Pad Frame: Term 0x%x, Ofs %" PRIu32 ", Len %" PRIu32 "(%d)",
|
||||
term_id, term_offset, frame_length, rounded_length);
|
||||
subtree = proto_item_add_subtree(pad_item, ett_aeron_pad);
|
||||
channel_item = proto_tree_add_uint64(subtree, hf_aeron_channel_id, tvb, 0, 0, transport->channel_id);
|
||||
|
@ -2303,7 +2303,7 @@ static void dissect_aeron_reassembled_data(packet_info * pinfo, proto_tree * tre
|
|||
msg->reassembled_data,
|
||||
0,
|
||||
tvb_reported_length_remaining(msg->reassembled_data, 0),
|
||||
"%" G_GUINT32_FORMAT " Reassembled Fragments (%" G_GUINT32_FORMAT " bytes):",
|
||||
"%" PRIu32 " Reassembled Fragments (%" PRIu32 " bytes):",
|
||||
msg->fragment_count,
|
||||
msg->length);
|
||||
frag_tree = proto_item_add_subtree(frag_item, ett_aeron_data_reassembly);
|
||||
|
@ -2320,7 +2320,7 @@ static void dissect_aeron_reassembled_data(packet_info * pinfo, proto_tree * tre
|
|||
msg_ofs,
|
||||
frag->data_length,
|
||||
frag->frame,
|
||||
"Frame: %" G_GUINT32_FORMAT ", payload: %" G_GUINT32_FORMAT "-%" G_GUINT32_FORMAT " (%" G_GUINT32_FORMAT " bytes)",
|
||||
"Frame: %" PRIu32 ", payload: %" PRIu32 "-%" PRIu32 " (%" PRIu32 " bytes)",
|
||||
frag->frame,
|
||||
msg_ofs,
|
||||
(msg_ofs + frag->data_length) - 1,
|
||||
|
@ -2328,11 +2328,11 @@ static void dissect_aeron_reassembled_data(packet_info * pinfo, proto_tree * tre
|
|||
proto_item_set_generated(pi);
|
||||
if (first_item)
|
||||
{
|
||||
proto_item_append_text(frag_item, " #%" G_GUINT32_FORMAT "(%" G_GUINT32_FORMAT ")", frag->frame, frag->data_length);
|
||||
proto_item_append_text(frag_item, " #%" PRIu32 "(%" PRIu32 ")", frag->frame, frag->data_length);
|
||||
}
|
||||
else
|
||||
{
|
||||
proto_item_append_text(frag_item, ", #%" G_GUINT32_FORMAT "(%" G_GUINT32_FORMAT ")", frag->frame, frag->data_length);
|
||||
proto_item_append_text(frag_item, ", #%" PRIu32 "(%" PRIu32 ")", frag->frame, frag->data_length);
|
||||
}
|
||||
msg_ofs += frag->data_length;
|
||||
first_item = FALSE;
|
||||
|
@ -2399,7 +2399,7 @@ static int dissect_aeron_data(tvbuff_t * tvb, int offset, packet_info * pinfo, p
|
|||
return 0;
|
||||
|
||||
aeron_info_stream_progress_report(pinfo, HDR_TYPE_DATA, pktinfo.flags, term_id, term_offset, finfo);
|
||||
data_item = proto_tree_add_none_format(tree, hf_aeron_data, tvb, offset, -1, "Data Frame: Term 0x%x, Ofs %" G_GUINT32_FORMAT ", Len %" G_GUINT32_FORMAT "(%d)",
|
||||
data_item = proto_tree_add_none_format(tree, hf_aeron_data, tvb, offset, -1, "Data Frame: Term 0x%x, Ofs %" PRIu32 ", Len %" PRIu32 "(%d)",
|
||||
(guint32) term_id, term_offset, frame_length, rounded_length);
|
||||
subtree = proto_item_add_subtree(data_item, ett_aeron_data);
|
||||
channel_item = proto_tree_add_uint64(subtree, hf_aeron_channel_id, tvb, 0, 0, transport->channel_id);
|
||||
|
@ -2505,7 +2505,7 @@ static int dissect_aeron_nak(tvbuff_t * tvb, int offset, packet_info * pinfo, pr
|
|||
return 0;
|
||||
|
||||
col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "NAK");
|
||||
nak_item = proto_tree_add_none_format(tree, hf_aeron_nak, tvb, offset, -1, "NAK Frame: Term 0x%x, Ofs %" G_GUINT32_FORMAT ", Len %" G_GUINT32_FORMAT,
|
||||
nak_item = proto_tree_add_none_format(tree, hf_aeron_nak, tvb, offset, -1, "NAK Frame: Term 0x%x, Ofs %" PRIu32 ", Len %" PRIu32,
|
||||
term_id, nak_term_offset, nak_length);
|
||||
subtree = proto_item_add_subtree(nak_item, ett_aeron_nak);
|
||||
channel_item = proto_tree_add_uint64(subtree, hf_aeron_channel_id, tvb, 0, 0, transport->channel_id);
|
||||
|
@ -2519,7 +2519,7 @@ static int dissect_aeron_nak(tvbuff_t * tvb, int offset, packet_info * pinfo, pr
|
|||
proto_tree_add_item(subtree, hf_aeron_nak_term_id, tvb, offset + O_AERON_NAK_TERM_ID, 4, ENC_LITTLE_ENDIAN);
|
||||
nak_offset_item = proto_tree_add_item(subtree, hf_aeron_nak_term_offset, tvb, offset + O_AERON_NAK_TERM_OFFSET, 4, ENC_LITTLE_ENDIAN);
|
||||
proto_tree_add_item(subtree, hf_aeron_nak_length, tvb, offset + O_AERON_NAK_LENGTH, 4, ENC_LITTLE_ENDIAN);
|
||||
expert_add_info_format(pinfo, nak_offset_item, &ei_aeron_analysis_nak, "NAK offset %" G_GUINT32_FORMAT " length %" G_GUINT32_FORMAT, nak_term_offset, nak_length);
|
||||
expert_add_info_format(pinfo, nak_offset_item, &ei_aeron_analysis_nak, "NAK offset %" PRIu32 " length %" PRIu32, nak_term_offset, nak_length);
|
||||
aeron_sequence_report(tvb, pinfo, subtree, transport, &pktinfo, finfo);
|
||||
proto_item_set_len(nak_item, rounded_length);
|
||||
if (frame_length != L_AERON_NAK)
|
||||
|
@ -2606,7 +2606,7 @@ static int dissect_aeron_sm(tvbuff_t * tvb, int offset, packet_info * pinfo, pro
|
|||
return 0;
|
||||
|
||||
aeron_info_stream_progress_report(pinfo, HDR_TYPE_SM, pktinfo.flags, term_id, consumption_offset, finfo);
|
||||
sm_item = proto_tree_add_none_format(tree, hf_aeron_sm, tvb, offset, -1, "Status Message: Term 0x%x, ConsumptionOfs %" G_GUINT32_FORMAT ", RcvWindow %" G_GUINT32_FORMAT ", RcvID %" G_GUINT64_FORMAT,
|
||||
sm_item = proto_tree_add_none_format(tree, hf_aeron_sm, tvb, offset, -1, "Status Message: Term 0x%x, ConsumptionOfs %" PRIu32 ", RcvWindow %" PRIu32 ", RcvID %" PRIu64,
|
||||
term_id, consumption_offset, rcv_window, rcv_id);
|
||||
subtree = proto_item_add_subtree(sm_item, ett_aeron_sm);
|
||||
item = proto_tree_add_uint64(subtree, hf_aeron_channel_id, tvb, 0, 0, transport->channel_id);
|
||||
|
@ -2725,7 +2725,7 @@ static int dissect_aeron_heartbeat(tvbuff_t * tvb, int offset, packet_info * pin
|
|||
return 0;
|
||||
|
||||
aeron_info_stream_progress_report(pinfo, HDR_TYPE_DATA, pktinfo.flags, term_id, term_offset, finfo);
|
||||
data_item = proto_tree_add_none_format(tree, hf_aeron_heartbeat, tvb, offset, -1, "Heartbeat Frame: Term 0x%x, Ofs %" G_GUINT32_FORMAT ", Len %" G_GUINT32_FORMAT "(%d)",
|
||||
data_item = proto_tree_add_none_format(tree, hf_aeron_heartbeat, tvb, offset, -1, "Heartbeat Frame: Term 0x%x, Ofs %" PRIu32 ", Len %" PRIu32 "(%d)",
|
||||
(guint32) term_id, term_offset, frame_length, rounded_length);
|
||||
subtree = proto_item_add_subtree(data_item, ett_aeron_data);
|
||||
channel_item = proto_tree_add_uint64(subtree, hf_aeron_channel_id, tvb, 0, 0, transport->channel_id);
|
||||
|
@ -2780,7 +2780,7 @@ static int dissect_aeron_rtt(tvbuff_t * tvb, int offset, packet_info * pinfo, pr
|
|||
stream_id = tvb_get_letohl(tvb, offset + O_AERON_RTT_STREAM_ID);
|
||||
rcv_id = tvb_get_letoh64(tvb, offset + O_AERON_RTT_RECEIVER_ID);
|
||||
|
||||
rtt_item = proto_tree_add_none_format(tree, hf_aeron_rtt, tvb, offset, -1, "RTT Message: Stream ID %" G_GUINT32_FORMAT ", RcvID %" G_GUINT64_FORMAT,
|
||||
rtt_item = proto_tree_add_none_format(tree, hf_aeron_rtt, tvb, offset, -1, "RTT Message: Stream ID %" PRIu32 ", RcvID %" PRIu64,
|
||||
stream_id, rcv_id);
|
||||
subtree = proto_item_add_subtree(rtt_item, ett_aeron_rtt);
|
||||
item = proto_tree_add_uint64(subtree, hf_aeron_channel_id, tvb, 0, 0, transport->channel_id);
|
||||
|
@ -2870,7 +2870,7 @@ static int dissect_aeron_setup(tvbuff_t * tvb, int offset, packet_info * pinfo,
|
|||
|
||||
col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "Setup");
|
||||
setup_item = proto_tree_add_none_format(tree, hf_aeron_setup, tvb, offset, -1,
|
||||
"Setup Frame: InitTerm 0x%x, ActiveTerm 0x%x, TermLen %" G_GUINT32_FORMAT ", Ofs %" G_GUINT32_FORMAT ", MTU %" G_GUINT32_FORMAT ", TTL %" G_GUINT32_FORMAT,
|
||||
"Setup Frame: InitTerm 0x%x, ActiveTerm 0x%x, TermLen %" PRIu32 ", Ofs %" PRIu32 ", MTU %" PRIu32 ", TTL %" PRIu32,
|
||||
initial_term_id, (guint32) active_term_id, term_length, term_offset, mtu, ttl);
|
||||
subtree = proto_item_add_subtree(setup_item, ett_aeron_setup);
|
||||
channel_item = proto_tree_add_uint64(subtree, hf_aeron_channel_id, tvb, 0, 0, transport->channel_id);
|
||||
|
|
|
@ -4457,26 +4457,26 @@ dissect_spotlight(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
|
|||
toc_offset = (tvb_get_guint64(tvb, offset, encoding) >> 32) * 8;
|
||||
if (toc_offset < 8) {
|
||||
ti = proto_tree_add_uint64(tree, hf_afp_toc_offset, tvb, offset, 8, toc_offset);
|
||||
expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" G_GINT64_MODIFIER "u < 8 (bogus)", toc_offset);
|
||||
expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" PRIu64 " < 8 (bogus)", toc_offset);
|
||||
return tvb_captured_length(tvb);
|
||||
}
|
||||
toc_offset -= 8;
|
||||
if (offset + toc_offset + 8 > G_MAXINT) {
|
||||
ti = proto_tree_add_uint64(tree, hf_afp_toc_offset, tvb, offset, 8, toc_offset);
|
||||
expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" G_GINT64_MODIFIER "u > %u (bogus)", toc_offset, G_MAXINT - 8 - offset);
|
||||
expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" PRIu64 " > %u (bogus)", toc_offset, G_MAXINT - 8 - offset);
|
||||
return tvb_captured_length(tvb);
|
||||
}
|
||||
querylen = (tvb_get_guint64(tvb, offset, encoding) & 0xffffffff) * 8;
|
||||
if (querylen < 8) {
|
||||
ti = proto_tree_add_uint64(tree, hf_afp_toc_offset, tvb, offset, 8, toc_offset);
|
||||
expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" G_GINT64_MODIFIER "u Bytes, Query length: %" G_GINT64_MODIFIER "u < 8 (bogus)",
|
||||
expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" PRIu64 " Bytes, Query length: %" PRIu64 " < 8 (bogus)",
|
||||
toc_offset, querylen);
|
||||
return tvb_captured_length(tvb);
|
||||
}
|
||||
querylen -= 8;
|
||||
if (querylen > G_MAXINT) {
|
||||
ti = proto_tree_add_uint64(tree, hf_afp_toc_offset, tvb, offset, 8, toc_offset);
|
||||
expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" G_GINT64_MODIFIER "u Bytes, Query length: %" G_GINT64_MODIFIER "u > %u (bogus)",
|
||||
expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" PRIu64 " Bytes, Query length: %" PRIu64 " > %u (bogus)",
|
||||
toc_offset, querylen, G_MAXINT);
|
||||
return tvb_captured_length(tvb);
|
||||
}
|
||||
|
@ -4518,20 +4518,20 @@ dissect_spotlight(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
|
|||
case SQ_CPX_TYPE_ARRAY:
|
||||
case SQ_CPX_TYPE_DICT:
|
||||
proto_tree_add_uint64_format(sub_tree_toc, hf_afp_toc_entry, tvb, offset, 8, toc_entry,
|
||||
"%u: count: %" G_GINT64_MODIFIER "u, type: %s, offset: %" G_GINT64_MODIFIER "u",
|
||||
"%u: count: %" PRIu64 ", type: %s, offset: %" PRIu64,
|
||||
i+1, toc_entry >> 32, val64_to_str_const((toc_entry & 0xffff0000) >> 16, cpx_qtype_string_values, "Unknown"),
|
||||
(toc_entry & 0xffff) * 8);
|
||||
break;
|
||||
case SQ_CPX_TYPE_STRING:
|
||||
case SQ_CPX_TYPE_UTF16_STRING:
|
||||
proto_tree_add_uint64_format(sub_tree_toc, hf_afp_toc_entry, tvb, offset, 8, toc_entry,
|
||||
"%u: pad byte count: %" G_GINT64_MODIFIER "x, type: %s, offset: %" G_GINT64_MODIFIER "u",
|
||||
"%u: pad byte count: %" PRIx64 ", type: %s, offset: %" PRIu64,
|
||||
i+1, 8 - (toc_entry >> 32), val64_to_str_const((toc_entry & 0xffff0000) >> 16, cpx_qtype_string_values, "Unknown"),
|
||||
(toc_entry & 0xffff) * 8);
|
||||
break;
|
||||
default:
|
||||
proto_tree_add_uint64_format(sub_tree_toc, hf_afp_toc_entry, tvb, offset, 8, toc_entry,
|
||||
"%u: unknown: 0x%08" G_GINT64_MODIFIER "x, type: %s, offset: %" G_GINT64_MODIFIER "u",
|
||||
"%u: unknown: 0x%08" PRIx64 ", type: %s, offset: %" PRIu64,
|
||||
i+1, toc_entry >> 32, val64_to_str_const((toc_entry & 0xffff0000) >> 16, cpx_qtype_string_values, "Unknown"),
|
||||
(toc_entry & 0xffff) * 8);
|
||||
}
|
||||
|
|
|
@ -313,11 +313,11 @@ convert_oid_to_str(guint32 *oid, int len, char* str, int slen, char prefix)
|
|||
if(slen < len) return 0;
|
||||
|
||||
if(prefix) {
|
||||
tlen += g_snprintf(str, slen, ".1.3.6.1.%d", prefix);
|
||||
tlen += snprintf(str, slen, ".1.3.6.1.%d", prefix);
|
||||
}
|
||||
|
||||
for(i=0; i < len && tlen < slen; i++) {
|
||||
tlen += g_snprintf(str+tlen, slen-tlen, ".%d", oid[i]);
|
||||
tlen += snprintf(str+tlen, slen-tlen, ".%d", oid[i]);
|
||||
}
|
||||
return tlen;
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ dissect_object_id(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 flags, enu
|
|||
}
|
||||
|
||||
if(!convert_oid_to_str(&oid[0], n_subid, &str_oid[0], 2048, prefix))
|
||||
g_snprintf(&str_oid[0], 2048, "(null)");
|
||||
snprintf(&str_oid[0], 2048, "(null)");
|
||||
|
||||
if(tree) {
|
||||
const char *range = "";
|
||||
|
|
|
@ -2418,7 +2418,7 @@ aim_generic_family( gchar *result, guint32 famnum )
|
|||
{
|
||||
const aim_family *family = aim_get_family(famnum);
|
||||
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%s (0x%x)", family?family->name:"Unknown", famnum);
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%s (0x%x)", family?family->name:"Unknown", famnum);
|
||||
}
|
||||
|
||||
static const aim_subtype aim_fnac_family_generic[] = {
|
||||
|
|
|
@ -1289,7 +1289,7 @@ parse_arg(tvbuff_t *tvb,
|
|||
static void
|
||||
alljoyn_typeid( gchar *result, guint32 type )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "'%c' => ", type);
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "'%c' => ", type);
|
||||
}
|
||||
|
||||
/* This is called by handle_message_header_fields() to handle a single
|
||||
|
|
|
@ -2414,7 +2414,7 @@ dissect_amqp_0_9_field_value(tvbuff_t *tvb, packet_info *pinfo, int offset, guin
|
|||
amqp_typename = "integer";
|
||||
if (length < 4)
|
||||
return 0; /* too short */
|
||||
value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT32_MODIFIER "i",
|
||||
value = wmem_strdup_printf(wmem_packet_scope(), "%" PRIi32,
|
||||
tvb_get_ntohil(tvb, offset));
|
||||
offset += 4;
|
||||
break;
|
||||
|
@ -2496,7 +2496,7 @@ dissect_amqp_0_9_field_value(tvbuff_t *tvb, packet_info *pinfo, int offset, guin
|
|||
amqp_typename = "short int";
|
||||
if (length < 2)
|
||||
return 0; /* too short */
|
||||
value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT16_MODIFIER "i",
|
||||
value = wmem_strdup_printf(wmem_packet_scope(), "%" PRIi16,
|
||||
tvb_get_ntohis(tvb, offset));
|
||||
offset += 2;
|
||||
break;
|
||||
|
@ -2504,7 +2504,7 @@ dissect_amqp_0_9_field_value(tvbuff_t *tvb, packet_info *pinfo, int offset, guin
|
|||
amqp_typename = "short uint";
|
||||
if (length < 2)
|
||||
return 0; /* too short */
|
||||
value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT16_MODIFIER "u",
|
||||
value = wmem_strdup_printf(wmem_packet_scope(), "%" PRIu16,
|
||||
tvb_get_ntohs(tvb, offset));
|
||||
offset += 2;
|
||||
break;
|
||||
|
@ -2512,7 +2512,7 @@ dissect_amqp_0_9_field_value(tvbuff_t *tvb, packet_info *pinfo, int offset, guin
|
|||
amqp_typename = "unsigned integer";
|
||||
if (length < 4)
|
||||
return 0; /* too short */
|
||||
value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT32_MODIFIER "u",
|
||||
value = wmem_strdup_printf(wmem_packet_scope(), "%" PRIu32,
|
||||
tvb_get_ntohl(tvb, offset));
|
||||
offset += 4;
|
||||
break;
|
||||
|
@ -2520,7 +2520,7 @@ dissect_amqp_0_9_field_value(tvbuff_t *tvb, packet_info *pinfo, int offset, guin
|
|||
amqp_typename = "long int";
|
||||
if (length < 8)
|
||||
return 0; /* too short */
|
||||
value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT64_MODIFIER "i",
|
||||
value = wmem_strdup_printf(wmem_packet_scope(), "%" PRIi64,
|
||||
tvb_get_ntohi64(tvb, offset));
|
||||
offset += 8;
|
||||
break;
|
||||
|
@ -10368,7 +10368,7 @@ format_amqp_1_0_uint(tvbuff_t *tvb,
|
|||
*value = wmem_strdup_printf(wmem_packet_scope(), "Invalid uint length %d!", length);
|
||||
return length;
|
||||
}
|
||||
*value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT64_MODIFIER "u", val);
|
||||
*value = wmem_strdup_printf(wmem_packet_scope(), "%" PRIu64, val);
|
||||
return length;
|
||||
}
|
||||
|
||||
|
@ -10392,7 +10392,7 @@ format_amqp_1_0_int(tvbuff_t *tvb,
|
|||
*value = wmem_strdup_printf(wmem_packet_scope(), "Invalid int length %d!", length);
|
||||
return length;
|
||||
}
|
||||
*value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT64_MODIFIER "i", val);
|
||||
*value = wmem_strdup_printf(wmem_packet_scope(), "%" PRIi64, val);
|
||||
return length;
|
||||
}
|
||||
|
||||
|
@ -10695,7 +10695,7 @@ format_amqp_0_10_sequence_set(tvbuff_t *tvb, guint offset, guint length,
|
|||
|
||||
static void amqp_prompt(packet_info *pinfo _U_, gchar* result)
|
||||
{
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "AMQP version as");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "AMQP version as");
|
||||
}
|
||||
|
||||
static gpointer amqp_value(packet_info *pinfo)
|
||||
|
|
|
@ -1947,7 +1947,7 @@ trans_param_tele_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint l
|
|||
"%s (%u)",
|
||||
str, value);
|
||||
|
||||
g_snprintf(add_string, string_len, " - %s (%u)", str, value);
|
||||
snprintf(add_string, string_len, " - %s (%u)", str, value);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1966,7 +1966,7 @@ trans_param_srvc_cat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint
|
|||
"%s (%u)",
|
||||
str, value);
|
||||
|
||||
g_snprintf(add_string, string_len, " - %s (%u)", str, value);
|
||||
snprintf(add_string, string_len, " - %s (%u)", str, value);
|
||||
|
||||
if ((value >= ANSI_TSB58_SRVC_CAT_CMAS_MIN) && (value <= ANSI_TSB58_SRVC_CAT_CMAS_MAX))
|
||||
{
|
||||
|
@ -2205,7 +2205,7 @@ trans_param_bearer_reply_opt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
|
|||
proto_tree_add_item(tree, hf_ansi_637_trans_bearer_reply_seq_num, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(tree, hf_ansi_637_reserved_bits_8_03, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
|
||||
g_snprintf(add_string, string_len, " - Reply Sequence Number (%u)",
|
||||
snprintf(add_string, string_len, " - Reply Sequence Number (%u)",
|
||||
(tvb_get_guint8(tvb, offset) & 0xfc) >> 2);
|
||||
}
|
||||
|
||||
|
@ -2228,7 +2228,7 @@ trans_param_cause_codes(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
|
|||
|
||||
oct = tvb_get_guint8(tvb, offset);
|
||||
|
||||
g_snprintf(add_string, string_len, " - Reply Sequence Number (%u)", (oct & 0xfc) >> 2);
|
||||
snprintf(add_string, string_len, " - Reply Sequence Number (%u)", (oct & 0xfc) >> 2);
|
||||
|
||||
if (!(oct & 0x03)) return;
|
||||
|
||||
|
|
|
@ -588,7 +588,7 @@ dissect_mic_e( tvbuff_t *tvb,
|
|||
if ( cse >= 400 )
|
||||
cse -= 400;
|
||||
|
||||
g_snprintf( info_buffer, STRLEN,
|
||||
snprintf( info_buffer, STRLEN,
|
||||
"Lat: %7.7s%c Long: %03d%02d.%02d%c, Cse: %d, Spd: %d, SSID: %d, Msg %s",
|
||||
latitude,
|
||||
n_s,
|
||||
|
@ -610,7 +610,7 @@ dissect_mic_e( tvbuff_t *tvb,
|
|||
tc = proto_tree_add_string( parent_tree, hf_mic_e_idx, tvb, offset, data_len, info_buffer );
|
||||
mic_e_tree = proto_item_add_subtree( tc, ett_aprs_mic_e );
|
||||
|
||||
g_snprintf( info_buffer, STRLEN,
|
||||
snprintf( info_buffer, STRLEN,
|
||||
"Lat %7.7s, Msg A %d, Msg B %d, Msg C %d, N/S %c, Long off %3d, W/E %c, SSID %d",
|
||||
latitude,
|
||||
msg_a,
|
||||
|
@ -882,7 +882,7 @@ aprs_latitude_compressed( proto_tree *aprs_tree, tvbuff_t *tvb, int offset )
|
|||
temp = ( tvb_get_guint8( tvb, offset + 2 ) - 33 ) + ( temp * 91 );
|
||||
temp = ( tvb_get_guint8( tvb, offset + 3 ) - 33 ) + ( temp * 91 );
|
||||
|
||||
g_snprintf( info_buffer, STRLEN, "%6.2f", 90.0 - (temp / 380926.0) );
|
||||
snprintf( info_buffer, STRLEN, "%6.2f", 90.0 - (temp / 380926.0) );
|
||||
proto_tree_add_string( aprs_tree, hf_aprs_lat, tvb, offset, 4, info_buffer );
|
||||
}
|
||||
return offset + 4;
|
||||
|
@ -903,7 +903,7 @@ aprs_longitude_compressed( proto_tree *aprs_tree, tvbuff_t *tvb, int offset )
|
|||
temp = ( tvb_get_guint8( tvb, offset + 2 ) - 33 ) + ( temp * 91 );
|
||||
temp = ( tvb_get_guint8( tvb, offset + 3 ) - 33 ) + ( temp * 91 );
|
||||
|
||||
g_snprintf( info_buffer, STRLEN, "%7.2f", (temp / 190463.0) - 180.0 );
|
||||
snprintf( info_buffer, STRLEN, "%7.2f", (temp / 190463.0) - 180.0 );
|
||||
proto_tree_add_string( aprs_tree, hf_aprs_long, tvb, offset, 4, info_buffer );
|
||||
}
|
||||
return offset + 4;
|
||||
|
|
|
@ -386,7 +386,7 @@ dissect_aruba_erm_type6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
|
|||
static void
|
||||
aruba_erm_prompt(packet_info *pinfo _U_, gchar* result)
|
||||
{
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Aruba ERM payload as");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Aruba ERM payload as");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -232,7 +232,7 @@ asphodel_fmt_version(gchar *result, guint32 version)
|
|||
guint8 major = version >> 8;
|
||||
guint8 minor = (version >> 4) & 0x0F;
|
||||
guint8 subminor = version & 0x0F;
|
||||
g_snprintf(result, ITEM_LABEL_LENGTH, "%d.%d.%d", major, minor, subminor);
|
||||
snprintf(result, ITEM_LABEL_LENGTH, "%d.%d.%d", major, minor, subminor);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -1746,7 +1746,7 @@ dissect_atm_pw_oam_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
|
|||
|
||||
static void atm_prompt(packet_info *pinfo _U_, gchar* result)
|
||||
{
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode AAL2 traffic as");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode AAL2 traffic as");
|
||||
}
|
||||
|
||||
static gpointer atm_value(packet_info *pinfo)
|
||||
|
|
|
@ -236,7 +236,7 @@ static gchar*
|
|||
calc_hf_key(user_data_field_t udf)
|
||||
{
|
||||
gchar* ret = NULL;
|
||||
ret = g_strdup_printf("%i-%i-%" G_GUINT64_FORMAT "-%s", udf.udf_offset, udf.udf_length, udf.udf_mask, udf.udf_name);
|
||||
ret = g_strdup_printf("%i-%i-%" PRIu64 "-%s", udf.udf_offset, udf.udf_length, udf.udf_mask, udf.udf_name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -252,9 +252,9 @@ dissect_ax25_kiss( tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, v
|
|||
default : break;
|
||||
}
|
||||
frame_type_text = val_to_str(kiss_type, kiss_frame_types, "Unknown (%u)");
|
||||
g_snprintf( info_buffer, STRLEN, "%s, Port %u", frame_type_text, kiss_port );
|
||||
snprintf( info_buffer, STRLEN, "%s, Port %u", frame_type_text, kiss_port );
|
||||
if ( kiss_param_len > 0 )
|
||||
g_snprintf( info_buffer, STRLEN, "%s %u, Port %u", frame_type_text, kiss_param, kiss_port );
|
||||
snprintf( info_buffer, STRLEN, "%s %u, Port %u", frame_type_text, kiss_param, kiss_port );
|
||||
|
||||
offset += kiss_param_len;
|
||||
|
||||
|
|
|
@ -153,18 +153,18 @@ dissect_ax25_nol3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, vo
|
|||
col_clear( pinfo->cinfo, COL_INFO);
|
||||
|
||||
offset = 0;
|
||||
g_snprintf( info_buffer, STRLEN, "Text" );
|
||||
snprintf( info_buffer, STRLEN, "Text" );
|
||||
|
||||
if ( gPREF_APRS )
|
||||
{
|
||||
dti = tvb_get_guint8( tvb, offset );
|
||||
if ( isaprs( dti ) )
|
||||
g_snprintf( info_buffer, STRLEN, "APRS" );
|
||||
snprintf( info_buffer, STRLEN, "APRS" );
|
||||
}
|
||||
if ( gPREF_DX )
|
||||
{
|
||||
if ( tvb_get_guint8( tvb, offset ) == 'D' && tvb_get_guint8( tvb, offset + 1 ) == 'X' )
|
||||
g_snprintf( info_buffer, STRLEN, "DX cluster" );
|
||||
snprintf( info_buffer, STRLEN, "DX cluster" );
|
||||
}
|
||||
|
||||
col_add_str( pinfo->cinfo, COL_INFO, info_buffer );
|
||||
|
|
|
@ -242,7 +242,7 @@ static const char *
|
|||
format_timestamp(const guint32 i)
|
||||
{
|
||||
static char buf[sizeof("0000.000000s")];
|
||||
g_snprintf(buf, sizeof(buf), "%u.%06us", i / 1000000, i % 1000000);
|
||||
snprintf(buf, sizeof(buf), "%u.%06us", i / 1000000, i % 1000000);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
|
|
@ -7001,7 +7001,7 @@ fUnsignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset,
|
|||
/* only support up to an 8 byte (64-bit) integer */
|
||||
if (fUnsigned64(tvb, offset + tag_len, lvt, &val))
|
||||
subtree = proto_tree_add_subtree_format(tree, tvb, offset, lvt+tag_len,
|
||||
ett_bacapp_tag, NULL, "%s(Unsigned) %" G_GINT64_MODIFIER "u", label, val);
|
||||
ett_bacapp_tag, NULL, "%s(Unsigned) %" PRIu64, label, val);
|
||||
else
|
||||
subtree = proto_tree_add_subtree_format(tree, tvb, offset, lvt+tag_len,
|
||||
ett_bacapp_tag, NULL, "%s - %u octets (Unsigned)", label, lvt);
|
||||
|
@ -7088,7 +7088,7 @@ fSignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, co
|
|||
tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt);
|
||||
if (fSigned64(tvb, offset + tag_len, lvt, &val))
|
||||
subtree = proto_tree_add_subtree_format(tree, tvb, offset, lvt+tag_len,
|
||||
ett_bacapp_tag, NULL, "%s(Signed) %" G_GINT64_MODIFIER "d", label, val);
|
||||
ett_bacapp_tag, NULL, "%s(Signed) %" PRId64, label, val);
|
||||
else
|
||||
subtree = proto_tree_add_subtree_format(tree, tvb, offset, lvt+tag_len,
|
||||
ett_bacapp_tag, NULL, "%s - %u octets (Signed)", label, lvt);
|
||||
|
@ -8687,13 +8687,13 @@ fAbstractSyntaxNType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint
|
|||
gboolean do_default_handling;
|
||||
|
||||
if (propertyIdentifier >= 0) {
|
||||
g_snprintf(ar, sizeof(ar), "%s: ",
|
||||
snprintf(ar, sizeof(ar), "%s: ",
|
||||
val_to_split_str(propertyIdentifier, 512,
|
||||
BACnetPropertyIdentifier,
|
||||
ASHRAE_Reserved_Fmt,
|
||||
Vendor_Proprietary_Fmt));
|
||||
} else {
|
||||
g_snprintf(ar, sizeof(ar), "Abstract Type: ");
|
||||
snprintf(ar, sizeof(ar), "Abstract Type: ");
|
||||
}
|
||||
|
||||
unsigned recursion_depth = p_get_proto_depth(pinfo, proto_bacapp);
|
||||
|
@ -14122,7 +14122,7 @@ fPriorityArray(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset
|
|||
while (tvb_reported_length_remaining(tvb, offset) > 0) {
|
||||
/* exit loop if nothing happens inside */
|
||||
lastoffset = offset;
|
||||
g_snprintf(ar, sizeof(ar), "%s[%d]: ",
|
||||
snprintf(ar, sizeof(ar), "%s[%d]: ",
|
||||
val_to_split_str(87 , 512,
|
||||
BACnetPropertyIdentifier,
|
||||
ASHRAE_Reserved_Fmt,
|
||||
|
|
|
@ -144,7 +144,7 @@ dissect_banana_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
|
|||
switch (byte) {
|
||||
case BE_LIST:
|
||||
if (val > MAX_ELEMENT_VAL) {
|
||||
expert_add_info_format(pinfo, NULL, &ei_banana_length_too_long, "List length %" G_GINT64_MODIFIER "d longer than we can handle", val);
|
||||
expert_add_info_format(pinfo, NULL, &ei_banana_length_too_long, "List length %" PRId64 " longer than we can handle", val);
|
||||
}
|
||||
ti = proto_tree_add_uint_format_value(tree, hf_banana_list, tvb, start_offset, offset - start_offset - 1, (guint32) val, "(%d items)", (gint) val);
|
||||
list_tree = proto_item_add_subtree(ti, ett_list);
|
||||
|
@ -158,20 +158,20 @@ dissect_banana_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
|
|||
break;
|
||||
case BE_INT:
|
||||
if (val > MAX_ELEMENT_VAL) {
|
||||
expert_add_info_format(pinfo, NULL, &ei_banana_value_too_large, "Integer value %" G_GINT64_MODIFIER "d too large", val);
|
||||
expert_add_info_format(pinfo, NULL, &ei_banana_value_too_large, "Integer value %" PRId64 " too large", val);
|
||||
}
|
||||
proto_tree_add_uint(tree, hf_banana_int, tvb, start_offset, offset - start_offset, (guint32) val);
|
||||
break;
|
||||
case BE_STRING:
|
||||
if (val > MAX_ELEMENT_VAL) {
|
||||
expert_add_info_format(pinfo, NULL, &ei_banana_length_too_long, "String length %" G_GINT64_MODIFIER "d longer than we can handle", val);
|
||||
expert_add_info_format(pinfo, NULL, &ei_banana_length_too_long, "String length %" PRId64 " longer than we can handle", val);
|
||||
}
|
||||
proto_tree_add_item(tree, hf_banana_string, tvb, offset, (guint32) val, ENC_ASCII|ENC_NA);
|
||||
offset += (gint) val;
|
||||
break;
|
||||
case BE_NEG_INT:
|
||||
if (val > MAX_ELEMENT_VAL) {
|
||||
expert_add_info_format(pinfo, NULL, &ei_banana_value_too_large, "Integer value -%" G_GINT64_MODIFIER "d too large", val);
|
||||
expert_add_info_format(pinfo, NULL, &ei_banana_value_too_large, "Integer value -%" PRId64 " too large", val);
|
||||
}
|
||||
proto_tree_add_int(tree, hf_banana_neg_int, tvb, start_offset, offset - start_offset, (gint32) val * -1);
|
||||
break;
|
||||
|
|
|
@ -362,7 +362,7 @@ static uat_field_t users_flds[] = {
|
|||
|
||||
static void ber_prompt(packet_info *pinfo _U_, gchar* result)
|
||||
{
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode ASN.1 file as");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode ASN.1 file as");
|
||||
}
|
||||
|
||||
static gpointer ber_value(packet_info *pinfo _U_)
|
||||
|
@ -534,12 +534,12 @@ ber_check_value64 (gint64 value, gint64 min_len, gint64 max_len, asn1_ctx_t *act
|
|||
if ((min_len != -1) && (value < min_len)) {
|
||||
expert_add_info_format(
|
||||
actx->pinfo, item, &ei_ber_size_constraint_value,
|
||||
"Size constraint: value too small: %" G_GINT64_MODIFIER "d (%" G_GINT64_MODIFIER "d .. %" G_GINT64_MODIFIER "d)",
|
||||
"Size constraint: value too small: %" PRId64 " (%" PRId64" .. %" PRId64 ")",
|
||||
value, min_len, max_len);
|
||||
} else if ((max_len != -1) && (value > max_len)) {
|
||||
expert_add_info_format(
|
||||
actx->pinfo, item, &ei_ber_size_constraint_value,
|
||||
"Size constraint: value too big: %" G_GINT64_MODIFIER "d (%" G_GINT64_MODIFIER "d .. %" G_GINT64_MODIFIER "d)",
|
||||
"Size constraint: value too big: %" PRId64 " (%" PRId64 " .. %" PRId64 ")",
|
||||
value, min_len, max_len);
|
||||
}
|
||||
}
|
||||
|
@ -3743,7 +3743,7 @@ dissect_ber_UTCTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, t
|
|||
goto malformed;
|
||||
}
|
||||
}
|
||||
g_snprintf(outstrptr, 15, "%.2s-%.2s-%.2s %.2s:%.2s", instr, instr+2, instr+4, instr+6, instr+8);
|
||||
snprintf(outstrptr, 15, "%.2s-%.2s-%.2s %.2s:%.2s", instr, instr+2, instr+4, instr+6, instr+8);
|
||||
outstrptr+= 14;
|
||||
|
||||
/* (ss)? */
|
||||
|
@ -3752,7 +3752,7 @@ dissect_ber_UTCTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, t
|
|||
i++;
|
||||
if ((instr[i] >= '0') && (instr[i] <= '9')) {
|
||||
i++;
|
||||
g_snprintf(outstrptr, 4, ":%.2s", instr+10);
|
||||
snprintf(outstrptr, 4, ":%.2s", instr+10);
|
||||
outstrptr+=3;
|
||||
} else {
|
||||
error_str = "BER Error: malformed UTCTime encoding, "
|
||||
|
@ -3771,7 +3771,7 @@ dissect_ber_UTCTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, t
|
|||
"there must be no further octets after \'Z\'";
|
||||
goto malformed;
|
||||
}
|
||||
g_snprintf(outstrptr, 7, " (UTC)");
|
||||
snprintf(outstrptr, 7, " (UTC)");
|
||||
i++;
|
||||
break;
|
||||
case '-':
|
||||
|
@ -3788,7 +3788,7 @@ dissect_ber_UTCTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, t
|
|||
goto malformed;
|
||||
}
|
||||
}
|
||||
g_snprintf(outstrptr, 12, " (UTC%c%.4s)", instr[i], instr+i+1);
|
||||
snprintf(outstrptr, 12, " (UTC%c%.4s)", instr[i], instr+i+1);
|
||||
i+=5;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -9445,8 +9445,8 @@ dissect_bgp_path_attr(proto_tree *subtree, tvbuff_t *tvb, guint16 path_attr_len,
|
|||
case AIGP_TLV_TYPE :
|
||||
proto_tree_add_item(subtree3, hf_bgp_aigp_tlv_length, tvb, q+1, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(subtree3, hf_bgp_aigp_accu_igp_metric, tvb, q+3, 8, ENC_BIG_ENDIAN);
|
||||
proto_item_append_text(ti, ": %" G_GINT64_MODIFIER "u", tvb_get_ntoh64(tvb, q+3));
|
||||
proto_item_append_text(ti_pa, ": %" G_GINT64_MODIFIER "u", tvb_get_ntoh64(tvb, q+3));
|
||||
proto_item_append_text(ti, ": %" PRIu64, tvb_get_ntoh64(tvb, q+3));
|
||||
proto_item_append_text(ti_pa, ": %" PRIu64, tvb_get_ntoh64(tvb, q+3));
|
||||
break;
|
||||
default :
|
||||
expert_add_info_format(pinfo, aigp_type_item, &ei_bgp_attr_aigp_type,
|
||||
|
|
|
@ -181,7 +181,7 @@ message_hash_key_convo(packet_info *pinfo,
|
|||
// msgtype:srcport:destport:messagenum
|
||||
|
||||
const gchar *msg_type = get_message_type(value_frame_flags);
|
||||
gchar *hash_key = wmem_strdup_printf(pinfo->pool, "%s:%u:%u:%" G_GINT64_MODIFIER "u",
|
||||
gchar *hash_key = wmem_strdup_printf(pinfo->pool, "%s:%u:%u:%" PRIu64,
|
||||
msg_type, pinfo->srcport, pinfo->destport, value_message_num);
|
||||
|
||||
return hash_key;
|
||||
|
@ -445,7 +445,7 @@ dissect_blip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, _U_ void *data
|
|||
offset += varint_frame_flags_length;
|
||||
|
||||
const gchar* msg_type = get_message_type(value_frame_flags);
|
||||
gchar* msg_num = wmem_strdup_printf(pinfo->pool, "#%" G_GUINT64_FORMAT, value_message_num);
|
||||
gchar* msg_num = wmem_strdup_printf(pinfo->pool, "#%" PRIu64, value_message_num);
|
||||
gchar* col_info = wmem_strconcat(pinfo->pool, msg_type, msg_num, NULL);
|
||||
col_add_str(pinfo->cinfo, COL_INFO, col_info);
|
||||
|
||||
|
|
|
@ -3472,9 +3472,9 @@ static void bluetooth_uuid_prompt(packet_info *pinfo, gchar* result)
|
|||
|
||||
value_data = (gchar *) p_get_proto_data(pinfo->pool, pinfo, proto_bluetooth, PROTO_DATA_BLUETOOTH_SERVICE_UUID);
|
||||
if (value_data)
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "BT Service UUID %s as", (gchar *) value_data);
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "BT Service UUID %s as", (gchar *) value_data);
|
||||
else
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown BT Service UUID");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown BT Service UUID");
|
||||
}
|
||||
|
||||
static gpointer bluetooth_uuid_value(packet_info *pinfo)
|
||||
|
|
|
@ -310,7 +310,7 @@ static int dissect_block_asb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
|
|||
gint64 *paramid = wscbor_require_int64(wmem_packet_scope(), chunk_paramid);
|
||||
proto_tree_add_cbor_int64(tree_param_pair, hf_asb_param_id, pinfo, tvb, chunk_paramid, paramid);
|
||||
if (paramid) {
|
||||
proto_item_append_text(item_param_pair, ", ID: %" G_GINT64_FORMAT, *paramid);
|
||||
proto_item_append_text(item_param_pair, ", ID: %" PRId64, *paramid);
|
||||
}
|
||||
|
||||
const gint offset_value = offset;
|
||||
|
@ -369,7 +369,7 @@ static int dissect_block_asb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
|
|||
gint64 *resultid = wscbor_require_int64(wmem_packet_scope(), chunk_resultid);
|
||||
proto_tree_add_cbor_int64(tree_result_pair, hf_asb_result_id, pinfo, tvb, chunk_resultid, resultid);
|
||||
if (resultid) {
|
||||
proto_item_append_text(item_result_pair, ", ID: %" G_GINT64_FORMAT, *resultid);
|
||||
proto_item_append_text(item_result_pair, ", ID: %" PRId64, *resultid);
|
||||
}
|
||||
|
||||
const gint offset_value = offset;
|
||||
|
|
|
@ -733,7 +733,7 @@ proto_item * proto_tree_add_cbor_eid(proto_tree *tree, int hfindex, int hfindex_
|
|||
const guint64 *service = wscbor_require_uint64(wmem_packet_scope(), chunk);
|
||||
proto_tree_add_cbor_uint64(tree_eid, hf_eid_ipn_service, pinfo, tvb, chunk, service);
|
||||
|
||||
wmem_strbuf_append_printf(uribuf, "ipn:%" G_GUINT64_FORMAT ".%" G_GUINT64_FORMAT, node ? *node : 0, service ? *service : 0);
|
||||
wmem_strbuf_append_printf(uribuf, "ipn:%" PRIu64 ".%" PRIu64, node ? *node : 0, service ? *service : 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -908,16 +908,16 @@ static void proto_tree_add_ident(proto_tree *tree, int hfindex, tvbuff_t *tvb, c
|
|||
wmem_strbuf_t *ident_text = wmem_strbuf_new(wmem_packet_scope(), NULL);
|
||||
wmem_strbuf_append_printf(
|
||||
ident_text,
|
||||
"Source: %s, DTN Time: %" G_GUINT64_FORMAT ", Seq: %" G_GUINT64_FORMAT,
|
||||
"Source: %s, DTN Time: %" PRIu64 ", Seq: %" PRIu64,
|
||||
ident->src,
|
||||
ident->ts->abstime.dtntime,
|
||||
ident->ts->seqno
|
||||
);
|
||||
if (ident->frag_offset) {
|
||||
wmem_strbuf_append_printf(ident_text, ", Frag Offset: %" G_GUINT64_FORMAT, *(ident->frag_offset));
|
||||
wmem_strbuf_append_printf(ident_text, ", Frag Offset: %" PRIu64, *(ident->frag_offset));
|
||||
}
|
||||
if (ident->total_len) {
|
||||
wmem_strbuf_append_printf(ident_text, ", Total Length: %" G_GUINT64_FORMAT, *(ident->total_len));
|
||||
wmem_strbuf_append_printf(ident_text, ", Total Length: %" PRIu64, *(ident->total_len));
|
||||
}
|
||||
|
||||
proto_item *item_subj_ident = proto_tree_add_string(tree, hfindex, tvb, 0, 0, wmem_strbuf_get_str(ident_text));
|
||||
|
@ -941,7 +941,7 @@ static gint dissect_block_primary(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
return offset - start;
|
||||
}
|
||||
#if 0
|
||||
proto_item_append_text(item_block, ", Items: %" G_GUINT64_FORMAT, chunk_block->head_value);
|
||||
proto_item_append_text(item_block, ", Items: %" PRIu64, chunk_block->head_value);
|
||||
#endif
|
||||
|
||||
wscbor_chunk_t *chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
|
||||
|
@ -964,7 +964,7 @@ static gint dissect_block_primary(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
field_ix++;
|
||||
block->crc_type = (crc_type ? (BundleCrcType)(*crc_type) : BP_CRC_NONE);
|
||||
if (crc_type) {
|
||||
proto_item_append_text(item_block, ", CRC Type: %s", val64_to_str(*crc_type, crc_vals, "%" G_GUINT64_FORMAT));
|
||||
proto_item_append_text(item_block, ", CRC Type: %s", val64_to_str(*crc_type, crc_vals, "%" PRIu64));
|
||||
}
|
||||
|
||||
proto_tree_add_cbor_eid(tree_block, hf_primary_dst_eid, hf_primary_dst_uri, pinfo, tvb, &offset, block->dst_eid);
|
||||
|
@ -1063,7 +1063,7 @@ static gint dissect_block_canonical(tvbuff_t *tvb, packet_info *pinfo, proto_tre
|
|||
return offset - start;
|
||||
}
|
||||
#if 0
|
||||
proto_item_append_text(item_block, ", Items: %" G_GUINT64_FORMAT, chunk_block->head_value);
|
||||
proto_item_append_text(item_block, ", Items: %" PRIu64, chunk_block->head_value);
|
||||
#endif
|
||||
|
||||
wscbor_chunk_t *chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
|
||||
|
@ -1073,7 +1073,7 @@ static gint dissect_block_canonical(tvbuff_t *tvb, packet_info *pinfo, proto_tre
|
|||
block->type_code = type_code;
|
||||
|
||||
if (type_code) {
|
||||
proto_item_append_text(item_block, ": %s", val64_to_str(*type_code, blocktype_vals, "Type %" G_GUINT64_FORMAT));
|
||||
proto_item_append_text(item_block, ": %s", val64_to_str(*type_code, blocktype_vals, "Type %" PRIu64));
|
||||
|
||||
// Check duplicate of this type
|
||||
guint64 limit = UINT64_MAX;
|
||||
|
@ -1112,7 +1112,7 @@ static gint dissect_block_canonical(tvbuff_t *tvb, packet_info *pinfo, proto_tre
|
|||
field_ix++;
|
||||
block->block_number = block_num;
|
||||
if (block_num) {
|
||||
proto_item_append_text(item_block, ", Block Num: %" G_GUINT64_FORMAT, *block_num);
|
||||
proto_item_append_text(item_block, ", Block Num: %" PRIu64, *block_num);
|
||||
}
|
||||
|
||||
chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
|
||||
|
@ -1127,7 +1127,7 @@ static gint dissect_block_canonical(tvbuff_t *tvb, packet_info *pinfo, proto_tre
|
|||
field_ix++;
|
||||
block->crc_type = (crc_type ? (BundleCrcType)(*crc_type) : BP_CRC_NONE);
|
||||
if (crc_type) {
|
||||
proto_item_append_text(item_block, ", CRC Type: %s", val64_to_str(*crc_type, crc_vals, "%" G_GUINT64_FORMAT));
|
||||
proto_item_append_text(item_block, ", CRC Type: %s", val64_to_str(*crc_type, crc_vals, "%" PRIu64));
|
||||
}
|
||||
|
||||
chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
|
||||
|
@ -1211,7 +1211,7 @@ static void mark_target_block(gpointer key, gpointer value _U_, gpointer user_da
|
|||
const bpsec_block_mark_t *mark = (bpsec_block_mark_t *)user_data;
|
||||
expert_add_info_format(
|
||||
mark->pinfo, mark->pi, mark->eiindex,
|
||||
"Block is targed by %s block number %" G_GUINT64_FORMAT, mark->sectype, *blk_num
|
||||
"Block is targed by %s block number %" PRIu64, mark->sectype, *blk_num
|
||||
);
|
||||
}
|
||||
static void apply_bpsec_mark(const security_mark_t *sec, packet_info *pinfo, proto_item *pi) {
|
||||
|
@ -1416,14 +1416,14 @@ static int dissect_bp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
|
|||
apply_bpsec_mark(&(block->sec), pinfo, block->item_block);
|
||||
}
|
||||
|
||||
proto_item_append_text(item_bundle, ", Blocks: %" G_GUINT64_FORMAT, block_ix);
|
||||
proto_item_append_text(item_bundle, ", Blocks: %" PRIu64, block_ix);
|
||||
if (bundle->primary) {
|
||||
const bp_block_primary_t *block = bundle->primary;
|
||||
proto_item_append_text(item_bundle, ", Dst: %s", block->dst_eid ? block->dst_eid->uri : NULL);
|
||||
proto_item_append_text(item_bundle, ", Src: %s", block->src_nodeid ? block->src_nodeid->uri : NULL);
|
||||
if (bundle->ident && (bundle->ident->ts)) {
|
||||
proto_item_append_text(item_bundle, ", Time: %" G_GUINT64_FORMAT, bundle->ident->ts->abstime.dtntime);
|
||||
proto_item_append_text(item_bundle, ", Seq: %" G_GUINT64_FORMAT, bundle->ident->ts->seqno);
|
||||
proto_item_append_text(item_bundle, ", Time: %" PRIu64, bundle->ident->ts->abstime.dtntime);
|
||||
proto_item_append_text(item_bundle, ", Seq: %" PRIu64, bundle->ident->ts->seqno);
|
||||
}
|
||||
}
|
||||
{
|
||||
|
@ -1494,7 +1494,7 @@ static int dissect_payload_admin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
|
|||
|
||||
dissector_handle_t admin_dissect = NULL;
|
||||
if (type_code) {
|
||||
proto_item_append_text(item_rec, ": %s", val64_to_str(*type_code, admin_type_vals, "Type %" G_GUINT64_FORMAT));
|
||||
proto_item_append_text(item_rec, ": %s", val64_to_str(*type_code, admin_type_vals, "Type %" PRIu64));
|
||||
admin_dissect = dissector_get_custom_table_handle(admin_dissectors, type_code);
|
||||
}
|
||||
tvbuff_t *tvb_record = tvb_new_subset_remaining(tvb, offset);
|
||||
|
@ -1652,7 +1652,7 @@ static int dissect_status_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
|
|||
status_buf);
|
||||
}
|
||||
if (reason_code) {
|
||||
proto_item_append_text(item_admin, ", Reason: %s", val64_to_str(*reason_code, status_report_reason_vals, "%" G_GUINT64_FORMAT));
|
||||
proto_item_append_text(item_admin, ", Reason: %s", val64_to_str(*reason_code, status_report_reason_vals, "%" PRIu64));
|
||||
}
|
||||
|
||||
proto_item_set_len(item_status, offset - chunk_status->start);
|
||||
|
|
|
@ -701,7 +701,7 @@ de_bssgp_bvci(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 o
|
|||
curr_offset+=2;
|
||||
|
||||
if (add_string)
|
||||
g_snprintf(add_string, string_len, " - 0x%x", bvci);
|
||||
snprintf(add_string, string_len, " - 0x%x", bvci);
|
||||
|
||||
|
||||
return(curr_offset-offset);
|
||||
|
@ -856,7 +856,7 @@ de_bssgp_cell_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of
|
|||
proto_tree_add_item(tree, hf_bssgp_ci, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
|
||||
curr_offset+=2;
|
||||
if (add_string)
|
||||
g_snprintf(add_string, string_len, "%s, CI %u", add_string, ci);
|
||||
snprintf(add_string, string_len, "%s, CI %u", add_string, ci);
|
||||
|
||||
|
||||
return(curr_offset-offset);
|
||||
|
@ -922,7 +922,7 @@ de_bssgp_flush_action(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, g
|
|||
proto_tree_add_item(tree, hf_bssgp_flush_action, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
|
||||
curr_offset+=1;
|
||||
if (add_string)
|
||||
g_snprintf(add_string, string_len, " - %s", val_to_str_const(oct, bssgp_flush_action_vals, "Reserved"));
|
||||
snprintf(add_string, string_len, " - %s", val_to_str_const(oct, bssgp_flush_action_vals, "Reserved"));
|
||||
|
||||
|
||||
return(curr_offset-offset);
|
||||
|
@ -980,7 +980,7 @@ de_bssgp_llc_frames_disc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_
|
|||
curr_offset+=1;
|
||||
|
||||
if (add_string)
|
||||
g_snprintf(add_string, string_len, " - %u Frames", oct);
|
||||
snprintf(add_string, string_len, " - %u Frames", oct);
|
||||
|
||||
return(curr_offset-offset);
|
||||
}
|
||||
|
@ -1418,7 +1418,7 @@ de_bssgp_no_of_oct_affected(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo
|
|||
curr_offset+=3;
|
||||
|
||||
if (add_string)
|
||||
g_snprintf(add_string, string_len, " - %u", no_of_oct);
|
||||
snprintf(add_string, string_len, " - %u", no_of_oct);
|
||||
|
||||
return(curr_offset-offset);
|
||||
}
|
||||
|
@ -2310,7 +2310,7 @@ de_bssgp_rim_routing_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gu
|
|||
proto_tree_add_item(tree, hf_bssgp_rnc_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
|
||||
|
||||
if (add_string)
|
||||
g_snprintf(add_string, string_len, " %s, RNC-ID %u", add_string, rnc_id);
|
||||
snprintf(add_string, string_len, " %s, RNC-ID %u", add_string, rnc_id);
|
||||
break;
|
||||
case 2:
|
||||
/* RIM Routing Address discriminator = 0010:
|
||||
|
@ -2764,7 +2764,7 @@ de_bssgp_rnc_identifier(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui
|
|||
curr_offset+=2;
|
||||
|
||||
if (add_string)
|
||||
g_snprintf(add_string, string_len, " %s, RNC-ID %u", add_string, rnc_id);
|
||||
snprintf(add_string, string_len, " %s, RNC-ID %u", add_string, rnc_id);
|
||||
|
||||
return(curr_offset-offset);
|
||||
|
||||
|
|
|
@ -4031,7 +4031,7 @@ static void helper_base_signed_negative_exponent(gchar * const buf, const gint b
|
|||
{
|
||||
const gint32 signed_value = (const gint32) value;
|
||||
const gint32 fraction = (((signed_value < 0) ? -1 : 1) * signed_value) % base;
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%i.%i%s", signed_value / base, fraction, unit);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%i.%i%s", signed_value / base, fraction, unit);
|
||||
}
|
||||
|
||||
static void base_signed_one_tenth_unitless(gchar *buf, guint32 value) {
|
||||
|
@ -4053,32 +4053,32 @@ static void base_signed_one_hundredth_percentage(gchar *buf, guint32 value) {
|
|||
/* unsigned area */
|
||||
|
||||
static void base_unsigned_one_tenth_unitless(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u", value / 10, value % 10);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u", value / 10, value % 10);
|
||||
}
|
||||
|
||||
static void base_unsigned_one_hundredth_km_h(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%02u km/h", value / 100, value % 100);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u.%02u km/h", value / 100, value % 100);
|
||||
}
|
||||
|
||||
static void base_unsigned_one_tenth_percentage(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u%%", value / 10, value % 10);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u%%", value / 10, value % 10);
|
||||
}
|
||||
|
||||
static void base_unsigned_one_tenth_milimeters(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%umm", value / 10, value % 10);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u.%umm", value / 10, value % 10);
|
||||
}
|
||||
|
||||
static void base_unsigned_one_half_half_minute(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%um 1/min", value / 2, value % 2);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u.%um 1/min", value / 2, value % 2);
|
||||
}
|
||||
|
||||
static void base_unsigned_one_ten_thousandth_unitless(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u", value / 10000, value % 10000);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u", value / 10000, value % 10000);
|
||||
}
|
||||
|
||||
|
||||
static void base_unsigned_one_hundredth_kg_per_meter(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u Kg/m", value / 100, value % 100);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u Kg/m", value / 100, value % 100);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4158,9 +4158,9 @@ static void btatt_handle_prompt(packet_info *pinfo, gchar* result)
|
|||
|
||||
value_data = (guint16 *) p_get_proto_data(pinfo->pool, pinfo, proto_btatt, PROTO_DATA_BTATT_HANDLE);
|
||||
if (value_data)
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "ATT Handle 0x%04x as", (guint) *value_data);
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "ATT Handle 0x%04x as", (guint) *value_data);
|
||||
else
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown ATT Handle");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown ATT Handle");
|
||||
}
|
||||
|
||||
static gpointer btatt_handle_value(packet_info *pinfo)
|
||||
|
|
|
@ -1787,7 +1787,7 @@ dissect_vendor_dependent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
uid_counter = tvb_get_ntohs(tvb, offset);
|
||||
offset += 2;
|
||||
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" G_GINT64_MODIFIER "x, UidCounter: 0x%04x",
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" PRIx64 ", UidCounter: 0x%04x",
|
||||
val_to_str_const(scope, scope_vals, "unknown"), uid, uid_counter);
|
||||
} else {
|
||||
guint status;
|
||||
|
@ -1815,7 +1815,7 @@ dissect_vendor_dependent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
uid_counter = tvb_get_ntohs(tvb, offset);
|
||||
offset += 2;
|
||||
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" G_GINT64_MODIFIER "x, UidCounter: 0x%04x",
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" PRIx64 ", UidCounter: 0x%04x",
|
||||
val_to_str_const(scope, scope_vals, "unknown"), uid, uid_counter);
|
||||
} else {
|
||||
guint status;
|
||||
|
@ -1981,7 +1981,7 @@ dissect_browsing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
uid = tvb_get_ntoh64(tvb, offset);
|
||||
offset += 8;
|
||||
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " - Direction: %s, Uid: 0x%016" G_GINT64_MODIFIER "x, UidCounter: 0x%04x",
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " - Direction: %s, Uid: 0x%016" PRIx64 ", UidCounter: 0x%04x",
|
||||
val_to_str_const(direction, direction_vals, "unknown"), uid, uid_counter);
|
||||
} else {
|
||||
guint number_of_items;
|
||||
|
@ -2011,7 +2011,7 @@ dissect_browsing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
proto_tree_add_item(tree, hf_btavrcp_number_of_attributes, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
number_of_attributes = tvb_get_guint8(tvb, offset);
|
||||
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" G_GINT64_MODIFIER "x, UidCounter: 0x%04x",
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" PRIx64 ", UidCounter: 0x%04x",
|
||||
val_to_str_const(scope, scope_vals, "unknown"), uid, uid_counter);
|
||||
|
||||
offset += 1;
|
||||
|
|
|
@ -287,7 +287,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
|
|||
remote_length = (gint)(strlen(remote_ether_addr) + 3 + strlen(remote_name) + 1);
|
||||
remote_addr_name = (gchar *)wmem_alloc(pinfo->pool, remote_length);
|
||||
|
||||
g_snprintf(remote_addr_name, remote_length, "%s (%s)", remote_ether_addr, remote_name);
|
||||
snprintf(remote_addr_name, remote_length, "%s (%s)", remote_ether_addr, remote_name);
|
||||
|
||||
if (pinfo->p2p_dir == P2P_DIR_RECV) {
|
||||
src_bd_addr = remote_bdaddr->bd_addr;
|
||||
|
@ -334,7 +334,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
|
|||
localhost_length = (gint)(strlen(localhost_ether_addr) + 3 + strlen(localhost_name) + 1);
|
||||
localhost_addr_name = (gchar *)wmem_alloc(pinfo->pool, localhost_length);
|
||||
|
||||
g_snprintf(localhost_addr_name, localhost_length, "%s (%s)", localhost_ether_addr, localhost_name);
|
||||
snprintf(localhost_addr_name, localhost_length, "%s (%s)", localhost_ether_addr, localhost_name);
|
||||
|
||||
if (pinfo->p2p_dir == P2P_DIR_RECV) {
|
||||
dst_bd_addr = localhost_bdaddr;
|
||||
|
|
|
@ -2593,7 +2593,7 @@ void proto_reg_handoff_btcommon(void);
|
|||
|
||||
static void bthci_cmd_vendor_prompt(packet_info *pinfo _U_, gchar* result)
|
||||
{
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Vendor as");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Vendor as");
|
||||
}
|
||||
|
||||
static gint dissect_coding_format(proto_tree *tree, int hf_x, tvbuff_t *tvb, gint offset, gint ett_x)
|
||||
|
@ -8909,9 +8909,9 @@ static void bluetooth_eir_ad_manufacturer_company_id_prompt(packet_info *pinfo,
|
|||
|
||||
value_data = (guint16 *) p_get_proto_data(pinfo->pool, pinfo, proto_btcommon, PROTO_DATA_BLUETOOTH_EIR_AD_MANUFACTURER_COMPANY_ID);
|
||||
if (value_data)
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "EIR/AD Manufacturer Company ID 0x%02x as", (guint) *value_data);
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "EIR/AD Manufacturer Company ID 0x%02x as", (guint) *value_data);
|
||||
else
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown EIR/AD Manufacturer");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown EIR/AD Manufacturer");
|
||||
}
|
||||
|
||||
static gpointer bluetooth_eir_ad_manufacturer_company_id_value(packet_info *pinfo)
|
||||
|
@ -8932,9 +8932,9 @@ static void bluetooth_eir_ad_tds_organization_id_prompt(packet_info *pinfo, gcha
|
|||
|
||||
value_data = (guint8 *) p_get_proto_data(pinfo->pool, pinfo, proto_btcommon, PROTO_DATA_BLUETOOTH_EIR_AD_TDS_ORGANIZATION_ID);
|
||||
if (value_data)
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "TDS Organization ID 0x%02x as", (guint) *value_data);
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "TDS Organization ID 0x%02x as", (guint) *value_data);
|
||||
else
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown TDS Organization ID");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown TDS Organization ID");
|
||||
}
|
||||
|
||||
static gpointer bluetooth_eir_ad_tds_organization_id_value(packet_info *pinfo)
|
||||
|
|
|
@ -1219,7 +1219,7 @@ void proto_reg_handoff_bthci_evt(void);
|
|||
|
||||
static void bthci_evt_vendor_prompt(packet_info *pinfo _U_, gchar* result)
|
||||
{
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Vendor as");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Vendor as");
|
||||
}
|
||||
|
||||
static gpointer bthci_evt_vendor_value(packet_info *pinfo _U_)
|
||||
|
|
|
@ -252,7 +252,7 @@ dissect_bthci_iso(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
|
|||
remote_length = (gint)(strlen(remote_ether_addr) + 3 + strlen(remote_name) + 1);
|
||||
remote_addr_name = (gchar *)wmem_alloc(pinfo->pool, remote_length);
|
||||
|
||||
g_snprintf(remote_addr_name, remote_length, "%s (%s)", remote_ether_addr, remote_name);
|
||||
snprintf(remote_addr_name, remote_length, "%s (%s)", remote_ether_addr, remote_name);
|
||||
|
||||
if (pinfo->p2p_dir == P2P_DIR_RECV) {
|
||||
set_address(&pinfo->net_src, AT_STRINGZ, (int)strlen(remote_name) + 1, remote_name);
|
||||
|
@ -309,7 +309,7 @@ dissect_bthci_iso(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
|
|||
localhost_length = (gint)(strlen(localhost_ether_addr) + 3 + strlen(localhost_name) + 1);
|
||||
localhost_addr_name = (gchar *)wmem_alloc(pinfo->pool, localhost_length);
|
||||
|
||||
g_snprintf(localhost_addr_name, localhost_length, "%s (%s)", localhost_ether_addr, localhost_name);
|
||||
snprintf(localhost_addr_name, localhost_length, "%s (%s)", localhost_ether_addr, localhost_name);
|
||||
|
||||
if (pinfo->p2p_dir == P2P_DIR_RECV) {
|
||||
set_address(&pinfo->net_dst, AT_STRINGZ, (int)strlen(localhost_name) + 1, localhost_name);
|
||||
|
|
|
@ -182,7 +182,7 @@ dissect_bthci_sco(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
|
|||
remote_length = (gint)(strlen(remote_ether_addr) + 3 + strlen(remote_name) + 1);
|
||||
remote_addr_name = (gchar *)wmem_alloc(pinfo->pool, remote_length);
|
||||
|
||||
g_snprintf(remote_addr_name, remote_length, "%s (%s)", remote_ether_addr, remote_name);
|
||||
snprintf(remote_addr_name, remote_length, "%s (%s)", remote_ether_addr, remote_name);
|
||||
|
||||
if (pinfo->p2p_dir == P2P_DIR_RECV) {
|
||||
set_address(&pinfo->net_src, AT_STRINGZ, (int)strlen(remote_name) + 1, remote_name);
|
||||
|
@ -243,7 +243,7 @@ dissect_bthci_sco(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
|
|||
localhost_length = (gint)(strlen(localhost_ether_addr) + 3 + strlen(localhost_name) + 1);
|
||||
localhost_addr_name = (gchar *)wmem_alloc(pinfo->pool, localhost_length);
|
||||
|
||||
g_snprintf(localhost_addr_name, localhost_length, "%s (%s)", localhost_ether_addr, localhost_name);
|
||||
snprintf(localhost_addr_name, localhost_length, "%s (%s)", localhost_ether_addr, localhost_name);
|
||||
|
||||
if (pinfo->p2p_dir == P2P_DIR_RECV) {
|
||||
set_address(&pinfo->net_dst, AT_STRINGZ, (int)strlen(localhost_name) + 1, localhost_name);
|
||||
|
|
|
@ -480,9 +480,9 @@ static void btl2cap_cid_prompt(packet_info *pinfo, gchar* result)
|
|||
|
||||
value_data = (guint16 *) p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_CID);
|
||||
if (value_data)
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "L2CAP CID 0x%04x as", (guint) *value_data);
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "L2CAP CID 0x%04x as", (guint) *value_data);
|
||||
else
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown L2CAP CID");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown L2CAP CID");
|
||||
}
|
||||
|
||||
static gpointer btl2cap_cid_value(packet_info *pinfo)
|
||||
|
@ -503,9 +503,9 @@ static void btl2cap_psm_prompt(packet_info *pinfo, gchar* result)
|
|||
|
||||
value_data = (guint16 *) p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM);
|
||||
if (value_data)
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "L2CAP PSM 0x%04x as", (guint) *value_data);
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "L2CAP PSM 0x%04x as", (guint) *value_data);
|
||||
else
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown L2CAP PSM");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown L2CAP PSM");
|
||||
}
|
||||
|
||||
static gpointer btl2cap_psm_value(packet_info *pinfo)
|
||||
|
|
|
@ -2378,21 +2378,21 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
|||
|
||||
switch (direction) {
|
||||
case BTLE_DIR_MASTER_SLAVE:
|
||||
g_snprintf(str_addr_src, str_addr_len, "Master_0x%08x", connection_info->access_address);
|
||||
g_snprintf(str_addr_dst, str_addr_len, "Slave_0x%08x", connection_info->access_address);
|
||||
snprintf(str_addr_src, str_addr_len, "Master_0x%08x", connection_info->access_address);
|
||||
snprintf(str_addr_dst, str_addr_len, "Slave_0x%08x", connection_info->access_address);
|
||||
set_address(&pinfo->dl_src, AT_ETHER, sizeof(connection_info->master_bd_addr), connection_info->master_bd_addr);
|
||||
set_address(&pinfo->dl_dst, AT_ETHER, sizeof(connection_info->slave_bd_addr), connection_info->slave_bd_addr);
|
||||
break;
|
||||
case BTLE_DIR_SLAVE_MASTER:
|
||||
g_snprintf(str_addr_src, str_addr_len, "Slave_0x%08x", connection_info->access_address);
|
||||
g_snprintf(str_addr_dst, str_addr_len, "Master_0x%08x", connection_info->access_address);
|
||||
snprintf(str_addr_src, str_addr_len, "Slave_0x%08x", connection_info->access_address);
|
||||
snprintf(str_addr_dst, str_addr_len, "Master_0x%08x", connection_info->access_address);
|
||||
set_address(&pinfo->dl_src, AT_ETHER, sizeof(connection_info->slave_bd_addr), connection_info->slave_bd_addr);
|
||||
set_address(&pinfo->dl_dst, AT_ETHER, sizeof(connection_info->master_bd_addr), connection_info->master_bd_addr);
|
||||
break;
|
||||
default:
|
||||
/* BTLE_DIR_UNKNOWN */
|
||||
g_snprintf(str_addr_src, str_addr_len, "Unknown_0x%08x", connection_info->access_address);
|
||||
g_snprintf(str_addr_dst, str_addr_len, "Unknown_0x%08x", connection_info->access_address);
|
||||
snprintf(str_addr_src, str_addr_len, "Unknown_0x%08x", connection_info->access_address);
|
||||
snprintf(str_addr_dst, str_addr_len, "Unknown_0x%08x", connection_info->access_address);
|
||||
clear_address(&pinfo->dl_src);
|
||||
clear_address(&pinfo->dl_dst);
|
||||
break;
|
||||
|
@ -3766,7 +3766,7 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
|||
sub_item = proto_tree_add_ether(btle_tree, hf_master_bd_addr, tvb, 0, 0, broadcastiso_connection_info->master_bd_addr);
|
||||
proto_item_set_generated(sub_item);
|
||||
|
||||
g_snprintf(str_addr_src, str_addr_len, "Master_0x%08x", broadcastiso_connection_info->access_address);
|
||||
snprintf(str_addr_src, str_addr_len, "Master_0x%08x", broadcastiso_connection_info->access_address);
|
||||
set_address(&pinfo->dl_src, AT_ETHER, sizeof(broadcastiso_connection_info->master_bd_addr), broadcastiso_connection_info->master_bd_addr);
|
||||
clear_address(&pinfo->dl_dst);
|
||||
|
||||
|
|
|
@ -3637,7 +3637,7 @@ static void
|
|||
format_publish_period(gchar *buf, guint32 value) {
|
||||
guint32 idx = (value & 0xC0 ) >> 6;
|
||||
guint32 val = (value & 0x3F ) * period_interval_multiplier[idx];
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u %s", val, period_interval_unit[idx]);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u %s", val, period_interval_unit[idx]);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3646,11 +3646,11 @@ format_transmit(gchar *buf, guint32 value) {
|
|||
guint32 ctr = (value & 0x07 );
|
||||
switch (ctr) {
|
||||
case 0:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "One transmissions");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "One transmissions");
|
||||
break;
|
||||
|
||||
default:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u transmissions at interval of %u ms", ctr, prd);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u transmissions at interval of %u ms", ctr, prd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3660,179 +3660,179 @@ format_retransmit(gchar *buf, guint32 value) {
|
|||
guint32 ctr = (value & 0x07 );
|
||||
switch (ctr) {
|
||||
case 0:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "No retransmissions");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "No retransmissions");
|
||||
break;
|
||||
|
||||
case 1:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "One retransmission after %u ms", prd);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "One retransmission after %u ms", prd);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u retransmissions at interval of %u ms", ctr, prd);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u retransmissions at interval of %u ms", ctr, prd);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
format_interval_steps(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u ms (%u)", (value + 1) * 10, value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u ms (%u)", (value + 1) * 10, value);
|
||||
}
|
||||
|
||||
static void
|
||||
format_key_index(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u (0x%03x)", value & 0xFFF, value & 0xFFF);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u (0x%03x)", value & 0xFFF, value & 0xFFF);
|
||||
}
|
||||
|
||||
static void
|
||||
format_key_index_rfu(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "0x%1x", (value & 0xF000) >> 12);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "0x%1x", (value & 0xF000) >> 12);
|
||||
}
|
||||
|
||||
static void
|
||||
format_dual_key_index(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u (0x%03x), %u (0x%03x)", value & 0xFFF, value & 0xFFF, ( value & 0xFFF000 ) >> 12, ( value & 0xFFF000 ) >> 12);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u (0x%03x), %u (0x%03x)", value & 0xFFF, value & 0xFFF, ( value & 0xFFF000 ) >> 12, ( value & 0xFFF000 ) >> 12);
|
||||
}
|
||||
|
||||
static void
|
||||
format_vendor_model(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "0x%04x of %s", value >> 16, val_to_str_ext_const(value & 0xFFFF, &bluetooth_company_id_vals_ext, "Unknown"));
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "0x%04x of %s", value >> 16, val_to_str_ext_const(value & 0xFFFF, &bluetooth_company_id_vals_ext, "Unknown"));
|
||||
}
|
||||
|
||||
static void
|
||||
format_publish_appkeyindex_model(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u (0x%03x) using %s security material", value & 0x0FFF, value & 0x0FFF, ((value & 0x1000) ? "Friendship" : "Master"));
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u (0x%03x) using %s security material", value & 0x0FFF, value & 0x0FFF, ((value & 0x1000) ? "Friendship" : "Master"));
|
||||
}
|
||||
|
||||
static void
|
||||
format_delay_ms(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u ms", value * 5);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u ms", value * 5);
|
||||
}
|
||||
|
||||
static void
|
||||
format_power(gchar *buf, guint32 value) {
|
||||
gdouble val;
|
||||
val = (gdouble)value / (gdouble)655.35;
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "% 3.2f %%", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "% 3.2f %%", val);
|
||||
}
|
||||
|
||||
static void
|
||||
format_battery_level(gchar *buf, guint32 value) {
|
||||
if (value == 0xFF) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "The percentage of the charge level is unknown");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "The percentage of the charge level is unknown");
|
||||
return;
|
||||
}
|
||||
if (value <= 0x64) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u %%", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u %%", value);
|
||||
return;
|
||||
}
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%u)", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%u)", value);
|
||||
}
|
||||
|
||||
static void
|
||||
format_battery_time(gchar *buf, guint32 value) {
|
||||
if (value == 0xFFFFFF) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "The remaining time is not known");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "The remaining time is not known");
|
||||
return;
|
||||
}
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u minutes", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u minutes", value);
|
||||
}
|
||||
|
||||
static void
|
||||
format_global_latitude(gchar *buf, gint32 value) {
|
||||
if (value == INT_MIN) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Global Latitude is not configured.");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Global Latitude is not configured.");
|
||||
return;
|
||||
}
|
||||
gdouble val;
|
||||
val = (gdouble)90.0 / (gdouble) (0x7FFFFFFF) * (gdouble)value ;
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "% 2.6f°", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "% 2.6f°", val);
|
||||
}
|
||||
|
||||
static void
|
||||
format_global_longitude(gchar *buf, gint32 value) {
|
||||
if (value == INT_MIN) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Global Longitude is not configured.");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Global Longitude is not configured.");
|
||||
return;
|
||||
}
|
||||
gdouble val;
|
||||
val = (gdouble)180.0 / (gdouble) (0x7FFFFFFF) * (gdouble)value;
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "% 2.6f°", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "% 2.6f°", val);
|
||||
}
|
||||
|
||||
static void
|
||||
format_global_altitude(gchar *buf, gint16 value) {
|
||||
if (value == 0x7FFF) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Global Altitude is not configured.");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Global Altitude is not configured.");
|
||||
return;
|
||||
}
|
||||
if (value == 0x7FFE) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Global Altitude is greater than or equal to 32766 meters.");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Global Altitude is greater than or equal to 32766 meters.");
|
||||
return;
|
||||
}
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d meters", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d meters", value);
|
||||
}
|
||||
|
||||
static void
|
||||
format_local_north(gchar *buf, gint16 value) {
|
||||
if (value == -32768) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Local North information is not configured.");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Local North information is not configured.");
|
||||
return;
|
||||
}
|
||||
gdouble val;
|
||||
val = (gdouble)value / (gdouble) 10.0;
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f meters", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.1f meters", val);
|
||||
}
|
||||
|
||||
static void
|
||||
format_local_east(gchar *buf, gint16 value) {
|
||||
if (value == -32768) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Local East information is not configured.");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Local East information is not configured.");
|
||||
return;
|
||||
}
|
||||
gdouble val;
|
||||
val = (gdouble)value / (gdouble) 10.0;
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f meters", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.1f meters", val);
|
||||
}
|
||||
|
||||
static void
|
||||
format_local_altitude(gchar *buf, gint16 value) {
|
||||
if (value == 0x7FFF) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Local Altitude is not configured.");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Local Altitude is not configured.");
|
||||
return;
|
||||
}
|
||||
if (value == 0x7FFE) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Local Altitude is greater than or equal to 3276.6 meters.");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Local Altitude is greater than or equal to 3276.6 meters.");
|
||||
return;
|
||||
}
|
||||
gdouble val;
|
||||
val = (gdouble)value / (gdouble) 10.0;
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f meters", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.1f meters", val);
|
||||
}
|
||||
|
||||
static void
|
||||
format_floor_number(gchar *buf, guint8 value) {
|
||||
switch (value) {
|
||||
case 0x00:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Floor -20 or any floor below -20.");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Floor -20 or any floor below -20.");
|
||||
break;
|
||||
|
||||
case 0xFC:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Floor 232 or any floor above 232.");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Floor 232 or any floor above 232.");
|
||||
break;
|
||||
|
||||
case 0xFD:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Ground floor. Floor 0.");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Ground floor. Floor 0.");
|
||||
break;
|
||||
|
||||
case 0xFE:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Ground floor. Floor 1.");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Ground floor. Floor 1.");
|
||||
break;
|
||||
|
||||
case 0xFF:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Not configured.");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Not configured.");
|
||||
break;
|
||||
|
||||
default:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", (gint16)value - (gint16)20 );
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d", (gint16)value - (gint16)20 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3841,46 +3841,46 @@ static void
|
|||
format_update_time(gchar *buf, guint16 value) {
|
||||
gdouble val;
|
||||
val = pow((gdouble)2.0, (gdouble)(value - 3));
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.*f seconds", (value<4?3-value:0), val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.*f seconds", (value<4?3-value:0), val);
|
||||
}
|
||||
|
||||
static void
|
||||
format_precision(gchar *buf, guint16 value) {
|
||||
gdouble val;
|
||||
val = pow((gdouble)2.0, (gdouble)(value - 3));
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.*f meters", (value<4?3-value:0),val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.*f meters", (value<4?3-value:0),val);
|
||||
}
|
||||
|
||||
static void
|
||||
format_scheduler_year(gchar *buf, gint32 value) {
|
||||
if (value <= 0x63) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", 2000+value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d", 2000+value);
|
||||
} else if (value == 0x64 ) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Any year");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Any year");
|
||||
} else {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
format_scheduler_day(gchar *buf, gint32 value) {
|
||||
if (value > 0x0) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d", value);
|
||||
} else {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Any day");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Any day");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
format_scheduler_hour(gchar *buf, gint32 value) {
|
||||
if (value < 24 ) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d", value);
|
||||
} else if (value == 0x18 ) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Any hour of the day");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Any hour of the day");
|
||||
} else if (value == 0x19 ) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Once a day (at a random hour)");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Once a day (at a random hour)");
|
||||
} else {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3888,23 +3888,23 @@ static void
|
|||
format_scheduler_minute(gchar *buf, gint32 value) {
|
||||
switch (value) {
|
||||
case 0x3C:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Any minute of the hour");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Any minute of the hour");
|
||||
break;
|
||||
|
||||
case 0x3D:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Every 15 minutes (minute modulo 15 is 0) (0, 15, 30, 45)");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Every 15 minutes (minute modulo 15 is 0) (0, 15, 30, 45)");
|
||||
break;
|
||||
|
||||
case 0x3E:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Every 20 minutes (minute modulo 20 is 0) (0, 20, 40)");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Every 20 minutes (minute modulo 20 is 0) (0, 20, 40)");
|
||||
break;
|
||||
|
||||
case 0x3F:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Once an hour (at a random minute)");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Once an hour (at a random minute)");
|
||||
break;
|
||||
|
||||
default:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d", value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3913,23 +3913,23 @@ static void
|
|||
format_scheduler_second(gchar *buf, gint32 value) {
|
||||
switch (value) {
|
||||
case 0x3C:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Any second of the minute");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Any second of the minute");
|
||||
break;
|
||||
|
||||
case 0x3D:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Every 15 seconds (second modulo 15 is 0) (0, 15, 30, 45)");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Every 15 seconds (second modulo 15 is 0) (0, 15, 30, 45)");
|
||||
break;
|
||||
|
||||
case 0x3E:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Every 20 seconds (second modulo 20 is 0) (0, 20, 40)");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Every 20 seconds (second modulo 20 is 0) (0, 20, 40)");
|
||||
break;
|
||||
|
||||
case 0x3F:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Once a minute (at a random second)");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Once a minute (at a random second)");
|
||||
break;
|
||||
|
||||
default:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d", value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3938,23 +3938,23 @@ static void
|
|||
format_scheduler_action(gchar *buf, gint32 value) {
|
||||
switch (value) {
|
||||
case 0x0:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Turn Off");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Turn Off");
|
||||
break;
|
||||
|
||||
case 0x1:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Turn On");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Turn On");
|
||||
break;
|
||||
|
||||
case 0x2:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Scene Recall");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Scene Recall");
|
||||
break;
|
||||
|
||||
case 0xF:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Inactive");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Inactive");
|
||||
break;
|
||||
|
||||
default:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Reserved for Future Use");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Reserved for Future Use");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -4008,28 +4008,28 @@ format_scheduler_day_of_week(gchar *buf, gint32 value) {
|
|||
|
||||
static void
|
||||
format_subsecond_ms(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f ms", (gdouble)value / 0.256);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.1f ms", (gdouble)value / 0.256);
|
||||
}
|
||||
|
||||
static void
|
||||
format_uncertainty_ms(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u ms", value * 10);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u ms", value * 10);
|
||||
}
|
||||
|
||||
static void
|
||||
format_tai_utc_delta_s(gchar *buf, guint32 value) {
|
||||
gint32 val = (gint32)value - 255;
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d s", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d s", val);
|
||||
}
|
||||
|
||||
static void
|
||||
format_time_zone_offset_h(gchar *buf, guint32 value) {
|
||||
gint32 val = (gint32)value - 64;
|
||||
if (val >= 0) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%+d:%02d", val/4, (val%4)*15 );
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%+d:%02d", val/4, (val%4)*15 );
|
||||
} else {
|
||||
val *=-1;
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "-%d:%02d", val/4, (val%4)*15 );
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "-%d:%02d", val/4, (val%4)*15 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4037,7 +4037,7 @@ static void
|
|||
format_tai_to_utc_date(gchar *buf, guint64 value) {
|
||||
|
||||
if (value == 0 ) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Unknown");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Unknown");
|
||||
} else {
|
||||
gchar *time_str;
|
||||
time_t val;
|
||||
|
@ -4063,49 +4063,49 @@ format_tai_to_utc_date(gchar *buf, guint64 value) {
|
|||
// 32 leap seconds difference between TAI and UTC on 1.1.2000
|
||||
val = (time_t)(value + 946684800ll - 32ll - delta);
|
||||
time_str = abs_time_secs_to_str(NULL, val, ABSOLUTE_TIME_UTC, TRUE);
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%s", time_str);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%s", time_str);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
format_temperature_kelvin(gchar *buf, guint32 value) {
|
||||
if (value < 0x0320 ) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value);
|
||||
} else if (value > 0x4E20 ) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value);
|
||||
} else {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d K", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d K", value);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
format_temperature_kelvin_unknown(gchar *buf, guint32 value) {
|
||||
if (value < 0x0320 ) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value);
|
||||
} else if (value > 0x4E20 && value != 0xFFFF) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value);
|
||||
} else if (value == 0xFFFF ) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Unknown");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Unknown");
|
||||
} else {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d K", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d K", value);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
format_light_lightness_prohibited(gchar *buf, guint32 value) {
|
||||
if (value == 0x0 ) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value);
|
||||
} else {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d", value);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
format_light_lightness_default(gchar *buf, guint32 value) {
|
||||
if (value == 0x0 ) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Use the Light Lightness Last value");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Use the Light Lightness Last value");
|
||||
} else {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d", value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4113,25 +4113,25 @@ static void
|
|||
format_hsl_hue(gchar *buf, guint32 value) {
|
||||
gdouble val;
|
||||
val = (gdouble)360.0 / (gdouble) (0x10000) * (gdouble)value;
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "% 3.3f°", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "% 3.3f°", val);
|
||||
}
|
||||
|
||||
static void
|
||||
format_xyl_coordinate(gchar *buf, guint32 value) {
|
||||
gdouble val;
|
||||
val = (gdouble)value / (gdouble) (0xFFFF);
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%1.5f", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%1.5f", val);
|
||||
}
|
||||
|
||||
static void
|
||||
format_sensor_setting_access(gchar *buf, guint32 value)
|
||||
{
|
||||
if (value == 0x01 ) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be read");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Can be read");
|
||||
} else if (value == 0x03) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be read and written");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Can be read and written");
|
||||
} else {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4139,10 +4139,10 @@ static void
|
|||
format_fast_cadence_period_divisor(gchar *buf, guint32 value)
|
||||
{
|
||||
if (value > 15) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
} else {
|
||||
guint32 v = (1 << value);
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", v);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d", v);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4150,10 +4150,10 @@ static void
|
|||
format_status_min_interval(gchar *buf, guint32 value)
|
||||
{
|
||||
if (value > 26) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
} else {
|
||||
guint32 v = (1 << value);
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d ms", v);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d ms", v);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4162,23 +4162,23 @@ format_admin_user_access(gchar *buf, guint32 value)
|
|||
{
|
||||
switch (value) {
|
||||
case 0x0:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Not a Generic User Property");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Not a Generic User Property");
|
||||
break;
|
||||
|
||||
case 0x1:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be read");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Can be read");
|
||||
break;
|
||||
|
||||
case 0x2:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be written");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Can be written");
|
||||
break;
|
||||
|
||||
case 0x3:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be read and written");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Can be read and written");
|
||||
break;
|
||||
|
||||
default:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -4187,11 +4187,11 @@ static void
|
|||
format_manufacturer_user_access(gchar *buf, guint32 value)
|
||||
{
|
||||
if (value == 0x00) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Not a Generic User Property");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Not a Generic User Property");
|
||||
} else if (value == 0x01) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be read");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Can be read");
|
||||
} else {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4200,19 +4200,19 @@ format_user_access(gchar *buf, guint32 value)
|
|||
{
|
||||
switch (value) {
|
||||
case 0x1:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be read");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Can be read");
|
||||
break;
|
||||
|
||||
case 0x2:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be written");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Can be written");
|
||||
break;
|
||||
|
||||
case 0x3:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be read and written");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Can be read and written");
|
||||
break;
|
||||
|
||||
default:
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -4221,11 +4221,11 @@ static void
|
|||
format_sensor_descriptor_tolerance(gchar *buf, guint32 value)
|
||||
{
|
||||
if (value == 0x000) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Unspecified");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Unspecified");
|
||||
} else {
|
||||
gdouble val;
|
||||
val = (gdouble)value / (gdouble)40.95;
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "% 3.2f %%", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "% 3.2f %%", val);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4233,22 +4233,22 @@ static void
|
|||
format_sensor_period(gchar *buf, guint32 value)
|
||||
{
|
||||
if (value == 0) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Not Applicable");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Not Applicable");
|
||||
} else {
|
||||
gdouble val;
|
||||
|
||||
val = pow((gdouble)1.1, (gdouble)value - (gdouble)64.0);
|
||||
if ( val < 1.0 ) { //Milliseconds
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.0f ms", val * 1000.0);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.0f ms", val * 1000.0);
|
||||
} else {
|
||||
if ( val < 60.0 ) { //Seconds
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f s", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.1f s", val);
|
||||
} else {
|
||||
gulong v = (gulong)val;
|
||||
if ( val < 86400 ) { //Hours:Minutes:Seconds
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%02lu:%02lu:%02lu", v/3600, (v % 3600)/60, v % 60);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%02lu:%02lu:%02lu", v/3600, (v % 3600)/60, v % 60);
|
||||
} else { //Days Hours:Minutes:Seconds
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%lu days %02lu:%02lu:%02lu", v/86400, (v % 86400)/3600, (v % 3600)/60, v % 60);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%lu days %02lu:%02lu:%02lu", v/86400, (v % 86400)/3600, (v % 3600)/60, v % 60);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4260,21 +4260,21 @@ format_percentage_change_16(gchar *buf, guint32 value)
|
|||
{
|
||||
gdouble val;
|
||||
val = (gdouble)value / (gdouble)(100);
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.2f %%", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.2f %%", val);
|
||||
}
|
||||
|
||||
static void
|
||||
format_decihour_8(gchar *buf, guint32 value)
|
||||
{
|
||||
if (value == 0xFF) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
} else {
|
||||
if (value > 240) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
} else {
|
||||
gdouble val;
|
||||
val = (gdouble)value / (gdouble)(10);
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f h", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.1f h", val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4283,11 +4283,11 @@ static void
|
|||
format_temperature_8(gchar *buf, gint32 value)
|
||||
{
|
||||
if (value == 0x7F) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
} else {
|
||||
gdouble val;
|
||||
val = (gdouble)value * (gdouble)(0.5);
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f C", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.1f C", val);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4295,14 +4295,14 @@ static void
|
|||
format_temperature(gchar *buf, gint32 value)
|
||||
{
|
||||
if (value == INT16_MIN ) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
} else {
|
||||
if (value < (gint32)(-27315)) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited");
|
||||
} else {
|
||||
gdouble val;
|
||||
val = (gdouble)value / (gdouble)(100);
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.2f C", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.2f C", val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4311,11 +4311,11 @@ static void
|
|||
format_electric_current(gchar *buf, guint32 value)
|
||||
{
|
||||
if (value == 0xFFFF) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
} else {
|
||||
gdouble val;
|
||||
val = (gdouble)value / (gdouble)(100);
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.2f A", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.2f A", val);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4323,73 +4323,73 @@ static void
|
|||
format_energy(gchar *buf, guint32 value)
|
||||
{
|
||||
if (value == 0xFFFFFF) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
} else {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d kWh", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d kWh", value);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
format_illuminance(gchar *buf, guint32 value) {
|
||||
if (value == 0xFFFFFF) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
} else {
|
||||
gdouble val;
|
||||
val = (gdouble)value / (gdouble)(100);
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.2f lux", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.2f lux", val);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
format_percentage_8(gchar *buf, guint32 value) {
|
||||
if (value == 0xFF) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
} else if (value > 200) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value);
|
||||
} else {
|
||||
gdouble val;
|
||||
val = (gdouble)value / (gdouble)(2);
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f %%", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.1f %%", val);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
format_time_millisecond_24(gchar *buf, guint32 value) {
|
||||
if (value == 0xFFFFFF) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
} else {
|
||||
gdouble val;
|
||||
val = (gdouble)value / (gdouble)(1000);
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.2f s", val);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.2f s", val);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
format_count_16(gchar *buf, guint32 value) {
|
||||
if (value == 0xFFFF) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
} else {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d", value);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
format_boolean(gchar *buf, guint32 value) {
|
||||
if (value == 0x00) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "False");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "False");
|
||||
} else if (value == 0x01) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "True");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "True");
|
||||
} else {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
format_time_second_16(gchar *buf, guint32 value) {
|
||||
if (value == 0xFFFF) {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known");
|
||||
} else {
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%d s", value);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%d s", value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -260,9 +260,9 @@ static void btrfcomm_directed_channel_prompt(packet_info *pinfo, gchar* result)
|
|||
|
||||
value_data = (guint8 *) p_get_proto_data(pinfo->pool, pinfo, proto_btrfcomm, PROTO_DATA_BTRFCOMM_DIRECTED_CHANNEL);
|
||||
if (value_data)
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "RFCOMM Channel %d (direction: %u) as", (guint) (*value_data) >> 1, (guint) (*value_data) & 1);
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "RFCOMM Channel %d (direction: %u) as", (guint) (*value_data) >> 1, (guint) (*value_data) & 1);
|
||||
else
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown RFCOMM Channel");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown RFCOMM Channel");
|
||||
}
|
||||
|
||||
static gpointer btrfcomm_directed_channel_value(packet_info *pinfo)
|
||||
|
|
|
@ -3071,7 +3071,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
|
|||
proto_tree_add_item(next_tree, hf_bip_total_imaging_data_capacity, tvb, offset, 8, ENC_BIG_ENDIAN);
|
||||
value_64 = tvb_get_ntoh64(tvb, offset);
|
||||
|
||||
wmem_strbuf_append_printf(info_buf, "%"G_GUINT64_FORMAT, value_64);
|
||||
wmem_strbuf_append_printf(info_buf, "%"PRIu64, value_64);
|
||||
break;
|
||||
default:
|
||||
found = FALSE;
|
||||
|
|
|
@ -992,7 +992,7 @@ dissect_bscvlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
|
|||
if ((bvlc_control & BSCVLC_CONTROL_ORIG_ADDRESS) != 0)
|
||||
{
|
||||
for(idx = 0; idx < 6; idx++)
|
||||
g_snprintf(&mac_buffer[idx * 2], sizeof(mac_buffer) - (idx * 2), "%02X", tvb_get_guint8(tvb, offset + idx));
|
||||
snprintf(&mac_buffer[idx * 2], sizeof(mac_buffer) - (idx * 2), "%02X", tvb_get_guint8(tvb, offset + idx));
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " SMAC %s", mac_buffer);
|
||||
|
||||
proto_tree_add_item(bvlc_tree, hf_bscvlc_orig_vmac, tvb, offset, 6, ENC_NA);
|
||||
|
@ -1002,7 +1002,7 @@ dissect_bscvlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
|
|||
if ((bvlc_control & BSCVLC_CONTROL_DEST_ADDRESS) != 0)
|
||||
{
|
||||
for(idx = 0; idx < 6; idx++)
|
||||
g_snprintf(&mac_buffer[idx * 2], sizeof(mac_buffer) - (idx * 2), "%02X", tvb_get_guint8(tvb, offset + idx));
|
||||
snprintf(&mac_buffer[idx * 2], sizeof(mac_buffer) - (idx * 2), "%02X", tvb_get_guint8(tvb, offset + idx));
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " DMAC %s", mac_buffer);
|
||||
|
||||
proto_tree_add_item(bvlc_tree, hf_bscvlc_dest_vmac, tvb, offset, 6, ENC_NA);
|
||||
|
|
|
@ -4579,7 +4579,7 @@ static int dissect_c15ch_echo_cancel(tvbuff_t *tvb, packet_info *pinfo _U_, prot
|
|||
loop_val = tvb_get_ntohl( tvb, 23 );
|
||||
slot_val = tvb_get_ntohl( tvb, 27 );
|
||||
loc_string = (char *) wmem_alloc0(wmem_packet_scope(), MAX_LEN_LOC_STRING); /* init to all NULL */
|
||||
g_snprintf( loc_string, MAX_LEN_LOC_STRING, "%d %d %d %d", pm_val, pc_val, loop_val, slot_val );
|
||||
snprintf( loc_string, MAX_LEN_LOC_STRING, "%d %d %d %d", pm_val, pc_val, loop_val, slot_val );
|
||||
ti = proto_tree_add_string(c15ch_echo_cancel_tree, hf_c15ch_echo_cancel_location, tvb, 15, (27 + 4 - 15) + 1, loc_string);
|
||||
loc_tree = proto_item_add_subtree (ti, ett_c15ch_second_level_sub4);
|
||||
|
||||
|
@ -4777,55 +4777,55 @@ static int dissect_c15ch_nitnxlate(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
if ( ( site_str_len > 1 ) && ( subsite_str_len > 1 ) && ( equipname_str_len > 1 ) )
|
||||
{
|
||||
/* 1) none of site, subsite, or equip is null */
|
||||
g_snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s %s ", site_string, subsite_string, equipname_string );
|
||||
snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s %s ", site_string, subsite_string, equipname_string );
|
||||
}
|
||||
else
|
||||
if ( ( site_str_len < 2 ) && ( subsite_str_len > 1 ) && ( equipname_str_len > 1 ) )
|
||||
{
|
||||
/* 2) only site is null */
|
||||
g_snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s ", subsite_string, equipname_string );
|
||||
snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s ", subsite_string, equipname_string );
|
||||
}
|
||||
else
|
||||
if ( ( site_str_len > 1 ) && ( subsite_str_len < 2 ) && ( equipname_str_len > 1 ) )
|
||||
{
|
||||
/* 3) only subsite is null */
|
||||
g_snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s ", site_string, equipname_string);
|
||||
snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s ", site_string, equipname_string);
|
||||
}
|
||||
else
|
||||
if ( ( site_str_len > 1 ) && ( subsite_str_len > 1 ) && ( equipname_str_len < 2 ) )
|
||||
{
|
||||
/* 4) only equip is null */
|
||||
g_snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s ", site_string, subsite_string);
|
||||
snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s ", site_string, subsite_string);
|
||||
}
|
||||
else
|
||||
if ( ( site_str_len < 2 ) && ( subsite_str_len < 2 ) && ( equipname_str_len > 1 ) )
|
||||
{
|
||||
/* 5) site and subsite are null but equip is non-null */
|
||||
g_snprintf( desc_string, MAX_LEN_DESC_STRING, "%s ", equipname_string );
|
||||
snprintf( desc_string, MAX_LEN_DESC_STRING, "%s ", equipname_string );
|
||||
}
|
||||
else
|
||||
if ( ( site_str_len < 2 ) && ( subsite_str_len > 1 ) && ( equipname_str_len < 2 ) )
|
||||
{
|
||||
/* 6) site and equip are null but subsite is not-null */
|
||||
g_snprintf( desc_string, MAX_LEN_DESC_STRING, "%s ", subsite_string );
|
||||
snprintf( desc_string, MAX_LEN_DESC_STRING, "%s ", subsite_string );
|
||||
}
|
||||
else
|
||||
if ( ( site_str_len > 1 ) && ( subsite_str_len < 2 ) && ( equipname_str_len < 2 ) )
|
||||
{
|
||||
/* 7) subsite and equip are null but site is not-null */
|
||||
g_snprintf( desc_string, MAX_LEN_DESC_STRING, "%s ", site_string );
|
||||
snprintf( desc_string, MAX_LEN_DESC_STRING, "%s ", site_string );
|
||||
}
|
||||
/* else site, subsite, equip are all null */
|
||||
if ( key_val )
|
||||
{
|
||||
if ( strlen( desc_string ) )
|
||||
{
|
||||
g_snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d %d %d %d %d",
|
||||
snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d %d %d %d %d",
|
||||
desc_string, frame_val, shelf_val, lsg_val, unit_val, key_val );
|
||||
}
|
||||
else
|
||||
{
|
||||
g_snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%d %d %d %d %d",
|
||||
snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%d %d %d %d %d",
|
||||
frame_val, shelf_val, lsg_val, unit_val, key_val );
|
||||
}
|
||||
}
|
||||
|
@ -4836,23 +4836,23 @@ static int dissect_c15ch_nitnxlate(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
if ( (g_strcmp0( "VLIN", equipname_string) == 0) ||
|
||||
(g_strcmp0( "PTRK", equipname_string) == 0) )
|
||||
{
|
||||
g_snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d",
|
||||
snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d",
|
||||
desc_string, frame_val );
|
||||
}
|
||||
else
|
||||
if ( (g_strcmp0( "GWE", equipname_string ) == 0) ||
|
||||
(g_strcmp0( "IDE", equipname_string ) == 0) )
|
||||
{
|
||||
g_snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d %d",
|
||||
snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d %d",
|
||||
desc_string, frame_val, shelf_val );
|
||||
}
|
||||
else
|
||||
g_snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d %d %d %d",
|
||||
snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d %d %d %d",
|
||||
desc_string, frame_val, shelf_val, lsg_val, unit_val);
|
||||
} /* if ( strlen( desc_string ) ) */
|
||||
else
|
||||
{
|
||||
g_snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%d %d %d %d",
|
||||
snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%d %d %d %d",
|
||||
frame_val, shelf_val, lsg_val, unit_val);
|
||||
}
|
||||
}
|
||||
|
@ -5055,7 +5055,7 @@ static int dissect_c15ch_ntwk_conn(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
from_loop_val = tvb_get_guint8( tvb, 10 );
|
||||
from_slot_val = tvb_get_guint8( tvb, 11 );
|
||||
from_loc_string = (char *) wmem_alloc0(wmem_packet_scope(), MAX_LEN_LOC_STRING); /* init to all NULL */
|
||||
g_snprintf( from_loc_string, MAX_LEN_LOC_STRING, "%d %d %d %d", from_pm_val, from_pc_val, from_loop_val, from_slot_val );
|
||||
snprintf( from_loc_string, MAX_LEN_LOC_STRING, "%d %d %d %d", from_pm_val, from_pc_val, from_loop_val, from_slot_val );
|
||||
ti = proto_tree_add_string(c15ch_ntwk_conn_tree, hf_c15ch_ntwk_conn_fromlocation, tvb, 8, (11 - 8) + 1,
|
||||
from_loc_string);
|
||||
old_loc_tree = proto_item_add_subtree (ti, ett_c15ch_second_level_sub1);
|
||||
|
@ -5096,7 +5096,7 @@ static int dissect_c15ch_ntwk_conn(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
to_loop_val = tvb_get_guint8( tvb, 33 );
|
||||
to_slot_val = tvb_get_guint8( tvb, 34 );
|
||||
to_loc_string = (char *) wmem_alloc0(wmem_packet_scope(), MAX_LEN_LOC_STRING); /* init to all NULL */
|
||||
g_snprintf( to_loc_string, MAX_LEN_LOC_STRING, "%d %d %d %d", to_pm_val, to_pc_val, to_loop_val, to_slot_val );
|
||||
snprintf( to_loc_string, MAX_LEN_LOC_STRING, "%d %d %d %d", to_pm_val, to_pc_val, to_loop_val, to_slot_val );
|
||||
ti = proto_tree_add_string(c15ch_ntwk_conn_tree, hf_c15ch_ntwk_conn_tolocation, tvb, 31, (34 - 31) + 1,
|
||||
to_loc_string);
|
||||
new_loc_tree = proto_item_add_subtree (ti, ett_c15ch_second_level_sub3);
|
||||
|
|
|
@ -2101,11 +2101,11 @@ static void dissect_tty_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
|
|||
int hex_string_length = 1+(2*tty_string_length)+1;
|
||||
hex_string = (char *)wmem_alloc(pinfo->pool, hex_string_length);
|
||||
|
||||
idx = g_snprintf(hex_string, hex_string_length, "$");
|
||||
idx = snprintf(hex_string, hex_string_length, "$");
|
||||
|
||||
/* Write hex out to new string */
|
||||
for (n=0; n < tty_string_length; n++) {
|
||||
idx += g_snprintf(hex_string+idx, 3, "%02x",
|
||||
idx += snprintf(hex_string+idx, 3, "%02x",
|
||||
tvb_get_guint8(tvb, offset+n));
|
||||
}
|
||||
string = hex_string;
|
||||
|
@ -3181,7 +3181,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
|
|||
if (protocol_handle == 0) {
|
||||
/* TODO: only look inside if a preference enabled? */
|
||||
char dotted_protocol_name[128];
|
||||
/* N.B. avoiding g_snprintf(), which was slow */
|
||||
/* N.B. avoiding snprintf(), which was slow */
|
||||
(void) g_strlcpy(dotted_protocol_name, "dct2000.", 128);
|
||||
(void) g_strlcpy(dotted_protocol_name+8, protocol_name, 128-8);
|
||||
protocol_handle = find_dissector(dotted_protocol_name);
|
||||
|
|
|
@ -306,7 +306,7 @@ dissect_cbor_byte_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *cbor_tre
|
|||
}
|
||||
if (length > G_MAXINT32 || *offset + (gint)length < *offset) {
|
||||
expert_add_info_format(pinfo, cbor_tree, &ei_cbor_too_long_length,
|
||||
"the length (%" G_GUINT64_FORMAT ") of the byte string too long", length);
|
||||
"the length (%" PRIu64 ") of the byte string too long", length);
|
||||
return NULL;
|
||||
}
|
||||
item = proto_tree_add_item(cbor_tree, hf_cbor_type_byte_string, tvb, *offset, (gint)length, ENC_BIG_ENDIAN|ENC_NA);
|
||||
|
@ -381,7 +381,7 @@ dissect_cbor_text_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *cbor_tre
|
|||
}
|
||||
if (length > G_MAXINT32 || *offset + (gint)length < *offset) {
|
||||
expert_add_info_format(pinfo, cbor_tree, &ei_cbor_too_long_length,
|
||||
"the length (%" G_GUINT64_FORMAT ") of the text string too long", length);
|
||||
"the length (%" PRIu64 ") of the text string too long", length);
|
||||
return NULL;
|
||||
}
|
||||
item = proto_tree_add_item(cbor_tree, hf_cbor_type_text_string, tvb, *offset, (gint)length, ENC_BIG_ENDIAN|ENC_UTF_8);
|
||||
|
@ -442,7 +442,7 @@ dissect_cbor_array(tvbuff_t *tvb, packet_info *pinfo, proto_tree *cbor_tree, gin
|
|||
tvb, orig_offset, -1, "Array", "(undefined elements)");
|
||||
} else {
|
||||
item = proto_tree_add_string_format_value(cbor_tree, hf_cbor_type_array,
|
||||
tvb, orig_offset, -1, "Array", "(%"G_GINT64_MODIFIER"u elements)", length);
|
||||
tvb, orig_offset, -1, "Array", "(%"PRIu64" elements)", length);
|
||||
}
|
||||
subtree = proto_item_add_subtree(item, ett_cbor_array);
|
||||
|
||||
|
@ -518,7 +518,7 @@ dissect_cbor_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *cbor_tree, gint
|
|||
tvb, orig_offset, -1, "Map", "(undefined entries)");
|
||||
} else {
|
||||
item = proto_tree_add_string_format_value(cbor_tree, hf_cbor_type_map,
|
||||
tvb, orig_offset, -1, "Map", "(%"G_GINT64_MODIFIER"u entries)", length);
|
||||
tvb, orig_offset, -1, "Map", "(%"PRIu64" entries)", length);
|
||||
}
|
||||
subtree = proto_item_add_subtree(item, ett_cbor_map);
|
||||
|
||||
|
|
|
@ -1088,7 +1088,7 @@ static const guint8* decrypt_data_security_data( wmem_allocator_t *pool, const g
|
|||
|
||||
gchar* output = info->output_text;
|
||||
gint output_max = sizeof info->output_text;
|
||||
g_snprintf( output, output_max, "with " );
|
||||
snprintf( output, output_max, "with " );
|
||||
while( *output ) { ++output; --output_max; }
|
||||
|
||||
// Try keys from keyring.XML
|
||||
|
@ -1107,7 +1107,7 @@ static const guint8* decrypt_data_security_data( wmem_allocator_t *pool, const g
|
|||
|
||||
if( decrypted )
|
||||
{
|
||||
g_snprintf( output, output_max, "GA " );
|
||||
snprintf( output, output_max, "GA " );
|
||||
while( *output ) { ++output; --output_max; }
|
||||
break;
|
||||
}
|
||||
|
@ -1129,7 +1129,7 @@ static const guint8* decrypt_data_security_data( wmem_allocator_t *pool, const g
|
|||
|
||||
if( decrypted )
|
||||
{
|
||||
g_snprintf( output, output_max, "dest IA " );
|
||||
snprintf( output, output_max, "dest IA " );
|
||||
while( *output ) { ++output; --output_max; }
|
||||
break;
|
||||
}
|
||||
|
@ -1152,7 +1152,7 @@ static const guint8* decrypt_data_security_data( wmem_allocator_t *pool, const g
|
|||
|
||||
if( decrypted )
|
||||
{
|
||||
g_snprintf( output, output_max, "source IA " );
|
||||
snprintf( output, output_max, "source IA " );
|
||||
while( *output ) { ++output; --output_max; }
|
||||
break;
|
||||
}
|
||||
|
@ -1182,17 +1182,17 @@ static const guint8* decrypt_data_security_data( wmem_allocator_t *pool, const g
|
|||
{
|
||||
guint8 count;
|
||||
|
||||
g_snprintf( output, output_max, "key" );
|
||||
snprintf( output, output_max, "key" );
|
||||
|
||||
for( count = 16; count; --count )
|
||||
{
|
||||
while( *output ) { ++output; --output_max; }
|
||||
g_snprintf( output, output_max, " %02X", *key++ );
|
||||
snprintf( output, output_max, " %02X", *key++ );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_snprintf( info->output_text, sizeof info->output_text, keys_found ? "failed" : "no keys found" );
|
||||
snprintf( info->output_text, sizeof info->output_text, keys_found ? "failed" : "no keys found" );
|
||||
}
|
||||
|
||||
return decrypted;
|
||||
|
@ -1712,8 +1712,8 @@ static void dissect_memory_ext_service( tvbuff_t* tvb, packet_info* pinfo, proto
|
|||
|
||||
/* 3 bytes Memory Address */
|
||||
guint32 x = tvb_get_guint24( tvb, offset + 1, ENC_BIG_ENDIAN );
|
||||
col_append_fstr( cinfo, COL_INFO, " X=$%06" G_GINT32_MODIFIER "X", x );
|
||||
proto_item_append_text( cemi_node, ", X=$%06" G_GINT32_MODIFIER "X", x );
|
||||
col_append_fstr( cinfo, COL_INFO, " X=$%06" PRIX32, x );
|
||||
proto_item_append_text( cemi_node, ", X=$%06" PRIX32, x );
|
||||
|
||||
if( is_response )
|
||||
{
|
||||
|
@ -2355,7 +2355,7 @@ static void dissect_data_security_service( tvbuff_t* tvb, packet_info* pinfo, pr
|
|||
{
|
||||
if( ia_seq->seq > seq_nr )
|
||||
{
|
||||
expert_add_info_format( pinfo, node, KIP_ERROR, "Expected: min $%012" G_GINT64_MODIFIER "X", ia_seq->seq );
|
||||
expert_add_info_format( pinfo, node, KIP_ERROR, "Expected: min $%012" PRIX64, ia_seq->seq );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2888,7 +2888,7 @@ static void dissect_cemi_transport_layer( tvbuff_t* tvb, packet_info* pinfo, pro
|
|||
name = try_val_to_str( tc, tc_vals );
|
||||
if( !name )
|
||||
{
|
||||
g_snprintf( text, sizeof text, "TC=%u", tc );
|
||||
snprintf( text, sizeof text, "TC=%u", tc );
|
||||
name = text;
|
||||
}
|
||||
col_append_fstr( cinfo, COL_INFO, " %s", name );
|
||||
|
@ -3192,7 +3192,7 @@ static void dissect_cemi_link_layer( tvbuff_t* tvb, packet_info* pinfo, proto_tr
|
|||
guint8 hc = (c & 0x70) >> 4; /* Hop Count */
|
||||
guint8 eff = c & 0x0F; /* Extended Frame Format (0 = standard) */
|
||||
|
||||
g_snprintf( text, sizeof text, "%u", (c & 0x70) >> 4 ); /* hop count */
|
||||
snprintf( text, sizeof text, "%u", (c & 0x70) >> 4 ); /* hop count */
|
||||
proto_item_append_text( cemi_node, ", H=%u", hc );
|
||||
node = proto_tree_add_none_format( cemi_list, hf_folder, tvb, offset, 1, "Ctrl2: Hops = %u", hc );
|
||||
if( eff )
|
||||
|
@ -3220,7 +3220,7 @@ static void dissect_cemi_link_layer( tvbuff_t* tvb, packet_info* pinfo, proto_tr
|
|||
else
|
||||
{
|
||||
source_addr = tvb_get_ntohs( tvb, offset );
|
||||
g_snprintf( text, sizeof text, "%u.%u.%u", (source_addr >> 12) & 0xF, (source_addr >> 8) & 0xF, source_addr & 0xFF );
|
||||
snprintf( text, sizeof text, "%u.%u.%u", (source_addr >> 12) & 0xF, (source_addr >> 8) & 0xF, source_addr & 0xFF );
|
||||
col_append_fstr( cinfo, COL_INFO, " %s", text );
|
||||
if( tree )
|
||||
{
|
||||
|
@ -3247,12 +3247,12 @@ static void dissect_cemi_link_layer( tvbuff_t* tvb, packet_info* pinfo, proto_tr
|
|||
if( unicast )
|
||||
{
|
||||
/* Individual Address */
|
||||
g_snprintf( text, sizeof text, "%u.%u.%u", (dest_addr >> 12) & 0xF, (dest_addr >> 8) & 0xF, dest_addr & 0xFF );
|
||||
snprintf( text, sizeof text, "%u.%u.%u", (dest_addr >> 12) & 0xF, (dest_addr >> 8) & 0xF, dest_addr & 0xFF );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Group Address */
|
||||
g_snprintf( text, sizeof text, "%u/%u/%u", (dest_addr >> 11) & 0x1F, (dest_addr >> 8) & 0x7, dest_addr & 0xFF );
|
||||
snprintf( text, sizeof text, "%u/%u/%u", (dest_addr >> 11) & 0x1F, (dest_addr >> 8) & 0x7, dest_addr & 0xFF );
|
||||
}
|
||||
|
||||
col_append_fstr( cinfo, COL_INFO, "->%s", text );
|
||||
|
|
|
@ -1617,7 +1617,7 @@ void c_append_text(c_pkt_data *data, proto_item *ti, const char *fmt, ...)
|
|||
char buf[ITEM_LABEL_LENGTH];
|
||||
va_start(ap, fmt);
|
||||
|
||||
g_vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||
vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||
|
||||
proto_item_append_text(ti, "%s", buf);
|
||||
proto_item_append_text(data->item_root, "%s", buf);
|
||||
|
@ -1787,7 +1787,7 @@ guint c_dissect_blob(proto_tree *root, int hf, int hf_data, int hf_len,
|
|||
ti = proto_tree_add_item(root, hf, tvb, off, size+4, ENC_NA);
|
||||
tree = proto_item_add_subtree(ti, ett_data);
|
||||
|
||||
proto_item_append_text(ti, ", Size: %"G_GINT32_MODIFIER"u", size);
|
||||
proto_item_append_text(ti, ", Size: %"PRIu32, size);
|
||||
if (size)
|
||||
{
|
||||
proto_item_append_text(ti, ", Data: %s",
|
||||
|
@ -1924,7 +1924,7 @@ guint c_dissect_sockaddr(proto_tree *root, c_sockaddr *out,
|
|||
}
|
||||
off += C_SIZE_SOCKADDR_STORAGE; /* Skip over sockaddr_storage. */
|
||||
|
||||
d.str = wmem_strdup_printf(wmem_packet_scope(), "%s:%"G_GINT16_MODIFIER"u",
|
||||
d.str = wmem_strdup_printf(wmem_packet_scope(), "%s:%"PRIu16,
|
||||
d.addr_str,
|
||||
d.port);
|
||||
proto_item_append_text(ti, ": %s", d.str);
|
||||
|
@ -2015,7 +2015,7 @@ guint c_dissect_entityname(proto_tree *root, int hf, c_entityname *out,
|
|||
}
|
||||
else
|
||||
{
|
||||
d.slug = wmem_strdup_printf(wmem_packet_scope(), "%s%"G_GINT64_MODIFIER"u",
|
||||
d.slug = wmem_strdup_printf(wmem_packet_scope(), "%s%"PRIu64,
|
||||
d.type_str,
|
||||
d.id);
|
||||
}
|
||||
|
@ -2330,8 +2330,8 @@ guint c_dissect_eversion(proto_tree *root, gint hf,
|
|||
off += 4;
|
||||
|
||||
proto_item_append_text(ti,
|
||||
", Version: %"G_GINT64_MODIFIER"d"
|
||||
", Epoch: %"G_GINT32_MODIFIER"d",
|
||||
", Version: %"PRId64
|
||||
", Epoch: %"PRId32,
|
||||
ver, epoch);
|
||||
|
||||
proto_item_set_end(ti, tvb, off);
|
||||
|
@ -2354,7 +2354,7 @@ guint c_dissect_object_locator(proto_tree *root, gint hf,
|
|||
|
||||
off = c_dissect_encoded(tree, &enchdr, 3, 6, tvb, off, data);
|
||||
|
||||
proto_item_append_text(ti, ", Pool: %"G_GINT64_MODIFIER"d",
|
||||
proto_item_append_text(ti, ", Pool: %"PRId64,
|
||||
tvb_get_letohi64(tvb, off));
|
||||
proto_tree_add_item(tree, hf_pool, tvb, off, 8, ENC_LITTLE_ENDIAN);
|
||||
off += 8;
|
||||
|
@ -2382,7 +2382,7 @@ guint c_dissect_object_locator(proto_tree *root, gint hf,
|
|||
if (hash >= 0)
|
||||
{
|
||||
proto_tree_add_item(tree, hf_hash, tvb, off, 8, ENC_LITTLE_ENDIAN);
|
||||
proto_item_append_text(ti, ", Hash: %"G_GINT64_MODIFIER"d", hash);
|
||||
proto_item_append_text(ti, ", Hash: %"PRId64, hash);
|
||||
}
|
||||
off += 8;
|
||||
}
|
||||
|
@ -2420,19 +2420,19 @@ guint c_dissect_pg(proto_tree *root, gint hf,
|
|||
c_warn_ver(ti2, ver, 1, 1, data);
|
||||
off += 1;
|
||||
|
||||
proto_item_append_text(ti, ", Pool: %"G_GINT64_MODIFIER"d",
|
||||
proto_item_append_text(ti, ", Pool: %"PRId64,
|
||||
tvb_get_letoh64(tvb, off));
|
||||
proto_tree_add_item(tree, hf_pgid_pool, tvb, off, 8, ENC_LITTLE_ENDIAN);
|
||||
off += 8;
|
||||
|
||||
proto_item_append_text(ti, ", Seed: %08"G_GINT32_MODIFIER"X",
|
||||
proto_item_append_text(ti, ", Seed: %08"PRIX32,
|
||||
tvb_get_letohl(tvb, off));
|
||||
proto_tree_add_item(tree, hf_pgid_seed, tvb, off, 4, ENC_LITTLE_ENDIAN);
|
||||
off += 4;
|
||||
|
||||
preferred = tvb_get_letohl(tvb, off);
|
||||
if (preferred >= 0)
|
||||
proto_item_append_text(ti, ", Prefer: %"G_GINT32_MODIFIER"d", preferred);
|
||||
proto_item_append_text(ti, ", Prefer: %"PRId32, preferred);
|
||||
proto_tree_add_item(tree, hf_pgid_preferred, tvb, off, 4, ENC_LITTLE_ENDIAN);
|
||||
off += 4;
|
||||
|
||||
|
@ -2501,7 +2501,7 @@ guint c_dissect_path(proto_tree *root, gint hf,
|
|||
off = c_dissect_str(tree, hf_path_rel, &rel, tvb, off);
|
||||
|
||||
if (inode)
|
||||
proto_item_append_text(ti, ", Inode: 0x%016"G_GINT64_MODIFIER"u", inode);
|
||||
proto_item_append_text(ti, ", Inode: 0x%016"PRIu64, inode);
|
||||
if (rel.size)
|
||||
proto_item_append_text(ti, ", Rel: \"%s\"", rel.str);
|
||||
|
||||
|
@ -2558,7 +2558,7 @@ guint c_dissect_mds_release(proto_tree *root, gint hf,
|
|||
|
||||
off = c_dissect_str(tree, hf_mds_release_dname, NULL, tvb, off);
|
||||
|
||||
proto_item_append_text(ti, ", Inode: 0x%016"G_GINT64_MODIFIER"u", inode);
|
||||
proto_item_append_text(ti, ", Inode: 0x%016"PRIu64, inode);
|
||||
|
||||
proto_item_set_end(ti, tvb, off);
|
||||
return off;
|
||||
|
@ -2654,7 +2654,7 @@ guint c_dissect_snapinfo(proto_tree *root,
|
|||
|
||||
off = c_dissect_str(tree, hf_snapinfo_name, &name, tvb, off);
|
||||
|
||||
proto_item_set_text(ti, ", ID: 0x%016"G_GINT64_MODIFIER"X"
|
||||
proto_item_set_text(ti, ", ID: 0x%016"PRIX64
|
||||
", Name: %s, Date: %s",
|
||||
id,
|
||||
name.str,
|
||||
|
@ -3025,12 +3025,12 @@ guint c_dissect_featureset(proto_tree *root, int hf,
|
|||
|
||||
off = c_dissect_str(subtree, hf_featureset_name_name, &name, tvb, off);
|
||||
|
||||
proto_item_append_text(ti2, ", Value: %"G_GINT64_MODIFIER"u, Name: %s",
|
||||
proto_item_append_text(ti2, ", Value: %"PRIu64", Name: %s",
|
||||
val, name.str);
|
||||
proto_item_set_end(ti2, tvb, off);
|
||||
}
|
||||
|
||||
proto_item_append_text(ti, ", Features: 0x%016"G_GINT64_MODIFIER"X", features);
|
||||
proto_item_append_text(ti, ", Features: 0x%016"PRIX64, features);
|
||||
proto_item_set_end(ti, tvb, off);
|
||||
return off;
|
||||
}
|
||||
|
@ -3112,8 +3112,8 @@ guint c_dissect_osd_superblock(proto_tree *root,
|
|||
tvb, off, 4, ENC_LITTLE_ENDIAN);
|
||||
off += 4;
|
||||
|
||||
proto_item_append_text(ti, ", Role: %"G_GINT32_MODIFIER"d, Weight: %lf"
|
||||
", Boot Epoch: %"G_GINT32_MODIFIER"d",
|
||||
proto_item_append_text(ti, ", Role: %"PRId32", Weight: %lf"
|
||||
", Boot Epoch: %"PRId32,
|
||||
role, weight, epoch);
|
||||
if (enc.version >= 4)
|
||||
{
|
||||
|
@ -3424,7 +3424,7 @@ guint c_dissect_osdmap(proto_tree *root,
|
|||
|
||||
off = c_dissect_pgpool(pooltree, tvb, off, data);
|
||||
|
||||
proto_item_append_text(poolti, ", ID: 0x%016"G_GINT64_MODIFIER"X", id);
|
||||
proto_item_append_text(poolti, ", ID: 0x%016"PRIX64, id);
|
||||
|
||||
proto_item_set_end(poolti, tvb, off);
|
||||
}
|
||||
|
@ -3450,7 +3450,7 @@ guint c_dissect_osdmap(proto_tree *root,
|
|||
off = c_dissect_str(nametree, hf_osdmap_poolname, &name, tvb, off);
|
||||
|
||||
proto_item_append_text(nameti,
|
||||
", ID: 0x%016"G_GINT64_MODIFIER"X, Name: %s",
|
||||
", ID: 0x%016"PRIX64", Name: %s",
|
||||
id, name.str);
|
||||
proto_item_set_end(nameti, tvb, off);
|
||||
}
|
||||
|
@ -3866,11 +3866,11 @@ guint c_dissect_osd_op(proto_tree *root, gint hf, c_osd_op *out,
|
|||
proto_tree_add_item(tree, hf_osd_op_extent_trunc_seq,
|
||||
tvb, off+24, 4, ENC_LITTLE_ENDIAN);
|
||||
|
||||
proto_item_append_text(ti, ", Offset: %"G_GINT64_MODIFIER"u"
|
||||
", Size: %"G_GINT64_MODIFIER"u",
|
||||
proto_item_append_text(ti, ", Offset: %"PRIu64
|
||||
", Size: %"PRIu64,
|
||||
offset, size);
|
||||
if (trunc_seq)
|
||||
proto_item_append_text(ti, ", Truncate To: %"G_GINT64_MODIFIER"u",
|
||||
proto_item_append_text(ti, ", Truncate To: %"PRIu64,
|
||||
trunc_size);
|
||||
break;
|
||||
default:
|
||||
|
@ -3881,7 +3881,7 @@ guint c_dissect_osd_op(proto_tree *root, gint hf, c_osd_op *out,
|
|||
off += 28;
|
||||
|
||||
d.payload_size = tvb_get_letohl(tvb, off);
|
||||
proto_item_append_text(ti, ", Data Length: %"G_GINT32_MODIFIER"d",
|
||||
proto_item_append_text(ti, ", Data Length: %"PRId32,
|
||||
d.payload_size);
|
||||
proto_tree_add_item(tree, hf_osd_op_payload_size,
|
||||
tvb, off, 4, ENC_LITTLE_ENDIAN);
|
||||
|
@ -4444,7 +4444,7 @@ guint c_dissect_msg_mon_sub(proto_tree *root,
|
|||
|
||||
c_append_text(data, ti, "%s%s", str.str, len? ",":"");
|
||||
|
||||
proto_item_append_text(subti, " What: %s, Starting: %"G_GUINT64_FORMAT,
|
||||
proto_item_append_text(subti, " What: %s, Starting: %"PRIu64,
|
||||
str.str,
|
||||
tvb_get_letoh64(tvb, off));
|
||||
|
||||
|
@ -4675,7 +4675,7 @@ guint c_dissect_msg_mon_getversion(proto_tree *root,
|
|||
off = c_dissect_str(tree, hf_msg_mon_getversion_what, &what, tvb, off);
|
||||
|
||||
|
||||
c_append_text(data, ti, ", TID: %"G_GINT64_MODIFIER"u, What: %s",
|
||||
c_append_text(data, ti, ", TID: %"PRIu64", What: %s",
|
||||
tid, what.str);
|
||||
|
||||
return off;
|
||||
|
@ -4719,9 +4719,9 @@ guint c_dissect_msg_mon_getversionreply(proto_tree *root,
|
|||
tvb, off, 8, ENC_LITTLE_ENDIAN);
|
||||
off += 8;
|
||||
|
||||
c_append_text(data, ti, ", TID: %"G_GINT64_MODIFIER"u"
|
||||
", Version: %"G_GINT64_MODIFIER"u"
|
||||
", Oldest Version: %"G_GINT64_MODIFIER"u",
|
||||
c_append_text(data, ti, ", TID: %"PRIu64
|
||||
", Version: %"PRIu64
|
||||
", Oldest Version: %"PRIu64,
|
||||
tid, ver, veroldest);
|
||||
|
||||
return off;
|
||||
|
@ -4927,8 +4927,8 @@ guint c_dissect_msg_client_reqfwd(proto_tree *root,
|
|||
tvb, off, 1, ENC_LITTLE_ENDIAN);
|
||||
off += 1;
|
||||
|
||||
c_append_text(data, ti, ", To: mds%"G_GINT32_MODIFIER"u, Resend: %s, "
|
||||
"Forwards: %"G_GINT32_MODIFIER"u",
|
||||
c_append_text(data, ti, ", To: mds%"PRIu32", Resend: %s, "
|
||||
"Forwards: %"PRIu32,
|
||||
to, resend? "True":"False", fwd);
|
||||
|
||||
return off;
|
||||
|
@ -5032,7 +5032,7 @@ guint c_dissect_msg_osd_map(proto_tree *root,
|
|||
|
||||
off = c_dissect_osdmap_inc(subtree, tvb, off, data);
|
||||
|
||||
proto_item_append_text(ti2, ", For Epoch: %"G_GINT32_MODIFIER"u", epoch);
|
||||
proto_item_append_text(ti2, ", For Epoch: %"PRIu32, epoch);
|
||||
proto_item_set_end(ti2, tvb, off);
|
||||
}
|
||||
|
||||
|
@ -5055,7 +5055,7 @@ guint c_dissect_msg_osd_map(proto_tree *root,
|
|||
|
||||
off = c_dissect_osdmap(subtree, tvb, off, data);
|
||||
|
||||
proto_item_append_text(ti2, ", For Epoch: %"G_GINT32_MODIFIER"u", epoch);
|
||||
proto_item_append_text(ti2, ", For Epoch: %"PRIu32, epoch);
|
||||
proto_item_set_end(ti2, tvb, off);
|
||||
}
|
||||
|
||||
|
@ -5118,7 +5118,7 @@ guint c_dissect_msg_osd_op(proto_tree *root,
|
|||
off = c_dissect_str(tree, hf_msg_osd_op_oid, &str, tvb, off);
|
||||
|
||||
opslen = tvb_get_letohs(tvb, off);
|
||||
c_append_text(data, ti, ", Operations: %"G_GINT32_MODIFIER"d", opslen);
|
||||
c_append_text(data, ti, ", Operations: %"PRId32, opslen);
|
||||
ti2 = proto_tree_add_item(tree, hf_msg_osd_op_ops_len,
|
||||
tvb, off, 2, ENC_LITTLE_ENDIAN);
|
||||
off += 2;
|
||||
|
@ -5329,7 +5329,7 @@ guint c_dissect_msg_poolopreply(proto_tree *root,
|
|||
hf_msg_poolopreply_data, hf_msg_poolopreply_data_size,
|
||||
tvb, off);
|
||||
|
||||
c_append_text(data, ti, ", Response Code: %"G_GINT32_MODIFIER"u", code);
|
||||
c_append_text(data, ti, ", Response Code: %"PRIu32, code);
|
||||
|
||||
return off;
|
||||
}
|
||||
|
@ -5402,7 +5402,7 @@ guint c_dissect_msg_poolop(proto_tree *root,
|
|||
}
|
||||
|
||||
c_append_text(data, ti,
|
||||
", Type: %s, Name: %s, Pool: %"G_GINT32_MODIFIER"d",
|
||||
", Type: %s, Name: %s, Pool: %"PRId32,
|
||||
c_poolop_type_string(type),
|
||||
name.str,
|
||||
pool);
|
||||
|
@ -5782,11 +5782,11 @@ guint c_dissect_msg_mon_paxos(proto_tree *root,
|
|||
hf_msg_mon_paxos_val_data, hf_msg_mon_paxos_val_size,
|
||||
tvb, off);
|
||||
|
||||
proto_item_append_text(ti2, ", Version: %"G_GINT64_MODIFIER"u", ver);
|
||||
proto_item_append_text(ti2, ", Version: %"PRIu64, ver);
|
||||
proto_item_set_end(ti2, tvb, off);
|
||||
}
|
||||
|
||||
c_append_text(data, ti, ", Op: %s, Proposal Number: %"G_GINT64_MODIFIER"u",
|
||||
c_append_text(data, ti, ", Op: %s, Proposal Number: %"PRIu64,
|
||||
c_mon_paxos_op_string(op), pn);
|
||||
|
||||
return off;
|
||||
|
@ -6194,8 +6194,8 @@ guint c_dissect_msg_client_caps(proto_tree *root,
|
|||
tvb, front_len, middle_len, ENC_NA);
|
||||
|
||||
proto_item_append_text(ti, ", Op: %s"
|
||||
", Inode: 0x%016"G_GINT64_MODIFIER"X"
|
||||
", Relam: 0x%"G_GINT64_MODIFIER"X",
|
||||
", Inode: 0x%016"PRIX64
|
||||
", Relam: 0x%"PRIX64,
|
||||
c_cap_op_type_string(op),
|
||||
inode, relam);
|
||||
|
||||
|
@ -6222,7 +6222,7 @@ guint c_dissect_msg_client_caprel(proto_tree *root,
|
|||
tree = proto_item_add_subtree(ti, ett_msg_client_caprel);
|
||||
|
||||
i = (c_cap_op_type)tvb_get_letohl(tvb, off);
|
||||
proto_item_append_text(ti, ", Caps: %"G_GINT32_MODIFIER"u", i);
|
||||
proto_item_append_text(ti, ", Caps: %"PRIu32, i);
|
||||
off += 4;
|
||||
while (i--)
|
||||
{
|
||||
|
@ -6287,8 +6287,8 @@ guint c_dissect_msg_timecheck(proto_tree *root,
|
|||
tvb, off, 8, ENC_LITTLE_ENDIAN);
|
||||
off += 8;
|
||||
|
||||
c_append_text(data, ti, ", Operation: %s, Epoch: %"G_GINT64_MODIFIER"u"
|
||||
", Round: %"G_GINT64_MODIFIER"u",
|
||||
c_append_text(data, ti, ", Operation: %s, Epoch: %"PRIu64
|
||||
", Round: %"PRIu64,
|
||||
c_timecheck_op_string(op),
|
||||
epoch, round);
|
||||
|
||||
|
@ -6865,7 +6865,7 @@ guint c_dissect_pdu(proto_tree *root,
|
|||
break;
|
||||
case C_STATE_SEQ:
|
||||
c_set_type(data, "Sequence Number");
|
||||
proto_item_append_text(data->item_root, ", Seq: %"G_GINT64_MODIFIER"u",
|
||||
proto_item_append_text(data->item_root, ", Seq: %"PRIu64,
|
||||
tvb_get_letoh64(tvb, off));
|
||||
proto_tree_add_item(tree, hf_seq_new, tvb, off, 8, ENC_LITTLE_ENDIAN);
|
||||
off += 8;
|
||||
|
|
|
@ -2951,7 +2951,7 @@ static const value_string cip_run_idle_vals[] = {
|
|||
|
||||
void cip_rpi_api_fmt(gchar *s, guint32 value)
|
||||
{
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%.3fms", value / 1000.0);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%.3fms", value / 1000.0);
|
||||
}
|
||||
|
||||
static void add_cip_class_to_info_column(packet_info *pinfo, guint32 class_id, int display_type)
|
||||
|
|
|
@ -880,7 +880,7 @@ dissect_coap_options_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *coap_tr
|
|||
return -1;
|
||||
}
|
||||
|
||||
g_snprintf(strbuf, sizeof(strbuf),
|
||||
snprintf(strbuf, sizeof(strbuf),
|
||||
"#%u: %s", opt_count, val_to_str(*opt_num, vals_opt_type,
|
||||
*opt_num % 14 == 0 ? "No-Op" : "Unknown Option (%d)"));
|
||||
item = proto_tree_add_string(coap_tree, dissect_hf->hf.opt_name,
|
||||
|
@ -889,7 +889,7 @@ dissect_coap_options_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *coap_tr
|
|||
|
||||
coap_opt_check(pinfo, subtree, *opt_num, opt_length, dissect_hf);
|
||||
|
||||
g_snprintf(strbuf, sizeof(strbuf),
|
||||
snprintf(strbuf, sizeof(strbuf),
|
||||
"Type %u, %s, %s%s", *opt_num,
|
||||
(*opt_num & 1) ? "Critical" : "Elective",
|
||||
(*opt_num & 2) ? "Unsafe" : "Safe",
|
||||
|
@ -1095,7 +1095,7 @@ dissect_coap_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *coap_tree, p
|
|||
coap_ctype_str_dis = coinfo->ctype_str;
|
||||
}
|
||||
|
||||
g_snprintf(str_payload, sizeof(str_payload),
|
||||
snprintf(str_payload, sizeof(str_payload),
|
||||
"Payload Content-Format: %s%s, Length: %u",
|
||||
coinfo->ctype_str, coinfo->ctype_value == DEFAULT_COAP_CTYPE_VALUE ?
|
||||
" (no Content-Format)" : "", payload_length);
|
||||
|
|
|
@ -481,7 +481,7 @@ dissect_collectd_integer (tvbuff_t *tvb, packet_info *pinfo, gint type_hf,
|
|||
else
|
||||
{
|
||||
pt = proto_tree_add_subtree_format(tree_root, tvb, offset, length,
|
||||
ett_collectd_integer, &pi, "collectd %s segment: %"G_GINT64_MODIFIER"u",
|
||||
ett_collectd_integer, &pi, "collectd %s segment: %"PRIu64,
|
||||
val_to_str_const (type, part_names, "UNKNOWN"),
|
||||
*ret_value);
|
||||
}
|
||||
|
@ -542,7 +542,7 @@ dissect_collectd_values(tvbuff_t *tvb, gint msg_off, gint val_cnt,
|
|||
val64 = tvb_get_ntoh64 (tvb, value_offset);
|
||||
value_tree = proto_tree_add_subtree_format(values_tree, tvb, msg_off + 6,
|
||||
val_cnt * 9, ett_collectd_valinfo, NULL,
|
||||
"Counter: %"G_GINT64_MODIFIER"u", val64);
|
||||
"Counter: %"PRIu64, val64);
|
||||
|
||||
proto_tree_add_item (value_tree, hf_collectd_val_type,
|
||||
tvb, value_type_offset, 1, ENC_BIG_ENDIAN);
|
||||
|
@ -577,7 +577,7 @@ dissect_collectd_values(tvbuff_t *tvb, gint msg_off, gint val_cnt,
|
|||
val64 = tvb_get_ntoh64 (tvb, value_offset);
|
||||
value_tree = proto_tree_add_subtree_format(values_tree, tvb, msg_off + 6,
|
||||
val_cnt * 9, ett_collectd_valinfo, NULL,
|
||||
"Derive: %"G_GINT64_MODIFIER"i", val64);
|
||||
"Derive: %"PRIi64, val64);
|
||||
|
||||
proto_tree_add_item (value_tree, hf_collectd_val_type,
|
||||
tvb, value_type_offset, 1, ENC_BIG_ENDIAN);
|
||||
|
@ -594,7 +594,7 @@ dissect_collectd_values(tvbuff_t *tvb, gint msg_off, gint val_cnt,
|
|||
val64 = tvb_get_ntoh64 (tvb, value_offset);
|
||||
value_tree = proto_tree_add_subtree_format(values_tree, tvb, msg_off + 6,
|
||||
val_cnt * 9, ett_collectd_valinfo, NULL,
|
||||
"Absolute: %"G_GINT64_MODIFIER"u", val64);
|
||||
"Absolute: %"PRIu64, val64);
|
||||
|
||||
proto_tree_add_item (value_tree, hf_collectd_val_type,
|
||||
tvb, value_type_offset, 1, ENC_BIG_ENDIAN);
|
||||
|
@ -611,7 +611,7 @@ dissect_collectd_values(tvbuff_t *tvb, gint msg_off, gint val_cnt,
|
|||
val64 = tvb_get_ntoh64 (tvb, value_offset);
|
||||
value_tree = proto_tree_add_subtree_format(values_tree, tvb, msg_off + 6,
|
||||
val_cnt * 9, ett_collectd_valinfo, NULL,
|
||||
"Unknown: %"G_GINT64_MODIFIER"x",
|
||||
"Unknown: %"PRIx64,
|
||||
val64);
|
||||
|
||||
proto_tree_add_item (value_tree, hf_collectd_val_type,
|
||||
|
@ -1241,7 +1241,7 @@ dissect_collectd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
|
|||
{
|
||||
proto_item_set_text (pi,
|
||||
"collectd SEVERITY segment: "
|
||||
"%s (%"G_GINT64_MODIFIER"u)",
|
||||
"%s (%"PRIu64")",
|
||||
val64_to_str_const (ndispatch.severity, severity_names, "UNKNOWN"),
|
||||
ndispatch.severity);
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ static void communityid_sha1_dbg(const gchar *msg, const void* data, gsize len)
|
|||
gsize i;
|
||||
|
||||
for (i = 0; i < len; i++, ptr += 2) {
|
||||
g_snprintf(ptr, 3, "%02x", ((guchar*)data)[i]);
|
||||
snprintf(ptr, 3, "%02x", ((guchar*)data)[i]);
|
||||
}
|
||||
|
||||
fprintf(stderr, "Community ID dbg [%s]: %s\n", msg, buf);
|
||||
|
@ -379,7 +379,7 @@ static gboolean communityid_calc(communityid_cfg_t *cfg, guint8 proto,
|
|||
gsize len = strlen(CID_VERSION_PREFIX) + strlen(str) + 1;
|
||||
|
||||
*result = (gchar*) g_malloc(len);
|
||||
g_snprintf(*result, (gulong) len, "%s%s", CID_VERSION_PREFIX, str);
|
||||
snprintf(*result, (gulong) len, "%s%s", CID_VERSION_PREFIX, str);
|
||||
g_free(str);
|
||||
} else {
|
||||
/* Convert binary SHA-1 to ASCII representation.
|
||||
|
@ -392,7 +392,7 @@ static gboolean communityid_calc(communityid_cfg_t *cfg, guint8 proto,
|
|||
memcpy(*result, CID_VERSION_PREFIX, strlen(CID_VERSION_PREFIX));
|
||||
ptr = *result + strlen(CID_VERSION_PREFIX);
|
||||
for (i = 0; i < sha1_buf_len; i++, ptr += 2) {
|
||||
g_snprintf(ptr, 3, "%02x", sha1_buf[i]);
|
||||
snprintf(ptr, 3, "%02x", sha1_buf[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3019,7 +3019,7 @@ info_to_display(tvbuff_t *tvb, proto_item *stt, int offset, int octets, const ch
|
|||
} else if (mode==FMT_DEC && octets==8) {
|
||||
code64 = tvb_get_ntoh64(tvb, offset);
|
||||
pi = proto_tree_add_uint64_format(stt, *hf_proto_parameter, tvb, offset, octets,
|
||||
code64, "%-28s : %" G_GINT64_MODIFIER "u", str, code64);
|
||||
code64, "%-28s : %" PRIu64, str, code64);
|
||||
} else {
|
||||
pi = proto_tree_add_uint_format(stt, *hf_proto_parameter,
|
||||
tvb, offset, octets, code32,"%s",str);
|
||||
|
@ -3062,7 +3062,7 @@ cops_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, guint8 op
|
|||
val_to_str(code16,table_cops_dqos_transaction_id, "Unknown (0x%04x)"),code16);
|
||||
|
||||
/* Write the right data into the 'info field' on the Gui */
|
||||
g_snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"),
|
||||
snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"),
|
||||
val_to_str_const(code16,table_cops_dqos_transaction_id, "Unknown"));
|
||||
|
||||
col_add_str(pinfo->cinfo, COL_INFO,info);
|
||||
|
@ -3448,7 +3448,7 @@ cops_mm_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, guint8
|
|||
val_to_str(code16,table_cops_mm_transaction_id, "Unknown (0x%04x)"),code16);
|
||||
|
||||
/* Write the right data into the 'info field' on the Gui */
|
||||
g_snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"),
|
||||
snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"),
|
||||
val_to_str_const(code16,table_cops_mm_transaction_id, "Unknown"));
|
||||
|
||||
col_add_str(pinfo->cinfo, COL_INFO,info);
|
||||
|
|
|
@ -320,7 +320,7 @@ dissect_corosync_totemsrp_memb_ring_id(tvbuff_t *tvb,
|
|||
rid = corosync_totemsrp_get_guint64(tvb, offset, encoding);
|
||||
offset += 8;
|
||||
|
||||
proto_item_append_text(item, " (ring: %" G_GINT64_MODIFIER "u)", rid);
|
||||
proto_item_append_text(item, " (ring: %" PRIu64 ")", rid);
|
||||
|
||||
if (node_id)
|
||||
*node_id = nid;
|
||||
|
@ -359,7 +359,7 @@ dissect_corosync_totemsrp_rtr_list(tvbuff_t *tvb,
|
|||
tvb, offset, 4, encoding);
|
||||
|
||||
seq = corosync_totemsrp_get_guint32(tvb, offset, encoding);
|
||||
proto_item_append_text(item, " (ring: %" G_GINT64_MODIFIER "u node: %u seq: %u)",
|
||||
proto_item_append_text(item, " (ring: %" PRIu64 " node: %u seq: %u)",
|
||||
ring_id, node_id, seq);
|
||||
offset += 4;
|
||||
|
||||
|
@ -432,7 +432,7 @@ dissect_corosync_totemsrp_orf_token(tvbuff_t *tvb,
|
|||
encoding);
|
||||
}
|
||||
|
||||
proto_item_append_text(item, " (ring: %" G_GINT64_MODIFIER "u node: %u nrtr: %d seq: %d au: %u)",
|
||||
proto_item_append_text(item, " (ring: %" PRIu64 " node: %u nrtr: %d seq: %d au: %u)",
|
||||
ring_id, node_id, rtr_list_entries, seq, aru);
|
||||
|
||||
proto_item_set_len(item, offset - original_offset);
|
||||
|
@ -513,7 +513,7 @@ dissect_corosync_totemsrp_mcast(tvbuff_t *tvb,
|
|||
&node_id,
|
||||
&ring_id);
|
||||
|
||||
proto_item_append_text(item, " (ring: %" G_GINT64_MODIFIER "u node: %u)",
|
||||
proto_item_append_text(item, " (ring: %" PRIu64 " node: %u)",
|
||||
ring_id, node_id);
|
||||
|
||||
proto_tree_add_item(tree, hf_corosync_totemsrp_mcast_node_id,
|
||||
|
@ -573,7 +573,7 @@ dissect_corosync_totemsrp_memb_merge_detect(tvbuff_t *tvb,
|
|||
&node_id,
|
||||
&ring_id);
|
||||
|
||||
proto_item_append_text(item, " (ring: %" G_GINT64_MODIFIER "u node: %u)",
|
||||
proto_item_append_text(item, " (ring: %" PRIu64 " node: %u)",
|
||||
ring_id, node_id);
|
||||
|
||||
proto_item_set_len(item, offset - original_offset);
|
||||
|
@ -751,7 +751,7 @@ dissect_corosync_totemsrp_memb_commit_token(tvbuff_t *tvb,
|
|||
NULL);
|
||||
}
|
||||
|
||||
proto_item_append_text(item, " (ring: %" G_GINT64_MODIFIER "u node: %u seq: %u entries: %u)",
|
||||
proto_item_append_text(item, " (ring: %" PRIu64 " node: %u seq: %u entries: %u)",
|
||||
ring_id, node_id, seq, addr_entries);
|
||||
|
||||
proto_item_set_len(item, offset - original_offset);
|
||||
|
@ -780,7 +780,7 @@ dissect_corosync_totemsrp_token_hold_cancel(tvbuff_t *tvb,
|
|||
&node_id,
|
||||
&ring_id);
|
||||
|
||||
proto_item_append_text(item, " (ring: %" G_GINT64_MODIFIER "u node: %u)",
|
||||
proto_item_append_text(item, " (ring: %" PRIu64 " node: %u)",
|
||||
ring_id, node_id);
|
||||
|
||||
proto_item_set_len(item, offset - original_offset);
|
||||
|
|
|
@ -366,7 +366,7 @@ static void dissect_header_pair(dissector_table_t dis_table, cose_header_context
|
|||
if (label) {
|
||||
key.label = ctx->label =
|
||||
g_variant_new_int64(*label);
|
||||
label_str = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT64_FORMAT, *label);
|
||||
label_str = wmem_strdup_printf(wmem_packet_scope(), "%" PRId64, *label);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -706,7 +706,7 @@ static int dissect_cose_msg_tagged(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
if (!dissector) {
|
||||
continue;
|
||||
}
|
||||
g_log(LOG_DOMAIN, G_LOG_LEVEL_INFO, "main dissector using tag %" G_GUINT64_FORMAT, tag->value);
|
||||
g_log(LOG_DOMAIN, G_LOG_LEVEL_INFO, "main dissector using tag %" PRIu64, tag->value);
|
||||
int sublen = call_dissector_only(dissector, tvb, pinfo, tree, tag);
|
||||
if (sublen > 0) {
|
||||
return sublen;
|
||||
|
|
|
@ -181,7 +181,7 @@ dissect_cpfi_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
src_board = tda >> 4;
|
||||
src_port = tda & 0x0f;
|
||||
src = (1 << 24) + (src_instance << 16) + (src_board << 8) + src_port;
|
||||
g_snprintf(src_str, sizeof(src_str), "%u.%u.%u", src_instance, src_board, src_port);
|
||||
snprintf(src_str, sizeof(src_str), "%u.%u.%u", src_instance, src_board, src_port);
|
||||
}
|
||||
|
||||
/* Figure out where the frame is going. srcTDA is destination of frame! */
|
||||
|
@ -203,7 +203,7 @@ dissect_cpfi_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
dst_board = tda >> 4;
|
||||
dst_port = tda & 0x0f;
|
||||
dst = (1 << 24) + (dst_instance << 16) + (dst_board << 8) + dst_port;
|
||||
g_snprintf(dst_str, sizeof(dst_str), "%u.%u.%u", dst_instance, dst_board, dst_port);
|
||||
snprintf(dst_str, sizeof(dst_str), "%u.%u.%u", dst_instance, dst_board, dst_port);
|
||||
}
|
||||
|
||||
/* Set up the source and destination and arrow per user configuration. */
|
||||
|
|
|
@ -670,7 +670,7 @@ dissect_feature_options(proto_tree *dccp_options_tree, tvbuff_t *tvb,
|
|||
case 5: /* Ack Ratio */
|
||||
|
||||
if (option_len > 0) /* could be empty Confirm */
|
||||
proto_item_append_text(dccp_item, " %" G_GUINT64_FORMAT "",
|
||||
proto_item_append_text(dccp_item, " %" PRIu64,
|
||||
dccp_ntoh_var(tvb, offset, option_len));
|
||||
break;
|
||||
|
||||
|
@ -1049,7 +1049,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
|
|||
if((dccp_relative_seq) && (dccpd->fwd->static_flags & DCCP_S_BASE_SEQ_SET)) {
|
||||
seq = dccph->seq - dccpd->fwd->base_seq;
|
||||
proto_tree_add_uint64_format_value(dccp_tree, hf_dccp_seq, tvb, offset, 6,
|
||||
seq, "%" G_GUINT64_FORMAT " (relative sequence number)", seq);
|
||||
seq, "%" PRIu64 " (relative sequence number)", seq);
|
||||
}
|
||||
else {
|
||||
seq = dccph->seq;
|
||||
|
@ -1069,7 +1069,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
|
|||
if((dccp_relative_seq) && (dccpd->fwd->static_flags & DCCP_S_BASE_SEQ_SET)) {
|
||||
seq = (dccph->seq - dccpd->fwd->base_seq) & 0xffffff;
|
||||
proto_tree_add_uint64_format_value(dccp_tree, hf_dccp_seq, tvb, offset, 3,
|
||||
seq, "%" G_GUINT64_FORMAT " (relative sequence number)", seq);
|
||||
seq, "%" PRIu64 " (relative sequence number)", seq);
|
||||
}
|
||||
else {
|
||||
seq = dccph->seq;
|
||||
|
@ -1077,9 +1077,9 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
|
|||
offset += 3;
|
||||
}
|
||||
if (dccp_summary_in_tree) {
|
||||
proto_item_append_text(dccp_item, " Seq=%" G_GUINT64_FORMAT "", seq);
|
||||
proto_item_append_text(dccp_item, " Seq=%" PRIu64, seq);
|
||||
}
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " Seq=%" G_GUINT64_FORMAT "", seq);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " Seq=%" PRIu64, seq);
|
||||
|
||||
/* dissecting type dependent additional fields */
|
||||
switch (dccph->type) {
|
||||
|
@ -1137,7 +1137,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
|
|||
}
|
||||
proto_tree_add_uint64(dccp_tree, hf_dccp_ack_abs, tvb, offset + 2, 6, dccph->ack);
|
||||
}
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" G_GUINT64_FORMAT ")", ack);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" PRIu64 ")", ack);
|
||||
offset += 8; /* move offset past the Acknowledgement Number Subheader */
|
||||
|
||||
dccph->service_code = tvb_get_ntohl(tvb, offset);
|
||||
|
@ -1189,11 +1189,11 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
|
|||
if (tree) {
|
||||
if((dccp_relative_seq) && (dccpd->rev->static_flags & DCCP_S_BASE_SEQ_SET)) {
|
||||
proto_tree_add_uint64_format_value(dccp_tree, hf_dccp_ack, tvb, offset + 2, 6,
|
||||
ack, "%" G_GUINT64_FORMAT " (relative acknowledgement number)", ack);
|
||||
ack, "%" PRIu64 " (relative acknowledgement number)", ack);
|
||||
}
|
||||
proto_tree_add_uint64(dccp_tree, hf_dccp_ack_abs, tvb, offset + 2, 6, dccph->ack);
|
||||
}
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" G_GUINT64_FORMAT ")", ack);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" PRIu64 ")", ack);
|
||||
offset += 8; /* move offset past the Ack Number Subheader */
|
||||
} else {
|
||||
if (advertised_dccp_header_len < offset + 4) {
|
||||
|
@ -1224,11 +1224,11 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
|
|||
if (tree) {
|
||||
if((dccp_relative_seq) && (dccpd->rev->static_flags & DCCP_S_BASE_SEQ_SET)) {
|
||||
proto_tree_add_uint64_format_value(dccp_tree, hf_dccp_ack, tvb, offset + 1, 3,
|
||||
ack, "%" G_GUINT64_FORMAT " (relative acknowledgement number)", ack);
|
||||
ack, "%" PRIu64 " (relative acknowledgement number)", ack);
|
||||
}
|
||||
proto_tree_add_uint64(dccp_tree, hf_dccp_ack_abs, tvb, offset + 1, 3, dccph->ack);
|
||||
}
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" G_GUINT64_FORMAT ")", ack);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" PRIu64 ")", ack);
|
||||
offset += 4; /* move offset past the Ack. Number Subheader */
|
||||
}
|
||||
break;
|
||||
|
@ -1262,11 +1262,11 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
|
|||
if (tree) {
|
||||
if((dccp_relative_seq) && (dccpd->rev->static_flags & DCCP_S_BASE_SEQ_SET)) {
|
||||
proto_tree_add_uint64_format_value(dccp_tree, hf_dccp_ack, tvb, offset + 1, 3,
|
||||
ack, "%" G_GUINT64_FORMAT " (relative acknowledgement number)", ack);
|
||||
ack, "%" PRIu64 " (relative acknowledgement number)", ack);
|
||||
}
|
||||
proto_tree_add_uint64(dccp_tree, hf_dccp_ack_abs, tvb, offset + 1, 3, dccph->ack);
|
||||
}
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" G_GUINT64_FORMAT ")", ack);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" PRIu64 ")", ack);
|
||||
offset += 8; /* move offset past the Ack. Number Subheader */
|
||||
|
||||
dccph->reset_code = tvb_get_guint8(tvb, offset);
|
||||
|
@ -1322,11 +1322,11 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
|
|||
if (tree) {
|
||||
if((dccp_relative_seq) && (dccpd->rev->static_flags & DCCP_S_BASE_SEQ_SET)) {
|
||||
proto_tree_add_uint64_format_value(dccp_tree, hf_dccp_ack, tvb, offset + 1, 3,
|
||||
ack, "%" G_GUINT64_FORMAT " (relative acknowledgement number)", ack);
|
||||
ack, "%" PRIu64 " (relative acknowledgement number)", ack);
|
||||
}
|
||||
proto_tree_add_uint64(dccp_tree, hf_dccp_ack_abs, tvb, offset + 1, 3, dccph->ack);
|
||||
}
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" G_GUINT64_FORMAT ")", ack);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" PRIu64 ")", ack);
|
||||
offset += 8; /* move offset past the Ack. Number Subheader */
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -447,7 +447,7 @@ epm_dissect_tower_data (tvbuff_t *tvb, int offset,
|
|||
static void
|
||||
epm_fmt_uuid_version( gchar *result, guint32 revision )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) );
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) );
|
||||
}
|
||||
|
||||
/* typedef struct {
|
||||
|
|
|
@ -69,16 +69,16 @@ PIDL_dissect_uint8_val(tvbuff_t *tvb, gint offset, packet_info *pinfo,
|
|||
switch (hf_info->display) {
|
||||
case BASE_DEC:
|
||||
if (hf_info->strings) {
|
||||
g_snprintf(valstr, 64, "%s(%d)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
snprintf(valstr, 64, "%s(%d)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
} else {
|
||||
g_snprintf(valstr, 64, "%d", val);
|
||||
snprintf(valstr, 64, "%d", val);
|
||||
}
|
||||
break;
|
||||
case BASE_HEX:
|
||||
if (hf_info->strings) {
|
||||
g_snprintf(valstr, 64, "%s(0x%02x)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
snprintf(valstr, 64, "%s(0x%02x)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
} else {
|
||||
g_snprintf(valstr, 64, "0x%02x", val);
|
||||
snprintf(valstr, 64, "0x%02x", val);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -157,16 +157,16 @@ PIDL_dissect_uint16_val(tvbuff_t *tvb, gint offset, packet_info *pinfo,
|
|||
switch (hf_info->display) {
|
||||
case BASE_DEC:
|
||||
if (hf_info->strings) {
|
||||
g_snprintf(valstr, 64, "%s(%d)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
snprintf(valstr, 64, "%s(%d)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
} else {
|
||||
g_snprintf(valstr, 64, "%d", val);
|
||||
snprintf(valstr, 64, "%d", val);
|
||||
}
|
||||
break;
|
||||
case BASE_HEX:
|
||||
if (hf_info->strings) {
|
||||
g_snprintf(valstr, 64, "%s(0x%04x)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
snprintf(valstr, 64, "%s(0x%04x)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
} else {
|
||||
g_snprintf(valstr, 64, "0x%04x", val);
|
||||
snprintf(valstr, 64, "0x%04x", val);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -284,16 +284,16 @@ PIDL_dissect_uint32_val(tvbuff_t *tvb, gint offset, packet_info *pinfo,
|
|||
switch (hf_info->display) {
|
||||
case BASE_DEC:
|
||||
if (hf_info->strings) {
|
||||
g_snprintf(valstr, 64, "%s(%d)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
snprintf(valstr, 64, "%s(%d)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
} else {
|
||||
g_snprintf(valstr, 64, "%d", val);
|
||||
snprintf(valstr, 64, "%d", val);
|
||||
}
|
||||
break;
|
||||
case BASE_HEX:
|
||||
if (hf_info->strings) {
|
||||
g_snprintf(valstr, 64, "%s(0x%08x)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
snprintf(valstr, 64, "%s(0x%08x)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
} else {
|
||||
g_snprintf(valstr, 64, "0x%08x", val);
|
||||
snprintf(valstr, 64, "0x%08x", val);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -400,16 +400,16 @@ PIDL_dissect_uint64_val(tvbuff_t *tvb, gint offset, packet_info *pinfo,
|
|||
switch (hf_info->display) {
|
||||
case BASE_DEC:
|
||||
if (hf_info->strings) {
|
||||
g_snprintf(valstr, 64, "%s(%" G_GINT64_MODIFIER "u)",val_to_str( (guint32) val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
snprintf(valstr, 64, "%s(%" PRIu64 ")",val_to_str( (guint32) val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
} else {
|
||||
g_snprintf(valstr, 64, "%" G_GINT64_MODIFIER "u", val);
|
||||
snprintf(valstr, 64, "%" PRIu64, val);
|
||||
}
|
||||
break;
|
||||
case BASE_HEX:
|
||||
if (hf_info->strings) {
|
||||
g_snprintf(valstr, 64, "%s(0x%" G_GINT64_MODIFIER "x)",val_to_str( (guint32) val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
snprintf(valstr, 64, "%s(0x%" PRIx64 ")",val_to_str( (guint32) val, (const value_string *)hf_info->strings, "Unknown:%u"), val);
|
||||
} else {
|
||||
g_snprintf(valstr, 64, "0x%" G_GINT64_MODIFIER "x", val);
|
||||
snprintf(valstr, 64, "0x%" PRIx64, val);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -878,7 +878,7 @@ dcerpc_prompt(packet_info *pinfo, gchar* result)
|
|||
g_string_append(str, "&\r\n");
|
||||
g_string_append_printf(str, "%s: %u\r\n", address_str->str, pinfo->destport);
|
||||
g_string_append_printf(str, "&\r\nContext ID: %u\r\n", decode_data->dcectxid);
|
||||
g_string_append_printf(str, "&\r\nSMB FID: %"G_GINT64_MODIFIER"u\r\n",
|
||||
g_string_append_printf(str, "&\r\nSMB FID: %"PRIu64"\r\n",
|
||||
dcerpc_get_transport_salt(pinfo));
|
||||
g_string_append(str, "with:\r\n");
|
||||
|
||||
|
|
|
@ -249,7 +249,7 @@ void dcom_interface_dump(void) {
|
|||
|
||||
for(objects = machine->objects; objects != NULL; objects = g_list_next(objects)) {
|
||||
object = (dcom_object_t *)objects->data;
|
||||
/*ws_warning(" Object(#%4u): OID:0x%" G_GINT64_MODIFIER "x private:%p", object->first_packet, object->oid, object->private_data);*/
|
||||
/*ws_warning(" Object(#%4u): OID:0x%" PRIx64 " private:%p", object->first_packet, object->oid, object->private_data);*/
|
||||
|
||||
for(interfaces = object->interfaces; interfaces != NULL; interfaces = g_list_next(interfaces)) {
|
||||
interf = (dcom_interface_t *)interfaces->data;
|
||||
|
@ -1384,7 +1384,7 @@ dissect_dcom_VARIANT(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|||
offset = dissect_dcom_I8(tvb, offset, pinfo, NULL, di, drep,
|
||||
0, &cyData);
|
||||
proto_tree_add_int64_format(sub_tree, hf_dcom_vt_cy, tvb, offset - 8,
|
||||
8, cyData, "%s: %" G_GINT64_FORMAT ".%.04" G_GINT64_FORMAT,
|
||||
8, cyData, "%s: %" PRId64 ".%.04" PRId64,
|
||||
proto_registrar_get_name(hf_dcom_vt_cy),
|
||||
cyData / 10000, ABS(cyData % 10000));
|
||||
break;
|
||||
|
@ -1616,7 +1616,7 @@ dcom_tvb_get_nwstringz0(tvbuff_t *tvb, gint offset, guint32 inLength, gchar *psz
|
|||
for(u32IdxA = 0, u32IdxW = 0;
|
||||
u32IdxW < u32Idx && u32IdxA < outLength-2;
|
||||
u32IdxW++, u32IdxA+=2) {
|
||||
g_snprintf(&pszStr[u32IdxA], 3, "%02X", tvb_get_guint8(tvb, offset+u32IdxW));
|
||||
snprintf(&pszStr[u32IdxA], 3, "%02X", tvb_get_guint8(tvb, offset+u32IdxW));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1806,14 +1806,14 @@ dissect_cablelabs_specific_opts(proto_tree *v_tree, proto_item *v_item, packet_i
|
|||
static void
|
||||
cablelabs_fmt_docsis_version( gchar *result, guint32 revision )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) );
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) );
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cablelabs_fmt_dpoe_server_version( gchar *result, guint32 revision )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) );
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -676,7 +676,7 @@ decode_dataitem_mdrr(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree *pt,
|
|||
guint64 mdrr;
|
||||
|
||||
proto_tree_add_item_ret_uint64(pt, hf_dlep_dataitem_mdrr, tvb, offset, DLEP_DIT_MDRR_LEN, ENC_BIG_ENDIAN, &mdrr);
|
||||
proto_item_append_text(pi, ": %" G_GUINT64_FORMAT " (bps)", mdrr);
|
||||
proto_item_append_text(pi, ": %" PRIu64 " (bps)", mdrr);
|
||||
offset+=DLEP_DIT_MDRR_LEN;
|
||||
|
||||
if (len != DLEP_DIT_MDRR_LEN)
|
||||
|
@ -692,7 +692,7 @@ decode_dataitem_mdrt(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree *pt,
|
|||
guint64 mdrt;
|
||||
|
||||
proto_tree_add_item_ret_uint64(pt, hf_dlep_dataitem_mdrt, tvb, offset, DLEP_DIT_MDRT_LEN, ENC_BIG_ENDIAN, &mdrt);
|
||||
proto_item_append_text(pi, ": %" G_GUINT64_FORMAT " (bps)", mdrt);
|
||||
proto_item_append_text(pi, ": %" PRIu64 " (bps)", mdrt);
|
||||
offset+=DLEP_DIT_MDRT_LEN;
|
||||
|
||||
if (len != DLEP_DIT_MDRT_LEN)
|
||||
|
@ -708,7 +708,7 @@ decode_dataitem_cdrr(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree *pt,
|
|||
guint64 cdrr;
|
||||
|
||||
proto_tree_add_item_ret_uint64(pt, hf_dlep_dataitem_cdrr, tvb, offset, DLEP_DIT_CDRR_LEN, ENC_BIG_ENDIAN, &cdrr);
|
||||
proto_item_append_text(pi, ": %" G_GUINT64_FORMAT " (bps)", cdrr);
|
||||
proto_item_append_text(pi, ": %" PRIu64 " (bps)", cdrr);
|
||||
offset+=DLEP_DIT_CDRR_LEN;
|
||||
|
||||
if (len != DLEP_DIT_CDRR_LEN)
|
||||
|
@ -724,7 +724,7 @@ decode_dataitem_cdrt(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree *pt,
|
|||
guint64 cdrt;
|
||||
|
||||
proto_tree_add_item_ret_uint64(pt, hf_dlep_dataitem_cdrt, tvb, offset, DLEP_DIT_CDRT_LEN, ENC_BIG_ENDIAN, &cdrt);
|
||||
proto_item_append_text(pi, ": %" G_GUINT64_FORMAT " (bps)", cdrt);
|
||||
proto_item_append_text(pi, ": %" PRIu64 " (bps)", cdrt);
|
||||
offset+=DLEP_DIT_CDRT_LEN;
|
||||
|
||||
if (len != DLEP_DIT_CDRT_LEN)
|
||||
|
@ -740,7 +740,7 @@ decode_dataitem_latency(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree *p
|
|||
guint64 latency;
|
||||
|
||||
proto_tree_add_item_ret_uint64(pt, hf_dlep_dataitem_latency, tvb, offset, DLEP_DIT_LAT_LEN, ENC_BIG_ENDIAN, &latency);
|
||||
proto_item_append_text(pi, ": %" G_GUINT64_FORMAT " (us)", latency);
|
||||
proto_item_append_text(pi, ": %" PRIu64 " (us)", latency);
|
||||
offset+=DLEP_DIT_LAT_LEN;
|
||||
|
||||
if (len != DLEP_DIT_LAT_LEN)
|
||||
|
|
|
@ -411,7 +411,7 @@ dissect_dlsw_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
|
|||
static void
|
||||
dlsw_fmt_version( gchar *result, guint32 revision )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) );
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) );
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -529,7 +529,7 @@ dissect_dlt_verbose_parameter_int(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
}
|
||||
}
|
||||
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " %" G_GINT64_FORMAT, value);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " %" PRId64, value);
|
||||
return length;
|
||||
}
|
||||
|
||||
|
@ -588,7 +588,7 @@ dissect_dlt_verbose_parameter_uint(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
}
|
||||
}
|
||||
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " %" G_GUINT64_FORMAT, value);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " %" PRIu64, value);
|
||||
return length;
|
||||
}
|
||||
|
||||
|
|
|
@ -1265,7 +1265,7 @@ static gboolean dmp_dec_xbyte_sic (guint64 bin, gchar *sic,
|
|||
|
||||
if (no_char >= MAX_SIC_LEN) {
|
||||
/* Illegal length */
|
||||
g_snprintf (sic, MAX_SIC_LEN, "Illegal length: %d", no_char);
|
||||
snprintf (sic, MAX_SIC_LEN, "Illegal length: %d", no_char);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1725,7 +1725,7 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo,
|
|||
|
||||
} else if (key <= 0xBF) {
|
||||
/* Reserved (not used) */
|
||||
g_snprintf (sic, MAX_SIC_LEN, "Reserved");
|
||||
snprintf (sic, MAX_SIC_LEN, "Reserved");
|
||||
no_sic = TRUE;
|
||||
|
||||
} else if (key <= 0xCF) {
|
||||
|
@ -1860,7 +1860,7 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo,
|
|||
failure = dmp_dec_xbyte_sic (value, sic, length, any);
|
||||
bf = proto_tree_add_string_format (sic_tree, hf_message_sic, tvb,
|
||||
offset, bytes, sic,
|
||||
"SIC %d: %s (%d bytes: %" G_GINT64_MODIFIER "x)%s",
|
||||
"SIC %d: %s (%d bytes: %" PRIx64 ")%s",
|
||||
i + 1, sic, bytes, value,
|
||||
failure ? " (invalid)": "");
|
||||
if (bitmap & (1 << (7 - i))) {
|
||||
|
@ -1882,12 +1882,12 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo,
|
|||
|
||||
} else if (key == 0xFE) {
|
||||
/* No SIC */
|
||||
g_snprintf (sic, MAX_SIC_LEN, "Not present");
|
||||
snprintf (sic, MAX_SIC_LEN, "Not present");
|
||||
no_sic = TRUE;
|
||||
|
||||
} else {
|
||||
/* Resered (not used) */
|
||||
g_snprintf (sic, MAX_SIC_LEN, "Reserved");
|
||||
snprintf (sic, MAX_SIC_LEN, "Reserved");
|
||||
no_sic = TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1430,7 +1430,7 @@ expand_dns_name(tvbuff_t *tvb, int offset, int max_len, int dns_data_offset,
|
|||
label_len = (bit_count - 1) / 8 + 1;
|
||||
|
||||
if (maxname > 0) {
|
||||
print_len = g_snprintf(np, maxname, "\\[x");
|
||||
print_len = snprintf(np, maxname, "\\[x");
|
||||
if (print_len <= maxname) {
|
||||
np += print_len;
|
||||
maxname -= print_len;
|
||||
|
@ -1442,7 +1442,7 @@ expand_dns_name(tvbuff_t *tvb, int offset, int max_len, int dns_data_offset,
|
|||
}
|
||||
while (label_len--) {
|
||||
if (maxname > 0) {
|
||||
print_len = g_snprintf(np, maxname, "%02x",
|
||||
print_len = snprintf(np, maxname, "%02x",
|
||||
tvb_get_guint8(tvb, offset));
|
||||
if (print_len <= maxname) {
|
||||
np += print_len;
|
||||
|
@ -1456,7 +1456,7 @@ expand_dns_name(tvbuff_t *tvb, int offset, int max_len, int dns_data_offset,
|
|||
offset++;
|
||||
}
|
||||
if (maxname > 0) {
|
||||
print_len = g_snprintf(np, maxname, "/%d]", bit_count);
|
||||
print_len = snprintf(np, maxname, "/%d]", bit_count);
|
||||
if (print_len <= maxname) {
|
||||
np += print_len;
|
||||
maxname -= print_len;
|
||||
|
@ -1614,7 +1614,7 @@ rfc1867_angle(tvbuff_t *tvb, int offset, gboolean longitude)
|
|||
|
||||
if (longitude ? (angle > 648000000) : (angle > 324000000))
|
||||
{
|
||||
g_snprintf(buf, sizeof(buf), "Value out of range");
|
||||
snprintf(buf, sizeof(buf), "Value out of range");
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
@ -1625,7 +1625,7 @@ rfc1867_angle(tvbuff_t *tvb, int offset, gboolean longitude)
|
|||
minutes = angle % 60;
|
||||
degrees = angle / 60;
|
||||
|
||||
g_snprintf(buf, sizeof(buf), "%u deg %u min %u.%03u sec %c", degrees, minutes, secs,
|
||||
snprintf(buf, sizeof(buf), "%u deg %u min %u.%03u sec %c", degrees, minutes, secs,
|
||||
tsecs, direction);
|
||||
return buf;
|
||||
}
|
||||
|
|
|
@ -1616,7 +1616,7 @@ two_compl_frac(
|
|||
gint16 frac = value;
|
||||
|
||||
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH,
|
||||
snprintf(buf, ITEM_LABEL_LENGTH,
|
||||
"%f",
|
||||
frac/16384.0);
|
||||
}
|
||||
|
@ -2492,31 +2492,31 @@ static const unit_name_string local_units_hz = { "Hz", NULL };
|
|||
static void
|
||||
ofdma_ir_pow_ctrl_start_pow(char *buf, guint32 value)
|
||||
{
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%f dBmV/1.6MHz", value/4.0);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%f dBmV/1.6MHz", value/4.0);
|
||||
}
|
||||
|
||||
static void
|
||||
ofdma_ir_pow_ctrl_step_size(char *buf, guint32 value)
|
||||
{
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%f dB", value/4.0);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%f dB", value/4.0);
|
||||
}
|
||||
|
||||
static void
|
||||
fourth_db(char *buf, guint32 value)
|
||||
{
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%f dB", value/4.0);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%f dB", value/4.0);
|
||||
}
|
||||
|
||||
static void
|
||||
subc_assign_range(char *buf, guint32 value)
|
||||
{
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u - %u", value >> 16, value &0xFFFF);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u - %u", value >> 16, value &0xFFFF);
|
||||
}
|
||||
|
||||
static void
|
||||
multipart_number_of_fragments(char *buf, guint32 value)
|
||||
{
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%u (Actual Number of Fragments: %u)", value, value + 1);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%u (Actual Number of Fragments: %u)", value, value + 1);
|
||||
}
|
||||
|
||||
static reassembly_table docsis_tlv_reassembly_table;
|
||||
|
|
|
@ -913,13 +913,13 @@ static const value_string docsis_time_prot_perf_sup_vals[] = {
|
|||
static void
|
||||
fourth_db(char *buf, guint32 value)
|
||||
{
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.2f dB", value/4.0);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.2f dB", value/4.0);
|
||||
}
|
||||
|
||||
static void
|
||||
fourth_dbmv(char *buf, guint32 value)
|
||||
{
|
||||
g_snprintf(buf, ITEM_LABEL_LENGTH, "%.2f dBmV", value/4.0);
|
||||
snprintf(buf, ITEM_LABEL_LENGTH, "%.2f dBmV", value/4.0);
|
||||
}
|
||||
|
||||
static reassembly_table ucd_reassembly_table;
|
||||
|
|
|
@ -1164,7 +1164,7 @@ static void decode_payload_uuids110(tvbuff_t *tvb, proto_tree *tree, drbd_conv *
|
|||
if (is_bit_set_64(bitmap_uuids_mask, i)) {
|
||||
guint64 bitmap_uuid = tvb_get_ntoh64(tvb, offset);
|
||||
proto_tree_add_uint64_format(tree, hf_drbd_bitmap_uuid, tvb, offset, 8, bitmap_uuid,
|
||||
"Bitmap UUID for node %d: 0x%016" G_GINT64_MODIFIER "x", i, bitmap_uuid);
|
||||
"Bitmap UUID for node %d: 0x%016" PRIx64, i, bitmap_uuid);
|
||||
offset += 8;
|
||||
}
|
||||
}
|
||||
|
@ -1306,11 +1306,11 @@ static void format_node_mask(gchar *s, guint64 value)
|
|||
const char *sep = written ? ", " : "";
|
||||
|
||||
if (run_length == 1)
|
||||
written += g_snprintf(s + written, ITEM_LABEL_LENGTH - written, "%s%d", sep, run_start);
|
||||
written += snprintf(s + written, ITEM_LABEL_LENGTH - written, "%s%d", sep, run_start);
|
||||
else if (run_length == 2)
|
||||
written += g_snprintf(s + written, ITEM_LABEL_LENGTH - written, "%s%d, %d", sep, run_start, run_start + 1);
|
||||
written += snprintf(s + written, ITEM_LABEL_LENGTH - written, "%s%d, %d", sep, run_start, run_start + 1);
|
||||
else
|
||||
written += g_snprintf(s + written, ITEM_LABEL_LENGTH - written, "%s%d - %d", sep, run_start, run_end - 1);
|
||||
written += snprintf(s + written, ITEM_LABEL_LENGTH - written, "%s%d - %d", sep, run_start, run_end - 1);
|
||||
}
|
||||
|
||||
if (!is_set)
|
||||
|
|
|
@ -900,7 +900,7 @@ dissect_dtls_record(tvbuff_t *tvb, packet_info *pinfo,
|
|||
/*
|
||||
* now dissect the next layer
|
||||
*/
|
||||
ssl_debug_printf("dissect_dtls_record: content_type %d epoch %d seq %"G_GUINT64_FORMAT"\n", content_type, epoch, sequence_number);
|
||||
ssl_debug_printf("dissect_dtls_record: content_type %d epoch %d seq %"PRIu64"\n", content_type, epoch, sequence_number);
|
||||
|
||||
/* try to decrypt record on the first pass, if possible. Store decrypted
|
||||
* record for later usage (without having to decrypt again). */
|
||||
|
@ -1825,7 +1825,7 @@ dtls_src_prompt(packet_info *pinfo, gchar *result)
|
|||
if (pi != NULL)
|
||||
srcport = pi->srcport;
|
||||
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", srcport, UTF8_RIGHTWARDS_ARROW);
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", srcport, UTF8_RIGHTWARDS_ARROW);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
|
@ -1850,7 +1850,7 @@ dtls_dst_prompt(packet_info *pinfo, gchar *result)
|
|||
if (pi != NULL)
|
||||
destport = pi->destport;
|
||||
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, destport);
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, destport);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
|
@ -1879,7 +1879,7 @@ dtls_both_prompt(packet_info *pinfo, gchar *result)
|
|||
destport = pi->destport;
|
||||
}
|
||||
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport);
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport);
|
||||
}
|
||||
|
||||
void proto_reg_handoff_dtls(void);
|
||||
|
|
|
@ -4200,8 +4200,8 @@ dissect_dvbci_payload_sas(guint32 tag, gint len_field _U_,
|
|||
switch(tag) {
|
||||
case T_SAS_CONNECT_RQST:
|
||||
case T_SAS_CONNECT_CNF:
|
||||
g_snprintf(app_id_str, sizeof(app_id_str),
|
||||
"0x%016" G_GINT64_MODIFIER "x", tvb_get_ntoh64(tvb, offset));
|
||||
snprintf(app_id_str, sizeof(app_id_str),
|
||||
"0x%016" PRIx64, tvb_get_ntoh64(tvb, offset));
|
||||
col_append_sep_str(pinfo->cinfo, COL_INFO, ": ", app_id_str);
|
||||
proto_tree_add_item(tree, hf_dvbci_sas_app_id,
|
||||
tvb, offset, 8, ENC_BIG_ENDIAN);
|
||||
|
|
|
@ -1199,11 +1199,11 @@ static int display_raw_cyclic_data(guint8 display, int offset, guint16 buffer_si
|
|||
/* we hit end of the current line */
|
||||
/* add final value to string */
|
||||
if (display == cyclic_display_byte_format) {
|
||||
g_snprintf(&pdata[idx], 32, "%02x",value8);
|
||||
snprintf(&pdata[idx], 32, "%02x",value8);
|
||||
} else if (display == cyclic_display_word_format) {
|
||||
g_snprintf(&pdata[idx], 32, "%04x",value16);
|
||||
snprintf(&pdata[idx], 32, "%04x",value16);
|
||||
} else if (display == cyclic_display_long_format) {
|
||||
g_snprintf(&pdata[idx], 32, "%08x",value32);
|
||||
snprintf(&pdata[idx], 32, "%08x",value32);
|
||||
}
|
||||
|
||||
/* display the completed line in the sub-tree */
|
||||
|
@ -1218,13 +1218,13 @@ static int display_raw_cyclic_data(guint8 display, int offset, guint16 buffer_si
|
|||
/* we're still adding to the current line */
|
||||
/* add current value to string */
|
||||
if (display == cyclic_display_byte_format) {
|
||||
g_snprintf(&pdata[idx], 32, "%02x ",value8);
|
||||
snprintf(&pdata[idx], 32, "%02x ",value8);
|
||||
idx += 3;
|
||||
} else if (display == cyclic_display_word_format) {
|
||||
g_snprintf(&pdata[idx], 32, "%04x ",value16);
|
||||
snprintf(&pdata[idx], 32, "%04x ",value16);
|
||||
idx += 5;
|
||||
} else if (display == cyclic_display_long_format) {
|
||||
g_snprintf(&pdata[idx], 32, "%08x ",value32);
|
||||
snprintf(&pdata[idx], 32, "%08x ",value32);
|
||||
idx += 9;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2408,7 +2408,7 @@ static int dissect_kademlia_tag(tvbuff_t *tvb, packet_info *pinfo,
|
|||
proto_tree_add_item( subtree, hf_kademlia_tag_uint64, tvb, offset, 8, ENC_LITTLE_ENDIAN);
|
||||
|
||||
value = tvb_get_letoh64( tvb, offset );
|
||||
proto_item_append_text( tag_node, "%" G_GINT64_MODIFIER "u (0x%08" G_GINT64_MODIFIER "X)", value, value );
|
||||
proto_item_append_text( tag_node, "%" PRIu64 " (0x%08" PRIX64 ")", value, value );
|
||||
|
||||
offset += 8;
|
||||
}
|
||||
|
@ -3082,7 +3082,7 @@ static int dissect_edonkey_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
|
|||
static void
|
||||
edonkey_fmt_revision(gchar *result, guint32 revision )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%u.%u", (guint16)(revision & 0xFFFF), (guint16)(( revision & 0xFFFF0000 ) >> 16) );
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%u.%u", (guint16)(revision & 0xFFFF), (guint16)(( revision & 0xFFFF0000 ) >> 16) );
|
||||
}
|
||||
|
||||
void proto_register_edonkey(void) {
|
||||
|
|
|
@ -2553,19 +2553,19 @@ dissect_eigrp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
|
|||
static void
|
||||
eigrp_fmt_cable_range(gchar *result, guint32 revision )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%u-%u", (guint16)(( revision & 0xFFFF0000 ) >> 16), (guint16)(revision & 0xFFFF) );
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%u-%u", (guint16)(( revision & 0xFFFF0000 ) >> 16), (guint16)(revision & 0xFFFF) );
|
||||
}
|
||||
|
||||
static void
|
||||
eigrp_fmt_nexthop_address(gchar *result, guint32 revision )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%u.%u", (guint16)(( revision & 0xFFFF0000 ) >> 16), (guint16)(revision & 0xFFFF) );
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%u.%u", (guint16)(( revision & 0xFFFF0000 ) >> 16), (guint16)(revision & 0xFFFF) );
|
||||
}
|
||||
|
||||
static void
|
||||
eigrp_fmt_version(gchar *result, guint32 revision )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) );
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -129,7 +129,7 @@ static const value_string status_flag_message_type[] = {
|
|||
};
|
||||
|
||||
static void elasticsearch_format_version(gchar *buf, guint32 value) {
|
||||
g_snprintf(buf, ELASTICSEARCH_VERSION_LABEL_LENGTH, "%d.%d.%d (%d)", (value / 1000000) % 100,
|
||||
snprintf(buf, ELASTICSEARCH_VERSION_LABEL_LENGTH, "%d.%d.%d (%d)", (value / 1000000) % 100,
|
||||
(value / 10000) % 100, (value/ 100) % 100, value);
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,7 @@ static version_t elasticsearch_parse_version(tvbuff_t *tvb, int offset){
|
|||
raw_version_value = read_vint(tvb, offset);
|
||||
version.length = raw_version_value.length;
|
||||
version.value = raw_version_value.value;
|
||||
g_snprintf(version.string, sizeof(version.string), "%d.%d.%d", (version.value / 1000000) % 100,
|
||||
snprintf(version.string, sizeof(version.string), "%d.%d.%d", (version.value / 1000000) % 100,
|
||||
(version.value / 10000) % 100, (version.value/ 100) % 100);
|
||||
|
||||
return version;
|
||||
|
@ -532,7 +532,7 @@ static int elasticsearch_dissect_valid_binary_packet(tvbuff_t *tvb, packet_info
|
|||
} else {
|
||||
elasticsearch_decode_binary_response(tvb, pinfo, tree, offset, transport_status_flags, version);
|
||||
}
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "request_id=%"G_GUINT64_FORMAT" ", request_id);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "request_id=%"PRIu64" ", request_id);
|
||||
|
||||
|
||||
/* Everything is marked as data, return the whole tvb as the length */
|
||||
|
|
|
@ -789,7 +789,7 @@ static const true_false_string dlr_lnknbrstatus_frame_type_vals = {
|
|||
|
||||
static void enip_prompt(packet_info *pinfo _U_, gchar* result)
|
||||
{
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Dissect unidentified I/O traffic as");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Dissect unidentified I/O traffic as");
|
||||
}
|
||||
|
||||
static wmem_map_t *enip_request_hashtable = NULL;
|
||||
|
@ -846,7 +846,7 @@ enip_request_equal(gconstpointer v, gconstpointer w)
|
|||
static void
|
||||
enip_fmt_lir_revision( gchar *result, guint32 revision )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) );
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) );
|
||||
}
|
||||
|
||||
static guint
|
||||
|
|
|
@ -752,7 +752,7 @@ epl_wmem_print_iarr(epl_wmem_iarray_t *iarr)
|
|||
for (i = 0; i < len; i++)
|
||||
{
|
||||
|
||||
ws_debug_printf("Range: low=%" G_GUINT32_FORMAT " high=%" G_GUINT32_FORMAT "\n", elem->low, elem->high);
|
||||
ws_debug_printf("Range: low=%" PRIu32 " high=%" PRIu32 "\n", elem->low, elem->high);
|
||||
|
||||
elem = (range_admin_t*)((char*)elem + g_array_get_element_size(iarr->arr));
|
||||
}
|
||||
|
|
|
@ -2502,7 +2502,7 @@ epl_set_sequence_nr(packet_info *pinfo, guint16 seqnum)
|
|||
static void
|
||||
elp_version( gchar *result, guint32 version )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%d", hi_nibble(version), lo_nibble(version));
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%d.%d", hi_nibble(version), lo_nibble(version));
|
||||
}
|
||||
/* Code to actually dissect the packets */
|
||||
static int
|
||||
|
@ -2807,7 +2807,7 @@ dissect_epl_payload(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, gin
|
|||
guint64 val;
|
||||
item = proto_tree_add_item_ret_uint64(epl_tree, *type->hf,
|
||||
tvb, offset, type->len, type->encoding, &val);
|
||||
proto_item_append_text(item, " (0x%.*" G_GINT64_MODIFIER "x)", 2*type->len, val);
|
||||
proto_item_append_text(item, " (0x%.*" PRIx64 ")", 2*type->len, val);
|
||||
}
|
||||
}
|
||||
/* If a mapping uses a type of fixed width that's not equal to
|
||||
|
@ -2821,7 +2821,7 @@ dissect_epl_payload(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, gin
|
|||
guint64 val;
|
||||
item = proto_tree_add_item_ret_uint64(epl_tree, hf_epl_od_uint,
|
||||
payload_tvb, 0, payload_len, ENC_LITTLE_ENDIAN, &val);
|
||||
proto_item_append_text(item, " (0x%.*" G_GINT64_MODIFIER "x)", 2*payload_len, val);
|
||||
proto_item_append_text(item, " (0x%.*" PRIx64 ")", 2*payload_len, val);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4330,9 +4330,9 @@ dissect_object_mapping(struct profile *profile, wmem_array_t *mappings, proto_tr
|
|||
{
|
||||
/* TODO One could think of a better string here? */
|
||||
if (nosub)
|
||||
g_snprintf(map.title, sizeof(map.title), "PDO - %04X", map.pdo.idx);
|
||||
snprintf(map.title, sizeof(map.title), "PDO - %04X", map.pdo.idx);
|
||||
else
|
||||
g_snprintf(map.title, sizeof(map.title), "PDO - %04X:%02X", map.pdo.idx, map.pdo.subindex);
|
||||
snprintf(map.title, sizeof(map.title), "PDO - %04X:%02X", map.pdo.idx, map.pdo.subindex);
|
||||
|
||||
add_object_mapping(mappings, &map);
|
||||
}
|
||||
|
|
|
@ -1853,7 +1853,7 @@ static void dissect_host_anchor_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
proto_tree *subtree;
|
||||
|
||||
/* TODO: top level linking to most recent frame like we have for Host ID? */
|
||||
subtree = proto_tree_add_subtree_format(tree, tvb, 0, 0, ett_erf_anchor, &pi, "Host ID: 0x%012" G_GINT64_MODIFIER "x, Anchor ID: 0x%012" G_GINT64_MODIFIER "x", host_id & ERF_EHDR_HOST_ID_MASK, anchor_id & ERF_EHDR_ANCHOR_ID_MASK);
|
||||
subtree = proto_tree_add_subtree_format(tree, tvb, 0, 0, ett_erf_anchor, &pi, "Host ID: 0x%012" PRIx64 ", Anchor ID: 0x%012" PRIx64, host_id & ERF_EHDR_HOST_ID_MASK, anchor_id & ERF_EHDR_ANCHOR_ID_MASK);
|
||||
proto_item_set_generated(pi);
|
||||
|
||||
pi = proto_tree_add_uint64(subtree, hf_erf_anchor_hostid, tvb, 0, 0, host_id & ERF_EHDR_HOST_ID_MASK);
|
||||
|
@ -1907,12 +1907,12 @@ dissect_host_id_source_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
|
|||
|
||||
if (fnum_current != G_MAXUINT32) {
|
||||
pi = proto_tree_add_uint_format(tree, hf_erf_source_current, tvb, 0, 0, fnum_current,
|
||||
"Host ID: 0x%012" G_GINT64_MODIFIER "x, Source ID: %u", host_id, source_id&0xFF);
|
||||
"Host ID: 0x%012" PRIx64 ", Source ID: %u", host_id, source_id&0xFF);
|
||||
hostid_tree = proto_item_add_subtree(pi, ett_erf_source);
|
||||
} else {
|
||||
/* If we have no frame number to link against, just add a static subtree */
|
||||
hostid_tree = proto_tree_add_subtree_format(tree, tvb, 0, 0, ett_erf_source, &pi,
|
||||
"Host ID: 0x%012" G_GINT64_MODIFIER "x, Source ID: %u", host_id, source_id&0xFF);
|
||||
"Host ID: 0x%012" PRIx64 ", Source ID: %u", host_id, source_id&0xFF);
|
||||
}
|
||||
proto_item_set_generated(pi);
|
||||
|
||||
|
@ -2776,7 +2776,7 @@ dissect_meta_record_tags(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
|||
case ERF_META_TAG_if_tx_speed:
|
||||
value64 = tvb_get_ntoh64(tvb, offset + 4);
|
||||
tmp = format_size((int64_t)value64, FORMAT_SIZE_UNIT_BITS_S, FORMAT_SIZE_PREFIX_SI);
|
||||
tag_pi = proto_tree_add_uint64_format_value(section_tree, tag_info->hf_value, tvb, offset + 4, taglength, value64, "%s (%" G_GINT64_MODIFIER "u bps)", tmp, value64);
|
||||
tag_pi = proto_tree_add_uint64_format_value(section_tree, tag_info->hf_value, tvb, offset + 4, taglength, value64, "%s (%" PRIu64 " bps)", tmp, value64);
|
||||
g_free(tmp);
|
||||
break;
|
||||
|
||||
|
@ -2807,7 +2807,7 @@ dissect_meta_record_tags(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
|||
case ERF_META_TAG_mem:
|
||||
value64 = tvb_get_ntoh64(tvb, offset + 4);
|
||||
tmp = format_size((int64_t)value64, FORMAT_SIZE_UNIT_BYTES, FORMAT_SIZE_PREFIX_IEC);
|
||||
tag_pi = proto_tree_add_uint64_format_value(section_tree, tag_info->hf_value, tvb, offset + 4, taglength, value64, "%s (%" G_GINT64_MODIFIER"u bytes)", tmp, value64);
|
||||
tag_pi = proto_tree_add_uint64_format_value(section_tree, tag_info->hf_value, tvb, offset + 4, taglength, value64, "%s (%" PRIu64" bytes)", tmp, value64);
|
||||
g_free(tmp);
|
||||
break;
|
||||
|
||||
|
|
|
@ -393,9 +393,9 @@ static gint dissect_etf_big_ext(tvbuff_t *tvb, gint offset, guint32 len, proto_t
|
|||
case 8: big_val = tvb_get_letoh64(tvb, offset); break;
|
||||
}
|
||||
proto_tree_add_uint64_format_value(tree, hf_erldp_big_ext_int, tvb, offset, len,
|
||||
big_val, "%s%" G_GINT64_MODIFIER "u", sign ? "-" : "", big_val);
|
||||
big_val, "%s%" PRIu64, sign ? "-" : "", big_val);
|
||||
if (value_str)
|
||||
*value_str = wmem_strdup_printf(wmem_packet_scope(), "%s%" G_GINT64_MODIFIER "u",
|
||||
*value_str = wmem_strdup_printf(wmem_packet_scope(), "%s%" PRIu64,
|
||||
sign ? "-" : "", big_val);
|
||||
} if (len < 64) {
|
||||
wmem_strbuf_t *strbuf = wmem_strbuf_sized_new(wmem_packet_scope(), len*1+3+1, len*1+3+1);
|
||||
|
@ -595,7 +595,7 @@ static gint dissect_etf_type_content(guint8 tag, packet_info *pinfo, tvbuff_t *t
|
|||
|
||||
for (i = 0; i < len; i++) {
|
||||
gchar buf[ITEM_LABEL_LENGTH];
|
||||
g_snprintf(buf, sizeof(buf), "Free Var[%u]", i + 1);
|
||||
snprintf(buf, sizeof(buf), "Free Var[%u]", i + 1);
|
||||
offset = dissect_etf_type(buf, pinfo, tvb, offset, tree);
|
||||
}
|
||||
break;
|
||||
|
@ -618,7 +618,7 @@ static gint dissect_etf_type_content(guint8 tag, packet_info *pinfo, tvbuff_t *t
|
|||
|
||||
for (i = 0; i < len; i++) {
|
||||
gchar buf[ITEM_LABEL_LENGTH];
|
||||
g_snprintf(buf, sizeof(buf), "Free Var[%u]", i + 1);
|
||||
snprintf(buf, sizeof(buf), "Free Var[%u]", i + 1);
|
||||
offset = dissect_etf_type(buf, pinfo, tvb, offset, tree);
|
||||
}
|
||||
break;
|
||||
|
@ -707,7 +707,7 @@ static gint dissect_etf_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
{ /* make a new subset */
|
||||
next_tvb = tvb_new_subset_remaining(tvb, offset);
|
||||
call_data_dissector(next_tvb, pinfo, tree);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " (Fragment ID: %" G_GUINT64_FORMAT ")", fragment_id);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " (Fragment ID: %" PRIu64 ")", fragment_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -715,7 +715,7 @@ static gint dissect_etf_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
proto_item_set_len(ti, offset);
|
||||
|
||||
dissect_etf_pdu_data(pinfo, next_tvb, offset, tree);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " (Reassembled, Fragment ID: %" G_GUINT64_FORMAT ")", fragment_id);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, " (Reassembled, Fragment ID: %" PRIu64 ")", fragment_id);
|
||||
}
|
||||
|
||||
pinfo->fragmented = save_fragmented;
|
||||
|
|
|
@ -136,7 +136,7 @@ dissect_etag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
|
|||
ing_e_cid = (guint32)((((tci >> 32) & 0xFFF) | ((tci << 4) & 0xFF000)) & 0xFFFFF); /* Ingress_E-CID_base | Ingress_E-CID ext */
|
||||
|
||||
if (etag_summary_in_tree) {
|
||||
proto_item_append_text(ti, ", TCI: 0x%" G_GINT64_MODIFIER "x Ingress_E-CID: %u E-CID: %u", tci, ing_e_cid, e_cid);
|
||||
proto_item_append_text(ti, ", TCI: 0x%" PRIx64 " Ingress_E-CID: %u E-CID: %u", tci, ing_e_cid, e_cid);
|
||||
}
|
||||
etag_tree = proto_item_add_subtree(ti, ett_etag);
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ const value_string etype_vals[] = {
|
|||
|
||||
static void eth_prompt(packet_info *pinfo, gchar* result)
|
||||
{
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Ethertype 0x%04x as",
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Ethertype 0x%04x as",
|
||||
GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_ethertype, pinfo->curr_layer_num)));
|
||||
}
|
||||
|
||||
|
|
|
@ -714,7 +714,7 @@ f5eth_tmmdist_stats_tree_packet(
|
|||
if(check_f5eth_tap_magic(tdata) == 0) return TAP_PACKET_DONT_REDRAW;
|
||||
*/
|
||||
|
||||
g_snprintf(tmm_stat_name_buffer, PER_TMM_STAT_NAME_BUF_LEN, "slot %3d,tmm %3d", tdata->slot,
|
||||
snprintf(tmm_stat_name_buffer, PER_TMM_STAT_NAME_BUF_LEN, "slot %3d,tmm %3d", tdata->slot,
|
||||
tdata->tmm);
|
||||
|
||||
pkt_len = pinfo->fd->pkt_len - tdata->trailer_len;
|
||||
|
@ -1915,12 +1915,12 @@ dissect_med_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o
|
|||
rstcauseline = (rstcauseval & 0x000000000000ffffLL);
|
||||
rstcauseval = (rstcauseval & 0xffffffffffff0000LL) >> 16;
|
||||
proto_tree_add_uint64_format_value(rc_tree, hf_rstcause_val, tvb, o, 6,
|
||||
rstcauseval, "0x%012" G_GINT64_MODIFIER "x", rstcauseval);
|
||||
rstcauseval, "0x%012" PRIx64, rstcauseval);
|
||||
proto_tree_add_item(rc_tree, hf_rstcause_line, tvb, o + 6, 2, ENC_BIG_ENDIAN);
|
||||
o += 8;
|
||||
|
||||
proto_item_append_text(rc_item,
|
||||
": [%" G_GINT64_MODIFIER "x:%" G_GINT64_MODIFIER "u]%s %s", rstcauseval,
|
||||
": [%" PRIx64 ":%" PRIu64 "]%s %s", rstcauseval,
|
||||
rstcauseline, rstcausepeer ? " {peer}" : "",
|
||||
tvb_get_string_enc(pinfo->pool, tvb, o,
|
||||
rstcauselen - (o - startcause), ENC_ASCII));
|
||||
|
@ -2361,12 +2361,12 @@ dissect_dpt_trailer_noise_med(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
|
|||
rstcauseline = (rstcauseval & 0x000000000000ffffLL);
|
||||
rstcauseval = (rstcauseval & 0xffffffffffff0000LL) >> 16;
|
||||
proto_tree_add_uint64_format_value(rc_tree, hf_rstcause_val, tvb, o, 6, rstcauseval,
|
||||
"0x%012" G_GINT64_MODIFIER "x", rstcauseval);
|
||||
"0x%012" PRIx64, rstcauseval);
|
||||
proto_tree_add_item(rc_tree, hf_rstcause_line, tvb, o + 6, 2, ENC_BIG_ENDIAN);
|
||||
o += 8;
|
||||
|
||||
proto_item_append_text(rc_item,
|
||||
": [%" G_GINT64_MODIFIER "x:%" G_GINT64_MODIFIER "u]%s %s", rstcauseval,
|
||||
": [%" PRIx64 ":%" PRIu64 "]%s %s", rstcauseval,
|
||||
rstcauseline, rstcausepeer ? " {peer}" : "",
|
||||
tvb_get_string_enc(
|
||||
pinfo->pool, tvb, o, rstcauselen - (o - startcause), ENC_ASCII));
|
||||
|
|
|
@ -752,19 +752,19 @@ dissect_swils_elp(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *elp_tree, g
|
|||
flagsbuf=(char *)wmem_alloc(wmem_packet_scope(), MAX_FLAGS_LEN);
|
||||
stroff = 0;
|
||||
|
||||
returned_length = g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff,
|
||||
returned_length = snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff,
|
||||
"Class 1 Valid");
|
||||
stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
|
||||
if (cls1_svcparm[0] & 0x40) {
|
||||
returned_length = g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IMX");
|
||||
returned_length = snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IMX");
|
||||
stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
|
||||
}
|
||||
if (cls1_svcparm[0] & 0x20) {
|
||||
returned_length = g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IPS");
|
||||
returned_length = snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IPS");
|
||||
stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
|
||||
}
|
||||
if (cls1_svcparm[0] & 0x10) {
|
||||
/*returned_length =*/ g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | LKS");
|
||||
/*returned_length =*/ snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | LKS");
|
||||
}
|
||||
flags=flagsbuf;
|
||||
}
|
||||
|
|
|
@ -260,35 +260,35 @@ fddifc_to_str(int fc)
|
|||
switch (fc & FDDI_FC_CLFF) {
|
||||
|
||||
case FDDI_FC_MAC:
|
||||
g_snprintf(strbuf, sizeof(strbuf), "MAC frame, control %x", fc & FDDI_FC_ZZZZ);
|
||||
snprintf(strbuf, sizeof(strbuf), "MAC frame, control %x", fc & FDDI_FC_ZZZZ);
|
||||
return strbuf;
|
||||
|
||||
case FDDI_FC_SMT:
|
||||
g_snprintf(strbuf, sizeof(strbuf), "SMT frame, control %x", fc & FDDI_FC_ZZZZ);
|
||||
snprintf(strbuf, sizeof(strbuf), "SMT frame, control %x", fc & FDDI_FC_ZZZZ);
|
||||
return strbuf;
|
||||
|
||||
case FDDI_FC_LLC_ASYNC:
|
||||
if (fc & FDDI_FC_ASYNC_R)
|
||||
g_snprintf(strbuf, sizeof(strbuf), "Async LLC frame, control %x", fc & FDDI_FC_ZZZZ);
|
||||
snprintf(strbuf, sizeof(strbuf), "Async LLC frame, control %x", fc & FDDI_FC_ZZZZ);
|
||||
else
|
||||
g_snprintf(strbuf, sizeof(strbuf), "Async LLC frame, priority %d",
|
||||
snprintf(strbuf, sizeof(strbuf), "Async LLC frame, priority %d",
|
||||
fc & FDDI_FC_ASYNC_PRI);
|
||||
return strbuf;
|
||||
|
||||
case FDDI_FC_LLC_SYNC:
|
||||
if (fc & FDDI_FC_ZZZZ) {
|
||||
g_snprintf(strbuf, sizeof(strbuf), "Sync LLC frame, control %x", fc & FDDI_FC_ZZZZ);
|
||||
snprintf(strbuf, sizeof(strbuf), "Sync LLC frame, control %x", fc & FDDI_FC_ZZZZ);
|
||||
return strbuf;
|
||||
} else
|
||||
return "Sync LLC frame";
|
||||
|
||||
case FDDI_FC_IMP_ASYNC:
|
||||
g_snprintf(strbuf, sizeof(strbuf), "Implementor async frame, control %x",
|
||||
snprintf(strbuf, sizeof(strbuf), "Implementor async frame, control %x",
|
||||
fc & FDDI_FC_ZZZZ);
|
||||
return strbuf;
|
||||
|
||||
case FDDI_FC_IMP_SYNC:
|
||||
g_snprintf(strbuf, sizeof(strbuf), "Implementor sync frame, control %x",
|
||||
snprintf(strbuf, sizeof(strbuf), "Implementor sync frame, control %x",
|
||||
fc & FDDI_FC_ZZZZ);
|
||||
return strbuf;
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ static gint ett_flip_payload = -1;
|
|||
|
||||
static void flip_prompt(packet_info *pinfo _U_, gchar* result)
|
||||
{
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode FLIP payload protocol as");
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode FLIP payload protocol as");
|
||||
}
|
||||
|
||||
/* Dissect the checksum extension header. */
|
||||
|
|
|
@ -838,7 +838,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
|
|||
if (show_file_off) {
|
||||
proto_tree_add_int64_format_value(fh_tree, hf_frame_file_off, tvb,
|
||||
0, 0, pinfo->fd->file_off,
|
||||
"%" G_GINT64_MODIFIER "d (0x%" G_GINT64_MODIFIER "x)",
|
||||
"%" PRId64 " (0x%" PRIx64 ")",
|
||||
pinfo->fd->file_off, pinfo->fd->file_off);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1224,7 +1224,7 @@ dissect_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offse
|
|||
expert_tree = proto_item_add_subtree(item, ett_mpsse_skipped_response_data);
|
||||
|
||||
command_in = proto_tree_add_uint_format(expert_tree, hf_mpsse_command_in, NULL, 0, 0, cmd_data->command_in_packet,
|
||||
"Bad Command 0x%02x in: %" G_GUINT32_FORMAT, cmd_data->cmd, cmd_data->command_in_packet);
|
||||
"Bad Command 0x%02x in: %" PRIu32, cmd_data->cmd, cmd_data->command_in_packet);
|
||||
proto_item_set_generated(command_in);
|
||||
if (cmd_data->is_response_set)
|
||||
{
|
||||
|
@ -1252,7 +1252,7 @@ dissect_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offse
|
|||
rsp_tree = proto_item_add_subtree(rsp_data, ett_mpsse_response_data);
|
||||
|
||||
command_in = proto_tree_add_uint_format(rsp_tree, hf_mpsse_command_in, NULL, 0, 0, cmd_data->command_in_packet,
|
||||
"Command 0x%02x in: %" G_GUINT32_FORMAT, cmd_data->cmd, cmd_data->command_in_packet);
|
||||
"Command 0x%02x in: %" PRIu32, cmd_data->cmd, cmd_data->command_in_packet);
|
||||
proto_item_set_generated(command_in);
|
||||
|
||||
offset += dissect_response_data(tvb, pinfo, rsp_tree, offset, cmd_data);
|
||||
|
|
|
@ -1247,7 +1247,7 @@ dissect_sec_intx(tvbuff_t *tvb, gint *offset, packet_info *pinfo, proto_tree *tr
|
|||
proto_tree_add_bits_item(subtree, hf_sgeonw_var_len_det, tvb, start << 3, (*offset) - start, ENC_NA);
|
||||
if ((hf != hf_sgeonw_app_id) || ((*offset) - start) > 4) {
|
||||
proto_tree_add_uint64_bits_format_value(subtree, hf, tvb, (start << 3) + (*offset) - start,
|
||||
(((*offset) - start) << 3) - ((*offset) - start), tmp_val, ENC_BIG_ENDIAN, "%" G_GUINT64_FORMAT, tmp_val);
|
||||
(((*offset) - start) << 3) - ((*offset) - start), tmp_val, ENC_BIG_ENDIAN, "%" PRIu64, tmp_val);
|
||||
}
|
||||
else {
|
||||
proto_tree_add_uint_bits_format_value(subtree, hf, tvb, (start << 3) + (*offset) - start,
|
||||
|
@ -2747,7 +2747,7 @@ btpa_src_prompt(packet_info *pinfo _U_, gchar* result)
|
|||
{
|
||||
guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_btpa_srcport, pinfo->curr_layer_num));
|
||||
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", port, UTF8_RIGHTWARDS_ARROW);
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", port, UTF8_RIGHTWARDS_ARROW);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
|
@ -2761,7 +2761,7 @@ btpa_dst_prompt(packet_info *pinfo, gchar *result)
|
|||
{
|
||||
guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_btpa_dstport, pinfo->curr_layer_num));
|
||||
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port);
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
|
@ -2775,7 +2775,7 @@ btpa_both_prompt(packet_info *pinfo, gchar *result)
|
|||
{
|
||||
guint32 srcport = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_btpa_srcport, pinfo->curr_layer_num)),
|
||||
destport = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_btpa_dstport, pinfo->curr_layer_num));
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport);
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2783,7 +2783,7 @@ btpb_dst_prompt(packet_info *pinfo, gchar *result)
|
|||
{
|
||||
guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_btpb_dstport, pinfo->curr_layer_num));
|
||||
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port);
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
|
@ -2914,7 +2914,7 @@ proto_reg_handoff_btpb(void)
|
|||
static void
|
||||
display_latitude( gchar *result, gint32 hexver )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%ud%u'%.2f\"%c (%d)",
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%ud%u'%.2f\"%c (%d)",
|
||||
abs(hexver)/10000000,
|
||||
abs(hexver%10000000)*6/1000000,
|
||||
abs(hexver*6%1000000)*6./100000.,
|
||||
|
@ -2925,7 +2925,7 @@ display_latitude( gchar *result, gint32 hexver )
|
|||
static void
|
||||
display_longitude( gchar *result, gint32 hexver )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%ud%u'%.2f\"%c (%d)",
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%ud%u'%.2f\"%c (%d)",
|
||||
abs(hexver)/10000000,
|
||||
abs(hexver%10000000)*6/1000000,
|
||||
abs(hexver*6%1000000)*6./100000.,
|
||||
|
@ -2936,13 +2936,13 @@ display_longitude( gchar *result, gint32 hexver )
|
|||
static void
|
||||
display_speed( gchar *result, gint32 hexver )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%.2f m/s", hexver/100.);
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%.2f m/s", hexver/100.);
|
||||
}
|
||||
|
||||
static void
|
||||
display_heading( gchar *result, guint32 hexver )
|
||||
{
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%.1f degrees", hexver/10.);
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%.1f degrees", hexver/10.);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2954,9 +2954,9 @@ display_elevation( gchar *result, gint32 hexver )
|
|||
// also represented by 0xF001.
|
||||
// 0xF000: an unknown elevation
|
||||
if (hexver == -4096)
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "Unknown (%4x)", hexver);
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "Unknown (%4x)", hexver);
|
||||
else
|
||||
g_snprintf( result, ITEM_LABEL_LENGTH, "%.1fm", hexver/10.);
|
||||
snprintf( result, ITEM_LABEL_LENGTH, "%.1fm", hexver/10.);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -175,7 +175,7 @@ static const range_string gfp_upi_management_rvals[] = {
|
|||
|
||||
static void gfp_prompt(packet_info *pinfo, gchar* result)
|
||||
{
|
||||
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "UPI %u as",
|
||||
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "UPI %u as",
|
||||
GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_gfp, 0)));
|
||||
}
|
||||
|
||||
|
|
|
@ -690,12 +690,12 @@ gluster_rpc4_0_dissect_dict(proto_tree *tree, tvbuff_t *tvb, int hfindex, int of
|
|||
if (val_type == 2) {
|
||||
val_len = 8;
|
||||
dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, val_len,
|
||||
NULL, "%s: %"G_GINT64_FORMAT, key,
|
||||
NULL, "%s: %"PRId64, key,
|
||||
tvb_get_gint64(tvb, offset, ENC_BIG_ENDIAN));
|
||||
} else if (val_type == 3) {
|
||||
val_len = 8;
|
||||
dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, val_len,
|
||||
NULL, "%s: %"G_GUINT64_FORMAT, key,
|
||||
NULL, "%s: %"PRIu64, key,
|
||||
tvb_get_guint64(tvb, offset, ENC_BIG_ENDIAN));
|
||||
} else if (val_type == 4) {
|
||||
val_len = 8;
|
||||
|
|
|
@ -951,7 +951,7 @@ CSN_DESCR_END (SystemInformation2_t)
|
|||
static void
|
||||
segx_half_db_value_fmt(gchar *s, guint32 v)
|
||||
{
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%2.1f dB (%u)", v * 0.5f, v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%2.1f dB (%u)", v * 0.5f, v);
|
||||
}
|
||||
|
||||
/* Segment 1A - [3] 11.5.2.66 */
|
||||
|
@ -959,7 +959,7 @@ static void
|
|||
seg1a_syncinfo_sa_freq_offset_fmt(gchar *s, guint32 v)
|
||||
{
|
||||
gint32 sv = (gint32)v;
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%d Hz (%d)", sv * 5, sv);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%d Hz (%d)", sv * 5, sv);
|
||||
}
|
||||
|
||||
static const value_string seg1a_rachctrl_acc_vals[] = {
|
||||
|
@ -1000,7 +1000,7 @@ seg3a_latitude_fmt(gchar *s, guint32 v)
|
|||
} else
|
||||
c = 'N';
|
||||
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f %c (%d)", sv / 10.0f, c, sv);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%.1f %c (%d)", sv / 10.0f, c, sv);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1017,7 +1017,7 @@ seg3a_longitude_fmt(gchar *s, guint32 v)
|
|||
sv = 3600 - v;
|
||||
}
|
||||
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f %c (%u)", sv / 10.0f, c, v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%.1f %c (%u)", sv / 10.0f, c, v);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1025,13 +1025,13 @@ seg3a_satpos_radius_fmt(gchar *s, guint32 v)
|
|||
{
|
||||
gint32 sv = (gint32)v;
|
||||
gint32 a = (42162 * 1000) + (sv * 5);
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%.3lf km (%u)", a / 1000.0, sv);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%.3lf km (%u)", a / 1000.0, sv);
|
||||
}
|
||||
|
||||
static void
|
||||
seg3a_miscinfo_sb_reselection_timer_fmt(gchar *s, guint32 v)
|
||||
{
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%d minutes (%u)", v*4, v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%d minutes (%u)", v*4, v);
|
||||
}
|
||||
|
||||
/* System Information 1 - [1] 10.3.31 */
|
||||
|
|
|
@ -244,7 +244,7 @@ rach_gps_pos_lat_fmt(gchar *s, guint32 v)
|
|||
{
|
||||
gint32 sv = v;
|
||||
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%.5f %s (%d)",
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%.5f %s (%d)",
|
||||
abs(sv) / 2912.7f, sv < 0 ? "S" : "N", sv);
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,7 @@ rach_gps_pos_long_fmt(gchar *s, guint32 v)
|
|||
{
|
||||
gint32 sv = v;
|
||||
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%.5f %s (%d)",
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%.5f %s (%d)",
|
||||
abs(sv) / 2912.70555f, sv < 0 ? "W" : "E", sv);
|
||||
|
||||
/* FIXME: The specs says >0 is West ... but it doesn't seem to
|
||||
|
@ -302,11 +302,11 @@ static void
|
|||
rach_sp_hplmn_id_fmt(gchar *s, guint32 v)
|
||||
{
|
||||
if (v == 0xfffff) {
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%05x (Null)", v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%05x (Null)", v);
|
||||
} else if ((v & 0xf8000) == 0xf8000) {
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%05x (SP ID %4d)", v, v & 0x7fff);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%05x (SP ID %4d)", v, v & 0x7fff);
|
||||
} else {
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%05x (HPLMN ID)", v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%05x (HPLMN ID)", v);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -322,20 +322,20 @@ static void
|
|||
rach_dialed_num_grp1234_fmt(gchar *s, guint32 v)
|
||||
{
|
||||
if (v <= 999) {
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%03d", v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%03d", v);
|
||||
} else if (v == 1023) {
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH,
|
||||
snprintf(s, ITEM_LABEL_LENGTH,
|
||||
"All digits in the preceding group are valid (%d)", v);
|
||||
} else if (v == 1022) {
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH,
|
||||
snprintf(s, ITEM_LABEL_LENGTH,
|
||||
"First two digits in the preceding group are valid, "
|
||||
"and the third digit (i.e. 0) is padding (%d)", v);
|
||||
} else if (v == 1021) {
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH,
|
||||
snprintf(s, ITEM_LABEL_LENGTH,
|
||||
"First digit in the preceding group is valid, and "
|
||||
"the second and third 0s are padding (%d)", v);
|
||||
} else {
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid (%d)", v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "Invalid (%d)", v);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -343,9 +343,9 @@ static void
|
|||
rach_dialed_num_grp5_fmt(gchar *s, guint32 v)
|
||||
{
|
||||
if (v >= 1100 && v <= 1199) {
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%02d (%d)", v - 1100, v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%02d (%d)", v - 1100, v);
|
||||
} else if (v >= 1200 && v <= 1209) {
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%01d (%d)", v - 1200, v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%01d (%d)", v - 1200, v);
|
||||
} else {
|
||||
rach_dialed_num_grp1234_fmt(s, v);
|
||||
}
|
||||
|
@ -355,9 +355,9 @@ static void
|
|||
rach_gps_timestamp_fmt(gchar *s, guint32 v)
|
||||
{
|
||||
if (v == 0xffff) {
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, ">= 65535 minutes or N/A (%04x)", v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, ">= 65535 minutes or N/A (%04x)", v);
|
||||
} else {
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%d minutes (%04x)", v, v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%d minutes (%04x)", v, v);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -475,38 +475,38 @@ _parse_dialed_number(gchar *s, int slen, tvbuff_t *tvb, int offset)
|
|||
if (grp[i+1] <= 999)
|
||||
{
|
||||
/* All digits of group are valid */
|
||||
rv += g_snprintf(s + rv, slen - rv, "%03d", grp[i]);
|
||||
rv += snprintf(s + rv, slen - rv, "%03d", grp[i]);
|
||||
}
|
||||
else if (grp[i+1] == 1023)
|
||||
{
|
||||
/* Last group and all digits are valid */
|
||||
rv += g_snprintf(s + rv, slen - rv, "%03d", grp[i]);
|
||||
rv += snprintf(s + rv, slen - rv, "%03d", grp[i]);
|
||||
done = 1;
|
||||
break;
|
||||
}
|
||||
else if (grp[i+1] == 1022)
|
||||
{
|
||||
/* Last group and first two digits are valid */
|
||||
rv += g_snprintf(s + rv, slen - rv, "%02d", grp[i] / 10);
|
||||
rv += snprintf(s + rv, slen - rv, "%02d", grp[i] / 10);
|
||||
done = 1;
|
||||
break;
|
||||
}
|
||||
else if (grp[i+1] == 1021)
|
||||
{
|
||||
/* Last group and first digit is valid */
|
||||
rv += g_snprintf(s + rv, slen - rv, "%01d", grp[i] / 100);
|
||||
rv += snprintf(s + rv, slen - rv, "%01d", grp[i] / 100);
|
||||
done = 1;
|
||||
break;
|
||||
}
|
||||
else if ((i==3) && (grp[i+1] >= 1100) && (grp[i+1] <= 1209))
|
||||
{
|
||||
/* All digits of group are valid */
|
||||
rv += g_snprintf(s + rv, slen - rv, "%03d", grp[i]);
|
||||
rv += snprintf(s + rv, slen - rv, "%03d", grp[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Invalid */
|
||||
return g_snprintf(s, slen, "(Invalid)");
|
||||
return snprintf(s, slen, "(Invalid)");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -514,22 +514,22 @@ _parse_dialed_number(gchar *s, int slen, tvbuff_t *tvb, int offset)
|
|||
if (grp[4] <= 999)
|
||||
{
|
||||
/* All digits are valid */
|
||||
rv += g_snprintf(s + rv, slen - rv, "%03d", grp[4]);
|
||||
rv += snprintf(s + rv, slen - rv, "%03d", grp[4]);
|
||||
}
|
||||
else if (grp[4] >= 1100 && grp[4] <= 1199)
|
||||
{
|
||||
/* Only two digits are valid */
|
||||
rv += g_snprintf(s + rv, slen - rv, "%02d", grp[4] - 1100);
|
||||
rv += snprintf(s + rv, slen - rv, "%02d", grp[4] - 1100);
|
||||
}
|
||||
else if (grp[4] >= 1200 && grp[4] <= 1209)
|
||||
{
|
||||
/* Only one digit is valid */
|
||||
rv += g_snprintf(s + rv, slen - rv, "%01d", grp[4] - 1200);
|
||||
rv += snprintf(s + rv, slen - rv, "%01d", grp[4] - 1200);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Invalid */
|
||||
return g_snprintf(s, slen, "(Invalid)");
|
||||
return snprintf(s, slen, "(Invalid)");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -262,7 +262,7 @@ static const value_string rr_gen_ie_presence_vals[] = {
|
|||
static void
|
||||
rr_gen_ie_seconds_fmt(gchar *s, guint32 v)
|
||||
{
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%u seconds", v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%u seconds", v);
|
||||
}
|
||||
|
||||
|
||||
|
@ -477,7 +477,7 @@ rr_timing_ofs_value_fmt(gchar *s, guint32 v)
|
|||
{
|
||||
gint32 sv = (signed)v;
|
||||
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%.3f symbols ( ~ %.3f ms )",
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%.3f symbols ( ~ %.3f ms )",
|
||||
sv / 40.0f, (sv / 40.0f) * (10.0f / 234.0f));
|
||||
}
|
||||
|
||||
|
@ -577,7 +577,7 @@ rr_freq_ofs_value_fmt(gchar *s, guint32 v)
|
|||
{
|
||||
gint32 sv = (signed)v;
|
||||
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%d Hz", sv);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%d Hz", sv);
|
||||
}
|
||||
|
||||
GMR1_IE_FUNC(gmr1_ie_rr_freq_ofs)
|
||||
|
@ -674,13 +674,13 @@ static const value_string rr_pos_upd_info_v_vals[] = {
|
|||
static void
|
||||
rr_pos_upd_info_dist_fmt(gchar *s, guint32 v)
|
||||
{
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%d km", v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%d km", v);
|
||||
}
|
||||
|
||||
static void
|
||||
rr_pos_upd_info_time_fmt(gchar *s, guint32 v)
|
||||
{
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%d minutes", v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%d minutes", v);
|
||||
}
|
||||
|
||||
GMR1_IE_FUNC(gmr1_ie_rr_pos_upd_info)
|
||||
|
@ -775,9 +775,9 @@ static void
|
|||
rr_gps_timestamp_fmt(gchar *s, guint32 v)
|
||||
{
|
||||
if (v == 0xffff)
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "> 65535 minutes or N/A");
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "> 65535 minutes or N/A");
|
||||
else
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%d minutes", v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%d minutes", v);
|
||||
}
|
||||
|
||||
GMR1_IE_FUNC(gmr1_ie_rr_gps_timestamp)
|
||||
|
@ -816,7 +816,7 @@ GMR1_IE_FUNC(gmr1_ie_rr_tmsi_avail_msk)
|
|||
static void
|
||||
rr_gps_almanac_pn_fmt(gchar *s, guint32 v)
|
||||
{
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%d", v+1);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%d", v+1);
|
||||
}
|
||||
|
||||
static const value_string rr_gps_almanac_sfn_vals[] = {
|
||||
|
@ -940,7 +940,7 @@ static const crumb_spec_t rr_pkt_freq_prm_ul_freq_dist_crumbs[] = {
|
|||
static void
|
||||
rr_pkt_freq_prm_xx_bw_fmt(gchar *s, guint32 v)
|
||||
{
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%d * 31.25 kHz = %.2f kHz (%d)", v, 31.25f*v, v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%d * 31.25 kHz = %.2f kHz (%d)", v, 31.25f*v, v);
|
||||
}
|
||||
|
||||
GMR1_IE_FUNC(gmr1_ie_rr_pkt_freq_prm)
|
||||
|
@ -1135,11 +1135,11 @@ static void
|
|||
rr_pkt_pwr_ctrl_prm_par_fmt(gchar *s, guint32 v)
|
||||
{
|
||||
if (v >= 61) {
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "Escape %d (%d)", v-60, v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "Escape %d (%d)", v-60, v);
|
||||
return;
|
||||
}
|
||||
|
||||
g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f dB (%d)", v*0.4f, v);
|
||||
snprintf(s, ITEM_LABEL_LENGTH, "%.1f dB (%d)", v*0.4f, v);
|
||||
}
|
||||
|
||||
GMR1_IE_FUNC(gmr1_ie_rr_pkt_pwr_ctrl_prm)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue