packet.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5238
f5534014-38df-0310-8fa8-
9805f1628bb7
/* packet-ldp.c
* Routines for LDP (RFC 3036) packet disassembly
*
/* packet-ldp.c
* Routines for LDP (RFC 3036) packet disassembly
*
- * $Id: packet-ldp.c,v 1.33 2002/04/24 19:16:49 guy Exp $
+ * $Id: packet-ldp.c,v 1.34 2002/04/24 19:26:18 guy Exp $
*
* Copyright (c) November 2000 by Richard Sharpe <rsharpe@ns.aus.com>
*
*
* Copyright (c) November 2000 by Richard Sharpe <rsharpe@ns.aus.com>
*
dissect_tlv_traffic(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
{
proto_tree *ti = NULL, *val_tree = NULL;
dissect_tlv_traffic(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
{
proto_tree *ti = NULL, *val_tree = NULL;
- union {
- guint32 val_32;
- float val_f;
- } conv;
proto_item *pi;
if (tree != NULL) {
proto_item *pi;
if (tree != NULL) {
/* reserver byte */
offset ++;
/* reserver byte */
offset ++;
pi = proto_tree_add_item(val_tree, hf_ldp_tlv_weight, tvb, offset, 1, FALSE);
val_8 = tvb_get_guint8(tvb, offset);
if (val_8 == 0)
pi = proto_tree_add_item(val_tree, hf_ldp_tlv_weight, tvb, offset, 1, FALSE);
val_8 = tvb_get_guint8(tvb, offset);
if (val_8 == 0)
- conv.val_32 = tvb_get_ntohl (tvb, offset);
+ val_f = tvb_get_ntohieee_float (tvb, offset);
proto_tree_add_double_format(val_tree, hf_ldp_tlv_pdr, tvb, offset,
proto_tree_add_double_format(val_tree, hf_ldp_tlv_pdr, tvb, offset,
- 4, conv.val_f, "PDR: %f Bps", conv.val_f);
+ 4, val_f, "PDR: %f Bps", val_f);
- conv.val_32 = (float)tvb_get_ntohl (tvb, offset);
+ val_f = tvb_get_ntohieee_float (tvb, offset);
proto_tree_add_double_format(val_tree, hf_ldp_tlv_pbs, tvb, offset,
proto_tree_add_double_format(val_tree, hf_ldp_tlv_pbs, tvb, offset,
- 4, conv.val_f, "PBS: %f Bytes", conv.val_f);
+ 4, val_f, "PBS: %f Bytes", val_f);
- conv.val_32 = (float)tvb_get_ntohl (tvb, offset);
+ val_f = tvb_get_ntohieee_float (tvb, offset);
proto_tree_add_double_format(val_tree, hf_ldp_tlv_cdr, tvb, offset,
proto_tree_add_double_format(val_tree, hf_ldp_tlv_cdr, tvb, offset,
- 4, conv.val_f, "CDR: %f Bps", conv.val_f);
+ 4, val_f, "CDR: %f Bps", val_f);
- conv.val_32 = (float)tvb_get_ntohl (tvb, offset);
+ val_f = tvb_get_ntohieee_float (tvb, offset);
proto_tree_add_double_format(val_tree, hf_ldp_tlv_cbs, tvb, offset,
proto_tree_add_double_format(val_tree, hf_ldp_tlv_cbs, tvb, offset,
- 4, conv.val_f, "CBS: %f Bytes", conv.val_f);
+ 4, val_f, "CBS: %f Bytes", val_f);
- conv.val_32 = (float)tvb_get_ntohl (tvb, offset);
+ val_f = tvb_get_ntohieee_float (tvb, offset);
proto_tree_add_double_format(val_tree, hf_ldp_tlv_ebs, tvb, offset,
proto_tree_add_double_format(val_tree, hf_ldp_tlv_ebs, tvb, offset,
- 4, conv.val_f, "EBS: %f Bytes", conv.val_f);
+ 4, val_f, "EBS: %f Bytes", val_f);