/* Adds the result of 2 SDNVs to tree: First SDNV is seconds, next is nanoseconds. Returns bytes in both SDNVs or 0 if something goes wrong.  */
static int add_dtn_time_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_dtn_time)
/* Adds the result of 2 SDNVs to tree: First SDNV is seconds, next is nanoseconds. Returns bytes in both SDNVs or 0 if something goes wrong.  */
static int add_dtn_time_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_dtn_time)
{
    nstime_t dtn_time;
    int      sdnv_length, sdnv2_length;
    int      sdnv_value;
    int      orig_offset;
    orig_offset = offset;
    sdnv_value = evaluate_sdnv(tvb, offset, &sdnv_length);
    if (sdnv_value < 0) {
        return 0;
    }
    dtn_time.secs = (time_t)(sdnv_value + 946684800);
    offset += sdnv_length;
    dtn_time.nsecs = evaluate_sdnv(tvb, offset, &sdnv2_length);
    if (dtn_time.nsecs < 0) {
        return 0;
    }
    proto_tree_add_time(tree, hf_dtn_time, tvb, orig_offset, sdnv_length + sdnv2_length, &dtn_time);
    return (sdnv_length + sdnv2_length);
}