forked from osmocom/wireshark
4e1b5ea866
Change-Id: I1a317b19d8076588c9305dae6287bb80cc14da64 Reviewed-on: https://code.wireshark.org/review/4494 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
77 lines
1.5 KiB
INI
77 lines
1.5 KiB
INI
# sv.cnf
|
|
# SampledValue conformation file
|
|
|
|
#.MODULE_IMPORT
|
|
|
|
#.EXPORTS
|
|
|
|
#.PDU_NEW
|
|
|
|
#.NO_EMIT ONLY_VALS
|
|
SampledValues
|
|
|
|
#.TYPE_RENAME
|
|
|
|
#.FIELD_RENAME
|
|
|
|
#.FN_BODY ASDU/smpCnt VAL_PTR = &value
|
|
guint32 value;
|
|
%(DEFAULT_BODY)s
|
|
sv_data.smpCnt = value;
|
|
#.END
|
|
|
|
#.FN_BODY UtcTime
|
|
guint32 len;
|
|
guint32 seconds;
|
|
guint32 fraction;
|
|
guint32 nanoseconds;
|
|
nstime_t ts;
|
|
gchar * ptime;
|
|
|
|
len = tvb_length_remaining(tvb, offset);
|
|
|
|
if(len != 8)
|
|
{
|
|
proto_tree_add_expert_format(tree, actx->pinfo, &ei_sv_mal_utctime, tvb, offset, len,
|
|
"BER Error: malformed UTCTime encoding, length must be 8 bytes");
|
|
if(hf_index >= 0)
|
|
{
|
|
proto_tree_add_string(tree, hf_index, tvb, offset, len, "????");
|
|
}
|
|
return offset;
|
|
}
|
|
|
|
seconds = tvb_get_ntohl(tvb, offset);
|
|
fraction = tvb_get_ntoh24(tvb, offset+4) * 0x100; /* Only 3 bytes are recommended */
|
|
nanoseconds = (guint32)( ((guint64)fraction * G_GUINT64_CONSTANT(1000000000)) / G_GUINT64_CONSTANT(0x100000000) ) ;
|
|
|
|
ts.secs = seconds;
|
|
ts.nsecs = nanoseconds;
|
|
|
|
ptime = abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_UTC, TRUE);
|
|
|
|
if(hf_index >= 0)
|
|
{
|
|
proto_tree_add_string(tree, hf_index, tvb, offset, len, ptime);
|
|
}
|
|
offset += 8;
|
|
return offset;
|
|
#.END
|
|
|
|
#.TYPE_ATTR
|
|
UtcTime TYPE = FT_STRING DISPLAY = BASE_NONE
|
|
|
|
#.FN_BODY ASDU/smpSynch VAL_PTR = &value
|
|
guint32 value;
|
|
%(DEFAULT_BODY)s
|
|
sv_data.smpSynch = value;
|
|
#.END
|
|
|
|
#.FN_BODY ASDU/smpMod VAL_PTR = &value
|
|
guint32 value;
|
|
%(DEFAULT_BODY)s
|
|
sv_data.smpMod = value;
|
|
#.END
|
|
|
|
#.END_OF_CNF
|