diff options
author | Guy Harris <gharris@sonic.net> | 2022-03-08 15:18:24 -0800 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2022-03-08 15:18:24 -0800 |
commit | f6fb59b11d20222d4648cdceeaadf6ce971a7a9a (patch) | |
tree | 82d4be40231a93047587a9cd52777b77528e188d /pcap-haiku.cpp | |
parent | cc9e70b80e0a33130fcb24fbab13a40666976d7f (diff) | |
parent | e75cc82c46e0f1208fbac03530da6a30976c7fd6 (diff) |
Merge branch 'master' into pcap-options
Diffstat (limited to 'pcap-haiku.cpp')
-rw-r--r-- | pcap-haiku.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pcap-haiku.cpp b/pcap-haiku.cpp index 701cac38..8b0009c5 100644 --- a/pcap-haiku.cpp +++ b/pcap-haiku.cpp @@ -160,6 +160,17 @@ pcap_activate_haiku(pcap_t *handle) handle->getnonblock_op = pcap_getnonblock_fd; handle->setnonblock_op = pcap_setnonblock_fd; + /* + * Turn a negative snapshot value (invalid), a snapshot value of + * 0 (unspecified), or a value bigger than the normal maximum + * value, into the maximum allowed value. + * + * If some application really *needs* a bigger snapshot + * length, we should just increase MAXIMUM_SNAPLEN. + */ + if (handle->snapshot <= 0 || handle->snapshot > MAXIMUM_SNAPLEN) + handle->snapshot = MAXIMUM_SNAPLEN; + handlep->device = strdup(device); if (handlep->device == NULL) { pcap_fmt_errmsg_for_errno(handle->errbuf, PCAP_ERRBUF_SIZE, @@ -280,3 +291,12 @@ pcap_platform_finddevs(pcap_if_list_t* _allDevices, char* errorBuffer) return pcap_findalldevs_interfaces(_allDevices, errorBuffer, can_be_bound, get_if_flags); } + +/* + * Libpcap version string. + */ +extern "C" const char * +pcap_lib_version(void) +{ + return (PCAP_VERSION_STRING); +} |