aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2020-01-21 14:26:38 -0800
committerGuy Harris <guy@alum.mit.edu>2020-01-21 23:37:05 +0000
commita152e041fa893ba672dcb1337c596ec15fdb0c0d (patch)
tree17debde7ec0104d70d12e67bb4e5d8764ef076d1 /epan/dissectors/asn1
parentd44c5e45cbb5e9ece96cab6a62793dd24ec52b7d (diff)
Put various epoch time deltas into wsutil/epochs.h.
There are some deltas between the UN*X epoch and other epochs that are used in a number of places; put them into a header. Change-Id: Ia2d9d69b9d91352d730d97d9e4897518635b4861 Reviewed-on: https://code.wireshark.org/review/35895 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/asn1')
-rw-r--r--epan/dissectors/asn1/lte-rrc/lte-rrc.cnf2
-rw-r--r--epan/dissectors/asn1/lte-rrc/packet-lte-rrc-template.c1
-rw-r--r--epan/dissectors/asn1/nr-rrc/nr-rrc.cnf2
-rw-r--r--epan/dissectors/asn1/nr-rrc/packet-nr-rrc-template.c1
4 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/asn1/lte-rrc/lte-rrc.cnf b/epan/dissectors/asn1/lte-rrc/lte-rrc.cnf
index 819688c10b..601afdf2d7 100644
--- a/epan/dissectors/asn1/lte-rrc/lte-rrc.cnf
+++ b/epan/dissectors/asn1/lte-rrc/lte-rrc.cnf
@@ -1044,7 +1044,7 @@ SystemInformationBlockType16-r11/timeInfo-r11/localTimeOffset-r11 DISPLAY=BASE_C
#.FN_FTR SystemInformationBlockType16-r11/timeInfo-r11/timeInfoUTC-r11
subtree = proto_item_add_subtree(actx->created_item, ett_lte_rrc_timeInfo);
- ts.secs = (time_t)(timeInfo/100)-2208988800U; /* epoch is 00:00:00 (midnight) UTC on 1900-01-01 */
+ ts.secs = (time_t)(timeInfo/100)-EPOCH_DELTA_1900_01_01_00_00_00_UTC; /* epoch is 00:00:00 (midnight) UTC on 1900-01-01 */
ts.nsecs = (int)(timeInfo%100)*10000000;
proto_tree_add_time(subtree, hf_lte_rrc_utc_time, tvb, old_offset>>3, (old_offset&0x07) ? 6 : 5, &ts);
proto_tree_add_time(subtree, hf_lte_rrc_local_time, tvb, old_offset>>3, (old_offset&0x07) ? 6 : 5, &ts);
diff --git a/epan/dissectors/asn1/lte-rrc/packet-lte-rrc-template.c b/epan/dissectors/asn1/lte-rrc/packet-lte-rrc-template.c
index 33d4d7201e..7103851c5a 100644
--- a/epan/dissectors/asn1/lte-rrc/packet-lte-rrc-template.c
+++ b/epan/dissectors/asn1/lte-rrc/packet-lte-rrc-template.c
@@ -26,6 +26,7 @@
#include <epan/proto_data.h>
#include <wsutil/str_util.h>
+#include <wsutil/epochs.h>
#include "packet-per.h"
#include "packet-rrc.h"
diff --git a/epan/dissectors/asn1/nr-rrc/nr-rrc.cnf b/epan/dissectors/asn1/nr-rrc/nr-rrc.cnf
index af4906dcd3..c4050bc23d 100644
--- a/epan/dissectors/asn1/nr-rrc/nr-rrc.cnf
+++ b/epan/dissectors/asn1/nr-rrc/nr-rrc.cnf
@@ -702,7 +702,7 @@ SIB8/messageIdentifier TYPE=FT_UINT16 DISPLAY=BASE_DEC|BASE_EXT_STRING STRINGS=&
#.FN_FTR SIB9/timeInfo/timeInfoUTC
subtree = proto_item_add_subtree(actx->created_item, ett_nr_rrc_timeInfo);
- ts.secs = (time_t)(timeInfo/100)-2208988800U; /* epoch is 00:00:00 (midnight) UTC on 1900-01-01 */
+ ts.secs = (time_t)(timeInfo/100)-EPOCH_DELTA_1900_01_01_00_00_00_UTC; /* epoch is 00:00:00 (midnight) UTC on 1900-01-01 */
ts.nsecs = (int)(timeInfo%100)*10000000;
proto_tree_add_time(subtree, hf_nr_rrc_utc_time, tvb, old_offset>>3, (old_offset&0x07) ? 6 : 5, &ts);
proto_tree_add_time(subtree, hf_nr_rrc_local_time, tvb, old_offset>>3, (old_offset&0x07) ? 6 : 5, &ts);
diff --git a/epan/dissectors/asn1/nr-rrc/packet-nr-rrc-template.c b/epan/dissectors/asn1/nr-rrc/packet-nr-rrc-template.c
index 72c0d16091..2876ac62d6 100644
--- a/epan/dissectors/asn1/nr-rrc/packet-nr-rrc-template.c
+++ b/epan/dissectors/asn1/nr-rrc/packet-nr-rrc-template.c
@@ -24,6 +24,7 @@
#include <epan/proto_data.h>
#include <wsutil/str_util.h>
+#include <wsutil/epochs.h>
#include "packet-per.h"
#include "packet-gsm_map.h"