コード例 #1
0
void
proto_register_mesh(void)
{
  /* Setup list of header fields  See Section 1.6.1 for details*/
  static hf_register_info hf[] = {
    { &hf_mesh_ttl,
      { "Mesh TTL", "mesh.ttl", FT_UINT8, BASE_DEC,
        NULL, 0x0, NULL, HFILL }},

    { &hf_mesh_e2eseq,
      { "Mesh End-to-end Seq", "mesh.e2eseq", FT_UINT16, BASE_HEX,
        NULL, 0x0, NULL, HFILL }},
  };

  /* Setup protocol subtree array */
  static gint *ett[] = {
    &ett_mesh
  };

  /* Register the protocol name and description */
  proto_mesh = proto_register_protocol("Mesh Header", "Mesh", "mesh");

  /* Required function calls to register the header fields and subtrees used */
  proto_register_field_array(proto_mesh, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));

  new_register_dissector("mesh", dissect_mesh, proto_mesh);
}
コード例 #2
0
/*--- proto_register_lppa -------------------------------------------*/
void proto_register_lppa(void) {

  /* List of fields */
  static hf_register_info hf[] = {

#include "packet-lppa-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
	  &ett_lppa,
#include "packet-lppa-ettarr.c"
  };

  /* Register protocol */
  proto_lppa = proto_register_protocol(PNAME, PSNAME, PFNAME);
  new_register_dissector("lppa", dissect_LPPA_PDU_PDU, proto_lppa);

  /* Register fields and subtrees */
  proto_register_field_array(proto_lppa, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));

   /* Register dissector tables */
  lppa_ies_dissector_table = register_dissector_table("lppa.ies", "LPPA-PROTOCOL-IES", FT_UINT32, BASE_DEC);
  lppa_proc_imsg_dissector_table = register_dissector_table("lppa.proc.imsg", "LPPA-ELEMENTARY-PROCEDURE InitiatingMessage", FT_UINT32, BASE_DEC);
  lppa_proc_sout_dissector_table = register_dissector_table("lppa.proc.sout", "LPPA-ELEMENTARY-PROCEDURE SuccessfulOutcome", FT_UINT32, BASE_DEC);
  lppa_proc_uout_dissector_table = register_dissector_table("lppa.proc.uout", "LPPA-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", FT_UINT32, BASE_DEC);
}
コード例 #3
0
void
proto_register_http_urlencoded(void)
{
#ifndef HAVE_HFI_SECTION_INIT
	static header_field_info *hfi[] = {
		&hfi_form_keyvalue,
		&hfi_form_key,
		&hfi_form_value,
	};
#endif

	static gint *ett[] = {
		&ett_form_urlencoded,
		&ett_form_keyvalue
	};

	int proto_urlencoded;

	proto_urlencoded = proto_register_protocol("HTML Form URL Encoded", "URL Encoded Form Data", "urlencoded-form");
	hfi_urlencoded = proto_registrar_get_nth(proto_urlencoded);

	form_urlencoded_handle = new_register_dissector("urlencoded-form", dissect_form_urlencoded, proto_urlencoded);

	proto_register_fields(proto_urlencoded, hfi, array_length(hfi));
	proto_register_subtree_array(ett, array_length(ett));
}
コード例 #4
0
void
proto_register_hci_h4(void)
{
    static hf_register_info hf[] = {
        { &hf_hci_h4_type,
            { "HCI Packet Type",           "hci_h4.type",
            FT_UINT8, BASE_HEX, VALS(hci_h4_type_vals), 0x0,
            NULL, HFILL }
        },
        { &hf_hci_h4_direction,
            { "Direction",                 "hci_h4.direction",
            FT_UINT8, BASE_HEX, VALS(hci_h4_direction_vals), 0x0,
            "HCI Packet Direction Sent/Rcvd", HFILL }
        }
    };

    static gint *ett[] = {
        &ett_hci_h4,
    };

    proto_hci_h4 = proto_register_protocol("Bluetooth HCI H4",
            "HCI_H4", "hci_h4");

    hci_h4_handle = new_register_dissector("hci_h4", dissect_hci_h4, proto_hci_h4);

    proto_register_field_array(proto_hci_h4, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));

    hci_h4_table = register_dissector_table("hci_h4.type",
            "HCI H4 pdu type", FT_UINT8, BASE_HEX, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
}
コード例 #5
0
/*--- proto_register_q932_ros -----------------------------------------------*/
void proto_register_q932_ros(void) {

  /* List of fields */
  static hf_register_info hf[] = {
#include "packet-q932-ros-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
#include "packet-q932-ros-ettarr.c"
  };

  static ei_register_info ei[] = {
     { &ei_ros_undecoded, { "q932.ros.undecoded", PI_UNDECODED, PI_WARN, "Undecoded", EXPFILL }},
  };

  expert_module_t* expert_q932_ros;

  /* Register protocol and dissector */
  proto_q932_ros = proto_register_protocol(PNAME, PSNAME, PFNAME);
  proto_set_cant_toggle(proto_q932_ros);

  /* Register fields and subtrees */
  proto_register_field_array(proto_q932_ros, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_q932_ros = expert_register_protocol(proto_q932_ros);
  expert_register_field_array(expert_q932_ros, ei, array_length(ei));

  new_register_dissector(PFNAME, dissect_q932_ros, proto_q932_ros);
}
コード例 #6
0
void
proto_register_pcap_pktdata(void)
{
    static hf_register_info hf[] = {
        { &hf_pcap_pktdata_pseudoheader,
            { "Pseudoheader",                              "pcap_pktdata.data.pseudoheader",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_pcap_pktdata_pseudoheader_bluetooth_direction,
            { "Direction",                                 "pcap_pktdata.pseudoheader.bluetooth.direction",
            FT_UINT32, BASE_HEX, VALS(pseudoheader_bluetooth_direction_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_pcap_pktdata_data,
            { "Data",                                      "pcap_pktdata.data",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
    };

    static gint *ett[] = {
        &ett_pcap_pktdata_pseudoheader,
        &ett_pcap_pktdata_data
    };

    proto_pcap_pktdata = proto_register_protocol("pcap/pcapng packet data", "pcap_pktdata", "pcap_pktdata");
    proto_register_field_array(proto_pcap_pktdata, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));

    new_register_dissector("pcap_pktdata", dissect_pcap_pktdata, proto_pcap_pktdata);
}
コード例 #7
0
/*--- proto_register_dsp -------------------------------------------*/
void proto_register_dsp(void) {

  /* List of fields */
  static hf_register_info hf[] =
  {
#include "packet-dsp-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
    &ett_dsp,
#include "packet-dsp-ettarr.c"
  };
  module_t *dsp_module;

  /* Register protocol */
  proto_dsp = proto_register_protocol(PNAME, PSNAME, PFNAME);

  new_register_dissector("dsp", dissect_dsp, proto_dsp);

  /* Register fields and subtrees */
  proto_register_field_array(proto_dsp, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));

  /* Register our configuration options for DSP, particularly our port */

  dsp_module = prefs_register_protocol_subtree("OSI/X.500", proto_dsp, prefs_register_dsp);

  prefs_register_uint_preference(dsp_module, "tcp.port", "DSP TCP Port",
				 "Set the port for DSP operations (if other"
				 " than the default of 102)",
				 10, &global_dsp_tcp_port);


}
コード例 #8
0
ファイル: packet-media.c プロジェクト: ARK1988/wireshark
void
proto_register_media(void)
{
    static hf_register_info hf[] = {
      { &hf_media_type,
        { "Media type", "media.type",
          FT_BYTES, BASE_NONE, NULL, 0,
          NULL, HFILL }},
    };
    static gint *ett[] = {
        &ett_media
    };

    proto_media = proto_register_protocol (
        "Media Type",   /* name */
        "Media",        /* short name */
        "media"         /* abbrev */
        );
    new_register_dissector("media", dissect_media, proto_media);
    register_heur_dissector_list("media", &heur_subdissector_list);
    proto_register_field_array(proto_media, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));

    /*
     * "Media" is used to dissect something whose normal dissector
     * is disabled, so it cannot itself be disabled.
     */
    proto_set_cant_toggle(proto_media);
}
コード例 #9
0
/*--- proto_register_lpp -------------------------------------------*/
void proto_register_lppe(void) {

  /* List of fields */
  static hf_register_info hf[] = {

#include "packet-lppe-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
	  &ett_lppe,
#include "packet-lppe-ettarr.c"
  };


  /* Register protocol */
  proto_lppe = proto_register_protocol(PNAME, PSNAME, PFNAME);
  new_register_dissector("lppe", dissect_OMA_LPPe_MessageExtension_PDU, proto_lppe);

  /* Register fields and subtrees */
  proto_register_field_array(proto_lppe, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));

 
}
コード例 #10
0
/*--- proto_register_rrlp -------------------------------------------*/
void proto_register_rrlp(void) {

  /* List of fields */
  static hf_register_info hf[] = {

#include "packet-rrlp-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
	  &ett_rrlp,
#include "packet-rrlp-ettarr.c"
  };


  /* Register protocol */
  proto_rrlp = proto_register_protocol(PNAME, PSNAME, PFNAME);
  new_register_dissector("rrlp", dissect_PDU_PDU, proto_rrlp);

  /* Register fields and subtrees */
  proto_register_field_array(proto_rrlp, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));


}
コード例 #11
0
/*--- proto_register_cmip ----------------------------------------------*/
void proto_register_cmip(void) {

  /* List of fields */
  static hf_register_info hf[] = {
    { &hf_cmip_actionType_OID,
      { "actionType", "cmip.actionType_OID",
        FT_STRING, BASE_NONE, NULL, 0,
        NULL, HFILL }},
    { &hf_cmip_eventType_OID,
      { "eventType", "cmip.eventType_OID",
        FT_STRING, BASE_NONE, NULL, 0,
        NULL, HFILL }},
    { &hf_cmip_attributeId_OID,
      { "attributeId", "cmip.attributeId_OID",
        FT_STRING, BASE_NONE, NULL, 0,
        NULL, HFILL }},
    { &hf_cmip_errorId_OID,
      { "errorId", "cmip.errorId_OID",
        FT_STRING, BASE_NONE, NULL, 0,
        NULL, HFILL }},
   { &hf_DiscriminatorConstruct,
      { "DiscriminatorConstruct", "cmip.DiscriminatorConstruct",
        FT_UINT32, BASE_DEC, NULL, 0,
        NULL, HFILL }},
    { &hf_Destination,
      { "Destination", "cmip.Destination",
        FT_UINT32, BASE_DEC, NULL, 0,
        NULL, HFILL }},
    { &hf_NameBinding,
      { "NameBinding", "cmip.NameBinding",
        FT_STRING, BASE_NONE, NULL, 0,
        NULL, HFILL }},
    { &hf_ObjectClass,
      { "ObjectClass", "cmip.ObjectClass",
        FT_UINT32, BASE_DEC, VALS(cmip_ObjectClass_vals), 0,
        NULL, HFILL }},

#include "packet-cmip-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
    &ett_cmip,
#include "packet-cmip-ettarr.c"
  };

  /* Register protocol */
  proto_cmip = proto_register_protocol(PNAME, PSNAME, PFNAME);
  new_register_dissector("cmip", dissect_cmip, proto_cmip);

  /* Register fields and subtrees */
  proto_register_field_array(proto_cmip, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
#include "packet-cmip-dis-tab.c"
    oid_add_from_string("discriminatorId(1)","2.9.3.2.7.1");

  attribute_id_dissector_table = register_dissector_table("cmip.attribute_id", "CMIP Attribute Id", FT_UINT32, BASE_DEC);

}
コード例 #12
0
void proto_register_rmt_fec(void)
{
	static hf_register_info hf[] = {
		{ &hf_encoding_id,
			{ "FEC Encoding ID", "rmt-fec.encoding_id", FT_UINT8, BASE_DEC, VALS(string_fec_encoding_id), 0x0, NULL, HFILL }},
		{ &hf_instance_id,
			{ "FEC Instance ID", "rmt-fec.instance_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
		{ &hf_sbn,
			{ "Source Block Number", "rmt-fec.sbn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
		{ &hf_sbn_with_mask,
			{ "Source Block Number", "rmt-fec.sbn", FT_UINT32, BASE_DEC, NULL, 0xFFF00000, NULL, HFILL }},
		{ &hf_sbl,
			{ "Source Block Length", "rmt-fec.sbl", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
		{ &hf_esi,
			{ "Encoding Symbol ID", "rmt-fec.esi", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
		{ &hf_esi_with_mask,
			{ "Encoding Symbol ID", "rmt-fec.esi", FT_UINT32, BASE_HEX, NULL, 0x000FFFFF, NULL, HFILL }},
		{ &hf_fti_transfer_length,
			{ "Transfer Length", "rmt-fec.fti.transfer_length", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
		{ &hf_fti_encoding_symbol_length,
			{ "Encoding Symbol Length", "rmt-fec.fti.encoding_symbol_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
		{ &hf_fti_max_source_block_length,
			{ "Maximum Source Block Length", "rmt-fec.fti.max_source_block_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
		{ &hf_fti_max_number_encoding_symbols,
			{ "Maximum Number of Encoding Symbols", "rmt-fec.fti.max_number_encoding_symbols", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
		{ &hf_fti_num_blocks,
			{ "Number of Source Blocks", "rmt-fec.fti.num_blocks", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
		{ &hf_fti_num_subblocks,
			{ "Number of Sub-Blocks", "rmt-fec.fti.num_subblocks", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
		{ &hf_fti_alignment,
			{ "Symbol Alignment", "rmt-fec.fti.alignment", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}
	};

	/* Setup protocol subtree array */
	static gint *ett[] = {
		&ett_main,
	};

	static ei_register_info ei[] = {
		{ &ei_fec_encoding_id, { "rmt-fec.encoding_id.not0", PI_PROTOCOL, PI_WARN, "FEC Encoding ID < 128, should be zero", EXPFILL }},
	};

	expert_module_t* expert_rmt_fec;

	/* Register the protocol name and description */
	proto_rmt_fec = proto_register_protocol("Forward Error Correction (FEC)", "RMT-FEC", "rmt-fec");
	new_register_dissector("rmt-fec", dissect_fec, proto_rmt_fec);

	/* Required function calls to register the header fields and subtrees used */
	proto_register_field_array(proto_rmt_fec, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));
	expert_rmt_fec = expert_register_protocol(proto_rmt_fec);
	expert_register_field_array(expert_rmt_fec, ei, array_length(ei));
}
コード例 #13
0
/*--- proto_register_ros -------------------------------------------*/
void proto_register_ros(void) {

  /* List of fields */
  static hf_register_info hf[] =
  {
    { &hf_ros_response_in,
      { "Response In", "ros.response_in",
	FT_FRAMENUM, BASE_NONE, NULL, 0x0,
	"The response to this remote operation invocation is in this frame", HFILL }},
    { &hf_ros_response_to,
      { "Response To", "ros.response_to",
	FT_FRAMENUM, BASE_NONE, NULL, 0x0,
	"This is a response to the remote operation invocation in this frame", HFILL }},
    { &hf_ros_time,
      { "Time", "ros.time",
	FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
	"The time between the Invoke and the Response", HFILL }},

#include "packet-ros-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
    &ett_ros,
    &ett_ros_unknown,
#include "packet-ros-ettarr.c"
  };

  static ei_register_info ei[] = {
     { &ei_ros_dissector_oid_not_implemented, { "ros.dissector_oid_not_implemented", PI_UNDECODED, PI_WARN, "ROS: Dissector for OID not implemented", EXPFILL }},
     { &ei_ros_unknown_ros_pdu, { "ros.unknown_ros_pdu", PI_UNDECODED, PI_WARN, "Unknown ROS PDU", EXPFILL }},
  };

  expert_module_t* expert_ros;

  /* Register protocol */
  proto_ros = proto_register_protocol(PNAME, PSNAME, PFNAME);
  new_register_dissector("ros", dissect_ros, proto_ros);
  /* Register fields and subtrees */
  proto_register_field_array(proto_ros, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_ros = expert_register_protocol(proto_ros);
  expert_register_field_array(expert_ros, ei, array_length(ei));

  ros_oid_dissector_table = register_dissector_table("ros.oid", "ROS OID Dissectors", FT_STRING, BASE_NONE);
  oid_table=g_hash_table_new(g_str_hash, g_str_equal);
  protocol_table=g_hash_table_new(g_str_hash, g_str_equal);

  ros_handle = find_dissector("ros");

  register_init_routine(ros_reinit);
}
コード例 #14
0
void proto_register_armagetronad(void)
{
	static hf_register_info hf[] = {
		{&hf_armagetronad_descriptor_id,
		 {"Descriptor", "armagetronad.descriptor_id",
		  FT_UINT16, BASE_DEC, VALS(descriptors), 0x0,
		  "The ID of the descriptor (the command)", HFILL}
		 },
		{&hf_armagetronad_message_id,
		 {"MessageID", "armagetronad.message_id",
		  FT_UINT16, BASE_HEX, NULL, 0x0,
		  "The ID of the message (to ack it)", HFILL}
		 },
		{&hf_armagetronad_data_len,
		 {"DataLen", "armagetronad.data_len",
		  FT_UINT16, BASE_DEC, NULL, 0x0,
		  "The length of the data (in shorts)", HFILL}
		 },
		{&hf_armagetronad_data,
		 {"Data", "armagetronad.data",
		  FT_STRING, BASE_NONE, NULL, 0x0,
		  "The actual data (array of shorts in network order)", HFILL}
		 },
		{&hf_armagetronad_sender_id,
		 {"SenderID", "armagetronad.sender_id",
		  FT_UINT16, BASE_HEX, NULL, 0x0,
		  "The ID of the sender (0x0000 for the server)", HFILL}
		 },
		{&hf_armagetronad_msg_subtree,
		 {"Message", "armagetronad.message",
		  FT_NONE, BASE_NONE, NULL, 0x0,
		  "A message", HFILL}
		 }
	};

	static gint *ett[] = {
		&ett_armagetronad,
		&ett_message
	};

	proto_armagetronad =
	    proto_register_protocol("The Armagetron Advanced OpenGL Tron clone",
				    "Armagetronad", "armagetronad");

	proto_register_field_array(proto_armagetronad, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));
	new_register_dissector("armagetronad", dissect_armagetronad,
			       proto_armagetronad);
}
コード例 #15
0
ファイル: packet-l1-events.c プロジェクト: ARK1988/wireshark
void
proto_register_l1_events(void)
{
	static gint *ett[] = {
		&ett_l1_events,
	};

	proto_register_subtree_array(ett, array_length(ett));

	proto_l1_events = proto_register_protocol(
			"Layer 1 Event Messages", /* Long name */
			"Layer 1 Events",	  /* Short name */
			"data-l1-events");		/* Filter name */
	new_register_dissector("data-l1-events", dissect_l1_events, proto_l1_events);
}
コード例 #16
0
/*--- proto_register_h282 ----------------------------------------------*/
void proto_register_h282(void) {

  /* List of fields */
  static hf_register_info hf[] = {
#include "packet-h282-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
    &ett_h282,
#include "packet-h282-ettarr.c"
  };

  /* Register protocol */
  proto_h282 = proto_register_protocol(PNAME, PSNAME, PFNAME);

  /* Register fields and subtrees */
  proto_register_field_array(proto_h282, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));

  new_register_dissector(PFNAME, dissect_h282, proto_h282);
  new_register_dissector(PFNAME".device_list", dissect_NonCollapsingCapabilities_PDU, proto_h282);

}
コード例 #17
0
ファイル: packet-text-media.c プロジェクト: jelmer/wireshark
void
proto_register_text_lines(void)
{
	static gint *ett[] = {
		&ett_text_lines,
	};

	proto_register_subtree_array(ett, array_length(ett));

	proto_text_lines = proto_register_protocol(
			"Line-based text data",	/* Long name */
			"Line-based text data",	/* Short name */
			"data-text-lines");		/* Filter name */
	new_register_dissector("data-text-lines", dissect_text_lines, proto_text_lines);
}
コード例 #18
0
/*--- proto_register_h450 -------------------------------------------*/
void proto_register_h450(void) {

  /* List of fields */
  static hf_register_info hf[] = {
    { &hf_h450_operation, { "Operation", "h450.operation",
                           FT_UINT8, BASE_DEC, VALS(h450_str_operation), 0x0,
                           NULL, HFILL }},
    { &hf_h450_error,     { "Error", "h450.error",
                           FT_UINT8, BASE_DEC, VALS(h450_str_error), 0x0,
                           NULL, HFILL }},
#include "packet-h450-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
#include "packet-h450-ettarr.c"
  };

  static ei_register_info ei[] = {
    { &ei_h450_unsupported_arg_type, { "h450.unsupported.arg_type", PI_UNDECODED, PI_WARN, "UNSUPPORTED ARGUMENT TYPE (H.450)", EXPFILL }},
    { &ei_h450_unsupported_result_type, { "h450.unsupported.result_type", PI_UNDECODED, PI_WARN, "UNSUPPORTED RESULT TYPE (H.450)", EXPFILL }},
    { &ei_h450_unsupported_error_type, { "h450.unsupported.error_type", PI_UNDECODED, PI_WARN, "UNSUPPORTED ERROR TYPE (H.450)", EXPFILL }},
  };

  expert_module_t* expert_h450;

  /* Register protocol */
  proto_h450 = proto_register_protocol(PNAME, PSNAME, PFNAME);
  new_register_dissector("h4501", dissect_h450_H4501SupplementaryService_PDU, proto_h450);
  /* Register fields and subtrees */
  proto_register_field_array(proto_h450, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_h450 = expert_register_protocol(proto_h450);
  expert_register_field_array(expert_h450, ei, array_length(ei));

  rose_ctx_init(&h450_rose_ctx);

  /* Register dissector tables */
  h450_rose_ctx.arg_global_dissector_table = register_dissector_table("h450.ros.global.arg", "H.450 Operation Argument (global opcode)", FT_STRING, BASE_NONE, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
  h450_rose_ctx.res_global_dissector_table = register_dissector_table("h450.ros.global.res", "H.450 Operation Result (global opcode)", FT_STRING, BASE_NONE, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
  h450_rose_ctx.arg_local_dissector_table = register_dissector_table("h450.ros.local.arg", "H.450 Operation Argument (local opcode)", FT_UINT32, BASE_HEX, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
  h450_rose_ctx.res_local_dissector_table = register_dissector_table("h450.ros.local.res", "H.450 Operation Result (local opcode)", FT_UINT32, BASE_HEX, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
  h450_rose_ctx.err_global_dissector_table = register_dissector_table("h450.ros.global.err", "H.450 Error (global opcode)", FT_STRING, BASE_NONE, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
  h450_rose_ctx.err_local_dissector_table = register_dissector_table("h450.ros.local.err", "H.450 Error (local opcode)", FT_UINT32, BASE_HEX, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);

}
コード例 #19
0
ファイル: packet-dop-template.c プロジェクト: pvons/wireshark
/*--- proto_register_dop -------------------------------------------*/
void proto_register_dop(void) {

  /* List of fields */
  static hf_register_info hf[] =
  {
#include "packet-dop-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
    &ett_dop,
    &ett_dop_unknown,
#include "packet-dop-ettarr.c"
  };

  static ei_register_info ei[] = {
     { &ei_dop_unknown_binding_parameter, { "dop.unknown_binding_parameter", PI_UNDECODED, PI_WARN, "Unknown binding-parameter", EXPFILL }},
  };

  expert_module_t* expert_dop;
  module_t *dop_module;

  /* Register protocol */
  proto_dop = proto_register_protocol(PNAME, PSNAME, PFNAME);

  new_register_dissector("dop", dissect_dop, proto_dop);

  dop_dissector_table = register_dissector_table("dop.oid", "DOP OID Dissectors", FT_STRING, BASE_NONE);

  /* Register fields and subtrees */
  proto_register_field_array(proto_dop, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_dop = expert_register_protocol(proto_dop);
  expert_register_field_array(expert_dop, ei, array_length(ei));

  /* Register our configuration options for DOP, particularly our port */

  dop_module = prefs_register_protocol_subtree("OSI/X.500", proto_dop, prefs_register_dop);

  prefs_register_uint_preference(dop_module, "tcp.port", "DOP TCP Port",
				 "Set the port for DOP operations (if other"
				 " than the default of 102)",
				 10, &global_dop_tcp_port);


}
コード例 #20
0
/*--- proto_register_dsp -------------------------------------------*/
void proto_register_dsp(void) {

  /* List of fields */
  static hf_register_info hf[] =
  {
#include "packet-dsp-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
    &ett_dsp,
#include "packet-dsp-ettarr.c"
  };
  static ei_register_info ei[] = {
    { &ei_dsp_unsupported_opcode, { "dsp.unsupported_opcode", PI_UNDECODED, PI_WARN, "Unsupported DSP opcode", EXPFILL }},
    { &ei_dsp_unsupported_errcode, { "dsp.unsupported_errcode", PI_UNDECODED, PI_WARN, "Unsupported DSP errcode", EXPFILL }},
    { &ei_dsp_unsupported_pdu, { "dsp.unsupported_pdu", PI_UNDECODED, PI_WARN, "Unsupported DSP PDU", EXPFILL }},
    { &ei_dsp_zero_pdu, { "dsp.zero_pdu", PI_PROTOCOL, PI_ERROR, "Internal error, zero-byte DSP PDU", EXPFILL }},
  };

  module_t *dsp_module;
  expert_module_t* expert_dsp;

  /* Register protocol */
  proto_dsp = proto_register_protocol(PNAME, PSNAME, PFNAME);

  new_register_dissector("dsp", dissect_dsp, proto_dsp);

  /* Register fields and subtrees */
  proto_register_field_array(proto_dsp, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_dsp = expert_register_protocol(proto_dsp);
  expert_register_field_array(expert_dsp, ei, array_length(ei));

  /* Register our configuration options for DSP, particularly our port */

  dsp_module = prefs_register_protocol_subtree("OSI/X.500", proto_dsp, prefs_register_dsp);

  prefs_register_uint_preference(dsp_module, "tcp.port", "DSP TCP Port",
				 "Set the port for DSP operations (if other"
				 " than the default of 102)",
				 10, &global_dsp_tcp_port);


}
コード例 #21
0
void
proto_register_ethertype(void)
{
	/* Decode As handling */
	static build_valid_func eth_da_build_value[1] = {eth_value};
	static decode_as_value_t eth_da_values = {eth_prompt, 1, eth_da_build_value};
	static decode_as_t ethertype_da = {"ethertype", "Link", "ethertype", 1, 0, &eth_da_values, NULL, NULL,
										decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL};


	proto_ethertype = proto_register_protocol("Ethertype", "Ethertype", "ethertype");

	new_register_dissector("ethertype", dissect_ethertype, proto_ethertype);

	/* subdissector code */
	ethertype_dissector_table = register_dissector_table("ethertype",
								"Ethertype", FT_UINT16, BASE_HEX);

	register_decode_as(&ethertype_da);
}
コード例 #22
0
/*--- proto_register_HI2Operations ----------------------------------------------*/
void proto_register_HI2Operations(void) {

  /* List of fields */
  static hf_register_info hf[] = {
#include "packet-HI2Operations-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
#include "packet-HI2Operations-ettarr.c"
  };

  /* Register protocol */
  proto_HI2Operations = proto_register_protocol(PNAME, PSNAME, PFNAME);

  /* Register fields and subtrees */
  proto_register_field_array(proto_HI2Operations, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));

  new_register_dissector("HI2Operations", dissect_IRIsContent_PDU, proto_HI2Operations);
}
コード例 #23
0
/*--- proto_register_q932_ros -----------------------------------------------*/
void proto_register_q932_ros(void) {

  /* List of fields */
  static hf_register_info hf[] = {
#include "packet-q932-ros-hfarr.c" 
  };

  /* List of subtrees */
  static gint *ett[] = {
#include "packet-q932-ros-ettarr.c" 
  };

  /* Register protocol and dissector */
  proto_q932_ros = proto_register_protocol(PNAME, PSNAME, PFNAME);
  proto_set_cant_toggle(proto_q932_ros);

  /* Register fields and subtrees */
  proto_register_field_array(proto_q932_ros, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));

  new_register_dissector(PFNAME, dissect_q932_ros, proto_q932_ros);
}
コード例 #24
0
/*--- proto_register_h501 ----------------------------------------------*/
void proto_register_h501(void) {
  module_t *h501_module;

  /* List of fields */
  static hf_register_info hf[] = {
#include "packet-h501-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
    &ett_h501,
#include "packet-h501-ettarr.c"
  };

  /* Register protocol */
  proto_h501 = proto_register_protocol(PNAME, PSNAME, PFNAME);

  /* Register fields and subtrees */
  proto_register_field_array(proto_h501, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));

  new_register_dissector(PFNAME, dissect_h501_pdu, proto_h501);

  h501_module = prefs_register_protocol(proto_h501, proto_reg_handoff_h501);
  prefs_register_uint_preference(h501_module, "udp.port",
                                 "UDP port",
                                 "Port to be decoded as h501",
                                 10, &h501_udp_port);
  prefs_register_uint_preference(h501_module, "tcp.port",
                                 "TCP port",
                                 "Port to be decoded as h501",
                                 10, &h501_tcp_port);
  prefs_register_bool_preference(h501_module, "desegment",
                                 "Desegment H.501 over TCP",
                                 "Desegment H.501 messages that span more TCP segments",
                                 &h501_desegment_tcp);

}
コード例 #25
0
void proto_register_bjnp (void)
{
  static hf_register_info hf[] = {
    { &hf_bjnp_id,
      { "Id", "bjnp.id", FT_STRING, BASE_NONE,
        NULL, 0x0, NULL, HFILL } },
    { &hf_dev_type,
      { "Type", "bjnp.type", FT_UINT8, BASE_DEC,
        VALS(dev_type_vals), 0x0, NULL, HFILL } },
    { &hf_cmd_code,
      { "Code", "bjnp.code", FT_UINT8, BASE_DEC,
        VALS(cmd_code_vals), 0x0, NULL, HFILL } },
    { &hf_seq_no,
      { "Sequence Number", "bjnp.seq_no", FT_UINT32, BASE_DEC,
        NULL, 0x0, NULL, HFILL } },
    { &hf_session_id,
      { "Session Id", "bjnp.session_id", FT_UINT16, BASE_DEC,
        NULL, 0x0, NULL, HFILL } },
    { &hf_payload_len,
      { "Payload Length", "bjnp.payload_len", FT_UINT32, BASE_DEC,
        NULL, 0x0, NULL, HFILL } },
    { &hf_payload,
      { "Payload", "bjnp.payload", FT_BYTES, BASE_NONE,
        NULL, 0x0, NULL, HFILL } },
  };

  static gint *ett[] = {
    &ett_bjnp
  };

  proto_bjnp = proto_register_protocol (PNAME, PSNAME, PFNAME);
  new_register_dissector (PFNAME, dissect_bjnp, proto_bjnp);

  proto_register_field_array (proto_bjnp, hf, array_length (hf));
  proto_register_subtree_array (ett, array_length (ett));
}
コード例 #26
0
void
proto_register_mpls_y1711(void)
{
    static hf_register_info hf[] = {
        {
            &hf_mpls_y1711_function_type,
            {
                "Function Type", "mpls.y1711.function_type", FT_UINT8,
                BASE_HEX, VALS(y1711_function_type_vals),
                0x0, "Function Type codepoint", HFILL
            }
        },
        {
            &hf_mpls_y1711_ttsi,
            {
                "Trail Termination Source Identifier",
                "mpls.y1711.ttsi",
                FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL
            }
        },
        {
            &hf_mpls_y1711_frequency,
            {
                "Frequency", "mpls.y1711.frequency", FT_UINT8,
                BASE_HEX, VALS(y1711_frequency_vals), 0x0,
                "Frequency of probe injection", HFILL
            }
        },
        {
            &hf_mpls_y1711_defect_type,
            {
                "Defect Type", "mpls.y1711.defect_type", FT_UINT16,
                BASE_HEX, VALS(y1711_defect_type_vals), 0x0, NULL, HFILL
            }
        },
        {
            &hf_mpls_y1711_defect_location,
            {
                "Defect Location (AS)", "mpls.y1711.defect_location",
                FT_UINT32, BASE_DEC, NULL, 0x0, "Defect Location", HFILL
            }
        },
        {
            &hf_mpls_y1711_bip16,
            {
                "BIP16", "mpls.y1711.bip16", FT_UINT16,
                BASE_HEX, NULL, 0x0, NULL, HFILL
            }
        },
    };

    static gint *ett[] = {
        &ett_mpls_y1711
    };

    proto_mpls_y1711 =
        proto_register_protocol("MPLS ITU-T Y.1711 OAM",
                                "MPLS ITU-T Y.1711 OAM",
                                "mplsy1711");
    proto_register_field_array(proto_mpls_y1711, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    new_register_dissector("mpls_y1711", dissect_mpls_y1711, proto_mpls_y1711);
}
コード例 #27
0
ファイル: packet-sbc.c プロジェクト: EMATech/wireshark
void
proto_register_sbc(void)
{
    module_t *module;
    expert_module_t* expert_sbc;

    static hf_register_info hf[] = {
        { &hf_sbc_fragmented,
            { "Fragmented",                      "sbc.fragmented",
            FT_BOOLEAN, 8, NULL, 0x80,
            NULL, HFILL }
        },
        { &hf_sbc_starting_packet,
            { "Starting Packet",                 "sbc.starting_packet",
            FT_BOOLEAN, 8, NULL, 0x40,
            NULL, HFILL }
        },
        { &hf_sbc_last_packet,
            { "Last Packet",                     "sbc.last_packet",
            FT_BOOLEAN, 8, NULL, 0x20,
            NULL, HFILL }
        },
        { &hf_sbc_rfa,
            { "RFA",                             "sbc.rfa",
            FT_BOOLEAN, 8, NULL, 0x10,
            NULL, HFILL }
        },
        { &hf_sbc_number_of_frames,
            { "Number of Frames",                "sbc.number_of_frames",
            FT_UINT8, BASE_DEC, NULL, 0x0F,
            NULL, HFILL }
        },
        { &hf_sbc_syncword,
            { "Sync Word",                       "sbc.syncword",
            FT_UINT8, BASE_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sbc_sampling_frequency,
            { "Sampling Frequency",              "sbc.sampling_frequency",
            FT_UINT8, BASE_HEX, VALS(sampling_frequency_vals), 0xC0,
            NULL, HFILL }
        },
        { &hf_sbc_blocks,
            { "Blocks",                          "sbc.blocks",
            FT_UINT8, BASE_HEX, VALS(blocks_vals), 0x30,
            NULL, HFILL }
        },
        { &hf_sbc_channel_mode,
            { "Channel Mode",                    "sbc.channel_mode",
            FT_UINT8, BASE_HEX, VALS(channel_mode_vals), 0x0C,
            NULL, HFILL }
        },
        { &hf_sbc_allocation_method,
            { "Allocation Method",               "sbc.allocation_method",
            FT_UINT8, BASE_HEX, VALS(allocation_method_vals), 0x02,
            NULL, HFILL }
        },
        { &hf_sbc_subbands,
            { "Subbands",                        "sbc.subbands",
            FT_UINT8, BASE_HEX, VALS(subbands_vals), 0x01,
            NULL, HFILL }
        },
        { &hf_sbc_bitpool,
            { "Bitpool",                         "sbc.bitpool",
            FT_UINT8, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sbc_crc_check,
            { "CRC Check",                       "sbc.crc_check",
            FT_UINT8, BASE_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sbc_expected_data_speed,
            { "Expected data speed",             "sbc.expected_speed_data",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sbc_frame_duration,
            { "Frame Duration",                  "sbc.frame_duration",
            FT_DOUBLE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sbc_cummulative_frame_duration,
            { "Cummulative Frame Duration",      "sbc.cummulative_frame_duration",
            FT_DOUBLE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sbc_delta_time,
            { "Delta time",                      "sbc.delta_time",
            FT_DOUBLE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sbc_delta_time_from_the_beginning,
            { "Delta time from the beginning",   "sbc.delta_time_from_the_beginning",
            FT_DOUBLE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sbc_cummulative_duration,
            { "Cummulative Music Duration",      "sbc.cummulative_music_duration",
            FT_DOUBLE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sbc_diff,
            { "Diff",            "sbc.diff",
            FT_DOUBLE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sbc_data,
            { "Frame Data",                      "sbc.data",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
    };

    static gint *ett[] = {
        &ett_sbc,
        &ett_sbc_list,
    };

    static ei_register_info ei[] = {
        { &ei_sbc_syncword, { "sbc.syncword.unexpected", PI_PROTOCOL, PI_WARN, "Unexpected syncword", EXPFILL }},
    };

    proto_sbc = proto_register_protocol("Bluetooth SBC Codec", "SBC", "sbc");

    proto_register_field_array(proto_sbc, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_sbc = expert_register_protocol(proto_sbc);
    expert_register_field_array(expert_sbc, ei, array_length(ei));

    new_register_dissector("sbc", dissect_sbc, proto_sbc);

    module = prefs_register_protocol(proto_sbc, NULL);
    prefs_register_static_text_preference(module, "a2dp.version",
            "Bluetooth Audio Codec SBC version based on A2DP 1.3",
            "Version of codec supported by this dissector.");
}
コード例 #28
0
/*--- proto_register_p1 -------------------------------------------*/
void proto_register_p1(void) {

  /* List of fields */
  static hf_register_info hf[] =
  {
      /* "Created by defining PDU in .cnf */
    { &hf_p1_MTABindArgument_PDU,
      { "MTABindArgument", "p1.MTABindArgument",
        FT_UINT32, BASE_DEC, VALS(p1_MTABindArgument_vals), 0,
        "p1.MTABindArgument", HFILL }},
    { &hf_p1_MTABindResult_PDU,
      { "MTABindResult", "p1.MTABindResult",
        FT_UINT32, BASE_DEC, VALS(p1_MTABindResult_vals), 0,
        "p1.MTABindResult", HFILL }},
    { &hf_p1_MTABindError_PDU,
      { "MTABindError", "p1.MTABindError",
        FT_UINT32, BASE_DEC, VALS(p1_MTABindError_vals), 0,
        "p1.MTABindError", HFILL }},
    { &hf_p1_MTS_APDU_PDU,
      { "MTS-APDU", "p1.MTS_APDU",
        FT_UINT32, BASE_DEC, VALS(p1_MTS_APDU_vals), 0,
        "p1.MTS_APDU", HFILL }},

#include "packet-p1-hfarr.c"
  };

  /* List of subtrees */
  static gint *ett[] = {
    &ett_p1,
    &ett_p3,
    &ett_p1_content_unknown,
    &ett_p1_bilateral_information,
    &ett_p1_additional_information,
    &ett_p1_unknown_standard_extension,
    &ett_p1_unknown_extension_attribute_type,
    &ett_p1_unknown_tokendata_type,
#include "packet-p1-ettarr.c"
  };

  static ei_register_info ei[] = {
     { &ei_p1_unknown_extension_attribute_type, { "p1.unknown.extension_attribute_type", PI_UNDECODED, PI_WARN, "Unknown extension-attribute-type", EXPFILL }},
     { &ei_p1_unknown_standard_extension, { "p1.unknown.standard_extension", PI_UNDECODED, PI_WARN, "Unknown standard-extension", EXPFILL }},
     { &ei_p1_unknown_built_in_content_type, { "p1.unknown.built_in_content_type", PI_UNDECODED, PI_WARN, "P1 Unknown Content (unknown built-in content-type)", EXPFILL }},
     { &ei_p1_unknown_tokendata_type, { "p1.unknown.tokendata_type", PI_UNDECODED, PI_WARN, "Unknown tokendata-type", EXPFILL }},
     { &ei_p1_unsupported_pdu, { "p1.unsupported_pdu", PI_UNDECODED, PI_WARN, "Unsupported P1 PDU", EXPFILL }},
     { &ei_p1_zero_pdu, { "p1.zero_pdu", PI_PROTOCOL, PI_ERROR, "Internal error, zero-byte P1 PDU", EXPFILL }},
  };

  expert_module_t* expert_p1;
  module_t *p1_module;

  /* Register protocol */
  proto_p1 = proto_register_protocol(PNAME, PSNAME, PFNAME);
  new_register_dissector("p1", dissect_p1, proto_p1);

  proto_p3 = proto_register_protocol("X.411 Message Access Service", "P3", "p3");

  /* Register fields and subtrees */
  proto_register_field_array(proto_p1, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_p1 = expert_register_protocol(proto_p1);
  expert_register_field_array(expert_p1, ei, array_length(ei));

  p1_extension_dissector_table = register_dissector_table("p1.extension", "P1-EXTENSION", FT_UINT32, BASE_DEC);
  p1_extension_attribute_dissector_table = register_dissector_table("p1.extension-attribute", "P1-EXTENSION-ATTRIBUTE", FT_UINT32, BASE_DEC);
  p1_tokendata_dissector_table = register_dissector_table("p1.tokendata", "P1-TOKENDATA", FT_UINT32, BASE_DEC);

  /* Register our configuration options for P1, particularly our port */

  p1_module = prefs_register_protocol_subtree("OSI/X.400", proto_p1, prefs_register_p1);

  prefs_register_uint_preference(p1_module, "tcp.port", "P1 TCP Port",
                 "Set the port for P1 operations (if other"
                 " than the default of 102)",
                 10, &global_p1_tcp_port);

  register_ber_syntax_dissector("P1 Message", proto_p1, dissect_p1_mts_apdu);
#include "packet-p1-syn-reg.c"
}
コード例 #29
0
ファイル: packet-adb.c プロジェクト: ARK1988/wireshark
void
proto_register_adb(void)
{
    module_t         *module;
    expert_module_t  *expert_module;

    static hf_register_info hf[] = {
        { &hf_command,
            { "Command",                         "adb.command",
            FT_UINT32, BASE_HEX, VALS(command_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_argument_0,
            { "Argument 0",                      "adb.argument.0",
            FT_UINT32, BASE_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_argument_1,
            { "Argument 0",                      "adb.argument.1",
            FT_UINT32, BASE_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_data_length,
            { "Data Length",                      "adb.data_length",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_data_crc32,
            { "Data CRC32",                      "adb.data_crc32",
            FT_UINT32, BASE_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_magic,
            { "Magic",                           "adb.magic",
            FT_UINT32, BASE_HEX, VALS(magic_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_version,
            { "Version",                         "adb.version",
            FT_UINT32, BASE_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_max_data,
            { "Max Data",                        "adb.max_data",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_auth_type,
            { "Type",                            "adb.auth_type",
            FT_UINT32, BASE_HEX, VALS(auth_type_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_online,
            { "Online",                          "adb.online",
            FT_BOOLEAN, 32, TFS(&tfs_no_yes), 0x00,
            NULL, HFILL }
        },
        { &hf_sequence,
            { "Sequence",                        "adb.sequence",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_zero,
            { "Zero",                            "adb.zero",
            FT_UINT32, BASE_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_local_id,
            { "Local ID",                        "adb.local_id",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_remote_id,
            { "Remote ID",                       "adb.remote_id",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_data,
            { "Data",                            "adb.data",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_service,
            { "Service",                         "adb.service",
            FT_STRING, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_data_fragment,
            { "Data Fragment",                   "adb.data_fragment",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_service_start_in_frame,
            { "Service Start in Frame",          "adb.service_start_in_frame",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_close_local_in_frame,
            { "Local Service Close in Frame",    "adb.close_local_in_frame",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_close_remote_in_frame,
            { "Remote Service Close in Frame",   "adb.close_remote_in_frame",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_command_in_frame,
            { "Command in Frame",                "adb.command_in_frame",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_completed_in_frame,
            { "Completed in Frame",              "adb.completed_in_frame",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_connection_info,
            { "Info",                            "adb.connection_info",
            FT_STRINGZ, STR_ASCII, NULL, 0x00,
            NULL, HFILL }
        }
    };

    static gint *ett[] = {
        &ett_adb,
        &ett_adb_arg0,
        &ett_adb_arg1,
        &ett_adb_crc,
        &ett_adb_magic
    };

    static ei_register_info ei[] = {
        { &ei_invalid_magic,          { "adb.expert.invalid_magic", PI_PROTOCOL, PI_WARN, "Invalid Magic", EXPFILL }},
        { &ei_invalid_crc,            { "adb.expert.crc_error", PI_PROTOCOL, PI_ERROR, "CRC32 Error", EXPFILL }},
    };

    command_info         = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
    service_info         = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());

    proto_adb = proto_register_protocol("Android Debug Bridge", "ADB", "adb");
    adb_handle = new_register_dissector("adb", dissect_adb, proto_adb);

    proto_register_field_array(proto_adb, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_module = expert_register_protocol(proto_adb);
    expert_register_field_array(expert_module, ei, array_length(ei));

    module = prefs_register_protocol(proto_adb, NULL);
    prefs_register_static_text_preference(module, "version",
            "ADB protocol version is compatibile pior to: adb 1.0.31",
            "Version of protocol supported by this dissector.");
}
コード例 #30
0
void
proto_register_hci_usb(void)
{
    module_t *module;

    static hf_register_info hf[] = {
        {  &hf_msg_fragments,
            { "Message fragments",               "hci_usb.msg.fragments",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        {  &hf_msg_fragment,
            { "Message fragment",                "hci_usb.msg.fragment",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        {  &hf_msg_fragment_overlap,
            { "Message fragment overlap",        "hci_usb.msg.fragment.overlap",
            FT_BOOLEAN, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        {  &hf_msg_fragment_overlap_conflicts,
            { "Message fragment overlapping with conflicting data", "hci_usb.msg.fragment.overlap.conflicts",
            FT_BOOLEAN, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        {  &hf_msg_fragment_multiple_tails,
            { "Message has multiple tail fragments", "hci_usb.msg.fragment.multiple_tails",
            FT_BOOLEAN, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        {  &hf_msg_fragment_too_long_fragment,
            { "Message fragment too long",       "hci_usb.msg.fragment.too_long_fragment",
            FT_BOOLEAN, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        {  &hf_msg_fragment_error,
            { "Message defragmentation error",   "hci_usb.msg.fragment.error",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        {  &hf_msg_fragment_count,
            { "Message fragment count",          "hci_usb.msg.fragment.count",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        {  &hf_msg_reassembled_in,
            { "Reassembled in",                  "hci_usb.msg.reassembled.in",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        {  &hf_msg_reassembled_length,
            { "Reassembled MP2T length",         "hci_usb.msg.reassembled.length",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_bthci_usb_packet_fragment,
            { "Packet Fragment",                 "hci_usb.packet.fragment",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_bthci_usb_packet_complete,
            { "Packet Complete",                 "hci_usb.packet.complete",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_bthci_usb_packet_unknown_fragment,
            { "Unknown Packet Fragment",         "hci_usb.packet.unknown_fragment",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_bthci_usb_data,
            { "Unknown Data",                    "hci_usb.data",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        }
    };

    static gint *ett[] = {
        &ett_hci_usb,
        &ett_hci_usb_msg_fragment,
        &ett_hci_usb_msg_fragments,
    };

    reassembly_table_init(&hci_usb_reassembly_table,
                          &addresses_reassembly_table_functions);
    fragment_info_table = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());

    chandle_to_bdaddr_table = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); /* adapter, chandle: bdaddr */
    bdaddr_to_name_table = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); /* bdaddr: name */
    localhost_bdaddr = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); /* adaper, frame: bdaddr */
    localhost_name = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); /* adaper, frame: name */

    proto_hci_usb = proto_register_protocol("Bluetooth HCI USB Transport", "HCI_USB", "hci_usb");
    proto_register_field_array(proto_hci_usb, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    new_register_dissector("hci_usb", dissect_hci_usb, proto_hci_usb);

    module = prefs_register_protocol(proto_hci_usb, NULL);
    prefs_register_static_text_preference(module, "bthci_usb.version",
            "Bluetooth HCI USB Transport from Core 4.0",
            "Version of protocol supported by this dissector.");
}