aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-04-05 18:07:45 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-05-03 21:42:28 +0200
commit4ba947bf4b80b553a3411ec1fd29c45430bd6c40 (patch)
tree5b7ba2565b16ff9a0dad4e943ea2b2103a90206b /openbsc/include
parentc36a6d5705830a6fd6e41e684dc031db35165e04 (diff)
filter: Separate SCCP/BSSAP extraction and gsm48 code
For the BSC we will have the gsm48_hdr and don't need to find data within SCCP. For legacy reasons we need to initialize con_type, imsi, reject causes early on and need to do the same in the filter method.
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/bsc_msg_filter.h11
-rw-r--r--openbsc/include/openbsc/bsc_nat.h8
2 files changed, 15 insertions, 4 deletions
diff --git a/openbsc/include/openbsc/bsc_msg_filter.h b/openbsc/include/openbsc/bsc_msg_filter.h
index 7e66517de..a974195c8 100644
--- a/openbsc/include/openbsc/bsc_msg_filter.h
+++ b/openbsc/include/openbsc/bsc_msg_filter.h
@@ -8,6 +8,7 @@
#include <regex.h>
struct vty;
+struct gsm48_hdr;
/* TODO: remove */
struct bsc_nat_parsed;
@@ -64,11 +65,13 @@ int bsc_filter_barr_find(struct rb_root *root, const char *imsi, int *cm, int *l
/**
* Content filtering.
*/
-int bsc_nat_filter_sccp_cr(struct bsc_connection *bsc, struct msgb *msg,
- struct bsc_nat_parsed *, int *con_type, char **imsi,
+int bsc_msg_filter_initial(struct gsm48_hdr *hdr, size_t size,
+ struct bsc_connection *bsc,
+ int *con_type, char **imsi,
struct bsc_filter_reject_cause *cause);
-int bsc_nat_filter_dt(struct bsc_connection *bsc, struct msgb *msg,
- struct nat_sccp_connection *con, struct bsc_nat_parsed *parsed,
+int bsc_msg_filter_data(struct gsm48_hdr *hdr, size_t size,
+ struct bsc_connection *bsc,
+ struct nat_sccp_connection *con,
struct bsc_filter_reject_cause *cause);
/* IMSI allow/deny handling */
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index b9f1e56f8..10f11a62b 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -22,6 +22,7 @@
#define BSC_NAT_H
#include "mgcp.h"
+#include "bsc_msg_filter.h"
#include <osmocom/core/select.h>
@@ -435,6 +436,13 @@ int bsc_nat_handle_ctrlif_msg(struct bsc_connection *bsc, struct msgb *msg);
int bsc_nat_extract_lac(struct bsc_connection *bsc, struct nat_sccp_connection *con,
struct bsc_nat_parsed *parsed, struct msgb *msg);
+int bsc_nat_filter_sccp_cr(struct bsc_connection *bsc, struct msgb *msg,
+ struct bsc_nat_parsed *, int *con_type, char **imsi,
+ struct bsc_filter_reject_cause *cause);
+int bsc_nat_filter_dt(struct bsc_connection *bsc, struct msgb *msg,
+ struct nat_sccp_connection *con, struct bsc_nat_parsed *parsed,
+ struct bsc_filter_reject_cause *cause);
+
/**
* CTRL interface helper
*/