summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sccp/sccp.h2
-rw-r--r--src/sccp/sccp.c11
2 files changed, 10 insertions, 3 deletions
diff --git a/include/sccp/sccp.h b/include/sccp/sccp.h
index 5dfcc31..2aa0322 100644
--- a/include/sccp/sccp.h
+++ b/include/sccp/sccp.h
@@ -148,7 +148,7 @@ 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);
-struct msgb *sccp_create_refuse(struct sccp_source_reference *src_ref, int cause);
+struct msgb *sccp_create_refuse(struct sccp_source_reference *src_ref, int cause, uint8_t *data, int length);
/**
* Below this are helper functions and structs for parsing SCCP messages
diff --git a/src/sccp/sccp.c b/src/sccp/sccp.c
index 35589dc..f7c31e8 100644
--- a/src/sccp/sccp.c
+++ b/src/sccp/sccp.c
@@ -638,7 +638,7 @@ static void _sccp_set_connection_state(struct sccp_connection *connection, int n
connection->state_cb(connection, old_state);
}
-struct msgb *sccp_create_refuse(struct sccp_source_reference *src_ref, int cause)
+struct msgb *sccp_create_refuse(struct sccp_source_reference *src_ref, int cause, uint8_t *inp, int length)
{
struct msgb *msgb;
struct sccp_connection_refused *ref;
@@ -660,6 +660,13 @@ struct msgb *sccp_create_refuse(struct sccp_source_reference *src_ref, int cause
ref->cause = cause;
ref->optional_start = 1;
+ if (inp) {
+ data = msgb_put(msgb, 1 + 1 + length);
+ data[0] = SCCP_PNC_DATA;
+ data[1] = length;
+ memcpy(&data[2], inp, length);
+ }
+
data = msgb_put(msgb, 1);
data[0] = SCCP_PNC_END_OF_OPTIONAL;
return msgb;
@@ -667,7 +674,7 @@ struct msgb *sccp_create_refuse(struct sccp_source_reference *src_ref, int cause
static int _sccp_send_refuse(struct sccp_source_reference *src_ref, int cause)
{
- struct msgb *msgb = sccp_create_refuse(src_ref, cause);
+ struct msgb *msgb = sccp_create_refuse(src_ref, cause, NULL, 0);
if (!msgb)
return -1;