diff options
author | Paul Thomas <pthomas8589@gmail.com> | 2017-12-20 12:51:28 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-12-21 00:08:44 +0000 |
commit | 530fd0a4d02c55c3dceec800d5c19803f7eddd3b (patch) | |
tree | a7b9e2358fec3c86fb1437823bacdf3270167066 /epan/dissectors/packet-dnp.c | |
parent | 798b937d97f86f45484d195b778571807e5da8f2 (diff) |
DNP3: Fix timestamps on command event objects
Before if (al_obj & 0x02) was incorrectly being used to test if it was a
variation with a timestamp.
Now it is done in the same manor as Object 21 with a switch statement
that falls through if it isn't a timestamp variation.
Change-Id: I9adaf9c0be3ad01f1cf87ba09f47257daeadb47c
Reviewed-on: https://code.wireshark.org/review/24915
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-dnp.c')
-rw-r--r-- | epan/dissectors/packet-dnp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c index 2f5aa224b6..30dedcb5e1 100644 --- a/epan/dissectors/packet-dnp.c +++ b/epan/dissectors/packet-dnp.c @@ -2175,12 +2175,18 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, } /* Get the timestamp */ - if (al_obj & 0x02) + switch(al_obj) { + case AL_OBJ_BOE_TIME: /* Binary Command Event with time (Obj:13, Var:02) */ + case AL_OBJ_AOC_32EVTT: /* 32-bit Analog Command Event with time (Obj:43, Var:03) */ + case AL_OBJ_AOC_16EVTT: /* 16-bit Analog Command Event with time (Obj:43, Var:04) */ + case AL_OBJ_AOC_FLTEVTT: /* 32-bit Floating Point Analog Command Event with time (Obj:43, Var:07) */ + case AL_OBJ_AOC_DBLEVTT: /* 64-bit Floating Point Analog Command Event with time (Obj:43, Var:08) */ dnp3_al_get_timestamp(&al_abstime, tvb, data_pos); proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_str(wmem_packet_scope(), &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); proto_tree_add_time(point_tree, hf_dnp3_al_timestamp, tvb, data_pos, 6, &al_abstime); data_pos += 6; + break; } proto_item_set_len(point_item, data_pos - offset); |