| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
strutil.h
Go to the documentation of this file.
1/* strutil.h
2 * String utility definitions
3 *
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10#pragma once
11#include "ws_symbol_export.h"
12
13#include <epan/wmem_scopes.h>
14#include <wsutil/str_util.h>
15
16#ifdef __cplusplus
17 extern "C" {
18#endif /* __cplusplus */
19
23
33WS_DLL_PUBLIC
34 const unsigned char *find_line_end(const unsigned char *data, const unsigned char *dataend,
35 const unsigned char **eol);
36
44WS_DLL_PUBLIC
45 int get_token_len(const unsigned char *linep, const unsigned char *lineend,
46 const unsigned char **next_token);
47
58WS_DLL_PUBLIC
59 bool hex_str_to_bytes(const char *hex_str, GByteArray *bytes,
60 bool force_separators);
61
89WS_DLL_PUBLIC
90 bool hex_str_to_bytes_encoding(const char *hex_str, GByteArray *bytes, const char **endptr,
91 const unsigned encoding, const bool fail_if_partial);
92
101WS_DLL_PUBLIC
102 bool uri_to_bytes(const char *uri_str, GByteArray *bytes, size_t len);
103
111WS_DLL_PUBLIC
112 bool uri_str_to_bytes(const char *uri_str, GByteArray *bytes);
113
122WS_DLL_PUBLIC
123 bool rel_oid_str_to_bytes(const char *oid_str, GByteArray *bytes, bool is_absolute);
124
132WS_DLL_PUBLIC
133 bool oid_str_to_bytes(const char *oid_str, GByteArray *bytes);
134
143WS_DLL_PUBLIC
144GByteArray *byte_array_dup(const GByteArray *ba);
145
157WS_DLL_PUBLIC
158 bool byte_array_equal(GByteArray *ba1, GByteArray *ba2);
159
160
167WS_DLL_PUBLIC
168 char* xml_escape(const char *unescaped);
169
177WS_DLL_PUBLIC
178uint8_t * convert_string_to_hex(const char *string, size_t *nbytes);
179
189WS_DLL_PUBLIC
190 char * convert_string_case(const char *string, bool case_insensitive);
191
199WS_DLL_PUBLIC
200 void IA5_7BIT_decode(unsigned char * dest, const unsigned char* src, int len);
201
202#define FORMAT_LABEL_REPLACE_SPACE (0x1 << 0)
203
218WS_DLL_PUBLIC
219 size_t ws_label_strcpy(char *label_str, size_t bufsize, size_t pos, const uint8_t *str, int flags);
220
234WS_DLL_PUBLIC
235 size_t ws_label_strcat(char *label_str, size_t bufsize, const uint8_t *str, int flags);
236
246WS_DLL_LOCAL unsigned char
247 module_check_valid_name(const char *name, bool lower_only);
248
249#ifdef __cplusplus
250}
251#endif /* __cplusplus */
str_util.h
byte_array_dup
WS_DLL_PUBLIC GByteArray * byte_array_dup(const GByteArray *ba)
Definition strutil.c:459
xml_escape
WS_DLL_PUBLIC char * xml_escape(const char *unescaped)
Definition strutil.c:566
convert_string_to_hex
WS_DLL_PUBLIC uint8_t * convert_string_to_hex(const char *string, size_t *nbytes)
Definition strutil.c:620
oid_str_to_bytes
WS_DLL_PUBLIC bool oid_str_to_bytes(const char *oid_str, GByteArray *bytes)
Definition strutil.c:473
hex_str_to_bytes
WS_DLL_PUBLIC bool hex_str_to_bytes(const char *hex_str, GByteArray *bytes, bool force_separators)
Definition strutil.c:140
convert_string_case
WS_DLL_PUBLIC char * convert_string_case(const char *string, bool case_insensitive)
Prep a string for case-sensitive vs case-insensitive searching.
Definition strutil.c:696
uri_to_bytes
WS_DLL_PUBLIC bool uri_to_bytes(const char *uri_str, GByteArray *bytes, size_t len)
Definition strutil.c:402
find_line_end
WS_DLL_PUBLIC const unsigned char * find_line_end(const unsigned char *data, const unsigned char *dataend, const unsigned char **eol)
Definition strutil.c:36
byte_array_equal
WS_DLL_PUBLIC bool byte_array_equal(GByteArray *ba1, GByteArray *ba2)
Definition strutil.c:548
rel_oid_str_to_bytes
WS_DLL_PUBLIC bool rel_oid_str_to_bytes(const char *oid_str, GByteArray *bytes, bool is_absolute)
Definition strutil.c:478
module_check_valid_name
WS_DLL_LOCAL unsigned char module_check_valid_name(const char *name, bool lower_only)
Check if name is valid.
Definition strutil.c:783
hex_str_to_bytes_encoding
WS_DLL_PUBLIC bool hex_str_to_bytes_encoding(const char *hex_str, GByteArray *bytes, const char **endptr, const unsigned encoding, const bool fail_if_partial)
Turn a string of hex digits with optional separators (defined by encoding).
Definition strutil.c:312
get_token_len
WS_DLL_PUBLIC int get_token_len(const unsigned char *linep, const unsigned char *lineend, const unsigned char **next_token)
Definition strutil.c:100
uri_str_to_bytes
WS_DLL_PUBLIC bool uri_str_to_bytes(const char *uri_str, GByteArray *bytes)
Definition strutil.c:446
ws_label_strcat
WS_DLL_PUBLIC size_t ws_label_strcat(char *label_str, size_t bufsize, const uint8_t *str, int flags)
Definition strutil.c:1094
ws_label_strcpy
WS_DLL_PUBLIC size_t ws_label_strcpy(char *label_str, size_t bufsize, size_t pos, const uint8_t *str, int flags)
Definition strutil.c:823
IA5_7BIT_decode
WS_DLL_PUBLIC void IA5_7BIT_decode(unsigned char *dest, const unsigned char *src, int len)
Decodes an IA5-7BIT encoded string into a UTF-8 string.
Definition strutil.c:742
wmem_scopes.h