[PATCH] openbsc[master]: V42BIS integration and unit test

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Fri Aug 26 10:34:35 UTC 2016


Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/644

to look at the new patch set (#30).

V42BIS integration and unit test

The previously committed SPANDSP v42bis implementation has been edited
to function outside the SPANDSP library. Debug printf statements were
changed into DEBUGP statements. Als removed the assembely code
in top_bit().

Change-Id: I689413f2541b6def0625ce6bd96f1f488f05f99d
---
M openbsc/.gitignore
M openbsc/configure.ac
M openbsc/include/openbsc/Makefile.am
M openbsc/include/openbsc/debug.h
M openbsc/include/openbsc/v42bis.h
R openbsc/include/openbsc/v42bis_private.h
M openbsc/src/gprs/Makefile.am
M openbsc/src/gprs/sgsn_main.c
M openbsc/src/gprs/v42bis.c
M openbsc/tests/Makefile.am
M openbsc/tests/testsuite.at
A openbsc/tests/v42bis/Makefile.am
A openbsc/tests/v42bis/v42bis_test.c
A openbsc/tests/v42bis/v42bis_test.ok
14 files changed, 569 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/44/644/30

diff --git a/openbsc/.gitignore b/openbsc/.gitignore
index e75b9eb..6fbd463 100644
--- a/openbsc/.gitignore
+++ b/openbsc/.gitignore
@@ -84,6 +84,7 @@
 tests/xid/xid_test
 tests/sndcp_xid/sndcp_xid_test
 tests/slhc/slhc_test
+tests/v42bis/v42bis_test
 
 tests/atconfig
 tests/atlocal
diff --git a/openbsc/configure.ac b/openbsc/configure.ac
index 18980b0..1df14fe 100644
--- a/openbsc/configure.ac
+++ b/openbsc/configure.ac
@@ -232,6 +232,7 @@
     tests/xid/Makefile
     tests/sndcp_xid/Makefile
     tests/slhc/Makefile
+    tests/v42bis/Makefile
     doc/Makefile
     doc/examples/Makefile
     Makefile)
diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am
index 88a7e2c..b3403dd 100644
--- a/openbsc/include/openbsc/Makefile.am
+++ b/openbsc/include/openbsc/Makefile.am
@@ -19,7 +19,8 @@
 		 gprs_gsup_client.h bsc_msg_filter.h \
 		 oap.h oap_messages.h \
 		 gtphub.h gprs_llc_xid.h gprs_sndcp.h gprs_sndcp_xid.h \
-		slhc.h gprs_sndcp_comp.h gprs_sndcp_pcomp.h
+		slhc.h gprs_sndcp_comp.h gprs_sndcp_pcomp.h v42bis.h \
+		v42bis_private.h
 
 openbsc_HEADERS = gsm_04_08.h meas_rep.h bsc_api.h
 openbscdir = $(includedir)/openbsc
diff --git a/openbsc/include/openbsc/debug.h b/openbsc/include/openbsc/debug.h
index 90ddca5..ca3d4ad 100644
--- a/openbsc/include/openbsc/debug.h
+++ b/openbsc/include/openbsc/debug.h
@@ -37,6 +37,7 @@
 	DGTPHUB,
 	DRANAP,
 	DSUA,
+	DV42BIS,
 	Debug_LastEntry,
 };
 
diff --git a/openbsc/include/openbsc/v42bis.h b/openbsc/include/openbsc/v42bis.h
index f13e5c5..0b97603 100644
--- a/openbsc/include/openbsc/v42bis.h
+++ b/openbsc/include/openbsc/v42bis.h
@@ -33,8 +33,12 @@
 \section v42bis_page_sec_2 How does it work?
 */
 
+#include <stdint.h>
+
 #if !defined(_SPANDSP_V42BIS_H_)
 #define _SPANDSP_V42BIS_H_
+
+#define SPAN_DECLARE(x) x
 
 #define V42BIS_MAX_BITS         12
 #define V42BIS_MAX_CODEWORDS    4096    /* 2^V42BIS_MAX_BITS */
@@ -114,7 +118,8 @@
     \param data_user_data An opaque pointer passed to the data callback handler.
     \param max_data_len The maximum length that should be passed to the data handler.
     \return The V.42bis context. */
