Wireshark 4.5.0
The Wireshark network protocol analyzer
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
clopts_common.h
Go to the documentation of this file.
1
12#ifndef __CLOPTS_COMMON_H__
13#define __CLOPTS_COMMON_H__
14
15#include <wireshark.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20
21/*
22 * Long options.
23 * For long options with no corresponding short options, we define values
24 * outside the range of ASCII graphic characters, make that the last
25 * component of the entry for the long option, and have a case for that
26 * option in the switch statement.
27 */
28// Base value for capture related long options
29#define LONGOPT_BASE_CAPTURE 1000
30// Base value for dissector related long options
31#define LONGOPT_BASE_DISSECTOR 2000
32// Base value for application specific long options
33#define LONGOPT_BASE_APPLICATION 3000
34// Base value for GUI specific long options
35#define LONGOPT_BASE_GUI 4000
36// Base value for logging related long options
37#define LONGOPT_BASE_WSLOG 5000
38
39#define LONGOPT_READ_CAPTURE_COMMON \
40 {"read-file", ws_required_argument, NULL, 'r' }, \
41
42#define OPTSTRING_READ_CAPTURE_COMMON \
43 "r:"
44
45WS_DLL_PUBLIC bool
46get_natural_int(const char *string, const char *name, int32_t* number);
47
48WS_DLL_PUBLIC bool
49get_positive_int(const char *string, const char *name, int32_t* number);
50
51WS_DLL_PUBLIC bool
52get_natural_int64(const char* string, const char* name, int64_t* number);
53
54WS_DLL_PUBLIC bool
55get_positive_int64(const char* string, const char* name, int64_t* number);
56
57WS_DLL_PUBLIC bool
58get_uint32(const char *string, const char *name, uint32_t* number);
59
60WS_DEPRECATED_X("Use get_uint32 instead")
61static inline uint32_t
62get_guint32(const char *string, const char *name) {
63 uint32_t number = 0;
64 get_uint32(string, name, &number);
65 return number;
66}
67
68WS_DLL_PUBLIC bool
69get_nonzero_uint32(const char *string, const char *name, uint32_t* number);
70
71WS_DEPRECATED_X("Use get_nonzero_uint32 instead")
72static inline uint32_t
73get_nonzero_guint32(const char *string, const char *name) {
74 uint32_t number = 0;
75 get_nonzero_uint32(string, name, &number);
76 return number;
77}
78
79WS_DLL_PUBLIC bool
80get_uint64(const char *string, const char *name, uint64_t* number);
81
82WS_DLL_PUBLIC bool
83get_nonzero_uint64(const char *string, const char *name, uint64_t* number);
84
85WS_DLL_PUBLIC bool
86get_positive_double(const char *string, const char *name, double* number);
87
88#ifdef __cplusplus
89}
90#endif /* __cplusplus */
91
92#endif /* __CLOPTS_COMMON_H__ */