void
proto_register_acap(void)
{
#ifndef HAVE_HFI_SECTION_INIT
	static header_field_info *hfi[] = {
		&hfi_acap_response,
		&hfi_acap_request,
	};
#endif

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

	int proto_acap;

	proto_acap = proto_register_protocol("Application Configuration Access Protocol",
					     "ACAP", "acap");
	hfi_acap = proto_registrar_get_nth(proto_acap);

	proto_register_fields(proto_acap, hfi, array_length(hfi));
	proto_register_subtree_array(ett, array_length(ett));

	acap_handle = create_dissector_handle(dissect_acap, proto_acap);
}
void
proto_register_http_urlencoded(void)
{
#ifndef HAVE_HFI_SECTION_INIT
	static header_field_info *hfi[] = {
		&hfi_form_key,
		&hfi_form_value,
	};
#endif

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

	int proto_urlencoded;

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

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

	proto_register_fields(proto_urlencoded, hfi, array_length(hfi));
	proto_register_subtree_array(ett, array_length(ett));
}
示例#3
0
void
proto_register_hpext(void)
{
#ifndef HAVE_HFI_SECTION_INIT
	static header_field_info *hfi[] = {
		&hfi_hpext_dxsap,
		&hfi_hpext_sxsap,
	};
#endif

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

	int proto_hpext;

	proto_hpext = proto_register_protocol(
	    "HP Extended Local-Link Control", "HPEXT", "hpext");
	hfi_hpext = proto_registrar_get_nth(proto_hpext);

	proto_register_fields(proto_hpext, hfi, array_length(hfi));
	proto_register_subtree_array(ett, array_length(ett));

/* subdissector code */
	subdissector_table = register_dissector_table("hpext.dxsap",
	  "HPEXT XSAP", FT_UINT16, BASE_HEX);

	hpext_handle = register_dissector("hpext", dissect_hpext, proto_hpext);
}
示例#4
0
void
proto_register_redback(void)
{
#ifndef HAVE_HFI_SECTION_INIT
	static header_field_info *hfi[] = {
		&hfi_redback_context,
		&hfi_redback_flags,
		&hfi_redback_circuit,
		&hfi_redback_length,
		&hfi_redback_protocol,
		&hfi_redback_l3offset,
		&hfi_redback_dataoffset,
		&hfi_redback_padding,
		&hfi_redback_unknown,
	};
#endif

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

	int proto_redback;

	proto_redback = proto_register_protocol("Redback", "Redback", "redback");
	hfi_redback   = proto_registrar_get_nth(proto_redback);

	proto_register_fields(proto_redback, hfi, array_length(hfi));
	proto_register_subtree_array(ett, array_length(ett));

	redback_handle = create_dissector_handle(dissect_redback, proto_redback);
}
示例#5
0
void
proto_register_nflog(void)
{
#ifndef HAVE_HFI_SECTION_INIT
	static header_field_info *hfi[] = {
	/* Header */
		&hfi_nflog_family,
		&hfi_nflog_version,
		&hfi_nflog_resid,
		&hfi_nflog_encoding,
	/* TLV */
		&hfi_nflog_tlv,
		&hfi_nflog_tlv_length,
		&hfi_nflog_tlv_type,
	/* TLV values */
		&hfi_nflog_tlv_prefix,
		&hfi_nflog_tlv_uid,
		&hfi_nflog_tlv_gid,
		&hfi_nflog_tlv_timestamp,
		&hfi_nflog_tlv_unknown,
	};
#endif

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

	module_t *pref;

	int proto_nflog;

	proto_nflog = proto_register_protocol("Linux Netfilter NFLOG", "NFLOG", "nflog");
	hfi_nflog = proto_registrar_get_nth(proto_nflog);

	pref = prefs_register_protocol(proto_nflog, NULL);
	prefs_register_enum_preference(pref, "byte_order_type", "Byte Order", "Byte Order",
				       &nflog_byte_order, byte_order_types, FALSE);

	register_dissector("nflog", dissect_nflog, proto_nflog);

	proto_register_fields(proto_nflog, hfi, array_length(hfi));
	proto_register_subtree_array(ett, array_length(ett));

}
示例#6
0
void
proto_register_jpeg(void)
{
#ifndef HAVE_HFI_SECTION_INIT
	static header_field_info *hfi[] =
	{
		&hfi_rtp_jpeg_main_hdr,
		&hfi_rtp_jpeg_main_hdr_ts,
		&hfi_rtp_jpeg_main_hdr_offs,
		&hfi_rtp_jpeg_main_hdr_type,
		&hfi_rtp_jpeg_main_hdr_q,
		&hfi_rtp_jpeg_main_hdr_width,
		&hfi_rtp_jpeg_main_hdr_height,
		&hfi_rtp_jpeg_restart_hdr,
		&hfi_rtp_jpeg_restart_hdr_interval,
		&hfi_rtp_jpeg_restart_hdr_f,
		&hfi_rtp_jpeg_restart_hdr_l,
		&hfi_rtp_jpeg_restart_hdr_count,
		&hfi_rtp_jpeg_qtable_hdr,
		&hfi_rtp_jpeg_qtable_hdr_mbz,
		&hfi_rtp_jpeg_qtable_hdr_prec,
		&hfi_rtp_jpeg_qtable_hdr_length,
		&hfi_rtp_jpeg_qtable_hdr_data,
		&hfi_rtp_jpeg_payload,
	};
#endif

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

	int proto_jpeg;

	proto_jpeg = proto_register_protocol("RFC 2435 JPEG","JPEG","jpeg");
	hfi_jpeg = proto_registrar_get_nth(proto_jpeg);

	proto_register_fields(proto_jpeg, hfi, array_length(hfi));
	proto_register_subtree_array(ett, array_length(ett));

	jpeg_handle = create_dissector_handle(dissect_jpeg, proto_jpeg);

	/* RFC 2798 */
	register_ber_oid_dissector_handle("0.9.2342.19200300.100.1.60", jpeg_handle, proto_jpeg, "jpegPhoto");
}
示例#7
0
void
proto_register_rip(void)
{
#ifndef HAVE_HFI_SECTION_INIT
	static header_field_info *hfi[] = {
		&hfi_rip_command,
		&hfi_rip_version,
		&hfi_rip_family,
		&hfi_rip_routing_domain,
		&hfi_rip_ip,
		&hfi_rip_netmask,
		&hfi_rip_next_hop,
		&hfi_rip_metric,
		&hfi_rip_auth,
		&hfi_rip_auth_passwd,
		&hfi_rip_route_tag,
	};
#endif /* HAVE_HFI_SECTION_INIT */

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

	module_t *rip_module;
	int proto_rip;

	proto_rip = proto_register_protocol("Routing Information Protocol",
				"RIP", "rip");
	hfi_rip = proto_registrar_get_nth(proto_rip);

	proto_register_fields(proto_rip, hfi, array_length(hfi));
	proto_register_subtree_array(ett, array_length(ett));

	rip_module = prefs_register_protocol(proto_rip, proto_reg_handoff_rip);

	prefs_register_bool_preference(rip_module, "display_routing_domain", "Display Routing Domain field", "Display the third and forth bytes of the RIPv2 header as the Routing Domain field (introduced in RFC 1388 [January 1993] and obsolete as of RFC 1723 [November 1994])", &pref_display_routing_domain);

	rip_handle = create_dissector_handle(dissect_rip, proto_rip);
}
示例#8
0
void
proto_register_daytime(void)
{
  static header_field_info *hfi[] = {
    &hfi_daytime_string,
  };

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

  int proto_daytime;

  proto_daytime = proto_register_protocol("Daytime Protocol", "DAYTIME", "daytime");
  hfi_daytime = proto_registrar_get_nth(proto_daytime);

  proto_register_fields(proto_daytime, hfi, array_length(hfi));
  proto_register_subtree_array(ett, array_length(ett));

  daytime_handle = create_dissector_handle(dissect_daytime, proto_daytime);
}
示例#9
0
void
proto_register_nflog(void)
{
#ifndef HAVE_HFI_SECTION_INIT
    static header_field_info *hfi[] = {
    /* Header */
        &hfi_nflog_family,
        &hfi_nflog_version,
        &hfi_nflog_resid,
    /* TLV */
        &hfi_nflog_tlv,
        &hfi_nflog_tlv_length,
        &hfi_nflog_tlv_type,
    /* TLV values */
        &hfi_nflog_tlv_prefix,
        &hfi_nflog_tlv_uid,
        &hfi_nflog_tlv_gid,
        &hfi_nflog_tlv_timestamp,
        &hfi_nflog_tlv_unknown,
    };
#endif

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

    int proto_nflog;

    proto_nflog = proto_register_protocol("Linux Netfilter NFLOG", "NFLOG", "nflog");
    hfi_nflog = proto_registrar_get_nth(proto_nflog);

    register_dissector("nflog", dissect_nflog, proto_nflog);

    proto_register_fields(proto_nflog, hfi, array_length(hfi));
    proto_register_subtree_array(ett, array_length(ett));

}
示例#10
0
void
proto_register_redback(void)
{
#ifndef HAVE_HFI_SECTION_INIT
	static header_field_info *hfi[] = {
		&hfi_redback_context,
		&hfi_redback_flags,
		&hfi_redback_circuit,
		&hfi_redback_length,
		&hfi_redback_protocol,
		&hfi_redback_l3offset,
		&hfi_redback_dataoffset,
		&hfi_redback_padding,
		&hfi_redback_unknown,
	};
#endif

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

	static ei_register_info ei[] = {
		{ &ei_redback_protocol, { "redback.protocol.unknown", PI_PROTOCOL, PI_WARN, "Unknown Protocol Data", EXPFILL }},
	};

	expert_module_t* expert_redback;
	int proto_redback;

	proto_redback = proto_register_protocol("Redback", "Redback", "redback");
	hfi_redback   = proto_registrar_get_nth(proto_redback);

	proto_register_fields(proto_redback, hfi, array_length(hfi));
	proto_register_subtree_array(ett, array_length(ett));
	expert_redback = expert_register_protocol(proto_redback);
	expert_register_field_array(expert_redback, ei, array_length(ei));

	redback_handle = create_dissector_handle(dissect_redback, proto_redback);
}
示例#11
0
void
proto_register_udp(void)
{
  module_t *udp_module;
  module_t *udplite_module;
  expert_module_t* expert_udp;

#ifndef HAVE_HFI_SECTION_INIT
  static header_field_info *hfi[] = {
    &hfi_udp_srcport,
    &hfi_udp_dstport,
    &hfi_udp_port,
    &hfi_udp_stream,
    &hfi_udp_length,
    &hfi_udp_checksum,
    &hfi_udp_checksum_calculated,
    &hfi_udp_checksum_good,
    &hfi_udp_checksum_bad,
    &hfi_udp_proc_src_uid,
    &hfi_udp_proc_src_pid,
    &hfi_udp_proc_src_uname,
    &hfi_udp_proc_src_cmd,
    &hfi_udp_proc_dst_uid,
    &hfi_udp_proc_dst_pid,
    &hfi_udp_proc_dst_uname,
    &hfi_udp_proc_dst_cmd,
  };

  static header_field_info *hfi_lite[] = {
    &hfi_udplite_checksum_coverage_bad,
    &hfi_udplite_checksum_coverage,
  };
#endif

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

  static ei_register_info ei[] = {
    { &ei_udp_possible_traceroute, { "udp.possible_traceroute", PI_SEQUENCE, PI_CHAT, "Possible traceroute", EXPFILL }},
    { &ei_udp_length, { "udp.length.bad", PI_MALFORMED, PI_ERROR, "Bad length value", EXPFILL }},
    { &ei_udplite_checksum_coverage, { "udp.checksum_coverage.expert", PI_MALFORMED, PI_ERROR, "Bad checksum coverage length value", EXPFILL }},
    { &ei_udp_checksum_zero, { "udp.checksum.zero", PI_CHECKSUM, PI_ERROR, "Illegal Checksum value (0)", EXPFILL }},
    { &ei_udp_checksum_bad, { "udp.checksum_bad.expert", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL }},
  };

  static build_valid_func udp_da_src_values[1] = {udp_src_value};
  static build_valid_func udp_da_dst_values[1] = {udp_dst_value};
  static build_valid_func udp_da_both_values[2] = {udp_src_value, udp_dst_value};
  static decode_as_value_t udp_da_values[3] = {{udp_src_prompt, 1, udp_da_src_values}, {udp_dst_prompt, 1, udp_da_dst_values}, {udp_both_prompt, 2, udp_da_both_values}};
  static decode_as_t udp_da = {"udp", "Transport", "udp.port", 3, 2, udp_da_values, "UDP", "port(s) as",
                               decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL};

  int proto_udp, proto_udplite;

  proto_udp = proto_register_protocol("User Datagram Protocol",
                                      "UDP", "udp");
  hfi_udp = proto_registrar_get_nth(proto_udp);
  udp_handle = register_dissector("udp", dissect_udp, proto_udp);
  expert_udp = expert_register_protocol(proto_udp);
  proto_register_fields(proto_udp, hfi, array_length(hfi));

  proto_udplite = proto_register_protocol("Lightweight User Datagram Protocol",
                                          "UDPlite", "udplite");
  udplite_handle = create_dissector_handle(dissect_udplite, proto_udplite);
  hfi_udplite = proto_registrar_get_nth(proto_udplite);
  proto_register_fields(proto_udplite, hfi_lite, array_length(hfi_lite));

  proto_register_subtree_array(ett, array_length(ett));
  expert_register_field_array(expert_udp, ei, array_length(ei));

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

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

  udplite_module = prefs_register_protocol(proto_udplite, NULL);
  prefs_register_bool_preference(udplite_module, "ignore_checksum_coverage",
                                 "Ignore UDPlite checksum coverage",
                                 "Ignore an invalid checksum coverage field and continue dissection",
                                 &udplite_ignore_checksum_coverage);
  prefs_register_bool_preference(udplite_module, "check_checksum",
                                 "Validate the UDPlite checksum if possible",
                                 "Whether to validate the UDPlite checksum",
                                 &udplite_check_checksum);

  register_decode_as(&udp_da);

  register_init_routine(udp_init);

}