aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-02-26 19:26:35 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-02-26 19:26:35 +0100
commite1d506778994c6f844d60c903d7cdeb2ffc74925 (patch)
tree797106930bc42f0d8df2490414a346645fc10468 /openbsc/src
parente2c5028dc4ca8b3f9f4846b658a9b80ec3e70f4d (diff)
[sccp] Implement parsing the rather easy IT messages.
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/sccp/sccp.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/openbsc/src/sccp/sccp.c b/openbsc/src/sccp/sccp.c
index 94fd0175c..80f86c4fa 100644
--- a/openbsc/src/sccp/sccp.c
+++ b/openbsc/src/sccp/sccp.c
@@ -470,6 +470,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...
@@ -1306,8 +1325,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;
}