aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc/sms.c
diff options
context:
space:
mode:
Diffstat (limited to 'samsung-ipc/sms.c')
-rw-r--r--samsung-ipc/sms.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/samsung-ipc/sms.c b/samsung-ipc/sms.c
index bb9e026..6743776 100644
--- a/samsung-ipc/sms.c
+++ b/samsung-ipc/sms.c
@@ -22,6 +22,7 @@
#include <string.h>
#include <samsung-ipc.h>
+#include <utils.h>
void *ipc_sms_send_msg_setup(struct ipc_sms_send_msg_request_header *header,
const char *smsc, const char *pdu)
@@ -58,4 +59,24 @@ void *ipc_sms_send_msg_setup(struct ipc_sms_send_msg_request_header *header,
return data;
}
+char *ipc_sms_incoming_msg_pdu_extract(const void *data, size_t size)
+{
+ struct ipc_sms_incoming_msg_header *header;
+ char *string;
+ void *pdu;
+
+ if (data == NULL || size < sizeof(struct ipc_sms_incoming_msg_header))
+ return NULL;
+
+ header = (struct ipc_sms_incoming_msg_header *) data;
+ if (header->length == 0 || header->length > size - sizeof(struct ipc_sms_incoming_msg_header))
+ return NULL;
+
+ pdu = (void *) ((unsigned char *) data + sizeof(struct ipc_sms_incoming_msg_header));
+
+ string = data2string(pdu, header->length);
+
+ return string;
+}
+
// vim:ts=4:sw=4:expandtab