Re: [Wireshark-dev] Code discussion - Extcap help files on Windows

2020-06-18 Thread Dario Lombardo
Hi Chuck
There are no written rules for that, but basically the discussions take
place on gerrit when they are related to the code review itself. They are
moved or are started on -dev when they need more thoughts, more people or
simply when they become too long. Unless you have a working solution for
the issue, that you want to propose, I guess you are in the right place.

On Thu, Jun 18, 2020, 18:16 chuck c  wrote:

> I'm looking to answer two questions:
>  - where do these type discussions typically take place? Email? Code
> review comments?
>  - suggestions on how to fix the Extcap help on Windows.
>
> thanks
> chuck
>
> +++
> https://www.wireshark.org/docs/wsdg_html_chunked/ChCaptureExtcap.html
> -
> "There should only be extcap programs (executable, python scripts, …) in
> the extcap folder to reduce the startup time and not have Wireshark trying
> to execute other file types."
>
> There are two file locations for Extcap programs.
>
> https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=ui/qt/about_dialog.cpp
>
> 
> /* Extcap */
> appendRow(QStringList() << tr("Personal Extcap path") <<
> QString(get_persconffile_path("extcap", FALSE)).trimmed() << tr("Extcap
> Plugins search path"));
> appendRow(QStringList() << tr("Global Extcap path") <<
> QString(get_extcap_dir()).trimmed() << tr("Extcap Plugins search path"));
>
> Do the help files for Personal Extcap programs go in the "Program"
> directory (C:\Program Files\Wireshark) along with the official release
> Extcap html files?
>
> In the real world all the pieces just get stuffed in the extcap folder:
>
> https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_sniffer_ble%2FUG%2Fsniffer_ble%2Finstalling_sniffer_plugin.html
>
>
> Currently when clicking the Help button in the Extcap GUI, it looks in the
> Extcap folder for the help file.
>
>
> https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=extcap/sshdump.c
>
> --
> help_url = data_file_url("sshdump.html");   <--
> extcap_base_set_util_info(extcap_conf, argv[0], SSHDUMP_VERSION_MAJOR,
> SSHDUMP_VERSION_MINOR, SSHDUMP_VERSION_RELEASE, help_url);
> g_free(help_url);
>
>
>
> https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=wsutil/filesystem.c
>
> -
> data_file_url(const gchar *filename)
> {
> gchar *file_path;
> gchar *uri;
>
> /* Absolute path? */
> if(g_path_is_absolute(filename)) {
> file_path = g_strdup(filename);
> } else {
> file_path = g_strdup_printf("%s/%s", get_datafile_dir(),
> filename);  <--
> }
> 
>
>
> /*
>  * On Windows, we use the directory in which the executable for this
>  * process resides.
>  */
>
> const char *
> get_datafile_dir(void)
> {
> if (datafile_dir != NULL)
> return datafile_dir;
>
> #ifdef _WIN32
> /*
>  * Do we have the pathname of the program?  If so, assume we're
>  * running an installed version of the program.  If we fail,
>  * we don't change "datafile_dir", and thus end up using the
>  * default.
>  *
>  * XXX - does NSIS put the installation directory into
>  * "\HKEY_LOCAL_MACHINE\SOFTWARE\Wireshark\InstallDir"?
>  * If so, perhaps we should read that from the registry,
>  * instead.
>  */
> if (progfile_dir != NULL) {
> /*
>  * Yes, we do; use that.
>  */
> datafile_dir = g_strdup(progfile_dir);  <--
> } else {
> /*
>  * No, we don't.
>  * Fall back on the default installation directory.
>  */
> datafile_dir = g_strdup("C:\\Program Files\\Wireshark\\");
> }
> #else
> 
> ___
> Sent via:Wireshark-dev mailing list 
> Archives:https://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
>  mailto:wireshark-dev-requ...@wireshark.org
> ?subject=unsubscribe
___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
 mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

[Wireshark-dev] Code discussion - Extcap help files on Windows

2020-06-18 Thread chuck c
I'm looking to answer two questions:
 - where do these type discussions typically take place? Email? Code review
comments?
 - suggestions on how to fix the Extcap help on Windows.

thanks
chuck

+++
https://www.wireshark.org/docs/wsdg_html_chunked/ChCaptureExtcap.html
-
"There should only be extcap programs (executable, python scripts, …) in
the extcap folder to reduce the startup time and not have Wireshark trying
to execute other file types."

There are two file locations for Extcap programs.
https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=ui/qt/about_dialog.cpp

/* Extcap */
appendRow(QStringList() << tr("Personal Extcap path") <<
QString(get_persconffile_path("extcap", FALSE)).trimmed() << tr("Extcap
Plugins search path"));
appendRow(QStringList() << tr("Global Extcap path") <<
QString(get_extcap_dir()).trimmed() << tr("Extcap Plugins search path"));

Do the help files for Personal Extcap programs go in the "Program"
directory (C:\Program Files\Wireshark) along with the official release
Extcap html files?

In the real world all the pieces just get stuffed in the extcap folder:
https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_sniffer_ble%2FUG%2Fsniffer_ble%2Finstalling_sniffer_plugin.html


Currently when clicking the Help button in the Extcap GUI, it looks in the
Extcap folder for the help file.

https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=extcap/sshdump.c
--
help_url = data_file_url("sshdump.html");   <--
extcap_base_set_util_info(extcap_conf, argv[0], SSHDUMP_VERSION_MAJOR,
SSHDUMP_VERSION_MINOR, SSHDUMP_VERSION_RELEASE, help_url);
g_free(help_url);


https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=wsutil/filesystem.c
-
data_file_url(const gchar *filename)
{
gchar *file_path;
gchar *uri;

/* Absolute path? */
if(g_path_is_absolute(filename)) {
file_path = g_strdup(filename);
} else {
file_path = g_strdup_printf("%s/%s", get_datafile_dir(), filename);
 <--
}



/*
 * On Windows, we use the directory in which the executable for this
 * process resides.
 */

const char *
get_datafile_dir(void)
{
if (datafile_dir != NULL)
return datafile_dir;

#ifdef _WIN32
/*
 * Do we have the pathname of the program?  If so, assume we're
 * running an installed version of the program.  If we fail,
 * we don't change "datafile_dir", and thus end up using the
 * default.
 *
 * XXX - does NSIS put the installation directory into
 * "\HKEY_LOCAL_MACHINE\SOFTWARE\Wireshark\InstallDir"?
 * If so, perhaps we should read that from the registry,
 * instead.
 */
if (progfile_dir != NULL) {
/*
 * Yes, we do; use that.
 */
datafile_dir = g_strdup(progfile_dir);  <--
} else {
/*
 * No, we don't.
 * Fall back on the default installation directory.
 */
datafile_dir = g_strdup("C:\\Program Files\\Wireshark\\");
}
#else

___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
 mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe