summaryrefslogtreecommitdiffstats
path: root/epan/manuf.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
commite4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch)
tree68cb5ef9081156392f1dd62a00c6ccc1451b93df /epan/manuf.h
parentInitial commit. (diff)
downloadwireshark-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 'epan/manuf.h')
-rw-r--r--epan/manuf.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/epan/manuf.h b/epan/manuf.h
new file mode 100644
index 0000000..5f5ca1b
--- /dev/null
+++ b/epan/manuf.h
@@ -0,0 +1,65 @@
+/* manuf.h
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+#ifndef __MANUF_H__
+#define __MANUF_H__
+
+#include <wireshark.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define MANUF_BLOCK_SIZE 5
+
+struct ws_manuf {
+ uint8_t block[MANUF_BLOCK_SIZE];
+ uint8_t mask;
+ const char *short_name;
+ const char *long_name;
+};
+
+/* Internal structure, not supposed to be accessed by users. */
+struct ws_manuf_iter {
+ size_t idx24, idx28, idx36;
+ struct ws_manuf buf24;
+ struct ws_manuf buf28;
+ struct ws_manuf buf36;
+};
+
+typedef struct ws_manuf_iter ws_manuf_iter_t;
+
+/* Returns the short name. Takes an optional pointer to return the long name. */
+WS_DLL_PUBLIC
+const char *
+ws_manuf_lookup_str(const uint8_t addr[6], const char **long_name_ptr);
+
+WS_DLL_PUBLIC
+void
+ws_manuf_iter_init(ws_manuf_iter_t *iter);
+
+WS_DLL_PUBLIC
+bool
+ws_manuf_iter_next(ws_manuf_iter_t *iter, struct ws_manuf *result);
+
+WS_DLL_PUBLIC
+const char *
+ws_manuf_block_str(char *buf, size_t buf_size, const struct ws_manuf *ptr);
+
+WS_DLL_PUBLIC void
+ws_manuf_dump(FILE *fp);
+
+WS_DLL_PUBLIC
+size_t
+ws_manuf_count(void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif