SNDCP: add V.42bis data compression functionality

 - Add compression control for V.42bis Add code to handle compression
   (gprs_sndcp_dcomp.c/h)
 - Add Adjustments in SNDCP
 - Add VTY commands

Change-Id: I6d36cbdf2f5c5f83ca9ba57c70452f02b8582e7e
diff --git a/openbsc/src/gprs/gprs_sndcp_comp.c b/openbsc/src/gprs/gprs_sndcp_comp.c
index 1a9d030..b13cb8b 100644
--- a/openbsc/src/gprs/gprs_sndcp_comp.c
+++ b/openbsc/src/gprs/gprs_sndcp_comp.c
@@ -34,6 +34,7 @@
 #include <openbsc/gprs_sndcp_xid.h>
 #include <openbsc/gprs_sndcp_comp.h>
 #include <openbsc/gprs_sndcp_pcomp.h>
+#include <openbsc/gprs_sndcp_dcomp.h>
 
 /* Create a new compression entity from a XID-Field */
 static struct gprs_sndcp_comp *gprs_sndcp_comp_create(const void *ctx,
@@ -100,16 +101,16 @@
 			comp_entity = NULL;
 		}
 	} else {
-		LOGP(DSNDCP, LOGL_ERROR,
-		     "We don't support data compression yet!\n");
-		talloc_free(comp_entity);
-		return NULL;
+		if (gprs_sndcp_dcomp_init(ctx, comp_entity, comp_field) != 0) {
+			talloc_free(comp_entity);
+			comp_entity = NULL;
+		}
 	}
 
 	/* Display info message */
 	if (comp_entity == NULL) {
 		LOGP(DSNDCP, LOGL_ERROR,
-		     "Header compression entity (%d) creation failed!\n",
+		     "Compression entity (%d) creation failed!\n",
 		     comp_entity->entity);
 		return NULL;
 	}
@@ -159,6 +160,7 @@
 			LOGP(DSNDCP, LOGL_INFO,
 			     "Deleting data compression entity %d ...\n",
 			     comp_entity->entity);
+			gprs_sndcp_dcomp_term(comp_entity);
 		}
 	}