smpp: Move the coding/mode detection into a utils file
Make sure to not ever have issues with this code again, move the
utility code to a new file and create a basic testcase. The method
currently has 100% line and branch coverage. My initial patched
missed the smpp_utils.c file and I re-did the copying (and verifying
the branch coverage)
diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h
index 747dc3a..21d28dd 100644
--- a/openbsc/src/libmsc/smpp_smsc.h
+++ b/openbsc/src/libmsc/smpp_smsc.h
@@ -15,6 +15,9 @@
#define SMPP_SYS_ID_LEN 16
#define SMPP_PASSWD_LEN 16
+#define MODE_7BIT 7
+#define MODE_8BIT 8
+
enum esme_read_state {
READ_ST_IN_LEN = 0,
READ_ST_IN_MSG = 1,
@@ -126,4 +129,6 @@
const struct osmo_smpp_addr *pfx);
int smpp_vty_init(void);
+
+int smpp_determine_scheme(uint8_t dcs, uint8_t *data_coding, int *mode);
#endif