/*****************************************************************************/ /* */ /* **** COPYRIGHT NOTICE **** */ /* */ /* */ /* Copyright (c) Digital Equipment Corporation, 1992 */ /* */ /* All Rights Reserved. Unpublished rights reserved under the */ /* copyright laws of the United States. */ /* */ /* The software contained on this media is proprietary to and */ /* embodies the confidential technology of Digital Equipment */ /* Corporation. Possession, use, duplication or dissemination */ /* of the software and media is authorized only pursuant to a */ /* valid written license from Digital Equipment Corporation. */ /* */ /* */ /* The information in this software is subject to change without notice */ /* and should not be construed as a commitment by DIGITAL EQUIPMENT */ /* CORPORATION. */ /* */ /* DIGITAL assumes no responsibility for the use or reliability of its */ /* software on equipment which is not supplied by DIGITAL. */ /* */ /* */ /****************************************************************************/ /************************************************************************ ** ** ** FACILITY: DECss7 IVP IS41 (Installation Verification Procedure) ** ** ENVIRONMENT: OSF/1 V4.0 ** ** MODULE NAME: ss7_is41_snd.c ** ** DESCRIPTION: IS41S part of the DECss7 IVP IS41. ** ** AUTHORS: Didier DRIGUES ** ** CREATION DATE: 24 July 1998 ** ** MODIFICATION HISTORY: ** Name (UserID) Date Comments ** ************************************************************************/ /* ** ** INCLUDE FILES ** */ /*************/ /* Libraries */ /*************/ #include #include #ifdef VMS #include #include #include #else #include #include #include #include #include #endif #include /***************/ /* Local files */ /***************/ #include "ss7_is41_common.h" /* **++ ** FUNCTIONAL DESCRIPTION: ** ** Main line of IS41S: ** Declare ourselves to SS7. ** Open a dialogue. ** SMS request. ** Send to peer. ** Wait for accept dialogue indication. ** Wait for sms response indication. ** Wait for close dialogue indication. ** Wait for last operation indication. ** ** FORMAL PARAMETERS: ** ** None. ** ** RETURN VALUE: ** ** None. ** ** SIDE EFFECTS: ** ** None ** ** **-- */ main(int argc, char *argv[]) { unsigned int status; unsigned long opr_time_out[SS7_K_IS41_MAX_OPR]; ss7_ssn_t ossn,dssn; ss7_dpc_t opc,dpc; unsigned long sap_id; unsigned long dialogue_id; unsigned long user_param; unsigned long opr_type; ss7_invoke_id_t invoke_id; ss7_invoke_id_t correlation_id; ss7_is41_open_param_t open_param; ss7_is41_sms_param_t sms_param; unsigned short i; char read_c[255]; ss7_is41_vector_t indications = { ss7_is41_open_dlg_ind, ss7_is41_accept_dlg_ind, ss7_is41_close_dlg_ind, 0, 0, ss7_is41_last_operation_ind, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ss7_is41_sms_ind, ss7_is41_sms_rsp_ind }; #ifdef VMS float delay = 10.0; /* Before "real" start */ float delay_exit = 2.0; /* Before exiting */ #else int delay = 10; /* Before "real" start */ int delay_exit = 2; /* Before exiting */ /* ADD SIGNALS HANDLER. */ sigset_t sig_set; sigemptyset(&sig_set); sigaddset(&sig_set, SIGXCPU); sigaddset(&sig_set, SIGABRT); sigaddset(&sig_set, SIGTERM); sigaddset(&sig_set, SIGURG); pthread_sigmask( SIG_BLOCK, &sig_set, 0 ); #endif /* VMS */ /* check values if any */ if ((argc != 1) && (argc != 5)) { printf("Usage: %s [opc dpc ossn dssn]\n",argv[0]); exit(-1); } if (argc == 1) { dpc=IS41R_PC; opc=IS41S_PC; dssn = IS41R_SSN; ossn = IS41S_SSN; } else { opc=atoi(argv[1]); if ((opc < 0) || (opc > MAX_VALUE)) { printf("Bad opc value (%s). Range is 0 to %d.\n",argv[1],MAX_VALUE); exit(-1); } dpc=atoi(argv[2]); if ((dpc < 0 ) || (dpc > MAX_VALUE)) { printf("Bad dpc value (%s). Range is 0 to %d.\n",argv[2],MAX_VALUE); exit(-1); } ossn=atoi(argv[3]); if ((ossn < 0) || (ossn > MAX_VALUE)) { printf("Bad ossn value (%s). Range is 0 to %d.\n",argv[1],MAX_VALUE); exit(-1); } dssn=atoi(argv[4]); if ((dssn < 0 ) || (dssn > MAX_VALUE)) { printf("Bad dssn value (%s). Range is 0 to %d.\n",argv[2],MAX_VALUE); exit(-1); } } /* initialise operation timeout */ for (i=0;i