summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-01-27 12:29:49 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-01-29 04:35:34 +0100
commit575d5def1b5e75471f95e6584409d343d323ee33 (patch)
treea6af7dddda2f1ff20fe03f2418e71eb0fab28293 /include
parent762afe424d9db41bb11383676a776ee9965bbb98 (diff)
[sccp] Invent new API to be used by the BSC NAT
I want to reuse the SCCP code for header parsing in the BSC NAT to identify data and patch the source local reference. To do this the current handle_* methods will be changed into two parts one is strictly parsing the other is handling the parsed data.
Diffstat (limited to 'include')
-rw-r--r--include/sccp/sccp.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/sccp/sccp.h b/include/sccp/sccp.h
index 69ef63c..e5e8b81 100644
--- a/include/sccp/sccp.h
+++ b/include/sccp/sccp.h
@@ -1,7 +1,7 @@
/*
* SCCP management code
*
- * (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * (C) 2009, 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
*
* All Rights Reserved
*
@@ -143,10 +143,25 @@ extern const struct sockaddr_sccp sccp_ssn_bssap;
u_int32_t sccp_src_ref_to_int(struct sccp_source_reference *ref);
struct sccp_source_reference sccp_src_ref_from_int(u_int32_t);
+/**
+ * Below this are helper functions and structs for parsing SCCP messages
+ */
+struct sccp_parse_result {
+ struct sccp_address called;
+ struct sccp_address calling;
+
+ /* point to the msg packet */
+ struct sccp_source_reference *source_local_reference;
+ struct sccp_source_reference *destination_local_reference;
+
+ /* data pointer */
+ int data_len;
+};
/*
* helper functions for the nat code
*/
int sccp_determine_msg_type(struct msgb *msg);
+int sccp_parse_header(struct msgb *msg, struct sccp_parse_result *result);
#endif