Wireshark  4.3.0
The Wireshark network protocol analyzer
Macros | Functions
filesystem.h File Reference
#include <wireshark.h>

Go to the source code of this file.

Macros

#define DEFAULT_PROFILE   "Default"
 

Functions

WS_DLL_PUBLIC char * configuration_init (const char *arg0, const char *namespace_name)
 
WS_DLL_PUBLIC const char * get_configuration_namespace (void)
 
WS_DLL_PUBLIC bool is_packet_configuration_namespace (void)
 
WS_DLL_PUBLIC const char * get_progfile_dir (void)
 
WS_DLL_PUBLIC char * get_executable_path (const char *filename)
 
WS_DLL_PUBLIC const char * get_plugins_dir (void)
 
WS_DLL_PUBLIC const char * get_plugins_dir_with_version (void)
 
WS_DLL_PUBLIC const char * get_plugins_pers_dir (void)
 
WS_DLL_PUBLIC const char * get_plugins_pers_dir_with_version (void)
 
WS_DLL_PUBLIC const char * get_extcap_dir (void)
 
WS_DLL_PUBLIC const char * get_extcap_pers_dir (void)
 
WS_DLL_PUBLIC bool running_in_build_directory (void)
 
WS_DLL_PUBLIC const char * get_datafile_dir (void)
 
WS_DLL_PUBLIC char * get_datafile_path (const char *filename)
 
WS_DLL_PUBLIC const char * get_doc_dir (void)
 
WS_DLL_PUBLIC char * get_docfile_path (const char *filename)
 
WS_DLL_PUBLIC char * doc_file_url (const char *filename)
 
WS_DLL_PUBLIC const char * get_systemfile_dir (void)
 
WS_DLL_PUBLIC void set_profile_name (const char *profilename)
 
WS_DLL_PUBLIC const char * get_profile_name (void)
 
WS_DLL_PUBLIC bool is_default_profile (void)
 
WS_DLL_PUBLIC bool has_global_profiles (void)
 
WS_DLL_PUBLIC char * get_profiles_dir (void)
 
WS_DLL_PUBLIC char * get_profile_dir (const char *profilename, bool is_global)
 
WS_DLL_PUBLIC int create_profiles_dir (char **pf_dir_path_return)
 
WS_DLL_PUBLIC char * get_global_profiles_dir (void)
 
WS_DLL_PUBLIC void profile_store_persconffiles (bool store)
 
WS_DLL_PUBLIC void profile_register_persconffile (const char *filename)
 
WS_DLL_PUBLIC bool profile_exists (const char *profilename, bool global)
 
WS_DLL_PUBLIC int create_persconffile_profile (const char *profilename, char **pf_dir_path_return)
 
WS_DLL_PUBLIC const GHashTable * allowed_profile_filenames (void)
 
WS_DLL_PUBLIC int delete_persconffile_profile (const char *profilename, char **pf_dir_path_return)
 
WS_DLL_PUBLIC int rename_persconffile_profile (const char *fromname, const char *toname, char **pf_from_dir_path_return, char **pf_to_dir_path_return)
 
WS_DLL_PUBLIC int copy_persconffile_profile (const char *toname, const char *fromname, bool from_global, char **pf_filename_return, char **pf_to_dir_path_return, char **pf_from_dir_path_return)
 
WS_DLL_PUBLIC int create_persconffile_dir (char **pf_dir_path_return)
 
WS_DLL_PUBLIC char * get_persconffile_path (const char *filename, bool from_profile)
 
WS_DLL_PUBLIC void set_persconffile_dir (const char *p)
 
WS_DLL_PUBLIC const char * get_persdatafile_dir (void)
 
WS_DLL_PUBLIC void set_persdatafile_dir (const char *p)
 
WS_DLL_PUBLIC const char * file_open_error_message (int err, bool for_writing)
 
WS_DLL_PUBLIC const char * file_write_error_message (int err)
 
WS_DLL_PUBLIC const char * get_basename (const char *)
 
WS_DLL_PUBLIC char * find_last_pathname_separator (const char *path)
 
WS_DLL_PUBLIC char * get_dirname (char *)
 
WS_DLL_PUBLIC int test_for_directory (const char *)
 
WS_DLL_PUBLIC int test_for_fifo (const char *)
 
WS_DLL_PUBLIC bool test_for_regular_file (const char *)
 
WS_DLL_PUBLIC bool file_exists (const char *fname)
 
WS_DLL_PUBLIC bool config_file_exists_with_entries (const char *fname, char comment_char)
 
WS_DLL_PUBLIC bool files_identical (const char *fname1, const char *fname2)
 
WS_DLL_PUBLIC bool file_needs_reopen (int fd, const char *filename)
 
WS_DLL_PUBLIC bool write_file_binary_mode (const char *filename, const void *content, size_t content_len)
 
WS_DLL_PUBLIC bool copy_file_binary_mode (const char *from_filename, const char *to_filename)
 
WS_DLL_PUBLIC char * data_file_url (const char *filename)
 
WS_DLL_PUBLIC void free_progdirs (void)
 

Detailed Description

Filesystem utility definitions

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ configuration_init()

WS_DLL_PUBLIC char* configuration_init ( const char *  arg0,
const char *  namespace_name 
)

Initialize our configuration environment.

Get the pathname of the directory from which the executable came, and save it for future use.

Set our configuration namespace, which determines the top-level configuration directory name and environment variable prefixes. Default is "Wireshark".

Parameters
arg0Executable name hint. Should be argv[0].
namespace_nameThe namespace to use. "Wireshark" or NULL uses the Wireshark namespace. "Logray" uses the Logray namespace.
Returns
NULL on success, and a g_mallocated string containing an error on failure.

◆ get_configuration_namespace()

WS_DLL_PUBLIC const char* get_configuration_namespace ( void  )

Get the configuration namespace name.

Returns
The namespace name. One of "Wireshark" or "Logray".

◆ is_packet_configuration_namespace()

WS_DLL_PUBLIC bool is_packet_configuration_namespace ( void  )

Check to see if the configuration namespace is for packet analysis (Wireshark) or log analysis (Logray).

Returns
true if the configuration namespace is for packets.