update to sualibrary-0.1.4 released 2003-10-15

* In addition to 1.3 Contains :
    * SSNM support(DAUD, DAVA, DUNA).
    * improved ASP management support.
    * test user can initiate certain ASP and SSNM proecdures.
    * Correct some bugs
    * Compiles and runs on Linux, FreeBSD, Max OS X ....
    * Tested on IPv4 and IPV6 networks
    * interoperable with other SUA implementations
    * corresponds to sua draft v15
    * requires SCTP implementation sctplib-1.0.0-pre19 from www.sctp.de
master
Harald Welte 13 years ago
parent c9c547aafe
commit 3b3b534da8
  1. 2
      configure.in
  2. 4
      sualibrary/Makefile.am
  3. 18
      sualibrary/docs/en/index-3.html
  4. 36
      sualibrary/sua/sua.h
  5. 125
      sualibrary/sua/sua_adapt.cpp
  6. 5
      sualibrary/sua/sua_adapt.h
  7. 289
      sualibrary/sua/sua_asp_mgnt.cpp
  8. 33
      sualibrary/sua/sua_asp_mgnt.h
  9. 34
      sualibrary/sua/sua_cl.cpp
  10. 165
      sualibrary/sua/sua_database.cpp
  11. 18
      sualibrary/sua/sua_database.h
  12. 50
      sualibrary/sua/sua_dataname.cpp
  13. 22
      sualibrary/sua/sua_datassoc.cpp
  14. 108
      sualibrary/sua/sua_distribution.cpp
  15. 24
      sualibrary/sua/sua_distribution.h
  16. 41
      sualibrary/sua/sua_file.cpp
  17. 361
      sualibrary/sua/sua_snm_mgnt.cpp
  18. 42
      sualibrary/sua/sua_snm_mgnt.h
  19. 898
      sualibrary/sua/sua_syntax.cpp
  20. 27
      sualibrary/sua/sua_syntax.h
  21. 6
      sualibrary/testup/Makefile.am
  22. 39
      sualibrary/testup/pcg729.sua
  23. 87
      sualibrary/testup/sigtran.sua
  24. 407
      sualibrary/testup/testuser.cpp

@ -8,7 +8,7 @@ AC_INIT(acconfig.h)
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
AM_INIT_AUTOMAKE(sualibrary,0.1.3)
AM_INIT_AUTOMAKE(sualibrary,0.1.4)
AC_PREFIX_DEFAULT(/usr/local)
if test "x$prefix" = "xNONE"; then

@ -1,7 +1,5 @@
####### kdevelop will overwrite this part!!! (begin)##########
bin_PROGRAMS = sualibrary
sualibrary_SOURCES =
sualibrary_LDADD = ./sua/libsua.a ./testup/libtestup.a
SUBDIRS = docs sua testup

