Пример #1
0
static void
dissect_m2pa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
  proto_item *m2pa_item;
  proto_tree *m2pa_tree;

  switch(m2pa_version) {
  case M2PA_V02:
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA (ID 02)");
    break;
  case M2PA_V08:
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA (ID 08)");
    break;
  case M2PA_RFC4165:
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA");
    break;
  };

  m2pa_item = proto_tree_add_item(tree, proto_m2pa, tvb, 0, -1, ENC_NA);
  m2pa_tree = proto_item_add_subtree(m2pa_item, ett_m2pa);

  switch(m2pa_version) {
    case M2PA_V02:
      dissect_v2_message(tvb, pinfo, m2pa_item, m2pa_tree, tree);
      break;
    case M2PA_V08:
      dissect_v8_message(tvb, pinfo, m2pa_item, m2pa_tree, tree);
      break;
    case M2PA_RFC4165:
      dissect_message(tvb, pinfo, m2pa_item, m2pa_tree, tree);
      break;
  };
}
Пример #2
0
static void
dissect_m2pa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
  proto_item *m2pa_item;
  proto_tree *m2pa_tree;

  if (check_col(pinfo->cinfo, COL_PROTOCOL))
    switch(m2pa_version) {
    case M2PA_V02:
      col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA (ID 02)");
      break;
    case M2PA_V08:
      col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA (ID 08)");
      break;
    case M2PA_V12:
      col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA (ID 12)");
      break;
    };

  if (tree) {
    m2pa_item = proto_tree_add_item(tree, proto_m2pa, tvb, 0, -1, FALSE);
    m2pa_tree = proto_item_add_subtree(m2pa_item, ett_m2pa);
  } else {
    m2pa_item = NULL;
    m2pa_tree = NULL;
  }

  switch(m2pa_version) {
    case M2PA_V02:
      dissect_v2_message(tvb, pinfo, m2pa_item, m2pa_tree, tree);
      break;
    case M2PA_V08:
      dissect_v8_message(tvb, pinfo, m2pa_item, m2pa_tree, tree);
      break;
    case M2PA_V12:
      dissect_v12_message(tvb, pinfo, m2pa_item, m2pa_tree, tree);
      break;
  };
}