2 # mms conformation file
7 #.IMPORT ../acse/acse-exp.cnf
19 TimeOfDay TYPE = FT_STRING DISPLAY = BASE_NONE
20 UtcTime TYPE = FT_STRING DISPLAY = BASE_NONE
24 #.FN_BODY ApplicationReference/ap-title
25 offset=dissect_acse_AP_title(FALSE, tvb, offset, actx, tree, hf_mms_ap_title);
27 #.FN_BODY ApplicationReference/ap-invocation-id
28 offset=dissect_acse_AP_invocation_identifier(FALSE, tvb, offset, actx, tree, hf_mms_ap_invocation_id);
30 #.FN_BODY ApplicationReference/ae-qualifier
31 offset=dissect_acse_AE_qualifier(FALSE, tvb, offset, actx, tree, hf_mms_ae_qualifier);
33 #.FN_BODY ApplicationReference/ae-invocation-id
34 offset=dissect_acse_AE_invocation_identifier(FALSE, tvb, offset, actx, tree, hf_mms_ae_invocation_id);
36 #.FN_BODY MMSpdu VAL_PTR=&branch_taken
41 if( (branch_taken!=-1) && mms_MMSpdu_vals[branch_taken].strptr ){
42 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%%s ", mms_MMSpdu_vals[branch_taken].strptr);
55 len = tvb_reported_length_remaining(tvb, offset);
59 milliseconds = tvb_get_ntohl(tvb, offset);
60 ptime = time_msecs_to_str(wmem_packet_scope(), milliseconds);
64 proto_tree_add_string(tree, hf_index, tvb, offset, len, ptime);
71 milliseconds = tvb_get_ntohl(tvb, offset);
72 days = tvb_get_ntohs(tvb, offset+4);
74 /* 5113 days between 01-01-1970 and 01-01-1984 */
75 /* 86400 seconds in one day */
77 ts.secs = (days + 5113) * 86400 + milliseconds / 1000;
78 ts.nsecs = (milliseconds %% 1000) * 1000000U;
80 ptime = abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_UTC, TRUE);
83 proto_tree_add_string(tree, hf_index, tvb, offset, len, ptime);
89 proto_tree_add_expert_format(tree, actx->pinfo, &ei_mms_mal_timeofday_encoding,
90 tvb, offset, len, "BER Error: malformed TimeOfDay encoding, length must be 4 or 6 bytes");
93 proto_tree_add_string(tree, hf_index, tvb, offset, len, "????");
107 len = tvb_reported_length_remaining(tvb, offset);
111 proto_tree_add_expert_format(tree, actx->pinfo, &ei_mms_mal_utctime_encoding,
112 tvb, offset, len, "BER Error: malformed IEC61850 UTCTime encoding, length must be 8 bytes");
115 proto_tree_add_string(tree, hf_index, tvb, offset, len, "????");
120 seconds = tvb_get_ntohl(tvb, offset);
121 fraction = tvb_get_ntoh24(tvb, offset+4) * 0x100; /* Only 3 bytes are recommended */
122 nanoseconds = (guint32)( ((guint64)fraction * G_GUINT64_CONSTANT(1000000000)) / G_GUINT64_CONSTANT(0x100000000) ) ;
125 ts.nsecs = nanoseconds;
127 ptime = abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_UTC, TRUE);
131 proto_tree_add_string(tree, hf_index, tvb, offset, len, ptime);