Esempio n. 1
0
void
proto_register_wai(void)
{
    static hf_register_info hf[] = {
        { &hf_wai_version,
          { "Version", "wai.version",
            FT_UINT16, BASE_DEC, NULL, 0x0,
            "Version of authentication infrastructure", HFILL }},

        { &hf_wai_type,
          { "Type", "wai.type",
            FT_UINT8, BASE_HEX, VALS(wai_type_names), 0x0,
            "Protocol type", HFILL }},

        { &hf_wai_subtype,
          { "Subtype", "wai.subtype",
            FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wai_subtype_names_ext, 0x0,
            NULL, HFILL }},

        { &hf_wai_reserved,
          { "Reserved", "wai.reserved",
            FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_wai_length,
          { "Length", "wai.length",
            FT_UINT16, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_wai_seq,
          { "Sequence number", "wai.seq",
            FT_UINT16, BASE_DEC, NULL, 0x0,
            "Packet sequence number", HFILL }},

        { &hf_wai_fragm_seq,
          { "Fragment sequence number", "wai.fragm.seq",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_wai_flag,
          { "Flag", "wai.flag",
            FT_UINT8, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_wai_data,
          { "Data", "wai.data",
            FT_BYTES, BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_wai_bk_rekeying_flag,
          {"BK rekeying", "wai.bk.rekeying.flag",
           FT_BOOLEAN, 8, TFS (&wai_bk_rekeying_flag), FLAG_BIT0,
           "BK rekeying flag", HFILL }},

        { &hf_wai_preauthentication_flag,
          {"Pre-Authentication", "wai.preauthentication.flag",
           FT_BOOLEAN, 8, TFS (&wai_preauthentication_flag), FLAG_BIT1,
           "Pre-Authentication flag", HFILL }},

        { &hf_wai_certificate_flag,
          {"Certificate", "wai.certificate.flag",
           FT_BOOLEAN, 8, TFS (&wai_certificate_flag), FLAG_BIT2,
           "Certificate flag", HFILL }},

        { &hf_wai_optional_flag,
          {"Optional", "wai.optional.flag",
           FT_BOOLEAN, 8, TFS (&wai_optional_flag), FLAG_BIT3,
           "Optional flag", HFILL }},

        { &hf_wai_usk_rekeying_flag,
            {"USK rekeying", "wai.usk.rekeying.flag",
                    FT_BOOLEAN, 8, TFS (&wai_usk_rekeying_flag), FLAG_BIT4,
                    "USK rekeying flag", HFILL }},

        { &hf_wai_negotiation_flag,
            {"STA negotiation", "wai.negotiation.flag",
                    FT_BOOLEAN, 8, TFS (&wai_negotiation_flag), FLAG_BIT5,
                    "STA negotiation flag", HFILL }},

        { &hf_wai_revoking_flag,
            {"STA revoking", "wai.revoking.flag",
                    FT_BOOLEAN, 8, TFS (&wai_revoking_flag), FLAG_BIT6,
                    "STA revoking flag", HFILL }},

        { &hf_wai_reserved_flag,
            {"Reserved", "wai.reserved.flag",
                    FT_BOOLEAN, 8, TFS (&wai_reserved_flag), FLAG_BIT7,
                    "Reserved flag", HFILL }},

        { &hf_wai_attr_type,
          { "Type", "wai.attrtype",
            FT_UINT8, BASE_HEX, VALS(wai_attr_type_names), 0x0,
            "Attribute type", HFILL }},

        { &hf_wai_cert,
            {"Certificate", "wai.cert",
                    FT_BYTES, BASE_NONE, NULL, 0x0,
             NULL, HFILL }},

        { &hf_wai_cert_id,
          {"Id", "wai.cert.id",
           FT_UINT16, BASE_HEX, NULL, 0x0,
           "Certificate Id", HFILL }},

        { &hf_wai_cert_data,
          {"Data", "wai.cert.data",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           "Certificate data", HFILL }},

        { &hf_wai_cert_len,
          {"Length", "wai.cert.len",
           FT_UINT16, BASE_DEC, NULL, 0x0,
           "Certificate length", HFILL }},

        { &hf_wai_addid,
          {"ADDID", "wai.addid",
           FT_STRING, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_ae_mac,
          {"AE MAC", "wai.ae.mac",
           FT_ETHER, BASE_NONE, NULL, 0x0,
           "AE MAC address", HFILL }},

        { &hf_wai_asue_mac,
          {"ASUE MAC", "wai.asue.mac",
           FT_ETHER, BASE_NONE, NULL, 0x0,
           "ASUE MAC address", HFILL }},

        { &hf_wai_bkid,
          {"BKID", "wai.bkid",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_uskid,
          {"USKID", "wai.uskid",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_wie,
          {"WIE from ASUE", "wai.wie",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_message_auth_code,
          {"Message Authentication Code", "wai.message.auth.code",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_mskid,
          {"MSKID/STAKeyID", "wai.mskid",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_data_pack_num,
          {"Data packet number", "wai.data.packet.num",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_key_data,
          {"Key Data", "wai.key.data",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_key_data_len,
          {"Length", "wai.key.data.len",
           FT_UINT8, BASE_DEC, NULL, 0x0,
           "Key data length", HFILL }},

        { &hf_wai_key_data_content,
          {"Content", "wai.key.data.content",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           "Key data content", HFILL }},

        { &hf_wai_key_ann_id,
          {"Key Announcement Identifier", "wai.key.ann.id",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_auth_id,
          {"Authentication Identifier", "wai.auth.id",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_identity,
          {"Identifier", "wai.identity",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_identity_id,
          {"Id", "wai.identity.id",
           FT_UINT16, BASE_HEX, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_identity_len,
          {"Length", "wai.identity.len",
           FT_UINT16, BASE_DEC, NULL, 0x0,
           "Identity length", HFILL }},

        { &hf_wai_identity_data,
          {"Data", "wai.identity.data",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           "Identity data", HFILL }},

        { &hf_wai_ecdh,
          {"ECDH Parameter", "wai.ecdhp",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_ecdh_id,
          {"ID", "wai.edch.id",
           FT_UINT8, BASE_HEX, NULL, 0x0,
           "ECDH Parameter Identifier", HFILL }},

        { &hf_wai_ecdh_len,
          {"Length", "wai.ecdh.len",
           FT_UINT16, BASE_DEC, NULL, 0x0,
           "ECDH Parameter Length", HFILL }},

        { &hf_wai_ecdh_content,
          {"Content", "wai.ecdh.content",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           "ECDH Parameter Content", HFILL }},

        { &hf_wai_counter,
          {"Replay counter", "wai.counter",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_sta_key_id,
          {"STAKeyID", "wai.sta.key.id",
           FT_UINT8, BASE_HEX, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_challenge,
          {"Challenge", "wai.challenge",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_cert_ver,
          {"Multiple Certificate Verification Result", "wai.cert.ver",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_nonce,
          {"Nonce", "wai.nonce",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_ver_res,
          {"Verification result", "wai.ver.res",
           FT_UINT8, BASE_HEX, VALS(wai_ver_res_names), 0x0,
           NULL, HFILL }},

        { &hf_wai_sign_alg,
          {"Signature Algorithm", "wai.sign.alg",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_hash_alg_id,
          {"Hash Algorithm Identifier", "wai.hash.alg.id",
           FT_UINT8, BASE_HEX, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_sign_alg_id,
          {"Signature Algorithm Identifier", "wai.sign.alg.id",
           FT_UINT8, BASE_HEX, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_param,
          {"Parameter", "wai.param",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_param_id,
          {"Parameter Identifier", "wai.param.id",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_param_content,
          {"Parameter Content", "wai.param.content",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_sign_val,
          {"Signature Value", "wai.sign.val",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_sign_content,
          {"Signature Content", "wai.sign.content",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_sign,
          {"Signature", "wai.sign",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_identity_list,
          {"ASU List trusted by ASUE", "wai.identity_list",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           "Identity list", HFILL }},

        { &hf_wai_reserved_byte,
          {"Reserved", "wai.reserved.byte",
           FT_UINT8, BASE_HEX, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_no_of_ids,
          {"Number of Identities", "wai.no.of.ids",
           FT_UINT16, BASE_DEC, NULL, 0x0,
           NULL, HFILL }},

        { &hf_wai_access_res,
        {"Access result", "wai.access_result",
         FT_UINT8, BASE_HEX, VALS(wai_access_res_names), 0x0,
         NULL, HFILL }},

        { &hf_wai_fragments,
          {"Message fragments", "wai.fragments",
           FT_NONE, BASE_NONE, NULL, 0x00,
           NULL, HFILL }},

        { &hf_wai_fragment,
          {"Message fragment", "wai.fragment",
           FT_FRAMENUM, BASE_NONE, NULL, 0x00,
           NULL, HFILL }},

        { &hf_wai_fragment_overlap,
          {"Message fragment overlap", "wai.fragment.overlap",
           FT_BOOLEAN, BASE_NONE, NULL, 0x00,
           NULL, HFILL }},

        { &hf_wai_fragment_overlap_conflicts,
          {"Message fragment overlapping with conflicting data", "wai.fragment.overlap.conflicts",
           FT_BOOLEAN, BASE_NONE, NULL, 0x00,
           NULL, HFILL }},

        { &hf_wai_fragment_multiple_tails,
          {"Message has multiple tail fragments", "wai.fragment.multiple_tails",
           FT_BOOLEAN, BASE_NONE, NULL, 0x00,
           NULL, HFILL }},

        { &hf_wai_fragment_too_long_fragment,
          {"Message fragment too long", "wai.fragment.too_long_fragment",
           FT_BOOLEAN, BASE_NONE, NULL, 0x00,
           NULL, HFILL }},

        { &hf_wai_fragment_error,
          {"Message defragmentation error", "wai.fragment.error",
           FT_FRAMENUM, BASE_NONE, NULL, 0x00,
           NULL, HFILL }},

        { &hf_wai_fragment_count,
          {"Message fragment count", "wai.fragment.count",
           FT_UINT32, BASE_DEC, NULL, 0x00,
           NULL, HFILL }},

        { &hf_wai_reassembled_in,
          {"Reassembled in", "wai.reassembled.in",
           FT_FRAMENUM, BASE_NONE, NULL, 0x00,
           NULL, HFILL }},

        { &hf_wai_reassembled_length,
          {"Reassembled length", "wai.reassembled.length",
           FT_UINT32, BASE_DEC, NULL, 0x00,
           NULL, HFILL }}
    };

    static gint *ett[] = {
        &ett_wai,
        &ett_wai_data,
        &ett_wai_flags,
        &ett_wai_certificate,
        &ett_wai_mac,
        &ett_wai_identity,
        &ett_wai_key_data,
        &ett_wai_ecdh_param,
        &ett_wai_certificate_verification,
        &ett_wai_identity_list,
        &ett_wai_sign,
        &ett_wai_sign_alg,
        &ett_wai_sign_val,
        &ett_wai_parameter,
        &ett_wai_fragment,
        &ett_wai_fragments
    };

    proto_wai = proto_register_protocol("WAI Protocol", "WAI", "wai");
    register_init_routine(&wai_reassemble_init);
    register_cleanup_routine(&wai_reassemble_cleanup);
    proto_register_field_array(proto_wai, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));

    wai_handle = register_dissector("wai", dissect_wai, proto_wai);
}
Esempio n. 2
0
/*--- proto_register_rrc -------------------------------------------*/
void proto_register_rrc(void) {

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

#include "packet-rrc-hfarr.c"
    { &hf_test,
      { "RAB Test", "rrc.RAB.test",
        FT_UINT8, BASE_DEC, NULL, 0,
        "rrc.RAB_Info_r6", HFILL }},
    { &hf_rrc_eutra_feat_group_ind_1,
      { "Indicator 1", "rrc.eutra_feat_group_ind_1",
        FT_BOOLEAN, BASE_NONE, TFS(&rrc_eutra_feat_group_ind_1_val), 0,
        "EUTRA Feature Group Indicator 1", HFILL }},
    { &hf_rrc_eutra_feat_group_ind_2,
      { "Indicator 2", "rrc.eutra_feat_group_ind_2",
        FT_BOOLEAN, BASE_NONE, TFS(&rrc_eutra_feat_group_ind_2_val), 0,
        "EUTRA Feature Group Indicator 2", HFILL }},
    { &hf_rrc_eutra_feat_group_ind_3,
      { "Indicator 3", "rrc.eutra_feat_group_ind_3",
        FT_BOOLEAN, BASE_NONE, TFS(&rrc_eutra_feat_group_ind_3_val), 0,
        "EUTRA Feature Group Indicator 3", HFILL }},
    { &hf_rrc_eutra_feat_group_ind_4,
      { "Indicator 4", "rrc.eutra_feat_group_ind_4",
        FT_BOOLEAN, BASE_NONE, TFS(&rrc_eutra_feat_group_ind_4_val), 0,
        "EUTRA Feature Group Indicator 4", HFILL }},
    { &hf_rrc_ims_info_atgw_trans_det_cont_type,
      { "ATGW transfer details content type", "rrc.rsrvcc_info.ims_info_atgw_trans_det_cont",
        FT_UINT8, BASE_DEC, VALS(rrc_ims_info_atgw_trans_det_cont_type), 0x3,
        "rSR-VCC IMS information ATGW transfer details content type", HFILL }},
    {&hf_rrc_ims_info_atgw_udp_port,
        {"ATGW UDP port","rrc.rsrvcc_info.ims_info_atgw_udp_port",
        FT_UINT16,BASE_DEC, NULL, 0x0,
        "rSR-VCC IMS information ATGW UDP port", HFILL }},
    { &hf_rrc_ims_info_atgw_ipv4,
        {"ATGW IPv4", "rrc.rsrvcc_info.ims_info_atgw_ipv4",
        FT_IPv4, BASE_NONE, NULL, 0x0,
        "rSR-VCC IMS information ATGW IPv4", HFILL}},
    { &hf_rrc_ims_info_atgw_ipv6,
        {"ATGW IPv6", "rrc.rsrvcc_info.ims_info_atgw_ipv6",
        FT_IPv6, BASE_NONE, NULL, 0x0,
        "rSR-VCC IMS information ATGW IPv6", HFILL}},
  };

  /* List of subtrees */
  static gint *ett[] = {
    &ett_rrc,
#include "packet-rrc-ettarr.c"
    &ett_rrc_eutraFeatureGroupIndicators,
    &ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo,
    &ett_rrc_ims_info,
  };

  static ei_register_info ei[] = {
     { &ei_rrc_no_hrnti, { "rrc.no_hrnti", PI_SEQUENCE, PI_NOTE, "Did not detect any H-RNTI", EXPFILL }},
  };

  expert_module_t* expert_rrc;

  /* Register protocol */
  proto_rrc = proto_register_protocol(PNAME, PSNAME, PFNAME);
  /* Register fields and subtrees */
  proto_register_field_array(proto_rrc, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_rrc = expert_register_protocol(proto_rrc);
  expert_register_field_array(expert_rrc, ei, array_length(ei));

  register_dissector("rrc", dissect_rrc, proto_rrc);

#include "packet-rrc-dis-reg.c"




    register_init_routine(rrc_init);
    register_cleanup_routine(rrc_cleanup);
}
Esempio n. 3
0
void
proto_register_gssapi(void)
{
	static hf_register_info hf[] = {
	{ &hf_gssapi_oid,
		{ "OID", "gss-api.OID", FT_STRING, BASE_NONE,
		  NULL, 0, "This is a GSS-API Object Identifier", HFILL }},
	{ &hf_gssapi_token_object,
		{ "Token object", "gss-api.token_object", FT_BYTES, BASE_NONE,
		  NULL, 0, NULL, HFILL }},
	{ &hf_gssapi_auth_verifier,
		{ "Authentication verifier", "gss-api.auth_verifier", FT_BYTES, BASE_NONE,
		  NULL, 0, NULL, HFILL }},
	{ &hf_gssapi_auth_credentials,
		{ "Authentication credentials", "gss-api.auth_credentials", FT_BYTES, BASE_NONE,
		  NULL, 0, NULL, HFILL }},
	{ &hf_gssapi_segment,
		{ "GSSAPI Segment", "gss-api.segment", FT_FRAMENUM, BASE_NONE,
		  NULL, 0x0, NULL, HFILL }},
	{ &hf_gssapi_segments,
		{ "GSSAPI Segments", "gss-api.segment.segments", FT_NONE, BASE_NONE,
		  NULL, 0x0, NULL, HFILL }},
	{ &hf_gssapi_segment_overlap,
		{ "Fragment overlap",	"gss-api.segment.overlap", FT_BOOLEAN, BASE_NONE,
		   NULL, 0x0, "Fragment overlaps with other fragments", HFILL }},
	{ &hf_gssapi_segment_overlap_conflict,
		{ "Conflicting data in fragment overlap",	"gss-api.segment.overlap.conflict", FT_BOOLEAN, BASE_NONE,
		  NULL, 0x0, "Overlapping fragments contained conflicting data", HFILL }},
	{ &hf_gssapi_segment_multiple_tails,
		{ "Multiple tail fragments found",	"gss-api.segment.multipletails", FT_BOOLEAN, BASE_NONE,
		  NULL, 0x0, "Several tails were found when defragmenting the packet", HFILL }},
	{ &hf_gssapi_segment_too_long_fragment,
		{ "Fragment too long",	"gss-api.segment.toolongfragment", FT_BOOLEAN, BASE_NONE,
		  NULL, 0x0, "Fragment contained data past end of packet", HFILL }},
	{ &hf_gssapi_segment_error,
		{ "Defragmentation error", "gss-api.segment.error", FT_FRAMENUM, BASE_NONE,
		  NULL, 0x0, "Defragmentation error due to illegal fragments", HFILL }},
	{ &hf_gssapi_segment_count,
		{ "Fragment count", "gss-api.segment.count", FT_UINT32, BASE_DEC,
		  NULL, 0x0, NULL, HFILL }},
	{ &hf_gssapi_reassembled_in,
		{ "Reassembled In", "gss-api.reassembled_in", FT_FRAMENUM, BASE_NONE,
		  NULL, 0x0, "The frame where this pdu is reassembled", HFILL }},
	{ &hf_gssapi_reassembled_length,
		{ "Reassembled GSSAPI length", "gss-api.reassembled.length", FT_UINT32, BASE_DEC,
		  NULL, 0x0, "The total length of the reassembled payload", HFILL }},
	};

	static gint *ett[] = {
		&ett_gssapi,
		&ett_gssapi_segment,
		&ett_gssapi_segments,
	};

	static ei_register_info ei[] = {
		{ &ei_gssapi_unknown_header, { "gssapi.unknown_header", PI_PROTOCOL, PI_WARN, "Unknown header", EXPFILL }},
	};

	module_t *gssapi_module;
	expert_module_t *expert_gssapi;

	proto_gssapi = proto_register_protocol(
		"GSS-API Generic Security Service Application Program Interface",
		"GSS-API", "gss-api");

	gssapi_module = prefs_register_protocol(proto_gssapi, NULL);
	prefs_register_bool_preference(gssapi_module, "gssapi_reassembly",
		"Reassemble fragmented GSSAPI blobs",
		"Whether or not to try reassembling GSSAPI blobs spanning multiple (SMB/SessionSetup) PDUs",
		&gssapi_reassembly);
	proto_register_field_array(proto_gssapi, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));
	expert_gssapi = expert_register_protocol(proto_gssapi);
	expert_register_field_array(expert_gssapi, ei, array_length(ei));

	register_dissector("gssapi", dissect_gssapi, proto_gssapi);
	register_dissector("gssapi_verf", dissect_gssapi_verf, proto_gssapi);

	gssapi_oids = g_hash_table_new(gssapi_oid_hash, gssapi_oid_equal);
	register_init_routine(gssapi_reassembly_init);
	register_cleanup_routine(gssapi_reassembly_cleanup);
}
/*--- proto_register_rtse -------------------------------------------*/
void proto_register_rtse(void) {

  /* List of fields */
  static hf_register_info hf[] =
  {
    /* Fragment entries */
    { &hf_rtse_segment_data,
      { "RTSE segment data", "rtse.segment", FT_NONE, BASE_NONE,
    NULL, 0x00, NULL, HFILL } },
    { &hf_rtse_fragments,
      { "RTSE fragments", "rtse.fragments", FT_NONE, BASE_NONE,
    NULL, 0x00, NULL, HFILL } },
    { &hf_rtse_fragment,
      { "RTSE fragment", "rtse.fragment", FT_FRAMENUM, BASE_NONE,
    NULL, 0x00, NULL, HFILL } },
    { &hf_rtse_fragment_overlap,
      { "RTSE fragment overlap", "rtse.fragment.overlap", FT_BOOLEAN,
    BASE_NONE, NULL, 0x0, NULL, HFILL } },
    { &hf_rtse_fragment_overlap_conflicts,
      { "RTSE fragment overlapping with conflicting data",
    "rtse.fragment.overlap.conflicts", FT_BOOLEAN, BASE_NONE,
    NULL, 0x0, NULL, HFILL } },
    { &hf_rtse_fragment_multiple_tails,
      { "RTSE has multiple tail fragments",
    "rtse.fragment.multiple_tails", FT_BOOLEAN, BASE_NONE,
    NULL, 0x0, NULL, HFILL } },
    { &hf_rtse_fragment_too_long_fragment,
      { "RTSE fragment too long", "rtse.fragment.too_long_fragment",
    FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } },
    { &hf_rtse_fragment_error,
      { "RTSE defragmentation error", "rtse.fragment.error", FT_FRAMENUM,
    BASE_NONE, NULL, 0x00, NULL, HFILL } },
    { &hf_rtse_fragment_count,
      { "RTSE fragment count", "rtse.fragment.count", FT_UINT32, BASE_DEC,
    NULL, 0x00, NULL, HFILL } },
    { &hf_rtse_reassembled_in,
      { "Reassembled RTSE in frame", "rtse.reassembled.in", FT_FRAMENUM, BASE_NONE,
    NULL, 0x00, "This RTSE packet is reassembled in this frame", HFILL } },
    { &hf_rtse_reassembled_length,
      { "Reassembled RTSE length", "rtse.reassembled.length", FT_UINT32, BASE_DEC,
    NULL, 0x00, "The total length of the reassembled payload", HFILL } },

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

  /* List of subtrees */
  static gint *ett[] = {
    &ett_rtse,
    &ett_rtse_unknown,
    &ett_rtse_fragment,
    &ett_rtse_fragments,
#include "packet-rtse-ettarr.c"
  };

  static ei_register_info ei[] = {
     { &ei_rtse_dissector_oid_not_implemented, { "rtse.dissector_oid_not_implemented", PI_UNDECODED, PI_WARN, "RTSE: Dissector for OID not implemented", EXPFILL }},
     { &ei_rtse_unknown_rtse_pdu, { "rtse.unknown_rtse_pdu", PI_UNDECODED, PI_WARN, "Unknown RTSE PDU", EXPFILL }},
     { &ei_rtse_abstract_syntax, { "rtse.bad_abstract_syntax", PI_PROTOCOL, PI_WARN, "Unable to determine abstract syntax for indirect reference", EXPFILL }},
  };

  expert_module_t* expert_rtse;
  module_t *rtse_module;

  /* Register protocol */
  proto_rtse = proto_register_protocol(PNAME, PSNAME, PFNAME);
  new_register_dissector("rtse", dissect_rtse, proto_rtse);
  /* Register fields and subtrees */
  proto_register_field_array(proto_rtse, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_rtse = expert_register_protocol(proto_rtse);
  expert_register_field_array(expert_rtse, ei, array_length(ei));
  register_init_routine (&rtse_reassemble_init);
  register_cleanup_routine (&rtse_reassemble_cleanup);
  rtse_module = prefs_register_protocol_subtree("OSI", proto_rtse, NULL);

  prefs_register_bool_preference(rtse_module, "reassemble",
                 "Reassemble segmented RTSE datagrams",
                 "Whether segmented RTSE datagrams should be reassembled."
                 " To use this option, you must also enable"
                 " \"Allow subdissectors to reassemble TCP streams\""
                 " in the TCP protocol settings.", &rtse_reassemble);

  rtse_oid_dissector_table = register_dissector_table("rtse.oid", "RTSE OID Dissectors", FT_STRING, BASE_NONE);
  oid_table=g_hash_table_new(g_str_hash, g_str_equal);


}
/* Register the protocol with Wireshark */
void
proto_register_cbs(void)
{
   /* Setup list of header fields */
   static hf_register_info hf_cbs[] =
      {
         { &hf_gsm_cbs_serial_number,
           { "GSM CBS Serial Number", "gsm_cbs.serial_number",
             FT_UINT16, BASE_HEX_DEC, NULL, 0x00,
             NULL, HFILL }
         },
         { &hf_gsm_cbs_message_code,
           { "GSM CBS Message Code", "gsm_cbs.message_code",
             FT_UINT16, BASE_DEC_HEX, NULL, 0x3FF0,
             NULL, HFILL }
         },
         { &hf_gsm_cbs_geographic_scope,
           { "GSM CBS Geographic Scope",     "gsm_cbs.geographic_scope",
             FT_UINT16, BASE_DEC, VALS(geographic_scope_values), 0xC000,
             NULL, HFILL }
         },
         { &hf_gsm_cbs_update_number,
           { "GSM CBS Update Number",        "gsm_cbs.update_number",
             FT_UINT16, BASE_DEC, NULL, 0x000F,
             NULL, HFILL }
         },
         { &hf_gsm_cbs_message_identifier,
           { "GSM CBS Message Identifier",   "gsm_cbs.message-identifier",
             FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
             NULL, HFILL }
         },
         { &hf_gsm_cbs_total_pages,
           { "GSM CBS Total Pages",  "gsm_cbs.total_pages",
             FT_UINT8, BASE_DEC, NULL, 0x0F,
             NULL, HFILL }
         },
         { &hf_gsm_cbs_current_page,
           { "GSM CBS Current Page", "gsm_cbs.current_page",
             FT_UINT8, BASE_DEC, NULL, 0xF0,
             NULL, HFILL }
         },
         /* Fragment fields
          */
         { &hf_gsm_cbs_page_overlap,
           { "page overlap",
             "gsm_cbs.page.overlap",
             FT_BOOLEAN, BASE_NONE, NULL, 0x0,
             "GSM CBS page overlaps with other fragments", HFILL
           }
         },
         { &hf_gsm_cbs_page_overlap_conflict,
           { "Conflicting data in page overlap",
             "gsm_cbs.page.overlap.conflict",
             FT_BOOLEAN, BASE_NONE, NULL, 0x0,
             "Overlapping pages contained conflicting data", HFILL
           }
         },
         { &hf_gsm_cbs_page_multiple_tails,
           { "Multiple final pages found",
             "gsm_cbs.page.multipletails",
             FT_BOOLEAN, BASE_NONE, NULL, 0x0,
             "Several copies of the final page were found when reassembling the message", HFILL
           }
         },
         { &hf_gsm_cbs_page_too_long_fragment,
           { "Page too long",
             "gsm_cbs.page.toolongfragment",
             FT_BOOLEAN, BASE_NONE, NULL, 0x0,
             "Page contained data past end of packet", HFILL
           }
         },
         { &hf_gsm_cbs_page_error,
           { "Reassembly error",
             "gsm_cbs.fragment.error",
             FT_FRAMENUM, BASE_NONE, NULL, 0x0,
             "Reassembly error due to illegal fragments", HFILL
           }
         },
         { &hf_gsm_cbs_page_count,
           { "Fragment count",
             "gsm_cbs.fragment.count",
             FT_UINT32, BASE_DEC, NULL, 0x0,
             "Count of Page Fragment", HFILL
           }
         },
         { &hf_gsm_cbs_message_reassembled_in,
           { "Reassembled in",
             "gsm_cbs.reassembled.in",
             FT_FRAMENUM, BASE_NONE, NULL, 0x0,
             "CBS pages are reassembled in the given packet", HFILL
           }
         },
         { &hf_gsm_cbs_message_reassembled_length,
           { "Reassembled message length",
             "gsm_cbs.reassembled.length",
             FT_UINT32, BASE_DEC, NULL, 0x0,
             "The total length of the reassembled message", HFILL
           }
         },
         { &hf_gsm_cbs_page_num,
           { "CBS Page Number",
             "gsm_cbs.page_number",
             FT_FRAMENUM, BASE_NONE, NULL, 0x0,
             NULL, HFILL
           }
         },
         { &hf_gsm_cbs_pages,
           { "CBS Pages",
             "gsm_cbs.pages",
             FT_NONE, BASE_NONE, NULL, 0x0,
             NULL, HFILL
           }
         },
         { &hf_gsm_cbs_page_content,
           { "CBS Page Content",
             "gsm_cbs.page_content",
             FT_STRING, BASE_NONE, NULL, 0x0,
             NULL, HFILL
           }
         },
         { &hf_gsm_cbs_page_content_padding,
           { "CBS Page Content Padding",
             "gsm_cbs.page_content_padding",
             FT_STRING, BASE_NONE, NULL, 0x0,
             NULL, HFILL
           }
         },
         { &hf_gsm_cbs_message_content,
           { "CBS Message Content",
             "gsm_cbs.message_content",
             FT_STRING, BASE_NONE, NULL, 0x0,
             NULL, HFILL
           }
         }
      };

   /* Setup protocol subtree array */
   static gint *ett[] = {
      &ett_cbs_msg,
      &ett_cbs_serial_no,
      &ett_cbs_coding,
      &ett_gsm_cbs_page,
      &ett_gsm_cbs_page_content,
      &ett_gsm_cbs_pages,
   };

   static ei_register_info ei[] = {
      { &ei_gsm_cbs_unhandled_encoding, { "gsm_cbs.unhandled_encoding", PI_PROTOCOL, PI_WARN, "Unhandled encoding", EXPFILL }},
   };
   expert_module_t* expert_cell_broadcast;

   /* Register the protocol name and description */
   proto_cell_broadcast = proto_register_protocol("GSM Cell Broadcast Service", "GSM Cell Broadcast Service", "gsm_cbs");

   proto_register_field_array(proto_cell_broadcast, hf_cbs, array_length(hf_cbs));
   register_init_routine(gsm_cbs_message_reassembly_init);
   register_cleanup_routine(gsm_cbs_message_reassembly_cleanup);

   /* subdissector code */
   register_dissector("gsm_cbs", dissect_gsm_cell_broadcast, proto_cell_broadcast);
   register_dissector("umts_cell_broadcast", dissect_umts_cell_broadcast_message, proto_cell_broadcast);

   /* subtree array */
   proto_register_subtree_array(ett, array_length(ett));
   expert_cell_broadcast = expert_register_protocol(proto_cell_broadcast);
   expert_register_field_array(expert_cell_broadcast, ei, array_length(ei));
}
Esempio n. 6
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,
    &ett_ros_invoke_argument,
    &ett_ros_return_result,
    &ett_ros_bind_invoke,
    &ett_ros_bind_result,
    &ett_ros_bind_error,
    &ett_ros_unbind_invoke,
    &ett_ros_unbind_result,
    &ett_ros_unbind_error,

#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);
  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", proto_ros, FT_STRING, BASE_NONE, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
  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_cleanup_routine(ros_cleanup);
}
/*
 * proto_register_ts2()
 * */
void proto_register_ts2(void)
{
    static hf_register_info hf[] = {
        { &hf_ts2_class,
            { "Class", "ts2.class",
                FT_UINT16, BASE_HEX,
                VALS(classnames), 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_type,
            { "Type", "ts2.type",
                FT_UINT16, BASE_HEX,
                VALS(typenames), 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_clientid,
            { "Client id", "ts2.clientid",
                FT_UINT32, BASE_DEC,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_sessionkey,
            { "Session Key", "ts2.sessionkey",
                FT_UINT32, BASE_HEX,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_ackto,
            { "Ping Reply To", "ts2.ping_ackto",
                FT_UINT32, BASE_DEC,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_crc32,
            { "CRC32 Checksum", "ts2.crc32",
                FT_UINT32, BASE_HEX,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_seqnum,
            { "Sequence Number", "ts2.sequencenum",
                FT_UINT32, BASE_DEC,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_protocol_string,
            { "Protocol String", "ts2.protocolstring",
                FT_UINT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
#if 0
        { &hf_ts2_string,
            { "String", "ts2.string",
                FT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
#endif
        { &hf_ts2_registeredlogin,
            { "Registered Login", "ts2.registeredlogin",
                FT_BOOLEAN, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_name,
            { "Name", "ts2.name",
                FT_UINT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_password,
            { "Password", "ts2.password",
                FT_UINT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_nick,
            { "Nick", "ts2.nick",
                FT_UINT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_badlogin,
            { "Bad Login", "ts2.badlogin",
                FT_BOOLEAN, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_unknown,
            { "Unknown", "ts2.unknown",
                FT_BYTES, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_channel,
            { "Channel", "ts2.channel",
                FT_UINT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_subchannel,
            { "Sub-Channel", "ts2.subchannel",
                FT_UINT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_channelpassword,
            { "Channel Password", "ts2.channelpassword",
                FT_UINT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_emptyspace,
            { "Empty Space", "ts2.emptyspace",
                FT_NONE, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_fragmentnumber,
            { "Fragment Number", "ts2.fragmentnumber",
                FT_UINT16, BASE_DEC,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_platform_string,
            { "Platform String", "ts2.platformstring",
                FT_UINT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_server_name,
            { "Server Name", "ts2.servername",
                FT_UINT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_server_welcome_message,
            { "Server Welcome Message", "ts2.serverwelcomemessage",
                FT_UINT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_parent_channel_id,
            { "Parent Channel ID", "ts2.parentchannelid",
                FT_UINT32, BASE_HEX,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_codec,
            { "Codec", "ts2.codec",
                FT_UINT16, BASE_HEX,
                VALS(codecnames), 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_channel_flags,
            { "Channel Flags", "ts2.channelflags",
                FT_UINT8, BASE_HEX,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_channel_id,
            { "Channel Id", "ts2.chanelid",
                FT_UINT32, BASE_DEC,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_channel_name,
            { "Channel Name", "ts2.chanelname",
                FT_STRINGZ, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_channel_topic,
            { "Channel Topic", "ts2.chaneltopic",
                FT_STRINGZ, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_channel_description,
            { "Channel Description", "ts2.chaneldescription",
                FT_STRINGZ, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_player_id,
            { "Player Id", "ts2.playerid",
                FT_UINT32, BASE_DEC,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_player_status_flags,
            { "Player Status Flags", "ts2.playerstatusflags",
                FT_UINT16, BASE_DEC,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_number_of_players,
            { "Number Of Players", "ts2.numberofplayers",
                FT_UINT32, BASE_DEC,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_number_of_channels,
            { "Number Of Channels", "ts2.numberofchannels",
                FT_UINT32, BASE_DEC,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_resend_count,
            { "Resend Count", "ts2.resendcount",
                FT_UINT16, BASE_DEC,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_ts2_status_channelcommander,
            { "Channel Commander", "ts2.playerstatusflags.channelcommander",
                FT_BOOLEAN, 8,
                NULL, TS2_STATUS_CHANNELCOMMANDER,
                NULL, HFILL }
        },
        { &hf_ts2_status_blockwhispers,
            { "Block Whispers", "ts2.playerstatusflags.blockwhispers",
                FT_BOOLEAN, 8,
                NULL, TS2_STATUS_BLOCKWHISPERS,
                NULL, HFILL }
        },
        { &hf_ts2_status_away,
            { "Away", "ts2.playerstatusflags.away",
                FT_BOOLEAN, 8,
                NULL, TS2_STATUS_AWAY,
                NULL, HFILL }
        },
        { &hf_ts2_status_mutemicrophone,
            { "Mute Microphone", "ts2.playerstatusflags.mutemicrophone",
                FT_BOOLEAN, 8,
                NULL, TS2_STATUS_MUTEMICROPHONE,
                NULL, HFILL }
        },
        { &hf_ts2_status_mute,
            { "Mute", "ts2.playerstatusflags.mute",
                FT_BOOLEAN, 8,
                NULL, TS2_STATUS_MUTE,
                NULL, HFILL }
        },
        { &hf_msg_fragments,
            {"Message fragments", "ts2.fragments",
                FT_NONE, BASE_NONE,
                NULL, 0x00,
                NULL, HFILL }
        },
        { &hf_msg_fragment,
            {"Message fragment", "ts2.fragment",
                FT_FRAMENUM, BASE_NONE,
                NULL, 0x00,
                NULL, HFILL }
        },
        { &hf_msg_fragment_overlap,
            {"Message fragment overlap", "ts2.fragment.overlap",
                FT_BOOLEAN, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_msg_fragment_overlap_conflicts,
            {"Message fragment overlapping with conflicting data",
                "ts2.fragment.overlap.conflicts",
                FT_BOOLEAN, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_msg_fragment_multiple_tails,
            {"Message has multiple tail fragments",
                "ts2.fragment.multiple_tails",
                FT_BOOLEAN, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_msg_fragment_too_long_fragment,
            {"Message fragment too long", "ts2.fragment.too_long_fragment",
                FT_BOOLEAN, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_msg_fragment_error,
            {"Message defragmentation error", "ts2.fragment.error",
                FT_FRAMENUM, BASE_NONE,
                NULL, 0x00,
                NULL, HFILL }
        },
        { &hf_msg_fragment_count,
            {"Message fragment count", "ts2.fragment.count",
                FT_UINT32, BASE_DEC,
                NULL, 0x00,
                NULL, HFILL }
        },
        { &hf_msg_reassembled_in,
            {"Reassembled in", "ts2.reassembled.in",
                FT_FRAMENUM, BASE_NONE,
                NULL, 0x00,
                NULL, HFILL }
        },
        { &hf_msg_reassembled_length,
            {"Reassembled TeamSpeak2 length", "ts2.reassembled.length",
                FT_UINT32, BASE_DEC,
                NULL, 0x00,
                NULL, HFILL }
        },
        { &hf_ts2_channel_unregistered,
            { "Unregistered", "ts2.channelflags.unregistered",
                FT_BOOLEAN, 8,
                NULL, 0x01,
                NULL, HFILL }
        },
        { &hf_ts2_channel_moderated,
            { "Moderated", "ts2.channelflags.moderated",
                FT_BOOLEAN, 8,
                NULL, 0x02,
                NULL, HFILL }
        },
        { &hf_ts2_channel_password,
            { "Has password", "ts2.channelflags.has_password",
                FT_BOOLEAN, 8,
                NULL, 0x04,
                NULL, HFILL }
        },
        { &hf_ts2_channel_subchannels,
            { "Has subchannels", "ts2.channelflags.has_subchannels",
                FT_BOOLEAN, 8,
                NULL, 0x08,
                NULL, HFILL }
        },
        { &hf_ts2_channel_default,
            { "Default", "ts2.channelflags.default",
                FT_BOOLEAN, 8,
                NULL, 0x10,
                NULL, HFILL }
        },
        { &hf_ts2_channel_order,
            { "Channel order", "ts2.channelorder",
                FT_UINT16, BASE_DEC,
                NULL, 0x00,
                NULL, HFILL }
        },
        { &hf_ts2_max_users,
            { "Max users", "ts2.maxusers",
                FT_UINT16, BASE_DEC,
                NULL, 0x00,
                NULL, HFILL }
        }
    };

    static gint *ett[] = {
        &ett_ts2,
        &ett_msg_fragment,
        &ett_msg_fragments,
        &ett_ts2_channel_flags
    };

    /* Setup protocol subtree array */
    proto_ts2 = proto_register_protocol (
            "Teamspeak2 Protocol",    /* name */
            "TeamSpeak2",        /* short name */
            "ts2"            /* abbrev */
            );
    proto_register_field_array(proto_ts2, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));

    register_init_routine(ts2_init);
    register_cleanup_routine(ts2_cleanup);
}