Exemple #1
0
void
epan_free(epan_t *session)
{
	if (session) {
		/* XXX, it should take session as param */
		cleanup_dissection();

		g_slice_free(epan_t, session);
	}
}
Exemple #2
0
void
epan_cleanup(void)
{
	cleanup_dissection();
	dfilter_cleanup();
	proto_cleanup();
	prefs_cleanup();
	packet_cleanup();
	oid_resolv_cleanup();
#ifdef HAVE_LIBGNUTLS
	gnutls_global_deinit();
#endif
	except_deinit();
	host_name_lookup_cleanup();
}
Exemple #3
0
int CaptureFile::close() {
    wtap_close(wth);
    cleanup_dissection();
    return 0;
}
cf_status_t cf_open(capture_file *cf, const char *fname, gboolean is_tempfile, int *err)
{
  wtap       *wth;
  gchar       *err_info;
  //char        err_msg[2048+1];

  dprintf("%s: fname =  %s\n", __FUNCTION__, fname);
  dprintf("%s: is_tempfile = %d  err = %p\n", __FUNCTION__, is_tempfile, err);
  wth = wtap_open_offline(fname, err, &err_info, FALSE);
  dprintf("wth = %p\n", wth);
  if (wth == NULL)
    goto fail;

  /* The open succeeded.  Fill in the information for this file. */

#if WIRESHARK_1_4_0
  /* Cleanup all data structures used for dissection. */
  cleanup_dissection();
#endif

  /* Initialize all data structures used for dissection. */
  init_dissection();

  cf->wth = wth;
  cf->f_datalen = 0; /* not used, but set it anyway */

  /* Set the file name because we need it to set the follow stream filter.
     XXX - is that still true?  We need it for other reasons, though,
     in any case. */
  cf->filename = g_strdup(fname);

  /* Indicate whether it's a permanent or temporary file. */
  cf->is_tempfile = is_tempfile;

  /* If it's a temporary capture buffer file, mark it as not saved. */
  cf->user_saved = !is_tempfile;

  cf->cd_t      = wtap_file_type(cf->wth);
  cf->count     = 0;
  cf->drops_known = FALSE;
  cf->drops     = 0;
  cf->snap      = wtap_snapshot_length(cf->wth);
  if (cf->snap == 0)
    {
      /* Snapshot length not known. */
      cf->has_snap = FALSE;
      cf->snap = WTAP_MAX_PACKET_SIZE;
    }
  else
    cf->has_snap = TRUE;
  nstime_set_zero(&cf->elapsed_time);
  nstime_set_unset(&first_ts);
  nstime_set_unset(&prev_dis_ts);
  nstime_set_unset(&prev_cap_ts);

  dprintf("%s: exiting\n", __FUNCTION__);

  return CF_OK;

fail:
  g_snprintf(sharktools_errmsg, sizeof(sharktools_errmsg),
             cf_open_error_message(*err, err_info, cf->cd_t), fname);
  return CF_ERROR;
}
Exemple #5
0
/**
	Wrapper for dissection structures cleanup
*/
extern "C" __declspec(dllexport) void hf_one_iteration_cleanup()
{
	cleanup_dissection();
}