Ejemplo n.º 1
0
void
proto_register_eth(void)
{
    static hf_register_info hf[] = {

        { &hf_eth_dst,
        { "Destination", "eth.dst", FT_ETHER, BASE_NONE, NULL, 0x0,
            "Destination Hardware Address", HFILL }},

        { &hf_eth_dst_resolved,
        { "Destination (resolved)", "eth.dst_resolved", FT_STRING, BASE_NONE,
            NULL, 0x0, "Destination Hardware Address (resolved)", HFILL }},

        { &hf_eth_src,
        { "Source", "eth.src", FT_ETHER, BASE_NONE, NULL, 0x0,
            "Source Hardware Address", HFILL }},

        { &hf_eth_src_resolved,
        { "Source (resolved)", "eth.src_resolved", FT_STRING, BASE_NONE,
            NULL, 0x0, "Source Hardware Address (resolved)", HFILL }},

        { &hf_eth_len,
        { "Length", "eth.len", FT_UINT16, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        /* registered here but handled in packet-ethertype.c */
        { &hf_eth_type,
        { "Type", "eth.type", FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
            NULL, HFILL }},

        { &hf_eth_invalid_lentype,
        { "Invalid length/type", "eth.invalid_lentype", FT_UINT16, BASE_HEX_DEC,
            NULL, 0x0, NULL, HFILL }},

        { &hf_eth_addr,
        { "Address", "eth.addr", FT_ETHER, BASE_NONE, NULL, 0x0,
            "Source or Destination Hardware Address", HFILL }},

        { &hf_eth_addr_resolved,
        { "Address (resolved)", "eth.addr_resolved", FT_STRING, BASE_NONE,
            NULL, 0x0, "Source or Destination Hardware Address (resolved)",
            HFILL }},

        { &hf_eth_padding,
        { "Padding", "eth.padding", FT_BYTES, BASE_NONE, NULL, 0x0,
            "Ethernet Padding", HFILL }},

        { &hf_eth_trailer,
        { "Trailer", "eth.trailer", FT_BYTES, BASE_NONE, NULL, 0x0,
            "Ethernet Trailer or Checksum", HFILL }},

        { &hf_eth_fcs,
        { "Frame check sequence", "eth.fcs", FT_UINT32, BASE_HEX, NULL, 0x0,
            "Ethernet checksum", HFILL }},

        { &hf_eth_fcs_good,
        { "FCS Good", "eth.fcs_good", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
            "True: checksum matches packet content; False: doesn't match content or not checked", HFILL }},

        { &hf_eth_fcs_bad,
        { "FCS Bad", "eth.fcs_bad", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
            "True: checksum doesn't matche packet content; False: does match content or not checked", HFILL }},

        { &hf_eth_lg,
        { "LG bit", "eth.lg", FT_BOOLEAN, 24,
            TFS(&lg_tfs), 0x020000,
            "Specifies if this is a locally administered or globally unique (IEEE assigned) address", HFILL }},

        { &hf_eth_ig,
        { "IG bit", "eth.ig", FT_BOOLEAN, 24,
            TFS(&ig_tfs), 0x010000,
            "Specifies if this is an individual (unicast) or group (broadcast/multicast) address", HFILL }}
    };
    static gint *ett[] = {
        &ett_ieee8023,
        &ett_ether2,
        &ett_ether,
        &ett_addr,
        &ett_eth_fcs
    };

    static ei_register_info ei[] = {
        { &ei_eth_invalid_lentype, { "eth.invalid_lentype", PI_PROTOCOL, PI_WARN, "Invalid length/type", EXPFILL }},
        { &ei_eth_src_not_group, { "eth.src_not_group", PI_PROTOCOL, PI_WARN, "Source MAC must not be a group address: IEEE 802.3-2002, Section 3.2.3(b)", EXPFILL }},
        { &ei_eth_fcs_bad, { "eth.fcs_bad.expert", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL }},
        { &ei_eth_len, { "eth.len.past_end", PI_MALFORMED, PI_ERROR, "Length field value goes past the end of the payload", EXPFILL }},
    };

    module_t *eth_module;
    expert_module_t* expert_eth;

    proto_eth = proto_register_protocol("Ethernet", "Ethernet", "eth");
    proto_register_field_array(proto_eth, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_eth = expert_register_protocol(proto_eth);
    expert_register_field_array(expert_eth, ei, array_length(ei));

    /* subdissector code */
    register_heur_dissector_list("eth", &heur_subdissector_list);
    register_heur_dissector_list("eth.trailer", &eth_trailer_subdissector_list);

    /* Register configuration preferences */
    eth_module = prefs_register_protocol(proto_eth, NULL);

    prefs_register_bool_preference(eth_module, "assume_padding",
            "Assume short frames which include a trailer contain padding",
            "Some devices add trailing data to frames. When this setting is checked "
            "the Ethernet dissector will assume there has been added padding to the "
            "frame before the trailer was added. Uncheck if a device added a trailer "
            "before the frame was padded.",
            &eth_assume_padding);

    prefs_register_uint_preference(eth_module, "trailer_length",
            "Fixed ethernet trailer length",
            "Some TAPs add a fixed length ethernet trailer at the end "
            "of the frame, but before the (optional) FCS. Make sure it "
            "gets interpreted correctly.",
            10, &eth_trailer_length);

    prefs_register_bool_preference(eth_module, "assume_fcs",
            "Assume packets have FCS",
            "Some Ethernet adapters and drivers include the FCS at the end of a packet, others do not.  "
            "The Ethernet dissector attempts to guess whether a captured packet has an FCS, "
            "but it cannot always guess correctly.",
            &eth_assume_fcs);

    prefs_register_bool_preference(eth_module, "check_fcs",
            "Validate the Ethernet checksum if possible",
            "Whether to validate the Frame Check Sequence",
            &eth_check_fcs);

    prefs_register_bool_preference(eth_module, "interpret_as_fw1_monitor",
            "Attempt to interpret as FireWall-1 monitor file",
            "Whether packets should be interpreted as coming from CheckPoint FireWall-1 monitor file if they look as if they do",
            &eth_interpret_as_fw1_monitor);

    prefs_register_static_text_preference(eth_module, "ccsds_heuristic",
            "These are the conditions to match a payload against in order to determine if this\n"
            "is a CCSDS (Consultative Committee for Space Data Systems) packet within\n"
            "an 802.3 packet. A packet is considered as a possible CCSDS packet only if\n"
            "one or more of the conditions are checked.",
            "Describe the conditions that must be true for the CCSDS dissector to be called");

    prefs_register_bool_preference(eth_module, "ccsds_heuristic_length",
            "CCSDS Length in header matches payload size",
            "Set the condition that must be true for the CCSDS dissector to be called",
            &ccsds_heuristic_length);

    prefs_register_bool_preference(eth_module, "ccsds_heuristic_version",
            "CCSDS Version # is zero",
            "Set the condition that must be true for the CCSDS dissector to be called",
            &ccsds_heuristic_version);

    prefs_register_bool_preference(eth_module, "ccsds_heuristic_header",
            "CCSDS Secondary Header Flag is set",
            "Set the condition that must be true for the CCSDS dissector to be called",
            &ccsds_heuristic_header);

    prefs_register_bool_preference(eth_module, "ccsds_heuristic_bit",
            "CCSDS Spare bit is cleared",
            "Set the condition that must be true for the CCSDS dissector to be called",
            &ccsds_heuristic_bit);

    register_dissector("eth_withoutfcs", dissect_eth_withoutfcs, proto_eth);
    register_dissector("eth_withfcs", dissect_eth_withfcs, proto_eth);
    register_dissector("eth", dissect_eth_maybefcs, proto_eth);
    eth_tap = register_tap("eth");
}
Ejemplo n.º 2
0
/*--- 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 }},
  };

  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);
  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);


}
Ejemplo n.º 3
0
void
proto_register_udp(void)
{
    module_t *udp_module;
    module_t *udplite_module;

    static hf_register_info hf[] = {
        {   &hf_udp_srcport,
            {   "Source Port",	"udp.srcport", FT_UINT16, BASE_DEC, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_udp_dstport,
            {   "Destination Port",	"udp.dstport", FT_UINT16, BASE_DEC, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_udp_port,
            {   "Source or Destination Port",	"udp.port", FT_UINT16, BASE_DEC,  NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_udp_length,
            {   "Length",		"udp.length", FT_UINT16, BASE_DEC, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_udp_checksum,
            {   "Checksum",		"udp.checksum", FT_UINT16, BASE_HEX, NULL, 0x0,
                "Details at: http://www.wireshark.org/docs/wsug_html_chunked/ChAdvChecksums.html", HFILL
            }
        },

        {   &hf_udp_checksum_good,
            {   "Good Checksum",	"udp.checksum_good", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
                "True: checksum matches packet content; False: doesn't match content or not checked", HFILL
            }
        },

        {   &hf_udp_checksum_bad,
            {   "Bad Checksum",	"udp.checksum_bad", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
                "True: checksum doesn't match packet content; False: matches content or not checked", HFILL
            }
        },

        {   &hf_udp_proc_src_uid,
            {   "Source process user ID", "udp.proc.srcuid", FT_UINT32, BASE_DEC, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_udp_proc_src_pid,
            {   "Source process ID", "udp.proc.srcpid", FT_UINT32, BASE_DEC, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_udp_proc_src_uname,
            {   "Source process user name", "udp.proc.srcuname", FT_STRING, BASE_NONE, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_udp_proc_src_cmd,
            {   "Source process name", "udp.proc.srccmd", FT_STRING, BASE_NONE, NULL, 0x0,
                "Source process command name", HFILL
            }
        },

        {   &hf_udp_proc_dst_uid,
            {   "Destination process user ID", "udp.proc.dstuid", FT_UINT32, BASE_DEC, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_udp_proc_dst_pid,
            {   "Destination process ID", "udp.proc.dstpid", FT_UINT32, BASE_DEC, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_udp_proc_dst_uname,
            {   "Destination process user name", "udp.proc.dstuname", FT_STRING, BASE_NONE, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_udp_proc_dst_cmd,
            {   "Destination process name", "udp.proc.dstcmd", FT_STRING, BASE_NONE, NULL, 0x0,
                "Destination process command name", HFILL
            }
        }
    };

    static hf_register_info hf_lite[] = {
        {   &hf_udplite_checksum_coverage_bad,
            {   "Bad Checksum coverage",	"udp.checksum_coverage_bad", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
                NULL, HFILL
            }
        },

        {   &hf_udplite_checksum_coverage,
            {   "Checksum coverage",	"udp.checksum_coverage", FT_UINT16, BASE_DEC, NULL, 0x0,
                NULL, HFILL
            }
        }
    };

    static gint *ett[] = {
        &ett_udp,
        &ett_udp_checksum,
        &ett_udp_process_info
    };

    proto_udp = proto_register_protocol("User Datagram Protocol",
                                        "UDP", "udp");
    register_dissector("udp", dissect_udp, proto_udp);
    proto_udplite = proto_register_protocol("Lightweight User Datagram Protocol",
                                            "UDPlite", "udplite");
    proto_register_field_array(proto_udp, hf, array_length(hf));
    proto_register_field_array(proto_udplite, hf_lite, array_length(hf_lite));
    proto_register_subtree_array(ett, array_length(ett));

    /* subdissector code */
    udp_dissector_table = register_dissector_table("udp.port",
                          "UDP port", FT_UINT16, BASE_DEC);
    register_heur_dissector_list("udp", &heur_subdissector_list);
    register_heur_dissector_list("udplite", &heur_subdissector_list);

    /* Register configuration preferences */
    udp_module = prefs_register_protocol(proto_udp, NULL);
    prefs_register_bool_preference(udp_module, "summary_in_tree",
                                   "Show UDP summary in protocol tree",
                                   "Whether the UDP summary line should be shown in the protocol tree",
                                   &udp_summary_in_tree);
    prefs_register_bool_preference(udp_module, "try_heuristic_first",
                                   "Try heuristic sub-dissectors first",
                                   "Try to decode a packet using an heuristic sub-dissector before using a sub-dissector registered to a specific port",
                                   &try_heuristic_first);
    prefs_register_bool_preference(udp_module, "check_checksum",
                                   "Validate the UDP checksum if possible",
                                   "Whether to validate the UDP checksum",
                                   &udp_check_checksum);
    prefs_register_bool_preference(udp_module, "process_info",
                                   "Collect process flow information",
                                   "Collect process flow information from IPFIX",
                                   &udp_process_info);

    udplite_module = prefs_register_protocol(proto_udplite, NULL);
    prefs_register_bool_preference(udplite_module, "ignore_checksum_coverage",
                                   "Ignore UDPlite checksum coverage",
                                   "Ignore an invalid checksum coverage field and continue dissection",
                                   &udplite_ignore_checksum_coverage);
    prefs_register_bool_preference(udplite_module, "check_checksum",
                                   "Validate the UDPlite checksum if possible",
                                   "Whether to validate the UDPlite checksum",
                                   &udplite_check_checksum);
}
Ejemplo n.º 4
0
void proto_register_ismacryp (void)
{
	/* A header field is something you can search/filter on.
	*
	* We create a structure to register our fields. It consists of an
	* array of hf_register_info structures, each of which are of the format
	* {&(field id), {name, abbrev, type, display, strings, bitmask, blurb, HFILL}}.
	*/
	static hf_register_info hf[] = {
#if 0
		{ &hf_ismacryp,
		  { "Data", "ismacryp.data", FT_NONE, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},
#endif

#if 0
		{ &hf_ismacryp_length,
		  { "Total Length", "ismacryp.len", FT_UINT16, BASE_DEC, NULL, 0x0,	/* length 2 bytes, print as decimal value */
		    NULL, HFILL }},
#endif

		{ &hf_ismacryp_header,
		  { "AU Header", "ismacryp.header", FT_NONE, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

#if 0
		{ &hf_ismacryp_header_length,
		  { "Header Length", "ismacryp.header.length", FT_UINT16, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},
#endif

		{ &hf_ismacryp_au_headers_length,
		  { "AU Headers Length", "ismacryp.au_headers.length", FT_UINT16, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_header_byte,
		  { "Header Byte", "ismacryp.header.byte", FT_NONE, BASE_NONE, NULL, 0x0, /* 1 byte */
		    NULL, HFILL }},

#if 0
		{ &hf_ismacryp_version,
		  { "Version", "ismacryp.version", FT_UINT8, BASE_HEX, NULL, 0x0, 	/* version 1 byte */
		    NULL, HFILL }},
#endif

		{ &hf_ismacryp_message,
		  { "Message", "ismacryp.message", FT_NONE, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

#if 0
		{ &hf_ismacryp_message_length,
		  { "Message Length", "ismacryp.message.len", FT_UINT16, BASE_DEC, NULL, 0x0,	/* length 2 bytes, print as decimal value */
		    NULL, HFILL }},
#endif

#if 0
		{ &hf_ismacryp_parameter,
		  { "Parameter", "ismacryp.parameter", FT_NONE, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},
#endif

#if 0
		{ &hf_ismacryp_parameter_length,
		  { "Parameter Length", "ismacryp.parameter.len", FT_UINT16, BASE_DEC, NULL, 0x0, /* length 2 bytes, print as decimal value */
		    NULL, HFILL }},
#endif

		{ &hf_ismacryp_iv,
		  { "IV", "ismacryp.iv", FT_BYTES, BASE_NONE, NULL, 0x0, /* variable length */
		    NULL, HFILL }},

		{ &hf_ismacryp_delta_iv,
		  { "Delta IV", "ismacryp.delta_iv", FT_BYTES, BASE_NONE, NULL, 0x0, /* variable length */
		    NULL, HFILL }},

		{ &hf_ismacryp_key_indicator,
		  { "Key Indicator", "ismacryp.key_indicator", FT_BYTES, BASE_NONE, NULL, 0x0, /* variable length */
		    NULL, HFILL }},

#if 0
		{ &hf_ismacryp_parameter_value,
		  { "Parameter Value", "ismacryp.parameter.value", FT_NONE, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},
#endif

		{ &hf_ismacryp_au_size,
		  { "AU size", "ismacryp.au.size", FT_UINT64, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_au_index,
		  { "AU index", "ismacryp.au.index", FT_UINT64, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_au_index_delta,
		  { "AU index delta", "ismacryp.au.index_delta", FT_UINT64, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_cts_delta,
		  { "CTS delta", "ismacryp.cts_delta", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_cts_flag,
		  { "CTS flag", "ismacryp.cts_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_dts_delta,
		  { "DTS delta", "ismacryp.dts_delta", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_dts_flag,
		  { "DTS flag", "ismacryp.dts_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_rap_flag,
		  { "RAP flag", "ismacryp.rap_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_stream_state,
		  { "Stream state", "ismacryp.stream_state", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_au_is_encrypted,
		  { "AU_is_encrypted flag", "ismacryp.au_is_encrypted", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_slice_start,
		  { "Slice_start flag", "ismacryp.slice_start", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_slice_end,
		  { "Slice_end flag", "ismacryp.slice_end", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_padding_bitcount,
		  { "Padding_bitcount bits", "ismacryp.padding_bitcount", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_padding,
		  { "Padding bits", "ismacryp.padding", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_reserved_bits,
		  { "Reserved bits", "ismacryp.reserved", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_ismacryp_unused_bits,
		  { "Unused bits", "ismacryp.unused", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }}
	};

	static gint *ett[] =
	{
		&ett_ismacryp,
		&ett_ismacryp_header,
		&ett_ismacryp_header_byte,
		&ett_ismacryp_message
	};

	static const enum_val_t version_types[] = {
		{PROTO_TAG_ISMACRYP_11, "ISMACryp v1.1", V11},
		{PROTO_TAG_ISMACRYP_20, "ISMACryp v2.0", V20},
		{NULL, NULL, -1}
	};

	static const enum_val_t mode_types[] = {
		{"aac-hbr", "aac-hbr", AAC_HBR_MODE},
		{"mpeg4-video", "mpeg4-video", MPEG4_VIDEO_MODE},
		{"avc-video", "avc-video", AVC_VIDEO_MODE},
		{NULL, NULL, -1}
	};

	module_t *ismacryp_module;

	proto_ismacryp = proto_register_protocol ("ISMACryp Protocol", "ISMACRYP", "ismacryp");
	proto_register_field_array (proto_ismacryp, hf, array_length (hf));
	proto_register_subtree_array (ett, array_length (ett));

	/* Register our configuration options for ismacryp */
	/* this registers our preferences, function proto_reg_handoff_ismacryp is called when preferences are applied */
	ismacryp_module = prefs_register_protocol(proto_ismacryp, proto_reg_handoff_ismacryp);

	prefs_register_uint_preference(ismacryp_module, "dynamic.payload.type",
							   "ISMACryp dynamic payload type",
							   "The dynamic payload type which will be interpreted as ISMACryp",
							   10,
							   &pref_dynamic_payload_type);

	prefs_register_enum_preference(ismacryp_module, "version",
					       "ISMACryp version",
					       "ISMACryp version",
					       &version_type, version_types, TRUE);

	prefs_register_static_text_preference(ismacryp_module, "text_override",
					      "The following option allows the version to be set manually"
					      " and to override the version if detected from RTP payload type:",
					      "The following option allows the version to be set manually"
					      " and to override the version if detected from RTP payload type:");

	prefs_register_bool_preference(ismacryp_module,
				       "override_rtp_pt","Override RTP payload type for version",
				       "Indicates whether or not the ISMACryp version deduced"
				       " from RTP payload type, if present, is used or whether the"
				       " version above is used",
				       &override_flag);

	/* ISMACryp v11 parameters */
	prefs_register_static_text_preference(ismacryp_module,
					      "v11_parameters",
					      "ISMACryp v1.1 parameters:",
					      "ISMACryp v1.1 parameters declared in SDP");

	prefs_register_uint_preference(ismacryp_module,
				       "iv_length","ISMACrypIVLength (bytes)",
				       "Set the length of the IV in the ISMACryp AU Header in bytes",
				       10, &iv_length);

	prefs_register_uint_preference(ismacryp_module,
				       "delta_iv_length","ISMACrypDeltaIVLength (bytes)",
				       "Set the length of the Delta IV in the ISMACryp AU Header in bytes",
				       10, &delta_iv_length);

	prefs_register_uint_preference(ismacryp_module,
				       "key_indicator_length","ISMACrypKeyIndicatorLength (bytes)",
				       "Set the length of the Key Indicator in the ISMACryp AU Header in bytes",
				       10, &key_indicator_length);

	prefs_register_bool_preference(ismacryp_module,
				       "key_indicator_per_au_flag","ISMACrypKeyIndicatorPerAU (T/F)",
				       "Indicates whether or not the Key Indicator is present in all AU Headers (T/F)",
				       &key_indicator_per_au_flag);

	prefs_register_bool_preference(ismacryp_module,
				       "selective_encryption","ISMACrypSelectiveEncryption (T/F)",
				       "Indicates whether or not selective encryption is enabled (T/F)",
				       &selective_encryption);

	/* ISMACryp v20 parameters */
	prefs_register_static_text_preference(ismacryp_module,
					      "v20_parameters",
					      "ISMACryp v2.0 parameters:",
					      "ISMACryp v2.0 parameters declared in SDP");

	prefs_register_bool_preference(ismacryp_module,
				       "slice_indication","ISMACrypSliceIndication (T/F)",
				       "Indicates whether or not slice start / end is present (T/F)",
				       &slice_indication);

	prefs_register_bool_preference(ismacryp_module,
				       "padding_indication","ISMACrypPaddingIndication (T/F)",
				       "Indicates whether or not padding information is present (T/F)",
				       &padding_indication);

	/* RFC3640 mode - ISMACryp v11 */
	prefs_register_static_text_preference(ismacryp_module,
					      "codec_modes",
					      "Codec mode selection (RFC3640 for ISMACryp v1.1 only):",
					      "AU parameters set according to RFC3640 mode or user defined");

	prefs_register_enum_preference(ismacryp_module,
				       "rfc3640_mode",
				       "RFC3640 mode",
				       "RFC3640 mode",
				       &mode, mode_types, TRUE);

	/* User defined mode */
	prefs_register_bool_preference(ismacryp_module,
				       "user_mode","User mode (T/F)",
				       "Indicates use of user mode instead of RFC3640 modes (T/F)",
				       &pref_user_mode);

	/* following preference values only used if user mode is selected above */
	prefs_register_static_text_preference(ismacryp_module,
					      "user_defined_modes",
					      "Following parameters only valid and used for user mode:",
					      "AU parameters defined by the user");

	/* ideally would grey this out or disable this if in user mode */
	prefs_register_uint_preference(ismacryp_module,
				       "au_size_length","User mode: SizeLength (bits)",
				       "Set the length of the AU size in the AU Header in bits",
				       10, &pref_au_size_length);

	prefs_register_uint_preference(ismacryp_module,
				       "au_index_length","User mode: IndexLength (bits)",
				       "Set the length of the AU index in the AU Header in bits",
				       10, &pref_au_index_length);

	prefs_register_uint_preference(ismacryp_module,
				       "au_index_delta_length","User mode: IndexDeltaLength (bits)",
				       "Set the length of the AU delta index in the AU Header in bits",
				       10, &pref_au_index_delta_length);

	prefs_register_uint_preference(ismacryp_module,
				       "cts_delta_length","User mode: CTSDeltaLength (bits)",
				       "Set the length of the CTS delta field in the AU Header in bits",
				       10, &pref_cts_delta_length);

	prefs_register_uint_preference(ismacryp_module,
				       "dts_delta_length","User mode: DTSDeltaLength (bits)",
				       "Set the length of the DTS delta field in the AU Header in bits",
				       10, &pref_dts_delta_length);

	prefs_register_bool_preference(ismacryp_module,
				       "random_access_indication","User mode: RandomAccessIndication (T/F)",
				       "Indicates whether or not the RAP field is present in the AU Header (T/F)",
				       &pref_random_access_indication);

	prefs_register_uint_preference(ismacryp_module,
				       "stream_state_indication","User mode: StreamStateIndication (number of bits)",
				       "Indicates the number of bits on which the stream state field is encoded"
				       " in the AU Header (bits)",
				       10, &pref_stream_state_indication);

}
Ejemplo n.º 5
0
void proto_register_uaudp(void)
{
    module_t *uaudp_module;
    int       i;

    /* Setup list of header fields. See Section 1.6.1 for details */
    static hf_register_info hf_uaudp[] = {
        {
            &hf_uaudp_opcode,
            {
                "Opcode",
                "uaudp.opcode",
                FT_UINT8,
                BASE_DEC | BASE_EXT_STRING,
                &uaudp_opcode_str_ext,
                0x0,
                "UA/UDP Opcode",
                HFILL
            }
        },
        {
            &hf_uaudp_version,
            {
                "Version",
                "uaudp.version",
                FT_UINT8,
                BASE_DEC,
                NULL, 0x0,
                "UA/UDP Version",
                HFILL
            }
        },
        {
            &hf_uaudp_window_size,
            {
                "Window Size",
                "uaudp.window_size",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/UDP Window Size",
                HFILL
            }
        },
        {
            &hf_uaudp_mtu,
            {
                "MTU",
                "uaudp.mtu",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/UDP MTU",
                HFILL
            }
        },
        {
            &hf_uaudp_udp_lost,
            {
                "UDP Lost",
                "uaudp.udp_lost",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/UDP Lost",
                HFILL
            }
        },
        {
            &hf_uaudp_udp_lost_reinit,
            {
                "UDP lost reinit",
                "uaudp.udp_lost_reinit",
                FT_UINT8,
                BASE_DEC,
                NULL, 0x0,
                "UA/UDP Lost Re-Init",
                HFILL
            }
        },
        {
            &hf_uaudp_keepalive,
            {
                "Keepalive",
                "uaudp.keepalive",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/UDP Keepalive",
                HFILL
            }
        },
        {
            &hf_uaudp_qos_ip_tos,
            {
                "QoS IP TOS",
                "uaudp.qos_ip_tos",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/UDP QoS IP TOS",
                HFILL
            }
        },
        {
            &hf_uaudp_qos_8021_vlid,
            {
                "QoS 802.1 VLID",
                "uaudp.qos_8021_vlid",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/UDP QoS 802.1 VLID",
                HFILL
            }
        },
        {
            &hf_uaudp_qos_8021_pri,
            {
                "QoS 802.1 PRI",
                "uaudp.qos_8021_pri",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/UDP QoS 802.1 PRI",
                HFILL
            }
        },
        {
            &hf_uaudp_expseq,
            {
                "Sequence Number (expected)",
                "uaudp.expseq",
                FT_UINT16,
                BASE_DEC,
                NULL,
                0x0,
                "UA/UDP Expected Sequence Number",
                HFILL
            }
        },
        {
            &hf_uaudp_sntseq,
            {
                "Sequence Number (sent)",
                "uaudp.sntseq",
                FT_UINT16,
                BASE_DEC,
                NULL,
                0x0,
                "UA/UDP Sent Sequence Number",
                HFILL
            }
        },
    };

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

    /* Register the protocol name and description */
    proto_uaudp = proto_register_protocol("UA/UDP Encapsulation Protocol",
                          "UAUDP",
                          "uaudp");

    uaudp_handle = register_dissector("uaudp", dissect_uaudp, proto_uaudp);
#if 0 /* XXX: Not used ?? */
    register_dissector("uaudp_dir_unknown",  dissect_uaudp_dir_unknown,  proto_uaudp);
    register_dissector("uaudp_term_to_serv", dissect_uaudp_term_to_serv, proto_uaudp);
    register_dissector("uaudp_serv_to_term", dissect_uaudp_serv_to_term, proto_uaudp);
#endif

    proto_register_field_array(proto_uaudp, hf_uaudp, array_length(hf_uaudp));
    proto_register_subtree_array(ett, array_length(ett));

    /* Register preferences */
    uaudp_module = prefs_register_protocol(proto_uaudp, proto_reg_handoff_uaudp);

#if 0
    prefs_register_bool_preference(uaudp_module, "enable",
                       "Enable UA/UDP decoding based on preferences",
                       "Enable UA/UDP decoding based on preferences",
                       &decode_ua);
#endif
    for (i=0; i<MAX_TERMINAL_PORTS; i++) {
        prefs_register_uint_preference(uaudp_module,
                           ports[i].name,
                           ports[i].text,
                           ports[i].text,
                           10,
                           &ports[i].port);
    }
    prefs_register_string_preference(uaudp_module, "system_ip",
                     "System IP Address (optional)",
                     "IPv4 address of the DHS3 system."
                     " (Used only in case of identical source and destination ports)",
                     &pref_sys_ip_s);

#if 0
    /* Register tap  */
    uaudp_tap = register_tap("uaudp");*/
#endif
}
Ejemplo n.º 6
0
void
proto_register_tacplus(void)
{
	static hf_register_info hf[] = {
	  { &hf_tacplus_response,
	    { "Response",           "tacplus.response",
	      FT_BOOLEAN, BASE_NONE, NULL, 0x0,
	      "TRUE if TACACS+ response", HFILL }},
	  { &hf_tacplus_request,
	    { "Request",            "tacplus.request",
	      FT_BOOLEAN, BASE_NONE, NULL, 0x0,
	      "TRUE if TACACS+ request", HFILL }},
	  { &hf_tacplus_majvers,
	    { "Major version",      "tacplus.majvers",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      "Major version number", HFILL }},
	  { &hf_tacplus_minvers,
	    { "Minor version",      "tacplus.minvers",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      "Minor version number", HFILL }},
	  { &hf_tacplus_type,
	    { "Type",               "tacplus.type",
	      FT_UINT8, BASE_DEC, VALS(tacplus_type_vals), 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_seqno,
	    { "Sequence number",    "tacplus.seqno",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_flags,
	    { "Flags",              "tacplus.flags",
	      FT_UINT8, BASE_HEX, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_flags_payload_type,
	    { "Unencrypted",       "tacplus.flags.unencrypted",
	      FT_BOOLEAN, 8, TFS(&tfs_set_notset), FLAGS_UNENCRYPTED,
	      "Is payload unencrypted?", HFILL }},
	  { &hf_tacplus_flags_connection_type,
	    { "Single Connection",    "tacplus.flags.singleconn",
	      FT_BOOLEAN, 8, TFS(&tfs_set_notset), FLAGS_SINGLE,
	      "Is this a single connection?", HFILL }},
	  { &hf_tacplus_acct_flags,
	    { "Flags",    "tacplus.acct.flags",
	      FT_UINT8, BASE_HEX, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_session_id,
	    { "Session ID",         "tacplus.session_id",
	      FT_UINT32, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_packet_len,
	    { "Packet length",      "tacplus.packet_len",
	      FT_UINT32, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }}
	};
	static gint *ett[] = {
		&ett_tacplus,
		&ett_tacplus_flags,
		&ett_tacplus_acct_flags,
		&ett_tacplus_body,
		&ett_tacplus_body_chap,
	};
	module_t *tacplus_module;

	proto_tacplus = proto_register_protocol("TACACS+", "TACACS+", "tacplus");
	proto_register_field_array(proto_tacplus, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));
	tacplus_module = prefs_register_protocol (proto_tacplus, tacplus_pref_cb );

        prefs_register_bool_preference(tacplus_module, "desegment", "Reassemble TACACS+ messages spanning multiple TCP segments.", "Whether the TACACS+ dissector should reassemble messages spanning multiple TCP segments.  To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", &tacplus_preference_desegment);

	prefs_register_string_preference ( tacplus_module, "key",
	"TACACS+ Encryption Key", "TACACS+ Encryption Key", &tacplus_opt_key );
}
Ejemplo n.º 7
0
void
proto_register_btbnep(void)
{
    module_t *module;

    static hf_register_info hf[] = {
        { &hf_btbnep_bnep_type,
            { "BNEP Type",                         "btbnep.bnep_type",
            FT_UINT8, BASE_HEX, VALS(bnep_type_vals), 0x7F,
            NULL, HFILL }
        },
        { &hf_btbnep_extension_flag,
            { "Extension Flag",                    "btbnep.extension_flag",
            FT_BOOLEAN, 8, NULL, 0x80,
            NULL, HFILL }
        },
        { &hf_btbnep_control_type,
            { "Control Type",                      "btbnep.control_type",
            FT_UINT8, BASE_HEX, VALS(control_type_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_btbnep_extension_type,
            { "Extension Type",                    "btbnep.extension_type",
            FT_UINT8, BASE_HEX, VALS(extension_type_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_btbnep_extension_length,
            { "Extension Length",                  "btbnep.extension_length",
            FT_UINT16, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_btbnep_unknown_control_type,
            { "Unknown Control Type",              "btbnep.uknown_control_type",
            FT_UINT8, BASE_HEX, VALS(control_type_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_btbnep_uuid_size,
            { "UIDD Size",                         "btbnep.uuid_size",
            FT_UINT8, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_btbnep_destination_service_uuid,
            { "Destination Service UUID",          "btbnep.destination_service_uuid",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_btbnep_source_service_uuid,
            { "Source Service UUID",               "btbnep.source_service_uuid",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_btbnep_setup_connection_response_message,
            { "Response Message",                  "btbnep.setup_connection_response_message",
            FT_UINT16, BASE_HEX, VALS(setup_connection_response_message_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_btbnep_filter_net_type_response_message,
            { "Response Message",                  "btbnep.filter_net_type_response_message",
            FT_UINT16, BASE_HEX, VALS(filter_net_type_response_message_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_btbnep_filter_multi_addr_response_message,
            { "Response Message",                  "btbnep.filter_multi_addr_response_message",
            FT_UINT16, BASE_HEX, VALS(filter_multi_addr_response_message_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_btbnep_list_length,
            { "List Length",                       "btbnep.list_length",
            FT_UINT16, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        /* http://www.iana.org/assignments/ethernet-numbers */
        { &hf_btbnep_network_type_start,
            { "Network Protocol Type Range Start", "btbnep.network_type_start",
            FT_UINT16, BASE_HEX, VALS(etype_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_btbnep_network_type_end,
            { "Network Protocol Type Range End",   "btbnep.network_type_end",
            FT_UINT16, BASE_HEX, VALS(etype_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_btbnep_multicast_address_start,
            { "Multicast Address Start",           "btbnep.multicast_address_start",
            FT_ETHER, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_btbnep_multicast_address_end,
            { "Multicast Address End",             "btbnep.multicast_address_end",
            FT_ETHER, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_btbnep_dst,
            { "Destination",                       "btbnep.dst",
            FT_ETHER, BASE_NONE, NULL, 0x0,
            "Destination Hardware Address", HFILL }
        },
        { &hf_btbnep_src,
            { "Source",                            "btbnep.src",
            FT_ETHER, BASE_NONE, NULL, 0x0,
            "Source Hardware Address", HFILL }
        },
        { &hf_btbnep_type,
            { "Type",                              "btbnep.type",
            FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
            NULL, HFILL }
        },
        { &hf_btbnep_addr,
            { "Address",                           "btbnep.addr",
            FT_ETHER, BASE_NONE, NULL, 0x0,
            "Source or Destination Hardware Address", HFILL }
        },
        { &hf_btbnep_lg,
            { "LG bit",                            "btbnep.lg",
            FT_BOOLEAN, 24, TFS(&lg_tfs), 0x020000,
            "Specifies if this is a locally administered or globally unique (IEEE assigned) address", HFILL }
        },
        { &hf_btbnep_ig,
            { "IG bit",                            "btbnep.ig",
            FT_BOOLEAN, 24, TFS(&ig_tfs), 0x010000,
            "Specifies if this is an individual (unicast) or group (broadcast/multicast) address", HFILL }
        }
    };

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

    proto_btbnep = proto_register_protocol("Bluetooth BNEP Protocol", "BT BNEP", "btbnep");
    register_dissector("btbnep", dissect_btbnep, proto_btbnep);

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

    module = prefs_register_protocol(proto_btbnep, NULL);
    prefs_register_static_text_preference(module, "bnep.version",
            "Bluetooth Protocol BNEP version: 1.0",
            "Version of protocol supported by this dissector.");

    prefs_register_bool_preference(module, "bnep.top_dissect",
            "Dissecting the top protocols", "Dissecting the top protocols",
            &top_dissect);
}
Ejemplo n.º 8
0
void
proto_register_frame(void)
{
	static hf_register_info hf[] = {
		{ &hf_frame_arrival_time,
		  { "Arrival Time", "frame.time",
		    FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0,
		    "Absolute time when this frame was captured", HFILL }},

		{ &hf_frame_shift_offset,
		  { "Time shift for this packet", "frame.offset_shift",
		    FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
		    "Time shift applied to this packet", HFILL }},

		{ &hf_frame_arrival_time_epoch,
		  { "Epoch Time", "frame.time_epoch",
		    FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
		    "Epoch time when this frame was captured", HFILL }},

		{ &hf_frame_time_invalid,
		  { "Arrival Timestamp invalid", "frame.time_invalid",
		    FT_NONE, BASE_NONE, NULL, 0x0,
		    "The timestamp from the capture is out of the valid range", HFILL }},

		{ &hf_frame_time_delta,
		  { "Time delta from previous captured frame", "frame.time_delta",
		    FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_time_delta_displayed,
		  { "Time delta from previous displayed frame", "frame.time_delta_displayed",
		    FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_time_relative,
		  { "Time since reference or first frame", "frame.time_relative",
		    FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
		    "Time relative to time reference or first frame", HFILL }},

		{ &hf_frame_time_reference,
		  { "This is a Time Reference frame", "frame.ref_time",
		    FT_NONE, BASE_NONE, NULL, 0x0,
		    "This frame is a Time Reference frame", HFILL }},

		{ &hf_frame_number,
		  { "Frame Number", "frame.number",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_len,
		  { "Frame length on the wire", "frame.len",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_capture_len,
		  { "Frame length stored into the capture file", "frame.cap_len",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_md5_hash,
		  { "Frame MD5 Hash", "frame.md5_hash",
		    FT_STRING, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_p2p_dir,
		  { "Point-to-Point Direction", "frame.p2p_dir",
		    FT_INT8, BASE_DEC, VALS(p2p_dirs), 0x0,
		    NULL, HFILL }},

		{ &hf_link_number,
		  { "Link Number", "frame.link_nr",
		    FT_UINT16, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_file_off,
		  { "File Offset", "frame.file_off",
		    FT_INT64, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_marked,
		  { "Frame is marked", "frame.marked",
		    FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    "Frame is marked in the GUI", HFILL }},

		{ &hf_frame_ignored,
		  { "Frame is ignored", "frame.ignored",
		    FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    "Frame is ignored by the dissectors", HFILL }},

		{ &hf_frame_protocols,
		  { "Protocols in frame", "frame.protocols",
		    FT_STRING, BASE_NONE, NULL, 0x0,
		    "Protocols carried by this frame", HFILL }},

		{ &hf_frame_color_filter_name,
		  { "Coloring Rule Name", "frame.coloring_rule.name",
		    FT_STRING, BASE_NONE, NULL, 0x0,
		    "The frame matched the coloring rule with this name", HFILL }},

		{ &hf_frame_color_filter_text,
		  { "Coloring Rule String", "frame.coloring_rule.string",
		    FT_STRING, BASE_NONE, NULL, 0x0,
		    "The frame matched this coloring rule string", HFILL }},

		{ &hf_frame_interface_id,
		  { "Interface id", "frame.interface_id",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_comments_text,
		  { "Comment", "frame.comment",
		    FT_STRING, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},
	};
	
	static hf_register_info hf_encap =
		{ &hf_frame_wtap_encap,
		  { "Encapsulation type", "frame.encap_type",
		    FT_INT16, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }};
	
 	static gint *ett[] = {
		&ett_frame,
		&ett_comments
	};

	module_t *frame_module;

	if (hf_encap.hfinfo.strings == NULL) {
		int encap_count = wtap_get_num_encap_types();
		value_string *arr;
		int i;
		
		hf_encap.hfinfo.strings = arr = g_new(value_string, encap_count+1); 
		
		for (i = 0; i < encap_count; i++) {
			arr[i].value = i;
			arr[i].strptr = wtap_encap_string(i);
		}
		arr[encap_count].value = 0;
		arr[encap_count].strptr = NULL;
	}

	wtap_encap_dissector_table = register_dissector_table("wtap_encap",
	    "Wiretap encapsulation type", FT_UINT32, BASE_DEC);

	proto_frame = proto_register_protocol("Frame", "Frame", "frame");
	proto_pkt_comment = proto_register_protocol("Packet comments", "Pkt_Comment", "pkt_comment");
	proto_register_field_array(proto_frame, hf, array_length(hf));
	proto_register_field_array(proto_frame, &hf_encap, 1);
	proto_register_subtree_array(ett, array_length(ett));
	register_dissector("frame",dissect_frame,proto_frame);

	/* You can't disable dissection of "Frame", as that would be
	   tantamount to not doing any dissection whatsoever. */
	proto_set_cant_toggle(proto_frame);

	proto_short = proto_register_protocol("Short Frame", "Short frame", "short");
	proto_malformed = proto_register_protocol("Malformed Packet",
	    "Malformed packet", "malformed");
	proto_unreassembled = proto_register_protocol(
	    "Unreassembled Fragmented Packet",
	    "Unreassembled fragmented packet", "unreassembled");

	/* "Short Frame", "Malformed Packet", and "Unreassembled Fragmented
	   Packet" aren't really protocols, they're error indications;
	   disabling them makes no sense. */
	proto_set_cant_toggle(proto_short);
	proto_set_cant_toggle(proto_malformed);
	proto_set_cant_toggle(proto_unreassembled);

	/* Our preferences */
	frame_module = prefs_register_protocol(proto_frame, NULL);
	prefs_register_bool_preference(frame_module, "show_file_off",
	    "Show File Offset", "Show offset of frame in capture file", &show_file_off);
	prefs_register_bool_preference(frame_module, "force_docsis_encap",
	    "Treat all frames as DOCSIS frames", "Treat all frames as DOCSIS Frames", &force_docsis_encap);
	prefs_register_bool_preference(frame_module, "generate_md5_hash",
	    "Generate an MD5 hash of each frame",
	    "Whether or not MD5 hashes should be generated for each frame, useful for finding duplicate frames.",
	    &generate_md5_hash);
	prefs_register_bool_preference(frame_module, "generate_epoch_time",
	    "Generate an epoch time entry for each frame",
	    "Whether or not an Epoch time entry should be generated for each frame.",
	    &generate_epoch_time);
	prefs_register_bool_preference(frame_module, "generate_bits_field",
	    "Show the number of bits in the frame",
	    "Whether or not the number of bits in the frame should be shown.",
	    &generate_bits_field);

	frame_tap=register_tap("frame");
}
Ejemplo n.º 9
0
void
proto_register_fcip (void)
{

    /* Setup list of header fields  See Section 1.6.1 for details*/
    static hf_register_info hf[] = {
        { &hf_fcip_protocol,
	  { "Protocol", "fcip.proto", FT_UINT8, BASE_DEC,
            VALS(fcencap_proto_vals), 0, NULL, HFILL }},
        { &hf_fcip_protocol_c,
          {"Protocol (1's Complement)", "fcip.protoc", FT_UINT8, BASE_DEC,
           NULL, 0, NULL, HFILL}},
        { &hf_fcip_version,
          {"Version", "fcip.version", FT_UINT8, BASE_DEC, 
           NULL, 0, NULL, HFILL}},
        { &hf_fcip_version_c,
          {"Version (1's Complement)", "fcip.versionc", FT_UINT8, BASE_DEC,
           NULL, 0, NULL, HFILL}},
        { &hf_fcip_encap_word1,
          {"FCIP Encapsulation Word1", "fcip.encap_word1", FT_UINT32, BASE_HEX,
           NULL, 0, NULL, HFILL}},
        { &hf_fcip_flags,
          {"Flags", "fcip.flags", FT_UINT8, BASE_HEX, 
           NULL, 0xFC, NULL, HFILL}},
        { &hf_fcip_flags_c,
          {"Flags (1's Complement)", "fcip.flagsc", FT_UINT8, BASE_HEX,
           NULL, 0xFC, NULL, HFILL}},
        { &hf_fcip_framelen,
          {"Frame Length (in Words)", "fcip.framelen", FT_UINT16, BASE_DEC,
           NULL, 0x03FF, NULL, HFILL}},
        { &hf_fcip_framelen_c,
          {"Frame Length (1's Complement)", "fcip.framelenc", FT_UINT16, BASE_DEC,
           NULL, 0x03FF, NULL, HFILL}},
        { &hf_fcip_tsec,
          {"Time (secs)", "fcip.tsec", FT_UINT32, BASE_DEC, 
           NULL, 0, NULL, HFILL}},
        { &hf_fcip_tusec,
          {"Time (fraction)", "fcip.tusec", FT_UINT32, BASE_DEC, 
           NULL, 0, NULL, HFILL}},
        { &hf_fcip_encap_crc,
          {"CRC", "fcip.encap_crc", FT_UINT32, BASE_HEX,
           NULL, 0, NULL, HFILL}},
        { &hf_fcip_sof,
          {"SOF", "fcip.sof", FT_UINT8, BASE_HEX, 
           VALS (&fcip_sof_vals), 0, NULL, HFILL}},
        { &hf_fcip_sof_c,
          {"SOF (1's Complement)", "fcip.sofc", FT_UINT8, BASE_HEX, 
           NULL, 0, NULL, HFILL}},
        { &hf_fcip_eof,
          {"EOF", "fcip.eof", FT_UINT8, BASE_HEX, 
           VALS (&fcip_eof_vals), 0, NULL, HFILL}},
        { &hf_fcip_eof_c,
          {"EOF (1's Complement)", "fcip.eofc", FT_UINT8, BASE_HEX, 
           NULL, 0, NULL, HFILL}},
        { &hf_fcip_pflags_changed,
          {"Changed Flag", "fcip.pflags.ch", FT_BOOLEAN, 8,
           NULL, 0x80, NULL, HFILL}},
        { &hf_fcip_pflags_special,
          {"Special Frame Flag", "fcip.pflags.sf", FT_BOOLEAN, 8,
           NULL, 0x1, NULL, HFILL}},
        { &hf_fcip_pflags_c,
          {"Pflags (1's Complement)", "fcip.pflagsc", FT_UINT8, BASE_HEX,
           NULL, 0x0, NULL, HFILL}},
        { &hf_fcip_src_wwn,
          {"Source Fabric WWN", "fcip.srcwwn", FT_STRING, BASE_NONE,
           NULL, 0x0, NULL, HFILL}},
        { &hf_fcip_dst_wwn,
          {"Destination Fabric WWN", "fcip.dstwwn", FT_STRING, BASE_NONE,
           NULL, 0x0, NULL, HFILL}},
        { &hf_fcip_src_entity_id,
          {"FC/FCIP Entity Id", "fcip.srcid", FT_BYTES, BASE_NONE,
           NULL, 0x0, NULL, HFILL}},
        { &hf_fcip_conn_flags,
          {"Connection Usage Flags", "fcip.connflags", FT_UINT8, BASE_HEX,
           NULL, 0x0, NULL, HFILL}},
        { &hf_fcip_conn_code,
          {"Connection Usage Code", "fcip.conncode", FT_UINT16, BASE_HEX,
           NULL, 0x0, NULL, HFILL}},
        { &hf_fcip_katov,
          {"K_A_TOV", "fcip.katov", FT_UINT32, BASE_DEC,
           NULL, 0x0, NULL, HFILL}},
        { &hf_fcip_conn_nonce,
          {"Connection Nonce", "fcip.nonce", FT_BYTES, BASE_NONE,
           NULL, 0x0, NULL, HFILL}},
    };

    static gint *ett[] = {
        &ett_fcip,
    };
    
    module_t *fcip_module;

    /* Register the protocol name and description */
    proto_fcip = proto_register_protocol("FCIP", "Fibre Channel over IP", "fcip");

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

    fcip_module = prefs_register_protocol(proto_fcip, NULL);
    prefs_register_bool_preference(fcip_module,
                                   "desegment",
                                   "Reassemble FCIP messages spanning multiple TCP segments",
                                   "Whether the FCIP dissector should reassemble messages spanning multiple TCP segments."
                                   " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
                                   &fcip_desegment);
    prefs_register_uint_preference(fcip_module,
                                   "target_port",
                                   "Target port",
                                   "Port number used for FCIP",
                                   10,
                                   &fcip_port);
}
Ejemplo n.º 10
0
void
proto_register_dvmrp(void)
{
	static hf_register_info hf[] = {
		{ &hf_version,
			{ "DVMRP Version", "dvmrp.version", FT_UINT8, BASE_DEC,
			  NULL, 0, NULL, HFILL }},

		{ &hf_type,
			{ "Type", "dvmrp.type", FT_UINT8, BASE_HEX,
			  VALS(dvmrp_type), 0, "DVMRP Packet Type", HFILL }},

		{ &hf_code_v1,
			{ "Code", "dvmrp.v1.code", FT_UINT8, BASE_HEX,
			  VALS(code_v1), 0, "DVMRP Packet Code", HFILL }},

		{ &hf_checksum,
			{ "Checksum", "dvmrp.checksum", FT_UINT16, BASE_HEX,
			  NULL, 0, "DVMRP Checksum", HFILL }},

		{ &hf_checksum_bad,
			{ "Bad Checksum", "dvmrp.checksum_bad", FT_BOOLEAN, BASE_NONE,
			  NULL, 0x0, "Bad DVMRP Checksum", HFILL }},

		{ &hf_commands,
			{ "Commands", "dvmrp.commands", FT_NONE, BASE_NONE,
			  NULL, 0, "DVMRP V1 Commands", HFILL }},

		{ &hf_command,
			{ "Command", "dvmrp.command", FT_UINT8, BASE_HEX,
			  VALS(command), 0, "DVMRP V1 Command", HFILL }},

		{ &hf_afi,
			{ "Address Family", "dvmrp.afi", FT_UINT8, BASE_HEX,
			  VALS(afi), 0, "DVMRP Address Family Indicator", HFILL }},

		{ &hf_count,
			{ "Count", "dvmrp.count", FT_UINT8, BASE_HEX,
			  NULL, 0, NULL, HFILL }},

		{ &hf_netmask,
			{ "Netmask", "dvmrp.netmask", FT_IPv4, BASE_NONE,
			  NULL, 0, "DVMRP Netmask", HFILL }},

		{ &hf_metric,
			{ "Metric", "dvmrp.metric", FT_UINT8, BASE_DEC,
			  NULL, 0, "DVMRP Metric", HFILL }},

		{&hf_dest_unr,
			{ "Destination Unreachable", "dvmrp.dest_unreach", FT_BOOLEAN, 8,
			TFS(&tfs_dest_unreach), 0x01, NULL, HFILL }},

		{&hf_split_horiz,
			{ "Split Horizon", "dvmrp.split_horiz", FT_BOOLEAN, 8,
			TFS(&tfs_split_horiz), 0x02, "Split Horizon concealed route", HFILL }},

		{ &hf_infinity,
			{ "Infinity", "dvmrp.infinity", FT_UINT8, BASE_DEC,
			  NULL, 0, "DVMRP Infinity", HFILL }},

		{ &hf_daddr,
			{ "Dest Addr", "dvmrp.daddr", FT_IPv4, BASE_NONE,
			  NULL, 0, "DVMRP Destination Address", HFILL }},

		{ &hf_maddr,
			{ "Multicast Addr", "dvmrp.maddr", FT_IPv4, BASE_NONE,
			  NULL, 0, "DVMRP Multicast Address", HFILL }},

		{ &hf_hold,
			{ "Hold Time", "dvmrp.hold", FT_UINT32, BASE_DEC,
			  NULL, 0, "DVMRP Hold Time in seconds", HFILL }},

		{ &hf_code_v3,
			{ "Code", "dvmrp.v3.code", FT_UINT8, BASE_HEX,
			  VALS(code_v3), 0, "DVMRP Packet Code", HFILL }},

		{ &hf_capabilities,
			{ "Capabilities", "dvmrp.capabilities", FT_NONE, BASE_NONE,
			  NULL, 0, "DVMRP V3 Capabilities", HFILL }},

		{&hf_cap_leaf,
			{ "Leaf", "dvmrp.cap.leaf", FT_BOOLEAN, 8,
			TFS(&tfs_cap_leaf), DVMRP_V3_CAP_LEAF, NULL, HFILL }},

		{&hf_cap_prune,
			{ "Prune", "dvmrp.cap.prune", FT_BOOLEAN, 8,
			TFS(&tfs_cap_prune), DVMRP_V3_CAP_PRUNE, "Prune capability", HFILL }},

		{&hf_cap_genid,
			{ "Genid", "dvmrp.cap.genid", FT_BOOLEAN, 8,
			TFS(&tfs_cap_genid), DVMRP_V3_CAP_GENID, "Genid capability", HFILL }},

		{&hf_cap_mtrace,
			{ "Mtrace", "dvmrp.cap.mtrace", FT_BOOLEAN, 8,
			TFS(&tfs_cap_mtrace), DVMRP_V3_CAP_MTRACE, "Mtrace capability", HFILL }},

		{&hf_cap_snmp,
			{ "SNMP", "dvmrp.cap.snmp", FT_BOOLEAN, 8,
			TFS(&tfs_cap_snmp), DVMRP_V3_CAP_SNMP, "SNMP capability", HFILL }},

		{&hf_cap_netmask,
			{ "Netmask", "dvmrp.cap.netmask", FT_BOOLEAN, 8,
			TFS(&tfs_cap_netmask), DVMRP_V3_CAP_NETMASK, "Netmask capability", HFILL }},

		{ &hf_min_ver,
			{ "Minor Version", "dvmrp.min_ver", FT_UINT8, BASE_HEX,
			  NULL, 0, "DVMRP Minor Version", HFILL }},

		{ &hf_maj_ver,
			{ "Major Version", "dvmrp.maj_ver", FT_UINT8, BASE_HEX,
			  NULL, 0, "DVMRP Major Version", HFILL }},

		{ &hf_genid,
			{ "Generation ID", "dvmrp.genid", FT_UINT32, BASE_DEC,
			  NULL, 0, "DVMRP Generation ID", HFILL }},

		{ &hf_route,
			{ "Route", "dvmrp.route", FT_NONE, BASE_NONE,
			  NULL, 0, "DVMRP V3 Route Report", HFILL }},

		{ &hf_saddr,
			{ "Source Addr", "dvmrp.saddr", FT_IPv4, BASE_NONE,
			  NULL, 0, "DVMRP Source Address", HFILL }},

		{ &hf_life,
			{ "Prune lifetime", "dvmrp.lifetime", FT_UINT32, BASE_DEC,
			  NULL, 0, "DVMRP Prune Lifetime", HFILL }},

		{ &hf_local,
			{ "Local Addr", "dvmrp.local", FT_IPv4, BASE_NONE,
			  NULL, 0, "DVMRP Local Address", HFILL }},

		{ &hf_threshold,
			{ "Threshold", "dvmrp.threshold", FT_UINT8, BASE_DEC,
			NULL, 0, "DVMRP Interface Threshold", HFILL }},

		{ &hf_flags,
			{ "Flags", "dvmrp.flags", FT_NONE, BASE_NONE,
			NULL, 0, "DVMRP Interface Flags", HFILL }},

		{ &hf_flag_tunnel,
			{ "Tunnel", "dvmrp.flag.tunnel", FT_BOOLEAN, 8,
			NULL, DVMRP_V3_FLAG_TUNNEL, "Neighbor reached via tunnel", HFILL }},

		{ &hf_flag_srcroute,
			{ "Source Route", "dvmrp.flag.srcroute", FT_BOOLEAN, 8,
			NULL, DVMRP_V3_FLAG_SRCROUTE, "Tunnel uses IP source routing", HFILL }},

		{ &hf_flag_down,
			{ "Down", "dvmrp.flag.down", FT_BOOLEAN, 8,
			NULL, DVMRP_V3_FLAG_DOWN, "Operational status down", HFILL }},

		{ &hf_flag_disabled,
			{ "Disabled", "dvmrp.flag.disabled", FT_BOOLEAN, 8,
			NULL, DVMRP_V3_FLAG_DISABLED, "Administrative status down", HFILL }},

		{ &hf_flag_querier,
			{ "Querier", "dvmrp.flag.querier", FT_BOOLEAN, 8,
			NULL, DVMRP_V3_FLAG_QUERIER, "Querier for interface", HFILL }},

		{ &hf_flag_leaf,
			{ "Leaf", "dvmrp.flag.leaf", FT_BOOLEAN, 8,
			NULL, DVMRP_V3_FLAG_LEAF, "No downstream neighbors on interface", HFILL }},

		{ &hf_ncount,
			{ "Neighbor Count", "dvmrp.ncount", FT_UINT8, BASE_DEC,
			NULL, 0, "DVMRP Neighbor Count", HFILL }},

		{ &hf_neighbor,
			{ "Neighbor Addr", "dvmrp.neighbor", FT_IPv4, BASE_NONE,
			  NULL, 0, "DVMRP Neighbor Address", HFILL }}
	};
	static gint *ett[] = {
		&ett_dvmrp,
		&ett_commands,
		&ett_capabilities,
		&ett_flags,
		&ett_route
	};
	module_t *module_dvmrp;

	proto_dvmrp = proto_register_protocol("Distance Vector Multicast Routing Protocol",
	    "DVMRP", "dvmrp");
	proto_register_field_array(proto_dvmrp, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));

	module_dvmrp = prefs_register_protocol(proto_dvmrp, NULL);

	prefs_register_bool_preference(module_dvmrp, "strict_v3", "Allow strict DVMRP V3 only",
		"Allow only packets with Major=0x03//Minor=0xFF as DVMRP V3 packets",
		&strict_v3);
}
Ejemplo n.º 11
0
void
proto_register_multipart(void)
{

    /* Setup list of header fields  See Section 1.6.1 for details */
    static hf_register_info hf[] = {
        {   &hf_multipart_type,
            {   "Type",
                "mime_multipart.type",
                FT_STRING, BASE_NONE, NULL, 0x00,
                "MIME multipart encapsulation type", HFILL
            }
        },
        {   &hf_multipart_part,
            {   "Encapsulated multipart part",
                "mime_multipart.part",
                FT_STRING, BASE_NONE, NULL, 0x00,
                NULL, HFILL
            }
        },
        {   &hf_multipart_sec_token_len,
            {   "Length of security token",
                "mime_multipart.header.sectoken-length",
                FT_UINT32, BASE_DEC, NULL, 0x00,
                "Length of the Kerberos BLOB which follows this token", HFILL
            }
        },
        {   &hf_header_array[POS_CONTENT_DISPOSITION],
            {   "Content-Disposition",
                "mime_multipart.header.content-disposition",
                FT_STRING, BASE_NONE, NULL, 0x00,
                "RFC 2183: Content-Disposition Header", HFILL
            }
        },
        {   &hf_header_array[POS_CONTENT_ENCODING],
            {   "Content-Encoding",
                "mime_multipart.header.content-encoding",
                FT_STRING, BASE_NONE, NULL, 0x00,
                "Content-Encoding Header", HFILL
            }
        },
        {   &hf_header_array[POS_CONTENT_ID],
            {   "Content-Id",
                "mime_multipart.header.content-id",
                FT_STRING, BASE_NONE, NULL, 0x00,
                "RFC 2045: Content-Id Header", HFILL
            }
        },
        {   &hf_header_array[POS_CONTENT_LANGUAGE],
            {   "Content-Language",
                "mime_multipart.header.content-language",
                FT_STRING, BASE_NONE, NULL, 0x00,
                "Content-Language Header", HFILL
            }
        },
        {   &hf_header_array[POS_CONTENT_LENGTH],
            {   "Content-Length",
                "mime_multipart.header.content-length",
                FT_STRING, BASE_NONE, NULL, 0x0,
                "Content-Length Header", HFILL
            }
        },
        {   &hf_header_array[POS_CONTENT_TRANSFER_ENCODING],
            {   "Content-Transfer-Encoding",
                "mime_multipart.header.content-transfer-encoding",
                FT_STRING, BASE_NONE, NULL, 0x00,
                "RFC 2045: Content-Transfer-Encoding Header", HFILL
            }
        },
        {   &hf_header_array[POS_CONTENT_TYPE],
            {   "Content-Type",
                "mime_multipart.header.content-type",
                FT_STRING, BASE_NONE,NULL,0x0,
                "Content-Type Header", HFILL
            }
        },
        {   &hf_header_array[POS_ORIGINALCONTENT],
            {   "OriginalContent",
                "mime_multipart.header.originalcontent",
                FT_STRING, BASE_NONE,NULL,0x0,
                "Original Content-Type Header", HFILL
            }
        },

        /* Generated from convert_proto_tree_add_text.pl */
        { &hf_multipart_first_boundary, { "First boundary", "mime_multipart.first_boundary", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_multipart_preamble, { "Preamble", "mime_multipart.preamble", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_multipart_last_boundary, { "Last boundary", "mime_multipart.last_boundary", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_multipart_boundary, { "Boundary", "mime_multipart.boundary", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_multipart_trailer, { "Trailer", "mime_multipart.trailer", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},

    };

    /*
     * Preferences
     */
    module_t *multipart_module;
    expert_module_t* expert_multipart;


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

    static ei_register_info ei[] = {
        { &ei_multipart_no_required_parameter, { "mime_multipart.no_required_parameter", PI_PROTOCOL, PI_ERROR, "The multipart dissector could not find a required parameter.", EXPFILL }},
        { &ei_multipart_decryption_not_possible, { "mime_multipart.decryption_not_possible", PI_UNDECODED, PI_WARN, "The multipart dissector could not decrypt the message.", EXPFILL }},
    };

    /*
     * Register the protocol name and description
     */
    proto_multipart = proto_register_protocol(
                          "MIME Multipart Media Encapsulation",
                          "MIME multipart",
                          "mime_multipart");

    /*
     * Required function calls to register
     * the header fields and subtrees used.
     */
    proto_register_field_array(proto_multipart, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_multipart = expert_register_protocol(proto_multipart);
    expert_register_field_array(expert_multipart, ei, array_length(ei));

    multipart_module = prefs_register_protocol(proto_multipart, NULL);

    prefs_register_bool_preference(multipart_module,
                                   "display_unknown_body_as_text",
                                   "Display bodies without media type as text",
                                   "Display multipart bodies with no media type dissector"
                                   " as raw text (may cause problems with binary data).",
                                   &display_unknown_body_as_text);

    prefs_register_bool_preference(multipart_module,
                                   "remove_base64_encoding",
                                   "Remove base64 encoding from bodies",
                                   "Remove any base64 content-transfer encoding from bodies. "
                                   "This supports export of the body and its further dissection.",
                                   &remove_base64_encoding);

    /*
     * Dissectors requiring different behavior in cases where the media
     * is contained in a multipart entity should register their multipart
     * dissector in the dissector table below, which is similar to the
     * "media_type" dissector table defined in the HTTP dissector code.
     */
    multipart_media_subdissector_table = register_dissector_table(
            "multipart_media_type",
            "Internet media type (for multipart processing)",
            FT_STRING, BASE_NONE, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
}
Ejemplo n.º 12
0
void
proto_register_clnp(void)
{
  static hf_register_info hf[] = {
    { &hf_clnp_id,
      { "Network Layer Protocol Identifier", "clnp.nlpi", FT_UINT8, BASE_HEX,
        VALS(nlpid_vals), 0x0, NULL, HFILL }},

    { &hf_clnp_length,
      { "HDR Length", "clnp.len",          FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_clnp_version,
      { "Version", "clnp.version",  FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_clnp_ttl,
      { "Holding Time", "clnp.ttl",        FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_clnp_type,
      { "PDU Type", "clnp.type",     FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_clnp_pdu_length,
      { "PDU length", "clnp.pdu.len",  FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_clnp_checksum,
      { "Checksum", "clnp.checksum", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_clnp_dest_length,
      { "DAL", "clnp.dsap.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_clnp_dest,
      { "DA", "clnp.dsap",     FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},

    { &hf_clnp_src_length,
      { "SAL", "clnp.ssap.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_clnp_src,
      { "SA", "clnp.ssap",     FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},

    { &hf_clnp_segment_overlap,
      { "Segment overlap", "clnp.segment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
        "Segment overlaps with other segments", HFILL }},

    { &hf_clnp_segment_overlap_conflict,
      { "Conflicting data in segment overlap", "clnp.segment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
        "Overlapping segments contained conflicting data", HFILL }},

    { &hf_clnp_segment_multiple_tails,
      { "Multiple tail segments found", "clnp.segment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
        "Several tails were found when reassembling the packet", HFILL }},

    { &hf_clnp_segment_too_long_segment,
      { "Segment too long", "clnp.segment.toolongsegment", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
        "Segment contained data past end of packet", HFILL }},

    { &hf_clnp_segment_error,
      { "Reassembly error", "clnp.segment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
        "Reassembly error due to illegal segments", HFILL }},

    { &hf_clnp_segment_count,
      { "Segment count", "clnp.segment.count", FT_UINT32, BASE_DEC, NULL, 0x0,
        NULL, HFILL }},

    { &hf_clnp_segment,
      { "CLNP Segment", "clnp.segment", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
        NULL, HFILL }},

    { &hf_clnp_segments,
      { "CLNP Segments", "clnp.segments", FT_NONE, BASE_NONE, NULL, 0x0,
        NULL, HFILL }},

    { &hf_clnp_reassembled_in,
      { "Reassembled CLNP in frame", "clnp.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
        "This CLNP packet is reassembled in this frame", HFILL }},

    { &hf_clnp_reassembled_length,
      { "Reassembled CLNP length", "clnp.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0,
        "The total length of the reassembled payload", HFILL }}
  };
  static gint *ett[] = {
    &ett_clnp,
    &ett_clnp_type,
    &ett_clnp_segments,
    &ett_clnp_segment,
    &ett_clnp_disc_pdu,
  };

  module_t *clnp_module;

  proto_clnp = proto_register_protocol(PROTO_STRING_CLNP, "CLNP", "clnp");
  proto_register_field_array(proto_clnp, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  register_dissector("clnp", dissect_clnp, proto_clnp);
  register_heur_dissector_list("clnp", &clnp_heur_subdissector_list);
  register_init_routine(clnp_reassemble_init);

  clnp_module = prefs_register_protocol(proto_clnp, NULL);
  prefs_register_uint_preference(clnp_module, "tp_nsap_selector",
        "NSAP selector for Transport Protocol (last byte in hex)",
        "NSAP selector for Transport Protocol (last byte in hex)",
        16, &tp_nsap_selector);
  prefs_register_bool_preference(clnp_module, "always_decode_transport",
        "Always try to decode NSDU as transport PDUs",
        "Always try to decode NSDU as transport PDUs",
        &always_decode_transport);
  prefs_register_bool_preference(clnp_module, "reassemble",
        "Reassemble segmented CLNP datagrams",
        "Whether segmented CLNP datagrams should be reassembled",
        &clnp_reassemble);
}
Ejemplo n.º 13
0
void
proto_register_file(void)
{
	static hf_register_info hf[] = {
		{ &hf_file_record_number,
		  { "Record Number", "file.record_number",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_file_record_len,
		  { "Record length", "file.record_len",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},
#if 0
		{ &hf_frame_file_off,
		  { "File Offset", "file.file_off",
		    FT_INT64, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},
#endif
		{ &hf_file_marked,
		  { "File record is marked", "file.marked",
		    FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    "File record is marked in the GUI", HFILL }},

		{ &hf_file_ignored,
		  { "File record is ignored", "file.ignored",
		    FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    "File record is ignored by the dissectors", HFILL }},

		{ &hf_file_protocols,
		  { "File record types in frame", "file.record_types",
		    FT_STRING, BASE_NONE, NULL, 0x0,
		    "File record types carried by this frame", HFILL }},

		{ &hf_file_color_filter_name,
		  { "Coloring Rule Name", "file.coloring_rule.name",
		    FT_STRING, BASE_NONE, NULL, 0x0,
		    "The file record matched the coloring rule with this name", HFILL }},

		{ &hf_file_color_filter_text,
		  { "Coloring Rule String", "file.coloring_rule.string",
		    FT_STRING, BASE_NONE, NULL, 0x0,
		    "The file record matched this coloring rule string", HFILL }},

		{ &hf_file_num_p_prot_data,
		  { "Number of per-record-data", "file.p_record_data",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_file_ftap_encap,
		  { "Encapsulation type", "file.encap_type",
		    FT_INT16, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},
	};

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

#if 0
	module_t *file_module;
#endif

	file_encap_dissector_table = register_dissector_table("ftap_encap",
	    "Filetap encapsulation type", FT_UINT32, BASE_DEC);

	proto_file = proto_register_protocol("File", "File", "file");
	proto_register_field_array(proto_file, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));
	register_dissector("file",dissect_file_record,proto_file);

	/* You can't disable dissection of "Frame", as that would be
	   tantamount to not doing any dissection whatsoever. */
	proto_set_cant_toggle(proto_file);

	/* Our preferences */
#if 0
	frame_module = prefs_register_protocol(proto_frame, NULL);
	prefs_register_bool_preference(frame_module, "show_file_off",
	    "Show File Offset", "Show offset of frame in capture file", &show_file_off);
#endif

	file_tap=register_tap("file");
}
/*--- proto_register_h225 -------------------------------------------*/
void proto_register_h225(void) {

  /* List of fields */
  static hf_register_info hf[] = {
	{ &hf_h221Manufacturer,
		{ "H.221 Manufacturer", "h221.Manufacturer", FT_UINT32, BASE_HEX,
		VALS(H221ManufacturerCode_vals), 0, NULL, HFILL }},
	{ &hf_h225_ras_req_frame,
      		{ "RAS Request Frame", "h225.ras.reqframe", FT_FRAMENUM, BASE_NONE,
      		NULL, 0, NULL, HFILL }},
  	{ &hf_h225_ras_rsp_frame,
      		{ "RAS Response Frame", "h225.ras.rspframe", FT_FRAMENUM, BASE_NONE,
      		NULL, 0, NULL, HFILL }},
  	{ &hf_h225_ras_dup,
      		{ "Duplicate RAS Message", "h225.ras.dup", FT_UINT32, BASE_DEC,
		NULL, 0, NULL, HFILL }},
  	{ &hf_h225_ras_deltatime,
      		{ "RAS Service Response Time", "h225.ras.timedelta", FT_RELATIVE_TIME, BASE_NONE,
      		NULL, 0, "Timedelta between RAS-Request and RAS-Response", HFILL }},

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

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

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

  h225_module = prefs_register_protocol(proto_h225, proto_reg_handoff_h225);
  prefs_register_uint_preference(h225_module, "tls.port",
                                 "H.225 TLS Port",
                                 "H.225 Server TLS Port",
                                 10, &h225_tls_port);
  prefs_register_bool_preference(h225_module, "reassembly",
		"Reassemble H.225 messages spanning multiple TCP segments",
		"Whether the H.225 dissector should reassemble messages spanning multiple TCP segments."
		" To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
		&h225_reassembly);
  prefs_register_bool_preference(h225_module, "h245_in_tree",
		"Display tunnelled H.245 inside H.225.0 tree",
		"ON - display tunnelled H.245 inside H.225.0 tree, OFF - display tunnelled H.245 in root tree after H.225.0",
		&h225_h245_in_tree);
  prefs_register_bool_preference(h225_module, "tp_in_tree",
		"Display tunnelled protocols inside H.225.0 tree",
		"ON - display tunnelled protocols inside H.225.0 tree, OFF - display tunnelled protocols in root tree after H.225.0",
		&h225_tp_in_tree);

  new_register_dissector("h225", dissect_h225_H323UserInformation, proto_h225);
  new_register_dissector("h323ui",dissect_h225_H323UserInformation, proto_h225);
  new_register_dissector("h225.ras", dissect_h225_h225_RasMessage, proto_h225);

  nsp_object_dissector_table = register_dissector_table("h225.nsp.object", "H.225 NonStandardParameter (object)", FT_STRING, BASE_NONE);
  nsp_h221_dissector_table = register_dissector_table("h225.nsp.h221", "H.225 NonStandardParameter (h221)", FT_UINT32, BASE_HEX);
  tp_dissector_table = register_dissector_table("h225.tp", "H.225 TunnelledProtocol", FT_STRING, BASE_NONE);
  gef_name_dissector_table = register_dissector_table("h225.gef.name", "H.225 Generic Extensible Framework (names)", FT_STRING, BASE_NONE);
  gef_content_dissector_table = register_dissector_table("h225.gef.content", "H.225 Generic Extensible Framework", FT_STRING, BASE_NONE);

  register_init_routine(&h225_init_routine);
  h225_tap = register_tap("h225");

  oid_add_from_string("Version 1","0.0.8.2250.0.1");
  oid_add_from_string("Version 2","0.0.8.2250.0.2");
  oid_add_from_string("Version 3","0.0.8.2250.0.3");
  oid_add_from_string("Version 4","0.0.8.2250.0.4");
  oid_add_from_string("Version 5","0.0.8.2250.0.5");
  oid_add_from_string("Version 6","0.0.8.2250.0.6");

}
Ejemplo n.º 15
0
void
proto_register_clnp(void)
{
    static hf_register_info hf[] = {
        { &hf_clnp_id,
            { "Network Layer Protocol Identifier", "clnp.nlpi", FT_UINT8, BASE_HEX,
                VALS(nlpid_vals), 0x0, NULL, HFILL }},

        { &hf_clnp_length,
            { "HDR Length", "clnp.len",          FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

        { &hf_clnp_version,
            { "Version", "clnp.version",  FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

        { &hf_clnp_ttl,
            { "Holding Time", "clnp.ttl",        FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

        { &hf_clnp_type,
            { "PDU Type", "clnp.type",     FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

        { &hf_clnp_cnf_segmentation,
            { "Segmentation permitted", "clnp.cnf.segmentation", FT_BOOLEAN, 8, TFS(&tfs_yes_no), CNF_SEG_OK, NULL, HFILL }},

        { &hf_clnp_cnf_more_segments,
            { "More segments", "clnp.cnf.more_segments", FT_BOOLEAN, 8, TFS(&tfs_yes_no), CNF_MORE_SEGS, NULL, HFILL }},

        { &hf_clnp_cnf_report_error,
            { "Report error if PDU discarded", "clnp.cnf.report_error", FT_BOOLEAN, 8, TFS(&tfs_yes_no), CNF_ERR_OK, NULL, HFILL }},

        { &hf_clnp_cnf_type,
            { "Type", "clnp.cnf.type", FT_UINT8, BASE_DEC, VALS(npdu_type_vals), CNF_TYPE, NULL, HFILL }},

        { &hf_clnp_pdu_length,
            { "PDU length", "clnp.pdu.len",  FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},

        { &hf_clnp_checksum,
            { "Checksum", "clnp.checksum", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},

        { &hf_clnp_dest_length,
            { "DAL", "clnp.dsap.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

        { &hf_clnp_dest,
            { "DA", "clnp.dsap",     FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},

        { &hf_clnp_src_length,
            { "SAL", "clnp.ssap.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

        { &hf_clnp_src,
            { "SA", "clnp.ssap",     FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},

        { &hf_clnp_atntt,
            { "ATN traffic type", "clnp.atn.tt",     FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

        { &hf_clnp_atnsc,
            { "ATN security classification", "clnp.atn.sc",     FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

        { &hf_clnp_segment_overlap,
            { "Segment overlap", "clnp.segment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
                "Segment overlaps with other segments", HFILL }},

        { &hf_clnp_segment_overlap_conflict,
            { "Conflicting data in segment overlap", "clnp.segment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
                "Overlapping segments contained conflicting data", HFILL }},

        { &hf_clnp_segment_multiple_tails,
            { "Multiple tail segments found", "clnp.segment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
                "Several tails were found when reassembling the packet", HFILL }},

        { &hf_clnp_segment_too_long_segment,
            { "Segment too long", "clnp.segment.toolongsegment", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
                "Segment contained data past end of packet", HFILL }},

        { &hf_clnp_segment_error,
            { "Reassembly error", "clnp.segment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
                "Reassembly error due to illegal segments", HFILL }},

        { &hf_clnp_segment_count,
            { "Segment count", "clnp.segment.count", FT_UINT32, BASE_DEC, NULL, 0x0,
                NULL, HFILL }},

        { &hf_clnp_segment,
            { "CLNP Segment", "clnp.segment", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
                NULL, HFILL }},

        { &hf_clnp_segments,
            { "CLNP Segments", "clnp.segments", FT_NONE, BASE_NONE, NULL, 0x0,
                NULL, HFILL }},

        { &hf_clnp_reassembled_in,
            { "Reassembled CLNP in frame", "clnp.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
                "This CLNP packet is reassembled in this frame", HFILL }},

        { &hf_clnp_reassembled_length,
            { "Reassembled CLNP length", "clnp.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0,
                "The total length of the reassembled payload", HFILL }}
    };
    static gint *ett[] = {
        &ett_clnp,
        &ett_clnp_type,
        &ett_clnp_segments,
        &ett_clnp_segment,
        &ett_clnp_disc_pdu,
    };

    static ei_register_info ei[] = {
        { &ei_clnp_length, { "clnp.len.bad", PI_MALFORMED, PI_ERROR, "Header length value bad", EXPFILL }},
    };

    module_t *clnp_module;
    expert_module_t* expert_clnp;

    proto_clnp = proto_register_protocol(PROTO_STRING_CLNP, "CLNP", "clnp");
    proto_register_field_array(proto_clnp, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_clnp = expert_register_protocol(proto_clnp);
    expert_register_field_array(expert_clnp, ei, array_length(ei));
    register_dissector("clnp", dissect_clnp, proto_clnp);
    register_heur_dissector_list("clnp", &clnp_heur_subdissector_list);
    register_init_routine(clnp_reassemble_init);

    clnp_module = prefs_register_protocol(proto_clnp, NULL);
    prefs_register_uint_preference(clnp_module, "tp_nsap_selector",
            "NSAP selector for Transport Protocol (last byte in hex)",
            "NSAP selector for Transport Protocol (last byte in hex)",
            16, &tp_nsap_selector);
    prefs_register_bool_preference(clnp_module, "always_decode_transport",
            "Always try to decode NSDU as transport PDUs",
            "Always try to decode NSDU as transport PDUs",
            &always_decode_transport);
    prefs_register_bool_preference(clnp_module, "reassemble",
            "Reassemble segmented CLNP datagrams",
            "Whether segmented CLNP datagrams should be reassembled",
            &clnp_reassemble);
    prefs_register_bool_preference(clnp_module, "decode_atn_options",
            "Decode ATN security label",
            "Whether ATN security label should be decoded",
            &clnp_decode_atn_options);
}
Ejemplo n.º 16
0
void
proto_register_adwin(void)
{
	static hf_register_info hf[] = {
		{ &hf_adwin_address,
		  { "memory address", "adwin.address",
		    FT_UINT32, BASE_HEX, NULL, 0x0,
		    "Memory address to read on DSP", HFILL }
		},
		{ &hf_adwin_armVersion,
		  { "Get ARM Version", "adwin.armVersion",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_binfilesize,
		  { "File size", "adwin.binfilesize",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    "Size of binary file", HFILL }
		},
		{ &hf_adwin_blocksize,
		  { "Blocksize", "adwin.blocksize",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    "Maximum number of unacknowledged packets", HFILL }
		},
		{ &hf_adwin_complete_packets,
		  { "Complete packets", "adwin.complete_packets",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    "Highest sequential package number", HFILL }
		},
		{ &hf_adwin_count,
		  { "Count", "adwin.count",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    "Number of longs", HFILL }
		},
		{ &hf_adwin_data_int,
		  { "Data element int", "adwin.data_int",
		    FT_INT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_data_float,
		  { "Data element float", "adwin.data_float",
		    FT_FLOAT, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_data_hex,
		  { "Data element hex", "adwin.data_hex",
		    FT_UINT32, BASE_HEX, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_data_no16,
		  { "Data No. (16bit)", "adwin.data",
		    FT_UINT16, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_data_no32,
		  { "Data No. (32bit)", "adwin.data",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_data_type,
		  { "Data type", "adwin.data_type",
		    FT_UINT32, BASE_DEC|BASE_EXT_STRING, &data_type_mapping_ext, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_data_packet_index,
		  { "Data packet index", "adwin.data_packet_index",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_dll_version,
		  { "DLL Version", "adwin.dll_version",
		    FT_STRINGZ, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_fifo_no16,
		  { "FiFo No. (16bit)", "adwin.fifo_no",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_fifo_no32,
		  { "FiFo No. (32bit)", "adwin.fifo_no",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_instruction,
		  { "Instruction", "adwin.instruction",
		    FT_UINT32, BASE_DEC|BASE_EXT_STRING, &instruction_mapping_ext, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_is_range,
		  { "packets are a range", "adwin.is_range",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_i3plus1,
		  { "3+1 Instruction", "adwin.i3plus1",
		    FT_UINT32, BASE_DEC|BASE_EXT_STRING, &instruction_3plus1_mapping_ext, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_link_addr,
		  { "Link address", "adwin.link_addr",
		    FT_UINT32, BASE_HEX, NULL, 0x0,
		    "Link address (TCP/IP Server only)", HFILL }
		},
		{ &hf_adwin_mem_type,
		  { "Memory type", "adwin.mem_type",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_memsize,
		  { "Memory size", "adwin.memsize",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_osys,
		  { "Operating system", "adwin.osys",
		    FT_UINT32, BASE_DEC|BASE_EXT_STRING, &osys_mapping_ext, 0x0,
		    "Operating system / environment", HFILL }
		},
		{ &hf_adwin_packet_end,
		  { "End packet", "adwin.packet_end",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    "GDSH: End Packet", HFILL }
		},
		{ &hf_adwin_packet_index,
		  { "Packet index", "adwin.packet_index",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_packet_no,
		  { "Packet No.", "adwin.packet_no",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_packet_start,
		  { "Starting packet", "adwin.packet_start",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    "GDSH: Starting Packet", HFILL }
		},
		{ &hf_adwin_packet_type,
		  { "Packet type", "adwin.packet_type",
		    FT_INT32, BASE_DEC|BASE_EXT_STRING, &packet_type_mapping_ext, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_parameter,
		  { "Parameter", "adwin.parameter",
		    FT_UINT32, BASE_DEC|BASE_EXT_STRING, &parameter_mapping_ext, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_password,
		  { "Password", "adwin.password",
		    FT_STRING, BASE_NONE, NULL, 0x0,
		    "Password for ADwin system", HFILL }
		},
		{ &hf_adwin_process_no,
		  { "Process No.", "adwin.process_no",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_processor,
		  { "Processor", "adwin.processor",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_response_in,
		  { "Response In", "adwin.response_in",
		    FT_FRAMENUM, BASE_NONE, NULL, 0x0,
		    "The response to this ADwin request is in this frame", HFILL }
		},
		{ &hf_adwin_response_to,
		  { "Request In", "adwin.response_to",
		    FT_FRAMENUM, BASE_NONE, NULL, 0x0,
		    "This is a response to the ADwin request in this frame", HFILL }
		},
		{ &hf_adwin_response_time,
		  { "Response time", "adwin.response_time",
		    FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
		    "The time between the Request and the Reply", HFILL }
		},
		{ &hf_adwin_retry_packet_index,
		  { "Retry packet index", "adwin.retry_packet_index",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_request_no,
		  { "Request Number", "adwin.request_no",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    "Request number index", HFILL }
		},
		{ &hf_adwin_start_index,
		  { "Start index", "adwin.start_index",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_status,
		  { "Status", "adwin.status",
		    FT_INT32, BASE_DEC|BASE_EXT_STRING, &error_code_mapping_ext, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_timeout,
		  { "Timeout", "adwin.timeout",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    "Timeout in ms", HFILL }
		},
		{ &hf_adwin_unused,
		  { "Unused", "adwin.unused",
		    FT_NONE, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }
		},
		{ &hf_adwin_val1,
		  { "Value 1 (as int)", "adwin.val1",
		    FT_INT32, BASE_DEC, NULL, 0x0,
		    "Generic return value 1 interpreted as integer (correct interpretation depends on request).", HFILL }
		},
		{ &hf_adwin_val1f,
		  { "Value 1 (as float)", "adwin.val1f",
		    FT_FLOAT, BASE_NONE, NULL, 0x0,
		    "Generic return value 1 interpreted as float (correct interpretation depends on request).", HFILL }
		},
		{ &hf_adwin_val2,
		  { "Value 2", "adwin.val2",
		    FT_INT32, BASE_DEC, NULL, 0x0,
		    "Generic return value 2 (interpretation depends on request).", HFILL }
		},
		{ &hf_adwin_val3,
		  { "Value 3", "adwin.val3",
		    FT_INT32, BASE_DEC, NULL, 0x0,
		    "Generic return value 3 (interpretation depends on request).", HFILL }
		},
		{ &hf_adwin_val4,
		  { "Value 4", "adwin.val4",
		    FT_INT32, BASE_DEC, NULL, 0x0,
		    "Generic return value 4 (interpretation depends on request).", HFILL }
		},
	};

	/* Setup protocol subtree array */
	static gint *ett[] = {
		&ett_adwin,
		&ett_adwin_debug,
	};
	module_t *adwin_module;

	/* Register the protocol name and description */
	proto_adwin = proto_register_protocol("ADwin communication protocol",
					      "ADwin", "adwin");

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

	/* Register our configuration options for ADwin, particularly
	   our port */
	adwin_module = prefs_register_protocol(proto_adwin, proto_reg_handoff_adwin);

	prefs_register_uint_preference(adwin_module, "udp.port", "ADwin UDP Port",
				       "Set the UDP port for ADwin packets (if other"
				       " than the default of 6543)",
				       10, &global_adwin_udp_port);

	prefs_register_bool_preference(adwin_module, "dissect_data",
				       "Dissect Data sections",
				       "Specify if the Data sections of packets "
				       "should be dissected or not",
				       &global_adwin_dissect_data);
}
Ejemplo n.º 17
0
void
proto_register_adb_service(void)
{
    module_t         *module;
    expert_module_t  *expert_module;

    static hf_register_info hf[] = {
        { &hf_service,
            { "Service",                         "adb_service.service",
            FT_STRING, STR_ASCII, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_fragment,
            { "Fragment",                        "adb_service.fragment",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_data,
            { "Data",                            "adb_service.data",
            FT_BYTES, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_hex_ascii_length,
            { "Hex ASCII String Length",         "adb_service.hex_ascii_length",
            FT_STRING, STR_ASCII, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_length,
            { "Length",                          "adb_service.length",
            FT_UINT32, BASE_DEC_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_version,
            { "Version",                         "adb_service.framebuffer.version",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_hex_ascii_version,
            { "Hex ASCII String Version",        "adb_service.hex_ascii_version",
            FT_STRING, STR_ASCII, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_version,
            { "Version",                         "adb_service.version",
            FT_UINT32, BASE_DEC_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_depth,
            { "Depth",                           "adb_service.framebuffer.depth",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_size,
            { "Size",                           "adb_service.framebuffer.size",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_width,
            { "Width",                           "adb_service.framebuffer.width",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_height,
            { "Height",                          "adb_service.framebuffer.height",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_red_offset,
            { "Red Offset",                      "adb_service.framebuffer.red_offset",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_red_length,
            { "Red Length",                      "adb_service.framebuffer.red_length",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_blue_offset,
            { "Blue Offset",                     "adb_service.framebuffer.blue_offset",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_blue_length,
            { "Blue Length",                     "adb_service.framebuffer.blue_length",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_green_offset,
            { "Green Offset",                    "adb_service.framebuffer.green_offset",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_green_length,
            { "Green Length",                    "adb_service.framebuffer.green_length",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_alpha_offset,
            { "Alpha Offset",                    "adb_service.framebuffer.alpha_offset",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_alpha_length,
            { "Alpha Length",                    "adb_service.framebuffer.alpha_length",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_pixel,
            { "Pixel",                           "adb_service.framebuffer.pixel",
            FT_NONE, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_blue_5,
            { "Blue",                            "adb_service.framebuffer.pixel.blue",
            FT_UINT16, BASE_DEC, NULL, 0xF800,
            NULL, HFILL }
        },
        { &hf_framebuffer_green_6,
            { "Green",                           "adb_service.framebuffer.pixel.green",
            FT_UINT16, BASE_DEC, NULL, 0x07E0,
            NULL, HFILL }
        },
        { &hf_framebuffer_red_5,
            { "Red",                             "adb_service.framebuffer.pixel.red",
            FT_UINT16, BASE_DEC, NULL, 0x001F,
            NULL, HFILL }
        },
        { &hf_framebuffer_blue,
            { "Blue",                            "adb_service.framebuffer.pixel.blue",
            FT_UINT8, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_green,
            { "Green",                           "adb_service.framebuffer.pixel.green",
            FT_UINT8, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_red,
            { "Red",                             "adb_service.framebuffer.pixel.red",
            FT_UINT8, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_alpha,
            { "Alpha",                           "adb_service.framebuffer.pixel.alpha",
            FT_UINT8, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_framebuffer_unused,
            { "Unused",                          "adb_service.framebuffer.pixel.unused",
            FT_UINT8, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_devices,
            { "Devices",                         "adb_service.devices",
            FT_STRING, STR_ASCII, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_stdin,
            { "Stdin",                           "adb_service.stdin",
            FT_STRING, STR_ASCII, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_stdout,
            { "Stdout",                          "adb_service.stdout",
            FT_STRING, STR_ASCII, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_result,
            { "Result",                          "adb_service.result",
            FT_STRING, STR_ASCII, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_pids,
            { "PIDs",                            "adb_service.pids",
            FT_STRING, STR_ASCII, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sync_id,
            { "Id",                              "adb_service.sync.id",
            FT_STRING, STR_ASCII, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sync_length,
            { "Length",                          "adb_service.sync.length",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sync_mode,
            { "Mode",                            "adb_service.sync.mode",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sync_size,
            { "Size",                            "adb_service.sync.size",
            FT_UINT32, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sync_time,
            { "Last Modification Time",          "adb_service.sync.time",
            FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sync_unused,
            { "Unused",                          "adb_service.sync.unused",
            FT_BYTES, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_sync_data,
            { "Sync Data",                       "adb_service.sync.data",
            FT_BYTES, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
    };

    static gint *ett[] = {
        &ett_adb_service,
        &ett_length,
        &ett_version,
        &ett_pixel,
        &ett_data
    };

    static ei_register_info ei[] = {
        { &ei_incomplete_message,         { "adb_service.expert.incomplete_message", PI_PROTOCOL, PI_WARN, "Incomplete message", EXPFILL }},
    };

    fragments          = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
    framebuffer_infos  = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
    continuation_infos = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());

    proto_adb_service = proto_register_protocol("Android Debug Bridge Service", "ADB Service", "adb_service");
    adb_service_handle = register_dissector("adb_service", dissect_adb_service, proto_adb_service);

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

    module = prefs_register_protocol(proto_adb_service, NULL);
    prefs_register_static_text_preference(module, "version",
            "ADB Service protocol version is compatible prior to: adb 1.0.31",
            "Version of protocol supported by this dissector.");

    prefs_register_bool_preference(module, "framebuffer_more_details",
            "Dissect more detail for framebuffer service",
            "Dissect more detail for framebuffer service",
            &pref_dissect_more_detail_framebuffer);
}
Ejemplo n.º 18
0
void
proto_register_tpkt(void)
{
    static hf_register_info hf[] = {
        {
            &hf_tpkt_version,
            {
                "Version",
                "tpkt.version",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "Version, only version 3 is defined", HFILL
            }
        },
        {
            &hf_tpkt_reserved,
            {
                "Reserved",
                "tpkt.reserved",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "Reserved, should be 0", HFILL
            }
        },
        {
            &hf_tpkt_length,
            {
                "Length",
                "tpkt.length",
                FT_UINT16,
                BASE_DEC,
                NULL,
                0x0,
                "Length of data unit, including this header", HFILL
            }
        },
        {
            &hf_tpkt_continuation_data,
            {
                "Continuation data",
                "tpkt.continuation_data",
                FT_BYTES,
                BASE_NONE,
                NULL,
                0x0,
                NULL, HFILL
            }
        },
    };

    static gint *ett[] =
    {
        &ett_tpkt,
    };
    module_t *tpkt_module;

    proto_tpkt = proto_register_protocol("TPKT - ISO on TCP - RFC1006", "TPKT", "tpkt");
    proto_tpkt_ptr = find_protocol_by_id(proto_tpkt);
    proto_register_field_array(proto_tpkt, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    register_dissector("tpkt", dissect_tpkt, proto_tpkt);

    tpkt_module = prefs_register_protocol(proto_tpkt, NULL);
    prefs_register_bool_preference(tpkt_module, "desegment",
        "Reassemble TPKT messages spanning multiple TCP segments",
        "Whether the TPKT dissector should reassemble messages spanning multiple TCP segments. "
        "To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
        &tpkt_desegment);
}
Ejemplo n.º 19
0
/* Register all the bits needed with the filtering engine */
void
proto_register_pgm(void)
{
	static hf_register_info hf[] = {
		{ &hf_pgm_main_sport,
		  { "Source Port", "pgm.hdr.sport", FT_UINT16, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_main_dport,
		  { "Destination Port", "pgm.hdr.dport", FT_UINT16, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_port,
		  { "Port", "pgm.port", FT_UINT16, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_main_type,
		  { "Type", "pgm.hdr.type", FT_UINT8, BASE_HEX,
		    VALS(type_vals), 0x0, NULL, HFILL }},
		{ &hf_pgm_main_opts,
		  { "Options", "pgm.hdr.opts", FT_UINT8, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_main_opts_opt,
		  { "Options", "pgm.hdr.opts.opt", FT_BOOLEAN, 8,
		    TFS(&opts_present), PGM_OPT, NULL, HFILL }},
		{ &hf_pgm_main_opts_netsig,
		  { "Network Significant Options", "pgm.hdr.opts.netsig",
		    FT_BOOLEAN, 8,
		    TFS(&opts_present), PGM_OPT_NETSIG, NULL, HFILL }},
		{ &hf_pgm_main_opts_varlen,
		  { "Variable length Parity Packet Option", "pgm.hdr.opts.varlen",
		    FT_BOOLEAN, 8,
		    TFS(&opts_present), PGM_OPT_VAR_PKTLEN, NULL, HFILL }},
		{ &hf_pgm_main_opts_parity,
		  { "Parity", "pgm.hdr.opts.parity", FT_BOOLEAN, 8,
		    TFS(&opts_present), PGM_OPT_PARITY, NULL, HFILL }},
		{ &hf_pgm_main_cksum,
		  { "Checksum", "pgm.hdr.cksum", FT_UINT16, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_main_cksum_bad,
		  { "Bad Checksum", "pgm.hdr.cksum_bad", FT_BOOLEAN, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_main_gsi,
		  { "Global Source Identifier", "pgm.hdr.gsi", FT_BYTES, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_main_tsdulen,
		  { "Transport Service Data Unit Length", "pgm.hdr.tsdulen", FT_UINT16,
		    BASE_DEC, NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_spm_sqn,
		  { "Sequence number", "pgm.spm.sqn", FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_spm_trail,
		  { "Trailing Edge Sequence Number", "pgm.spm.trail", FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_spm_lead,
		  { "Leading Edge Sequence Number", "pgm.spm.lead", FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_spm_pathafi,
		  { "Path NLA AFI", "pgm.spm.pathafi", FT_UINT16, BASE_DEC,
		    VALS(afn_vals), 0x0, NULL, HFILL }},
		{ &hf_pgm_spm_res,
		  { "Reserved", "pgm.spm.res", FT_UINT16, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_spm_path,
		  { "Path NLA", "pgm.spm.path", FT_IPv4, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_spm_path6,
		  { "Path NLA", "pgm.spm.path", FT_IPv6, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
#if 0
		{ &hf_pgm_data_sqn,
		  { "Data Packet Sequence Number", "pgm.data.sqn", FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
#endif
#if 0
		{ &hf_pgm_data_trail,
		  { "Trailing Edge Sequence Number", "pgm.data.trail", FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
#endif
		{ &hf_pgm_nak_sqn,
		  { "Requested Sequence Number", "pgm.nak.sqn", FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_nak_srcafi,
		  { "Source NLA AFI", "pgm.nak.srcafi", FT_UINT16, BASE_DEC,
		    VALS(afn_vals), 0x0, NULL, HFILL }},
		{ &hf_pgm_nak_srcres,
		  { "Reserved", "pgm.nak.srcres", FT_UINT16, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_nak_src,
		  { "Source NLA", "pgm.nak.src", FT_IPv4, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_nak_src6,
		  { "Source NLA", "pgm.nak.src", FT_IPv6, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_nak_grpafi,
		  { "Multicast Group AFI", "pgm.nak.grpafi", FT_UINT16, BASE_DEC,
		    VALS(afn_vals), 0x0, NULL, HFILL }},
		{ &hf_pgm_nak_grpres,
		  { "Reserved", "pgm.nak.grpres", FT_UINT16, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_nak_grp,
		  { "Multicast Group NLA", "pgm.nak.grp", FT_IPv4, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_nak_grp6,
		  { "Multicast Group NLA", "pgm.nak.grp", FT_IPv6, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_poll_sqn,
		  { "Sequence Number", "pgm.poll.sqn", FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_poll_round,
		  { "Round", "pgm.poll.round", FT_UINT16, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_poll_subtype,
		  { "Subtype", "pgm.poll.subtype", FT_UINT16, BASE_HEX,
		    VALS(poll_subtype_vals), 0x0, NULL, HFILL }},
		{ &hf_pgm_poll_pathafi,
		  { "Path NLA AFI", "pgm.poll.pathafi", FT_UINT16, BASE_DEC,
		    VALS(afn_vals), 0x0, NULL, HFILL }},
		{ &hf_pgm_poll_res,
		  { "Reserved", "pgm.poll.res", FT_UINT16, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_poll_path,
		  { "Path NLA", "pgm.poll.path", FT_IPv4, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_poll_path6,
		  { "Path NLA", "pgm.poll.path", FT_IPv6, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_poll_backoff_ivl,
		  { "Back-off Interval", "pgm.poll.backoff_ivl", FT_UINT32, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_poll_rand_str,
		  { "Random String", "pgm.poll.rand_str", FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_poll_matching_bmask,
		  { "Matching Bitmask", "pgm.poll.matching_bmask", FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_polr_sqn,
		  { "Sequence Number", "pgm.polr.sqn", FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_polr_round,
		  { "Round", "pgm.polr.round", FT_UINT16, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_polr_res,
		  { "Reserved", "pgm.polr.res", FT_UINT16, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_ack_sqn,
		  { "Maximum Received Sequence Number", "pgm.ack.maxsqn", FT_UINT32,
		    BASE_HEX, NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_ack_bitmap,
		  { "Packet Bitmap", "pgm.ack.bitmap", FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_type,
		  { "Type", "pgm.opts.type", FT_UINT8, BASE_HEX,
		    VALS(opt_vals), 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_len,
		  { "Length", "pgm.opts.len", FT_UINT8, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_tlen,
		  { "Total Length", "pgm.opts.tlen", FT_UINT16, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_genopt_end,
		  { "Option end", "pgm.genopts.end", FT_BOOLEAN, 8,
		    TFS(&tfs_yes_no), 0x80, NULL, HFILL }},
		{ &hf_pgm_genopt_type,
		  { "Type", "pgm.genopts.type", FT_UINT8, BASE_HEX,
		    VALS(opt_vals), 0x7f, NULL, HFILL }},
		{ &hf_pgm_genopt_len,
		  { "Length", "pgm.genopts.len", FT_UINT8, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_genopt_opx,
		  { "Option Extensibility Bits", "pgm.genopts.opx", FT_UINT8, BASE_HEX,
		    VALS(opx_vals), 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_parity_prm_po,
		  { "Parity Parameters", "pgm.opts.parity_prm.op", FT_UINT8, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_parity_prm_prmtgsz,
		  { "Transmission Group Size", "pgm.opts.parity_prm.prm_grp",
		    FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_join_res,
		  { "Reserved", "pgm.opts.join.res", FT_UINT8, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_join_minjoin,
		  { "Minimum Sequence Number", "pgm.opts.join.min_join",
		    FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_parity_grp_res,
		  { "Reserved", "pgm.opts.parity_prm.op", FT_UINT8, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_parity_grp_prmgrp,
		  { "Transmission Group Size", "pgm.opts.parity_prm.prm_grp",
		    FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_nak_res,
		  { "Reserved", "pgm.opts.nak.op", FT_UINT8, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_nak_list,
		  { "List", "pgm.opts.nak.list", FT_BYTES, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_ccdata_res,
		  { "Reserved", "pgm.opts.ccdata.res", FT_UINT8, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_ccdata_tsp,
		  { "Time Stamp", "pgm.opts.ccdata.tstamp", FT_UINT16, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_ccdata_afi,
		  { "Acker AFI", "pgm.opts.ccdata.afi", FT_UINT16, BASE_DEC,
		    VALS(afn_vals), 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_ccdata_res2,
		  { "Reserved", "pgm.opts.ccdata.res2", FT_UINT16, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_ccdata_acker,
		  { "Acker", "pgm.opts.ccdata.acker", FT_IPv4, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_ccdata_acker6,
		  { "Acker", "pgm.opts.ccdata.acker", FT_IPv6, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_ccfeedbk_res,
		  { "Reserved", "pgm.opts.ccdata.res", FT_UINT8, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_ccfeedbk_tsp,
		  { "Time Stamp", "pgm.opts.ccdata.tstamp", FT_UINT16, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_ccfeedbk_afi,
		  { "Acker AFI", "pgm.opts.ccdata.afi", FT_UINT16, BASE_DEC,
		    VALS(afn_vals), 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_ccfeedbk_lossrate,
		  { "Loss Rate", "pgm.opts.ccdata.lossrate", FT_UINT16, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_ccfeedbk_acker,
		  { "Acker", "pgm.opts.ccdata.acker", FT_IPv4, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_ccfeedbk_acker6,
		  { "Acker", "pgm.opts.ccdata.acker", FT_IPv6, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_nak_bo_ivl_res,
		  { "Reserved", "pgm.opts.nak_bo_ivl.res", FT_UINT8, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_nak_bo_ivl_bo_ivl,
		  { "Back-off Interval", "pgm.opts.nak_bo_ivl.bo_ivl", FT_UINT32, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_nak_bo_ivl_bo_ivl_sqn,
		  { "Back-off Interval Sequence Number", "pgm.opts.nak_bo_ivl.bo_ivl_sqn", FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_nak_bo_rng_res,
		  { "Reserved", "pgm.opts.nak_bo_rng.res", FT_UINT8, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_nak_bo_rng_min_bo_ivl,
		  { "Min Back-off Interval", "pgm.opts.nak_bo_rng.min_bo_ivl", FT_UINT32, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_nak_bo_rng_max_bo_ivl,
		  { "Max Back-off Interval", "pgm.opts.nak_bo_rng.max_bo_ivl", FT_UINT32, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_redirect_res,
		  { "Reserved", "pgm.opts.redirect.res", FT_UINT8, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_redirect_afi,
		  { "DLR AFI", "pgm.opts.redirect.afi", FT_UINT16, BASE_DEC,
		    VALS(afn_vals), 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_redirect_res2,
		  { "Reserved", "pgm.opts.redirect.res2", FT_UINT16, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_redirect_dlr,
		  { "DLR", "pgm.opts.redirect.dlr", FT_IPv4, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_redirect_dlr6,
		  { "DLR", "pgm.opts.redirect.dlr", FT_IPv6, BASE_NONE,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_fragment_res,
		  { "Reserved", "pgm.opts.fragment.res", FT_UINT8, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_fragment_first_sqn,
		  { "First Sequence Number", "pgm.opts.fragment.first_sqn", FT_UINT32, BASE_HEX,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_fragment_offset,
		  { "Fragment Offset", "pgm.opts.fragment.fragment_offset", FT_UINT32, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }},
		{ &hf_pgm_opt_fragment_total_length,
		  { "Total Length", "pgm.opts.fragment.total_length", FT_UINT32, BASE_DEC,
		    NULL, 0x0, NULL, HFILL }}
	};
	static gint *ett[] = {
		&ett_pgm,
		&ett_pgm_optbits,
		&ett_pgm_spm,
		&ett_pgm_data,
		&ett_pgm_nak,
		&ett_pgm_poll,
		&ett_pgm_polr,
		&ett_pgm_ack,
		&ett_pgm_opts,
		&ett_pgm_opts_join,
		&ett_pgm_opts_parityprm,
		&ett_pgm_opts_paritygrp,
		&ett_pgm_opts_naklist,
		&ett_pgm_opts_ccdata,
		&ett_pgm_opts_nak_bo_ivl,
		&ett_pgm_opts_nak_bo_rng,
		&ett_pgm_opts_redirect,
		&ett_pgm_opts_fragment
	};
	static ei_register_info ei[] = {
		{ &ei_pgm_opt_type, { "pgm.opts.type.invalid", PI_PROTOCOL, PI_WARN, "Invalid option", EXPFILL }},
		{ &ei_pgm_opt_tlen, { "pgm.opts.tlen.invalid", PI_PROTOCOL, PI_WARN, "Total Length invalid", EXPFILL }},
		{ &ei_pgm_genopt_len, { "pgm.genopts.len.invalid", PI_PROTOCOL, PI_WARN, "Option length invalid", EXPFILL }},
		{ &ei_address_format_invalid, { "pgm.address_format_invalid", PI_PROTOCOL, PI_WARN, "Can't handle this address format", EXPFILL }},
	};

	module_t *pgm_module;
	expert_module_t* expert_pgm;

	proto_pgm = proto_register_protocol("Pragmatic General Multicast",
					    "PGM", "pgm");

	proto_register_field_array(proto_pgm, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));
	expert_pgm = expert_register_protocol(proto_pgm);
	expert_register_field_array(expert_pgm, ei, array_length(ei));

	/* subdissector code */
	subdissector_table = register_dissector_table("pgm.port",
						      "PGM port", FT_UINT16, BASE_DEC);
	heur_subdissector_list = register_heur_dissector_list("pgm");

	/*
	 * Register configuration preferences for UDP encapsulation
	 * (Note: Initially the ports are set to zero and the ports
	 *        are not registered so the dissecting of PGM
	 *        encapsulated in UDP packets is off by default;
	 *        dissector_add_for_decode_as is called so that pgm
	 *        is available for 'decode-as'
	 */
	pgm_module = prefs_register_protocol(proto_pgm, proto_reg_handoff_pgm);

	prefs_register_bool_preference(pgm_module, "check_checksum",
				       "Check the validity of the PGM checksum when possible",
				       "Whether to check the validity of the PGM checksum",
				       &pgm_check_checksum);

	prefs_register_uint_preference(pgm_module, "udp.encap_ucast_port",
				       "PGM Encap Unicast Port (standard is 3055)",
				       "PGM Encap is PGM packets encapsulated in UDP packets"
				       " (Note: This option is off, i.e. port is 0, by default)",
				       10, &udp_encap_ucast_port);

	prefs_register_uint_preference(pgm_module, "udp.encap_mcast_port",
				       "PGM Encap Multicast Port (standard is 3056)",
				       "PGM Encap is PGM packets encapsulated in UDP packets"
				       " (Note: This option is off, i.e. port is 0, by default)",
				       10, &udp_encap_mcast_port);

}
Ejemplo n.º 20
0
void
proto_register_mtp3(void)
{

  /* Setup list of header fields  See Section 1.6.1 for details*/
  static hf_register_info hf[] = {
    { &hf_mtp3_service_indicator,     { "Service indicator",        "mtp3.service_indicator", FT_UINT8,  BASE_HEX,  VALS(mtp3_service_indicator_code_vals), SERVICE_INDICATOR_MASK,     NULL, HFILL }},
    { &hf_mtp3_network_indicator,     { "Network indicator",        "mtp3.network_indicator", FT_UINT8,  BASE_HEX,  VALS(mtp3_network_indicator_vals),      NETWORK_INDICATOR_MASK,     NULL, HFILL }},
    { &hf_mtp3_itu_spare,             { "Spare",                    "mtp3.spare",             FT_UINT8,  BASE_HEX,  NULL,                                   SPARE_MASK,                 NULL, HFILL }},
    { &hf_mtp3_itu_priority,          { "ITU priority",             "mtp3.priority",          FT_UINT8,  BASE_DEC,  NULL,                                   SPARE_MASK,                 NULL, HFILL }},
    { &hf_mtp3_ansi_priority,         { "ANSI Priority",            "mtp3.priority",          FT_UINT8,  BASE_DEC,  NULL,                                   ANSI_PRIORITY_MASK,         NULL, HFILL }},
    { &hf_mtp3_itu_opc,               { "OPC",                      "mtp3.opc",               FT_UINT32, BASE_DEC,  NULL,                                   ITU_OPC_MASK,               NULL, HFILL }},
    { &hf_mtp3_itu_pc,                { "PC",                       "mtp3.pc",                FT_UINT32, BASE_DEC,  NULL,                                   0x0,                        NULL, HFILL }},
    { &hf_mtp3_24bit_pc,              { "PC",                       "mtp3.pc",                FT_UINT32, BASE_DEC,  NULL,                                   ANSI_PC_MASK,               NULL, HFILL }},
    { &hf_mtp3_24bit_opc,             { "OPC",                      "mtp3.opc",               FT_UINT32, BASE_DEC,  NULL,                                   ANSI_PC_MASK,               NULL, HFILL }},
    { &hf_mtp3_ansi_opc,              { "OPC",                      "mtp3.ansi_opc",          FT_STRING, BASE_NONE, NULL,                                   0x0,                        NULL, HFILL }},
    { &hf_mtp3_chinese_opc,           { "OPC",                      "mtp3.chinese_opc",       FT_STRING, BASE_NONE, NULL,                                   0x0,                        NULL, HFILL }},
    { &hf_mtp3_opc_network,           { "OPC Network",              "mtp3.opc.network",       FT_UINT24, BASE_DEC,  NULL,                                   ANSI_NETWORK_MASK,          NULL, HFILL }},
    { &hf_mtp3_opc_cluster,           { "OPC Cluster",              "mtp3.opc.cluster",       FT_UINT24, BASE_DEC,  NULL,                                   ANSI_CLUSTER_MASK,          NULL, HFILL }},
    { &hf_mtp3_opc_member,            { "OPC Member",               "mtp3.opc.member",        FT_UINT24, BASE_DEC,  NULL,                                   ANSI_MEMBER_MASK,           NULL, HFILL }},
    { &hf_mtp3_japan_opc,             { "OPC",                      "mtp3.opc",               FT_UINT16, BASE_DEC,  NULL,                                   JAPAN_PC_MASK,              NULL, HFILL }},
    { &hf_mtp3_japan_pc,              { "PC",                       "mtp3.pc",                FT_UINT16, BASE_DEC,  NULL,                                   JAPAN_PC_MASK,              NULL, HFILL }},
    { &hf_mtp3_itu_dpc,               { "DPC",                      "mtp3.dpc",               FT_UINT32, BASE_DEC,  NULL,                                   ITU_DPC_MASK,               NULL, HFILL }},
    { &hf_mtp3_24bit_dpc,             { "DPC",                      "mtp3.dpc",               FT_UINT32, BASE_DEC,  NULL,                                   ANSI_PC_MASK,               NULL, HFILL }},
    { &hf_mtp3_ansi_dpc,              { "DPC",                      "mtp3.ansi_dpc",          FT_STRING, BASE_NONE, NULL,                                   0x0,                        NULL, HFILL }},
    { &hf_mtp3_chinese_dpc,           { "DPC",                      "mtp3.chinese_dpc",       FT_STRING, BASE_NONE, NULL,                                   0x0,                        NULL, HFILL }},
    { &hf_mtp3_dpc_network,           { "DPC Network",              "mtp3.dpc.network",       FT_UINT24, BASE_DEC,  NULL,                                   ANSI_NETWORK_MASK,          NULL, HFILL }},
    { &hf_mtp3_dpc_cluster,           { "DPC Cluster",              "mtp3.dpc.cluster",       FT_UINT24, BASE_DEC,  NULL,                                   ANSI_CLUSTER_MASK,          NULL, HFILL }},
    { &hf_mtp3_dpc_member,            { "DPC Member",               "mtp3.dpc.member",        FT_UINT24, BASE_DEC,  NULL,                                   ANSI_MEMBER_MASK,           NULL, HFILL }},
    { &hf_mtp3_japan_dpc,             { "DPC",                      "mtp3.dpc",               FT_UINT16, BASE_DEC,  NULL,                                   JAPAN_PC_MASK,              NULL, HFILL }},
    { &hf_mtp3_itu_sls,               { "Signalling Link Selector", "mtp3.sls",               FT_UINT32, BASE_DEC,  NULL,                                   ITU_SLS_MASK,               NULL, HFILL }},
    { &hf_mtp3_japan_4_bit_sls,       { "Signalling Link Selector", "mtp3.sls",               FT_UINT8,  BASE_DEC,  NULL,                                   JAPAN_4_BIT_SLS_MASK,       NULL, HFILL }},
    { &hf_mtp3_japan_4_bit_sls_spare, { "SLS Spare",                "mtp3.sls_spare",         FT_UINT8,  BASE_HEX,  NULL,                                   JAPAN_4_BIT_SLS_SPARE_MASK, NULL, HFILL }},
    { &hf_mtp3_japan_5_bit_sls,       { "Signalling Link Selector", "mtp3.sls",               FT_UINT8,  BASE_DEC,  NULL,                                   JAPAN_5_BIT_SLS_MASK,       NULL, HFILL }},
    { &hf_mtp3_japan_5_bit_sls_spare, { "SLS Spare",                "mtp3.sls_spare",         FT_UINT8,  BASE_HEX,  NULL,                                   JAPAN_5_BIT_SLS_SPARE_MASK, NULL, HFILL }},
    { &hf_mtp3_ansi_5_bit_sls,        { "Signalling Link Selector", "mtp3.sls",               FT_UINT8,  BASE_DEC,  NULL,                                   ANSI_5BIT_SLS_MASK,         NULL, HFILL }},
    { &hf_mtp3_ansi_8_bit_sls,        { "Signalling Link Selector", "mtp3.sls",               FT_UINT8,  BASE_DEC,  NULL,                                   ANSI_8BIT_SLS_MASK,         NULL, HFILL }},
    { &hf_mtp3_chinese_itu_sls,       { "Signalling Link Selector", "mtp3.sls",               FT_UINT8,  BASE_DEC,  NULL,                                   CHINESE_ITU_SLS_MASK,       NULL, HFILL }}
  };

  /* Setup protocol subtree array */
  static gint *ett[] = {
    &ett_mtp3,
    &ett_mtp3_sio,
    &ett_mtp3_label,
    &ett_mtp3_label_dpc,
    &ett_mtp3_label_opc
  };

  static const enum_val_t mtp3_options[] = {
    { "itu",		"ITU",		ITU_STANDARD },
    { "ansi",		"ANSI",		ANSI_STANDARD },
    { "chinese-itu",	"Chinese ITU",	CHINESE_ITU_STANDARD },
    { "japan",		"Japan",	JAPAN_STANDARD },
    { NULL,		NULL,		0 }
  };

  static const enum_val_t mtp3_addr_fmt_str_e[] = {
    { "decimal",	"Decimal",		MTP3_ADDR_FMT_DEC },
    { "hexadecimal",	"Hexadecimal",		MTP3_ADDR_FMT_HEX },
    { "ni-decimal",     "NI-Decimal",		MTP3_ADDR_FMT_NI_DEC },
    { "ni-hexadecimal", "NI-Hexadecimal",       MTP3_ADDR_FMT_NI_HEX },
    { "dashed",		"Dashed",		MTP3_ADDR_FMT_DASHED },
    { NULL,		NULL,			0 }
  };

  static const enum_val_t itu_pc_structures[] = {
    { "unstructured",	"Unstructured",	ITU_PC_STRUCTURE_NONE},
    { "3-8-3",		"3-8-3",	ITU_PC_STRUCTURE_3_8_3 },
    { "4-3-4-3",	"4-3-4-3",	ITU_PC_STRUCTURE_4_3_4_3 },
    { NULL,		NULL,		0 }
  };

  static const enum_val_t japan_pc_structures[] = {
    { "unstructured",	"Unstructured",	JAPAN_PC_STRUCTURE_NONE},
    { "7-4-5",		"7-4-5",	JAPAN_PC_STRUCTURE_7_4_5 },
    { "3-4-4-5",	"3-4-4-5",	JAPAN_PC_STRUCTURE_3_4_4_5 },
    { NULL,		NULL,		0 }
  };

 /* Register the protocol name and description */
  proto_mtp3 = proto_register_protocol("Message Transfer Part Level 3",
				       "MTP3", "mtp3");
  mtp3_handle = register_dissector("mtp3", dissect_mtp3, proto_mtp3);

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

  mtp3_sio_dissector_table = register_dissector_table("mtp3.service_indicator",
						      "MTP3 Service indicator",
						      FT_UINT8, BASE_HEX);

  mtp3_tap = register_tap("mtp3");

  mtp3_module = prefs_register_protocol(proto_mtp3, NULL);

  prefs_register_bool_preference(mtp3_module, "heuristic_standard",
				 "Try to determine the MTP3 standard heuristically",
				 "This only works for SCCP traffic for now",
				 &mtp3_heuristic_standard);

  prefs_register_enum_preference(mtp3_module, "standard", "MTP3 standard",
				 "The SS7 standard used in MTP3 packets",
				 &mtp3_standard, mtp3_options, FALSE);

  prefs_register_enum_preference(mtp3_module, "itu_pc_structure", "ITU Pointcode structure",
				 "The structure of the pointcodes in ITU networks",
				 &itu_pc_structure, itu_pc_structures, FALSE);

  prefs_register_enum_preference(mtp3_module, "japan_pc_structure", "Japan Pointcode structure",
				 "The structure of the pointcodes in Japan networks",
				 &japan_pc_structure, japan_pc_structures, FALSE);

  prefs_register_bool_preference(mtp3_module, "ansi_5_bit_sls",
				 "Use 5-bit SLS (ANSI only)",
				 "Use 5-bit (instead of 8-bit) SLS in ANSI MTP3 packets",
				 &mtp3_use_ansi_5_bit_sls);

  prefs_register_bool_preference(mtp3_module, "japan_5_bit_sls",
				 "Use 5-bit SLS (Japan only)",
				 "Use 5-bit (instead of 4-bit) SLS in Japan MTP3 packets",
				 &mtp3_use_japan_5_bit_sls);

  prefs_register_enum_preference(mtp3_module, "addr_format", "Address Format",
				 "Format for point code in the address columns",
				 &mtp3_addr_fmt, mtp3_addr_fmt_str_e, FALSE);

  prefs_register_bool_preference(mtp3_module, "itu_priority",
				 "Show MSU priority (national option, ITU and China ITU only)",
				 "Decode the spare bits of the SIO as the MSU priority (a national option in ITU)",
				 &mtp3_show_itu_priority);

}
Ejemplo n.º 21
0
void
proto_register_lapdm(void)
{
    static hf_register_info hf[] = {

        { &hf_lapdm_address,
        { "Address Field", "lapdm.address_field", FT_UINT8, BASE_HEX, NULL, 0x0,
        "Address", HFILL }},

        { &hf_lapdm_ea,
        { "EA", "lapdm.ea", FT_UINT8, BASE_DEC, VALS(lapdm_ea_vals), LAPDM_EA,
        "Address field extension bit", HFILL }},

        { &hf_lapdm_cr,
        { "C/R", "lapdm.cr", FT_UINT8, BASE_DEC, NULL, LAPDM_CR,
        "Command/response field bit", HFILL }},

        { &hf_lapdm_lpd,
        { "LPD", "lapdm.lpd", FT_UINT8, BASE_DEC, VALS(lapdm_lpd_vals), LAPDM_LPD,
        "Link Protocol Discriminator", HFILL }},

        { &hf_lapdm_sapi,
        { "SAPI", "lapdm.sapi", FT_UINT8, BASE_DEC, VALS(lapdm_sapi_vals), LAPDM_SAPI,
        "Service access point identifier", HFILL }},

        { &hf_lapdm_control,
        { "Control Field", "lapdm.control_field", FT_UINT8, BASE_HEX, NULL, 0x0,
        NULL, HFILL }},

        { &hf_lapdm_n_r,
        { "N(R)", "lapdm.control.n_r", FT_UINT8, BASE_DEC,
        NULL, XDLC_N_R_MASK, NULL, HFILL }},

        { &hf_lapdm_n_s,
        { "N(S)", "lapdm.control.n_s", FT_UINT8, BASE_DEC,
        NULL, XDLC_N_S_MASK, NULL, HFILL }},

        { &hf_lapdm_p,
        { "Poll", "lapdm.control.p", FT_BOOLEAN, 8,
        TFS(&tfs_true_false), XDLC_P_F, NULL, HFILL }},

        { &hf_lapdm_f,
        { "Final", "lapdm.control.f", FT_BOOLEAN, 8,
        TFS(&tfs_true_false), XDLC_P_F, NULL, HFILL }},

        { &hf_lapdm_s_ftype,
        { "Supervisory frame type", "lapdm.control.s_ftype", FT_UINT8, BASE_HEX,
        VALS(stype_vals), XDLC_S_FTYPE_MASK, NULL, HFILL }},

        { &hf_lapdm_u_modifier_cmd,
        { "Command", "lapdm.control.u_modifier_cmd", FT_UINT8, BASE_HEX,
        VALS(modifier_vals_cmd), XDLC_U_MODIFIER_MASK, NULL, HFILL }},

        { &hf_lapdm_u_modifier_resp,
        { "Response", "lapdm.control.u_modifier_resp", FT_UINT8, BASE_HEX,
        VALS(modifier_vals_resp), XDLC_U_MODIFIER_MASK, NULL, HFILL }},

        { &hf_lapdm_ftype_i,
        { "Frame type", "lapdm.control.ftype", FT_UINT8, BASE_HEX,
        VALS(ftype_vals), XDLC_I_MASK, NULL, HFILL }},

        { &hf_lapdm_ftype_s_u,
        { "Frame type", "lapdm.control.ftype", FT_UINT8, BASE_HEX,
        VALS(ftype_vals), XDLC_S_U_MASK, NULL, HFILL }},

        { &hf_lapdm_length,
        { "Length Field", "lapdm.length_field", FT_UINT8, BASE_HEX,
        NULL, 0x0, NULL, HFILL }},

        { &hf_lapdm_el,
        { "EL", "lapdm.el", FT_UINT8, BASE_DEC,
        VALS(lapdm_el_vals), LAPDM_EL, "Length indicator field extension bit", HFILL }},

        { &hf_lapdm_m,
        { "M", "lapdm.m", FT_UINT8, BASE_DEC,
        VALS(lapdm_m_vals), LAPDM_M, "More data bit", HFILL }},

        { &hf_lapdm_len,
        { "Length", "lapdm.length", FT_UINT8, BASE_DEC,
        NULL, LAPDM_LEN, "Length indicator", HFILL }},

	/* Fragment reassembly
	 */
        { &hf_lapdm_fragments,
        { "Message fragments", "lapdm.fragments", FT_NONE, BASE_NONE,
        NULL, 0x00, "LAPDm Message fragments", HFILL }},

        { &hf_lapdm_fragment,
        { "Message fragment", "lapdm.fragment", FT_FRAMENUM, BASE_NONE,
        NULL, 0x00, "LAPDm Message fragment", HFILL }},

        { &hf_lapdm_fragment_overlap,
        { "Message fragment overlap", "lapdm.fragment.overlap", FT_BOOLEAN, BASE_NONE,
        NULL, 0x0, "LAPDm Message fragment overlaps with other fragment(s)", HFILL }},

        { &hf_lapdm_fragment_overlap_conflicts,
        { "Message fragment overlapping with conflicting data", "lapdm.fragment.overlap.conflicts", FT_BOOLEAN, BASE_NONE,
        NULL, 0x0, "LAPDm Message fragment overlaps with conflicting data", HFILL }},

        { &hf_lapdm_fragment_multiple_tails,
        { "Message has multiple tail fragments", "lapdm.fragment.multiple_tails", FT_BOOLEAN, BASE_NONE,
        NULL, 0x0, "LAPDm Message fragment has multiple tail fragments", HFILL }},

        { &hf_lapdm_fragment_too_long_fragment,
        { "Message fragment too long", "lapdm.fragment.too_long_fragment", FT_BOOLEAN, BASE_NONE,
        NULL, 0x0, "LAPDm Message fragment data goes beyond the packet end", HFILL }},

        { &hf_lapdm_fragment_error,
        { "Message defragmentation error", "lapdm.fragment.error", FT_FRAMENUM, BASE_NONE,
        NULL, 0x00, "LAPDm Message defragmentation error due to illegal fragments", HFILL }},

        { &hf_lapdm_fragment_count,
        { "Message fragment count", "lapdm.fragment.count", FT_UINT32, BASE_DEC,
        NULL, 0x00, NULL, HFILL }},

        { &hf_lapdm_reassembled_in,
        { "Reassembled in", "lapdm.reassembled.in", FT_FRAMENUM, BASE_NONE,
	NULL, 0x00, "LAPDm Message has been reassembled in this packet.", HFILL }},

        { &hf_lapdm_reassembled_length,
        { "Reassembled LAPDm length", "lapdm.reassembled.length", FT_UINT32, BASE_DEC,
        NULL, 0x00, "The total length of the reassembled payload", HFILL }}

    };
    static gint *ett[] = {
        &ett_lapdm,
        &ett_lapdm_address,
        &ett_lapdm_control,
        &ett_lapdm_length,
        &ett_lapdm_fragment,
        &ett_lapdm_fragments
    };

    module_t *lapdm_module;

    proto_lapdm = proto_register_protocol("Link Access Procedure, Channel Dm (LAPDm)", "LAPDm", "lapdm");
    proto_register_field_array (proto_lapdm, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));

    register_dissector("lapdm", dissect_lapdm, proto_lapdm);

    lapdm_sapi_dissector_table = register_dissector_table("lapdm.sapi", "LAPDm SAPI", FT_UINT8, BASE_DEC);

    lapdm_module = prefs_register_protocol(proto_lapdm, NULL);
    prefs_register_bool_preference(lapdm_module, "reassemble",
        "Reassemble fragmented LAPDm packets",
        "Whether the dissector should defragment LAPDm messages spanning multiple packets.",
        &reassemble_lapdm);
    register_init_routine (lapdm_defragment_init);
}
Ejemplo n.º 22
0
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();
}
Ejemplo n.º 23
0
void
proto_register_beep(void)
{
  static hf_register_info hf[] = {
    { &hf_beep_proto_viol,
      { "Protocol Violation", "beep.violation", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_req,
      { "Request", "beep.req", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_req_chan,
      { "Request Channel Number", "beep.req.channel", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_rsp,
      { "Response", "beep.rsp", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_rsp_chan,
      { "Response Channel Number", "beep.rsp.channel", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_seq,
      { "Sequence", "beep.seq", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_seq_chan,
      { "Sequence Channel Number", "beep.seq.channel", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_end,
      { "End", "beep.end", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_complete,
      { "Complete", "beep.more.complete", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_intermediate,
      { "Intermediate", "beep.more.intermediate", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_msgno,
      { "Msgno", "beep.msgno", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_ansno,
      { "Ansno", "beep.ansno", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_seqno,
      { "Seqno", "beep.seqno", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_size,
      { "Size", "beep.size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_channel,
      { "Channel", "beep.channel", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_negative,
      { "Negative", "beep.status.negative", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_positive,
      { "Positive", "beep.status.positive", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_ackno,
      { "Ackno", "beep.seq.ackno", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},

    { &hf_beep_window,
      { "Window", "beep.seq.window", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},

  };
  static gint *ett[] = {
    &ett_beep,
    &ett_mime_header,
    &ett_header,
    &ett_trailer,
  };
  module_t *beep_module;

  proto_beep = proto_register_protocol("Blocks Extensible Exchange Protocol",
                                       "BEEP", "beep");

  proto_register_field_array(proto_beep, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  register_init_routine(&beep_init_protocol);

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

  beep_module = prefs_register_protocol(proto_beep, proto_reg_handoff_beep);

  prefs_register_uint_preference(beep_module, "tcp.port", "BEEP TCP Port",
                                 "Set the port for BEEP messages (if other"
                                 " than the default of 10288)",
                                 10, &global_beep_tcp_port);

  prefs_register_bool_preference(beep_module, "strict_header_terminator",
                                 "BEEP Header Requires CRLF",
                                 "Specifies that BEEP requires CRLF as a "
                                 "terminator, and not just CR or LF",
                                 &global_beep_strict_term);
}
Ejemplo n.º 24
0
void
proto_register_frame(void)
{
	static hf_register_info hf[] = {
		{ &hf_frame_arrival_time,
		  { "Arrival Time", "frame.time",
		    FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0,
		    "Absolute time when this frame was captured", HFILL }},

		{ &hf_frame_shift_offset,
		  { "Time shift for this packet", "frame.offset_shift",
		    FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
		    "Time shift applied to this packet", HFILL }},

		{ &hf_frame_arrival_time_epoch,
		  { "Epoch Time", "frame.time_epoch",
		    FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
		    "Epoch time when this frame was captured", HFILL }},

		{ &hf_frame_time_delta,
		  { "Time delta from previous captured frame", "frame.time_delta",
		    FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_time_delta_displayed,
		  { "Time delta from previous displayed frame", "frame.time_delta_displayed",
		    FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_time_relative,
		  { "Time since reference or first frame", "frame.time_relative",
		    FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
		    "Time relative to time reference or first frame", HFILL }},

		{ &hf_frame_time_reference,
		  { "This is a Time Reference frame", "frame.ref_time",
		    FT_NONE, BASE_NONE, NULL, 0x0,
		    "This frame is a Time Reference frame", HFILL }},

		{ &hf_frame_number,
		  { "Frame Number", "frame.number",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_len,
		  { "Frame length on the wire", "frame.len",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_capture_len,
		  { "Frame length stored into the capture file", "frame.cap_len",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_md5_hash,
		  { "Frame MD5 Hash", "frame.md5_hash",
		    FT_STRING, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_p2p_dir,
		  { "Point-to-Point Direction", "frame.p2p_dir",
		    FT_INT8, BASE_DEC, VALS(p2p_dirs), 0x0,
		    NULL, HFILL }},

		{ &hf_link_number,
		  { "Link Number", "frame.link_nr",
		    FT_UINT16, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_file_off,
		  { "File Offset", "frame.file_off",
		    FT_INT64, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_marked,
		  { "Frame is marked", "frame.marked",
		    FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    "Frame is marked in the GUI", HFILL }},

		{ &hf_frame_ignored,
		  { "Frame is ignored", "frame.ignored",
		    FT_BOOLEAN, BASE_NONE, NULL, 0x0,
		    "Frame is ignored by the dissectors", HFILL }},

		{ &hf_frame_protocols,
		  { "Protocols in frame", "frame.protocols",
		    FT_STRING, BASE_NONE, NULL, 0x0,
		    "Protocols carried by this frame", HFILL }},

		{ &hf_frame_color_filter_name,
		  { "Coloring Rule Name", "frame.coloring_rule.name",
		    FT_STRING, BASE_NONE, NULL, 0x0,
		    "The frame matched the coloring rule with this name", HFILL }},

		{ &hf_frame_color_filter_text,
		  { "Coloring Rule String", "frame.coloring_rule.string",
		    FT_STRING, BASE_NONE, NULL, 0x0,
		    "The frame matched this coloring rule string", HFILL }},

		{ &hf_frame_interface_id,
		  { "Interface id", "frame.interface_id",
		    FT_UINT32, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_pack_flags,
		  { "Packet flags", "frame.packet_flags",
		    FT_UINT32, BASE_HEX, NULL, 0x0,
		    NULL, HFILL }},

		{ &hf_frame_pack_direction,
		  { "Direction", "frame.packet_flags_direction",
		    FT_UINT32, BASE_HEX, VALS(packet_word_directions), PACKET_WORD_DIRECTION_MASK,
		    NULL, HFILL }},

		{ &hf_frame_pack_reception_type,
		  { "Reception type", "frame.packet_flags_reception_type",
		    FT_UINT32, BASE_DEC, VALS(packet_word_reception_types), PACKET_WORD_RECEPTION_TYPE_MASK,
		    NULL, HFILL }},

		{ &hf_frame_pack_fcs_length,
		  { "FCS length", "frame.packet_flags_fcs_length",
		    FT_UINT32, BASE_DEC, NULL, PACKET_WORD_FCS_LENGTH_MASK,
		    NULL, HFILL }},

		{ &hf_frame_pack_reserved,
		  { "Reserved", "frame.packet_flags_reserved",
		    FT_UINT32, BASE_DEC, NULL, PACKET_WORD_RESERVED_MASK,
		    NULL, HFILL }},

		{ &hf_frame_pack_crc_error,
		  { "CRC error", "frame.packet_flags_crc_error",
		    FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_CRC_ERR_MASK,
		    NULL, HFILL }},

		{ &hf_frame_pack_wrong_packet_too_long_error,
		  { "Packet too long error", "frame.packet_flags_packet_too_error",
		    FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_PACKET_TOO_LONG_ERR_MASK,
		    NULL, HFILL }},

		{ &hf_frame_pack_wrong_packet_too_short_error,
		  { "Packet too short error", "frame.packet_flags_packet_too_short_error",
		    FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_PACKET_TOO_SHORT_ERR_MASK,
		    NULL, HFILL }},

		{ &hf_frame_pack_wrong_inter_frame_gap_error,
		  { "Wrong interframe gap error", "frame.packet_flags_wrong_inter_frame_gap_error",
		    FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_WRONG_INTER_FRAME_GAP_ERR_MASK,
		    NULL, HFILL }},

		{ &hf_frame_pack_unaligned_frame_error,
		  { "Unaligned frame error", "frame.packet_flags_unaligned_frame_error",
		    FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_UNALIGNED_FRAME_ERR_MASK,
		    NULL, HFILL }},

		{ &hf_frame_pack_start_frame_delimiter_error,
		  { "Start frame delimiter error", "frame.packet_flags_start_frame_delimiter_error",
		    FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_START_FRAME_DELIMITER_ERR_MASK,
		    NULL, HFILL }},

		{ &hf_frame_pack_preamble_error,
		  { "Preamble error", "frame.packet_flags_preamble_error",
		    FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_PREAMBLE_ERR_MASK,
		    NULL, HFILL }},

		{ &hf_frame_pack_symbol_error,
		  { "Symbol error", "frame.packet_flags_symbol_error",
		    FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_SYMBOL_ERR_MASK,
		    NULL, HFILL }},

		{ &hf_comments_text,
		  { "Comment", "frame.comment",
		    FT_STRING, BASE_NONE, NULL, 0x0,
		    NULL, HFILL }},
	};

	static hf_register_info hf_encap =
		{ &hf_frame_wtap_encap,
		  { "Encapsulation type", "frame.encap_type",
		    FT_INT16, BASE_DEC, NULL, 0x0,
		    NULL, HFILL }};

 	static gint *ett[] = {
		&ett_frame,
		&ett_flags,
		&ett_comments
	};

	static ei_register_info ei[] = {
		{ &ei_comments_text, { "frame.comment.expert", PI_COMMENTS_GROUP, PI_COMMENT, "Formatted comment", EXPFILL }},
		{ &ei_arrive_time_out_of_range, { "frame.time_invalid", PI_SEQUENCE, PI_NOTE, "Arrival Time: Fractional second out of range (0-1000000000)", EXPFILL }},
	};

	module_t *frame_module;
	expert_module_t* expert_frame;

	if (hf_encap.hfinfo.strings == NULL) {
		int encap_count = wtap_get_num_encap_types();
		value_string *arr;
		int i;

		hf_encap.hfinfo.strings = arr = g_new(value_string, encap_count+1);

		for (i = 0; i < encap_count; i++) {
			arr[i].value = i;
			arr[i].strptr = wtap_encap_string(i);
		}
		arr[encap_count].value = 0;
		arr[encap_count].strptr = NULL;
	}

	wtap_encap_dissector_table = register_dissector_table("wtap_encap",
	    "Wiretap encapsulation type", FT_UINT32, BASE_DEC);
	wtap_fts_rec_dissector_table = register_dissector_table("wtap_fts_rec",
	    "Wiretap file type for file-type-specific records", FT_UINT32, BASE_DEC);

	proto_frame = proto_register_protocol("Frame", "Frame", "frame");
	proto_pkt_comment = proto_register_protocol("Packet comments", "Pkt_Comment", "pkt_comment");
	proto_register_field_array(proto_frame, hf, array_length(hf));
	proto_register_field_array(proto_frame, &hf_encap, 1);
	proto_register_subtree_array(ett, array_length(ett));
	expert_frame = expert_register_protocol(proto_frame);
	expert_register_field_array(expert_frame, ei, array_length(ei));
	new_register_dissector("frame",dissect_frame,proto_frame);

	/* You can't disable dissection of "Frame", as that would be
	   tantamount to not doing any dissection whatsoever. */
	proto_set_cant_toggle(proto_frame);

	/* Our preferences */
	frame_module = prefs_register_protocol(proto_frame, NULL);
	prefs_register_bool_preference(frame_module, "show_file_off",
	    "Show File Offset", "Show offset of frame in capture file", &show_file_off);
	prefs_register_bool_preference(frame_module, "force_docsis_encap",
	    "Treat all frames as DOCSIS frames", "Treat all frames as DOCSIS Frames", &force_docsis_encap);
	prefs_register_bool_preference(frame_module, "generate_md5_hash",
	    "Generate an MD5 hash of each frame",
	    "Whether or not MD5 hashes should be generated for each frame, useful for finding duplicate frames.",
	    &generate_md5_hash);
	prefs_register_bool_preference(frame_module, "generate_epoch_time",
	    "Generate an epoch time entry for each frame",
	    "Whether or not an Epoch time entry should be generated for each frame.",
	    &generate_epoch_time);
	prefs_register_bool_preference(frame_module, "generate_bits_field",
	    "Show the number of bits in the frame",
	    "Whether or not the number of bits in the frame should be shown.",
	    &generate_bits_field);

	frame_tap=register_tap("frame");
}
Ejemplo n.º 25
0
void
proto_register_ax25_nol3(void)
{
	module_t *ax25_nol3_module;

	/* Setup list of header fields */
#if 0 /* not used ? */
	static hf_register_info hf[] = {
		{ &hf_text,
			{ "Text",			"ax25_nol3.text",
			FT_STRING, BASE_NONE, NULL, 0x0,
			NULL, HFILL }
		},
	};
#endif

	static hf_register_info hf_dx[] = {
		{ &hf_dx_report,
			{ "DX",				"ax25_nol3.dx",
			FT_STRING, BASE_NONE, NULL, 0x0,
			"DX cluster", HFILL }
		},
	};

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

	/* Register the protocol name and description */
	proto_ax25_nol3 = proto_register_protocol("AX.25 no Layer 3", "AX.25 no L3", "ax25_nol3");

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

	/* Register preferences module */
	ax25_nol3_module = prefs_register_protocol( proto_ax25_nol3, NULL);

	/* Register any preference */
	prefs_register_bool_preference(ax25_nol3_module, "showaprs",
	     "Decode the APRS info field",
	     "Enable decoding of the payload as APRS.",
	     &gPREF_APRS );

	prefs_register_bool_preference(ax25_nol3_module, "showcluster",
	     "Decode DX cluster info field",
	     "Enable decoding of the payload as DX cluster info.",
	     &gPREF_DX );

	/* Register the sub-protocol name and description */
	proto_dx = proto_register_protocol("DX cluster", "DX", "dx");

	/* Register the dissector */
	register_dissector( "dx", dissect_dx, proto_dx);

	/* Register the header fields */
	proto_register_field_array( proto_dx, hf_dx, array_length( hf_dx ) );

	/* Register the subtrees used */
	/* proto_register_subtree_array( ett_dx, array_length( ett_dx ) ); */
}
Ejemplo n.º 26
0
void
proto_register_rip(void)
{
	static hf_register_info hf[] = {
		{ &hf_rip_command,
			{ "Command", "rip.command", FT_UINT8, BASE_DEC,
			VALS(command_vals), 0, "What type of RIP Command is this", HFILL }},

		{ &hf_rip_version,
			{ "Version", "rip.version", FT_UINT8, BASE_DEC,
			VALS(version_vals), 0, "Version of the RIP protocol", HFILL }},

		{ &hf_rip_family,
			{ "Address Family", "rip.family", FT_UINT16, BASE_DEC,
			VALS(family_vals), 0, NULL, HFILL }},

		{ &hf_rip_routing_domain,
			{ "Routing Domain", "rip.routing_domain", FT_UINT16, BASE_DEC,
			NULL, 0, "RIPv2 Routing Domain", HFILL }},

		{ &hf_rip_ip,
			{ "IP Address", "rip.ip", FT_IPv4, BASE_NONE,
			NULL, 0, NULL, HFILL}},

		{ &hf_rip_netmask,
			{ "Netmask", "rip.netmask", FT_IPv4, BASE_NONE,
			NULL, 0, NULL, HFILL}},

		{ &hf_rip_next_hop,
			{ "Next Hop", "rip.next_hop", FT_IPv4, BASE_NONE,
			NULL, 0, "Next Hop router for this route", HFILL}},

		{ &hf_rip_metric,
			{ "Metric", "rip.metric", FT_UINT16, BASE_DEC,
			NULL, 0, "Metric for this route", HFILL }},

		{ &hf_rip_auth,
			{ "Authentication type", "rip.auth.type", FT_UINT16, BASE_DEC,
			VALS(rip_auth_type), 0, "Type of authentication", HFILL }},

		{ &hf_rip_auth_passwd,
			{ "Password", "rip.auth.passwd", FT_STRING, BASE_NONE,
			NULL, 0, "Authentication password", HFILL }},

		{ &hf_rip_route_tag,
			{ "Route Tag", "rip.route_tag", FT_UINT16, BASE_DEC,
			NULL, 0, NULL, HFILL }},

	};
	static gint *ett[] = {
		&ett_rip,
		&ett_rip_vec,
		&ett_auth_vec,
	};

	module_t *rip_module;

	proto_rip = proto_register_protocol("Routing Information Protocol",
				"RIP", "rip");
	proto_register_field_array(proto_rip, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));

	rip_module = prefs_register_protocol(proto_rip, proto_reg_handoff_rip);

	prefs_register_bool_preference(rip_module, "display_routing_domain", "Display Routing Domain field", "Display the third and forth bytes of the RIPv2 header as the Routing Domain field (introduced in RFC 1388 [January 1993] and obsoleted as of RFC 1723 [November 1994])", &pref_display_routing_domain);
}
Ejemplo n.º 27
0
/* Register the protocol with Wireshark */
void
proto_register_gsm_sms_ud(void)
{
    module_t *gsm_sms_ud_module; /* Preferences for GSM SMS UD */

    /* Setup list of header fields  */
    static hf_register_info hf[] = {
        /*
         * User Data Header
         */
        {   &hf_gsm_sms_udh_iei,
            {   "IE Id", "gsm_sms_ud.udh.iei",
                FT_UINT8, BASE_HEX, VALS(vals_udh_iei), 0x00,
                "Name of the User Data Header Information Element.",
                HFILL
            }
        },
        {   &hf_gsm_sms_udh_length,
            {   "UDH Length", "gsm_sms_ud.udh.len",
                FT_UINT8, BASE_DEC, NULL, 0x00,
                "Length of the User Data Header (bytes)",
                HFILL
            }
        },
#if 0
        {   &hf_gsm_sms_udh_multiple_messages,
            {   "Multiple messages UDH", "gsm_sms_ud.udh.mm",
                FT_NONE, BASE_NONE, NULL, 0x00,
                "Multiple messages User Data Header",
                HFILL
            }
        },
#endif
        {   &hf_gsm_sms_udh_multiple_messages_msg_id,
            {   "Message identifier", "gsm_sms_ud.udh.mm.msg_id",
                FT_UINT16, BASE_DEC, NULL, 0x00,
                "Identification of the message",
                HFILL
            }
        },
        {   &hf_gsm_sms_udh_multiple_messages_msg_parts,
            {   "Message parts", "gsm_sms_ud.udh.mm.msg_parts",
                FT_UINT8, BASE_DEC, NULL, 0x00,
                "Total number of message parts (fragments)",
                HFILL
            }
        },
        {   &hf_gsm_sms_udh_multiple_messages_msg_part,
            {   "Message part number", "gsm_sms_ud.udh.mm.msg_part",
                FT_UINT8, BASE_DEC, NULL, 0x00,
                "Message part (fragment) sequence number",
                HFILL
            }
        },
#if 0
        {   &hf_gsm_sms_udh_ports,
            {   "Port number UDH", "gsm_sms_ud.udh.ports",
                FT_NONE, BASE_NONE, NULL, 0x00,
                "Port number User Data Header",
                HFILL
            }
        },
#endif
        {   &hf_gsm_sms_udh_ports_src,
            {   "Source port", "gsm_sms_ud.udh.ports.src",
                FT_UINT8, BASE_DEC, NULL, 0x00,
                NULL,
                HFILL
            }
        },
        {   &hf_gsm_sms_udh_ports_dst,
            {   "Destination port", "gsm_sms_ud.udh.ports.dst",
                FT_UINT8, BASE_DEC, NULL, 0x00,
                NULL,
                HFILL
            }
        },
        /*
         * Short Message fragment reassembly
         */
        {   &hf_gsm_sms_ud_fragments,
            {   "Short Message fragments", "gsm_sms_ud.fragments",
                FT_NONE, BASE_NONE, NULL, 0x00,
                "GSM Short Message fragments",
                HFILL
            }
        },
        {   &hf_gsm_sms_ud_fragment,
            {   "Short Message fragment", "gsm_sms_ud.fragment",
                FT_FRAMENUM, BASE_NONE, NULL, 0x00,
                "GSM Short Message fragment",
                HFILL
            }
        },
        {   &hf_gsm_sms_ud_fragment_overlap,
            {   "Short Message fragment overlap", "gsm_sms_ud.fragment.overlap",
                FT_BOOLEAN, BASE_NONE, NULL, 0x0,
                "GSM Short Message fragment overlaps with other fragment(s)",
                HFILL
            }
        },
        {   &hf_gsm_sms_ud_fragment_overlap_conflicts,
            {   "Short Message fragment overlapping with conflicting data",
                "gsm_sms_ud.fragment.overlap.conflicts",
                FT_BOOLEAN, BASE_NONE, NULL, 0x0,
                "GSM Short Message fragment overlaps with conflicting data",
                HFILL
            }
        },
        {   &hf_gsm_sms_ud_fragment_multiple_tails,
            {   "Short Message has multiple tail fragments",
                "gsm_sms_ud.fragment.multiple_tails",
                FT_BOOLEAN, BASE_NONE, NULL, 0x0,
                "GSM Short Message fragment has multiple tail fragments",
                HFILL
            }
        },
        {   &hf_gsm_sms_ud_fragment_too_long_fragment,
            {   "Short Message fragment too long",
                "gsm_sms_ud.fragment.too_long_fragment",
                FT_BOOLEAN, BASE_NONE, NULL, 0x0,
                "GSM Short Message fragment data goes beyond the packet end",
                HFILL
            }
        },
        {   &hf_gsm_sms_ud_fragment_error,
            {   "Short Message defragmentation error", "gsm_sms_ud.fragment.error",
                FT_FRAMENUM, BASE_NONE, NULL, 0x00,
                "GSM Short Message defragmentation error due to illegal fragments",
                HFILL
            }
        },
        {   &hf_gsm_sms_ud_fragment_count,
            {   "Short Message fragment count", "gsm_sms_ud.fragment.count",
                FT_UINT32, BASE_DEC, NULL, 0x00,
                NULL,
                HFILL
            }
        },
        {   &hf_gsm_sms_ud_reassembled_in,
            {   "Reassembled in",
                "gsm_sms_ud.reassembled.in",
                FT_FRAMENUM, BASE_NONE, NULL, 0x00,
                "GSM Short Message has been reassembled in this packet.",
                HFILL
            }
        },
        {   &hf_gsm_sms_ud_reassembled_length,
            {   "Reassembled Short Message length",
                "gsm_sms_ud.reassembled.length",
                FT_UINT32, BASE_DEC, NULL, 0x00,
                "The total length of the reassembled payload",
                HFILL
            }
        },
        {   &hf_gsm_sms_ud_short_msg,
            {   "Short Message body",
                "gsm_sms_ud.short_msg",
                FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL
            }
        },
    };

    static gint *ett[] = {
        &ett_gsm_sms,
        &ett_udh,
        &ett_udh_ie,
        &ett_gsm_sms_ud_fragment,
        &ett_gsm_sms_ud_fragments,
    };
    /* Register the protocol name and description */
    proto_gsm_sms_ud = proto_register_protocol(
                           "GSM Short Message Service User Data",  /* Name */
                           "GSM SMS UD",           /* Short name */
                           "gsm_sms_ud");          /* Filter name */

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

    /* Subdissector code */
    gsm_sms_dissector_table = register_dissector_table("gsm_sms_ud.udh.port",
                              "GSM SMS port IE in UDH", FT_UINT16, BASE_DEC);

    /* Preferences for GSM SMS UD */
    gsm_sms_ud_module = prefs_register_protocol(proto_gsm_sms_ud, NULL);
    prefs_register_bool_preference(gsm_sms_ud_module,
                                   "port_number_udh_means_wsp",
                                   "Port Number IE in UDH always triggers CL-WSP dissection",
                                   "Always decode a GSM Short Message as Connectionless WSP "
                                   "if a Port Number Information Element is present "
                                   "in the SMS User Data Header.",
                                   &port_number_udh_means_wsp);
    prefs_register_bool_preference(gsm_sms_ud_module, "try_dissect_1st_fragment",
                                   "Always try subdissection of 1st Short Message fragment",
                                   "Always try subdissection of the 1st fragment of a fragmented "
                                   "GSM Short Message. If reassembly is possible, the Short Message "
                                   "may be dissected twice (once as a short frame, once in its "
                                   "entirety).",
                                   &try_dissect_1st_frag);
    prefs_register_bool_preference(gsm_sms_ud_module, "prevent_dissectors_chg_cols",
                                   "Prevent sub-dissectors from changing column data",
                                   "Prevent sub-dissectors from replacing column data with their "
                                   "own. Eg. Prevent WSP dissector overwriting SMPP information.",
                                   &prevent_subdissectors_changing_columns);

    register_dissector("gsm_sms_ud", dissect_gsm_sms_ud, proto_gsm_sms_ud);

    /* GSM SMS UD dissector initialization routines */
    register_init_routine(gsm_sms_ud_defragment_init);
}
Ejemplo n.º 28
0
void
proto_register_tacplus(void)
{
	static hf_register_info hf[] = {
	  { &hf_tacplus_response,
	    { "Response",           "tacplus.response",
	      FT_BOOLEAN, BASE_NONE, NULL, 0x0,
	      "TRUE if TACACS+ response", HFILL }},
	  { &hf_tacplus_request,
	    { "Request",            "tacplus.request",
	      FT_BOOLEAN, BASE_NONE, NULL, 0x0,
	      "TRUE if TACACS+ request", HFILL }},
	  { &hf_tacplus_majvers,
	    { "Major version",      "tacplus.majvers",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      "Major version number", HFILL }},
	  { &hf_tacplus_minvers,
	    { "Minor version",      "tacplus.minvers",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      "Minor version number", HFILL }},
	  { &hf_tacplus_type,
	    { "Type",               "tacplus.type",
	      FT_UINT8, BASE_DEC, VALS(tacplus_type_vals), 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_seqno,
	    { "Sequence number",    "tacplus.seqno",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_flags,
	    { "Flags",              "tacplus.flags",
	      FT_UINT8, BASE_HEX, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_flags_payload_type,
	    { "Unencrypted",       "tacplus.flags.unencrypted",
	      FT_BOOLEAN, 8, TFS(&tfs_set_notset), FLAGS_UNENCRYPTED,
	      "Is payload unencrypted?", HFILL }},
	  { &hf_tacplus_flags_connection_type,
	    { "Single Connection",    "tacplus.flags.singleconn",
	      FT_BOOLEAN, 8, TFS(&tfs_set_notset), FLAGS_SINGLE,
	      "Is this a single connection?", HFILL }},
	  { &hf_tacplus_acct_flags,
	    { "Flags",    "tacplus.acct.flags",
	      FT_UINT8, BASE_HEX, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_acct_flags_more,
	    { "More",    "tacplus.acct.flags.more",
	      FT_BOOLEAN, 8, TFS(&tfs_set_notset), TAC_PLUS_ACCT_FLAG_MORE,
	      NULL, HFILL }},
	  { &hf_tacplus_acct_flags_start,
	    { "Start",    "tacplus.acct.flags.start",
	      FT_BOOLEAN, 8, TFS(&tfs_set_notset), TAC_PLUS_ACCT_FLAG_START,
	      NULL, HFILL }},
	  { &hf_tacplus_acct_flags_stop,
	    { "Stop",    "tacplus.acct.flags.stop",
	      FT_BOOLEAN, 8, TFS(&tfs_set_notset), TAC_PLUS_ACCT_FLAG_STOP,
	      NULL, HFILL }},
	  { &hf_tacplus_acct_flags_watchdog,
	    { "Watchdog",    "tacplus.acct.flags.watchdog",
	      FT_BOOLEAN, 8, TFS(&tfs_set_notset), TAC_PLUS_ACCT_FLAG_WATCHDOG,
	      NULL, HFILL }},
	  { &hf_tacplus_session_id,
	    { "Session ID",         "tacplus.session_id",
	      FT_UINT32, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_packet_len,
	    { "Packet length",      "tacplus.packet_len",
	      FT_UINT32, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_auth_password,
	    { "Password",           "tacplus.auth_password",
	      FT_STRINGZ, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_port,
	    { "Port",           "tacplus.port",
	      FT_STRINGZ, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_remote_address,
	    { "Remote Address",           "tacplus.remote_address",
	      FT_STRINGZ, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_chap_challenge,
	    { "Challenge",           "tacplus.chap.challenge",
	      FT_STRINGZ, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_chap_response,
	    { "Response",           "tacplus.chap.response",
	      FT_STRINGZ, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_mschap_challenge,
	    { "Challenge",           "tacplus.mschap.challenge",
	      FT_STRINGZ, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_mschap_response,
	    { "Response",           "tacplus.mschap.response",
	      FT_STRINGZ, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_arap_nas_challenge,
	    { "Nas Challenge",           "tacplus.arap.nas_challenge",
	      FT_STRINGZ, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_arap_remote_challenge,
	    { "Remote Challenge",           "tacplus.arap.remote_challenge",
	      FT_STRINGZ, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_arap_remote_response,
	    { "Remote Response",           "tacplus.arap.remote_response",
	      FT_STRINGZ, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_privilege_level,
	    { "Privilege Level",    "tacplus.privilege_level",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_authentication_type,
	    { "Authentication type",    "tacplus.authentication_type",
	      FT_UINT8, BASE_DEC, VALS(tacplus_authen_type_vals), 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_service,
	    { "Service",    "tacplus.service",
	      FT_UINT8, BASE_DEC, VALS(tacplus_authen_service_vals), 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_user_len,
	    { "User len",    "tacplus.user_len",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_user,
	    { "User",        "tacplus.user",
	      FT_STRINGZ, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_port_len,
	    { "Port len",    "tacplus.port_len",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_remote_address_len,
	    { "Remaddr len",    "tacplus.address_len",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_arg_length,
	    { "Length",    "tacplus.arg_length",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_arg_value,
	    { "Value",           "tacplus.arg_value",
	      FT_STRINGZ, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_chap_id,
	    { "ID",    "tacplus.chap.id",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_mschap_id,
	    { "ID",    "tacplus.mschap.id",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_authen_action,
	    { "Action",    "tacplus.authen_action",
	      FT_UINT8, BASE_DEC, VALS(tacplus_authen_action_vals), 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_authen_req_cont_flags,
	    { "Flags",    "tacplus.body_authen_req_cont.flags",
	      FT_UINT8, BASE_HEX, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_authen_req_cont_user_length,
	    { "User length",    "tacplus.body_authen_req_cont.user_length",
	      FT_UINT16, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_authen_req_cont_data_length,
	    { "Data length",    "tacplus.body_authen_req_cont.data_length",
	      FT_UINT16, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_authen_req_cont_user,
	    { "User",           "tacplus.body_authen_req_cont.user",
	      FT_STRING, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_authen_rep_status,
	    { "Status",    "tacplus.body_authen_rep.status",
	      FT_UINT8, BASE_HEX, VALS(tacplus_reply_status_vals), 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_authen_rep_flags,
	    { "Flags",    "tacplus.body_authen_rep.flags",
	      FT_UINT8, BASE_HEX, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_authen_rep_server_msg_len,
	    { "Server message length",    "tacplus.body_authen_rep.server_msg_len",
	      FT_UINT16, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_authen_rep_server_msg,
	    { "Server message", "tacplus.body_authen_rep.server_msg",
	      FT_STRING, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_authen_rep_server_data_len,
	    { "Data length",    "tacplus.body_authen_rep_server.data_len",
	      FT_UINT16, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_author_req_auth_method,
	    { "Auth Method",    "tacplus.body_author_req.auth_method",
	      FT_UINT8, BASE_HEX, VALS(tacplus_authen_method), 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_author_req_arg_count,
	    { "Arg count",    "tacplus.body_author_req.arg_count",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_author_rep_auth_status,
	    { "Auth Status",    "tacplus.body_author_rep.auth_status",
	      FT_UINT8, BASE_HEX, VALS(tacplus_author_status), 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_author_rep_server_msg_len,
	    { "Server Msg length",    "tacplus.body_author_rep_server.msg_len",
	      FT_UINT16, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_author_rep_server_data_len,
	    { "Data length",    "tacplus.body_author_rep_server.data_len",
	      FT_UINT16, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_author_rep_arg_count,
	    { "Arg count",    "tacplus.body_author_rep.arg_count",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_acct_authen_method,
	    { "Auth Method",    "tacplus.acct.auth_method",
	      FT_UINT8, BASE_HEX, VALS(tacplus_authen_method), 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_acct_arg_count,
	    { "Arg count",    "tacplus.acct.arg_count",
	      FT_UINT8, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_acct_status,
	    { "Status",    "tacplus.body_acct.status",
	      FT_UINT8, BASE_HEX, VALS(tacplus_acct_status), 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_acct_server_msg_len,
	    { "Server Msg length",    "tacplus.body_acct.msg_len",
	      FT_UINT16, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_acct_data_len,
	    { "Data length",    "tacplus.body_acct.data_len",
	      FT_UINT16, BASE_DEC, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_acct_server_msg,
	    { "Server message", "tacplus.body_acct.server_msg",
	      FT_STRING, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	  { &hf_tacplus_body_acct_data,
	    { "Data", "tacplus.body_acct.data",
	      FT_STRING, BASE_NONE, NULL, 0x0,
	      NULL, HFILL }},
	};
	static gint *ett[] = {
		&ett_tacplus,
		&ett_tacplus_flags,
		&ett_tacplus_acct_flags,
		&ett_tacplus_body,
		&ett_tacplus_body_chap,
	};

	static ei_register_info ei[] = {
		{ &ei_tacplus_packet_len_invalid, { "tacplus.packet_len.invalid", PI_PROTOCOL, PI_WARN, "Invalid length", EXPFILL }},
	};

	module_t *tacplus_module;
	expert_module_t* expert_tacplus;

	proto_tacplus = proto_register_protocol("TACACS+", "TACACS+", "tacplus");
	proto_register_field_array(proto_tacplus, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));
	expert_tacplus = expert_register_protocol(proto_tacplus);
	expert_register_field_array(expert_tacplus, ei, array_length(ei));
	tacplus_module = prefs_register_protocol (proto_tacplus, tacplus_pref_cb );

	prefs_register_bool_preference(tacplus_module, "desegment", "Reassemble TACACS+ messages spanning multiple TCP segments.", "Whether the TACACS+ dissector should reassemble messages spanning multiple TCP segments.  To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", &tacplus_preference_desegment);

	prefs_register_string_preference ( tacplus_module, "key",
	"TACACS+ Encryption Key", "TACACS+ Encryption Key", &tacplus_opt_key );
}
Ejemplo n.º 29
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));

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

	gssapi_oids = g_hash_table_new_full(gssapi_oid_hash, gssapi_oid_equal, g_free, g_free);

	reassembly_table_register(&gssapi_reassembly_table,
	                      &addresses_reassembly_table_functions);

	register_shutdown_routine(gssapi_shutdown);
}
Ejemplo n.º 30
0
void
proto_register_mpeg_sect(void)
{
    static hf_register_info hf[] = {
        { &hf_mpeg_sect_table_id, {
            "Table ID", "mpeg_sect.tid",
            FT_UINT8, BASE_HEX, VALS(mpeg_sect_table_id_vals), 0, NULL, HFILL
        } },

        { &hf_mpeg_sect_syntax_indicator, {
            "Syntax indicator", "mpeg_sect.syntax_indicator",
            FT_UINT16, BASE_DEC, NULL, MPEG_SECT_SYNTAX_INDICATOR_MASK, NULL, HFILL
        } },

        { &hf_mpeg_sect_reserved, {
            "Reserved", "mpeg_sect.reserved",
            FT_UINT16, BASE_HEX, NULL, MPEG_SECT_RESERVED_MASK, NULL, HFILL
        } },

        { &hf_mpeg_sect_length, {
            "Length", "mpeg_sect.len",
            FT_UINT16, BASE_DEC, NULL, MPEG_SECT_LENGTH_MASK, NULL, HFILL
        } },

        { &hf_mpeg_sect_crc, {
            "CRC 32", "mpeg_sect.crc",
            FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL
        } }
    };

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

    static ei_register_info ei[] = {
        { &ei_mpeg_sect_crc, { "mpeg_sect.crc.invalid", PI_CHECKSUM, PI_WARN, "Invalid CRC", EXPFILL }},
    };

    module_t *mpeg_sect_module;
    expert_module_t* expert_mpeg_sect;

    proto_mpeg_sect = proto_register_protocol("MPEG2 Section", "MPEG SECT", "mpeg_sect");
    register_dissector("mpeg_sect", dissect_mpeg_sect, proto_mpeg_sect);

    proto_register_field_array(proto_mpeg_sect, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_mpeg_sect = expert_register_protocol(proto_mpeg_sect);
    expert_register_field_array(expert_mpeg_sect, ei, array_length(ei));

    mpeg_sect_module = prefs_register_protocol(proto_mpeg_sect, NULL);

    prefs_register_bool_preference(mpeg_sect_module,
        "verify_crc",
        "Verify the section CRC",
        "Whether the section dissector should verify the CRC",
        &mpeg_sect_check_crc);

    mpeg_sect_tid_dissector_table = register_dissector_table("mpeg_sect.tid",
                                 "MPEG SECT Table ID",
                                 FT_UINT8, BASE_HEX);

}