aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-08-04 12:56:45 +0200
committerPaul Kocialkowski <contact@paulk.fr>2014-08-04 12:56:45 +0200
commitd0de45e9191fd8c9a99487f5123844b86f07d5de (patch)
treebe0d68c2a3b2d3cb7f870f8b5214a3ab1267e9d8 /samsung-ipc
parentc48926e382b68d0764c88b453711a9b269735537 (diff)
downloadexternal_libsamsung-ipc-d0de45e9191fd8c9a99487f5123844b86f07d5de.zip
external_libsamsung-ipc-d0de45e9191fd8c9a99487f5123844b86f07d5de.tar.gz
external_libsamsung-ipc-d0de45e9191fd8c9a99487f5123844b86f07d5de.tar.bz2
sms: SVC center addr extract helper
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'samsung-ipc')
-rw-r--r--samsung-ipc/sms.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/samsung-ipc/sms.c b/samsung-ipc/sms.c
index beacecc..0e0c807 100644
--- a/samsung-ipc/sms.c
+++ b/samsung-ipc/sms.c
@@ -176,4 +176,29 @@ int ipc_sms_del_msg_setup(struct ipc_sms_del_msg_request_data *data,
return 0;
}
+size_t ipc_sms_svc_center_addr_smsc_size_extract(const void *data, size_t size)
+{
+ struct ipc_sms_svc_center_addr_header *header;
+
+ header = (struct ipc_sms_svc_center_addr_header *) data;
+ if (header->length == 0 || header->length > size - sizeof(struct ipc_sms_svc_center_addr_header))
+ return 0;
+
+ return (size_t) header->length;
+}
+
+void *ipc_sms_svc_center_addr_smsc_extract(const void *data, size_t size)
+{
+ struct ipc_sms_svc_center_addr_header *header;
+ void *smsc;
+
+ header = (struct ipc_sms_svc_center_addr_header *) data;
+ if (header->length == 0 || header->length > size - sizeof(struct ipc_sms_svc_center_addr_header))
+ return NULL;
+
+ smsc = (void *) ((unsigned char *) data + sizeof(struct ipc_sms_svc_center_addr_header));
+
+ return smsc;
+}
+
// vim:ts=4:sw=4:expandtab