summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-08-01 02:52:28 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-08-01 04:57:41 +0800
commit9aa8c8bb35f4c5fe78f514f9ecece20f26cea808 (patch)
tree2e2409ee24d718474031212ee849828cb3a597e0
parent444d8d1234d9ea6b36cb34517be3ee96c3319208 (diff)
sccp: Make it possible to have a POC inside the sockaddr_sccp.
Embed the POC, add the indicator, add the POC byte.
-rw-r--r--include/sccp/sccp.h3
-rw-r--r--src/sccp/sccp.c14
2 files changed, 15 insertions, 2 deletions
diff --git a/include/sccp/sccp.h b/include/sccp/sccp.h
index 7c75b0c..6305704 100644
--- a/include/sccp/sccp.h
+++ b/include/sccp/sccp.h
@@ -58,6 +58,9 @@ struct sockaddr_sccp {
/* any of SCCP_TITLE_IND_* */
uint8_t gti_ind;
+ int use_poi;
+ uint8_t poi[2];
+
/* not sure about these */
/* uint8_t sccp_class; */
};
diff --git a/src/sccp/sccp.c b/src/sccp/sccp.c
index 5d48642..12addde 100644
--- a/src/sccp/sccp.c
+++ b/src/sccp/sccp.c
@@ -514,6 +514,7 @@ static int _sccp_parse_err(struct msgb *msgb, struct sccp_parse_result *result)
static void create_sccp_addr(struct msgb *msg, const struct sockaddr_sccp *sock)
{
+ int pos = 2;
uint8_t *data;
data = msgb_put(msg, 1 + 2 + sock->gti_len);
@@ -524,10 +525,19 @@ static void create_sccp_addr(struct msgb *msg, const struct sockaddr_sccp *sock)
else
data[1] = 1 << 6 | 1 << 1;
- data[2] = sock->sccp_ssn;
+ /* store a point code */
+ if (sock->use_poi) {
+ msgb_put(msg, 2);
+ data[1] |= 0x01;
+ data[pos++] = sock->poi[0];
+ data[pos++] = sock->poi[1];
+ }
+
+
+ data[pos++] = sock->sccp_ssn;
/* copy the gti if it is present */
- memcpy(&data[3], sock->gti, sock->gti_len);
+ memcpy(&data[pos++], sock->gti, sock->gti_len);
}
/*