aboutsummaryrefslogtreecommitdiffstats
path: root/test_pdu
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-11-07 08:32:31 +0100
committerHarald Welte <laforge@gnumonks.org>2012-11-07 08:32:31 +0100
commit4b233b4f3b22f79c2bdd60703d309c9929f74ab6 (patch)
tree91b2622eb54d509b5c78896aca56babc120f1b7b /test_pdu
initial import of libsmpp34-1.101.10
Diffstat (limited to 'test_pdu')
-rw-r--r--test_pdu/Makefile.am113
-rw-r--r--test_pdu/alert_notification_test.c74
-rw-r--r--test_pdu/bind_receiver_resp_test.c69
-rw-r--r--test_pdu/bind_receiver_test.c65
-rw-r--r--test_pdu/bind_transceiver_resp_test.c69
-rw-r--r--test_pdu/bind_transceiver_test.c64
-rw-r--r--test_pdu/bind_transmitter_resp_test.c68
-rw-r--r--test_pdu/bind_transmitter_test.c64
-rw-r--r--test_pdu/cancel_sm_resp_test.c58
-rw-r--r--test_pdu/cancel_sm_test.c66
-rw-r--r--test_pdu/core.c109
-rw-r--r--test_pdu/core.h29
-rw-r--r--test_pdu/data_sm_resp_test.c58
-rw-r--r--test_pdu/data_sm_test.c84
-rw-r--r--test_pdu/deliver_sm_resp_test.c58
-rw-r--r--test_pdu/deliver_sm_test.c98
-rw-r--r--test_pdu/enquire_link_resp_test.c58
-rw-r--r--test_pdu/enquire_link_test.c58
-rw-r--r--test_pdu/generic_nack_test.c57
-rw-r--r--test_pdu/outbind_test.c60
-rw-r--r--test_pdu/query_sm_resp_test.c62
-rw-r--r--test_pdu/query_sm_test.c62
-rw-r--r--test_pdu/replace_sm_resp_test.c58
-rw-r--r--test_pdu/replace_sm_test.c70
-rw-r--r--test_pdu/submit_multi_resp_test.c89
-rw-r--r--test_pdu/submit_multi_test.c115
-rw-r--r--test_pdu/submit_sm_resp_test.c59
-rw-r--r--test_pdu/submit_sm_test.c93
-rw-r--r--test_pdu/unbind_resp_test.c57
-rw-r--r--test_pdu/unbind_test.c57
30 files changed, 2101 insertions, 0 deletions
diff --git a/test_pdu/Makefile.am b/test_pdu/Makefile.am
new file mode 100644
index 0000000..ff1d869
--- /dev/null
+++ b/test_pdu/Makefile.am
@@ -0,0 +1,113 @@
+# test_pdu/Makefile.am #
+TESTPDU_SOURCE_DIR = $(top_srcdir)/test_pdu
+
+submit_multi_resp_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/submit_multi_resp_test.c
+
+submit_multi_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/submit_multi_test.c
+
+alert_notification_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/alert_notification_test.c
+
+bind_receiver_resp_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/bind_receiver_resp_test.c
+
+bind_receiver_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/bind_receiver_test.c
+
+bind_transceiver_resp_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/bind_transceiver_resp_test.c
+
+bind_transceiver_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/bind_transceiver_test.c
+
+bind_transmitter_resp_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/bind_transmitter_resp_test.c
+
+bind_transmitter_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/bind_transmitter_test.c
+
+cancel_sm_resp_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/cancel_sm_resp_test.c
+
+cancel_sm_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/cancel_sm_test.c
+
+data_sm_resp_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/data_sm_resp_test.c
+
+data_sm_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/data_sm_test.c
+
+deliver_sm_resp_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/deliver_sm_resp_test.c
+
+deliver_sm_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/deliver_sm_test.c
+
+enquire_link_resp_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/enquire_link_resp_test.c
+
+enquire_link_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/enquire_link_test.c
+
+generic_nack_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/generic_nack_test.c
+
+outbind_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/outbind_test.c
+
+query_sm_resp_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/query_sm_resp_test.c
+
+query_sm_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/query_sm_test.c
+
+replace_sm_resp_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/replace_sm_resp_test.c
+
+replace_sm_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/replace_sm_test.c
+
+submit_sm_resp_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/submit_sm_resp_test.c
+
+submit_sm_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/submit_sm_test.c
+
+unbind_resp_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/unbind_resp_test.c
+
+unbind_test_SOURCES = \
+ $(TESTPDU_SOURCE_DIR)/core.c \
+ $(TESTPDU_SOURCE_DIR)/unbind_test.c
+
+noinst_HEADERS = $(TESTPDU_SOURCE_DIR)/core.h
+
diff --git a/test_pdu/alert_notification_test.c b/test_pdu/alert_notification_test.c
new file mode 100644
index 0000000..d220fca
--- /dev/null
+++ b/test_pdu/alert_notification_test.c
@@ -0,0 +1,74 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : alert_notification_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+#define TEXTO "Raul Antonio Tremsal"
+int
+main( int argc, char *argv[] )
+{
+
+ alert_notification_t a;
+ alert_notification_t b;
+ tlv_t tlv;
+
+ memset(&a, 0, sizeof(alert_notification_t));
+ memset(&b, 0, sizeof(alert_notification_t));
+ memset(&tlv, 0, sizeof(tlv_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = ALERT_NOTIFICATION;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ b.source_addr_ton = 2;
+ b.source_addr_npi = 1;
+ snprintf((char*)b.source_addr, ADDRESS_LENGTH, "%s", "0900001111");
+ b.esme_addr_ton = 2;
+ b.esme_addr_npi = 1;
+ snprintf((char*)b.esme_addr, ADDRESS_LENGTH, "%s", "0900001111");
+
+ tlv.tag = TLVID_ms_availability_status; /* defined in smpp34.h */
+ tlv.length = sizeof(uint8_t);
+ tlv.value.val08 = 0x24;
+ build_tlv( &(b.tlv), &tlv );
+
+ doTest(ALERT_NOTIFICATION, &a, &b);
+ destroy_tlv( b.tlv );
+ destroy_tlv( a.tlv );
+
+ return( 0 );
+};
diff --git a/test_pdu/bind_receiver_resp_test.c b/test_pdu/bind_receiver_resp_test.c
new file mode 100644
index 0000000..b02a9c6
--- /dev/null
+++ b/test_pdu/bind_receiver_resp_test.c
@@ -0,0 +1,69 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : bind_receiver_resp_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+int
+main( int argc, char *argv[] )
+{
+
+ bind_receiver_resp_t a;
+ bind_receiver_resp_t b;
+ tlv_t tlv;
+
+ memset(&b, 0, sizeof(bind_receiver_resp_t));
+ memset(&a, 0, sizeof(bind_receiver_resp_t));
+ memset(&tlv, 0, sizeof(tlv_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = BIND_RECEIVER_RESP;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "1234567890123456");
+
+ tlv.tag = TLVID_sc_interface_version;
+ tlv.length = sizeof(uint8_t);
+ tlv.value.val16 = 0x34;
+ build_tlv( &(b.tlv), &tlv );
+
+ doTest(BIND_RECEIVER_RESP, &a, &b);
+ destroy_tlv( b.tlv );
+ destroy_tlv( a.tlv );
+
+ return( 0 );
+};
diff --git a/test_pdu/bind_receiver_test.c b/test_pdu/bind_receiver_test.c
new file mode 100644
index 0000000..571947d
--- /dev/null
+++ b/test_pdu/bind_receiver_test.c
@@ -0,0 +1,65 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : bind_receiver_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+int
+main( int argc, char *argv[] )
+{
+
+ bind_receiver_t a;
+ bind_receiver_t b;
+
+ memset(&a, 0, sizeof(bind_receiver_t));
+ memset(&b, 0, sizeof(bind_receiver_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = BIND_RECEIVER;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "system_id");
+ snprintf((char*)b.password, sizeof(b.password), "%s", "pass");
+ snprintf((char*)b.system_type, sizeof(b.system_type), "%s", "syste");
+ b.addr_ton = 0x34;
+ b.addr_ton = 2;
+ b.addr_npi = 1;
+ snprintf((char*)b.address_range, sizeof(b.address_range), "%s", "address_range");
+
+ doTest(BIND_RECEIVER, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/bind_transceiver_resp_test.c b/test_pdu/bind_transceiver_resp_test.c
new file mode 100644
index 0000000..621b17c
--- /dev/null
+++ b/test_pdu/bind_transceiver_resp_test.c
@@ -0,0 +1,69 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : bind_transceiver_resp_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+#define TEXTO "Raul Antonio Tremsal"
+
+int
+main( int argc, char *argv[] )
+{
+ bind_transceiver_resp_t a;
+ bind_transceiver_resp_t b;
+ tlv_t tlv;
+
+ memset(&a, 0, sizeof(bind_transceiver_resp_t));
+ memset(&b, 0, sizeof(bind_transceiver_resp_t));
+ memset(&tlv, 0, sizeof(tlv));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = BIND_TRANSCEIVER_RESP;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "system_id");
+
+ tlv.tag = TLVID_sc_interface_version;
+ tlv.length = sizeof(uint8_t);
+ tlv.value.val16 = 0x34;
+ build_tlv( &(b.tlv), &tlv );
+
+ doTest(BIND_TRANSCEIVER_RESP, &a, &b);
+ destroy_tlv( b.tlv );
+ destroy_tlv( a.tlv );
+ return( 0 );
+};
diff --git a/test_pdu/bind_transceiver_test.c b/test_pdu/bind_transceiver_test.c
new file mode 100644
index 0000000..8d8fdff
--- /dev/null
+++ b/test_pdu/bind_transceiver_test.c
@@ -0,0 +1,64 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : bind_transceiver_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+int
+main( int argc, char *argv[] )
+{
+
+ bind_transceiver_t a;
+ bind_transceiver_t b;
+
+ memset(&a, 0, sizeof(bind_transceiver_t));
+ memset(&b, 0, sizeof(bind_transceiver_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = BIND_TRANSCEIVER;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "system_id");
+ snprintf((char*)b.password, sizeof(b.password), "%s", "pas");
+ snprintf((char*)b.system_type, sizeof(b.system_type), "%s", "syst");
+ b.interface_version= 0x34;
+ b.addr_ton = 2;
+ b.addr_npi = 1;
+ snprintf((char*)b.address_range, sizeof(b.address_range), "%s", "address_range");
+
+ doTest(BIND_TRANSCEIVER, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/bind_transmitter_resp_test.c b/test_pdu/bind_transmitter_resp_test.c
new file mode 100644
index 0000000..f6263e6
--- /dev/null
+++ b/test_pdu/bind_transmitter_resp_test.c
@@ -0,0 +1,68 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : bind_transmitter_resp_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+int
+main( int argc, char *argv[] )
+{
+
+ bind_transmitter_resp_t a;
+ bind_transmitter_resp_t b;
+ tlv_t tlv;
+
+ memset(&a, 0, sizeof(bind_transmitter_resp_t));
+ memset(&b, 0, sizeof(bind_transmitter_resp_t));
+ memset(&tlv, 0, sizeof(tlv_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = BIND_TRANSMITTER_RESP;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "system_id");
+
+ tlv.tag = TLVID_sc_interface_version;
+ tlv.length = sizeof(uint8_t);
+ tlv.value.val16 = 0x34;
+ build_tlv( &(b.tlv), &tlv );
+
+ doTest(BIND_TRANSMITTER_RESP, &a, &b);
+ destroy_tlv( b.tlv );
+ destroy_tlv( a.tlv );
+ return( 0 );
+};
diff --git a/test_pdu/bind_transmitter_test.c b/test_pdu/bind_transmitter_test.c
new file mode 100644
index 0000000..78e641e
--- /dev/null
+++ b/test_pdu/bind_transmitter_test.c
@@ -0,0 +1,64 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : bind_transmitter_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+int
+main( int argc, char *argv[] )
+{
+
+ bind_transmitter_t a;
+ bind_transmitter_t b;
+
+ memset(&a, 0, sizeof(bind_transmitter_t));
+ memset(&b, 0, sizeof(bind_transmitter_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = BIND_TRANSMITTER;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "system_id");
+ snprintf((char*)b.password, sizeof(b.password), "%s", "pass");
+ snprintf((char*)b.system_type, sizeof(b.system_type), "%s", "syst");
+ b.interface_version = 0x34;
+ b.addr_ton = 2;
+ b.addr_npi = 1;
+ snprintf((char*)b.address_range, sizeof(b.address_range), "%s", "address_range");
+
+ doTest(BIND_TRANSMITTER, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/cancel_sm_resp_test.c b/test_pdu/cancel_sm_resp_test.c
new file mode 100644
index 0000000..5ab6a5c
--- /dev/null
+++ b/test_pdu/cancel_sm_resp_test.c
@@ -0,0 +1,58 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : cancel_sm_resp_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+int
+main( int argc, char *argv[] )
+{
+
+ cancel_sm_resp_t a;
+ cancel_sm_resp_t b;
+
+ memset(&a, 0, sizeof(cancel_sm_resp_t));
+ memset(&b, 0, sizeof(cancel_sm_resp_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = CANCEL_SM_RESP;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+
+ doTest(CANCEL_SM_RESP, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/cancel_sm_test.c b/test_pdu/cancel_sm_test.c
new file mode 100644
index 0000000..074ae5e
--- /dev/null
+++ b/test_pdu/cancel_sm_test.c
@@ -0,0 +1,66 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : cancel_sm_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+int
+main( int argc, char *argv[] )
+{
+
+ cancel_sm_t a;
+ cancel_sm_t b;
+
+ memset(&a, 0, sizeof(cancel_sm_t));
+ memset(&b, 0, sizeof(cancel_sm_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = CANCEL_SM;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.service_type, sizeof(b.service_type), "%s", "CMT");
+ snprintf((char*)b.message_id, sizeof(b.message_id), "%s", "0302830192");
+ b.source_addr_ton = 2;
+ b.source_addr_npi = 1;
+ snprintf((char*)b.source_addr, sizeof(b.source_addr), "%s", "0900001111");
+ b.dest_addr_ton = 2;
+ b.dest_addr_npi = 1;
+ snprintf((char*)b.destination_addr, sizeof(b.source_addr), "%s", "0900001111");
+
+ doTest(CANCEL_SM, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/core.c b/test_pdu/core.c
new file mode 100644
index 0000000..30676a4
--- /dev/null
+++ b/test_pdu/core.c
@@ -0,0 +1,109 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : core.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+
+extern int smpp34_errno;
+extern char smpp34_strerror[2048];
+
+
+int
+doTest( uint32_t id, void* dst, void* src )
+{
+
+ int ret = 0;
+ uint8_t bufPDU[2048];
+ int bufPDULen = 0;
+ uint8_t bPrint[2048];
+
+ /* Linealize PDU to buffer ********************************************/
+ memset(&bufPDU, 0, sizeof(bufPDU));
+ ret = smpp34_pack(id, bufPDU, sizeof(bufPDU), &bufPDULen, (void*)src);
+ if( ret != 0 ){
+ printf("Error in smpp34_pack():%d:\n%s\n",
+ smpp34_errno, smpp34_strerror);
+ return( 0 );
+ };
+ printf("parse smpp34_pack()\n%s\n", smpp34_strerror);
+
+ /* Print PDU **********************************************************/
+ memset(&bPrint, 0, sizeof(bPrint));
+ ret = smpp34_dumpPdu(id, bPrint, sizeof(bPrint), (void*)src);
+ if( ret != 0){
+ printf("Error in smpp34_dumpPdu():%d:\n%s\n",
+ smpp34_errno, smpp34_strerror);
+ return( -1 );
+ };
+ printf("parse smpp34_dumpPdu()\n%s\n", smpp34_strerror);
+ printf("-----------------------------------------------------------\n");
+ printf("%s\n", bPrint);
+ printf("-----------------------------------------------------------\n");
+
+ /* Print Buffer *******************************************************/
+ memset(bPrint, 0, sizeof(bPrint));
+ ret = smpp34_dumpBuf(bPrint, sizeof(bPrint), bufPDU, bufPDULen);
+ if( ret != 0 ){
+ printf("Error in smpp34_dumpBuf():%d:\n%s\n",
+ smpp34_errno, smpp34_strerror );
+ return( -1 );
+ };
+ printf("parse smpp34_dumpBuf()\n%s\n", smpp34_strerror);
+ printf("-----------------------------------------------------------\n");
+ printf("%s", bPrint);
+ printf("-----------------------------------------------------------\n");
+
+ /* Copy PDU from Buffer ***********************************************/
+ ret = smpp34_unpack(id, (void*)dst, bufPDU, bufPDULen);
+ if( ret != 0 ){
+ printf("Error in smpp34_unpack():%d:\n%s\n",
+ smpp34_errno, smpp34_strerror);
+ return( -1 );
+ };
+ printf("parse smpp34_unpack()\n%s\n", smpp34_strerror);
+
+ /* Print PDU **********************************************************/
+ memset(bPrint, 0, sizeof(bPrint));
+ ret = smpp34_dumpPdu(id, bPrint, sizeof(bPrint), (void*)dst );
+ if( ret != 0){
+ printf("Error in smpp34_dumpPdu():%d:\n%s\n",
+ smpp34_errno, smpp34_strerror);
+ return( -1 );
+ };
+ printf("parse smpp34_dumpPdu()\n%s\n", smpp34_strerror);
+ printf("-----------------------------------------------------------\n");
+ printf("%s\n", bPrint);
+ printf("-----------------------------------------------------------\n");
+ return( 0 );
+};
diff --git a/test_pdu/core.h b/test_pdu/core.h
new file mode 100644
index 0000000..1aac663
--- /dev/null
+++ b/test_pdu/core.h
@@ -0,0 +1,29 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : core.h
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef _CORE_H_
+#define _CORE_H_
+
+int doTest( uint32_t id, void* dst, void* src );
+#endif /* _CORE_H_ */
diff --git a/test_pdu/data_sm_resp_test.c b/test_pdu/data_sm_resp_test.c
new file mode 100644
index 0000000..5e311fb
--- /dev/null
+++ b/test_pdu/data_sm_resp_test.c
@@ -0,0 +1,58 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : data_sm_resp_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+int
+main( int argc, char *argv[] )
+{
+
+ data_sm_resp_t a;
+ data_sm_resp_t b;
+
+ memset(&a, 0, sizeof(data_sm_resp_t));
+ memset(&b, 0, sizeof(data_sm_resp_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = DATA_SM_RESP;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.message_id, sizeof(b.message_id), "%s", "88898239379");
+
+ doTest(DATA_SM_RESP, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/data_sm_test.c b/test_pdu/data_sm_test.c
new file mode 100644
index 0000000..ed2fd15
--- /dev/null
+++ b/test_pdu/data_sm_test.c
@@ -0,0 +1,84 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : data_sm_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+#define TEXTO "Raul Antonio Tremsal"
+
+int
+main( int argc, char *argv[] )
+{
+
+ data_sm_t a;
+ data_sm_t b;
+ tlv_t tlv;
+
+ memset(&a, 0, sizeof(data_sm_t));
+ memset(&b, 0, sizeof(data_sm_t));
+ memset(&tlv, 0, sizeof(tlv_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = DATA_SM;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.service_type, SERVICE_TYPE_LENGTH, "%s", "CMT");
+ b.source_addr_ton = 2;
+ b.source_addr_npi = 1;
+ snprintf((char*)b.source_addr, ADDRESS_LENGTH, "%s", "0900001111");
+ b.dest_addr_ton = 2;
+ b.dest_addr_npi = 1;
+ snprintf((char*)b.destination_addr, ADDRESS_LENGTH, "%s", "0900001111");
+ b.esm_class = 0;
+ b.registered_delivery = 0;
+ b.data_coding = 0;
+
+ tlv.tag = TLVID_user_message_reference;
+ tlv.length = sizeof(uint16_t);
+ tlv.value.val16 = 0x0024;
+ build_tlv( &(b.tlv), &tlv );
+
+ tlv.tag = TLVID_message_payload;
+ tlv.length = strlen(TEXTO);
+ memcpy(tlv.value.octet, TEXTO, tlv.length);
+ build_tlv( &(b.tlv), &tlv );
+
+ doTest(DATA_SM, &a, &b);
+ destroy_tlv( b.tlv );
+ destroy_tlv( a.tlv );
+ return( 0 );
+};
diff --git a/test_pdu/deliver_sm_resp_test.c b/test_pdu/deliver_sm_resp_test.c
new file mode 100644
index 0000000..a1238dd
--- /dev/null
+++ b/test_pdu/deliver_sm_resp_test.c
@@ -0,0 +1,58 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : deliver_sm_resp_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+int
+main( int argc, char *argv[] )
+{
+
+ deliver_sm_resp_t a;
+ deliver_sm_resp_t b;
+
+ memset(&a, 0, sizeof(deliver_sm_resp_t));
+ memset(&b, 0, sizeof(deliver_sm_resp_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = DELIVER_SM_RESP;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.message_id, sizeof(b.message_id), "%s", "");
+
+ doTest(DELIVER_SM_RESP, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/deliver_sm_test.c b/test_pdu/deliver_sm_test.c
new file mode 100644
index 0000000..04757d3
--- /dev/null
+++ b/test_pdu/deliver_sm_test.c
@@ -0,0 +1,98 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : deliver_sm_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+#define TEXTO "Raul Antonio Tremsal"
+
+int
+main( int argc, char *argv[] )
+{
+
+ deliver_sm_t a;
+ deliver_sm_t b;
+ tlv_t tlv;
+
+ memset(&a, 0, sizeof(deliver_sm_t));
+ memset(&b, 0, sizeof(deliver_sm_t));
+ memset(&tlv, 0, sizeof(tlv_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = DELIVER_SM;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.service_type, SERVICE_TYPE_LENGTH, "%s", "CMT");
+ b.source_addr_ton = 2;
+ b.source_addr_npi = 1;
+ snprintf((char*)b.source_addr, ADDRESS_LENGTH, "%s", "0900001111");
+ b.dest_addr_ton = 2;
+ b.dest_addr_npi = 1;
+ snprintf((char*)b.destination_addr, ADDRESS_LENGTH, "%s", "0900001111");
+ b.esm_class = 0;
+ b.protocol_id = 0;
+ b.priority_flag = 0;
+ memset(b.schedule_delivery_time, 0, sizeof(b.schedule_delivery_time));
+ memset(b.validity_period, 0, sizeof(b.validity_period));
+ b.registered_delivery = 0;
+ b.replace_if_present_flag =0;
+ b.data_coding = 0;
+ b.sm_default_msg_id = 0;
+ b.sm_length = strlen(TEXTO);
+ memcpy(b.short_message, TEXTO, b.sm_length);
+
+ tlv.tag = TLVID_user_message_reference;
+ tlv.length = sizeof(uint16_t);
+ tlv.value.val16 = 0x0024;
+ build_tlv( &(b.tlv), &tlv );
+
+ tlv.tag = TLVID_message_payload;
+ tlv.length = strlen(TEXTO);
+ memcpy(tlv.value.octet, TEXTO, tlv.length);
+ build_tlv( &(b.tlv), &tlv );
+
+ tlv.tag = 0x1501;
+
+ tlv.length = strlen(TEXTO);
+ memcpy(tlv.value.octet, TEXTO, tlv.length);
+ build_tlv( &(b.tlv), &tlv );
+
+ doTest(DELIVER_SM, &a, &b);
+ destroy_tlv( b.tlv );
+ destroy_tlv( a.tlv );
+ return( 0 );
+};
diff --git a/test_pdu/enquire_link_resp_test.c b/test_pdu/enquire_link_resp_test.c
new file mode 100644
index 0000000..823bebb
--- /dev/null
+++ b/test_pdu/enquire_link_resp_test.c
@@ -0,0 +1,58 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : enquire_link_resp_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+int
+main( int argc, char *argv[] )
+{
+
+ enquire_link_resp_t a;
+ enquire_link_resp_t b;
+
+ memset(&a, 0, sizeof(enquire_link_resp_t));
+ memset(&b, 0, sizeof(enquire_link_resp_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = ENQUIRE_LINK_RESP;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+
+ doTest(ENQUIRE_LINK_RESP, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/enquire_link_test.c b/test_pdu/enquire_link_test.c
new file mode 100644
index 0000000..9e1890c
--- /dev/null
+++ b/test_pdu/enquire_link_test.c
@@ -0,0 +1,58 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : enquire_link_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+int
+main( int argc, char *argv[] )
+{
+
+ enquire_link_t a;
+ enquire_link_t b;
+
+ memset(&a, 0, sizeof(enquire_link_t));
+ memset(&b, 0, sizeof(enquire_link_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = ENQUIRE_LINK;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+
+ doTest(ENQUIRE_LINK, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/generic_nack_test.c b/test_pdu/generic_nack_test.c
new file mode 100644
index 0000000..b61ecc6
--- /dev/null
+++ b/test_pdu/generic_nack_test.c
@@ -0,0 +1,57 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : generic_nack_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+int
+main( int argc, char *argv[] )
+{
+
+ generic_nack_t a;
+ generic_nack_t b;
+
+ memset(&a, 0, sizeof(generic_nack_t));
+ memset(&b, 0, sizeof(generic_nack_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = GENERIC_NACK;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+
+ doTest(GENERIC_NACK, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/outbind_test.c b/test_pdu/outbind_test.c
new file mode 100644
index 0000000..4e1d993
--- /dev/null
+++ b/test_pdu/outbind_test.c
@@ -0,0 +1,60 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : outbind_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+int
+main( int argc, char *argv[] )
+{
+
+ outbind_t a;
+ outbind_t b;
+
+ memset(&a, 0, sizeof(outbind_t));
+ memset(&b, 0, sizeof(outbind_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = OUTBIND;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "system_id");
+ snprintf((char*)b.password, sizeof(b.password), "%s", "pass");
+
+ doTest(OUTBIND, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/query_sm_resp_test.c b/test_pdu/query_sm_resp_test.c
new file mode 100644
index 0000000..4b79bdb
--- /dev/null
+++ b/test_pdu/query_sm_resp_test.c
@@ -0,0 +1,62 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : query_sm_resp_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+int
+main( int argc, char *argv[] )
+{
+
+ query_sm_resp_t a;
+ query_sm_resp_t b;
+
+ memset(&a, 0, sizeof(query_sm_resp_t));
+ memset(&b, 0, sizeof(query_sm_resp_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = QUERY_SM_RESP;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.message_id, sizeof(b.message_id), "%s", "88898239379");
+ snprintf((char*)b.final_date, sizeof(b.final_date), "%s", "No se");
+ b.message_state = 1;
+ b.error_code = 4;
+
+ doTest(QUERY_SM_RESP, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/query_sm_test.c b/test_pdu/query_sm_test.c
new file mode 100644
index 0000000..3318219
--- /dev/null
+++ b/test_pdu/query_sm_test.c
@@ -0,0 +1,62 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : query_sm_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+int
+main( int argc, char *argv[] )
+{
+
+ query_sm_t a;
+ query_sm_t b;
+
+ memset(&a, 0, sizeof(query_sm_t));
+ memset(&b, 0, sizeof(query_sm_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = QUERY_SM;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.message_id, sizeof(b.message_id), "%s", "989898");
+ b.source_addr_ton = 2;
+ b.source_addr_npi = 1;
+ snprintf((char*)b.source_addr, ADDRESS_LENGTH, "%s", "0900001111");
+
+ doTest(QUERY_SM, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/replace_sm_resp_test.c b/test_pdu/replace_sm_resp_test.c
new file mode 100644
index 0000000..59435bd
--- /dev/null
+++ b/test_pdu/replace_sm_resp_test.c
@@ -0,0 +1,58 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : replace_sm_resp_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+int
+main( int argc, char *argv[] )
+{
+
+ replace_sm_resp_t a;
+ replace_sm_resp_t b;
+
+ memset(&a, 0, sizeof(replace_sm_resp_t));
+ memset(&b, 0, sizeof(replace_sm_resp_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = REPLACE_SM_RESP;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+
+ doTest(REPLACE_SM_RESP, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/replace_sm_test.c b/test_pdu/replace_sm_test.c
new file mode 100644
index 0000000..3d0a236
--- /dev/null
+++ b/test_pdu/replace_sm_test.c
@@ -0,0 +1,70 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : replace_sm_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+#define TEXTO "Raul Antonio Tremsal"
+
+int
+main( int argc, char *argv[] )
+{
+
+ replace_sm_t a;
+ replace_sm_t b;
+
+ memset(&a, 0, sizeof(replace_sm_t));
+ memset(&b, 0, sizeof(replace_sm_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = REPLACE_SM;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.message_id, sizeof(b.message_id), "%s", "CMT");
+ b.source_addr_ton = 2;
+ b.source_addr_npi = 1;
+ snprintf((char*)b.source_addr, ADDRESS_LENGTH, "%s", "0900001111");
+ memset(b.schedule_delivery_time, 0, sizeof(b.schedule_delivery_time));
+ memset(b.validity_period, 0, sizeof(b.validity_period));
+ b.registered_delivery = 0;
+ b.sm_default_msg_id = 0;
+ b.sm_length = strlen(TEXTO);
+ memcpy(b.short_message, TEXTO, b.sm_length);
+
+ doTest(REPLACE_SM, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/submit_multi_resp_test.c b/test_pdu/submit_multi_resp_test.c
new file mode 100644
index 0000000..5118286
--- /dev/null
+++ b/test_pdu/submit_multi_resp_test.c
@@ -0,0 +1,89 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : submit_multi_resp_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+int
+main( int argc, char *argv[] )
+{
+
+ submit_multi_resp_t a;
+ submit_multi_resp_t b;
+ udad_t udad;
+
+ memset(&a, 0, sizeof(submit_multi_resp_t));
+ memset(&b, 0, sizeof(submit_multi_resp_t));
+ memset(&udad, 0, sizeof( udad_t ));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = SUBMIT_MULTI_RESP;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf( (char*)b.message_id, sizeof(b.message_id), "%s", "88898239379");
+ b.no_unsuccess = 3;
+
+ /* Unsuccess submitted list of DAD ************************************/
+ udad.dest_addr_ton = 2;
+ udad.dest_addr_npi = 1;
+ snprintf( (char*)udad.destination_addr, sizeof(udad.destination_addr),
+ "%s", "9911112222");
+ udad.error_status_code = ESME_RX_T_APPN;
+ build_udad( &(b.unsuccess_smes), &udad );
+
+ udad.dest_addr_ton = 0;
+ udad.dest_addr_npi = 0;
+ snprintf( (char*)udad.destination_addr, sizeof(udad.destination_addr),
+ "%s", "9922223333");
+ udad.error_status_code = ESME_RX_P_APPN;
+ build_udad( &(b.unsuccess_smes), &udad );
+
+ udad.dest_addr_ton = 2;
+ udad.dest_addr_npi = 1;
+ snprintf( (char*)udad.destination_addr, sizeof(udad.destination_addr),
+ "%s", "9933334444");
+ udad.error_status_code = ESME_RX_R_APPN;
+ build_udad( &(b.unsuccess_smes), &udad );
+ /**********************************************************************/
+
+ doTest(SUBMIT_MULTI_RESP, &a, &b);
+
+ destroy_udad( b.unsuccess_smes );
+ destroy_udad( a.unsuccess_smes );
+
+ return( 0 );
+};
diff --git a/test_pdu/submit_multi_test.c b/test_pdu/submit_multi_test.c
new file mode 100644
index 0000000..a2d81bb
--- /dev/null
+++ b/test_pdu/submit_multi_test.c
@@ -0,0 +1,115 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : submit_multi_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+#define TEXTO "Raul Antonio Tremsal"
+
+int
+main( int argc, char *argv[] )
+{
+
+ submit_multi_t a;
+ submit_multi_t b;
+ tlv_t tlv;
+ dad_t dad;
+
+ memset(&a, 0, sizeof(submit_multi_t));
+ memset(&b, 0, sizeof(submit_multi_t));
+ memset(&tlv, 0, sizeof(tlv_t));
+ memset(&dad, 0, sizeof(dad_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = SUBMIT_MULTI;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.service_type, sizeof(b.service_type), "%s", "SMS");
+ b.source_addr_ton = 2;
+ b.source_addr_npi = 1;
+ snprintf((char*)b.source_addr, sizeof(b.source_addr), "%s",
+ "09000011111");
+ /* Destination Addresses Definition ***********************************/
+ b.number_of_dests = 3;
+
+ dad.dest_flag = DFID_SME_Address; /* in smpp34.h */
+ dad.value.sme.dest_addr_ton = 0;
+ dad.value.sme.dest_addr_npi = 0;
+ snprintf((char*)dad.value.sme.destination_addr,
+ sizeof(dad.value.sme.destination_addr), "%s", "0900002222");
+ build_dad( &(b.dest_addr_def), &dad );
+
+ dad.dest_flag = DFID_Distribution_List_Name; /* in smpp34.h */
+ snprintf((char*)dad.value.dl_name, sizeof(dad.value.dl_name),"%s","list_name_01");
+ build_dad( &(b.dest_addr_def), &dad );
+
+ dad.dest_flag = DFID_SME_Address; /* in smpp34.h */
+ dad.value.sme.dest_addr_ton = 2;
+ dad.value.sme.dest_addr_npi = 1;
+ snprintf((char*)dad.value.sme.destination_addr,
+ sizeof(dad.value.sme.destination_addr), "%s", "1100007777");
+ build_dad( &(b.dest_addr_def), &dad );
+ /**********************************************************************/
+
+ b.esm_class = 0;
+ b.protocol_id = 0;
+ b.priority_flag = 0;
+ memset(b.schedule_delivery_time,0,sizeof(b.schedule_delivery_time));
+ memset(b.validity_period,0,sizeof(b.validity_period));
+ b.registered_delivery = 0;
+ b.replace_if_present_flag =0;
+ b.data_coding = 0;
+ b.sm_default_msg_id = 0;
+ b.sm_length = strlen(TEXTO);
+ memcpy(b.short_message, TEXTO, b.sm_length);
+
+ tlv.tag = TLVID_user_message_reference;
+ tlv.length = sizeof(uint16_t);
+ tlv.value.val16 = 0x0024;
+ build_tlv( &(b.tlv), &tlv );
+
+ tlv.tag = TLVID_message_payload;
+ tlv.length = strlen(TEXTO);
+ memcpy(tlv.value.octet, TEXTO, tlv.length);
+ build_tlv( &(b.tlv), &tlv );
+
+ doTest(SUBMIT_MULTI, &a, &b);
+ destroy_tlv( b.tlv );
+ destroy_tlv( a.tlv );
+ destroy_dad( b.dest_addr_def );
+ destroy_dad( a.dest_addr_def );
+ return( 0 );
+};
diff --git a/test_pdu/submit_sm_resp_test.c b/test_pdu/submit_sm_resp_test.c
new file mode 100644
index 0000000..dd94a45
--- /dev/null
+++ b/test_pdu/submit_sm_resp_test.c
@@ -0,0 +1,59 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : submit_sm_resp_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+
+int
+main( int argc, char *argv[] )
+{
+
+ submit_sm_resp_t a;
+ submit_sm_resp_t b;
+
+ memset(&a, 0, sizeof(submit_sm_resp_t));
+ memset(&b, 0, sizeof(submit_sm_resp_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = SUBMIT_SM_RESP;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.message_id, sizeof(b.message_id), "%s", "88898239379");
+
+ doTest(SUBMIT_SM_RESP, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/submit_sm_test.c b/test_pdu/submit_sm_test.c
new file mode 100644
index 0000000..1c1dcc5
--- /dev/null
+++ b/test_pdu/submit_sm_test.c
@@ -0,0 +1,93 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : submit_sm_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+#define TEXTO "Raul Antonio Tremsal"
+
+int
+main( int argc, char *argv[] )
+{
+
+ submit_sm_t a;
+ submit_sm_t b;
+ tlv_t tlv;
+
+ memset(&a, 0, sizeof(submit_sm_t));
+ memset(&b, 0, sizeof(submit_sm_t));
+ memset(&tlv, 0, sizeof(tlv_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = SUBMIT_SM;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+ snprintf((char*)b.service_type, sizeof(b.service_type), "%s", "SMS");
+ b.source_addr_ton = 2;
+ b.source_addr_npi = 1;
+ snprintf((char*)b.source_addr, sizeof(b.source_addr), "%s",
+ "09000011111");
+ b.dest_addr_ton = 2;
+ b.dest_addr_npi = 0;
+ snprintf((char*)b.destination_addr, sizeof(b.destination_addr), "%s",
+ "1121312309000");
+ b.esm_class = 0;
+ b.protocol_id = 0;
+ b.priority_flag = 0;
+ memset(b.schedule_delivery_time,0,sizeof(b.schedule_delivery_time));
+ memset(b.validity_period,0,sizeof(b.validity_period));
+ b.registered_delivery = 0;
+ b.replace_if_present_flag =0;
+ b.data_coding = 0;
+ b.sm_default_msg_id = 0;
+ b.sm_length = strlen(TEXTO);
+ memcpy(b.short_message, TEXTO, b.sm_length);
+
+ tlv.tag = TLVID_user_message_reference;
+ tlv.length = sizeof(uint16_t);
+ tlv.value.val16 = 0x0024;
+ build_tlv( &(b.tlv), &tlv );
+
+ tlv.tag = TLVID_message_payload;
+ tlv.length = strlen(TEXTO);
+ memcpy(tlv.value.octet, TEXTO, tlv.length);
+ build_tlv( &(b.tlv), &tlv );
+
+ doTest(SUBMIT_SM, &a, &b);
+ destroy_tlv( b.tlv );
+ destroy_tlv( a.tlv );
+ return( 0 );
+};
diff --git a/test_pdu/unbind_resp_test.c b/test_pdu/unbind_resp_test.c
new file mode 100644
index 0000000..6020002
--- /dev/null
+++ b/test_pdu/unbind_resp_test.c
@@ -0,0 +1,57 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : unbind_resp_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+int
+main( int argc, char *argv[] )
+{
+
+ unbind_resp_t a;
+ unbind_resp_t b;
+
+ memset(&a, 0, sizeof(unbind_resp_t));
+ memset(&b, 0, sizeof(unbind_resp_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = UNBIND_RESP;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+
+ doTest(UNBIND_RESP, &a, &b);
+ return( 0 );
+};
diff --git a/test_pdu/unbind_test.c b/test_pdu/unbind_test.c
new file mode 100644
index 0000000..28ef08d
--- /dev/null
+++ b/test_pdu/unbind_test.c
@@ -0,0 +1,57 @@
+
+/*
+ * Copyright (C) 2006 Raul Tremsal
+ * File : unbind_test.c
+ * Author: Raul Tremsal <ultraismo@yahoo.com>
+ *
+ * This file is part of libsmpp34 (c-open-smpp3.4 library).
+ *
+ * The libsmpp34 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifdef __linux__
+#include <stdint.h>
+#endif
+
+#include "smpp34.h"
+#include "smpp34_structs.h"
+#include "smpp34_params.h"
+#include "core.h"
+
+int
+main( int argc, char *argv[] )
+{
+
+ unbind_t a;
+ unbind_t b;
+
+ memset(&a, 0, sizeof(unbind_t));
+ memset(&b, 0, sizeof(unbind_t));
+
+ /* Init PDU ***********************************************************/
+ b.command_length = 0;
+ b.command_id = UNBIND;
+ b.command_status = ESME_ROK;
+ b.sequence_number = 1;
+
+ doTest(UNBIND, &a, &b);
+ return( 0 );
+};