diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-05-25 16:21:35 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-07-31 16:58:26 +0200 |
commit | 0655cac6f1fbb0a669f064780a171a363ce8ef83 (patch) | |
tree | 17bda895ab0b476e73d74e9fdb6deb21dd38689b /include | |
parent | b05d72d21b8cc91126cf45525f9010df6142e1c2 (diff) |
sysmobts: Verify the structure of IPA and OML messages
Extend the router to verify that the message received is
properly encoded. The code can deal with the basic structure
of ETSI OML and vendor specific messages for ip.access and
the osmocom project.
Diffstat (limited to 'include')
-rw-r--r-- | include/osmo-bts/Makefile.am | 2 | ||||
-rw-r--r-- | include/osmo-bts/msg_utils.h | 20 | ||||
-rw-r--r-- | include/osmo-bts/oml.h | 4 |
3 files changed, 25 insertions, 1 deletions
diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am index d7f9421f..68d63e09 100644 --- a/include/osmo-bts/Makefile.am +++ b/include/osmo-bts/Makefile.am @@ -1,3 +1,3 @@ noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h logging.h measurement.h \ oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \ - handover.h + handover.h msg_utils.h diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h new file mode 100644 index 00000000..f63c0964 --- /dev/null +++ b/include/osmo-bts/msg_utils.h @@ -0,0 +1,20 @@ +/* + * Routines to check the structurally integrity of messages + */ + +#pragma once + +struct msgb; + +/** + * Classification of OML message. ETSI for plain GSM 12.21 + * messages and IPA/Osmo for manufacturer messages. + */ +enum { + OML_MSG_TYPE_ETSI, + OML_MSG_TYPE_IPA, + OML_MSG_TYPE_OSMO, +}; + +int msg_verify_ipa_structure(struct msgb *msg); +int msg_verify_oml_structure(struct msgb *msg); diff --git a/include/osmo-bts/oml.h b/include/osmo-bts/oml.h index dfbc5549..d7092780 100644 --- a/include/osmo-bts/oml.h +++ b/include/osmo-bts/oml.h @@ -5,6 +5,10 @@ struct gsm_bts; struct gsm_abis_mo; struct msgb; + +extern const char oml_ipa_magic[13]; +extern const char oml_osmo_magic[12]; + int oml_init(void); int down_oml(struct gsm_bts *bts, struct msgb *msg); |