diff options
author | Philipp <pmaier@sysmocom.de> | 2016-09-02 13:32:38 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-09-24 03:17:59 +0000 |
commit | d8b45778de992ea5dec6d543a7cad10783a3d69b (patch) | |
tree | 28370ca46b1fc1e104c04d94c0d7600bb207218c /openbsc/include/openbsc | |
parent | 0b11db7e9f6f15262443d5f31206bec92ea05d8f (diff) |
V.42bis: integration and unit test
- Edit previously committed V.42bis implementation to function
outside IAXmodem.
- Add unit test to verify the correct function of V.42bis
Change-Id: I689413f2541b6def0625ce6bd96f1f488f05f99d
Diffstat (limited to 'openbsc/include/openbsc')
-rw-r--r-- | openbsc/include/openbsc/Makefile.am | 2 | ||||
-rw-r--r-- | openbsc/include/openbsc/debug.h | 1 | ||||
-rw-r--r-- | openbsc/include/openbsc/v42bis.h | 9 | ||||
-rw-r--r-- | openbsc/include/openbsc/v42bis_private.h | 1 |
4 files changed, 11 insertions, 2 deletions
diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index e28c507a9..3014d5fa1 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -78,6 +78,8 @@ noinst_HEADERS = \ trau_upqueue.h \ ussd.h \ vty.h \ + v42bis.h \ + v42bis_private.h \ $(NULL) openbsc_HEADERS = \ diff --git a/openbsc/include/openbsc/debug.h b/openbsc/include/openbsc/debug.h index 90ddca5a2..ca3d4ad0d 100644 --- a/openbsc/include/openbsc/debug.h +++ b/openbsc/include/openbsc/debug.h @@ -37,6 +37,7 @@ enum { DGTPHUB, DRANAP, DSUA, + DV42BIS, Debug_LastEntry, }; diff --git a/openbsc/include/openbsc/v42bis.h b/openbsc/include/openbsc/v42bis.h index b947a61cd..607a58e51 100644 --- a/openbsc/include/openbsc/v42bis.h +++ b/openbsc/include/openbsc/v42bis.h @@ -31,9 +31,13 @@ conjunction with the error correction scheme defined in V.42. \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_MIN_STRING_SIZE 6 #define V42BIS_MAX_STRING_SIZE 250 #define V42BIS_MIN_DICTIONARY_SIZE 512 @@ -56,6 +60,8 @@ enum V42BIS_COMPRESSION_MODE_NEVER }; +typedef void (*put_msg_func_t)(void *user_data, const uint8_t *msg, int len); + /*! V.42bis compression/decompression descriptor. This defines the working state for a single instance of V.42bis compress/decompression. @@ -111,7 +117,8 @@ SPAN_DECLARE(void) v42bis_compression_control(v42bis_state_t *s, int mode); \param decode_user_data An opaque pointer passed to the decode callback handler. \param max_decode_len The maximum length that should be passed to the decode 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/v42bis_private.h b/openbsc/include/openbsc/v42bis_private.h index 2c801ebe2..daa5ea315 100644 --- a/openbsc/include/openbsc/v42bis_private.h +++ b/openbsc/include/openbsc/v42bis_private.h @@ -120,7 +120,6 @@ struct v42bis_state_s v42bis_comp_state_t decompress; /*! \brief Error and flow logging control */ - logging_state_t logging; }; #endif |