Exemplo n.º 1
0
/* Protocol Data */
static void
dissect_m2tp_protocol_data_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item, packet_info *pinfo, proto_item *m2tp_item, proto_tree *tree)
{
  guint16 length, protocol_data_length, padding_length;
  tvbuff_t *mtp2_tvb;

  length               = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET);
  padding_length       = nr_of_padding_bytes(length);
  protocol_data_length = length - PARAMETER_HEADER_LENGTH;

  mtp2_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, protocol_data_length, protocol_data_length);
  call_dissector(mtp2_handle, mtp2_tvb, pinfo, tree);

  if (parameter_tree) {
    proto_item_set_text(parameter_item, "Protocol data (SS7 message)");
    proto_item_set_len(parameter_item, proto_item_get_len(parameter_item) - protocol_data_length - padding_length);
    proto_item_set_len(m2tp_item,      proto_item_get_len(m2tp_item)      - protocol_data_length - padding_length);

  }
}
Exemplo n.º 2
0
static int
dissect_mongo_msg(tvbuff_t *tvb, guint offset, proto_tree *tree)
{

  proto_item *ti;

  ti = proto_tree_add_item(tree, hf_mongo_message, tvb, offset, -1, ENC_ASCII|ENC_NA);
  offset += proto_item_get_len(ti);

  return offset;
}
Exemplo n.º 3
0
/* Dissect OSC packet */
static void
dissect_osc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
    gint offset = 0;

    col_set_str(pinfo->cinfo, COL_PROTOCOL, "OSC");
    /* clear out stuff in the info column */
    col_clear(pinfo->cinfo, COL_INFO);

    if(tree) /* we are being asked for details */
    {
        gint len;
        proto_item *ti = NULL;
        proto_tree *osc_tree = NULL;

        /* create OSC packet */
        ti = proto_tree_add_item(tree, proto_osc, tvb, 0, -1, ENC_NA);
        osc_tree = proto_item_add_subtree(ti, ett_osc_packet);
        len = proto_item_get_len(ti);

        /* peek first bundle element char */
        switch(tvb_get_guint8(tvb, offset))
        {
            case '#': /* this is a bundle */
                if(dissect_osc_bundle(tvb, ti, osc_tree, offset, len))
                    return;
                else
                    break;
            case '/': /* this is a message */
                if(dissect_osc_message(tvb, ti, osc_tree, offset, len))
                    return;
                else
                    break;
            default: /* neither message nor bundle */
                return;
        }
    }
}