diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
commit | e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch) | |
tree | 68cb5ef9081156392f1dd62a00c6ccc1451b93df /wsutil/ws_mempbrk.h | |
parent | Initial commit. (diff) | |
download | wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip |
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wsutil/ws_mempbrk.h')
-rw-r--r-- | wsutil/ws_mempbrk.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/wsutil/ws_mempbrk.h b/wsutil/ws_mempbrk.h new file mode 100644 index 00000000..7aff505f --- /dev/null +++ b/wsutil/ws_mempbrk.h @@ -0,0 +1,37 @@ +/** @file + * + * Wireshark - Network traffic analyzer + * By Gerald Combs <gerald@wireshark.org> + * Copyright 1998 Gerald Combs + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef __WS_MEMPBRK_H__ +#define __WS_MEMPBRK_H__ + +#include <wireshark.h> + +#ifdef HAVE_SSE4_2 +#include <emmintrin.h> +#endif + +/** The pattern object used for ws_mempbrk_exec(). + */ +typedef struct { + char patt[256]; +#ifdef HAVE_SSE4_2 + bool use_sse42; + __m128i mask; +#endif +} ws_mempbrk_pattern; + +/** Compile the pattern for the needles to find using ws_mempbrk_exec(). + */ +WS_DLL_PUBLIC void ws_mempbrk_compile(ws_mempbrk_pattern* pattern, const char *needles); + +/** Scan for the needles specified by the compiled pattern. + */ +WS_DLL_PUBLIC const uint8_t *ws_mempbrk_exec(const uint8_t* haystack, size_t haystacklen, const ws_mempbrk_pattern* pattern, unsigned char *found_needle); + +#endif /* __WS_MEMPBRK_H__ */ |