diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-07-29 04:14:06 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-07-29 04:23:18 +0800 |
commit | c882a0560d804800312f2ef79658c8f8103a2e0e (patch) | |
tree | a063ead57aafeae23934d35e5614e6c3ec752f6f /openbsc | |
parent | 1c5d12009e15d1790b363de0dfb05f4260249caa (diff) |
gsm0480: Implement a generic "invoke" wrapping for messages.
Implement a GSM 04.80 invoke wrapper for a component and an
invoke id.
Conflicts:
openbsc/src/gsm_04_80.c
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/include/openbsc/gsm_04_80.h | 1 | ||||
-rw-r--r-- | openbsc/src/gsm_04_80.c | 23 |
2 files changed, 23 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/gsm_04_80.h b/openbsc/include/openbsc/gsm_04_80.h index 2842d8d39..bfe7aaa81 100644 --- a/openbsc/include/openbsc/gsm_04_80.h +++ b/openbsc/include/openbsc/gsm_04_80.h @@ -20,5 +20,6 @@ int gsm0480_send_ussd_reject(const struct msgb *msg, 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 479998586..a314d40ec 100644 --- a/openbsc/src/gsm_04_80.c +++ b/openbsc/src/gsm_04_80.c @@ -360,8 +360,29 @@ int gsm0480_send_ussd_response(const struct msgb *in_msg, const char *response_t return gsm48_sendmsg(msg, NULL); } +/* 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(const struct msgb *in_msg, - const struct ussd_request *req) + const struct ussd_request *req) { struct msgb *msg = gsm48_msgb_alloc(); struct gsm48_hdr *gh; |