@ -169,21 +169,25 @@ REMARK: Spaces are used to clarify the commands only. They are not allowed or no
<P>
- cr destip: dest_id = i,ip = cccc;</P>
<P>Provides the Destination IP address(es)(v4/v6) for the remote node with dest_id i.</P>
<P>
A node can have both a PC or/and a IP address. If both are present then the dest_id must be the same for that particular node.</P>
<P>If a destname is provided, then a cr destip must be done as the translation of the hostname or global title will yield a IP address , which is subsequently used to find the correct association to send the msg out on. The IP address of the cr destip and the ip address of one of the cr assoc's must be the same. Do not forget to do a cr route also for the IP address.</P>
<P>A node can have both a PC or/and a IP address. If both are present then the dest_id must be the same for that particular node.</P>
<P>
- cr destname: dname_id = i,name = www.sctp.be;</P>
<P>Provides the Destination Hostname for the remote node with dname_id i.</P>
<P>Provides the Destination Hostname for the remote node with dname_id i. (Do not forget to do a cr destip.)</P>
<P>
- cr name: dname_id=k,tt=tt,na=nn,np=ppp,digits= 123456789abcdef;</p>
<P>Provides the Destination Global Title for the remote node with dname_id i. tt = translation identifier, na = Nature of address, np= Numbering plan, digits= digits of the Global Title</P>
- cr destname: dname_id=k,tt=tt,na=nn,np=ppp,digits= 123456789abcdef;</p>
<P>Provides the Destination Global Title for the remote node with dname_id i. tt = translation identifier, na = Nature of address, np= Numbering plan, digits= digits of the Global Title(Do not forget to do a cr destip)</P>
<P>
- cr route: dest_id = j, assoc_id = i;</P>
<P>Make the link between a Destination(PC/IP addr) and a association. Destination dest_id j can be reached via the association assoc_id i.</P>
<P>Make the link between a Destination(PC/IP addr) and a association. Destination dest_id j(created via cr destpc or destip) can be reached via the association assoc_id i(created via cr assoc).</P>
<P>
- cr route: dname_id = j, assoc_id = i;</P>
<P>Make the link between a Destination(GT/Name) and a association. Destination dname_id j can be reached via the association assoc_id i.</P>
<P>Make the link between a Destination(GT/Name) and a association. Destination dname_id j(created via cr destname) can be reached via the association assoc_id i(created via cr assoc).</P>
<P>
<P>The Format of the IP address can be provided as an</P>
<P>- IPv4: xxx.yyy.zzz.uuu = decimal (example: 1.1.1.1)</P>
<P>- IPv6: aaa:zzz:eeee = hex (example: 20df::0001)</P>
<P>The translation type, numbering plan and Nature of address must be provided as a decimal value(example: 10)</P>
<P>
<HR>
<A HREF="index-4.html">Next</A>

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua.h,v 1.1 2003/01/14 14:15:36 p82609 Exp $
* $Id: sua.h,v 1.4 2003/09/09 08:43:25 p82609 Exp $
*
* SUA implementation according to SUA draft issue 13.
*
@ -63,8 +63,11 @@
* - terminate a association
* - Send a SUA primtive to SUA
* - Receive a SUA primitive from SUA
* - convert Hostname(string) to SUAname(Character array)
* - convert SUAname(Character array) to Hostname(Character array)
* - get the SUA destination pointcode and status
* - get the SUA origination pointcode
* - activate the SUA association
* - deactivate the SUA association
* - do a SS7 mngt audit(DAUD) on all destinations
*/
#define __EXTENSIONS__
@ -400,6 +403,33 @@ unsigned int Receive_sua_primitive( unsigned int &primitive,
);
#define SUA_GETPC_NO_ERROR 0
#define SUA_GETPC_ERROR 1
unsigned int sua_get_sourcepc_addr( unsigned int sua_id,
pointcode_str &pc
);
unsigned int sua_get_destpc_addr( unsigned int sua_id,
pointcode_str &pc,
unsigned int &sua_assoc_id,
unsigned int &status
);
#define SUA_MNGT_NO_ERROR 0
#define SUA_MNGT_ERROR 1
unsigned int sua_Activate_assoc( unsigned int sua_id
);
unsigned int sua_DeActivate_assoc( unsigned int sua_id
);
#define SUA_DAUD_NO_ERROR 0
#define SUA_DAUD_ERROR 1
unsigned int sua_send_daud();
#endif // SUA_GLOBAL_H

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_adapt.cpp,v 1.3 2003/01/31 11:36:39 p82609 Exp $
* $Id: sua_adapt.cpp,v 1.7 2003/09/09 08:43:25 p82609 Exp $
*
* SUA implementation according to SUA draft issue 13.
*
@ -54,10 +54,11 @@
* - reading the SUA configuration file
* - registering a local SUA instance
* - Setting up the association with a remote SUA node
* - get info on a certain (SUA) association
* - terminate a association
* - convert Hostname(string) to SUAname(Character array)
* - convert SUAname(Character array) to Hostname(Character array)
* - get SUA path info on a certain (SUA) association
* - get SUA destination pointcode (IP and SS7) and status
* - get SUA origination pointcode (IP and SS7)
* - deactivate a SUA association
*/
// sua_adapt.c++
@ -147,7 +148,10 @@ unsigned int sua_registerInstance ( Sua_ULP_CallBacks ulp_callback
SCTPCallbackFunctions.communicationErrorNotif = &sctp_CommunicationErrorNotif;
SCTPCallbackFunctions.restartNotif = &sctp_RestartNotif;
SCTPCallbackFunctions.shutdownCompleteNotif = &sctp_ShutDownCompleteNotif;
SCTPCallbackFunctions.peerShutdownReceivedNotif = &sctp_ShutDownCompleteNotif;
SCTPCallbackFunctions.queueStatusChangeNotif = &sctp_queueStatusChangeNotif;
SCTPCallbackFunctions.asconfStatusNotif = &sctp_asconfStatusNotif;
result = sua.local_sua.register_instance ( SCTPCallbackFunctions,
ulp_callback
);
@ -211,24 +215,39 @@ unsigned int sua_getPath( unsigned int assoc_id,
/***********************************************************************/
/* get destination pointcode address */
/***********************************************************************/
pointcode_str get_destpc_addr( unsigned int sua_id)
unsigned int sua_get_destpc_addr( unsigned int sua_id,
pointcode_str &pc,
unsigned int &sua_assoc_id,
unsigned int &status
)
{
pointcode_str pc;
pc.ipvx = sua.AssocDB.instance[sua_id].Dest.addrs[0];
pc.ss7 = sua.AssocDB.instance[sua_id].Dest.pc;
return(pc);
if (( sua_id > 0) && (sua_id <= ((unsigned int)sua.remote_sua.num_of_instance)))
{
pc.ipvx = sua.remote_sua.instance[sua_id].Dest.addrs[0];
pc.ss7 = sua.remote_sua.instance[sua_id].Dest.pc;
sua_assoc_id = sua.remote_sua.instance[sua_id].SUA_assoc_id;
status = (unsigned int ) sua.remote_sua.instance[sua_id].status;
return(SUA_GETPC_NO_ERROR);
}
else
return(SUA_GETPC_ERROR);
}
/***********************************************************************/
/* get source pointcode address */
/***********************************************************************/
pointcode_str get_sourcepc_addr( unsigned int sua_id)
unsigned int sua_get_sourcepc_addr( unsigned int sua_id,
pointcode_str &pc
)
{
pointcode_str pc;
pc.ipvx = sua.AssocDB.instance[sua_id].Source.addrs[0];
pc.ss7 = sua.AssocDB.instance[sua_id].Source.pc;
return(pc);
if (( sua_id > 0) && (sua_id <= ((unsigned int) sua.local_sua.num_of_instance)))
{
pc.ipvx = sua.local_sua.instance[sua_id].Source.addrs[0];
pc.ss7 = sua.local_sua.instance[sua_id].Source.pc;
return(SUA_GETPC_NO_ERROR);
}
else
return(SUA_GETPC_ERROR);
}
/***********************************************************************/
@ -259,6 +278,80 @@ unsigned int sua_terminate( )
}
/***********************************************************************/
/* sua_Activate_assoc */
/***********************************************************************/
unsigned int sua_Activate_assoc( unsigned int sua_assoc_id
)
{
unsigned int result = SUA_MNGT_NO_ERROR;
switch (sua.AssocDB.instance[sua_assoc_id].asp.status)
{
case(asp_inactive):
case(asp_inactive_traf_hold):
{
result = sua_send_ASPAC( sua_assoc_id,
tmt_unknown,
true,
1
);
break;
}
case( asp_active):
{
/* do nothing, association is already active */
break;
}
default:
{
result = sua_send_ASPUP( sua_assoc_id ,
false,
1
);
break;
}
}
return (result);
}
/***********************************************************************/
/* sua_DeActivate_assoc */
/***********************************************************************/
unsigned int sua_DeActivate_assoc( unsigned int sua_assoc_id
)
{
unsigned int result = SUA_MNGT_NO_ERROR;
switch (sua.AssocDB.instance[sua_assoc_id].asp.status)
{
case(asp_inactive):
case(asp_inactive_traf_hold):
{
result = sua_send_ASPDOWN( sua_assoc_id );
break;
}
case( asp_active):
{
result = sua_send_ASPINAC( sua_assoc_id,
true,
1
);
break;
}
default:
{
/* do nothing, association is already inactive(idle or down)*/
break;
}
}
return (result);
}
// end of module sua_adapt.c++

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_adapt.h,v 1.1 2003/01/14 14:15:36 p82609 Exp $
* $Id: sua_adapt.h,v 1.2 2003/08/26 11:43:57 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*
@ -71,9 +71,6 @@
using namespace std;
pointcode_str get_destpc_addr( unsigned int sua_id);
pointcode_str get_sourcepc_addr( unsigned int sua_id);
// end of module sua_adapt.h

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_asp_mgnt.cpp,v 1.1 2003/01/14 14:15:36 p82609 Exp $
* $Id: sua_asp_mgnt.cpp,v 1.2 2003/09/09 08:43:25 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*
@ -59,6 +59,7 @@
* - send a ASP-ACTIVE msg to remote node
* - send a ASP-ACTIVE ACKnowledge msg to remote node
* - send a ASP-INactive Acknowledge msg to remote node
* - send a NOTIFY msg to remote node
* - Receive/process ASP UP msg
* - Receive/process ASP UP ACKnowladge msg
* - Receive/process ASP DOWN msg
@ -94,7 +95,9 @@ extern tcb_Sua_msgqueue_pool msg_store;
/***********************************************************************/
/* sua_send_ASPUP */
/***********************************************************************/
int sua_send_ASPUP( unsigned int Sua_assoc_id
int sua_send_ASPUP( unsigned int Sua_assoc_id,
boolean ASP_id_pres,
uint32_t ASP_id
)
{
Sua_container msg;
@ -111,8 +114,10 @@ int sua_send_ASPUP( unsigned int Sua_assoc_id
// fill in the main sua header
msg.sua_prim.hdr_msg_class = sua_aspsm;
msg.sua_prim.hdr_msg_type.aspsm = aspsm_up;
msg.sua_prim.ASP_id_pres = TRUE;
msg.sua_prim.ASP_id = 1;
msg.sua_prim.ASP_id_pres = ASP_id_pres;
if ( ASP_id_pres)
msg.sua_prim.ASP_id = ASP_id;
msg.sua_prim.asp_cap_pres = FALSE;
msg.sua_prim.info_pres = FALSE;
@ -165,7 +170,7 @@ int sua_send_ASPUP( unsigned int Sua_assoc_id
}
/***********************************************************************/
/* sua_send_ASPUP_ACK */
/* sua_send_ASPUP_ACK */
/***********************************************************************/
int sua_send_ASPUP_ACK( unsigned int Sua_assoc_id,
boolean ASP_id_pres,
@ -241,6 +246,79 @@ int sua_send_ASPUP_ACK( unsigned int Sua_assoc_id,
return(error_value);
}
/***********************************************************************/
/* sua_send_ASPDOWN */
/***********************************************************************/
int sua_send_ASPDOWN( unsigned int Sua_assoc_id
)
{
Sua_container msg;
Sua_syntax_error_struct error;
int error_value = 0;
int string_size, datalen;
signed int sctp_assoc_id;
short stream_id = 0;
int delivery_type, result;
// init the message
msg.sua_init();
// fill in the main sua header
msg.sua_prim.hdr_msg_class = sua_aspsm;
msg.sua_prim.hdr_msg_type.aspsm = aspsm_down;
msg.sua_prim.asp_cap_pres = FALSE;
msg.sua_prim.info_pres = FALSE;
// encode the SUA unitdata message
error = msg.sua_encode();
string_size = msg.sua_msg.size();
delivery_type = SCTP_UNORDERED_DELIVERY;
sctp_assoc_id = sua.AssocDB.instance[Sua_assoc_id].SCTP_assoc_id;
/* does association exist? */
if (sctp_assoc_id > 0)
{
// send data to SCTP
char* databuf = new char[msg.sua_msg.length()];
msg.sua_msg.copy(databuf, msg.sua_msg.length());
datalen = msg.sua_msg.length();
/* yes it does, continue, no problem, send the msg */
#ifdef DEBUG
// display byte array
display_byte_array(databuf , msg.sua_msg.length());
#endif
char logstring[100];
sprintf(logstring, "SUA encoded message, ready for being send to SCTP assoc %d", sctp_assoc_id);
event_log("sua_asp_mgnt.c",logstring);
log_byte_array("sua_asp_mgnt.c", databuf,msg.sua_msg.length());
result = sctp_send ( sctp_assoc_id,
stream_id,
(unsigned char *) databuf,
datalen,
SUA_PPI,
SCTP_USE_PRIMARY,
SCTP_NO_CONTEXT,
SCTP_INFINITE_LIFETIME,
delivery_type,
SCTP_BUNDLING_DISABLED
);
error_value = result;
delete databuf;
#ifdef DEBUG
cout << "sua_asp_mgnt.c:result ASPDOWN sctp send = "<< result << "\n";
#endif
}
return(error_value);
}
/***********************************************************************/
/* sua_send_ASPDOWN_ACK */
/***********************************************************************/
@ -458,7 +536,10 @@ int sua_send_BEAT_ACK( unsigned int Sua_assoc_id,
/***********************************************************************/
/* sua_send_ASPAC */
/***********************************************************************/
int sua_send_ASPAC( unsigned int Sua_assoc_id
int sua_send_ASPAC( unsigned int Sua_assoc_id,
Sua_traffic_mode_type traff_mode,
boolean routing_context_present,
uint32_t routing_context
)
{
Sua_container msg;
@ -476,11 +557,18 @@ int sua_send_ASPAC( unsigned int Sua_assoc_id
msg.sua_prim.hdr_msg_class = sua_asptm;
msg.sua_prim.hdr_msg_type.asptm = asptm_act;
/* traffic mode is optional mandatory */
msg.sua_prim.traf_mode_pres = TRUE;
msg.sua_prim.traf_mode = tmt_override;
if (traff_mode == tmt_unknown)
msg.sua_prim.traf_mode_pres = false;
else {
msg.sua_prim.traf_mode_pres = true;
msg.sua_prim.traf_mode = traff_mode;
}
/* rest is optional */
msg.sua_prim.rout_con_pres = TRUE;
msg.sua_prim.rout_con = 1;
msg.sua_prim.rout_con_pres = routing_context_present;
if (msg.sua_prim.rout_con_pres)
msg.sua_prim.rout_con = routing_context;
msg.sua_prim.info_pres = FALSE;
// encode the SUA unitdata message
@ -616,6 +704,83 @@ int sua_send_ASPAC_ACK( unsigned int Sua_assoc_id,
}
/***********************************************************************/
/* sua_send_ASPINAC */
/***********************************************************************/
int sua_send_ASPINAC( unsigned int Sua_assoc_id,
boolean routing_context_present,
uint32_t routing_context
)
{
Sua_container msg;
Sua_syntax_error_struct error;
int error_value = 0;
int string_size, datalen;
signed int sctp_assoc_id;
short stream_id = 0;
int delivery_type, result;
// init the message
msg.sua_init();
// fill in the main sua header
msg.sua_prim.hdr_msg_class = sua_asptm;
msg.sua_prim.hdr_msg_type.asptm = asptm_inact;
msg.sua_prim.rout_con_pres = routing_context_present;
if ( msg.sua_prim.rout_con_pres)
msg.sua_prim.rout_con = routing_context;
msg.sua_prim.info_pres = FALSE;
// encode the SUA unitdata message
error = msg.sua_encode();
string_size = msg.sua_msg.size();
delivery_type = SCTP_UNORDERED_DELIVERY;
sctp_assoc_id = sua.AssocDB.instance[Sua_assoc_id].SCTP_assoc_id;
/* does association exist? */
if (sctp_assoc_id > 0)
{
// send data to SCTP
char* databuf = new char[msg.sua_msg.length()];
msg.sua_msg.copy(databuf, msg.sua_msg.length());
datalen = msg.sua_msg.length();
/* yes it does, continue, no problem, send the msg */
#ifdef DEBUG
// display byte array
display_byte_array(databuf , msg.sua_msg.length());
#endif
char logstring[100];
sprintf(logstring, "SUA encoded message, ready for being send to SCTP assoc %d", sctp_assoc_id);
event_log("sua_asp_mgnt.c",logstring);
log_byte_array("sua_asp_mgnt.c", databuf,msg.sua_msg.length());
result = sctp_send ( sctp_assoc_id,
stream_id,
(unsigned char *) databuf,
datalen,
SUA_PPI,
SCTP_USE_PRIMARY,
SCTP_NO_CONTEXT,
SCTP_INFINITE_LIFETIME,
delivery_type,
SCTP_BUNDLING_DISABLED
);
error_value = result;
delete databuf;
#ifdef DEBUG
cout << "sua_asp_mgnt.c:result ASPINAC sctp send = "<< result << "\n";
#endif
}
return(error_value);
}
/***********************************************************************/
/* sua_send_ASPINAC_ACK */
/***********************************************************************/
@ -639,7 +804,9 @@ int sua_send_ASPINAC_ACK( unsigned int Sua_assoc_id,
msg.sua_prim.hdr_msg_class = sua_asptm;
msg.sua_prim.hdr_msg_type.asptm = asptm_inact_ack;
msg.sua_prim.rout_con_pres = routing_context_present;
msg.sua_prim.rout_con = routing_context;
if ( msg.sua_prim.rout_con_pres)
msg.sua_prim.rout_con = routing_context;
msg.sua_prim.info_pres = FALSE;
// encode the SUA unitdata message
@ -690,6 +857,91 @@ int sua_send_ASPINAC_ACK( unsigned int Sua_assoc_id,
return(error_value);
}
/***********************************************************************/
/* sua_send_NOTIFY */
/***********************************************************************/
int sua_send_NOTIFY( unsigned int Sua_assoc_id,
boolean ASP_id_pres,
uint32_t ASP_id,
boolean routing_context_present,
uint32_t routing_context,
uint8_t status_type,
uint8_t status_id
)
{
Sua_container msg;
Sua_syntax_error_struct error;
int error_value = 0;
int string_size, datalen;
signed int sctp_assoc_id;
short stream_id = 0;
int delivery_type, result;
// init the message
msg.sua_init();
// fill in the main sua header
msg.sua_prim.hdr_msg_class = sua_mngt;
msg.sua_prim.hdr_msg_type.mngt = mngt_notify;
msg.sua_prim.status_pres = true;
msg.sua_prim.status.status_type = status_type ;
msg.sua_prim.status.status_ID = status_id;
msg.sua_prim.ASP_id_pres = ASP_id_pres;
msg.sua_prim.ASP_id = ASP_id;
msg.sua_prim.rout_con_pres = routing_context_present;
if (routing_context_present)
msg.sua_prim.rout_con = routing_context;
msg.sua_prim.info_pres = FALSE;
// encode the SUA notify message
error = msg.sua_encode();
string_size = msg.sua_msg.size();
delivery_type = SCTP_UNORDERED_DELIVERY;
sctp_assoc_id = sua.AssocDB.instance[Sua_assoc_id].SCTP_assoc_id;
/* does association exist? */
if (sctp_assoc_id > 0)
{
// send data to SCTP
char* databuf = new char[msg.sua_msg.length()];
msg.sua_msg.copy(databuf, msg.sua_msg.length());
datalen = msg.sua_msg.length();
/* yes it does, continue, no problem, send the msg */
#ifdef DEBUG
// display byte array
display_byte_array(databuf , msg.sua_msg.length());
#endif
char logstring[100];
sprintf(logstring, "SUA encoded message, ready for being send to SCTP assoc %d", sctp_assoc_id);
event_log("sua_asp_mgnt.c",logstring);
log_byte_array("sua_asp_mgnt.c", databuf,msg.sua_msg.length());
result = sctp_send ( sctp_assoc_id,
stream_id,
(unsigned char *) databuf,
datalen,
SUA_PPI,
SCTP_USE_PRIMARY,
SCTP_NO_CONTEXT,
SCTP_INFINITE_LIFETIME,
delivery_type,
SCTP_BUNDLING_DISABLED
);
error_value = result;
delete databuf;
#ifdef DEBUG
cout << "sua_asp_mgnt.c:result NOTIFY sctp send = "<< result << "\n";
#endif
}
return(error_value);
}
/***********************************************************************/
/* Receiving SUA Management msg */
/***********************************************************************/
@ -749,7 +1001,11 @@ int process_ASPUP_ACK_msg ( unsigned int sua_assoc_id,
#ifndef IPSP_SINGLE
/* send activation to remote */
error_value = sua_send_ASPAC( sua_assoc_id );
error_value = sua_send_ASPAC( sua_assoc_id,
tmt_unknown,
true,
1
);
#ifdef DEBUG
cout << "sua_asp_mgnt.c:result send ASPAC = "<< error_value << "\n";
@ -1003,6 +1259,9 @@ int process_ASPINAC_ACK_msg ( unsigned int sua_assoc_id,
)
{
int error_value = 0;
sua.AssocDB.deactivate(sua_assoc_id,0);
#ifdef DEBUG
cout << "sua_asp_mgnt.c:ASPINAC_ACK received, nothing further to do.\n";
#endif
@ -1018,9 +1277,9 @@ void Asp_mngt_standby ( unsigned int sua_AS_id,
)
{
sua.ApplicServ.override_ASP( sua_asp_id,
sua_AS_id,
mode
);
sua_AS_id,
mode
);
}
/***********************************************************************/

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_asp_mgnt.h,v 1.1 2003/01/14 14:15:37 p82609 Exp $
* $Id: sua_asp_mgnt.h,v 1.2 2003/09/09 08:43:25 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*
@ -93,12 +93,33 @@ typedef enum { lm_override, // 0: standard loadshare: only 1 ASP
lm_share_BC // 3: Broadcasting
}asp_Sua_loadmode_set;
int sua_send_ASPUP( unsigned int Sua_assoc_id
int sua_send_ASPUP( unsigned int Sua_assoc_id,
boolean ASP_id_pres,
uint32_t ASP_id
);
int sua_send_ASPAC( unsigned int Sua_assoc_id
int sua_send_ASPDOWN( unsigned int Sua_assoc_id
);
int sua_send_ASPAC( unsigned int Sua_assoc_id,
Sua_traffic_mode_type traff_mode,
boolean routing_context_present,
uint32_t routing_context
);
int sua_send_ASPINAC( unsigned int Sua_assoc_id,
boolean routing_context_present,
uint32_t routing_context
);
int sua_send_NOTIFY( unsigned int Sua_assoc_id,
boolean ASP_id_pres,
uint32_t ASP_id,
boolean routing_context_present,
uint32_t routing_context,
uint8_t status_type,
uint8_t status_id
);
int process_ASPUP_msg ( unsigned int sua_assoc_id,
int local_sua_id,
@ -113,9 +134,9 @@ int process_ASPUP_ACK_msg ( unsigned int sua_assoc_id,
);
int process_ASPDOWN_msg ( unsigned int sua_assoc_id,
int local_sua_id,
int remote_sua_id,
Sua_container sua_asp_msg
int local_sua_id,
int remote_sua_id,
Sua_container sua_asp_msg
);
int process_ASPDOWN_ACK_msg ( unsigned int sua_assoc_id,

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_cl.cpp,v 1.4 2003/02/17 14:38:08 p82609 Exp $
* $Id: sua_cl.cpp,v 1.5 2003/09/09 08:43:25 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*
@ -274,9 +274,22 @@ int sua_route_Message( unsigned int &sctp_assoc_id,
cout << "routed to SCTP assoc " << sctp_assoc_id << "/SUA assoc id " << sua_assoc_id <<"\n";
#endif
/* does association exist? */
if ((msg.sua_prim.hop_count_pres) && (msg.sua_prim.hop_count <= 0))
{
sctp_assoc_id = 0;
#ifdef DEBUG
cout << "Hopcounter reach 0: drop/send response back msg\n";
#endif
}
/* does association exist? */
if (sctp_assoc_id > 0)
{
/* if hopcounter present decrement him */
if (msg.sua_prim.hop_count_pres)
msg.sua_prim.hop_count--;
/* YES, encode the SUA unitdata message and ... */
error = msg.sua_encode();
@ -412,7 +425,7 @@ int sua_send_Unitdata ( sccp_QOS_str &QOS,
msg.sua_prim.prot_class_pres = TRUE;
msg.sua_prim.prot_class.pcl = prot_class_0;
msg.sua_prim.seq_control_pres = TRUE;
msg.sua_prim.seq_control = QOS.sequence_number;
msg.sua_prim.seq_control = 0;
sctp_delivery_type = SCTP_UNORDERED_DELIVERY;
break;
case(class1):
@ -698,6 +711,8 @@ short process_unitdata_msg ( int local_sua_id,
temp.primitive = N_UNITDATA;
temp.user_ref = 0;
/* change routing context hard coded for test with CMG-logica */
/*msg.sua_prim.rout_con = 6;*/
if (msg.sua_prim.prot_class_pres)
{
@ -917,6 +932,7 @@ short process_UDTService_msg ( int local_sua_id,
sua_save_str temp;
int i, result = 0;
unsigned int sctp_assoc_id = 0;
char digit_char;
temp.primitive = N_NOTICE;
temp.user_ref = 0;
@ -976,8 +992,10 @@ short process_UDTService_msg ( int local_sua_id,
temp.calling_pty_address.name.GT.Numbering_Plan = msg.sua_prim.source_addr.gt.num_plan;
temp.calling_pty_address.name.GT.Nature_of_Address = msg.sua_prim.source_addr.gt.nat_addr;
temp.calling_pty_address.name.GT.nr_of_digits = msg.sua_prim.source_addr.gt.nr_of_digits;
for (i=0; i < temp.calling_pty_address.name.GT.nr_of_digits; i++)
temp.calling_pty_address.name.GT.digits[i] = msg.sua_prim.source_addr.gt.digits[i];
for (i=0; i < temp.calling_pty_address.name.GT.nr_of_digits; i++){
sprintf(&digit_char, "%d", msg.sua_prim.source_addr.gt.digits[i]);
temp.calling_pty_address.name.GT.digits[i] = digit_char;
}
temp.calling_pty_address.name.GT.digits[temp.calling_pty_address.name.GT.nr_of_digits] = '\0';
}
@ -1050,8 +1068,10 @@ short process_UDTService_msg ( int local_sua_id,
temp.called_pty_address.name.GT.Numbering_Plan = msg.sua_prim.dest_addr.gt.num_plan;
temp.called_pty_address.name.GT.Nature_of_Address = msg.sua_prim.dest_addr.gt.nat_addr;
temp.called_pty_address.name.GT.nr_of_digits = msg.sua_prim.dest_addr.gt.nr_of_digits;
for (i=0; i < temp.called_pty_address.name.GT.nr_of_digits; i++)
temp.called_pty_address.name.GT.digits[i] = msg.sua_prim.dest_addr.gt.digits[i];
for (i=0; i < temp.called_pty_address.name.GT.nr_of_digits; i++){
sprintf(&digit_char, "%d", msg.sua_prim.dest_addr.gt.digits[i]);
temp.called_pty_address.name.GT.digits[i] = digit_char;
}
temp.called_pty_address.name.GT.digits[temp.called_pty_address.name.GT.nr_of_digits] = '\0';
}

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_database.cpp,v 1.2 2003/01/16 15:07:56 p82609 Exp $
* $Id: sua_database.cpp,v 1.5 2003/08/28 09:30:20 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*
@ -410,6 +410,29 @@ return(0);
return(0);
}
/***********************************************************************/
/* Sua_LocalList::found */
/***********************************************************************/
bool db_Sua_LocalList:: found( SS7union pc ){
int i = 1;
bool found_pc = false;
while (( i <= num_of_instance ) && (!found_pc))
{
if (pc.ITU14.family == ITU14bit) // standard ITU: 14 bits
found_pc = ((pc.ITU14.pc == instance[i].Source.pc.ITU14.pc));
else if (pc.ITU24.family == ITU24bit) // chinese PC length: 24 bits
found_pc = ((pc.ITU24.pc == instance[i].Source.pc.ITU24.pc));
else if (pc.ANSI24.family == ANSI24bit) // ANSI PC length: 24 bits
found_pc = ((pc.ANSI24.pc == instance[i].Source.pc.ANSI24.pc));
else
found_pc = false;
i++;
}
return(found_pc);
}
/***********************************************************************/
/* functions of the object class SUA Remote Object */
/***********************************************************************/
@ -418,7 +441,7 @@ return(0);
/***********************************************************************/
void db_Sua_RemoteObject::initialize(){
;
status = ssnm_unavailable;
}
/***********************************************************************/
@ -460,6 +483,144 @@ void db_Sua_RemoteList:: increase_instance(){
};
/***********************************************************************/
/* Sua_RemoteList::Dest_Available */
/***********************************************************************/
void db_Sua_RemoteList:: Dest_Available( SS7union pc)
{
int i = 0;
bool found_pc = false;
while (( i < num_of_instance ) && (!found_pc))
{
i++;
if (pc.ITU14.family == ITU14bit) // standard ITU: 14 bits
found_pc = ((pc.ITU14.pc == instance[i].Dest.pc.ITU14.pc));
else if (pc.ITU24.family == ITU24bit) // chinese PC length: 24 bits
found_pc = ((pc.ITU24.pc == instance[i].Dest.pc.ITU24.pc));
else if (pc.ANSI24.family == ANSI24bit) // ANSI PC length: 24 bits
found_pc = ((pc.ANSI24.pc == instance[i].Dest.pc.ANSI24.pc));
else
found_pc = false;
};
if (found_pc)
instance[i].status = ssnm_available;
}
/***********************************************************************/
/* Sua_RemoteList::Dest_Unavailable */
/***********************************************************************/
void db_Sua_RemoteList:: Dest_Unavailable( SS7union pc)
{
int i = 0;
bool found_pc = false;
while (( i < num_of_instance ) && (!found_pc))
{
i++;
if (pc.ITU14.family == ITU14bit) // standard ITU: 14 bits
found_pc = ((pc.ITU14.pc == instance[i].Dest.pc.ITU14.pc));
else if (pc.ITU24.family == ITU24bit) // chinese PC length: 24 bits
found_pc = ((pc.ITU24.pc == instance[i].Dest.pc.ITU24.pc));
else if (pc.ANSI24.family == ANSI24bit) // ANSI PC length: 24 bits
found_pc = ((pc.ANSI24.pc == instance[i].Dest.pc.ANSI24.pc));
else
found_pc = false;
};
if (found_pc)
instance[i].status = ssnm_unavailable;
}
/***********************************************************************/
/* Sua_RemoteList::deactivate_dests */
/***********************************************************************/
void db_Sua_RemoteList:: Deactivate_dests( unsigned int sua_assoc_id)
{
int i = 0;
while (( i < num_of_instance ))
{
i++;
if (sua_assoc_id == instance[i].SUA_assoc_id) // found assoc_id
instance[i].status = ssnm_unavailable;
}
}
/***********************************************************************/
/* Sua_RemoteList::Activate_dests */
/***********************************************************************/
void db_Sua_RemoteList:: Activate_dests( unsigned int sua_assoc_id)
{
int i = 0;
while (( i < num_of_instance ))
{
i++;
if (sua_assoc_id == instance[i].SUA_assoc_id) // found assoc_id
instance[i].status = ssnm_available;
}
}
/***********************************************************************/
/* Sua_RemoteList::get_Dest_status */
/***********************************************************************/
snm_Sua_pc_state_set db_Sua_RemoteList:: get_Dest_status( SS7union pc )
{
int i = 0;
bool found_pc = false;
while (( i < num_of_instance ) && (!found_pc))
{
i++;
if (pc.ITU14.family == ITU14bit) // standard ITU: 14 bits
found_pc = ((pc.ITU14.pc == instance[i].Dest.pc.ITU14.pc));
else if (pc.ITU24.family == ITU24bit) // chinese PC length: 24 bits
found_pc = ((pc.ITU24.pc == instance[i].Dest.pc.ITU24.pc));
else if (pc.ANSI24.family == ANSI24bit) // ANSI PC length: 24 bits
found_pc = ((pc.ANSI24.pc == instance[i].Dest.pc.ANSI24.pc));
else
found_pc = false;
}
if (found_pc)
return(instance[i].status);
else
return(ssnm_unavailable);
}
/***********************************************************************/
/* Sua_RemoteList::found */
/***********************************************************************/
bool db_Sua_RemoteList:: found( SS7union pc ){
int i = 0;
bool found_pc = false;
while (( i < num_of_instance ) && (!found_pc))
{
i++;
if (pc.ITU14.family == ITU14bit) // standard ITU: 14 bits
found_pc = ((pc.ITU14.pc == instance[i].Dest.pc.ITU14.pc));
else if (pc.ITU24.family == ITU24bit) // chinese PC length: 24 bits
found_pc = ((pc.ITU24.pc == instance[i].Dest.pc.ITU24.pc));
else if (pc.ANSI24.family == ANSI24bit) // ANSI PC length: 24 bits
found_pc = ((pc.ANSI24.pc == instance[i].Dest.pc.ANSI24.pc));
else
found_pc = false;
}
return(found_pc);
}
/***********************************************************************/
/* functions of the object class SUA Application Server Process (ASP) */
/***********************************************************************/

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_database.h,v 1.4 2003/01/31 11:36:39 p82609 Exp $
* $Id: sua_database.h,v 1.7 2003/08/28 09:30:20 p82609 Exp $
*
* SUA implementation according to SUA draft issue 8.
*
@ -69,6 +69,7 @@
#include "sua.h"
#include "sua_asp_mgnt.h"
#include "sua_snm_mgnt.h"
#include <string>
@ -143,6 +144,7 @@ class db_Sua_LocalList{
);
short unregister_instance();
void increase_instance();
bool found( SS7union pc);
}; ///:~
/***********************************************************************/
@ -150,11 +152,13 @@ class db_Sua_LocalList{
/***********************************************************************/
class db_Sua_RemoteObject{
public:
db_Sua_SSNObject ssn;
db_Sua_SSNObject ssn;
/* contains the association sua id with which it is linked. */
unsigned int SUA_assoc_id;
unsigned int SUA_assoc_id;
/* status of the remote node */
snm_Sua_pc_state_set status;
/* dest address of the remote sua node */
db_Sua_AddressObject Dest;
db_Sua_AddressObject Dest;
public:
// functions of the Class
void initialize();
@ -171,6 +175,12 @@ class db_Sua_RemoteList{
void initialize();
void read_ssn(string ssn);
void increase_instance();
bool found( SS7union pc);
void Dest_Available( SS7union pc);
void Dest_Unavailable( SS7union pc);
void Activate_dests( unsigned int sua_assoc_id);
void Deactivate_dests( unsigned int sua_assoc_id);
snm_Sua_pc_state_set get_Dest_status(SS7union pc);
}; ///:~
/***********************************************************************/

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_dataname.cpp,v 1.2 2003/01/31 11:36:39 p82609 Exp $
* $Id: sua_dataname.cpp,v 1.4 2003/09/09 08:43:44 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*
@ -270,8 +270,9 @@ signed int db_Sua_NameList::perform_GTT ( global_title_str& cld_in,
pointcode_str& dest_pc
)
{
boolean search_gt = true, gt_entry_found = false;
int i, found_gt_entry;
boolean search_gt = true, gt_entry_found = false;
int i, found_gt_entry,res;
unsigned int sua_assoc_id, status;
/* resolving can be done via: */
/* - local global Titel database */
@ -290,9 +291,36 @@ signed int db_Sua_NameList::perform_GTT ( global_title_str& cld_in,
i++;
}
cout << "found_gt_entry = " << found_gt_entry << "\n";
cout << "tt = " << cld_in.Translation_Type << "\n";
cout << "NP = " << cld_in.Numbering_Plan << "\n";
cout << "NA = " << cld_in.Nature_of_Address << "\n";
cout << "CLD number of digits = " << cld_in.nr_of_digits << "\n";
cout << "CLD digits = " << cld_in.digits[0];
cout << cld_in.digits[1];
cout << cld_in.digits[2];
cout << cld_in.digits[3];
cout << cld_in.digits[4];
cout << cld_in.digits[5];
cout << cld_in.digits[6];
cout << cld_in.digits[7];
cout << cld_in.digits[8];
cout << cld_in.digits[9];
cout << cld_in.digits[10];
cout << cld_in.digits[11];
cout << "\n";
cout << "CLG number of digits = " << clg_in.nr_of_digits << "\n";
cout << "CLG digits = " << clg_in.digits << "\n";
if (gt_entry_found) {
/* get the association number from gt database */
dest_pc = get_destpc_addr(instance[found_gt_entry].SUA_assoc_id);
res = sua_get_destpc_addr(instance[found_gt_entry].SUA_assoc_id,
dest_pc,
sua_assoc_id,
status
);
return(0);
}
else
@ -317,3 +345,17 @@ void db_Sua_NameList:: increase_instance(){

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_datassoc.cpp,v 1.8 2003/02/17 14:38:08 p82609 Exp $
* $Id: sua_datassoc.cpp,v 1.9 2003/09/09 08:43:44 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*
@ -363,12 +363,22 @@ passive_associate( unsigned int sctp_assoc_id,
&status
);
#ifdef DEBUG
cout << "SCTP association " << sctp_assoc_id <<" result = " << result<< "\n";
#endif
#ifdef DEBUG
cout << "number of asoc = " << num_of_instance << "\n";
#endif
while ((i <= num_of_instance) && !(assoc_found)){
assoc_found = (instance[i].Dest.nr_of_addrs == status.numberOfAddresses);
if (assoc_found)
{
k = 0;
found_addr = false;
#ifdef DEBUG
cout << "same number of addresses\n";
#endif
while ((k < instance[i].Dest.nr_of_addrs) && (!found_addr))
{
j=0;
@ -380,6 +390,9 @@ passive_associate( unsigned int sctp_assoc_id,
k++;
}
if (found_addr){
#ifdef DEBUG
cout << "found same ip address\n";
#endif
assoc_found = ( found_addr && (instance[i].Dest.addrs[0].sin.sin_port == status.destPort));
assoc_instance_idx = i;
}
@ -393,6 +406,9 @@ passive_associate( unsigned int sctp_assoc_id,
{
/* unknown association added */
/* not allowed: drop it */
#ifdef DEBUG
cout << "not found ???\n";
#endif
assoc_instance_idx = 0;
result = sctp_abort(sctp_assoc_id);
}
@ -872,6 +888,10 @@ route_on_GTT ( global_title_str& dest_gt,
dest_pc
);
#ifdef DEBUG
cout << "result of GT translation : " << result << "\n";
cout << "dest IP address = " << dest_pc.ipvx.sa.sa_family << "\n";
#endif
sctp_assoc_id = route_on_IPpc( dest_pc.ipvx,
org_pc.ipvx,
sua_assoc_id

@ -15,7 +15,7 @@
* *
******************************************