#include <time.h>
#include <epan/packet.h>
+#include "packet-ntp.h"
/* Initialize the protocol and registered fields */
static int proto_mip = -1;
/* Port used for Mobile IP */
#define UDP_PORT_MIP 434
-#define NTP_BASETIME 2208988800ul
typedef enum {
REGISTRATION_REQUEST = 1,
proto_tree *flags_tree;
guint8 type;
guint8 flags;
- nstime_t ident_time;
size_t offset=0;
+ const guint8 *reftime;
+ gchar buff[NTP_TS_SIZE];
/* Make entries in Protocol column and Info column on summary display */
proto_tree_add_item(mip_tree, hf_mip_coa, tvb, offset, 4, FALSE);
offset += 4;
- /* Identifier */
- ident_time.secs = tvb_get_ntohl(tvb,16)-(guint32) NTP_BASETIME;
- ident_time.nsecs = tvb_get_ntohl(tvb,20)*1000;
- proto_tree_add_time(mip_tree, hf_mip_ident, tvb, offset, 8, &ident_time);
+ /* Identifier - assumed to be an NTP time here */
+ reftime = tvb_get_ptr(tvb, offset, 8);
+ proto_tree_add_bytes_format(mip_tree, hf_mip_ident, tvb, offset, 8,
+ reftime,
+ "Identification: %s",
+ ntp_fmt_ts(reftime, buff));
offset += 8;
} /* if tree */
proto_tree_add_item(mip_tree, hf_mip_haaddr, tvb, offset, 4, FALSE);
offset += 4;
- /* Identifier */
- ident_time.secs = tvb_get_ntohl(tvb,12)-(guint32) NTP_BASETIME;
- ident_time.nsecs = tvb_get_ntohl(tvb,16)*1000;
- proto_tree_add_time(mip_tree, hf_mip_ident, tvb, offset, 8, &ident_time);
+ /* Identifier - assumed to be an NTP time here */
+ reftime = tvb_get_ptr(tvb, offset, 8);
+ proto_tree_add_bytes_format(mip_tree, hf_mip_ident, tvb, offset, 8,
+ reftime,
+ "Identification: %s",
+ ntp_fmt_ts(reftime, buff));
offset += 8;
} /* if tree */
},
{ &hf_mip_ident,
{ "Identification", "mip.ident",
- FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0,
+ FT_BYTES, BASE_NONE, NULL, 0,
"MN Identification.", HFILL }
},
{ &hf_mip_ext_type,