| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
manuf.h
1/* manuf.h
2 *
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9#ifndef __MANUF_H__
10#define __MANUF_H__
11
12#include <wireshark.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif /* __cplusplus */
17
18#define MANUF_BLOCK_SIZE 5
19
20 struct ws_manuf {
21 uint8_t block[MANUF_BLOCK_SIZE];
22 uint8_t mask;
23 const char *short_name;
24 const char *long_name;
25};
26
27/* Internal structure, not supposed to be accessed by users. */
28 struct ws_manuf_iter {
29 size_t idx24, idx28, idx36;
30 struct ws_manuf buf24;
31 struct ws_manuf buf28;
32 struct ws_manuf buf36;
33};
34
35typedef struct ws_manuf_iter ws_manuf_iter_t;
36
37/* Returns the short name. Takes an optional pointer to return the long name. */
38WS_DLL_PUBLIC
39const char *
40ws_manuf_lookup_str(const uint8_t addr[6], const char **long_name_ptr);
41
42/* Returns the short name. Takes an optional pointer to return the long name.
43 * Takes an optional pointer to return the length of the mask. */
44WS_DLL_PUBLIC
45const char *
46ws_manuf_lookup(const uint8_t addr[6], const char **long_name_ptr, unsigned *mask_ptr);
47
48/* Search only in the OUI/MA-L/CID tables for a 24-bit OUI. Returns the short
49 * name. Takes an optional pointer to return the long time. */
50WS_DLL_PUBLIC
51const char *
52ws_manuf_lookup_oui24(const uint8_t oui[3], const char **long_name_ptr);
53
54WS_DLL_PUBLIC
55void
56ws_manuf_iter_init(ws_manuf_iter_t *iter);
57
58WS_DLL_PUBLIC
59bool
60ws_manuf_iter_next(ws_manuf_iter_t *iter, struct ws_manuf *result);
61
62WS_DLL_PUBLIC
63const char *
64ws_manuf_block_str(char *buf, size_t buf_size, const struct ws_manuf *ptr);
65
66WS_DLL_PUBLIC void
67ws_manuf_dump(FILE *fp);
68
69WS_DLL_PUBLIC
70size_t
71ws_manuf_count(void);
72
73#ifdef __cplusplus
74}
75#endif /* __cplusplus */
76
77#endif
ws_manuf_iter
Definition manuf.h:28
ws_manuf
Definition manuf.h:20