1 /* 2 * Copyright (c) 2009 Konrad Hammel <konrad@sangoma.com> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms|with or without 6 * modification|are permitted provided that the following conditions 7 * are met: 8 * 9 * * Redistributions of source code must retain the above copyright 10 * notice|this list of conditions and the following disclaimer. 11 * 12 * * Redistributions in binary form must reproduce the above copyright 13 * notice|this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 16 * * Neither the name of the original author; nor the names of any contributors 17 * may be used to endorse or promote products derived from this software 18 * without specific prior written permission. 19 * 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES|INCLUDING|BUT NOT 23 * LIMITED TO|THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 25 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT|INDIRECT|INCIDENTAL|SPECIAL, 26 * EXEMPLARY|OR CONSEQUENTIAL DAMAGES (INCLUDING|BUT NOT LIMITED TO, 27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE|DATA|OR 28 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 29 * LIABILITY|WHETHER IN CONTRACT|STRICT LIABILITY|OR TORT (INCLUDING 30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 31 * SOFTWARE|EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 */ 33 34 /* INCLUDE ********************************************************************/ 35 #include "ftmod_sangoma_ss7_main.h" 36 /******************************************************************************/ 37 38 /* DEFINES ********************************************************************/ 39 /******************************************************************************/ 40 41 /* GLOBALS ********************************************************************/ 42 /******************************************************************************/ 43 44 /* PROTOTYPES *****************************************************************/ 45 int ftmod_ss7_mtplink_sta(uint32_t id, SnMngmt *cfm); 46 int ftmod_ss7_mtplinkSet_sta(uint32_t id, SnMngmt *cfm); 47 /******************************************************************************/ 48 49 /* FUNCTIONS ******************************************************************/ 50 int ftmod_ss7_mtplink_sta(uint32_t id, SnMngmt *cfm) 51 { 52 SnMngmt sta; 53 Pst pst; 54 55 memset(&sta, 0x0, sizeof(sta)); 56 57 /* initalize the post structure */ 58 smPstInit(&pst); 59 60 /* insert the destination Entity */ 61 pst.dstEnt = ENTSN; 62 63 sta.hdr.elmId.elmnt = STDLSAP; 64 sta.hdr.elmId.elmntInst1 = g_ftdm_sngss7_data.cfg.mtpLink[id].id; 65 66 return(sng_sta_mtp3(&pst, &sta, cfm)); 67 } 68 69 /******************************************************************************/ 70 int ftmod_ss7_mtplinkSet_sta(uint32_t id, SnMngmt *cfm) 71 { 72 SnMngmt sta; 73 Pst pst; 74 75 memset(&sta, 0x0, sizeof(sta)); 76 77 /* initalize the post structure */ 78 smPstInit(&pst); 79 80 /* insert the destination Entity */ 81 pst.dstEnt = ENTSN; 82 83 sta.hdr.elmId.elmnt = STLNKSET; 84 sta.hdr.elmId.elmntInst1 = g_ftdm_sngss7_data.cfg.mtpLinkSet[id].id; 85 sta.hdr.elmId.elmntInst2 = g_ftdm_sngss7_data.cfg.mtpLinkSet[id].links[0]; 86 87 return(sng_sta_mtp3(&pst, &sta, cfm)); 88 } 89 /******************************************************************************/ 90 91 /******************************************************************************/ 92 /* For Emacs: 93 * Local Variables: 94 * mode:c 95 * indent-tabs-mode:t 96 * tab-width:4 97 * c-basic-offset:4 98 * End: 99 * For VIM: 100 * vim:set softtabstop=4 shiftwidth=4 tabstop=4: 101 */ 102 /******************************************************************************/