| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
saplzclzh.h
1/* saplzclzh.h
2 * Routines for decompression with SAP LZC/LZH algorithms
3 * Copyright 2022, Martin Gallo <martin.gallo [AT] gmail.com>
4 * Code contributed by SecureAuth Corp.
5 *
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
9 *
10 * SPDX-License-Identifier: GPL-2.0-or-later
11 */
12
13
14#ifndef __SAPLZCLZH_H__
15#define __SAPLZCLZH_H__
16
17#include <wireshark.h>
18
19#ifdef __cplusplus
20 extern "C" {
21#endif /* __cplusplus */
22
23/* SAP LZC/LZH Decompression routine return codes */
24#define CS_END_INBUFFER 3
25#define CS_END_OUTBUFFER 2
26#define CS_END_OF_STREAM 1
27#define CS_OK 0
28
29#define CS_IEND_OF_STREAM -1
30#define CS_IEND_OUTBUFFER -2
31#define CS_IEND_INBUFFER -3
32
33#define CS_E_OUT_BUFFER_LEN -10
34#define CS_E_IN_BUFFER_LEN -11
35#define CS_E_NOSAVINGS -12
36#define CS_E_INVALID_SUMLEN -13
37#define CS_E_IN_EQU_OUT -14
38#define CS_E_INVALID_ADDR -15
39#define CS_E_FATAL -19
40#define CS_E_BOTH_ZERO -20
41#define CS_E_UNKNOWN_ALG -21
42#define CS_E_UNKNOWN_TYPE -22
43
44#define CS_E_FILENOTCOMPRESSED -50
45#define CS_E_MAXBITS_TOO_BIG -51
46#define CS_E_BAD_HUF_TREE -52
47#define CS_E_NO_STACKMEM -53
48#define CS_E_INVALIDCODE -54
49#define CS_E_BADLENGTH -55
50
51#define CS_E_STACK_OVERFLOW -60
52#define CS_E_STACK_UNDERFLOW -61
53
54#define CS_NOT_INITIALIZED -71
55
56/* Return code for memory errors */
57#define SAP_LZC_LZH_CS_E_MEMORY_ERROR -99
58
59
70WS_DLL_PUBLIC const char *sap_lzclzh_decompress_error_string(int return_code);
71
72
89WS_DLL_PUBLIC int sap_lzclzh_decompress(wmem_allocator_t *wmem_scope, const guint8 *in, gint in_length, guint8 *out, guint *out_length);
90
91#ifdef __cplusplus
92}
93#endif /* __cplusplus */
94
95#endif /* __SAPLZCLZH_H__ */
wmem_allocator_t
struct _wmem_allocator_t wmem_allocator_t
Definition wmem_core.h:44