-SPAN_DECLARE(v42bis_state_t *) v42bis_init(v42bis_state_t *s,
+SPAN_DECLARE(v42bis_state_t *) v42bis_init(const void *ctx,
+                                           v42bis_state_t *s,
                                            int negotiated_p0,
                                            int negotiated_p1,
                                            int negotiated_p2,
diff --git a/openbsc/include/openbsc/private_v42bis.h b/openbsc/include/openbsc/v42bis_private.h
similarity index 100%
rename from openbsc/include/openbsc/private_v42bis.h
rename to openbsc/include/openbsc/v42bis_private.h
diff --git a/openbsc/src/gprs/Makefile.am b/openbsc/src/gprs/Makefile.am
index 2910c02..f479d56 100644
--- a/openbsc/src/gprs/Makefile.am
+++ b/openbsc/src/gprs/Makefile.am
@@ -27,7 +27,7 @@
 			gprs_utils.c gprs_gsup_client.c \
 			sgsn_cdr.c sgsn_ares.c \
 			oap.c oap_messages.c gprs_llc_xid.c gprs_sndcp_xid.c \
-			slhc.c gprs_sndcp_comp.c gprs_sndcp_pcomp.c
+			slhc.c gprs_sndcp_comp.c gprs_sndcp_pcomp.c v42bis.c
 osmo_sgsn_LDADD = 	\
 			$(top_builddir)/src/libcommon/libcommon.a \
 			-lgtp $(OSMO_LIBS) $(LIBOSMOABIS_LIBS) $(LIBCARES_LIBS) \
diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c
index 894ce84..f01798b 100644
--- a/openbsc/src/gprs/sgsn_main.c
+++ b/openbsc/src/gprs/sgsn_main.c
@@ -297,6 +297,11 @@
 		.description = "RFC1144 TCP/IP Header compression (SLHC)",
 		.enabled = 1, .loglevel = LOGL_DEBUG,
 	},
+	[DV42BIS] = {
+		.name = "DV42BIS",
+		.description = "V.42bis data compression (SNDCP)",
+		.enabled = 1, .loglevel = LOGL_DEBUG,
+	}
 };
 
 static const struct log_info gprs_log_info = {
diff --git a/openbsc/src/gprs/v42bis.c b/openbsc/src/gprs/v42bis.c
index 6d38916..b8a886d 100644
--- a/openbsc/src/gprs/v42bis.c
+++ b/openbsc/src/gprs/v42bis.c
@@ -31,9 +31,8 @@
 
 /*! \file */
 
-#if defined(HAVE_CONFIG_H)
-#include "config.h"
-#endif
+#define FALSE 0
+#define TRUE 1
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -44,13 +43,11 @@
 #include <ctype.h>
 #include <assert.h>
 
-#include "spandsp/telephony.h"
-#include "spandsp/logging.h"
-#include "spandsp/bit_operations.h"
-#include "spandsp/v42bis.h"
+#include <openbsc/v42bis.h>
+#include <openbsc/v42bis_private.h>
+#include <openbsc/debug.h>
+#include <osmocom/core/talloc.h>
 
-#include "spandsp/private/logging.h"
-#include "spandsp/private/v42bis.h"
 
 /* Fixed parameters from the spec. */
 #define V42BIS_N3               8   /* Character size (bits) */
@@ -310,7 +307,7 @@
                 {
                     if (ss->transparent)
                     {
-                        printf("Going compressed\n");
+                        DEBUGP(DV42BIS,"Going compressed\n");
                         /* 7.8.1 Transition to compressed mode */
                         /* Switch out of transparent now, between codes. We need to send the octet which did not
                         match, just before switching. */
@@ -332,7 +329,7 @@
                 {
                     if (!ss->transparent)
                     {
-                        printf("Going transparent\n");
+                        DEBUGP(DV42BIS,"Going transparent\n");
                         /* 7.8.2 Transition to transparent mode */
                         /* Switch into transparent now, between codes, and the unmatched octet should
                            go out in transparent mode, just below */
@@ -401,7 +398,7 @@
     {
         if (s->compress.dict[i].parent_code != 0xFFFF)
         {
-            printf("Entry %4x, prior %4x, leaves %d, octet %2x\n", i, s->compress.dict[i].parent_code, s->compress.dict[i].leaves, s->compress.dict[i].node_octet);
+            DEBUGP(DV42BIS,"Entry %4x, prior %4x, leaves %d, octet %2x\n", i, s->compress.dict[i].parent_code, s->compress.dict[i].leaves, s->compress.dict[i].node_octet);
         }
     }
     return 0;
@@ -454,13 +451,13 @@
                 ss->escaped = FALSE;
                 if (code == V42BIS_ECM)
                 {
-                    printf("Hit V42BIS_ECM\n");
+                    DEBUGP(DV42BIS,"Hit V42BIS_ECM\n");
                     ss->transparent = FALSE;
                     code_len = ss->v42bis_parm_c2;
                 }
                 else if (code == V42BIS_EID)
                 {
-                    printf("Hit V42BIS_EID\n");
+                    DEBUGP(DV42BIS,"Hit V42BIS_EID\n");
                     ss->output_buf[ss->output_octet_count++] = ss->escape_code - 1;
                     if (ss->output_octet_count >= ss->max_len - s->v42bis_parm_n7)
                     {
@@ -470,11 +467,11 @@
                 }
                 else if (code == V42BIS_RESET)
                 {
-                    printf("Hit V42BIS_RESET\n");
+                    DEBUGP(DV42BIS,"Hit V42BIS_RESET\n");
                 }
                 else
                 {
-                    printf("Hit V42BIS_???? - %" PRIu32 "\n", code);
+                    DEBUGP(DV42BIS,"Hit V42BIS_???? - %" PRIu32 "\n", code);
                 }
             }
             else if (code == ss->escape_code)
@@ -500,17 +497,17 @@
                 switch (new_code)
                 {
                 case V42BIS_ETM:
-                    printf("Hit V42BIS_ETM\n");
+                    DEBUGP(DV42BIS,"Hit V42BIS_ETM\n");
                     ss->transparent = TRUE;
                     code_len = 8;
                     break;
                 case V42BIS_FLUSH:
-                    printf("Hit V42BIS_FLUSH\n");
+                    DEBUGP(DV42BIS,"Hit V42BIS_FLUSH\n");
                     v42bis_decompress_flush(s);
                     break;
                 case V42BIS_STEPUP:
                     /* We need to increase the codeword size */
-                    printf("Hit V42BIS_STEPUP\n");
+                    DEBUGP(DV42BIS,"Hit V42BIS_STEPUP\n");
                     if (ss->v42bis_parm_c3 >= s->v42bis_parm_n2)
                     {
                         /* Invalid condition */
@@ -547,7 +544,7 @@
             /* Trace back through the octets which form the string, and output them. */
             while (code >= V42BIS_N5)
             {
-if (code > 4095) {printf("Code is 0x%" PRIu32 "\n", code); exit(2);}
+if (code > 4095) {DEBUGP(DV42BIS,"Code is 0x%" PRIu32 "\n", code); exit(2);}
                 *string-- = ss->dict[code].node_octet;
                 code = ss->dict[code].parent_code;
             }
@@ -631,7 +628,7 @@
     {
         if (s->decompress.dict[i].parent_code != 0xFFFF)
         {
-            printf("Entry %4x, prior %4x, leaves %d, octet %2x\n", i, s->decompress.dict[i].parent_code, s->decompress.dict[i].leaves, s->decompress.dict[i].node_octet);
+            DEBUGP(DV42BIS,"Entry %4x, prior %4x, leaves %d, octet %2x\n", i, s->decompress.dict[i].parent_code, s->decompress.dict[i].leaves, s->decompress.dict[i].node_octet);
         }
     }
     return 0;
@@ -654,7 +651,8 @@
 }
 /*- End of function --------------------------------------------------------*/
 
-SPAN_DECLARE(v42bis_state_t *) v42bis_init(v42bis_state_t *s,
+SPAN_DECLARE(v42bis_state_t *) v42bis_init(const void *ctx,
+                                           v42bis_state_t *s,
                                            int negotiated_p0,
                                            int negotiated_p1,
                                            int negotiated_p2,
@@ -673,7 +671,7 @@
         return NULL;
     if (s == NULL)
     {
-        if ((s = (v42bis_state_t *) malloc(sizeof(*s))) == NULL)
+        if ((s = (v42bis_state_t *) talloc_zero_size(ctx,sizeof(*s))) == NULL)
             return NULL;
     }
     memset(s, 0, sizeof(*s));
@@ -735,7 +733,7 @@
 
 SPAN_DECLARE(int) v42bis_free(v42bis_state_t *s)
 {
-    free(s);
+    talloc_free(s);
     return 0;
 }
 /*- End of function --------------------------------------------------------*/
diff --git a/openbsc/tests/Makefile.am b/openbsc/tests/Makefile.am
index d5aa356..7acebc0 100644
--- a/openbsc/tests/Makefile.am
+++ b/openbsc/tests/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = gsm0408 db channel mgcp gprs abis gbproxy trau subscr mm_auth xid sndcp_xid slhc
+SUBDIRS = gsm0408 db channel mgcp gprs abis gbproxy trau subscr mm_auth xid sndcp_xid slhc v42bis
 
 if BUILD_NAT
 SUBDIRS += bsc-nat bsc-nat-trie
diff --git a/openbsc/tests/testsuite.at b/openbsc/tests/testsuite.at
index 5f37b8e..f18b734 100644
--- a/openbsc/tests/testsuite.at
+++ b/openbsc/tests/testsuite.at
@@ -141,3 +141,9 @@
 cat $abs_srcdir/slhc/slhc_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/slhc/slhc_test], [], [expout], [ignore])
 AT_CLEANUP
+
+AT_SETUP([v42bis])
+AT_KEYWORDS([v42bis])
+cat $abs_srcdir/v42bis/v42bis_test.ok > expout
+AT_CHECK([$abs_top_builddir/tests/v42bis/v42bis_test], [], [expout], [ignore])
+AT_CLEANUP
diff --git a/openbsc/tests/v42bis/Makefile.am b/openbsc/tests/v42bis/Makefile.am
new file mode 100644
index 0000000..9001c0f
--- /dev/null
+++ b/openbsc/tests/v42bis/Makefile.am
@@ -0,0 +1,21 @@
+AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
+AM_CFLAGS=-Wall -ggdb3 $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBCARES_CFLAGS)
+
+EXTRA_DIST = v42bis_test.ok
+
+noinst_PROGRAMS = v42bis_test
+
+v42bis_test_SOURCES = v42bis_test.c
+
+v42bis_test_LDADD = \
+	$(top_builddir)/src/gprs/v42bis.o \
+	$(top_builddir)/src/libcommon/libcommon.a \
+	$(LIBOSMOABIS_LIBS) \
+	$(LIBOSMOCORE_LIBS) \
+	$(LIBOSMOGSM_LIBS) \
+	$(LIBOSMOGB_LIBS) \
+	$(LIBCARES_LIBS) \
+	$(LIBCRYPTO_LIBS) \
+	-lgtp -lrt -lm
+
+
diff --git a/openbsc/tests/v42bis/v42bis_test.c b/openbsc/tests/v42bis/v42bis_test.c
new file mode 100644
index 0000000..da5f339
--- /dev/null
+++ b/openbsc/tests/v42bis/v42bis_test.c
@@ -0,0 +1,278 @@
+/* Test v42bis Compression/Decompression */
+
+/* (C) 2016 by sysmocom s.f.m.c. GmbH <info at sysmocom.de>
+ * All Rights Reserved
+ *
+ * Author: Philipp Maier
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <openbsc/v42bis.h>
+#include <openbsc/v42bis_private.h>
+#include <openbsc/debug.h>
+
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/utils.h>
+
+#include <osmocom/core/application.h>
+
+#include <stdio.h>
+#include <string.h>
+#include <stdbool.h>
+
+#define P0 3
+#define P1 512
+#define P2 20
+
+#define BLOCK_SIZE 1024
+#define MAX_BLOCK_SIZE 1024
+
+#define UNCOMPR_PACKETS_LEN 6
+char *uncompr_packets[] = {
+	"45000236000700004006cf2cc0a80002550d93d7400000501e200da7c0c95a70801840002e3700000101080a000174140853d489474554202f20485454502f312e310d0a4163636570743a206d756c7469706172742f6d697865642c206170706c69636174696f6e2f766e642e7761702e6d756c7469706172742e6d697865642c206170706c69636174696f6e2f766e642e7761702e7868746d6c2b786d6c2c206170706c69636174696f6e2f7868746d6c2b786d6c2c20746578742f766e642e7761702e776d6c2c202a2f2a0d0a4163636570742d436861727365743a207574662d382c207574662d31362c2069736f2d383835392d312c2069736f2d31303634362d7563732d322c2053686966745f4a49532c20426967350d0a4163636570742d4c616e67756167653a20656e0d0a782d7761702d70726f66696c653a2022687474703a2f2f7761702e736f6e796572696373736f6e2e636f6d2f554170726f662f4b38303069523230312e786d6c220d0a486f73743a207777772e7a6f636b2e636f6d0d0a557365722d4167656e743a20536f6e794572696373736f6e4b383030692f5232422052656c656173652f4d61722d31332d323030372042726f777365722f4e657446726f6e742f332e332050726f66696c652f4d4944502d322e3020436f6e66696775726174696f6e2f434c44432d312e310d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a206465666c6174652c20677a69700d0a0d0a",
+	"4510004046dd40004006a9a7c0a8646ec0a864640017ad8b81980100f3ac984d801800e32a1600000101080a000647de06d1bf5efffd18fffd20fffd23fffd27",
+	"4510005b46de40004006a98bc0a8646ec0a864640017ad8b8198010cf3ac984d801800e3867500000101080a000647df06d1bf61fffb03fffd1ffffd21fffe22fffb05fffa2001fff0fffa2301fff0fffa2701fff0fffa1801fff0",
+	"4510003746df40004006a9aec0a8646ec0a864640017ad8b81980133f3ac989f801800e35fd700000101080a000647e106d1bf63fffd01",
+	"4510003746e040004006a9adc0a8646ec0a864640017ad8b81980136f3ac98a2801800e35fd200000101080a000647e106d1bf64fffb01",
+	"4510007446e140004006a96fc0a8646ec0a864640017ad8b81980139f3ac98a5801800e37b9b00000101080a000647e206d1bf640d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a57656c6c636f6d6520746f20706f6c6c75780d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a",
+	"4510004246e240004006a9a0c0a8646ec0a864640017ad8b81980179f3ac98a5801800e3dab000000101080a000647ec06d1bf6f706f6c6c7578206c6f67696e3a20"
+};
+
+/* A simple function to show the ascii content of a packet */
+void show_packet(uint8_t *packet, int len)
+{
+	int i;
+	char c;
+	for (i = 0; i < len; i++) {
+		c = packet[i];
+		if (c >= 0x20 && c <= 0x7E)
+			printf("%c", c);
+		else
+			printf(".");
+	}
+	printf("\n");
+}
+
+/* A struct to capture the output data of compressor and decompressor */
+struct v42bis_output_buffer {
+	uint8_t *buf;
+	uint8_t *buf_pointer;
+	int len;
+};
+
+/* A simple testpattern generator */
+static void gen_test_pattern(uint8_t *data, int len)
+{
+	int i;
+	for (i = 0; i < len; i++)
+		data[i] = i & 0xF0;
+}
+
+/* Handler to capture the output data from the compressor */
+void tx_v42bis_frame_handler(void *user_data, const uint8_t *pkt, int len)
+{
+	struct v42bis_output_buffer *output_buffer =
+	    (struct v42bis_output_buffer *)user_data;
+	memcpy(output_buffer->buf_pointer, pkt, len);
+	output_buffer->buf_pointer += len;
+	output_buffer->len += len;
+	return;
+}
+
+/* Handler to capture the output data from the decompressor */
+void tx_v42bis_data_handler(void *user_data, const uint8_t *buf, int len)
+{
+	/* stub, never used */
+	OSMO_ASSERT(false);
+	return;
+}
+
+/* Handler to capture the output data from the compressor */
+void rx_v42bis_frame_handler(void *user_data, const uint8_t *pkt, int len)
+{
+	/* stub, never used */
+	OSMO_ASSERT(false);
+	return;
+}
+
+/* Handler to capture the output data from the decompressor */
+void rx_v42bis_data_handler(void *user_data, const uint8_t *buf, int len)
+{
+	struct v42bis_output_buffer *output_buffer =
+	    (struct v42bis_output_buffer *)user_data;
+	memcpy(output_buffer->buf_pointer, buf, len);
+	output_buffer->buf_pointer += len;
+	output_buffer->len += len;
+	return;
+}
+
+/* Test V.42bis compression and decompression */
+static void v42bis(const void *ctx, int mode, uint8_t *testvec, int len)
+{
+	v42bis_state_t *tx_state;
+	v42bis_state_t *rx_state;
+	uint8_t *uncompressed_original;
+	uint8_t *compressed;
+	uint8_t *uncompressed;
+
+	uncompressed_original = talloc_zero_size(ctx, len);
+	uncompressed = talloc_zero_size(ctx, len);
+
+	/* Note: We allocate double the size for the compressed buffer,
+	 * because in some cases the compression may increase the amount.
+	 * of data. */
+	compressed = talloc_zero_size(ctx, len * 2);
+
+	int rc;
+	int rc_sum = 0;
+	struct v42bis_output_buffer compressed_data;
+	struct v42bis_output_buffer uncompressed_data;
+
+	/* Initalize */
+	tx_state =
+	    v42bis_init(ctx, NULL, P0, P1, P2,
+			&tx_v42bis_frame_handler, NULL, MAX_BLOCK_SIZE,
+			&tx_v42bis_data_handler, NULL, MAX_BLOCK_SIZE);
+	OSMO_ASSERT(tx_state);
+	rx_state =
+	    v42bis_init(ctx, NULL, P0, P1, P2,
+			&rx_v42bis_frame_handler, NULL, MAX_BLOCK_SIZE,
+			&rx_v42bis_data_handler, NULL, MAX_BLOCK_SIZE);
+	OSMO_ASSERT(rx_state);
+	v42bis_compression_control(tx_state, mode);
+
+	/* Setup input data */
+	memcpy(uncompressed_original, testvec, len);
+
+	/* Run compressor */
+	compressed_data.buf = compressed;
+	compressed_data.buf_pointer = compressed;
+	compressed_data.len = 0;
+	tx_state->compress.user_data = (&compressed_data);
+	rc = v42bis_compress(tx_state, uncompressed_original, len);
+	printf("v42bis_compress() rc=%d\n", rc);
+	OSMO_ASSERT(rc == 0);
+	rc = v42bis_compress_flush(tx_state);
+	printf("v42bis_compress_flush() rc=%d\n", rc);
+	OSMO_ASSERT(rc == 0);
+
+	/* Decompress again */
+	uncompressed_data.buf = uncompressed;
+	uncompressed_data.buf_pointer = uncompressed;
+	uncompressed_data.len = 0;
+	rx_state->decompress.user_data = (&uncompressed_data);
+	rc = v42bis_decompress(rx_state, compressed_data.buf,
+			       compressed_data.len);
+	printf("v42bis_decompress() rc=%d\n", rc);
+	rc = v42bis_decompress_flush(rx_state);
+	rc_sum += rc;
+	printf("v42bis_decompress_flush() rc=%d\n", rc);
+	rc_sum += rc;
+
+	/* Check results */
+	printf("Mode: %i\n", mode);
+
+	printf("uncompressed_original= %s ASCII:",
+	       osmo_hexdump_nospc(uncompressed_original, len));
+	show_packet(uncompressed_original, len);
+	printf("uncompressed=          %s ASCII:",
+	       osmo_hexdump_nospc(uncompressed_data.buf,
+				  uncompressed_data.len));
+	show_packet(uncompressed_data.buf, uncompressed_data.len);
+	printf("compressed=            %s ASCII:",
+	       osmo_hexdump_nospc(compressed_data.buf, compressed_data.len));
+	show_packet(compressed_data.buf, compressed_data.len);
+
+	rc = memcmp(uncompressed, uncompressed_original, len);
+	printf("memcmp() rc=%d\n", rc);
+	rc_sum += rc;
+	OSMO_ASSERT(rc_sum == 0);
+
+	/* Free buffers and exit */
+	v42bis_free(tx_state);
+	v42bis_free(rx_state);
+	talloc_free(uncompressed_original);
+	talloc_free(compressed);
+	talloc_free(uncompressed);
+	printf("\n");
+}
+
+/* Test V.42bis compression and decompression with generated data*/
+static void test_v42bis(const void *ctx)
+{
+	printf("Testing compression/decompression with generated data:\n");
+	uint8_t testvec[BLOCK_SIZE];
+	int len = sizeof(testvec);
+	gen_test_pattern(testvec, len);
+	v42bis(ctx, V42BIS_COMPRESSION_MODE_DYNAMIC, testvec, len);
+	v42bis(ctx, V42BIS_COMPRESSION_MODE_NEVER, testvec, len);
+	v42bis(ctx, V42BIS_COMPRESSION_MODE_ALWAYS, testvec, len);
+}
+
+/* Test V.42bis compression and decompression with some TCP/IP packets */
+static void test_v42bis_tcpip(const void *ctx, int packet_id)
+{
+	uint8_t *testvec;
+	int len;
+	printf
+	    ("Testing compression/decompression with realistic TCP/IP packets:\n");
+	printf("Packet No.: %i\n", packet_id);
+	len = strlen(uncompr_packets[packet_id]);
+	testvec = talloc_zero_size(ctx, len);
+	len = osmo_hexparse(uncompr_packets[packet_id], testvec, len);
+	v42bis(ctx, V42BIS_COMPRESSION_MODE_DYNAMIC, testvec, len);
+	v42bis(ctx, V42BIS_COMPRESSION_MODE_NEVER, testvec, len);
+	v42bis(ctx, V42BIS_COMPRESSION_MODE_ALWAYS, testvec, len);
+	talloc_free(testvec);
+}
+
+static struct log_info_cat gprs_categories[] = {
+	[DV42BIS] = {
+		     .name = "DV42BIS",
+		     .description = "V.42bis data compression (SNDCP)",
+		     .enabled = 1,.loglevel = LOGL_DEBUG,
+		     }
+};
+
+static struct log_info info = {
+	.cat = gprs_categories,
+	.num_cat = ARRAY_SIZE(gprs_categories),
+};
+
+int main(int argc, char **argv)
+{
+	void *v42bis_ctx;
+	int i;
+
+	osmo_init_logging(&info);
+
+	v42bis_ctx = talloc_named_const(NULL, 0, "v42bis_ctx");
+
+	test_v42bis(v42bis_ctx);
+
+	for(i=0;i<UNCOMPR_PACKETS_LEN;i++)
+		test_v42bis_tcpip(v42bis_ctx,i);
+	printf("Done\n");
+	talloc_report_full(v42bis_ctx, stderr);
+	OSMO_ASSERT(talloc_total_blocks(v42bis_ctx) == 1);
+	return 0;
+}
+
+/* stubs */
+struct osmo_prim_hdr;
+int bssgp_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
+{
+	abort();
+}
diff --git a/openbsc/tests/v42bis/v42bis_test.ok b/openbsc/tests/v42bis/v42bis_test.ok
new file mode 100644
index 0000000..1f0edeb
--- /dev/null
+++ b/openbsc/tests/v42bis/v42bis_test.ok
@@ -0,0 +1,224 @@
+Testing compression/decompression with generated data:
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 0
+uncompressed_original= 00000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0 ASCII:................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................
+uncompressed=          00000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0 ASCII:................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................
+compressed=            0180e0703824120a1309c1e0f0884424462385c2e190c868cc670f87c4221112190e27138a4522a5329c5e2f188c464c6638dc6e391c8e9cce71f8fc82412141a0e4723924924a9349c9e4f28944a546a395cae592c96acd672f97cc2613161b0e67339a4d26ad369cde6f389c4e5c6e39dcee793c9ebcde73f9fd02814182c16870484c268d0886c36930c88c4699108ac569f148cc66a5188ec76ab1c90c86b12092c96b72494ca6bd2896cb6c32c98cc6c9309acd6cf349cce6d5389ecf6db3ca0d06e140a25120d47a3d22954aa5d369b4ea8542a353a9d52ad56abd66b35aae572bb5fafd82c562b1d96cb66b45a2d36bb5db2dd6eb7dc6e372b9dcc0775bac1eef7785de6f30fbddee277dbec5eff7f8de07031fc1e0e4785c2c9f0f8795e27132fc5e2e678dc6cdf1f8f9de47233f0080 ASCII:...p8$........D$F#.....h.g..."....'..E".2.^/..FLf8.n9....q...A!A..r9$.J.I....D.F......j.g/..&....g3.M&.6..o8.N\n9..y<...s....A..hpHL&....i0..F....i.H.f....j..... ..krIL..(..l2....0..l.I...8..m..... at .Q .z=".J..i...B.S..*.j.f.Z.W+.....b..l.kE..k..-..}..r...w[...w..o0...'}............x\,.....q2.^.g.......G#?..
+memcmp() rc=0
+
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 2
+uncompressed_original= 00000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0 ASCII:................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................
+uncompressed=          00000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0 ASCII:................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................
+compressed=            01800000400000000000000000000000000004040404040404040404040404040404080808080808080808080808080808080c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c1010101010101010101010101010101014141414141414141414141414141414181818181818181818181818181818181c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c2020202020202020202020202020202024242424242424242424242424242424282828282828282828282828282828282c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c3030303030303030303030303030303034343434343434343434343434343434383838383838383838383838383838383c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c0000000000000000000000000000000004040404040404040404040404040404080808080808080808080808080808080c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c1010101010101010101010101010101014141414141414141414141414141414181818181818181818181818181818181c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c2020202020202020202020202020202024242424242424242424242424242424282828282828282828282828282828282c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c3030303030303030303030303030303034343434343434343434343434343434383838383838383838383838383838383c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c0000000000000000000000000000000004040404040404040404040404040404080808080808080808080808080808080c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c1010101010101010101010101010101014141414141414141414141414141414181818181818181818181818181818181c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c2020202020202020202020202020202024242424242424242424242424242424282828282828282828282828282828282c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c3030303030303030303030303030303034343434343434343434343434343434383838383838383838383838383838383c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c0000000000000000000000000000000004040404040404040404040404040404080808080808080808080808080808080c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c1010101010101010101010101010101014141414141414141414141414141414181818181818181818181818181818181c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c2020202020202020202020202020202024242424242424242424242424242424282828282828282828282828282828282c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c3030303030303030303030303030303034343434343434343434343434343434383838383838383838383838383838383c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c00 ASCII:.... at .............................................................................................................................                $$$$$$$$$$$$$$$$((((((((((((((((,,,,,,,,,,,,,,,,000000000000000044444444444444448888888888888888<<<<<<<<<<<<<<<<................................................................................................................................                $$$$$$$$$$$$$$$$((((((((((((((((,,,,,,,,,,,,,,,,000000000000000044444444444444448888888888888888<<<<<<<<<<<<<<<<................................................................................................................................                $$$$$$$$$$$$$$$$((((((((((((((((,,,,,,,,,,,,,,,,000000000000000044444444444444448888888888888888<<<<<<<<<<<<<<<<................................................................................................................................                $$$$$$$$$$$$$$$$((((((((((((((((,,,,,,,,,,,,,,,,000000000000000044444444444444448888888888888888<<<<<<<<<<<<<<<<.
+memcmp() rc=0
+
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 1
+uncompressed_original= 00000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0 ASCII:................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................
+uncompressed=          00000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f000000000000000000000000000000000101010101010101010101010101010102020202020202020202020202020202030303030303030303030303030303030404040404040404040404040404040405050505050505050505050505050505060606060606060606060606060606060707070707070707070707070707070708080808080808080808080808080808090909090909090909090909090909090a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0 ASCII:................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................................................                0000000000000000@@@@@@@@@@@@@@@@PPPPPPPPPPPPPPPP````````````````pppppppppppppppp................................................................................................................................
+compressed=            0180e0703824120a1309c1e0f0884424462385c2e190c868cc670f87c4221112190e27138a4522a5329c5e2f188c464c6638dc6e391c8e9cce71f8fc82412141a0e4723924924a9349c9e4f28944a546a395cae592c96acd672f97cc2613161b0e67339a4d26ad369cde6f389c4e5c6e39dcee793c9ebcde73f9fd02814182c16870484c268d0886c36930c88c4699108ac569f148cc66a5188ec76ab1c90c86b12092c96b72494ca6bd2896cb6c32c98cc6c9309acd6cf349cce6d5389ecf6db3ca0d06e140a25120d47a3d22954aa5d369b4ea8542a353a9d52ad56abd66b35aae572bb5fafd82c562b1d96cb66b45a2d36bb5db2dd6eb7dc6e372b9dcc0775bac1eef7785de6f30fbddee277dbec5eff7f8de07031fc1e0e4785c2c9f0f8795e27132fc5e2e678dc6cdf1f8f9de47233f0080 ASCII:...p8$........D$F#.....h.g..."....'..E".2.^/..FLf8.n9....q...A!A..r9$.J.I....D.F......j.g/..&....g3.M&.6..o8.N\n9..y<...s....A..hpHL&....i0..F....i.H.f....j..... ..krIL..(..l2....0..l.I...8..m..... at .Q .z=".J..i...B.S..*.j.f.Z.W+.....b..l.kE..k..-..}..r...w[...w..o0...'}............x\,.....q2.^.g.......G#?..
+memcmp() rc=0
+
+Testing compression/decompression with realistic TCP/IP packets:
+Packet No.: 0
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 0
+uncompressed_original= 45000236000700004006cf2cc0a80002550d93d7400000501e200da7c0c95a70801840002e3700000101080a000174140853d489474554202f20485454502f312e310d0a4163636570743a206d756c7469706172742f6d697865642c206170706c69636174696f6e2f766e642e7761702e6d756c7469706172742e6d697865642c206170706c69636174696f6e2f766e642e7761702e7868746d6c2b786d6c2c206170706c69636174696f6e2f7868746d6c2b786d6c2c20746578742f766e642e7761702e776d6c2c202a2f2a0d0a4163636570742d436861727365743a207574662d382c207574662d31362c2069736f2d383835392d312c2069736f2d31303634362d7563732d322c2053686966745f4a49532c20426967350d0a4163636570742d4c616e67756167653a20656e0d0a782d7761702d70726f66696c653a2022687474703a2f2f7761702e736f6e796572696373736f6e2e636f6d2f554170726f662f4b38303069523230312e786d6c220d0a486f73743a207777772e7a6f636b2e636f6d0d0a557365722d4167656e743a20536f6e794572696373736f6e4b383030692f5232422052656c656173652f4d61722d31332d323030372042726f777365722f4e657446726f6e742f332e332050726f66696c652f4d4944502d322e3020436f6e66696775726174696f6e2f434c44432d312e310d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a206465666c6174652c20677a69700d0a0d0a ASCII:E..6.... at ..,....U... at ..P. ....Zp.. at ..7........t..S..GET / HTTP/1.1..Accept: multipart/mixed, application/vnd.wap.multipart.mixed, application/vnd.wap.xhtml+xml, application/xhtml+xml, text/vnd.wap.wml, */*..Accept-Charset: utf-8, utf-16, iso-8859-1, iso-10646-ucs-2, Shift_JIS, Big5..Accept-Language: en..x-wap-profile: "http://wap.sonyericsson.com/UAprof/K800iR201.xml"..Host: www.zock.com..User-Agent: SonyEricssonK800i/R2B Release/Mar-13-2007 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1..Connection: Keep-Alive..Accept-Encoding: deflate, gzip....
+uncompressed=          45000236000700004006cf2cc0a80002550d93d7400000501e200da7c0c95a70801840002e3700000101080a000174140853d489474554202f20485454502f312e310d0a4163636570743a206d756c7469706172742f6d697865642c206170706c69636174696f6e2f766e642e7761702e6d756c7469706172742e6d697865642c206170706c69636174696f6e2f766e642e7761702e7868746d6c2b786d6c2c206170706c69636174696f6e2f7868746d6c2b786d6c2c20746578742f766e642e7761702e776d6c2c202a2f2a0d0a4163636570742d436861727365743a207574662d382c207574662d31362c2069736f2d383835392d312c2069736f2d31303634362d7563732d322c2053686966745f4a49532c20426967350d0a4163636570742d4c616e67756167653a20656e0d0a782d7761702d70726f66696c653a2022687474703a2f2f7761702e736f6e796572696373736f6e2e636f6d2f554170726f662f4b38303069523230312e786d6c220d0a486f73743a207777772e7a6f636b2e636f6d0d0a557365722d4167656e743a20536f6e794572696373736f6e4b383030692f5232422052656c656173652f4d61722d31332d323030372042726f777365722f4e657446726f6e742f332e332050726f66696c652f4d4944502d322e3020436f6e66696775726174696f6e2f434c44432d312e310d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a206465666c6174652c20677a69700d0a0d0a ASCII:E..6.... at ..,....U... at ..P. ....Zp.. at ..7........t..S..GET / HTTP/1.1..Accept: multipart/mixed, application/vnd.wap.multipart.mixed, application/vnd.wap.xhtml+xml, application/xhtml+xml, text/vnd.wap.wml, */*..Accept-Charset: utf-8, utf-16, iso-8859-1, iso-10646-ucs-2, Shift_JIS, Big5..Accept-Language: en..x-wap-profile: "http://wap.sonyericsson.com/UAprof/K800iR201.xml"..Host: www.zock.com..User-Agent: SonyEricssonK800i/R2B Release/Mar-13-2007 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1..Connection: Keep-Alive..Accept-Encoding: deflate, gzip....
+compressed=            2400c0a3901828060321825a42f61aae085808259b4438494c4223082a986cc2e9cd061b8b0c4750902010160d01810ee1705959ae8c25120ae231908c96572b94c6434188d0200d22198cc68399dc7a23381e0de77361ccc8753b8c8e06c3d9a0ce2f11990e673379b0cc64a71c8e2323c9c4ce313d570634ba6d3ea277b6d5ab15aae57ac16236592cd68b55b0f66b3b9c0de2e3de12ed5dafd86c765c0e0f0b8737d68ee683dd4ecf69b59ced588118b4642da0d0e8b4718118d7513b1a290233c1dcd2301dd6b5fb11a0e6b46c3b1cb643b1c0f06034dceef82331c8dc72303c198ec301ad68ac6b361a4ee6226930ad5a229b0d438d1d128c771813cc871351e0c86a34524d071a09ec619b181ccea72349b0dfeb118970477398f46432cd8c776713e1a0eb603b4286266391c06458227d3ec32270ec6633361546a339f6484b41259c8edad3d1e8f4313e9c8cc6e894528258d59d46044f51c75a56b21f0910ee642a3b1f360ca444511954d1f9326ac6450a8f046dce8f8e84645fa9ea703228eb093f59e8c86c311b08ca7f5fbfe6ee4c2394f9c311988c8d64fbf9ceb623659064462791c8dc1188d283a5389c4d066b19c6924e3451a755f3c9a3bf45a38c090718999cd9e6a499cd06937d88d15a351f69f41a0804 ASCII:$.....(..!.ZB....X.%.D8ILB#.*.l.......GP. .......pYY..%...1...W+..CA.. ."......z#8...sa..u;......./...g3y..d...##...1=W.4.m>.w......z.b6Y,..U..k;.......]..lv\....7.....N.i...X...d-....q...Q;.).3...0........l;..C...`4...#1..r0<.....h.k6.N."i0.Z"..C....w.....Q..j4RM....a.....#I.....pGs..d2..wg....`;B.&c..dX"}>."p.f36.F.9.HKA%.......1>.....R.X..F.OQ.ZV.....d*;.6..DQ.T..2j.E...m....d_..p2(..?Y..l1...._...L#.......d....#e.dF'........8.M.k...N4Q.U....E..............}..Z5.i....
+memcmp() rc=0
+
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 2
+uncompressed_original= 45000236000700004006cf2cc0a80002550d93d7400000501e200da7c0c95a70801840002e3700000101080a000174140853d489474554202f20485454502f312e310d0a4163636570743a206d756c7469706172742f6d697865642c206170706c69636174696f6e2f766e642e7761702e6d756c7469706172742e6d697865642c206170706c69636174696f6e2f766e642e7761702e7868746d6c2b786d6c2c206170706c69636174696f6e2f7868746d6c2b786d6c2c20746578742f766e642e7761702e776d6c2c202a2f2a0d0a4163636570742d436861727365743a207574662d382c207574662d31362c2069736f2d383835392d312c2069736f2d31303634362d7563732d322c2053686966745f4a49532c20426967350d0a4163636570742d4c616e67756167653a20656e0d0a782d7761702d70726f66696c653a2022687474703a2f2f7761702e736f6e796572696373736f6e2e636f6d2f554170726f662f4b38303069523230312e786d6c220d0a486f73743a207777772e7a6f636b2e636f6d0d0a557365722d4167656e743a20536f6e794572696373736f6e4b383030692f5232422052656c656173652f4d61722d31332d323030372042726f777365722f4e657446726f6e742f332e332050726f66696c652f4d4944502d322e3020436f6e66696775726174696f6e2f434c44432d312e310d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a206465666c6174652c20677a69700d0a0d0a ASCII:E..6.... at ..,....U... at ..P. ....Zp.. at ..7........t..S..GET / HTTP/1.1..Accept: multipart/mixed, application/vnd.wap.multipart.mixed, application/vnd.wap.xhtml+xml, application/xhtml+xml, text/vnd.wap.wml, */*..Accept-Charset: utf-8, utf-16, iso-8859-1, iso-10646-ucs-2, Shift_JIS, Big5..Accept-Language: en..x-wap-profile: "http://wap.sonyericsson.com/UAprof/K800iR201.xml"..Host: www.zock.com..User-Agent: SonyEricssonK800i/R2B Release/Mar-13-2007 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1..Connection: Keep-Alive..Accept-Encoding: deflate, gzip....
+uncompressed=          45000236000700004006cf2cc0a80002550d93d7400000501e200da7c0c95a70801840002e3700000101080a000174140853d489474554202f20485454502f312e310d0a4163636570743a206d756c7469706172742f6d697865642c206170706c69636174696f6e2f766e642e7761702e6d756c7469706172742e6d697865642c206170706c69636174696f6e2f766e642e7761702e7868746d6c2b786d6c2c206170706c69636174696f6e2f7868746d6c2b786d6c2c20746578742f766e642e7761702e776d6c2c202a2f2a0d0a4163636570742d436861727365743a207574662d382c207574662d31362c2069736f2d383835392d312c2069736f2d31303634362d7563732d322c2053686966745f4a49532c20426967350d0a4163636570742d4c616e67756167653a20656e0d0a782d7761702d70726f66696c653a2022687474703a2f2f7761702e736f6e796572696373736f6e2e636f6d2f554170726f662f4b38303069523230312e786d6c220d0a486f73743a207777772e7a6f636b2e636f6d0d0a557365722d4167656e743a20536f6e794572696373736f6e4b383030692f5232422052656c656173652f4d61722d31332d323030372042726f777365722f4e657446726f6e742f332e332050726f66696c652f4d4944502d322e3020436f6e66696775726174696f6e2f434c44432d312e310d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a206465666c6174652c20677a69700d0a0d0a ASCII:E..6.... at ..,....U... at ..P. ....Zp.. at ..7........t..S..GET / HTTP/1.1..Accept: multipart/mixed, application/vnd.wap.multipart.mixed, application/vnd.wap.xhtml+xml, application/xhtml+xml, text/vnd.wap.wml, */*..Accept-Charset: utf-8, utf-16, iso-8859-1, iso-10646-ucs-2, Shift_JIS, Big5..Accept-Language: en..x-wap-profile: "http://wap.sonyericsson.com/UAprof/K800iR201.xml"..Host: www.zock.com..User-Agent: SonyEricssonK800i/R2B Release/Mar-13-2007 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1..Connection: Keep-Alive..Accept-Encoding: deflate, gzip....
+compressed=            24000000408d8001c0001001b3cb302a0000954364f5d000001407880369f032569c200610000b8dc000004040420280005d050214f52251d155080bc8121515140bcc4b8c43429058d8d95c1d0e881b5d5b1d1a5c185c9d0bdb5a5e19590b08185c1c1b1a58d85d1a5bdb8bdd9b990b9dd85c0b9b5d5b1d1a5c185c9d0b9b5a5e19590b08185c1c1b1a58d85d1a5bdb8bdd9b990b9dd85c0b9e1a1d1b5b0ade1b5b0b08185c1c1b1a58d85d1a5bdb8bde1a1d1b5b0ade1b5b0b081d195e1d0bdd9b990b9dd85c0b9ddb5b0b080a8bca83429058d8d95c1d0b50da185c9cd95d0e881d5d198b4e0b081d5d198b4c4d8b081a5cdbcb4e0e0d4e4b4c4b081a5cdbcb4c4c0d8d0d8b5d58dccb4c8b0814da1a599d17d29254cb08109a59cd43429058d8d95c1d0b53185b99dd5859d94e88195b83429e0b5dd85c0b5c1c9bd99a5b194e88089a1d1d1c0e8bcbddd85c0b9cdbdb9e595c9a58dcdcdbdb8b98dbdb4bd5505c1c9bd98bd2ce0c0c1a548c8c0c4b9e1b5b088342921bdcdd0e881dddddcb9e9bd8dacb98dbdb4342955cd95c8b5059d95b9d0e8814dbdb9e515c9a58dcdcdbdb92ce0c0c1a4bd48c908814995b19585cd94bd3585c8b4c4ccb4c8c0c0dc8109c9bdddcd95c8bd3995d119c9bdb9d0bcccb8cc8141c9bd99a5b194bd35251140b4c8b8c0810dbdb999a59dd5c985d1a5bdb8bd0d31110cb4c4b8c434290dbdb9b9958dd1a5bdb8e8812d9595c0b505b1a5d9943429058d8d95c1d0b515b98dbd91a5b99ce881919599b185d194b0819de9a5c0342834280 ASCII:$... at .........0*...Cd........i.2V. ........@@B...]...."Q.U.........K.CB.X..\....][..\.\...Z^.Y...\...X.].[........\..][..\.\...Z^.Y...\...X.].[........\.....[...[...\...X.].[......[...[....^........\...[......B.X..\..P..\..]...]..N...]..LM...\..N..NKLK..\..LL....]X..L.....Y....T....Y.CB.X..\..S.[..XY.N..[.B..].\.\....[.N...........\.....Y\.X........K.P\.........T...K..[..B..................CB.\.\.PY.[.......Q\.X.........K......[.X\.K.X\.LL.L..........\...]...............[.K.RQ..L........Y.\.].[.......LK.CB.....X..[.....Y\.P[.].CB.X..\..Q[....[.....Y..].K....\.B.B.
+memcmp() rc=0
+
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 1
+uncompressed_original= 45000236000700004006cf2cc0a80002550d93d7400000501e200da7c0c95a70801840002e3700000101080a000174140853d489474554202f20485454502f312e310d0a4163636570743a206d756c7469706172742f6d697865642c206170706c69636174696f6e2f766e642e7761702e6d756c7469706172742e6d697865642c206170706c69636174696f6e2f766e642e7761702e7868746d6c2b786d6c2c206170706c69636174696f6e2f7868746d6c2b786d6c2c20746578742f766e642e7761702e776d6c2c202a2f2a0d0a4163636570742d436861727365743a207574662d382c207574662d31362c2069736f2d383835392d312c2069736f2d31303634362d7563732d322c2053686966745f4a49532c20426967350d0a4163636570742d4c616e67756167653a20656e0d0a782d7761702d70726f66696c653a2022687474703a2f2f7761702e736f6e796572696373736f6e2e636f6d2f554170726f662f4b38303069523230312e786d6c220d0a486f73743a207777772e7a6f636b2e636f6d0d0a557365722d4167656e743a20536f6e794572696373736f6e4b383030692f5232422052656c656173652f4d61722d31332d323030372042726f777365722f4e657446726f6e742f332e332050726f66696c652f4d4944502d322e3020436f6e66696775726174696f6e2f434c44432d312e310d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a206465666c6174652c20677a69700d0a0d0a ASCII:E..6.... at ..,....U... at ..P. ....Zp.. at ..7........t..S..GET / HTTP/1.1..Accept: multipart/mixed, application/vnd.wap.multipart.mixed, application/vnd.wap.xhtml+xml, application/xhtml+xml, text/vnd.wap.wml, */*..Accept-Charset: utf-8, utf-16, iso-8859-1, iso-10646-ucs-2, Shift_JIS, Big5..Accept-Language: en..x-wap-profile: "http://wap.sonyericsson.com/UAprof/K800iR201.xml"..Host: www.zock.com..User-Agent: SonyEricssonK800i/R2B Release/Mar-13-2007 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1..Connection: Keep-Alive..Accept-Encoding: deflate, gzip....
+uncompressed=          45000236000700004006cf2cc0a80002550d93d7400000501e200da7c0c95a70801840002e3700000101080a000174140853d489474554202f20485454502f312e310d0a4163636570743a206d756c7469706172742f6d697865642c206170706c69636174696f6e2f766e642e7761702e6d756c7469706172742e6d697865642c206170706c69636174696f6e2f766e642e7761702e7868746d6c2b786d6c2c206170706c69636174696f6e2f7868746d6c2b786d6c2c20746578742f766e642e7761702e776d6c2c202a2f2a0d0a4163636570742d436861727365743a207574662d382c207574662d31362c2069736f2d383835392d312c2069736f2d31303634362d7563732d322c2053686966745f4a49532c20426967350d0a4163636570742d4c616e67756167653a20656e0d0a782d7761702d70726f66696c653a2022687474703a2f2f7761702e736f6e796572696373736f6e2e636f6d2f554170726f662f4b38303069523230312e786d6c220d0a486f73743a207777772e7a6f636b2e636f6d0d0a557365722d4167656e743a20536f6e794572696373736f6e4b383030692f5232422052656c656173652f4d61722d31332d323030372042726f777365722f4e657446726f6e742f332e332050726f66696c652f4d4944502d322e3020436f6e66696775726174696f6e2f434c44432d312e310d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a206465666c6174652c20677a69700d0a0d0a ASCII:E..6.... at ..,....U... at ..P. ....Zp.. at ..7........t..S..GET / HTTP/1.1..Accept: multipart/mixed, application/vnd.wap.multipart.mixed, application/vnd.wap.xhtml+xml, application/xhtml+xml, text/vnd.wap.wml, */*..Accept-Charset: utf-8, utf-16, iso-8859-1, iso-10646-ucs-2, Shift_JIS, Big5..Accept-Language: en..x-wap-profile: "http://wap.sonyericsson.com/UAprof/K800iR201.xml"..Host: www.zock.com..User-Agent: SonyEricssonK800i/R2B Release/Mar-13-2007 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1..Connection: Keep-Alive..Accept-Encoding: deflate, gzip....
+compressed=            2400c0a3901828060321825a42f61aae085808259b4438494c4223082a986cc2e9cd061b8b0c4750902010160d01810ee1705959ae8c25120ae231908c96572b94c6434188d0200d22198cc68399dc7a23381e0de77361ccc8753b8c8e06c3d9a0ce2f11990e673379b0cc64a71c8e2323c9c4ce313d570634ba6d3ea277b6d5ab15aae57ac16236592cd68b55b0f66b3b9c0de2e3de12ed5dafd86c765c0e0f0b8737d68ee683dd4ecf69b59ced588118b4642da0d0e8b4718118d7513b1a290233c1dcd2301dd6b5fb11a0e6b46c3b1cb643b1c0f06034dceef82331c8dc72303c198ec301ad68ac6b361a4ee6226930ad5a229b0d438d1d128c771813cc871351e0c86a34524d071a09ec619b181ccea72349b0dfeb118970477398f46432cd8c776713e1a0eb603b4286266391c06458227d3ec32270ec6633361546a339f6484b41259c8edad3d1e8f4313e9c8cc6e894528258d59d46044f51c75a56b21f0910ee642a3b1f360ca444511954d1f9326ac6450a8f046dce8f8e84645fa9ea703228eb093f59e8c86c311b08ca7f5fbfe6ee4c2394f9c311988c8d64fbf9ceb623659064462791c8dc1188d283a5389c4d066b19c6924e3451a755f3c9a3bf45a38c090718999cd9e6a499cd06937d88d15a351f69f41a0804 ASCII:$.....(..!.ZB....X.%.D8ILB#.*.l.......GP. .......pYY..%...1...W+..CA.. ."......z#8...sa..u;......./...g3y..d...##...1=W.4.m>.w......z.b6Y,..U..k;.......]..lv\....7.....N.i...X...d-....q...Q;.).3...0........l;..C...`4...#1..r0<.....h.k6.N."i0.Z"..C....w.....Q..j4RM....a.....#I.....pGs..d2..wg....`;B.&c..dX"}>."p.f36.F.9.HKA%.......1>.....R.X..F.OQ.ZV.....d*;.6..DQ.T..2j.E...m....d_..p2(..?Y..l1...._...L#.......d....#e.dF'........8.M.k...N4Q.U....E..............}..Z5.i....
+memcmp() rc=0
+
+Testing compression/decompression with realistic TCP/IP packets:
+Packet No.: 1
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 0
+uncompressed_original= 4510004046dd40004006a9a7c0a8646ec0a864640017ad8b81980100f3ac984d801800e32a1600000101080a000647de06d1bf5efffd18fffd20fffd23fffd27 ASCII:E.. at F.@. at .....dn..dd...........M....*.........G....^..... ..#..'
+uncompressed=          4510004046dd40004006a9a7c0a8646ec0a864640017ad8b81980100f3ac984d801800e32a1600000101080a000647de06d1bf5efffd18fffd20fffd23fffd27 ASCII:E.. at F.@. at .....dn..dd...........M....*.........G....^..... ..#..'
+compressed=            2404c064324b80870504ab154c35599ce30e3399c061a58239089b0200decaf4d941061b01b985a190180c08040583406092538412d46118605000dcd44735134d454010 ASCII:$..d2K......L5Y...3..a..9........A.............@`.S...a.`P...G5.ME at .
+memcmp() rc=0
+
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 2
+uncompressed_original= 4510004046dd40004006a9a7c0a8646ec0a864640017ad8b81980100f3ac984d801800e32a1600000101080a000647de06d1bf5efffd18fffd20fffd23fffd27 ASCII:E.. at F.@. at .....dn..dd...........M....*.........G....^..... ..#..'
+uncompressed=          4510004046dd40004006a9a7c0a8646ec0a864640017ad8b81980100f3ac984d801800e32a1600000101080a000647de06d1bf5efffd18fffd20fffd23fffd27 ASCII:E.. at F.@. at .....dn..dd...........M....*.........G....^..... ..#..'
+compressed=            24000400005011b750001001aa69f02a191bb02a19190005eb62e0660040403ceb261360060038ca85800000404202800191f781b46fd7bfff463fff483fff48ffff49c0 ASCII:$....P..P....i.*...*.....b.f.@@<.&.`..8..... at B.......o...F?.H?.H..I.
+memcmp() rc=0
+
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 1
+uncompressed_original= 4510004046dd40004006a9a7c0a8646ec0a864640017ad8b81980100f3ac984d801800e32a1600000101080a000647de06d1bf5efffd18fffd20fffd23fffd27 ASCII:E.. at F.@. at .....dn..dd...........M....*.........G....^..... ..#..'
+uncompressed=          4510004046dd40004006a9a7c0a8646ec0a864640017ad8b81980100f3ac984d801800e32a1600000101080a000647de06d1bf5efffd18fffd20fffd23fffd27 ASCII:E.. at F.@. at .....dn..dd...........M....*.........G....^..... ..#..'
+compressed=            2404c064324b80870504ab154c35599ce30e3399c061a58239089b0200decaf4d941061b01b985a190180c08040583406092538412d46118605000dcd44735134d454010 ASCII:$..d2K......L5Y...3..a..9........A.............@`.S...a.`P...G5.ME at .
+memcmp() rc=0
+
+Testing compression/decompression with realistic TCP/IP packets:
+Packet No.: 2
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 0
+uncompressed_original= 4510005b46de40004006a98bc0a8646ec0a864640017ad8b8198010cf3ac984d801800e3867500000101080a000647df06d1bf61fffb03fffd1ffffd21fffe22fffb05fffa2001fff0fffa2301fff0fffa2701fff0fffa1801fff0 ASCII:E..[F. at .@.....dn..dd...........M.....u........G....a........!.."..... .....#.....'.........
+uncompressed=          4510005b46de40004006a98bc0a8646ec0a864640017ad8b8198010cf3ac984d801800e3867500000101080a000647df06d1bf61fffb03fffd1ffffd21fffe22fffb05fffa2001fff0fffa2301fff0fffa2701fff0fffa1801fff0 ASCII:E..[F. at .@.....dn..dd...........M.....u........G....a........!.."..... .....#.....'.........
+compressed=            2404c065e24b84860321825588e61aacce718799cce030d2c11c844d8101ef657a6ca0830d80dcc893c00c06040202c1a0304929c4096a308c9027f01a0500114e44902808966c08813f44604813ce8626a3521fa2aa5d0c374b0080 ASCII:$..e.K...!.U.....q....0....M...ezl...............0I)..j0..'.....ND.(..l..?D`H...&.R...].7K..
+memcmp() rc=0
+
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 2
+uncompressed_original= 4510005b46de40004006a98bc0a8646ec0a864640017ad8b8198010cf3ac984d801800e3867500000101080a000647df06d1bf61fffb03fffd1ffffd21fffe22fffb05fffa2001fff0fffa2301fff0fffa2701fff0fffa1801fff0 ASCII:E..[F. at .@.....dn..dd...........M.....u........G....a........!.."..... .....#.....'.........
+uncompressed=          4510005b46de40004006a98bc0a8646ec0a864640017ad8b8198010cf3ac984d801800e3867500000101080a000647df06d1bf61fffb03fffd1ffffd21fffe22fffb05fffa2001fff0fffa2301fff0fffa2701fff0fffa1801fff0 ASCII:E..[F. at .@.....dn..dd...........M.....u........G....a........!.."..... .....#.....'.........
+compressed=            240004000056d1b790001001aa62f02a191bb02a19190005eb62e0660040433ceb261360060038e19d400000404202800191f7c1b46fd87ffec0ffff47ffff487fff88bffec17ffe88007ffc3ffe88c07ffc3ffe89c07ffc3ffe86007ffc00 ASCII:$....V.......b.*...*.....b.f. at C<.&.`..8.. at ..@B.......o......G..H............?.....?.....?......
+memcmp() rc=0
+
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 1
+uncompressed_original= 4510005b46de40004006a98bc0a8646ec0a864640017ad8b8198010cf3ac984d801800e3867500000101080a000647df06d1bf61fffb03fffd1ffffd21fffe22fffb05fffa2001fff0fffa2301fff0fffa2701fff0fffa1801fff0 ASCII:E..[F. at .@.....dn..dd...........M.....u........G....a........!.."..... .....#.....'.........
+uncompressed=          4510005b46de40004006a98bc0a8646ec0a864640017ad8b8198010cf3ac984d801800e3867500000101080a000647df06d1bf61fffb03fffd1ffffd21fffe22fffb05fffa2001fff0fffa2301fff0fffa2701fff0fffa1801fff0 ASCII:E..[F. at .@.....dn..dd...........M.....u........G....a........!.."..... .....#.....'.........
+compressed=            2404c065e24b84860321825588e61aacce718799cce030d2c11c844d8101ef657a6ca0830d80dcc893c00c06040202c1a0304929c4096a308c9027f01a0500114e44902808966c08813f44604813ce8626a3521fa2aa5d0c374b0080 ASCII:$..e.K...!.U.....q....0....M...ezl...............0I)..j0..'.....ND.(..l..?D`H...&.R...].7K..
+memcmp() rc=0
+
+Testing compression/decompression with realistic TCP/IP packets:
+Packet No.: 3
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 0
+uncompressed_original= 4510003746df40004006a9aec0a8646ec0a864640017ad8b81980133f3ac989f801800e35fd700000101080a000647e106d1bf63fffd01 ASCII:E..7F. at .@.....dn..dd.......3........_.........G....c...
+uncompressed=          4510003746df40004006a9aec0a8646ec0a864640017ad8b81980133f3ac989f801800e35fd700000101080a000647e106d1bf63fffd01 ASCII:E..7F. at .@.....dn..dd.......3........_.........G....c...
+compressed=            2404c063a24b8886032182558b161aacce718799cce030d2c11c844d8106cf657a6d44830d80dcc626d00c06040202c1a0304929c8096a308cd028001002 ASCII:$..c.K...!.U.....q....0....M...ezmD.....&........0I)..j0..(...
+memcmp() rc=0
+
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 2
+uncompressed_original= 4510003746df40004006a9aec0a8646ec0a864640017ad8b81980133f3ac989f801800e35fd700000101080a000647e106d1bf63fffd01 ASCII:E..7F. at .@.....dn..dd.......3........_.........G....c...
+uncompressed=          4510003746df40004006a9aec0a8646ec0a864640017ad8b81980133f3ac989f801800e35fd700000101080a000647e106d1bf63fffd01 ASCII:E..7F. at .@.....dn..dd.......3........_.........G....c...
+compressed=            24000400004dd1b7d0001001aa6bb02a191bb02a19190005eb62e06600404cfceb2627e0060038d7f5c00000404202800191f841b46fd8ffff4040 ASCII:$....M.......k.*...*.....b.f. at L..&'...8..... at B.....A.o...@@
+memcmp() rc=0
+
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 1
+uncompressed_original= 4510003746df40004006a9aec0a8646ec0a864640017ad8b81980133f3ac989f801800e35fd700000101080a000647e106d1bf63fffd01 ASCII:E..7F. at .@.....dn..dd.......3........_.........G....c...
+uncompressed=          4510003746df40004006a9aec0a8646ec0a864640017ad8b81980133f3ac989f801800e35fd700000101080a000647e106d1bf63fffd01 ASCII:E..7F. at .@.....dn..dd.......3........_.........G....c...
+compressed=            2404c063a24b8886032182558b161aacce718799cce030d2c11c844d8106cf657a6d44830d80dcc626d00c06040202c1a0304929c8096a308cd028001002 ASCII:$..c.K...!.U.....q....0....M...ezmD.....&........0I)..j0..(...
+memcmp() rc=0
+
+Testing compression/decompression with realistic TCP/IP packets:
+Packet No.: 4
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 0
+uncompressed_original= 4510003746e040004006a9adc0a8646ec0a864640017ad8b81980136f3ac98a2801800e35fd200000101080a000647e106d1bf64fffb01 ASCII:E..7F. at .@.....dn..dd.......6........_.........G....d...
+uncompressed=          4510003746e040004006a9adc0a8646ec0a864640017ad8b81980136f3ac98a2801800e35fd200000101080a000647e106d1bf64fffb01 ASCII:E..7F. at .@.....dn..dd.......6........_.........G....d...
+compressed=            2404c063a24b8c86032182558b061aacce718799cce030d2c11c844d81072f657a6d4a830d80dcc626a80c06040202c1a0304929c8096a308cf027f01002 ASCII:$..c.K...!.U.....q....0....M../ezmJ.....&........0I)..j0..'...
+memcmp() rc=0
+
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 2
+uncompressed_original= 4510003746e040004006a9adc0a8646ec0a864640017ad8b81980136f3ac98a2801800e35fd200000101080a000647e106d1bf64fffb01 ASCII:E..7F. at .@.....dn..dd.......6........_.........G....d...
+uncompressed=          4510003746e040004006a9adc0a8646ec0a864640017ad8b81980136f3ac98a2801800e35fd200000101080a000647e106d1bf64fffb01 ASCII:E..7F. at .@.....dn..dd.......6........_.........G....d...
+compressed=            24000400004dd1b810001001aa6b702a191bb02a19190005eb62e06600404dbceb2628a0060038d7f4800000404202800191f841b46fd93ffec040 ASCII:$....M.......kp*...*.....b.f. at M..&(...8..... at B.....A.o.?..@
+memcmp() rc=0
+
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 1
+uncompressed_original= 4510003746e040004006a9adc0a8646ec0a864640017ad8b81980136f3ac98a2801800e35fd200000101080a000647e106d1bf64fffb01 ASCII:E..7F. at .@.....dn..dd.......6........_.........G....d...
+uncompressed=          4510003746e040004006a9adc0a8646ec0a864640017ad8b81980136f3ac98a2801800e35fd200000101080a000647e106d1bf64fffb01 ASCII:E..7F. at .@.....dn..dd.......6........_.........G....d...
+compressed=            2404c063a24b8c86032182558b061aacce718799cce030d2c11c844d81072f657a6d4a830d80dcc626a80c06040202c1a0304929c8096a308cf027f01002 ASCII:$..c.K...!.U.....q....0....M../ezmJ.....&........0I)..j0..'...
+memcmp() rc=0
+
+Testing compression/decompression with realistic TCP/IP packets:
+Packet No.: 5
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 0
+uncompressed_original= 4510007446e140004006a96fc0a8646ec0a864640017ad8b81980139f3ac98a5801800e37b9b00000101080a000647e206d1bf640d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a57656c6c636f6d6520746f20706f6c6c75780d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a ASCII:E..tF. at .@..o..dn..dd.......9........{.........G....d..------------------..Wellcome to pollux..------------------....
+uncompressed=          4510007446e140004006a96fc0a8646ec0a864640017ad8b81980139f3ac98a5801800e37b9b00000101080a000647e206d1bf640d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a57656c6c636f6d6520746f20706f6c6c75780d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a ASCII:E..tF. at .@..o..dn..dd.......9........{.........G....d..------------------..Wellcome to pollux..------------------....
+compressed=            2404c067724b90860321825587261aacce718799cce030d2c11c844d81078f657a6d50830d80dcc7e4f00c06040202c1a0304929ca096a308ce10068c061389c4e6733a9c4d8b468379bccc72381a046773908ce672a01e0f7369dceea13c06cd802 ASCII:$..grK...!.U.&...q....0....M...ezmP..............0I)..j0...h.a8.Ng3....h7...#..Fw9..g*...6.....l..
+memcmp() rc=0
+
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 2
+uncompressed_original= 4510007446e140004006a96fc0a8646ec0a864640017ad8b81980139f3ac98a5801800e37b9b00000101080a000647e206d1bf640d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a57656c6c636f6d6520746f20706f6c6c75780d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a ASCII:E..tF. at .@..o..dn..dd.......9........{.........G....d..------------------..Wellcome to pollux..------------------....
+uncompressed=          4510007446e140004006a96fc0a8646ec0a864640017ad8b81980139f3ac98a5801800e37b9b00000101080a000647e206d1bf640d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a57656c6c636f6d6520746f20706f6c6c75780d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a ASCII:E..tF. at .@..o..dn..dd.......9........{.........G....d..------------------..Wellcome to pollux..------------------....
+compressed=            24000400005d11b850001001aa5bf02a191bb02a19190005eb62e06600404e7ceb262960060038dee6c00000404202800191f881b46fd903428b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b434295d95b1b18dbdb59481d1bc81c1bdb1b1d5e03428b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4342834280 ASCII:$....]..P....[.*...*.....b.f. at N|.&)`..8..... at B.......o..B.KKKKKKKKKKKKKKKKKCB..[....YH........^.B.KKKKKKKKKKKKKKKKKCB.B.
+memcmp() rc=0
+
+v42bis_compress() rc=0
+v42bis_compress_flush() rc=0
+v42bis_decompress() rc=0
+v42bis_decompress_flush() rc=0
+Mode: 1
+uncompressed_original= 4510007446e140004006a96fc0a8646ec0a864640017ad8b81980139f3ac98a5801800e37b9b00000101080a000647e206d1bf640d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a57656c6c636f6d6520746f20706f6c6c75780d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a ASCII:E..tF. at .@..o..dn..dd.......9........{.........G....d..------------------..Wellcome to pollux..------------------....
+uncompressed=          4510007446e140004006a96fc0a8646ec0a864640017ad8b81980139f3ac98a5801800e37b9b00000101080a000647e206d1bf640d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a57656c6c636f6d6520746f20706f6c6c75780d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a ASCII:E..tF. at .@..o..dn..dd.......9........{.........G....d..------------------..Wellcome to pollux..------------------....
+compressed=            2404c067724b90860321825587261aacce718799cce030d2c11c844d81078f657a6d50830d80dcc7e4f00c06040202c1a0304929ca096a308ce10068c061389c4e6733a9c4d8b468379bccc72381a046773908ce672a01e0f7369dceea13c06cd802 ASCII:$..grK...!.U.&...q....0....M...ezmP..............0I)..j0...h.a8.Ng3....h7...#..Fw9..g*...6.....l..
+memcmp() rc=0
+
+Done

-- 
To view, visit https://gerrit.osmocom.org/644
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I689413f2541b6def0625ce6bd96f1f488f05f99d
Gerrit-PatchSet: 30
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list