2
* Copyright (C) 2013 Sourcefire, Inc.
4
* Authors: David Raynor <draynor@sourcefire.com>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 2 as
8
* published by the Free Software Foundation.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
42
typedef struct adc_stream adc_stream;
44
#define ADC_BUFF_SIZE 65536
46
#define ADC_MEM_ERROR -1
47
#define ADC_DATA_ERROR -2
48
#define ADC_IO_ERROR -3
50
#define ADC_STREAM_END 1
54
ADC_STATE_GETTYPE = 1,
55
ADC_STATE_RAWDATA = 2,
56
ADC_STATE_SHORTOP = 3,
57
ADC_STATE_LONGOP2 = 4,
58
ADC_STATE_LONGOP1 = 5,
59
ADC_STATE_SHORTLOOK = 6,
60
ADC_STATE_LONGLOOK = 7
63
/* Compression phrases
64
* store phrase - 1 byte header + data, first byte 0x80-0xFF, max length 0x80 (7 bits + 1), no offset
65
* short phrase - 2 byte header + data, first byte 0x00-0x3F, max length 0x12 (4 bits + 3), max offset 0x3FF (10 bits)
66
* long phrase - 3 byte header + data, first byte 0x40-0x7F, max length 0x43 (6 bits + 4), max offset 0xFFFF (16 bits)
69
int adc_decompressInit(adc_stream *strm);
70
int adc_decompress(adc_stream *strm);
71
int adc_decompressEnd(adc_stream *strm);