diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-03-22 03:25:11 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-03-24 06:16:04 +0100 |
commit | 22481bf76d129d3c41d20b96b6587ef085be485b (patch) | |
tree | 8c8de852e945dd5422a83bc7e0c37548d2911fe2 /openbsc/src/sccp/sccp.c | |
parent | b973955295b720b8ba7c556d0165750ed9bfb381 (diff) | |
parent | 61b4232c6363ff9d78ef73b9dbf47ec16c94d610 (diff) |
Merge remote branch 'origin/master' into on-waves/bsc-master
* Move to libosmocore
* Move to new debugging architecture
* Register the BTS types
* Has only been compile tested
Conflicts:
openbsc/include/openbsc/Makefile.am
openbsc/include/openbsc/gsm_data.h
openbsc/include/openbsc/ipaccess.h
openbsc/include/openbsc/mgcp.h
openbsc/include/openbsc/msgb.h
openbsc/include/openbsc/tlv.h
openbsc/src/Makefile.am
openbsc/src/abis_rsl.c
openbsc/src/bsc_init.c
openbsc/src/bsc_mgcp.c
openbsc/src/chan_alloc.c
openbsc/src/debug.c
openbsc/src/gsm_subscriber_base.c
openbsc/src/msgb.c
openbsc/src/rest_octets.c
openbsc/src/sccp/sccp.c
openbsc/src/vty/command.c
openbsc/src/vty_interface.c
openbsc/tests/Makefile.am
Diffstat (limited to 'openbsc/src/sccp/sccp.c')
-rw-r--r-- | openbsc/src/sccp/sccp.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/openbsc/src/sccp/sccp.c b/openbsc/src/sccp/sccp.c index 8b3a487a0..b1da2c721 100644 --- a/openbsc/src/sccp/sccp.c +++ b/openbsc/src/sccp/sccp.c @@ -2,7 +2,7 @@ * SCCP management code * * (C) 2009, 2010 by Holger Hans Peter Freyther <zecke@selfish.org> - * (C) 2009, 2010 by on-waves.com + * (C) 2009, 2010 by On-Waves * * All Rights Reserved * @@ -24,11 +24,12 @@ #include <string.h> +#include <osmocore/msgb.h> +#include <openbsc/debug.h> +#include <osmocore/talloc.h> + #include <sccp/sccp.h> -#include <openbsc/debug.h> -#include <openbsc/talloc.h> -#include <openbsc/linuxlist.h> static void *tall_sccp_ctx; static LLIST_HEAD(sccp_connections); @@ -208,7 +209,7 @@ int _sccp_parse_connection_request(struct msgb *msgb, struct sccp_parse_result * static const u_int32_t called_offset = offsetof(struct sccp_connection_request, variable_called); - struct sccp_connection_request *req = (struct sccp_connection_request *)msgb->data; + struct sccp_connection_request *req = (struct sccp_connection_request *)msgb->l2h; struct sccp_optional_data optional_data; /* header check */ @@ -459,6 +460,7 @@ int _sccp_parse_udt(struct msgb *msgb, struct sccp_parse_result *result) msgb->l3h = &udt->data[udt->variable_data]; + result->data_len = msgb_l3len(msgb); if (msgb_l3len(msgb) != msgb->l3h[-1]) { DEBUGP(DSCCP, "msgb is truncated is: %u should: %u\n", @@ -469,6 +471,25 @@ int _sccp_parse_udt(struct msgb *msgb, struct sccp_parse_result *result) return 0; } +static int _sccp_parse_it(struct msgb *msgb, struct sccp_parse_result *result) +{ + static const u_int32_t header_size = sizeof(struct sccp_data_it); + + struct sccp_data_it *it; + + if (msgb_l2len(msgb) < header_size) { + DEBUGP(DSCCP, "msgb < header_size %u %u\n", + msgb_l2len(msgb), header_size); + return -1; + } + + it = (struct sccp_data_it *) msgb->l2h; + result->data_len = 0; + result->source_local_reference = &it->source_local_reference; + result->destination_local_reference = &it->destination_local_reference; + return 0; +} + /* * Send UDT. Currently we have a fixed address... @@ -1305,8 +1326,12 @@ int sccp_parse_header(struct msgb *msg, struct sccp_parse_result *result) case SCCP_MSG_TYPE_UDT: return _sccp_parse_udt(msg, result); break; + case SCCP_MSG_TYPE_IT: + return _sccp_parse_it(msg, result); + break; }; + LOGP(DSCCP, LOGL_ERROR, "Unimplemented MSG Type: 0x%x\n", type); return -1; } |