blob: d220fcaf80e5ef22d1705408fa5566c18277034a [file] [log] [blame]
Harald Welte4b233b42012-11-07 08:32:31 +01001
2/*
3 * Copyright (C) 2006 Raul Tremsal
4 * File : alert_notification_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#include "smpp34.h"
34#include "smpp34_structs.h"
35#include "smpp34_params.h"
36#include "core.h"
37
38
39#define TEXTO "Raul Antonio Tremsal"
40int
41main( int argc, char *argv[] )
42{
43
44 alert_notification_t a;
45 alert_notification_t b;
46 tlv_t tlv;
47
48 memset(&a, 0, sizeof(alert_notification_t));
49 memset(&b, 0, sizeof(alert_notification_t));
50 memset(&tlv, 0, sizeof(tlv_t));
51
52 /* Init PDU ***********************************************************/
53 b.command_length = 0;
54 b.command_id = ALERT_NOTIFICATION;
55 b.command_status = ESME_ROK;
56 b.sequence_number = 1;
57 b.source_addr_ton = 2;
58 b.source_addr_npi = 1;
59 snprintf((char*)b.source_addr, ADDRESS_LENGTH, "%s", "0900001111");
60 b.esme_addr_ton = 2;
61 b.esme_addr_npi = 1;
62 snprintf((char*)b.esme_addr, ADDRESS_LENGTH, "%s", "0900001111");
63
64 tlv.tag = TLVID_ms_availability_status; /* defined in smpp34.h */
65 tlv.length = sizeof(uint8_t);
66 tlv.value.val08 = 0x24;
67 build_tlv( &(b.tlv), &tlv );
68
69 doTest(ALERT_NOTIFICATION, &a, &b);
70 destroy_tlv( b.tlv );
71 destroy_tlv( a.tlv );
72
73 return( 0 );
74};