aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-08-22 00:31:58 +0000
committerGuy Harris <guy@alum.mit.edu>2004-08-22 00:31:58 +0000
commitc68f62210fc20890502cb84dbc2ea4321de5b791 (patch)
treed7311a179eacd5a137e9e874b3bf2d0e15377de6 /epan/tvbuff.c
parent9dcb077e460619b8ab54810e4fef850a0799bcde (diff)
Add "tvb_get_ntoh64()" and "tvb_get_letoh64()" routines to fetch 64-bit
integers. Make FT_INT64 and FT_UINT64 add numerical values, rather than byte-array values, to the protocol tree, and add routines to add specified 64-bit integer values to the protocol tree. Use those routines in the RSVP dissector. svn path=/trunk/; revision=11796
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r--epan/tvbuff.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index 575114fdbc..eee139ff54 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -1052,6 +1052,15 @@ tvb_get_ntohl(tvbuff_t *tvb, gint offset)
return pntohl(ptr);
}
+guint64
+tvb_get_ntoh64(tvbuff_t *tvb, gint offset)
+{
+ const guint8* ptr;
+
+ ptr = ensure_contiguous(tvb, offset, sizeof(guint64));
+ return pntoh64(ptr);
+}
+
/*
* Stuff for IEEE float handling on platforms that don't have IEEE
* format as the native floating-point format.
@@ -1282,6 +1291,15 @@ tvb_get_letohl(tvbuff_t *tvb, gint offset)
return pletohl(ptr);
}
+guint64
+tvb_get_letoh64(tvbuff_t *tvb, gint offset)
+{
+ const guint8* ptr;
+
+ ptr = ensure_contiguous(tvb, offset, sizeof(guint64));
+ return pletoh64(ptr);
+}
+
/*
* Fetches an IEEE single-precision floating-point number, in
* little-endian form, and returns a "float".