Wireshark mailing list archives

Re: wiretap function wtap_open_offline fails with SIGSEGV


From: Martin Sehnoutka <msehnout () redhat com>
Date: Thu, 3 May 2018 12:37:21 +0200



On 05/03/2018 10:52 AM, Guy Harris wrote:
You must initialize libwiretap before you use it.

Call

      wtap_init(TRUE);

first.

Note also that the libwiretap API is subject to change, so don't rely on it not changing out from under you in future 
Wireshark releases.


It does work, but only with wtap_init(FALSE). In case of TRUE it fails
again, this time with this bt:
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff71cf60a in report_failure (
    msg_format=msg_format@entry=0x7ffff71df960 "Couldn't load plugin
'%s': %s") at report_message.c:52
#2  0x00007ffff71d48b9 in scan_plugins_dir
(plugins_module=plugins_module@entry=0x604060 = {...},
    dirpath=<optimized out>, type=type@entry=WS_PLUGIN_WIRETAP,
append_type=append_type@entry=1)
    at plugins.c:142
#3  0x00007ffff71d49ee in plugins_init
(type=type@entry=WS_PLUGIN_WIRETAP) at plugins.c:267
#4  0x00007ffff7b6d822 in wtap_init (load_wiretap_plugins=1) at wtap.c:1442
#5  0x0000000000400dc1 in main (argc=2, argv=0x7fffffffe4c8) at
../main.cpp:38

Anyway, I would like to read the drop count value from a pcapng record,
but it is not present.

    ...
    gboolean ok = wtap_read(wth, &err, &errinfo, &data_offset);
    wtap_rec *rec = wtap_get_rec(wth);
    cout << "\ndrop count: ";
    if (rec->presence_flags & WTAP_HAS_DROP_COUNT)
    ...

Is it implemented?

Regards,
-- 
Martin Sehnoutka | Associate Software Engineer
PGP: 5FD64AF5
UTC+1 (CET)
RED HAT | TRIED. TESTED. TRUSTED.

Attachment: signature.asc
Description: OpenPGP digital signature

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: