From 6a4b362ceb7dd1742de2d1ffebadf1846634a3af Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 26 Jul 2010 03:41:11 +0800 Subject: [PATCH] gsm0480: Implement a generic "invoke" wrapping for messages. Implement a GSM 04.80 invoke wrapper for a component and an invoke id. --- openbsc/include/openbsc/gsm_04_80.h | 1 + openbsc/src/gsm_04_80.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/openbsc/include/openbsc/gsm_04_80.h b/openbsc/include/openbsc/gsm_04_80.h index 85b6a4990..8a25554e9 100644 --- a/openbsc/include/openbsc/gsm_04_80.h +++ b/openbsc/include/openbsc/gsm_04_80.h @@ -24,5 +24,6 @@ int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, const struct ussd_request *request); struct msgb * gsm0480_create_notifySS(const char *text); +int gsm0480_wrap_invoke(struct msgb *msg, int op, int link_id); #endif diff --git a/openbsc/src/gsm_04_80.c b/openbsc/src/gsm_04_80.c index f2a0728f2..71fb40577 100644 --- a/openbsc/src/gsm_04_80.c +++ b/openbsc/src/gsm_04_80.c @@ -360,6 +360,27 @@ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, return gsm0808_submit_dtap(conn, msg, 0); } +/* wrap an invoke around it... the other way around + * + * 1.) Invoke Component tag + * 2.) Invoke ID Tag + * 3.) Operation + * 4.) Data + */ +int gsm0480_wrap_invoke(struct msgb *msg, int op, int link_id) +{ + /* 3. operation */ + msgb_push_TLV1(msg, GSM0480_OPERATION_CODE, op); + + /* 2. invoke id tag */ + msgb_push_TLV1(msg, GSM0480_COMPIDTAG_INVOKE_ID, link_id); + + /* 1. component tag */ + msgb_wrap_with_TL(msg, GSM0480_CTYPE_INVOKE); + + return 0; +} + int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, const struct msgb *in_msg, const struct ussd_request *req)