diff options
author | morriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-02-09 03:24:12 +0000 |
---|---|---|
committer | morriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-02-09 03:24:12 +0000 |
commit | 515fcf92bcc9186362502f01c1299a1d923169ca (patch) | |
tree | de104b3427d8c0eee621a6bd8b9bf09c56b7243b /epan/dissectors/packet-zep.c | |
parent | 2c086094edb447cb4d9a22c0903fa14e8d3f9a06 (diff) |
A couple of dissectors have/need an NTP-to-nstime routine, so put it in
packet-ntp and export it to the other dissectors.
Move some macros (now) only used in packet-ntp.c into that file.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35887 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-zep.c')
-rw-r--r-- | epan/dissectors/packet-zep.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/epan/dissectors/packet-zep.c b/epan/dissectors/packet-zep.c index 8bfe9ae6a3..673ed37198 100644 --- a/epan/dissectors/packet-zep.c +++ b/epan/dissectors/packet-zep.c @@ -88,28 +88,6 @@ static dissector_handle_t data_handle; static dissector_handle_t ieee802154_handle; static dissector_handle_t ieee802154_ccfcs_handle; - -/*FUNCTION:------------------------------------------------------ - * NAME - * ntp_to_nstime - * DESCRIPTION - * Converts a timestamp from ntp format to nstime format. - * PARAMETERS - * guint32 ntp_secs; - * guint32 ntp_fraction; - * struct *nstime_ptr; - * RETURNS - * void - *--------------------------------------------------------------- - */ -static void ntp_to_nstime(guint32 ntp_secs, guint32 ntp_fraction, nstime_t *nstime_ptr) -{ - double temp; - nstime_ptr->secs = (ntp_secs >= NTP_BASETIME) ? ntp_secs - NTP_BASETIME : ntp_secs; - temp = (double)ntp_fraction / 4.294967296; /* 4.294967296 = (2<<32 / 10<<9) */ - nstime_ptr->nsecs = (guint32) temp; -} /* ntp_to_nstime */ - /*FUNCTION:------------------------------------------------------ * NAME * dissect_zep @@ -174,7 +152,7 @@ static void dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) zep_data.device_id = tvb_get_ntohs(tvb, 5); zep_data.lqi_mode = tvb_get_guint8(tvb, 7)?1:0; zep_data.lqi = tvb_get_guint8(tvb, 8); - ntp_to_nstime(tvb_get_ntohl(tvb, 9), tvb_get_ntohl(tvb, 13), &(zep_data.ntp_time)); + ntp_to_nstime(tvb, 9, &(zep_data.ntp_time)); zep_data.seqno = tvb_get_ntohl(tvb, 17); ieee_packet_len = (tvb_get_guint8(tvb, ZEP_V2_HEADER_LEN - 1) & ZEP_LENGTH_MASK); } |