예제 #1
0
/** plugin entry functions.
 * This registers the OpcUa protocol.
 */
void proto_register_opcua(void)
{
    module_t *opcua_module;

    proto_opcua = proto_register_protocol(
        "OpcUa Binary Protocol", /* name */
        "OpcUa",                 /* short name */
        "opcua"                  /* abbrev */
        );
  
    registerTransportLayerTypes(proto_opcua);
    registerSecurityLayerTypes(proto_opcua);
    registerApplicationLayerTypes(proto_opcua);
    registerSimpleTypes(proto_opcua);
    registerEnumTypes(proto_opcua);
    registerComplexTypes();
    registerServiceTypes();
    registerFieldTypes(proto_opcua);

    proto_register_subtree_array(ett, array_length(ett));    

    range_convert_str(&global_tcp_ports_opcua, ep_strdup_printf("%u", OPCUA_PORT),  65535);

    /* register user preferences */
    opcua_module = prefs_register_protocol(proto_opcua, proto_reg_handoff_opcua);
    prefs_register_range_preference(opcua_module, "tcp_ports",
				 "OPC UA TCP Ports",
				 "The TCP ports for the OPC UA TCP Binary Protocol",
				 &global_tcp_ports_opcua, 65535);
}
void proto_register_inap(void) {
	module_t *inap_module;
  /* List of fields */
  static hf_register_info hf[] = {



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






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

  static ei_register_info ei[] = {
     { &ei_inap_unknown_invokeData, { "inap.unknown.invokeData", PI_MALFORMED, PI_WARN, "Unknown invokeData", EXPFILL }},
     { &ei_inap_unknown_returnResultData, { "inap.unknown.returnResultData", PI_MALFORMED, PI_WARN, "Unknown returnResultData", EXPFILL }},
     { &ei_inap_unknown_returnErrorData, { "inap.unknown.returnErrorData", PI_MALFORMED, PI_WARN, "Unknown returnResultData", EXPFILL }},
  };

  expert_module_t* expert_inap;

  /* Register protocol */
  proto_inap = proto_register_protocol(PNAME, PSNAME, PFNAME);
  register_dissector("inap", dissect_inap, proto_inap);
  /* Register fields and subtrees */
  proto_register_field_array(proto_inap, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  expert_inap = expert_register_protocol(proto_inap);
  expert_register_field_array(expert_inap, ei, array_length(ei));

  /* Set default SSNs */
  range_convert_str(&global_ssn_range, "106,241", MAX_SSN);

  inap_module = prefs_register_protocol(proto_inap, proto_reg_handoff_inap);

  prefs_register_obsolete_preference(inap_module, "tcap.itu_ssn");

  prefs_register_obsolete_preference(inap_module, "tcap.itu_ssn1");

  prefs_register_range_preference(inap_module, "ssn", "TCAP SSNs",
				  "TCAP Subsystem numbers used for INAP",
				  &global_ssn_range, MAX_SSN);
}
예제 #3
0
/*--- proto_register_pcap -------------------------------------------*/
void proto_register_pcap(void) {

  /* List of fields */

  static hf_register_info hf[] = {

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

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

  module_t *pcap_module;

  /* Register protocol */
  proto_pcap = proto_register_protocol(PNAME, PSNAME, PFNAME);
  /* Register fields and subtrees */
  proto_register_field_array(proto_pcap, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));

  pcap_module = prefs_register_protocol(proto_pcap, proto_reg_handoff_pcap);

  /* Register dissector */
  register_dissector("pcap", dissect_pcap, proto_pcap);

  /* Register dissector tables */
  pcap_ies_dissector_table = register_dissector_table("pcap.ies", "PCAP-PROTOCOL-IES", FT_UINT32, BASE_DEC);
  pcap_ies_p1_dissector_table = register_dissector_table("pcap.ies.pair.first", "PCAP-PROTOCOL-IES-PAIR FirstValue", FT_UINT32, BASE_DEC);
  pcap_ies_p2_dissector_table = register_dissector_table("pcap.ies.pair.second", "PCAP-PROTOCOL-IES-PAIR SecondValue", FT_UINT32, BASE_DEC);
  pcap_extension_dissector_table = register_dissector_table("pcap.extension", "PCAP-PROTOCOL-EXTENSION", FT_UINT32, BASE_DEC);
  pcap_proc_imsg_dissector_table = register_dissector_table("pcap.proc.imsg", "PCAP-ELEMENTARY-PROCEDURE InitiatingMessage", FT_UINT32, BASE_DEC);
  pcap_proc_sout_dissector_table = register_dissector_table("pcap.proc.sout", "PCAP-ELEMENTARY-PROCEDURE SuccessfulOutcome", FT_UINT32, BASE_DEC);
  pcap_proc_uout_dissector_table = register_dissector_table("pcap.proc.uout", "PCAP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", FT_UINT32, BASE_DEC);
  pcap_proc_out_dissector_table = register_dissector_table("pcap.proc.out", "PCAP-ELEMENTARY-PROCEDURE Outcome", FT_UINT32, BASE_DEC);


  /* Preferences */
  /* Set default SSNs */
  range_convert_str(&global_ssn_range, "", MAX_SSN);

  prefs_register_range_preference(pcap_module, "ssn", "SCCP SSNs",
                                  "SCCP (and SUA) SSNs to decode as PCAP",
                                  &global_ssn_range, MAX_SSN);
}
void proto_register_inap(void) {
	module_t *inap_module;
  /* List of fields */
  static hf_register_info hf[] = {



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






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

  /* Register protocol */
  proto_inap = proto_register_protocol(PNAME, PSNAME, PFNAME);
  register_dissector("inap", dissect_inap, proto_inap);
  /* Register fields and subtrees */
  proto_register_field_array(proto_inap, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));

  /* Set default SSNs */
  range_convert_str(&global_ssn_range, "106,241", MAX_SSN);

  inap_module = prefs_register_protocol(proto_inap, proto_reg_handoff_inap);

  prefs_register_obsolete_preference(inap_module, "tcap.itu_ssn");

  prefs_register_obsolete_preference(inap_module, "tcap.itu_ssn1");

  prefs_register_range_preference(inap_module, "ssn", "TCAP SSNs",
				  "TCAP Subsystem numbers used for INAP",
				  &global_ssn_range, MAX_SSN);
}
예제 #5
0
void
proto_register_nsip(void)
{
  static hf_register_info hf[] = {
    { &hf_nsip_cause,
      { "Cause", "nsip.cause",
        FT_UINT8, BASE_OCT, VALS(tab_nsip_cause_values), 0x0,
        NULL, HFILL }
    },
    { &hf_nsip_ns_vci,
      { "NS-VCI", "nsip.ns_vci",
        FT_UINT16, BASE_HEX, NULL, 0x0,
        "Network Service Virtual Link Identifier", HFILL }
    },
    { &hf_nsip_pdu_type,
      { "PDU type", "nsip.pdu_type",
        FT_UINT8, BASE_OCT, VALS(tab_nsip_pdu_types), 0x0,
        "PDU type information element", HFILL }
    },
    { &hf_nsip_bvci,
      { "BVCI", "nsip.bvci",
        FT_UINT16, BASE_DEC, NULL, 0x0,
        "BSSGP Virtual Connection Identifier", HFILL }
    },
    { &hf_nsip_nsei,
      { "NSEI", "nsip.nsei",
        FT_UINT16, BASE_DEC, NULL, 0x0,
        "Network Service Entity Identifier", HFILL }
    },
#if 0
    { &hf_nsip_ip4_elements,
      { "IP4 elements", "nsip.ip4_elements",
        FT_NONE, BASE_NONE, NULL, 0x0,
        "List of IP4 elements", HFILL }
    },
#endif
#if 0
    { &hf_nsip_ip6_elements,
      { "IP6 elements", "nsip.ip6_elements",
        FT_NONE, BASE_NONE, NULL, 0x0,
        "List of IP6 elements", HFILL }
    },
#endif
    { &hf_nsip_max_num_ns_vc,
      { "Maximum number of NS-VCs", "nsip.max_num_ns_vc",
        FT_UINT16, BASE_DEC, NULL, 0x0,
        NULL, HFILL }
    },
    { &hf_nsip_num_ip4_endpoints,
      { "Number of IP4 endpoints", "nsip.num_ip4_endpoints",
        FT_UINT16, BASE_DEC, NULL, 0x0,
        NULL, HFILL }
    },
    { &hf_nsip_num_ip6_endpoints,
      { "Number of IP6 endpoints", "nsip.num_ip6_endpoints",
        FT_UINT16, BASE_DEC, NULL, 0x0,
        NULL, HFILL }
    },
    { &hf_nsip_reset_flag,
      { "Reset flag", "nsip.reset_flag.flag",
        FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_RESET_FLAG,
        NULL, HFILL }
    },
    { &hf_nsip_reset_flag_spare,
      { "Reset flag spare bits", "nsip.reset_flag.spare",
        FT_UINT8, BASE_HEX, NULL, NSIP_MASK_RESET_FLAG_SPARE,
        NULL, HFILL }
    },
    { &hf_nsip_ip_address_type,
      { "IP Address Type", "nsip.ip_address_type",
        FT_UINT8, BASE_DEC, VALS(ip_address_type_vals), 0x0,
        NULL, HFILL }
    },
    { &hf_nsip_ip_address_ipv4,
      { "IP Address", "nsip.ipv4_address",
        FT_IPv4, BASE_NONE, NULL, 0x0,
        NULL, HFILL }
    },
    { &hf_nsip_ip_address_ipv6,
      { "IP Address", "nsip.ipv6_address",
        FT_IPv6, BASE_NONE, NULL, 0x0,
        NULL, HFILL }
    },
    { &hf_nsip_end_flag,
      { "End flag", "nsip.end_flag.flag",
        FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_END_FLAG,
        NULL, HFILL }
    },
    { &hf_nsip_end_flag_spare,
      { "End flag spare bits", "nsip.end_flag.spare",
        FT_UINT8, BASE_HEX, NULL, NSIP_MASK_END_FLAG_SPARE,
        NULL, HFILL }
    },
    { &hf_nsip_control_bits_r,
      { "Request change flow", "nsip.control_bits.r",
        FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_CONTROL_BITS_R,
        NULL, HFILL }
    },
    { &hf_nsip_control_bits_c,
      { "Confirm change flow", "nsip.control_bits.c",
        FT_BOOLEAN, 8, TFS(&tfs_set_notset), NSIP_MASK_CONTROL_BITS_C,
        NULL, HFILL }
    },
    { &hf_nsip_control_bits_spare,
      { "Spare bits", "nsip.control_bits.spare",
        FT_UINT8, BASE_HEX, NULL, NSIP_MASK_CONTROL_BITS_SPARE,
        NULL, HFILL }
    },
    { &hf_nsip_transaction_id,
      { "Transaction ID", "nsip.transaction_id",
      FT_UINT8, BASE_DEC, NULL, 0x0,
      NULL, HFILL }
    },
#if 0
    { &hf_nsip_ip_element_ip_address_ipv4,
      { "IP Address", "nsip.ip_element.ipv4_address",
        FT_IPv4, BASE_NONE, NULL, 0x0,
        NULL, HFILL }
    },
#endif
#if 0
    { &hf_nsip_ip_element_ip_address_ipv6,
      { "IP Address", "nsip.ip_element.ipv6_address",
        FT_IPv6, BASE_NONE, NULL, 0x0,
        NULL, HFILL }
    },
#endif
    { &hf_nsip_ip_element_udp_port,
      { "UDP Port", "nsip.ip_element.udp_port",
        FT_UINT16, BASE_DEC, NULL, 0x0,
        NULL, HFILL }
    },
    { &hf_nsip_ip_element_signalling_weight,
      { "Signalling Weight", "nsip.ip_element.signalling_weight",
        FT_UINT8, BASE_DEC, NULL, 0x0,
        NULL, HFILL }
    },
    { &hf_nsip_ip_element_data_weight,
      { "Data Weight", "nsip.ip_element.data_weight",
        FT_UINT8, BASE_DEC, NULL, 0x0,
        NULL, HFILL }
    },
  };

  /* Setup protocol subtree array */
  static gint *ett[] = {
    &ett_nsip,
    &ett_nsip_control_bits,
    &ett_nsip_reset_flag,
    &ett_nsip_end_flag,
    &ett_nsip_ip_element,
    &ett_nsip_ip_element_list,
  };

  module_t *nsip_module;

  /* Register the protocol name and description */
  proto_nsip = proto_register_protocol("GPRS Network Service",
                                       "GPRS-NS", "gprs-ns");

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

  register_dissector("gprs_ns", dissect_nsip, proto_nsip);

  /* Set default UDP ports */
  range_convert_str(&global_nsip_udp_port_range, DEFAULT_NSIP_PORT_RANGE, MAX_UDP_PORT);

  /* Register configuration options */
  nsip_module = prefs_register_protocol(proto_nsip, proto_reg_handoff_nsip);
  prefs_register_obsolete_preference(nsip_module, "udp.port1");
  prefs_register_obsolete_preference(nsip_module, "udp.port2");
  prefs_register_range_preference(nsip_module, "udp.ports", "GPRS-NS UDP ports",
                                  "UDP ports to be decoded as GPRS-NS (default: "
                                  DEFAULT_NSIP_PORT_RANGE ")",
                                  &global_nsip_udp_port_range, MAX_UDP_PORT);
}
예제 #6
0
void
proto_register_kt(void)
{
    module_t *kt_module; /* preferences */

    static hf_register_info hf[] = {
        {   &hf_kt_magic,
            {   "magic", "kt.magic", FT_UINT8, BASE_HEX,
                VALS(kt_magic_vals), 0x0, "identifier", HFILL
            }
        },
        {   &hf_kt_type,
            {   "type", "kt.type", FT_UINT8, BASE_HEX,
                VALS(kt_oper_vals), 0x0, "request/response", HFILL
            }
        },
        {   &hf_kt_flags,
            {   "flags", "kt.flags", FT_UINT32, BASE_HEX,
                NULL, 0x0, "flags of bitwise-or", HFILL
            }
        },
        {   &hf_kt_rnum,
            {   "rnum", "kt.rnum", FT_UINT32, BASE_DEC, NULL, 0x0,
                "the number of records", HFILL
            }
        },
        {   &hf_kt_dbidx,
            {   "dbidx", "kt.dbidx", FT_UINT16,
                BASE_DEC, NULL, 0x0, "the index of the target database", HFILL
            }
        },
        {   &hf_kt_sid,
            {   "sid", "kt.sid", FT_UINT16, BASE_DEC,
                NULL, 0x0, "the server ID number", HFILL
            }
        },
        {   &hf_kt_ts,
            {   "ts", "kt.ts", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
                NULL, 0x0, "the timestamp of the log", HFILL
            }
        },
        {   &hf_kt_xt,
            {   "xt", "kt.xt", FT_UINT64, BASE_DEC,
                NULL, 0x0, "the expiration time in seconds", HFILL
            }
        },
        {   &hf_kt_xt_resp,
            {   "xt", "kt.xt_resp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
                NULL, 0x0, "the expiration time", HFILL
            }
        },
        {   &hf_kt_ksiz,
            {   "ksiz", "kt.ksiz", FT_UINT32, BASE_DEC,
                NULL, 0x0, "the size of the key",HFILL
            }
        },
        {   &hf_kt_vsiz,
            {   "vsiz", "kt.vsiz", FT_UINT32, BASE_DEC,
                NULL, 0x0, "the size of the value", HFILL
            }
        },
        {   &hf_kt_key,
            {   "key", "kt.key", FT_BYTES, BASE_NONE,
                NULL, 0x0, "the key", HFILL
            }
        },
        {   &hf_kt_val,
            {   "value", "kt.value", FT_BYTES, BASE_NONE,
                NULL, 0x0, "the value", HFILL
            }
        },
        {   &hf_kt_key_str,
            {   "key", "kt.key_str", FT_STRING, BASE_NONE,
                NULL, 0x0, "ASCII representation of the key", HFILL
            }
        },
        {   &hf_kt_val_str,
            {   "value", "kt.value_str", FT_STRING, BASE_NONE,
                NULL, 0x0, "ASCII representation of the value", HFILL
            }
        },
        {   &hf_kt_hits,
            {   "hits", "kt.hits", FT_UINT32, BASE_DEC,
                NULL, 0x0, "the number of records", HFILL
            }
        },
        {   &hf_kt_size,
            {   "size", "kt.size", FT_UINT32, BASE_DEC,
                NULL, 0x0, "the size of the replication log", HFILL
            }
        },
        {   &hf_kt_log,
            {   "log", "kt.log", FT_BYTES, BASE_NONE,
                NULL, 0x0, "the replication log", HFILL
            }
        },
        {   &hf_kt_nsiz,
            {   "nsiz", "kt.nsiz", FT_UINT32, BASE_DEC,
                NULL, 0x0, "the size of the procedure name", HFILL
            }
        },
        {   &hf_kt_name,
            {   "name", "kt.name", FT_STRING, BASE_NONE,
                NULL, 0x0, "the procedure name", HFILL
            }
        },
        {   &hf_kt_rec,
            {   "record", "kt.record", FT_NONE, BASE_NONE,
                NULL, 0x0, "a record", HFILL
            }
        }
    };

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

    proto_kt = proto_register_protocol("Kyoto Tycoon Protocol", "Kyoto Tycoon", "kt");
    register_dissector("kt", dissect_kt, proto_kt);
    proto_register_field_array(proto_kt, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));

    /* Preferences */
    kt_module = prefs_register_protocol(proto_kt, proto_reg_handoff_kt);

    range_convert_str(&global_kt_tcp_port_range, DEFAULT_KT_PORT_RANGE, MAX_TCP_PORT);
    prefs_register_range_preference(kt_module, "tcp.ports", "Kyoto Tycoon TCP ports",
                                    "TCP ports to be decoded as Kyoto Tycoon (binary protocol) (default: "
                                    DEFAULT_KT_PORT_RANGE ")",
                                    &global_kt_tcp_port_range, MAX_TCP_PORT);

    prefs_register_bool_preference(kt_module, "present_key_val_as_ascii",
                                   "Attempt to also show ASCII string representation of keys and values",
                                   "KT allows binary values in keys and values. Attempt to show an ASCII representation anyway (which might be prematurely terminated by a NULL!",
                                   &kt_present_key_val_as_ascii);
}
void
proto_register_tcap(void)
{

/* Setup list of header fields  See Section 1.6.1 for details*/
    static hf_register_info hf[] = {
	{ &hf_tcap_tag,
		{ "Tag",           "tcap.msgtype",
		FT_UINT8, BASE_HEX, NULL, 0,
		NULL, HFILL }
	},
	{ &hf_tcap_length,
		{ "Length", "tcap.len",
		FT_UINT8, BASE_DEC, NULL, 0,
		NULL, HFILL }
	},
	{ &hf_tcap_data,
		{ "Data", "tcap.data",
		FT_BYTES, BASE_NONE, NULL, 0,
		NULL, HFILL }
	},
		{ &hf_tcap_tid,
		{ "Transaction Id", "tcap.tid",
		FT_BYTES, BASE_NONE, NULL, 0,
		NULL, HFILL }
	},
	/* Tcap Service Response Time */
	{ &hf_tcapsrt_SessionId,
	  { "Session Id",
	    "tcap.srt.session_id",
	    FT_UINT32, BASE_DEC, NULL, 0x0,
	    NULL, HFILL }
	},
	{ &hf_tcapsrt_BeginSession,
	  { "Begin Session",
	    "tcap.srt.begin",
	    FT_FRAMENUM, BASE_NONE, NULL, 0x0,
	    "SRT Begin of Session", HFILL }
	},
	{ &hf_tcapsrt_EndSession,
	  { "End Session",
	    "tcap.srt.end",
	    FT_FRAMENUM, BASE_NONE, NULL, 0x0,
	    "SRT End of Session", HFILL }
	},
	{ &hf_tcapsrt_SessionTime,
	  { "Session duration",
	    "tcap.srt.sessiontime",
	    FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
	    "Duration of the TCAP session", HFILL }
	},
	{ &hf_tcapsrt_Duplicate,
	  { "Session Duplicate",
	    "tcap.srt.duplicate",
	    FT_FRAMENUM, BASE_NONE, NULL, 0x0,
	    "SRT Duplicated with Session", HFILL }
	},
#include "packet-tcap-hfarr.c"
    };

/* Setup protocol subtree array */
    static gint *ett[] = {
	&ett_tcap,
	&ett_param,
	&ett_otid,
	&ett_dtid,
	&ett_tcap_stat,
	#include "packet-tcap-ettarr.c"
    };

    /*static enum_val_t tcap_options[] = {
	{ "itu", "ITU",  ITU_TCAP_STANDARD },
	{ "ansi", "ANSI", ANSI_TCAP_STANDARD },
	{ NULL, NULL, 0 }
    };*/

    module_t *tcap_module;

/* Register the protocol name and description */
    proto_tcap = proto_register_protocol(PNAME, PSNAME, PFNAME);

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

    tcap_module = prefs_register_protocol(proto_tcap, NULL);

#if 0
    prefs_register_enum_preference(tcap_module, "standard", "ITU TCAP standard",
	"The SS7 standard used in ITU TCAP packets",
	&tcap_standard, tcap_options, FALSE);
#else
    prefs_register_obsolete_preference(tcap_module, "standard");
#endif

#if 0
    prefs_register_bool_preference(tcap_module, "lock_info_col", "Lock Info column",
	"Always show TCAP in Info column",
	&lock_info_col);
#else
    prefs_register_obsolete_preference(tcap_module, "lock_info_col");
#endif

    /* Set default SSNs */
    range_convert_str(&global_ssn_range, "", MAX_SSN);
    ssn_range = range_empty();

    prefs_register_range_preference(tcap_module, "ssn", "SCCP SSNs",
	"SCCP (and SUA) SSNs to decode as TCAP",
	&global_ssn_range, MAX_SSN);

    prefs_register_bool_preference(tcap_module, "srt",
				   "Service Response Time Analyse",
				   "Activate the analyse for Response Time",
				   &gtcap_HandleSRT);

    prefs_register_bool_preference(tcap_module, "persistentsrt",
				   "Persistent stats for SRT",
				   "Statistics for Response Time",
				   &gtcap_PersistentSRT);

    prefs_register_uint_preference(tcap_module, "repetitiontimeout",
				   "Repetition timeout",
				   "Maximal delay for message repetion",
				   10, &gtcap_RepetitionTimeout);

    prefs_register_uint_preference(tcap_module, "losttimeout",
				   "lost timeout",
				   "Maximal delay for message lost",
				   10, &gtcap_LostTimeout);

    ansi_sub_dissectors = g_hash_table_new(g_direct_hash,g_direct_equal);
    itu_sub_dissectors = g_hash_table_new(g_direct_hash,g_direct_equal);

    /* 'globally' register dissector */
    register_dissector("tcap", dissect_tcap, proto_tcap);

    tcap_handle = create_dissector_handle(dissect_tcap, proto_tcap);

    register_init_routine(&init_tcap);
}
예제 #8
0
파일: opcua.c 프로젝트: dnstap/wireshark
/** plugin entry functions.
 * This registers the OpcUa protocol.
 */
void proto_register_opcua(void)
{

    static hf_register_info hf[] =
    {
        {&hf_opcua_fragments,
            {"Message fragments", "opcua.fragments",
            FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } },
        {&hf_opcua_fragment,
            {"Message fragment", "opcua.fragment",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
        {&hf_opcua_fragment_overlap,
            {"Message fragment overlap", "opcua.fragment.overlap",
            FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } },
        {&hf_opcua_fragment_overlap_conflicts,
            {"Message fragment overlapping with conflicting data",
            "opcua.fragment.overlap.conflicts",
            FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } },
        {&hf_opcua_fragment_multiple_tails,
            {"Message has multiple tail fragments",
            "opcua.fragment.multiple_tails",
            FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } },
        {&hf_opcua_fragment_too_long_fragment,
            {"Message fragment too long", "opcua.fragment.too_long_fragment",
            FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } },
        {&hf_opcua_fragment_error,
            {"Message defragmentation error", "opcua.fragment.error",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
        {&hf_opcua_fragment_count,
            {"Message fragment count", "opcua.fragment.count",
            FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } },
        {&hf_opcua_reassembled_in,
            {"Reassembled in", "opcua.reassembled.in",
            FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
        {&hf_opcua_reassembled_length,
            {"Reassembled length", "opcua.reassembled.length",
            FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }
    };

    /** Setup protocol subtree array */
    static gint *ett[] =
    {
        &ett_opcua_transport,
        &ett_opcua_extensionobject,
        &ett_opcua_nodeid,
        &ett_opcua_fragment,
        &ett_opcua_fragments
    };

    module_t *opcua_module;

    proto_opcua = proto_register_protocol(
        "OpcUa Binary Protocol", /* name */
        "OpcUa",                 /* short name */
        "opcua"                  /* abbrev */
        );

    registerTransportLayerTypes(proto_opcua);
    registerSecurityLayerTypes(proto_opcua);
    registerApplicationLayerTypes(proto_opcua);
    registerSimpleTypes(proto_opcua);
    registerEnumTypes(proto_opcua);
    registerComplexTypes();
    registerServiceTypes();
    registerFieldTypes(proto_opcua);

    proto_register_subtree_array(ett, array_length(ett));

    range_convert_str(&global_tcp_ports_opcua, ep_strdup_printf("%u", OPCUA_PORT),  65535);

    reassembly_table_init(&opcua_reassembly_table,
                          &addresses_reassembly_table_functions);
    proto_register_field_array(proto_opcua, hf, array_length(hf));

    /* register user preferences */
    opcua_module = prefs_register_protocol(proto_opcua, proto_reg_handoff_opcua);
    prefs_register_range_preference(opcua_module, "tcp_ports",
				 "OPC UA TCP Ports",
				 "The TCP ports for the OPC UA TCP Binary Protocol",
				 &global_tcp_ports_opcua, 65535);
}
void proto_register_ipa(void)
{
    module_t *ipa_module;

    static hf_register_info hf[] = {
        {   &hf_ipa_data_len,
            {   "DataLen", "gsm_ipa.data_len",
                FT_UINT16, BASE_DEC, NULL, 0x0,
                "The length of the data (in bytes)", HFILL
            }
        },
        {   &hf_ipa_protocol,
            {   "Protocol", "gsm_ipa.protocol",
                FT_UINT8, BASE_HEX, VALS(ipa_protocol_vals), 0x0,
                "The IPA Sub-Protocol", HFILL
            }
        },
        {   &hf_ipa_hsl_debug,
            {   "Debug Message", "gsm_ipa.hsl_debug",
                FT_STRING, BASE_NONE, NULL, 0,
                "Hay Systems Limited debug message", HFILL
            }
        },
        {   &hf_ipa_osmo_proto,
            {   "Osmo ext protocol", "gsm_ipa.osmo.protocol",
                FT_UINT8, BASE_HEX, VALS(ipa_osmo_proto_vals), 0x0,
                "The osmo extension protocol", HFILL
            }
        },

        {   &hf_ipa_osmo_ctrl_data,
            {   "CTRL data", "gsm_ipa.ctrl.data",
                FT_STRING, BASE_NONE, NULL, 0x0,
                "Control interface data", HFILL
            }
        },

    };
    static hf_register_info hf_ipa[] = {
        {   &hf_ipaccess_msgtype,
            {   "MessageType", "ipaccess.msg_type",
                FT_UINT8, BASE_HEX, VALS(ipaccess_msgtype_vals), 0x0,
                "Type of ip.access messsage", HFILL
            }
        },
        {   &hf_ipaccess_attr_tag,
            {   "Tag", "ipaccess.attr_tag",
                FT_UINT8, BASE_HEX, VALS(ipaccess_idtag_vals), 0x0,
                "Attribute Tag", HFILL
            }
        },
        {   &hf_ipaccess_attr_string,
            {   "String", "ipaccess.attr_string",
                FT_STRING, BASE_NONE, NULL, 0x0,
                "String attribute", HFILL
            }
        },
    };

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

    proto_ipa =
        proto_register_protocol("GSM over IP protocol as used by ip.access",
                                "GSM over IP", "gsm_ipa");
    proto_ipaccess =
        proto_register_protocol("GSM over IP ip.access CCM sub-protocol",
                                "IPA", "ipaccess");

    proto_register_field_array(proto_ipa, hf, array_length(hf));
    proto_register_field_array(proto_ipaccess, hf_ipa, array_length(hf_ipa));
    proto_register_subtree_array(ett, array_length(ett));

    register_dissector("gsm_ipa", dissect_ipa, proto_ipa);

    /* Register table for subdissectors */
    osmo_dissector_table = register_dissector_table("ipa.osmo.protocol",
                           "ip.access Protocol", FT_UINT8, BASE_DEC);


    range_convert_str(&global_ipa_tcp_ports, IPA_TCP_PORTS, MAX_TCP_PORT);
    range_convert_str(&global_ipa_udp_ports, IPA_UDP_PORTS, MAX_UDP_PORT);
    ipa_module = prefs_register_protocol(proto_ipa,
                                         proto_reg_handoff_gsm_ipa);

    prefs_register_range_preference(ipa_module, "tcp_ports",
                                    "GSM IPA TCP Port(s)",
                                    "Set the port(s) for ip.access IPA"
                                    " (default: " IPA_TCP_PORTS ")",
                                    &global_ipa_tcp_ports, MAX_TCP_PORT);
    prefs_register_range_preference(ipa_module, "udp_ports",
                                    "GSM IPA UDP Port(s)",
                                    "Set the port(s) for ip.access IPA"
                                    " (default: " IPA_UDP_PORTS ")",
                                    &global_ipa_udp_ports, MAX_UDP_PORT);

    prefs_register_bool_preference(ipa_module, "hsl_debug_in_root_tree",
                                   "HSL Debug messages in root protocol tree",
                                   NULL, &global_ipa_in_root);
    prefs_register_bool_preference(ipa_module, "hsl_debug_in_info",
                                   "HSL Debug messages in INFO column",
                                   NULL, &global_ipa_in_info);
}
void
proto_register_nasdaq_soup(void)
{

    /* Setup list of header fields  See Section 1.6.1 for details*/
    static hf_register_info hf[] = {

        {   &hf_nasdaq_soup_packet_type,
            {   "Packet Type",       "nasdaq-soup.packet_type",
                FT_UINT8, BASE_DEC, VALS(message_types_val), 0x0,
                NULL, HFILL
            }
        },

        {   &hf_nasdaq_soup_reject_code,
            {   "Login Reject Code", "nasdaq-soup.reject_code",
                FT_UINT8, BASE_DEC, VALS(reject_code_val), 0x0,
                NULL, HFILL
            }
        },

        {   &hf_nasdaq_soup_message,
            {   "Message",           "nasdaq-soup.message",
                FT_STRING, BASE_NONE, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_nasdaq_soup_text,
            {   "Debug Text",        "nasdaq-soup.text",
                FT_STRING, BASE_NONE, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_nasdaq_soup_username,
            {   "User Name",         "nasdaq-soup.username",
                FT_STRING, BASE_NONE, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_nasdaq_soup_password,
            {   "Password",          "nasdaq-soup.password",
                FT_STRING, BASE_NONE, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_nasdaq_soup_session,
            {   "Session",           "nasdaq-soup.session",
                FT_STRING, BASE_NONE, NULL, 0x0,
                "Session ID", HFILL
            }
        },

        {   &hf_nasdaq_soup_seq_number,
            {   "Sequence number",   "nasdaq-soup.seq_number",
                FT_STRING, BASE_NONE, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_nasdaq_soup_packet_eol,
            {   "End Of Packet",     "nasdaq-soup.packet_eol",
                FT_STRING, BASE_NONE, NULL, 0x0,
                NULL, HFILL
            }
        }
    };

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

    module_t *nasdaq_soup_module;

    /* Register the protocol name and description */
    proto_nasdaq_soup = proto_register_protocol("Nasdaq-SoupTCP version 2.0","NASDAQ-SOUP", "nasdaq_soup");

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

    nasdaq_soup_module = prefs_register_protocol(proto_nasdaq_soup, nasdaq_soup_prefs);
    prefs_register_bool_preference(nasdaq_soup_module, "desegment",
                                   "Reassemble Nasdaq-SoupTCP messages spanning multiple TCP segments",
                                   "Whether the Nasdaq-SoupTCP dissector should reassemble messages spanning multiple TCP segments.",
                                   &nasdaq_soup_desegment);

    prefs_register_range_preference(nasdaq_soup_module, "tcp.port", "TCP Ports", "TCP Ports range", &global_nasdaq_soup_tcp_range, 65535);

    nasdaq_soup_tcp_range = range_empty();
}
예제 #11
0
void
proto_register_gopher(void)
{
    static hf_register_info hf[] = {
        { &hf_gopher_request,
            { "Gopher client request", "gopher.request",
                FT_STRING, BASE_NONE, NULL, 0,
                NULL, HFILL }
        },

        { &hf_gopher_dir_item,
            { "Directory item", "gopher.directory",
                FT_STRING, BASE_NONE, NULL, 0,
                NULL, HFILL }
        },
        { &hf_gopher_di_type,
            { "Type", "gopher.directory.type",
                FT_UINT8, BASE_HEX, VALS(item_types), 0,
                NULL, HFILL }
        },
        { &hf_gopher_di_name,
            { "Name", "gopher.directory.name",
                FT_STRING, BASE_NONE, NULL, 0,
                NULL, HFILL }
        },
        { &hf_gopher_di_selector,
            { "Selector", "gopher.directory.selector",
                FT_STRING, BASE_NONE, NULL, 0,
                NULL, HFILL }
        },
        { &hf_gopher_di_host,
            { "Host", "gopher.directory.host",
                FT_STRING, BASE_NONE, NULL, 0,
                NULL, HFILL }
        },
        { &hf_gopher_di_port,
            { "Port", "gopher.directory.port",
                FT_STRING, BASE_NONE, NULL, 0,
                NULL, HFILL }
        },

        { &hf_gopher_unknown,
            { "Unknown Gopher transaction data", "gopher.unknown",
                FT_STRING, BASE_NONE, NULL, 0,
                NULL, HFILL }
        }
    };

    module_t *gopher_module;

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

    /* Register the protocol name and description */
    proto_gopher = proto_register_protocol("Gopher",
        "Gopher", "gopher");

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

    /* Initialize dissector preferences */
    gopher_module = prefs_register_protocol(proto_gopher, gopher_prefs_apply);

    range_convert_str(&global_gopher_tcp_range, TCP_DEFAULT_RANGE, 65535);
    gopher_tcp_range = range_empty();
    prefs_register_range_preference(gopher_module, "tcp.port", "TCP Ports",
                                    "TCP Ports range",
                                    &global_gopher_tcp_range, 65535);
}