Commit 1d7eee00 authored by berge's avatar berge
Browse files

Fixed value incorrectly set to 0 when copying some fields

parent c3483b48
Loading
Loading
Loading
Loading
+18 −18
Original line number Diff line number Diff line
@@ -533,7 +533,7 @@ static int tree_gn_cert_time64(tvbuff_t *tvb, proto_tree *ext_tree, int hf_gn_ty
  strftime(time_buf, 255, "%Y-%m-%d %H:%M:%S", time_tm);
  time_buf[255] = '\0';

  proto_tree_add_uint64_format(ext_tree, hf_gn_type, tvb, offset, 8, FALSE,
  proto_tree_add_uint64_format(ext_tree, hf_gn_type, tvb, offset, 8, time64_us,
			       "Generation Time: %19s.%06d (%lld)",
                               time_buf, time_us, time64_us);     

@@ -553,7 +553,7 @@ static int tree_gn_cert_time32(tvbuff_t *tvb, proto_tree *ext_tree, int hf_gn_ty
  time_tm = gmtime(&time_sec);
  strftime(time_buf, 40, "%Y-%m-%d %H:%M:%S", time_tm);

  proto_tree_add_uint_format(ext_tree, hf_gn_type, tvb, offset, 4, FALSE,
  proto_tree_add_uint_format(ext_tree, hf_gn_type, tvb, offset, 4, time32_s,
                             "Time: %19s (%d)",
                             time_buf, time32_s);
  return 4;
@@ -576,7 +576,7 @@ static int tree_gn_3dpos(tvbuff_t *tvb, proto_tree *ext_tree, int offset)
  /* Latitude */
  tmp_ll = (gint32)tvb_get_ntohl(tvb, offset);
  coordinate = tmp_ll / 10000000.0;
  proto_tree_add_int_format_value(loc_tree, hf_gn_area_lat, tvb, offset, 4, FALSE,
  proto_tree_add_int_format_value(loc_tree, hf_gn_area_lat, tvb, offset, 4, tmp_ll,
				  "%02d°%02d'%02.2f\"%c (%d)",
				  abs((int)coordinate),
				  abs((int)((coordinate - (int)coordinate) * 60)),
@@ -590,7 +590,7 @@ static int tree_gn_3dpos(tvbuff_t *tvb, proto_tree *ext_tree, int offset)
  /* Longitude */
  tmp_ll = (gint32)tvb_get_ntohl(tvb, offset);
  coordinate = tmp_ll / 10000000.0;
  proto_tree_add_int_format_value(loc_tree, hf_gn_area_long, tvb, offset, 4, FALSE,
  proto_tree_add_int_format_value(loc_tree, hf_gn_area_long, tvb, offset, 4, tmp_ll,
				  "%02d°%02d'%02.2f\"%c (%d)",
				  abs((int)coordinate),
				  abs((int)((coordinate - (int)coordinate) * 60)),
@@ -602,7 +602,7 @@ static int tree_gn_3dpos(tvbuff_t *tvb, proto_tree *ext_tree, int offset)
  offset += 4;

  elevation = (guint16)(tvb_get_guint8(tvb, offset) << 8) | (guint16)tvb_get_guint8(tvb, offset + 1);
  proto_tree_add_uint_format_value(loc_tree, hf_gn_area_elev, tvb, offset, 2, FALSE,
  proto_tree_add_uint_format_value(loc_tree, hf_gn_area_elev, tvb, offset, 2, elevation,
				  "%d meter(s)",
				  elevation
				  );
@@ -628,7 +628,7 @@ static int tree_gn_2dpos(tvbuff_t *tvb, proto_tree *ext_tree, int offset)
  /* Latitude */
  tmp_ll = (gint32)tvb_get_ntohl(tvb, offset);
  coordinate = tmp_ll / 10000000.0;
  proto_tree_add_int_format_value(loc_tree, hf_gn_area_lat, tvb, offset, 4, FALSE,
  proto_tree_add_int_format_value(loc_tree, hf_gn_area_lat, tvb, offset, 4, tmp_ll,
				  "%02d°%02d'%02.2f\"%c (%d)",
				  abs((int)coordinate),
				  abs((int)((coordinate - (int)coordinate) * 60)),
@@ -642,7 +642,7 @@ static int tree_gn_2dpos(tvbuff_t *tvb, proto_tree *ext_tree, int offset)
  /* Longitude */
  tmp_ll = (gint32)tvb_get_ntohl(tvb, offset);
  coordinate = tmp_ll / 10000000.0;
  proto_tree_add_int_format_value(loc_tree, hf_gn_area_long, tvb, offset, 4, FALSE,
  proto_tree_add_int_format_value(loc_tree, hf_gn_area_long, tvb, offset, 4, tmp_ll,
				  "%02d°%02d'%02.2f\"%c (%d)",
				  abs((int)coordinate),
				  abs((int)((coordinate - (int)coordinate) * 60)),
@@ -826,7 +826,7 @@ static int tree_gn_sopv(tvbuff_t *tvb, proto_tree *header_tree, int offset)
  /* Latitude */
  tmp_ll = (gint32)tvb_get_ntohl(tvb, offset);
  coordinate = tmp_ll / 10000000.0;
  proto_tree_add_int_format_value(tree, hf_gn_so_lat, tvb, offset, 4, FALSE,
  proto_tree_add_int_format_value(tree, hf_gn_so_lat, tvb, offset, 4, tmp_ll,
				  "%02d°%02d'%02.2f\"%c (%d)",
				  abs((int)coordinate),
				  abs((int)((coordinate - (int)coordinate) * 60)),
@@ -839,7 +839,7 @@ static int tree_gn_sopv(tvbuff_t *tvb, proto_tree *header_tree, int offset)
  /* Longitude */
  tmp_ll = (gint32)tvb_get_ntohl(tvb, offset);
  coordinate = tmp_ll / 10000000.0;
  proto_tree_add_int_format_value(tree, hf_gn_so_long, tvb, offset, 4, FALSE,
  proto_tree_add_int_format_value(tree, hf_gn_so_long, tvb, offset, 4, tmp_ll,
				  "%02d°%02d'%02.2f\"%c (%d)",
				  abs((int)coordinate),
				  abs((int)((coordinate - (int)coordinate) * 60)),
@@ -857,7 +857,7 @@ static int tree_gn_sopv(tvbuff_t *tvb, proto_tree *header_tree, int offset)
  if((speed & M_SPEED_SIGN) == M_SPEED_SIGN) {
    speed |= M_PAI;
  }
  proto_tree_add_int_format_value(tree, hf_gn_so_speed, tvb, offset, 2, FALSE,
  proto_tree_add_int_format_value(tree, hf_gn_so_speed, tvb, offset, 2, speed,
				  "%.2f m/s | %.2f km/h (%d)",
				  speed / 100.0,
				  speed * 0.036,
@@ -866,7 +866,7 @@ static int tree_gn_sopv(tvbuff_t *tvb, proto_tree *header_tree, int offset)
  offset += 2;

  /* Heading */
  proto_tree_add_uint_format_value(tree, hf_gn_so_heading, tvb, offset, 2, FALSE,
  proto_tree_add_uint_format_value(tree, hf_gn_so_heading, tvb, offset, 2, tvb_get_ntohs(tvb, offset),
				   "%.1f° (%d)",
				   (tvb_get_ntohs(tvb, offset) % 3600) / 10.0,
				   tvb_get_ntohs(tvb, offset)
@@ -907,7 +907,7 @@ static int tree_gn_depv(tvbuff_t *tvb, proto_tree *header_tree, int offset)
  /* Latitude */
  tmp_ll = (gint32)tvb_get_ntohl(tvb, offset);
  coordinate = tmp_ll / 10000000.0;
  proto_tree_add_int_format_value(tree, hf_gn_de_lat, tvb, offset, 4, FALSE,
  proto_tree_add_int_format_value(tree, hf_gn_de_lat, tvb, offset, 4, tmp_ll,
				  "%02d°%02d'%02.2f\"%c (%d)",
				  abs((int)coordinate),
				  abs((int)((coordinate - (int)coordinate) * 60)),
@@ -920,7 +920,7 @@ static int tree_gn_depv(tvbuff_t *tvb, proto_tree *header_tree, int offset)
  /* Longitude */
  tmp_ll = (gint32)tvb_get_ntohl(tvb, offset);
  coordinate = tmp_ll / 10000000.0;
  proto_tree_add_int_format_value(tree, hf_gn_de_long, tvb, offset, 4, FALSE,
  proto_tree_add_int_format_value(tree, hf_gn_de_long, tvb, offset, 4, tmp_ll,
				  "%02d°%02d'%02.2f\"%c (%d)",
				  abs((int)coordinate),
				  abs((int)((coordinate - (int)coordinate) * 60)),
@@ -959,7 +959,7 @@ static int tree_gn_ext_geoarea(tvbuff_t *tvb, proto_tree *ext_tree, int offset)
  /* Latitude */
  tmp_ll = (gint32)tvb_get_ntohl(tvb, offset);
  coordinate = tmp_ll / 10000000.0;
  proto_tree_add_int_format_value(ext_tree, hf_gn_area_lat, tvb, offset, 4, FALSE,
  proto_tree_add_int_format_value(ext_tree, hf_gn_area_lat, tvb, offset, 4, tmp_ll,
				  "%02d°%02d'%02.2f\"%c (%d)",
				  abs((int)coordinate),
				  abs((int)((coordinate - (int)coordinate) * 60)),
@@ -972,7 +972,7 @@ static int tree_gn_ext_geoarea(tvbuff_t *tvb, proto_tree *ext_tree, int offset)
  /* Longitude */
  tmp_ll = (gint32)tvb_get_ntohl(tvb, offset);
  coordinate = tmp_ll / 10000000.0;
  proto_tree_add_int_format_value(ext_tree, hf_gn_area_long, tvb, offset, 4, FALSE,
  proto_tree_add_int_format_value(ext_tree, hf_gn_area_long, tvb, offset, 4, tmp_ll,
				  "%02d°%02d'%02.2f\"%c (%d)",
				  abs((int)coordinate),
				  abs((int)((coordinate - (int)coordinate) * 60)),
@@ -983,7 +983,7 @@ static int tree_gn_ext_geoarea(tvbuff_t *tvb, proto_tree *ext_tree, int offset)
  offset += 4;

  /* Distance A */
  proto_tree_add_uint_format_value(ext_tree, hf_gn_area_a, tvb, offset, 2, FALSE,
  proto_tree_add_uint_format_value(ext_tree, hf_gn_area_a, tvb, offset, 2, tvb_get_ntohs(tvb, offset),
				   "%d m (%d)",
				   tvb_get_ntohs(tvb, offset),
				   tvb_get_ntohs(tvb, offset)
@@ -991,7 +991,7 @@ static int tree_gn_ext_geoarea(tvbuff_t *tvb, proto_tree *ext_tree, int offset)
  offset += 2;

  /* Distance B */
  proto_tree_add_uint_format_value(ext_tree, hf_gn_area_b, tvb, offset, 2, FALSE,
  proto_tree_add_uint_format_value(ext_tree, hf_gn_area_b, tvb, offset, 2, tvb_get_ntohs(tvb, offset),
				   "%d m (%d)",
				   tvb_get_ntohs(tvb, offset),
				   tvb_get_ntohs(tvb, offset)
@@ -999,7 +999,7 @@ static int tree_gn_ext_geoarea(tvbuff_t *tvb, proto_tree *ext_tree, int offset)
  offset += 2;

  /* Angle */
  proto_tree_add_uint_format_value(ext_tree, hf_gn_area_angle, tvb, offset, 2, FALSE,
  proto_tree_add_uint_format_value(ext_tree, hf_gn_area_angle, tvb, offset, 2, tvb_get_ntohs(tvb, offset),
				   "%d° (%d)",
				   tvb_get_ntohs(tvb, offset),
				   tvb_get_ntohs(tvb, offset)