예제 #1
0
void
epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_data),
	  void (*register_all_handoffs_func)(register_cb cb, gpointer client_data),
	  register_cb cb,
	  gpointer client_data,
	  void (*report_failure)(const char *, va_list),
	  void (*report_open_failure)(const char *, int, gboolean),
	  void (*report_read_failure)(const char *, int),
	  void (*report_write_failure)(const char *, int))
{
	init_report_err(report_failure, report_open_failure,
	    report_read_failure, report_write_failure);

	/* initialize memory allocation subsystem */
	ep_init_chunk();
	se_init_chunk();

	/* initialize the GUID to name mapping table */
	guids_init();

	except_init();
#ifdef HAVE_LIBGNUTLS
	gnutls_global_init();
#elif defined(HAVE_LIBGCRYPT)
	gcry_check_version(NULL);
#endif
	tvbuff_init();
	tap_init();
	prefs_init();
	proto_init(register_all_protocols_func, register_all_handoffs_func,
	    cb, client_data);
	packet_init();
	dfilter_init();
	final_registration_all_protocols();
	host_name_lookup_init();
	expert_init();
	oids_init();
#ifdef HAVE_LUA_5_1
	wslua_init(NULL);
#endif
#ifdef HAVE_GEOIP
	geoip_db_init();
#endif

}
예제 #2
0
void
epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_data),
          void (*register_all_handoffs_func)(register_cb cb, gpointer client_data),
          register_cb cb,
          gpointer client_data,
          void (*report_failure_fcn_p)(const char *, va_list),
          void (*report_open_failure_fcn_p)(const char *, int, gboolean),
          void (*report_read_failure_fcn_p)(const char *, int),
          void (*report_write_failure_fcn_p)(const char *, int))
{
    init_report_err(report_failure_fcn_p, report_open_failure_fcn_p,
                    report_read_failure_fcn_p, report_write_failure_fcn_p);

    /* initialize memory allocation subsystems */
    emem_init();
    wmem_init();

    /* initialize the GUID to name mapping table */
    guids_init();

    except_init();
#ifdef HAVE_LIBGCRYPT
    /* initialize libgcrypt (beware, it won't be thread-safe) */
    gcry_check_version(NULL);
    gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
    gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
#ifdef HAVE_LIBGNUTLS
    gnutls_global_init();
#endif
    tap_init();
    prefs_init();
    expert_init();
    proto_init(register_all_protocols_func, register_all_handoffs_func,
               cb, client_data);
    packet_init();
    dfilter_init();
    final_registration_all_protocols();
    /*host_name_lookup_init();*//* We load the hostname file in cf_open, no need to do it here? */
    expert_packet_init();
#ifdef HAVE_LUA
    wslua_init(cb, client_data);
#endif
}
예제 #3
0
void
epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_data),
	  void (*register_all_handoffs_func)(register_cb cb, gpointer client_data),
	  register_cb cb,
	  gpointer client_data)
{
	/* initialize memory allocation subsystem */
	wmem_init();

	/* initialize the GUID to name mapping table */
	guids_init();

        /* initialize name resolution (addr_resolv.c) */
        addr_resolv_init();

	except_init();
#ifdef HAVE_LIBGCRYPT
	/* initialize libgcrypt (beware, it won't be thread-safe) */
	gcry_check_version(NULL);
	gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
	gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
#ifdef HAVE_LIBGNUTLS
	gnutls_global_init();
#endif
	tap_init();
	prefs_init();
	expert_init();
	packet_init();
	proto_init(register_all_protocols_func, register_all_handoffs_func,
	    cb, client_data);
	packet_cache_proto_handles();
	dfilter_init();
	final_registration_all_protocols();
	print_cache_field_handles();
	expert_packet_init();
#ifdef HAVE_LUA
	wslua_init(cb, client_data);
#endif
}
예제 #4
0
파일: epan.c 프로젝트: crondaemon/wireshark
gboolean
epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_data),
	  void (*register_all_handoffs_func)(register_cb cb, gpointer client_data),
	  register_cb cb,
	  gpointer client_data)
{
	volatile gboolean status = TRUE;

	/* initialize memory allocation subsystem */
	wmem_init();

	/* initialize the GUID to name mapping table */
	guids_init();

	/* initialize name resolution (addr_resolv.c) */
	addr_resolv_init();

	except_init();
#ifdef HAVE_LIBGCRYPT
	/* initialize libgcrypt (beware, it won't be thread-safe) */
	gcry_check_version(NULL);
	gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
	gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
#ifdef HAVE_LIBGNUTLS
	gnutls_global_init();
#endif
	TRY {
		tap_init();
		prefs_init();
		expert_init();
		packet_init();
		capture_dissector_init();
		proto_init(register_all_protocols_func, register_all_handoffs_func,
		    cb, client_data);
		packet_cache_proto_handles();
		dfilter_init();
		final_registration_all_protocols();
		print_cache_field_handles();
		expert_packet_init();
		export_pdu_init();
#ifdef HAVE_LUA
		wslua_init(cb, client_data);
#endif
	}
	CATCH(DissectorError) {
		/*
		 * This is probably a dissector, or something it calls,
		 * calling REPORT_DISSECTOR_ERROR() in a registration
		 * routine or something else outside the normal dissection
		 * code path.
		 */
		const char *exception_message = GET_MESSAGE;
		static const char dissector_error_nomsg[] =
		    "Dissector writer didn't bother saying what the error was";

		report_failure("Dissector bug: %s",
			       exception_message == NULL ?
				 dissector_error_nomsg : exception_message);
		if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
			abort();
		status = FALSE;
	}
	ENDTRY;
	return status;
}