コード例 #1
0
ファイル: packet-udp.c プロジェクト: jiangxilong/wireshark-1
void
proto_reg_handoff_udp(void)
{
  dissector_add_uint("ip.proto", IP_PROTO_UDP, udp_handle);
  dissector_add_uint("ip.proto", IP_PROTO_UDPLITE, udplite_handle);
  data_handle = find_dissector("data");
  udp_tap = register_tap("udp");
  udp_follow_tap = register_tap("udp_follow");
}
コード例 #2
0
void
expert_init(void)
{
	static hf_register_info hf[] = {
		{ &hf_expert_msg,
			{ "Message", "expert.message", FT_STRING, BASE_NONE, NULL, 0, "Wireshark expert information", HFILL }
		},
		{ &hf_expert_group,
			{ "Group", "expert.group", FT_UINT32, BASE_HEX, VALS(expert_group_vals), 0, "Wireshark expert group", HFILL }
		},
		{ &hf_expert_severity,
			{ "Severity level", "expert.severity", FT_UINT32, BASE_HEX, VALS(expert_severity_vals), 0, "Wireshark expert severity level", HFILL }
		}
	};
	static gint *ett[] = {
		&ett_expert,
		&ett_subexpert
	};

	if (expert_tap == -1) {
		expert_tap = register_tap("expert");
	}

	if (proto_expert == -1) {
		proto_expert = proto_register_protocol("Expert Info", "Expert", "expert");
		proto_register_field_array(proto_expert, hf, array_length(hf));
		proto_register_subtree_array(ett, array_length(ett));
		proto_set_cant_toggle(proto_expert);
	}

	highest_severity = 0;
}
コード例 #3
0
ファイル: packet-esp.c プロジェクト: ecsv/wireshark-esp
void proto_reg_handoff_eth_esp(void)
{
	static gboolean inited = FALSE;
	static unsigned int old_eth_esp_ethertype;

	if (!inited) {
		eth_esp_handle = create_dissector_handle(dissect_eth_esp, proto_eth_esp_plugin);

		data_handle = find_dissector("data");

		eth_esp_tap = register_tap("eth_esp");
		eth_esp_follow_tap = register_tap("eth_esp_follow");

		register_heur_dissector_list("eth_esp", &heur_subdissector_list);

		inited = TRUE;
	} else {
		dissector_delete("ethertype", old_eth_esp_ethertype, eth_esp_handle);
	}

	old_eth_esp_ethertype = eth_esp_ethertype;
	dissector_add("ethertype", eth_esp_ethertype, eth_esp_handle);
}
コード例 #4
0
ファイル: packet-frame.c プロジェクト: zonquan/dumphttp
void
proto_register_frame(void)
{
	
    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");
	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);


	frame_tap=register_tap("frame");
}
コード例 #5
0
int
register_export_object(const int proto_id, tap_packet_cb export_packet_func, export_object_gui_reset_cb reset_cb)
{
    register_eo_t *table;
    DISSECTOR_ASSERT(export_packet_func);

    table = wmem_new(wmem_epan_scope(), register_eo_t);

    table->proto_id      = proto_id;
    table->tap_listen_str = wmem_strdup_printf(wmem_epan_scope(), "%s_eo", proto_get_protocol_filter_name(proto_id));
    table->eo_func = export_packet_func;
    table->reset_cb = reset_cb;

    if (registered_eo_tables == NULL)
        registered_eo_tables = wmem_tree_new(wmem_epan_scope());

    wmem_tree_insert_string(registered_eo_tables, proto_get_protocol_filter_name(proto_id), table, 0);
    return register_tap(table->tap_listen_str);
}
コード例 #6
0
void
proto_register_frame(void)
{
	static hf_register_info hf[] = {
		{ &hf_frame_arrival_time,
		{ "Arrival Time",		"frame.time", FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
			"Absolute 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_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 }}
	};
	static gint *ett[] = {
		&ett_frame
	};
	module_t *frame_module;

	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_register_field_array(proto_frame, hf, array_length(hf));
	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);

	frame_tap=register_tap("frame");
}
コード例 #7
0
void
proto_register_fddi(void)
{
  static hf_register_info hf[] = {

    /*
     * XXX - we want this guy to have his own private formatting
     * routine, using "fc_to_str()"; if "fc_to_str()" returns
     * NULL, just show the hex value, else show the string.
     */
    { &hf_fddi_fc,
      { "Frame Control", "fddi.fc", FT_UINT8, BASE_HEX, NULL, 0x0,
        NULL, HFILL }},

    { &hf_fddi_fc_clf,
      { "Class/Length/Format", "fddi.fc.clf", FT_UINT8, BASE_HEX, VALS(clf_vals), FDDI_FC_CLFF,
        NULL, HFILL }},

    { &hf_fddi_fc_prio,
      { "Priority", "fddi.fc.prio", FT_UINT8, BASE_DEC, NULL, FDDI_FC_ASYNC_PRI,
        NULL, HFILL }},

    { &hf_fddi_fc_smt_subtype,
      { "SMT Subtype", "fddi.fc.smt_subtype", FT_UINT8, BASE_DEC, VALS(smt_subtype_vals), FDDI_FC_ZZZZ,
        NULL, HFILL }},

    { &hf_fddi_fc_mac_subtype,
      { "MAC Subtype", "fddi.fc.mac_subtype", FT_UINT8, BASE_DEC, VALS(mac_subtype_vals), FDDI_FC_ZZZZ,
        NULL, HFILL }},

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

    { &hf_fddi_src,
      { "Source", "fddi.src", FT_ETHER, BASE_NONE, NULL, 0x0,
        NULL, HFILL }},

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

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

  module_t *fddi_module;

  proto_fddi = proto_register_protocol("Fiber Distributed Data Interface",
                                       "FDDI", "fddi");
  proto_register_field_array(proto_fddi, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));

  /*
   * Called from various dissectors for encapsulated FDDI frames.
   * We assume the MAC addresses in them aren't bitswapped.
   */
  register_dissector("fddi", dissect_fddi_not_bitswapped, proto_fddi);

  fddi_module = prefs_register_protocol(proto_fddi, NULL);
  prefs_register_bool_preference(fddi_module, "padding",
                                 "Add 3-byte padding to all FDDI packets",
                                 "Whether the FDDI dissector should add 3-byte padding to all "
                                 "captured FDDI packets (useful with e.g. Tru64 UNIX tcpdump)",
                                 &fddi_padding);

  fddi_tap = register_tap("fddi");
}
コード例 #8
0
void
proto_register_radiotap(void)
{
  static const value_string phy_type[] = {
    { 0, "Unknown" },
    { IEEE80211_CHAN_A,		"802.11a" },
    { IEEE80211_CHAN_A | IEEE80211_CHAN_HT20,		"802.11a (ht20)" },
    { IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U,		"802.11a (ht40+)" },
    { IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D,		"802.11a (ht40-)" },
    { IEEE80211_CHAN_B,		"802.11b" },
    { IEEE80211_CHAN_PUREG,	"802.11g (pure-g)" },
    { IEEE80211_CHAN_G,		"802.11g" },
    { IEEE80211_CHAN_G | IEEE80211_CHAN_HT20,		"802.11g (ht20)" },
    { IEEE80211_CHAN_G | IEEE80211_CHAN_HT40U,		"802.11g (ht40+)" },
    { IEEE80211_CHAN_G | IEEE80211_CHAN_HT40D,		"802.11g (ht40-)" },
    { IEEE80211_CHAN_T,		"802.11a (turbo)" },
    { IEEE80211_CHAN_108PUREG,	"802.11g (pure-g, turbo)" },
    { IEEE80211_CHAN_108G,	"802.11g (turbo)" },
    { IEEE80211_CHAN_FHSS,	"FHSS" },
    { 0, NULL },
  };

  static const true_false_string preamble_type = {
      "Short",
      "Long",
  };

  static hf_register_info hf[] = {
    { &hf_radiotap_version,
      { "Header revision", "radiotap.version",
	FT_UINT8, BASE_DEC, NULL, 0x0,
	"Version of radiotap header format", HFILL } },
    { &hf_radiotap_pad,
      { "Header pad", "radiotap.pad",
	FT_UINT8, BASE_DEC, NULL, 0x0,
	"Padding", HFILL } },
    { &hf_radiotap_length,
       { "Header length", "radiotap.length",
	 FT_UINT16, BASE_DEC, NULL, 0x0,
	 "Length of header including version, pad, length and data fields", HFILL } },
    { &hf_radiotap_present,
       { "Present flags", "radiotap.present",
	 FT_UINT32, BASE_HEX, NULL, 0x0, "Bitmask indicating which fields are present", HFILL } },

#define RADIOTAP_MASK_TSFT                  0x00000001
#define RADIOTAP_MASK_FLAGS                 0x00000002
#define RADIOTAP_MASK_RATE                  0x00000004
#define RADIOTAP_MASK_CHANNEL               0x00000008
#define RADIOTAP_MASK_FHSS                  0x00000010
#define RADIOTAP_MASK_DBM_ANTSIGNAL         0x00000020
#define RADIOTAP_MASK_DBM_ANTNOISE          0x00000040
#define RADIOTAP_MASK_LOCK_QUALITY          0x00000080
#define RADIOTAP_MASK_TX_ATTENUATION        0x00000100
#define RADIOTAP_MASK_DB_TX_ATTENUATION     0x00000200
#define RADIOTAP_MASK_DBM_TX_ATTENUATION    0x00000400
#define RADIOTAP_MASK_ANTENNA               0x00000800
#define RADIOTAP_MASK_DB_ANTSIGNAL          0x00001000
#define RADIOTAP_MASK_DB_ANTNOISE           0x00002000
#define RADIOTAP_MASK_RX_FLAGS              0x00004000
#define RADIOTAP_MASK_XCHANNEL              0x00040000
#define RADIOTAP_MASK_EXT                   0x80000000

    /* Boolean 'present' flags */
    { &hf_radiotap_present_tsft,
      { "TSFT", "radiotap.present.tsft",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_TSFT,
	"Specifies if the Time Synchronization Function Timer field is present", HFILL } },

    { &hf_radiotap_present_flags,
      { "Flags", "radiotap.present.flags",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_FLAGS,
	"Specifies if the channel flags field is present", HFILL } },

    { &hf_radiotap_present_rate,
      { "Rate", "radiotap.present.rate",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_RATE,
	"Specifies if the transmit/receive rate field is present", HFILL } },

    { &hf_radiotap_present_channel,
      { "Channel", "radiotap.present.channel",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_CHANNEL,
	"Specifies if the transmit/receive frequency field is present", HFILL } },

    { &hf_radiotap_present_fhss,
      { "FHSS", "radiotap.present.fhss",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_FHSS,
	"Specifies if the hop set and pattern is present for frequency hopping radios", HFILL } },

    { &hf_radiotap_present_dbm_antsignal,
      { "DBM Antenna Signal", "radiotap.present.dbm_antsignal",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_DBM_ANTSIGNAL,
	"Specifies if the antenna signal strength in dBm is present", HFILL } },

    { &hf_radiotap_present_dbm_antnoise,
      { "DBM Antenna Noise", "radiotap.present.dbm_antnoise",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_DBM_ANTNOISE,
	"Specifies if the RF noise power at antenna field is present", HFILL } },

    { &hf_radiotap_present_lock_quality,
      { "Lock Quality", "radiotap.present.lock_quality",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_LOCK_QUALITY,
	"Specifies if the signal quality field is present", HFILL } },

    { &hf_radiotap_present_tx_attenuation,
      { "TX Attenuation", "radiotap.present.tx_attenuation",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_TX_ATTENUATION,
	"Specifies if the transmit power from max power field is present", HFILL } },

    { &hf_radiotap_present_db_tx_attenuation,
      { "DB TX Attenuation", "radiotap.present.db_tx_attenuation",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_DB_TX_ATTENUATION,
	"Specifies if the transmit power from max power (in dB) field is present", HFILL } },

    { &hf_radiotap_present_dbm_tx_attenuation,
      { "DBM TX Attenuation", "radiotap.present.dbm_tx_attenuation",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_DBM_TX_ATTENUATION,
	"Specifies if the transmit power from max power (in dBm) field is present", HFILL } },

    { &hf_radiotap_present_antenna,
      { "Antenna", "radiotap.present.antenna",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_ANTENNA,
	"Specifies if the antenna number field is present", HFILL } },

    { &hf_radiotap_present_db_antsignal,
      { "DB Antenna Signal", "radiotap.present.db_antsignal",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_DB_ANTSIGNAL,
	"Specifies if the RF signal power at antenna in dB field is present", HFILL } },

    { &hf_radiotap_present_db_antnoise,
      { "DB Antenna Noise", "radiotap.present.db_antnoise",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_DB_ANTNOISE,
	"Specifies if the RF signal power at antenna in dBm field is present", HFILL } },

    { &hf_radiotap_present_rxflags,
      { "RX flags", "radiotap.present.rxflags",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_RX_FLAGS,
	"Specifies if the RX flags field is present", HFILL } },

    { &hf_radiotap_present_hdrfcs,
      { "FCS in header", "radiotap.present.fcs",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_RX_FLAGS,
	"Specifies if the FCS field is present", HFILL } },

    { &hf_radiotap_present_xchannel,
      { "Channel+", "radiotap.present.xchannel",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_XCHANNEL,
	"Specifies if the extended channel info field is present", HFILL } },

    { &hf_radiotap_present_ext,
      { "Ext", "radiotap.present.ext",
	FT_BOOLEAN, 32, NULL, RADIOTAP_MASK_EXT,
	"Specifies if there are any extensions to the header present", HFILL } },

    /* Boolean 'present.flags' flags */
    { &hf_radiotap_flags,
      { "Flags", "radiotap.flags",
	FT_UINT8, BASE_HEX, NULL,  0x0, NULL, HFILL } },

    { &hf_radiotap_flags_cfp,
      { "CFP", "radiotap.flags.cfp",
	FT_BOOLEAN, 8, NULL,  IEEE80211_RADIOTAP_F_CFP,
	"Sent/Received during CFP", HFILL } },

    { &hf_radiotap_flags_preamble,
      { "Preamble", "radiotap.flags.preamble",
	FT_BOOLEAN, 8, TFS(&preamble_type),  IEEE80211_RADIOTAP_F_SHORTPRE,
	"Sent/Received with short preamble", HFILL } },

    { &hf_radiotap_flags_wep,
      { "WEP", "radiotap.flags.wep",
	FT_BOOLEAN, 8, NULL, IEEE80211_RADIOTAP_F_WEP,
	"Sent/Received with WEP encryption", HFILL } },

    { &hf_radiotap_flags_frag,
      { "Fragmentation", "radiotap.flags.frag",
	FT_BOOLEAN, 8, NULL, IEEE80211_RADIOTAP_F_FRAG,
	"Sent/Received with fragmentation", HFILL } },

    { &hf_radiotap_flags_fcs,
      { "FCS at end", "radiotap.flags.fcs",
	FT_BOOLEAN, 8, NULL, IEEE80211_RADIOTAP_F_FCS,
    "Frame includes FCS at end", HFILL } },

    { &hf_radiotap_flags_datapad,
      { "Data Pad", "radiotap.flags.datapad",
	FT_BOOLEAN, 8, NULL, IEEE80211_RADIOTAP_F_DATAPAD,
    "Frame has padding between 802.11 header and payload", HFILL } },

    { &hf_radiotap_flags_badfcs,
      { "Bad FCS", "radiotap.flags.badfcs",
	FT_BOOLEAN, 8, NULL, IEEE80211_RADIOTAP_F_BADFCS,
        "Frame received with bad FCS", HFILL } },

    { &hf_radiotap_flags_shortgi,
      { "Short GI", "radiotap.flags.shortgi",
	FT_BOOLEAN, 8, NULL, IEEE80211_RADIOTAP_F_SHORTGI,
    "Frame Sent/Received with HT short Guard Interval", HFILL } },


    { &hf_radiotap_mactime,
       { "MAC timestamp", "radiotap.mactime",
	 FT_UINT64, BASE_DEC, NULL, 0x0,
	 "Value in microseconds of the MAC's Time Synchronization Function timer when the first bit of the MPDU arrived at the MAC.", HFILL } },

    { &hf_radiotap_quality,
       { "Signal Quality", "radiotap.quality",
	 FT_UINT16, BASE_DEC, NULL, 0x0,
	 "Signal quality (unitless measure)", HFILL } },

    { &hf_radiotap_fcs,
       { "802.11 FCS", "radiotap.fcs",
	 FT_UINT32, BASE_HEX, NULL, 0x0,
	 "Frame check sequence of this frame", HFILL } },

    { &hf_radiotap_channel,
      { "Channel", "radiotap.channel",
	FT_UINT32, BASE_DEC, NULL, 0x0,
	"802.11 channel number that this frame was sent/received on", HFILL } },

    { &hf_radiotap_channel_frequency,
      { "Channel frequency", "radiotap.channel.freq",
	FT_UINT32, BASE_DEC, NULL, 0x0,
	"Channel frequency in megahertz that this frame was sent/received on", HFILL } },

    { &hf_radiotap_channel_flags,
      { "Channel type", "radiotap.channel.type",
	FT_UINT16, BASE_HEX, VALS(phy_type), 0x0,
	NULL, HFILL } },

    { &hf_radiotap_channel_flags_turbo,
       { "Turbo", "radiotap.channel.type.turbo",
	 FT_BOOLEAN, 16, NULL, 0x0010, "Channel Type Turbo", HFILL } },
    { &hf_radiotap_channel_flags_cck,
       { "Complementary Code Keying (CCK)", "radiotap.channel.type.cck",
	 FT_BOOLEAN, 16, NULL, 0x0020, "Channel Type Complementary Code Keying (CCK) Modulation", HFILL } },
    { &hf_radiotap_channel_flags_ofdm,
       { "Orthogonal Frequency-Division Multiplexing (OFDM)", "radiotap.channel.type.ofdm",
	 FT_BOOLEAN, 16, NULL, 0x0040, "Channel Type Orthogonal Frequency-Division Multiplexing (OFDM)", HFILL } },
    { &hf_radiotap_channel_flags_2ghz,
       { "2 GHz spectrum", "radiotap.channel.type.2ghz",
	 FT_BOOLEAN, 16, NULL, 0x0080, "Channel Type 2 GHz spectrum", HFILL } },
    { &hf_radiotap_channel_flags_5ghz,
       { "5 GHz spectrum", "radiotap.channel.type.5ghz",
	 FT_BOOLEAN, 16, NULL, 0x0100, "Channel Type 5 GHz spectrum", HFILL } },
    { &hf_radiotap_channel_flags_passive,
       { "Passive", "radiotap.channel.type.passive",
	 FT_BOOLEAN, 16, NULL, 0x0200, "Channel Type Passive", HFILL } },
    { &hf_radiotap_channel_flags_dynamic,
       { "Dynamic CCK-OFDM", "radiotap.channel.type.dynamic",
	 FT_BOOLEAN, 16, NULL, 0x0400, "Channel Type Dynamic CCK-OFDM Channel", HFILL } },
    { &hf_radiotap_channel_flags_gfsk,
       { "Gaussian Frequency Shift Keying (GFSK)", "radiotap.channel.type.gfsk",
	 FT_BOOLEAN, 16, NULL, 0x0800, "Channel Type Gaussian Frequency Shift Keying (GFSK) Modulation", HFILL } },
    { &hf_radiotap_channel_flags_gsm,
       { "GSM (900MHz)", "radiotap.channel.type.gsm",
	 FT_BOOLEAN, 16, NULL, 0x1000, "Channel Type GSM", HFILL } },
    { &hf_radiotap_channel_flags_sturbo,
       { "Static Turbo", "radiotap.channel.type.sturbo",
	 FT_BOOLEAN, 16, NULL, 0x2000, "Channel Type Status Turbo", HFILL } },
    { &hf_radiotap_channel_flags_half,
       { "Half Rate Channel (10MHz Channel Width)", "radiotap.channel.type.half",
	 FT_BOOLEAN, 16, NULL, 0x4000, "Channel Type Half Rate", HFILL } },
    { &hf_radiotap_channel_flags_quarter,
       { "Quarter Rate Channel (5MHz Channel Width)", "radiotap.channel.type.quarter",
	 FT_BOOLEAN, 16, NULL, 0x8000, "Channel Type Quarter Rate", HFILL } },

    { &hf_radiotap_rxflags,
      { "RX flags", "radiotap.rxflags",
	FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },

    { &hf_radiotap_rxflags_badplcp,
       { "Bad PLCP", "radiotap.rxflags.badplcp",
	 FT_BOOLEAN, 24, NULL, IEEE80211_RADIOTAP_F_RX_BADPLCP,
	 "Frame with bad PLCP", HFILL } },

    { &hf_radiotap_xchannel,
      { "Channel number", "radiotap.xchannel",
	FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
    { &hf_radiotap_xchannel_frequency,
      { "Channel frequency", "radiotap.xchannel.freq",
	FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
    { &hf_radiotap_xchannel_flags,
      { "Channel type", "radiotap.xchannel.flags",
	FT_UINT32, BASE_HEX, VALS(phy_type), 0x0, NULL, HFILL } },

    { &hf_radiotap_xchannel_flags_turbo,
       { "Turbo", "radiotap.xchannel.type.turbo",
	 FT_BOOLEAN, 24, NULL, 0x0010, "Channel Type Turbo", HFILL } },
    { &hf_radiotap_xchannel_flags_cck,
       { "Complementary Code Keying (CCK)", "radiotap.xchannel.type.cck",
	 FT_BOOLEAN, 24, NULL, 0x0020, "Channel Type Complementary Code Keying (CCK) Modulation", HFILL } },
    { &hf_radiotap_xchannel_flags_ofdm,
       { "Orthogonal Frequency-Division Multiplexing (OFDM)", "radiotap.xchannel.type.ofdm",
	 FT_BOOLEAN, 24, NULL, 0x0040, "Channel Type Orthogonal Frequency-Division Multiplexing (OFDM)", HFILL } },
    { &hf_radiotap_xchannel_flags_2ghz,
       { "2 GHz spectrum", "radiotap.xchannel.type.2ghz",
	 FT_BOOLEAN, 24, NULL, 0x0080, "Channel Type 2 GHz spectrum", HFILL } },
    { &hf_radiotap_xchannel_flags_5ghz,
       { "5 GHz spectrum", "radiotap.xchannel.type.5ghz",
	 FT_BOOLEAN, 24, NULL, 0x0100, "Channel Type 5 GHz spectrum", HFILL } },
    { &hf_radiotap_xchannel_flags_passive,
       { "Passive", "radiotap.channel.xtype.passive",
	 FT_BOOLEAN, 24, NULL, 0x0200, "Channel Type Passive", HFILL } },
    { &hf_radiotap_xchannel_flags_dynamic,
       { "Dynamic CCK-OFDM", "radiotap.xchannel.type.dynamic",
	 FT_BOOLEAN, 24, NULL, 0x0400, "Channel Type Dynamic CCK-OFDM Channel", HFILL } },
    { &hf_radiotap_xchannel_flags_gfsk,
       { "Gaussian Frequency Shift Keying (GFSK)", "radiotap.xchannel.type.gfsk",
	 FT_BOOLEAN, 24, NULL, 0x0800, "Channel Type Gaussian Frequency Shift Keying (GFSK) Modulation", HFILL } },
    { &hf_radiotap_xchannel_flags_gsm,
       { "GSM (900MHz)", "radiotap.xchannel.type.gsm",
	 FT_BOOLEAN, 24, NULL, 0x1000, "Channel Type GSM", HFILL } },
    { &hf_radiotap_xchannel_flags_sturbo,
       { "Static Turbo", "radiotap.xchannel.type.sturbo",
	 FT_BOOLEAN, 24, NULL, 0x2000, "Channel Type Status Turbo", HFILL } },
    { &hf_radiotap_xchannel_flags_half,
       { "Half Rate Channel (10MHz Channel Width)", "radiotap.xchannel.type.half",
	 FT_BOOLEAN, 24, NULL, 0x4000, "Channel Type Half Rate", HFILL } },
    { &hf_radiotap_xchannel_flags_quarter,
       { "Quarter Rate Channel (5MHz Channel Width)", "radiotap.xchannel.type.quarter",
	 FT_BOOLEAN, 24, NULL, 0x8000, "Channel Type Quarter Rate", HFILL } },
    { &hf_radiotap_xchannel_flags_ht20,
       { "HT Channel (20MHz Channel Width)", "radiotap.xchannel.type.ht20",
	 FT_BOOLEAN, 24, NULL, 0x10000, "Channel Type HT/20", HFILL } },
    { &hf_radiotap_xchannel_flags_ht40u,
       { "HT Channel (40MHz Channel Width with Extension channel above)", "radiotap.xchannel.type.ht40u",
	 FT_BOOLEAN, 24, NULL, 0x20000, "Channel Type HT/40+", HFILL } },
    { &hf_radiotap_xchannel_flags_ht40d,
       { "HT Channel (40MHz Channel Width with Extension channel below)", "radiotap.xchannel.type.ht40d",
	 FT_BOOLEAN, 24, NULL, 0x40000, "Channel Type HT/40-", HFILL } },
#if 0
    { &hf_radiotap_xchannel_maxpower,
      { "Max transmit power", "radiotap.xchannel.maxpower",
	FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL } },
#endif
    { &hf_radiotap_fhss_hopset,
      { "FHSS Hop Set", "radiotap.fhss.hopset",
	FT_UINT8, BASE_DEC, NULL,  0x0,
	"Frequency Hopping Spread Spectrum hopset", HFILL } },

    { &hf_radiotap_fhss_pattern,
      { "FHSS Pattern", "radiotap.fhss.pattern",
	FT_UINT8, BASE_DEC, NULL,  0x0,
	"Frequency Hopping Spread Spectrum hop pattern", HFILL } },

    { &hf_radiotap_datarate,
      { "Data rate (Mb/s)", "radiotap.datarate",
	FT_FLOAT, BASE_NONE, NULL, 0x0,
	"Speed this frame was sent/received at", HFILL } },

    { &hf_radiotap_antenna,
      { "Antenna", "radiotap.antenna",
	FT_UINT32, BASE_DEC, NULL, 0x0,
	"Antenna number this frame was sent/received over (starting at 0)", HFILL } },

    { &hf_radiotap_dbm_antsignal,
      { "SSI Signal (dBm)", "radiotap.dbm_antsignal",
	FT_INT32, BASE_DEC, NULL, 0x0,
	"RF signal power at the antenna from a fixed, arbitrary value in decibels from one milliwatt", HFILL } },

    { &hf_radiotap_db_antsignal,
      { "SSI Signal (dB)", "radiotap.db_antsignal",
	FT_UINT32, BASE_DEC, NULL, 0x0,
	"RF signal power at the antenna from a fixed, arbitrary value in decibels", HFILL } },

    { &hf_radiotap_dbm_antnoise,
      { "SSI Noise (dBm)", "radiotap.dbm_antnoise",
	FT_INT32, BASE_DEC, NULL, 0x0,
	"RF noise power at the antenna from a fixed, arbitrary value in decibels per one milliwatt", HFILL } },

    { &hf_radiotap_db_antnoise,
      { "SSI Noise (dB)", "radiotap.db_antnoise",
	FT_UINT32, BASE_DEC, NULL, 0x0,
	"RF noise power at the antenna from a fixed, arbitrary value in decibels", HFILL } },

    { &hf_radiotap_tx_attenuation,
      { "Transmit attenuation", "radiotap.txattenuation",
	FT_UINT16, BASE_DEC, NULL, 0x0,
	"Transmit power expressed as unitless distance from max power set at factory (0 is max power)", HFILL } },

    { &hf_radiotap_db_tx_attenuation,
      { "Transmit attenuation (dB)", "radiotap.db_txattenuation",
	FT_UINT16, BASE_DEC, NULL, 0x0,
	"Transmit power expressed as decibels from max power set at factory (0 is max power)", HFILL } },

    { &hf_radiotap_txpower,
      { "Transmit power", "radiotap.txpower",
	FT_INT32, BASE_DEC, NULL, 0x0,
	"Transmit power in decibels per one milliwatt (dBm)", HFILL } },

    /* Special variables */
    { &hf_radiotap_fcs_bad,
      { "Bad FCS", "radiotap.fcs_bad",
	FT_BOOLEAN, BASE_NONE, NULL, 0x0,
	"Specifies if this frame has a bad frame check sequence", HFILL } },

  };
  static gint *ett[] = {
    &ett_radiotap,
    &ett_radiotap_present,
    &ett_radiotap_flags,
    &ett_radiotap_rxflags,
    &ett_radiotap_channel_flags,
    &ett_radiotap_xchannel_flags
  };
  module_t *radiotap_module;

  proto_radiotap = proto_register_protocol("IEEE 802.11 Radiotap Capture header", "802.11 Radiotap", "radiotap");
  proto_register_field_array(proto_radiotap, hf, array_length(hf));
  proto_register_subtree_array(ett, array_length(ett));
  register_dissector("radiotap", dissect_radiotap, proto_radiotap);

  radiotap_tap = register_tap("radiotap");

  radiotap_module = prefs_register_protocol(proto_radiotap, NULL);
  prefs_register_bool_preference(radiotap_module, "bit14_fcs_in_header",
      "Assume bit 14 means FCS in header",
      "Radiotap has a bit to indicate whether the FCS is still on the frame or not. "
      "Some generators (e.g. AirPcap) use a non-standard radiotap flag 14 to put "
      "the FCS into the header.",
      &radiotap_bit14_fcs);
}
コード例 #9
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");
}
コード例 #10
0
ファイル: file-file.c プロジェクト: DHODoS/wireshark
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.offset",
		    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_proto_name_and_key,
		  { "Protocol Name and Key", "file.proto_name_and_key",
		    FT_STRING, BASE_NONE, 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

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

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

	/* 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");
}
コード例 #11
0
void
proto_register_rtp_events(void)
{

    module_t *rtp_events_module;

    static hf_register_info hf[] =
    {
        {
            &hf_rtp_events_event,
            {
                "Event ID",
                "rtpevent.event_id",
                FT_UINT8,
                BASE_DEC,
                VALS(rtp_event_type_values),
                0x0,
                NULL, HFILL
            }
        },
        {
            &hf_rtp_events_end,
            {
                "End of Event",
                "rtpevent.end_of_event",
                FT_BOOLEAN,
                8,
                NULL,
                0x80,
                NULL, HFILL
            }
        },
        {
            &hf_rtp_events_reserved,
            {
                "Reserved",
                "rtpevent.reserved",
                FT_BOOLEAN,
                8,
                NULL,
                0x40,
                NULL, HFILL
            }
        },
        {
            &hf_rtp_events_volume,
            {
                "Volume",
                "rtpevent.volume",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x3F,
                NULL, HFILL
            }
        },

        {
            &hf_rtp_events_duration,
            {
                "Event Duration",
                "rtpevent.duration",
                FT_UINT16,
                BASE_DEC,
                NULL,
                0x0,
                NULL, HFILL
            }
        },

    };

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


    proto_rtp_events = proto_register_protocol("RFC 2833 RTP Event", "RTP Event", "rtpevent");
    proto_register_field_array(proto_rtp_events, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));


    /* Register preferences */
    rtp_events_module = prefs_register_protocol (proto_rtp_events, proto_reg_handoff_rtp_events);
    prefs_register_uint_preference (rtp_events_module,
                                    "event_payload_type_value", "Payload Type for RFC2833 RTP Events",
                                    "This is the value of the Payload Type field"
                                    " that specifies RTP Events", 10,
                                    &rtp_event_payload_type_value);


    prefs_register_uint_preference (rtp_events_module,
                                    "cisco_nse_payload_type_value", "Payload Type for Cisco Named Signaling Events",
                                    "This is the value of the Payload Type field"
                                    " that specifies Cisco Named Signaling Events", 10,
                                    &cisco_nse_pt_value);

    register_dissector("rtpevent", dissect_rtp_events, proto_rtp_events);
    rtp_event_tap = register_tap("rtpevent");
}
コード例 #12
0
ファイル: expert.c プロジェクト: DuLerWeil/wireshark
void
expert_packet_init(void)
{
	module_t *module_expert;
	uat_t    *expert_uat;

	static hf_register_info hf[] = {
		{ &hf_expert_msg,
			{ "Message", "_ws.expert.message", FT_STRING, BASE_NONE, NULL, 0, "Wireshark expert information", HFILL }
		},
		{ &hf_expert_group,
			{ "Group", "_ws.expert.group", FT_UINT32, BASE_HEX, VALS(expert_group_vals), 0, "Wireshark expert group", HFILL }
		},
		{ &hf_expert_severity,
			{ "Severity level", "_ws.expert.severity", FT_UINT32, BASE_HEX, VALS(expert_severity_vals), 0, "Wireshark expert severity level", HFILL }
		}
	};
	static gint *ett[] = {
		&ett_expert,
		&ett_subexpert
	};

	/* UAT for overriding severity levels */
	static uat_field_t custom_expert_fields[] = {
		UAT_FLD_CSTRING(uat_expert_entries, field, "Field name", "Expert Info filter name"),
		UAT_FLD_VS(uat_expert_entries, severity, "Severity", expert_severity_vals, "Custom severity level"),
		UAT_END_FIELDS
	};

	if (expert_tap == -1) {
		expert_tap = register_tap("expert");
	}

	if (proto_expert == -1) {
		proto_expert = proto_register_protocol("Expert Info", "Expert", "_ws.expert");
		proto_register_field_array(proto_expert, hf, array_length(hf));
		proto_register_subtree_array(ett, array_length(ett));
		proto_set_cant_toggle(proto_expert);

		module_expert = prefs_register_protocol(proto_expert, NULL);

		expert_uat = uat_new("Expert Info Severity Level Configuration",
			sizeof(expert_level_entry_t),
			"expert_severity",
			TRUE,
			(void **)&uat_expert_entries,
			&expert_level_entry_count,
			UAT_AFFECTS_DISSECTION,
			NULL,
			uat_expert_copy_cb,
			uat_expert_update_cb,
			uat_expert_free_cb,
			uat_expert_post_update_cb,
			custom_expert_fields);

		prefs_register_uat_preference(module_expert,
			"expert_severity_levels",
			"Severity Level Configuration",
			"A table that overrides Expert Info field severity levels to user configured levels",
			expert_uat);

	}

	highest_severity = 0;

	proto_malformed = proto_get_id_by_filter_name("_ws.malformed");
}
コード例 #13
0
/*--- proto_register_sv -------------------------------------------*/
void proto_register_sv(void) {

	/* List of fields */
	static hf_register_info hf[] = {
		{ &hf_sv_appid,
		{ "APPID",	"sv.appid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},

		{ &hf_sv_length,
		{ "Length",	"sv.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},

		{ &hf_sv_reserve1,
		{ "Reserved 1",	"sv.reserve1", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }},

		{ &hf_sv_reserve2,
		{ "Reserved 2",	"sv.reserve2", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }},

		{ &hf_sv_phmeas_instmag_i,
		{ "value", "sv.meas_value", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},

		{ &hf_sv_phsmeas_q,
		{ "quality", "sv.meas_quality", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}},

		{ &hf_sv_phsmeas_q_validity,
		{ "validity", "sv.meas_quality.validity", FT_UINT32, BASE_HEX, VALS(sv_q_validity_vals), Q_VALIDITY_MASK, NULL, HFILL}},

		{ &hf_sv_phsmeas_q_overflow,
		{ "overflow", "sv.meas_quality.overflow", FT_BOOLEAN, 32, NULL, Q_OVERFLOW, NULL, HFILL}},

		{ &hf_sv_phsmeas_q_outofrange,
		{ "out of range", "sv.meas_quality.outofrange", FT_BOOLEAN, 32, NULL, Q_OUTOFRANGE, NULL, HFILL}},

		{ &hf_sv_phsmeas_q_badreference,
		{ "bad reference", "sv.meas_quality.badreference", FT_BOOLEAN, 32, NULL, Q_BADREFERENCE, NULL, HFILL}},

		{ &hf_sv_phsmeas_q_oscillatory,
		{ "oscillatory", "sv.meas_quality.oscillatory", FT_BOOLEAN, 32, NULL, Q_OSCILLATORY, NULL, HFILL}},

		{ &hf_sv_phsmeas_q_failure,
		{ "failure", "sv.meas_quality.failure", FT_BOOLEAN, 32, NULL, Q_FAILURE, NULL, HFILL}},

		{ &hf_sv_phsmeas_q_olddata,
		{ "old data", "sv.meas_quality.olddata", FT_BOOLEAN, 32, NULL, Q_OLDDATA, NULL, HFILL}},

		{ &hf_sv_phsmeas_q_inconsistent,
		{ "inconsistent", "sv.meas_quality.inconsistent", FT_BOOLEAN, 32, NULL, Q_INCONSISTENT, NULL, HFILL}},

		{ &hf_sv_phsmeas_q_inaccurate,
		{ "inaccurate", "sv.meas_quality.inaccurate", FT_BOOLEAN, 32, NULL, Q_INACCURATE, NULL, HFILL}},

		{ &hf_sv_phsmeas_q_source,
		{ "source", "sv.meas_quality.source", FT_UINT32, BASE_HEX, VALS(sv_q_source_vals), Q_SOURCE_MASK, NULL, HFILL}},

		{ &hf_sv_phsmeas_q_test,
		{ "test", "sv.meas_quality.teset", FT_BOOLEAN, 32, NULL, Q_TEST, NULL, HFILL}},

		{ &hf_sv_phsmeas_q_operatorblocked,
		{ "operator blocked", "sv.meas_quality.operatorblocked", FT_BOOLEAN, 32, NULL, Q_OPERATORBLOCKED, NULL, HFILL}},

		{ &hf_sv_phsmeas_q_derived,
		{ "derived", "sv.meas_quality.derived", FT_BOOLEAN, 32, NULL, Q_DERIVED, NULL, HFILL}},


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

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

	static ei_register_info ei[] = {
		{ &ei_sv_mal_utctime, { "sv.malformed.utctime", PI_MALFORMED, PI_WARN, "BER Error: malformed UTCTime encoding", EXPFILL }},
		{ &ei_sv_zero_pdu, { "sv.zero_pdu", PI_PROTOCOL, PI_ERROR, "Internal error, zero-byte SV PDU", EXPFILL }},
	};

	expert_module_t* expert_sv;
	module_t *sv_module;

	/* Register protocol */
	proto_sv = proto_register_protocol(PNAME, PSNAME, PFNAME);
	register_dissector("sv", dissect_sv, proto_sv);

	/* Register fields and subtrees */
	proto_register_field_array(proto_sv, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));
	expert_sv = expert_register_protocol(proto_sv);
	expert_register_field_array(expert_sv, ei, array_length(ei));
	sv_module = prefs_register_protocol(proto_sv, NULL);
	prefs_register_bool_preference(sv_module, "decode_data_as_phsmeas",
		"Force decoding of seqData as PhsMeas",
		NULL, &sv_decode_data_as_phsmeas);

	/* Register tap */
	sv_tap = register_tap("sv");
}
コード例 #14
0
void proto_register_uasip(void)
{
    module_t *uasip_module;

    static hf_register_info hf_uasip[] = {
        {
            &hf_uasip_opcode,
            {
                "Opcode",
                "uasip.opcode",
                FT_UINT8,
                BASE_DEC | BASE_EXT_STRING,
                &uaudp_opcode_str_ext,
                0x0,
                "UA/SIP Opcode",
                HFILL
            }
        },
        {
            &hf_uasip_version,
            {
                "Version",
                "uasip.version",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/SIP Version",
                HFILL
            }
        },
        {
            &hf_uasip_window_size,
            {
                "Window Size",
                "uasip.window_size",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/SIP Window Size",
                HFILL
            }
        },
        {
            &hf_uasip_mtu,
            {
                "MTU",
                "uasip.mtu",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/SIP MTU",
                HFILL
            }
        },
        {
            &hf_uasip_udp_lost,
            {
                "UDP Lost",
                "uasip.udp_lost",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/SIP Lost",
                HFILL
            }
        },
        {
            &hf_uasip_udp_lost_reinit,
            {
                "UDP lost reinit",
                "uasip.udp_lost_reinit",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/SIP Lost Re-Init",
                HFILL
            }
        },
        {
            &hf_uasip_keepalive,
            {
                "Keepalive",
                "uasip.keepalive",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/SIP Keepalive",
                HFILL
            }
        },
        {
            &hf_uasip_qos_ip_tos,
            {
                "QoS IP TOS",
                "uasip.qos_ip_tos",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/SIP QoS IP TOS",
                HFILL
            }
        },
        {
            &hf_uasip_qos_8021_vlid,
            {
                "QoS 802.1 VLID",
                "uasip.qos_8021_vlid",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/SIP QoS 802.1 VLID",
                HFILL
            }
        },
        {
            &hf_uasip_qos_8021_pri,
            {
                "QoS 802.1 PRI",
                "uasip.qos_8021_pri",
                FT_UINT8,
                BASE_DEC,
                NULL,
                0x0,
                "UA/SIP QoS 802.1 PRI",
                HFILL
            }
        },
        {
            &hf_uasip_expseq,
            {
                "Sequence Number (expected)",
                "uasip.expseq",
                FT_UINT16,
                BASE_DEC,
                NULL,
                0x0,
                "UA/SIP Expected Sequence Number",
                HFILL
            }
        },
        {
            &hf_uasip_sntseq,
            {
                "Sequence Number (sent)",
                "uasip.sntseq",
                FT_UINT16,
                BASE_DEC,
                NULL,
                0x0,
                "UA/SIP Sent Sequence Number",
                HFILL
            }
        },
    };

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

    proto_uasip = proto_register_protocol("UA/SIP Protocol", "UASIP", "uasip");
    uasip_handle = register_dissector("uasip", dissect_uasip, proto_uasip);

    proto_register_field_array(proto_uasip, hf_uasip, array_length(hf_uasip));
    proto_register_subtree_array(ett, array_length(ett));

    uasip_module = prefs_register_protocol(proto_uasip, proto_reg_handoff_uasip);
    prefs_register_bool_preference(uasip_module, "aplication_octet_stream", "Try to decode application/octet-stream as UASIP", "UA SIP Protocol enabled", &uasip_enabled);
    prefs_register_bool_preference(uasip_module, "noesip", "Try to decode SIP NOE", "NOE SIP Protocol", &noesip_enabled);
    prefs_register_string_preference(uasip_module, "proxy_ipaddr", "Proxy IP Address",
                                     "IPv4 address of the proxy (Invalid values will be ignored)",
                                     &pref_proxy_ipaddr_s);
#if 0
    uasip_tap = register_tap("uasip");
#endif
}
コード例 #15
0
/* Register all the bits needed with the filtering engine */
void proto_register_actrace(void)
{
	static hf_register_info hf[] =
		{
			/* CAS */
			{ &hf_actrace_cas_time,
			  { "Time", "actrace.cas.time", FT_INT32, BASE_DEC, NULL, 0x0,
			    "Capture Time", HFILL }},
			{ &hf_actrace_cas_source,
			  { "Source", "actrace.cas.source", FT_INT32, BASE_DEC, VALS(actrace_cas_source_vals), 0x0,
			    NULL, HFILL }},
			{ &hf_actrace_cas_current_state,
			  { "Current State", "actrace.cas.curr_state", FT_INT32, BASE_DEC, NULL, 0x0,
			    NULL, HFILL }},
			{ &hf_actrace_cas_event,
			  { "Event", "actrace.cas.event", FT_INT32, BASE_DEC|BASE_EXT_STRING, &actrace_cas_event_vals_ext, 0x0,
			    "New Event", HFILL }},
			{ &hf_actrace_cas_next_state,
			  { "Next State", "actrace.cas.next_state", FT_INT32, BASE_DEC, NULL, 0x0,
			    NULL, HFILL }},
			{ &hf_actrace_cas_function,
			  { "Function", "actrace.cas.function", FT_INT32, BASE_DEC|BASE_EXT_STRING, &actrace_cas_function_vals_ext, 0x0,
			    NULL, HFILL }},
			{ &hf_actrace_cas_par0,
			  { "Parameter 0", "actrace.cas.par0", FT_INT32, BASE_DEC, NULL, 0x0,
			    NULL, HFILL }},
			{ &hf_actrace_cas_par1,
			  { "Parameter 1", "actrace.cas.par1", FT_INT32, BASE_DEC, NULL, 0x0,
			    NULL, HFILL }},
			{ &hf_actrace_cas_par2,
			  { "Parameter 2", "actrace.cas.par2", FT_INT32, BASE_DEC, NULL, 0x0,
			    NULL, HFILL }},
			{ &hf_actrace_cas_trunk,
			  { "Trunk Number", "actrace.cas.trunk", FT_INT32, BASE_DEC, NULL, 0x0,
			    NULL, HFILL }},
			{ &hf_actrace_cas_bchannel,
			  { "BChannel", "actrace.cas.bchannel", FT_INT32, BASE_DEC, NULL, 0x0,
			    NULL, HFILL }},
			{ &hf_actrace_cas_connection_id,
			  { "Connection ID", "actrace.cas.conn_id", FT_INT32, BASE_DEC, NULL, 0x0,
			    NULL, HFILL }},

			/* ISDN */
			{ &hf_actrace_isdn_trunk,
			  { "Trunk Number", "actrace.isdn.trunk", FT_INT16, BASE_DEC, NULL, 0x0,
			    NULL, HFILL }},
			{ &hf_actrace_isdn_direction,
			  { "Direction", "actrace.isdn.dir", FT_INT32, BASE_DEC, VALS(actrace_isdn_direction_vals), 0x0,
			    NULL, HFILL }},
			{ &hf_actrace_isdn_length,
			  { "Length", "actrace.isdn.length", FT_INT16, BASE_DEC, NULL, 0x0,
			    NULL, HFILL }},
		};

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

	module_t *actrace_module;

	/* Register protocol */
	proto_actrace = proto_register_protocol("AudioCodes Trunk Trace", "ACtrace", "actrace");
	proto_register_field_array(proto_actrace, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));

	/* Register our configuration options */
	actrace_module = prefs_register_protocol(proto_actrace, proto_reg_handoff_actrace);

	prefs_register_uint_preference(actrace_module, "udp_port",
				       "AudioCodes Trunk Trace UDP port",
				       "Set the UDP port for AudioCodes Trunk Traces."
				       "Use http://x.x.x.x/TrunkTraces to enable the traces in the Blade",
				       10, &global_actrace_udp_port);

	prefs_register_obsolete_preference(actrace_module, "display_dissect_tree");

	actrace_tap = register_tap("actrace");
}
コード例 #16
0
ファイル: packet-ipx.c プロジェクト: AnkitKejriwal/wireshark
void
proto_register_ipx(void)
{
	static hf_register_info hf_ipx[] = {
		{ &hf_ipx_checksum,
		{ "Checksum",		"ipx.checksum", FT_UINT16, BASE_HEX, NULL, 0x0,
			NULL, HFILL }},

		{ &hf_ipx_src,
		{ "Source Address",	"ipx.src", FT_STRING, BASE_NONE, NULL, 0x0,
		  "Source IPX Address  \"network.node\"", HFILL }},

		{ &hf_ipx_dst,
		{ "Destination Address",	"ipx.dst", FT_STRING, BASE_NONE, NULL, 0x0,
		  "Destination IPX Address  \"network.node\"", HFILL }},
		{ &hf_ipx_addr,
		{ "Src/Dst Address",	"ipx.addr", FT_STRING, BASE_NONE, NULL, 0x0,
		  "Source or Destination IPX Address  \"network.node\"", HFILL }},

		{ &hf_ipx_len,
		{ "Length",		"ipx.len", FT_UINT16, BASE_DEC, NULL, 0x0,
			NULL, HFILL }},

		{ &hf_ipx_hops,
		{ "Transport Control (Hops)", "ipx.hops", FT_UINT8, BASE_DEC, NULL, 0x0,
			NULL, HFILL }},

		{ &hf_ipx_packet_type,
		{ "Packet Type",	"ipx.packet_type", FT_UINT8, BASE_HEX, VALS(ipx_packet_type_vals),
			0x0,
			NULL, HFILL }},

		{ &hf_ipx_dnet,
		{ "Destination Network","ipx.dst.net", FT_IPXNET, BASE_NONE, NULL, 0x0,
			NULL, HFILL }},

		{ &hf_ipx_dnode,
		{ "Destination Node",	"ipx.dst.node", FT_ETHER, BASE_NONE, NULL, 0x0,
			NULL, HFILL }},

		{ &hf_ipx_dsocket,
		{ "Destination Socket",	"ipx.dst.socket", FT_UINT16, BASE_HEX|BASE_EXT_STRING,
			&ipx_socket_vals_ext, 0x0,
			NULL, HFILL }},

		{ &hf_ipx_snet,
		{ "Source Network","ipx.src.net", FT_IPXNET, BASE_NONE, NULL, 0x0,
			NULL, HFILL }},

		{ &hf_ipx_snode,
		{ "Source Node",	"ipx.src.node", FT_ETHER, BASE_NONE, NULL, 0x0,
			NULL, HFILL }},

		{ &hf_ipx_ssocket,
		{ "Source Socket",	"ipx.src.socket", FT_UINT16, BASE_HEX|BASE_EXT_STRING,
			&ipx_socket_vals_ext, 0x0,
			NULL, HFILL }},

		{ &hf_ipx_net,
		{ "Source or Destination Network","ipx.net", FT_IPXNET, BASE_NONE, NULL, 0x0,
			NULL, HFILL }},

		{ &hf_ipx_node,
		{ "Source or Destination Node", "ipx.node", FT_ETHER, BASE_NONE, NULL, 0x0,
			NULL, HFILL }},

		{ &hf_ipx_socket,
		{ "Source or Destination Socket", "ipx.socket", FT_UINT16, BASE_HEX|BASE_EXT_STRING,
			&ipx_socket_vals_ext, 0x0,
			NULL, HFILL }},
	};

	static hf_register_info hf_spx[] = {
		{ &hf_spx_connection_control,
		{ "Connection Control",		"spx.ctl",
		  FT_UINT8,	BASE_HEX,	NULL,	0x0,
		  NULL, HFILL }},

		{ &hf_spx_connection_control_sys,
		{ "System Packet",		"spx.ctl.sys",
		  FT_BOOLEAN,	8,	NULL,	SPX_SYS_PACKET,
		  NULL, HFILL }},

		{ &hf_spx_connection_control_send_ack,
		{ "Send Ack",		"spx.ctl.send_ack",
		  FT_BOOLEAN,	8,	NULL,	SPX_SEND_ACK,
		  NULL, HFILL }},

		{ &hf_spx_connection_control_attn,
		{ "Attention",		"spx.ctl.attn",
		  FT_BOOLEAN,	8,	NULL,	SPX_ATTN,
		  NULL, HFILL }},

		{ &hf_spx_connection_control_eom,
		{ "End of Message",	"spx.ctl.eom",
		  FT_BOOLEAN,	8,	NULL,	SPX_EOM,
		  NULL, HFILL }},

		{ &hf_spx_datastream_type,
		{ "Datastream type",	       	"spx.type",
		  FT_UINT8,	BASE_HEX,	NULL,	0x0,
		  NULL, HFILL }},

		{ &hf_spx_src_id,
		{ "Source Connection ID",	"spx.src",
		  FT_UINT16,	BASE_DEC,	NULL,	0x0,
		  NULL, HFILL }},

		{ &hf_spx_dst_id,
		{ "Destination Connection ID",	"spx.dst",
		  FT_UINT16,	BASE_DEC,	NULL,	0x0,
		  NULL, HFILL }},

		{ &hf_spx_seq_nr,
		{ "Sequence Number",		"spx.seq",
		  FT_UINT16,	BASE_DEC,	NULL,	0x0,
		  NULL, HFILL }},

		{ &hf_spx_ack_nr,
		{ "Acknowledgment Number",	"spx.ack",
		  FT_UINT16,	BASE_DEC,	NULL,	0x0,
		  NULL, HFILL }},

		{ &hf_spx_all_nr,
		{ "Allocation Number",		"spx.alloc",
		  FT_UINT16,	BASE_DEC,	NULL,	0x0,
		  NULL, HFILL }},

		{ &hf_spx_rexmt_frame,
		{ "Retransmitted Frame Number",	"spx.rexmt_frame",
		  FT_FRAMENUM,	BASE_NONE,	NULL,	0x0,
		  NULL, HFILL }},
	};

	static hf_register_info hf_ipxrip[] = {
		{ &hf_ipxrip_request,
		{ "Request",			"ipxrip.request",
		  FT_BOOLEAN,	BASE_NONE,	NULL,	0x0,
		  "TRUE if IPX RIP request", HFILL }},

		{ &hf_ipxrip_response,
		{ "Response",			"ipxrip.response",
		  FT_BOOLEAN,	BASE_NONE,	NULL,	0x0,
		  "TRUE if IPX RIP response", HFILL }}
	};

	static hf_register_info hf_sap[] = {
		{ &hf_sap_request,
		{ "Request",			"ipxsap.request",
		  FT_BOOLEAN,	BASE_NONE,	NULL,	0x0,
		  "TRUE if SAP request", HFILL }},

		{ &hf_sap_response,
		{ "Response",			"ipxsap.response",
		  FT_BOOLEAN,	BASE_NONE,	NULL,	0x0,
		  "TRUE if SAP response", HFILL }}
	};

	static hf_register_info hf_ipxmsg[] = {
		{ &hf_msg_conn,
		{ "Connection Number",			"ipxmsg.conn",
		  FT_UINT8,	BASE_DEC,	NULL,	0x0,
		  NULL, HFILL }},

		{ &hf_msg_sigchar,
		{ "Signature Char",			"ipxmsg.sigchar",
		  FT_UINT8,	BASE_DEC,	VALS(ipxmsg_sigchar_vals),	0x0,
		  NULL, HFILL }}
	};

	static gint *ett[] = {
		&ett_ipx,
		&ett_spx,
		&ett_spx_connctrl,
		&ett_ipxmsg,
		&ett_ipxrip,
		&ett_serialization,
		&ett_ipxsap,
		&ett_ipxsap_server,
	};

	proto_ipx = proto_register_protocol("Internetwork Packet eXchange",
	    "IPX", "ipx");
	proto_register_field_array(proto_ipx, hf_ipx, array_length(hf_ipx));

	register_dissector("ipx", dissect_ipx, proto_ipx);

	proto_spx = proto_register_protocol("Sequenced Packet eXchange",
	    "SPX", "spx");
	proto_register_field_array(proto_spx, hf_spx, array_length(hf_spx));

	proto_ipxrip = proto_register_protocol("IPX Routing Information Protocol",
	    "IPX RIP", "ipxrip");
	proto_register_field_array(proto_ipxrip, hf_ipxrip, array_length(hf_ipxrip));

	proto_serialization = proto_register_protocol("NetWare Serialization Protocol",
	    "NW_SERIAL", "nw_serial");

	proto_ipxmsg = proto_register_protocol("IPX Message", "IPX MSG",
	    "ipxmsg");
	proto_register_field_array(proto_ipxmsg, hf_ipxmsg, array_length(hf_ipxmsg));

	proto_sap = proto_register_protocol("Service Advertisement Protocol",
	    "IPX SAP", "ipxsap");
	register_dissector("ipxsap", dissect_ipxsap, proto_sap);

	proto_register_field_array(proto_sap, hf_sap, array_length(hf_sap));

	proto_register_subtree_array(ett, array_length(ett));

	ipx_type_dissector_table = register_dissector_table("ipx.packet_type",
	    "IPX packet type", FT_UINT8, BASE_HEX);
	ipx_socket_dissector_table = register_dissector_table("ipx.socket",
	    "IPX socket", FT_UINT16, BASE_HEX);
	spx_socket_dissector_table = register_dissector_table("spx.socket",
	    "SPX socket", FT_UINT16, BASE_HEX);

	register_init_routine(&spx_init_protocol);
	register_postseq_cleanup_routine(&spx_postseq_cleanup);
	ipx_tap=register_tap("ipx");
}
コード例 #17
0
ファイル: packet-eth.c プロジェクト: mcrotty/stack
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_src,
        { "Source", "eth.src", FT_ETHER, BASE_NONE, NULL, 0x0,
            "Source Hardware Address", 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_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
    };
    module_t *eth_module;

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

    /* 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_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");
}
コード例 #18
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));
	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");
}
コード例 #19
0
ファイル: packet-uaudp.c プロジェクト: huzhiren/wireshark
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
}
コード例 #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(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 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 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 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 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");
  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);

}
コード例 #21
0
/* Wireshark Protocol Registration */
void
proto_register_t38(void)
{
	static hf_register_info hf[] =
	{
#include "packet-t38-hfarr.c"
		{   &hf_t38_setup,
		    { "Stream setup", "t38.setup", FT_STRING, BASE_NONE,
		    NULL, 0x0, "Stream setup, method and frame number", HFILL }},
		{   &hf_t38_setup_frame,
            { "Stream frame", "t38.setup-frame", FT_FRAMENUM, BASE_NONE,
            NULL, 0x0, "Frame that set up this stream", HFILL }},
        {   &hf_t38_setup_method,
            { "Stream Method", "t38.setup-method", FT_STRING, BASE_NONE,
            NULL, 0x0, "Method used to set up this stream", HFILL }},
		{&hf_t38_fragments,
			{"Message fragments", "t38.fragments",
			FT_NONE, BASE_NONE, NULL, 0x00,	NULL, HFILL } },
		{&hf_t38_fragment,
			{"Message fragment", "t38.fragment",
			FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
		{&hf_t38_fragment_overlap,
			{"Message fragment overlap", "t38.fragment.overlap",
			FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } },
		{&hf_t38_fragment_overlap_conflicts,
			{"Message fragment overlapping with conflicting data",
			"t38.fragment.overlap.conflicts",
			FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } },
		{&hf_t38_fragment_multiple_tails,
			{"Message has multiple tail fragments",
			"t38.fragment.multiple_tails",
			FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } },
		{&hf_t38_fragment_too_long_fragment,
			{"Message fragment too long", "t38.fragment.too_long_fragment",
			FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } },
		{&hf_t38_fragment_error,
			{"Message defragmentation error", "t38.fragment.error",
			FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
		{&hf_t38_fragment_count,
			{"Message fragment count", "t38.fragment.count",
			FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } },
		{&hf_t38_reassembled_in,
			{"Reassembled in", "t38.reassembled.in",
			FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
		{&hf_t38_reassembled_length,
			{"Reassembled T38 length", "t38.reassembled.length",
			FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } },
	};

	static gint *ett[] =
	{
		&ett_t38,
#include "packet-t38-ettarr.c"
		&ett_t38_setup,
		&ett_data_fragment,
		&ett_data_fragments
	};

	module_t *t38_module;

	proto_t38 = proto_register_protocol("T.38", "T.38", "t38");
	proto_register_field_array(proto_t38, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));
	register_dissector("t38", dissect_t38, proto_t38);

	/* Init reassemble tables for HDLC */
	register_init_routine(t38_defragment_init);

	t38_tap = register_tap("t38");

	t38_module = prefs_register_protocol(proto_t38, proto_reg_handoff_t38);
	prefs_register_bool_preference(t38_module, "use_pre_corrigendum_asn1_specification",
	    "Use the Pre-Corrigendum ASN.1 specification",
	    "Whether the T.38 dissector should decode using the Pre-Corrigendum T.38 "
		"ASN.1 specification (1998).",
	    &use_pre_corrigendum_asn1_specification);
	prefs_register_bool_preference(t38_module, "dissect_possible_rtpv2_packets_as_rtp",
	    "Dissect possible RTP version 2 packets with RTP dissector",
	    "Whether a UDP packet that looks like RTP version 2 packet will "
		"be dissected as RTP packet or T.38 packet. If enabled there is a risk that T.38 UDPTL "
		"packets with sequence number higher than 32767 may be dissected as RTP.",
	    &dissect_possible_rtpv2_packets_as_rtp);
	prefs_register_uint_preference(t38_module, "tcp.port",
		"T.38 TCP Port",
		"Set the TCP port for T.38 messages",
		10, &global_t38_tcp_port);
	prefs_register_uint_preference(t38_module, "udp.port",
		"T.38 UDP Port",
		"Set the UDP port for T.38 messages",
		10, &global_t38_udp_port);
	prefs_register_bool_preference(t38_module, "reassembly",
		"Reassemble T.38 PDUs over TPKT over TCP",
		"Whether the dissector should reassemble T.38 PDUs spanning multiple TCP segments "
		"when TPKT is used over TCP. "
		"To use this option, you must also enable \"Allow subdissectors to reassemble "
		"TCP streams\" in the TCP protocol settings.",
		&t38_tpkt_reassembly);
	prefs_register_enum_preference(t38_module, "tpkt_usage",
		"TPKT used over TCP",
		"Whether T.38 is used with TPKT for TCP",
		(gint *)&t38_tpkt_usage,t38_tpkt_options,FALSE);

	prefs_register_bool_preference(t38_module, "show_setup_info",
                "Show stream setup information",
                "Where available, show which protocol and frame caused "
                "this T.38 stream to be created",
                &global_t38_show_setup_info);

}
コード例 #22
0
/*--- 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");

}