Harald Welte | 4b233b4 | 2012-11-07 08:32:31 +0100 | [diff] [blame^] | 1 | |
| 2 | /* |
| 3 | * Copyright (C) 2006 Raul Tremsal |
| 4 | * File : submit_multi_resp_test.c |
| 5 | * Author: Raul Tremsal <ultraismo@yahoo.com> |
| 6 | * |
| 7 | * This file is part of libsmpp34 (c-open-smpp3.4 library). |
| 8 | * |
| 9 | * The libsmpp34 library is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU Lesser General Public License as |
| 11 | * published by the Free Software Foundation; either version 2.1 of the |
| 12 | * License, or (at your option) any later version. |
| 13 | * |
| 14 | * This library is distributed in the hope that it will be useful, but |
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 16 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
| 17 | * License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU Lesser General Public License |
| 20 | * along with this library; if not, write to the Free Software Foundation, |
| 21 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 | * |
| 23 | */ |
| 24 | |
| 25 | #include <stdio.h> |
| 26 | #include <string.h> |
| 27 | #include <sys/types.h> |
| 28 | #include <netinet/in.h> |
| 29 | |
| 30 | #ifdef __linux__ |
| 31 | #include <stdint.h> |
| 32 | #endif |
| 33 | |
| 34 | #include "smpp34.h" |
| 35 | #include "smpp34_structs.h" |
| 36 | #include "smpp34_params.h" |
| 37 | #include "core.h" |
| 38 | |
| 39 | |
| 40 | int |
| 41 | main( int argc, char *argv[] ) |
| 42 | { |
| 43 | |
| 44 | submit_multi_resp_t a; |
| 45 | submit_multi_resp_t b; |
| 46 | udad_t udad; |
| 47 | |
| 48 | memset(&a, 0, sizeof(submit_multi_resp_t)); |
| 49 | memset(&b, 0, sizeof(submit_multi_resp_t)); |
| 50 | memset(&udad, 0, sizeof( udad_t )); |
| 51 | |
| 52 | /* Init PDU ***********************************************************/ |
| 53 | b.command_length = 0; |
| 54 | b.command_id = SUBMIT_MULTI_RESP; |
| 55 | b.command_status = ESME_ROK; |
| 56 | b.sequence_number = 1; |
| 57 | snprintf( (char*)b.message_id, sizeof(b.message_id), "%s", "88898239379"); |
| 58 | b.no_unsuccess = 3; |
| 59 | |
| 60 | /* Unsuccess submitted list of DAD ************************************/ |
| 61 | udad.dest_addr_ton = 2; |
| 62 | udad.dest_addr_npi = 1; |
| 63 | snprintf( (char*)udad.destination_addr, sizeof(udad.destination_addr), |
| 64 | "%s", "9911112222"); |
| 65 | udad.error_status_code = ESME_RX_T_APPN; |
| 66 | build_udad( &(b.unsuccess_smes), &udad ); |
| 67 | |
| 68 | udad.dest_addr_ton = 0; |
| 69 | udad.dest_addr_npi = 0; |
| 70 | snprintf( (char*)udad.destination_addr, sizeof(udad.destination_addr), |
| 71 | "%s", "9922223333"); |
| 72 | udad.error_status_code = ESME_RX_P_APPN; |
| 73 | build_udad( &(b.unsuccess_smes), &udad ); |
| 74 | |
| 75 | udad.dest_addr_ton = 2; |
| 76 | udad.dest_addr_npi = 1; |
| 77 | snprintf( (char*)udad.destination_addr, sizeof(udad.destination_addr), |
| 78 | "%s", "9933334444"); |
| 79 | udad.error_status_code = ESME_RX_R_APPN; |
| 80 | build_udad( &(b.unsuccess_smes), &udad ); |
| 81 | /**********************************************************************/ |
| 82 | |
| 83 | doTest(SUBMIT_MULTI_RESP, &a, &b); |
| 84 | |
| 85 | destroy_udad( b.unsuccess_smes ); |
| 86 | destroy_udad( a.unsuccess_smes ); |
| 87 | |
| 88 | return( 0 ); |
| 89 | }; |