aboutsummaryrefslogtreecommitdiffstats
path: root/src/isup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/isup.c')
-rw-r--r--src/isup.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/isup.c b/src/isup.c
index 54d2772..770fa62 100644
--- a/src/isup.c
+++ b/src/isup.c
@@ -177,6 +177,34 @@ static int send_cgu(struct mtp_link_set *set, int sls, int cic, int range)
return 0;
}
+static int handle_cgu(struct mtp_link_set *set, int sls, int cic,
+ uint8_t *data, uint16_t size)
+{
+ uint8_t *out;
+ struct isup_msg_hdr *hdr;
+ struct msgb *resp;
+
+ resp = msgb_alloc_headroom(4096, 128, "ISUP CGUA MSG");
+ if (!resp) {
+ LOGP(DISUP, LOGL_ERROR, "Allocation of CGUA message failed.\n");
+ return -1;
+ }
+
+ resp->l2h = msgb_put(resp, sizeof(*hdr));
+
+ /* write the ISUP header */
+ hdr = (struct isup_msg_hdr *) resp->l2h;
+ hdr->cic = cic;
+ hdr->msg_type = ISUP_MSG_CGUA;
+
+ out = msgb_put(resp, size);
+ memcpy(out, data, size);
+
+ mtp_link_set_submit_isup_data(set, sls, resp->l2h, msgb_l2len(resp));
+ msgb_free(resp);
+ return 0;
+}
+
static int handle_simple_resp(struct mtp_link_set *set, int sls, int cic, int msg_type)
{
struct msgb *resp;
@@ -217,6 +245,9 @@ int mtp_link_set_isup(struct mtp_link_set *set, struct msgb *msg, int sls)
if (rc == 0)
rc = send_cgu(set, sls, hdr->cic, 28);
break;
+ case ISUP_MSG_CGU:
+ rc = handle_cgu(set, sls, hdr->cic, hdr->data, payload_size);
+ break;
case ISUP_MSG_CGUA:
LOGP(DISUP, LOGL_NOTICE, "CIC %d is now unblocked on linkset %d/%s.\n",
hdr->cic, set->nr, set->name);