update to sualibrary-0.1.3 released 2003-05-28

* Contains Relaying functionality using Global Titles and hostnames.
    * New configuration commands via configuration file.
    * 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 v13
    * requires SCTP implementation sctplib-1.0.0-pre19 from www.sctp.de
master
Harald Welte 13 years ago
parent 3dc72b8cff
commit c9c547aafe
  1. 2
      configure.in
  2. 2
      sualibrary.kdevprj
  3. 4
      sualibrary/Makefile.am
  4. 44
      sualibrary/docs/en/index-1.html
  5. 11
      sualibrary/docs/en/index-2.html
  6. 67
      sualibrary/docs/en/index-3.html
  7. 2
      sualibrary/docs/en/index-6.html
  8. 5
      sualibrary/docs/en/index.html
  9. 5
      sualibrary/sua/sua.h
  10. 39
      sualibrary/sua/sua_adapt.cpp
  11. 2
      sualibrary/sua/sua_adapt.h
  12. 2
      sualibrary/sua/sua_asp_mgnt.cpp
  13. 2
      sualibrary/sua/sua_asp_mgnt.h
  14. 60
      sualibrary/sua/sua_cl.cpp
  15. 62
      sualibrary/sua/sua_cl.h
  16. 51
      sualibrary/sua/sua_co.cpp
  17. 2
      sualibrary/sua/sua_co.h
  18. 58
      sualibrary/sua/sua_database.cpp
  19. 110
      sualibrary/sua/sua_database.h
  20. 117
      sualibrary/sua/sua_dataname.cpp
  21. 692
      sualibrary/sua/sua_datassoc.cpp
  22. 2
      sualibrary/sua/sua_debug.h
  23. 13
      sualibrary/sua/sua_distribution.cpp
  24. 2
      sualibrary/sua/sua_distribution.h
  25. 998
      sualibrary/sua/sua_file.cpp
  26. 6
      sualibrary/sua/sua_file.h
  27. 2
      sualibrary/sua/sua_logging.cpp
  28. 2
      sualibrary/sua/sua_logging.h
  29. 2
      sualibrary/sua/sua_snm_mgnt.cpp
  30. 2
      sualibrary/sua/sua_snm_mgnt.h
  31. 5
      sualibrary/sua/sua_sual.cpp
  32. 2
      sualibrary/sua/sua_sual.h
  33. 144
      sualibrary/sua/sua_syntax.cpp
  34. 2
      sualibrary/sua/sua_syntax.h
  35. 2
      sualibrary/sua/sua_tcb.cpp
  36. 2
      sualibrary/sua/sua_tcb.h
  37. 3
      sualibrary/testup/Makefile.am
  38. 7
      sualibrary/testup/main.cpp
  39. 59
      sualibrary/testup/testuser.cpp
  40. 2
      sualibrary/testup/testuser.h

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

@ -24,7 +24,7 @@ ldadd=
ldflags=
[General]
AMChanged=false
AMChanged=true
author=Lode Coene
configure_args=
email=lode.coene@siemens.atea.be

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

@ -18,7 +18,7 @@ Previous
<H2><A NAME="s1.1">1.1 General concept</A></H2>
<P>
The sualib-0.1.0 library release is the product of a cooperation between Siemens AG (ICM), Munich, Germany and Siemens Atea, Herentals Belgium.
The sualib-0.1.3 library release is the product of a cooperation between Siemens AG (ICM), Munich, Germany and Siemens Atea, Herentals Belgium.
It has been developed since late 2000 and has been planned to become a fairly complete prototype implementation of the SCCP User Adaptation
@ -62,22 +62,31 @@ callbacks for SUA events are passed in a SUA_ulpCallbacks(described more closely
and 6.5).
Then the application either calls the possibly blocking function sua_eventLoop(). While calling the former, it will react to a previously scheduled timer or any file descriptor event (by executing the registered callback functions). In case a timer is scheduled at a very late point in time, and no events happen on registered file descriptors (e.g. sockets), the program will sleep (because the system call poll() is used. In this case, the control flow is handled by the library, and the user must register appropriate callbacks for events and timers before handing control over to the sua_eventLoop() function. The proper use of the sua_eventLoop() is explained in some simple example programs in section 7.
</P>
<P>
See the following chapters for some general infomation on the present features of SUA.</P>
<UL>
<LI><A HREF="index-3.html#ss3.1">3.1 General usage of the SUA library</A>
<LI><A HREF="index-3.html#ss3.2">3.2 Features of the implementation</A>
<LI><A HREF="index-3.html#ss3.3">3.3 What is missing</A>
<LI><A HREF="index-3.html#ss3.4">3.4 SUA configuration file commands</A>
</UL>
<P>
<P>
<H2><A NAME="ss1.2">1.2 Changes</A>
</H2>
Changes in comparison with sualibrary 0.0.5:
Changes in comparison with sualibrary 0.1.2:
<P>
- portable to Darwin (Mac)<P>
- New configuration file syntax<P>
<P>
- Global title addressing supported<P>
<P>
- portable to different UNIX versions<P>
- tested on both Linux and FreeBSD vs 4.4<P>
- tested with both IPv4 and IPv6 networks<P>
- msg syntax updated to <draft-ietf-sigtran-sua-12.txt> (example: DNS names)<P><UL>
<LI><A HREF="index-3.html#ss3.1">3.1 General usage of the SUA library</A>
<LI><A HREF="index-3.html#ss3.2">3.2 Features of the implementation</A>
<LI><A HREF="index-3.html#ss3.3">3.3 What is missing</A>
</UL>
<P>
<H2><A name="ss1.3">1.3 Nomenclature </A></H2>
@ -98,3 +107,18 @@ Previous
<A HREF="index.html#toc1">Contents</A>
</BODY>
</HTML>

@ -51,7 +51,7 @@ autoconf
you should have not trouble
compiling it.
Should you run into problems please report them to the the author at
<A HREF="mailto:lode.coene@siemens.atea.be">Lode Coene</A><P>
<A HREF="mailto:lode.coene@siemens.com">Lode Coene</A><P>
<P>
<P>
@ -61,3 +61,12 @@ Should you run into problems please report them to the the author at
<A HREF="index.html#toc2">Contents</A>
</BODY>
</HTML>

@ -61,13 +61,13 @@ Connectionless : CLDT message transfer
<P>
Connectionoriented: CORE, COAK, RELRE, RELCO, COREF & CODT message transfer
<P>
Adressing options: use of Ipv4 and Ipv6 addresses, SS7 pointcodes, hostname
Adressing options: use of Ipv4 and Ipv6 addresses, SS7 pointcodes, hostname, Global titles
<P>
SUA ASP management(optional)
<P><P>
It has been tested with implementations of 4 companies in the first SUA bakeoff.
<P><P>
The following flags are recognized when reading a configuration file for SUA:
The following flags are recognized when running SUA:
<P>
-s : source address<P>
@ -95,11 +95,11 @@ The following flags are recognized when reading a configuration file for SUA:
example of a association<P>
-s 10.0.1.1 -7s 1 -d 10.0.3.1 -7d 66051 -r 14001 -n 255 -a 1 -t 16<P>
./testup -s 10.0.1.1 -7s 1 -d 10.0.3.1 -7d 66051 -r 14001 -n 255 -a 1 -t 16<P>
example of a local listener<P>
-s be.atea.sua01 –n 255 –a 1 –t 2 <P>
./testup -s 10.0.1.1 -n 255 -a 1 -t 2 <P>
<P>
@ -111,8 +111,7 @@ example of a local listener<P>
<P>
Features to be included in future version:
<P>
- Relaying functionality<P>
<P><P>
- SUA management: ASP , AS management, etc<P>
<P>
@ -130,6 +129,62 @@ patches, and patches are always welcome !
<P>
<P>
<P>
Features not to be included:
<P>
- NIF/interworking with classical SS7 SCCP<P>
- Routing keys<P>
- Registration of Applications<P>
<P>
<P>
<P>
<H2><A NAME="ss3.4">3.4 SUA configuration file commands.</A>
</H2>
<P>
<P>
The following Commands can be used in the SUA configuration file:
<P>
REMARK: Spaces are used to clarify the commands only. They are not allowed or not recognized correctly in the actual configuration file!!!! See example configuration file in the package under sualibrary/testup/pcg729.sua</P>
<P><P>
<P>
- cr host:host_id = j, org_ip= t.t.t.t, org_port= yyyyy \n;</P>
<P>Provides the IP address(ses)(v4/v6) and portnumber of your own host. In most cases only one host entry will be needed, so host_id = 1</P>
<P>
- cr assoc:assoc_id= i, init= false, host_id = j, dest_ip = x.x.x.x, dest_port= yyyy;</P>
<P>Provides the IP addres(ses) and portnumber of the destination to which to set up a association. Each association requires a different association_id. The init flag indicates if the implementation should setup the association immediatly(active assoc setup) or wait for a incomming association from remote node with those particular parameters(passive assoc setup or listening mode).</P>
<P>
- cr orgpc: pc = cccc, host_id = j;</P>
<P>Provides the originating SS7 pointcode for the own node with host_id j.</P>
<P>
- cr orggt: host_id=j,tt=tt,na=nn,np=ppp,digits= 123456789abcdef; </P>
<P>Provides the originating Global title(=Calling party Address) for the own node with host_id j.</P>
<P>
- cr orgname: host_id=j,name=www.xxx.zzz; </P>
<P>Provides the originating Hostname for the own node with host_id j.</P>
<P>
- cr destpc: dest_id = i,pc = cccc;</P>
<P>Provides the Destination Pointcode for the remote node with dest_id i.</P>
<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>
- 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>
- 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>
<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>
- 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>
<P>
<HR>
<A HREF="index-4.html">Next</A>
<A HREF="index-2.html">Previous</A>

@ -14,7 +14,7 @@ Next
<H2><A NAME="s6">6. Copyright</A></H2>
<P>
<P>Sualibrary Copyright 2002 Lode Coene , lode.coene@siemens.atea.be
<P>Sualibrary Copyright 2003 Lode Coene , lode.coene@siemens.atea.be
<P>
<P>This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

@ -16,9 +16,9 @@ Contents
<H2>Lode Coene <CODE>lode.coene@siemens.atea.be</CODE></H2>
<H2>Gery Verwimp <CODE>gery.verwimp@siemens.atea.be</CODE></H2>
Version 0.1.0 , Friday Feb 15 12:01:21 CET 2002
Version 0.1.3 , Friday May 31 12:01:21 CET 2003
<P><HR>
<EM>This Handbook describes Sualibrary Version 0.1.0</EM>
<EM>This Handbook describes Sualibrary Version 0.1.3</EM>
<HR>
<P>
<H2><A NAME="toc1">1.</A> <A HREF="index-1.html">Introduction</A></H2>
@ -43,6 +43,7 @@ Version 0.1.0 , Friday Feb 15 12:01:21 CET 2002
<LI><A HREF="index-3.html#ss3.1">3.1 General usage of the SUA library</A>
<LI><A HREF="index-3.html#ss3.2">3.2 Features of the implementation</A>
<LI><A HREF="index-3.html#ss3.3">3.3 What is missing</A>
<LI><A HREF="index-3.html#ss3.4">3.4 SUA configuration file commands</A>
</UL>
<P>
<H2><A NAME="toc4">4.</A> <A HREF="index-4.html">SUA Application Program Interface (SUA API)</A></H2>

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua.h,v 1.8 2002/11/12 11:02:49 p82609 Exp $
* $Id: sua.h,v 1.1 2003/01/14 14:15:36 p82609 Exp $
*
* SUA implementation according to SUA draft issue 13.
*
@ -345,8 +345,7 @@ unsigned int sua_read_config_file
#define SUA_REG_NO_ERROR 0
unsigned int sua_registerInstance
( short local_ssn,
Sua_ULP_CallBacks ulp_callback
( Sua_ULP_CallBacks ulp_callback
);

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_adapt.cpp,v 1.5 2002/11/12 11:02:49 p82609 Exp $
* $Id: sua_adapt.cpp,v 1.3 2003/01/31 11:36:39 p82609 Exp $
*
* SUA implementation according to SUA draft issue 13.
*
@ -109,9 +109,7 @@ void sua_initialisation()
sctp_setLibraryParameters(&params);
init_logging_file();
sua.local_sua.initialize();
sua.remote_sua.initialize();
sua.AssocDB.initialize();
sua.initialize();
cout << "Finished initialising SUA data\n ";
} /* end of sua_initialisation */
@ -124,13 +122,10 @@ unsigned int sua_read_config_file( char *pConfFile)
unsigned int result = SUA_CFG_NO_ERROR;
string sua_filename;
sua_filename = pConfFile;
result = read_sua_file( sua_filename,
sua.local_sua,
sua.remote_sua,
sua.AssocDB,
sua.NameDB,
sua.ApplicServ
);
result = read_sua_conf_file( sua_filename,
sua
);
return(result);
}
@ -138,8 +133,7 @@ unsigned int sua_read_config_file( char *pConfFile)
/***********************************************************************/
/* sua_registerInstance */
/***********************************************************************/
unsigned int sua_registerInstance ( short local_ssn,
Sua_ULP_CallBacks ulp_callback
unsigned int sua_registerInstance ( Sua_ULP_CallBacks ulp_callback
)
{
unsigned int result = SUA_REG_NO_ERROR;
@ -154,10 +148,9 @@ unsigned int sua_registerInstance ( short local_ssn,
SCTPCallbackFunctions.restartNotif = &sctp_RestartNotif;
SCTPCallbackFunctions.shutdownCompleteNotif = &sctp_ShutDownCompleteNotif;
result = sua.AssocDB.register_instance ( SCTPCallbackFunctions,
ulp_callback,
sua.local_sua
);
result = sua.local_sua.register_instance ( SCTPCallbackFunctions,
ulp_callback
);
return(result);
}
@ -197,22 +190,20 @@ unsigned int sua_getPath( unsigned int assoc_id,
pathinfo.remote_addr.ssn = sua.remote_sua.instance[sua.AssocDB.instance[assoc_id].remote_sua_id].ssn.ssn;
pathinfo.ASP_status = sua.AssocDB.instance[assoc_id].asp.status;
#ifdef DEBUG
//cout << "remote ssn = " << pathinfo.remote_addr.ssn << "\n";
//cout << "remote sua_id = " << sua.AssocDB.instance[assoc_id].remote_sua_id << "\n";
#endif
}
else
result = SUA_PATH_NO_DEST_ADDR_PRESENT;
pathinfo.local_addr.pc.ipvx.ch = sua.AssocDB.instance[assoc_id].Source.addrs[0].ch;
pathinfo.local_addr.pc.ipvx.ch = sua.local_sua.instance[sua.AssocDB.instance[assoc_id].local_sua_id].Source.addrs[0].ch;
/*memcpy( pathinfo.local_addr.pc.ipvx.ch, sua.AssocDB.instance[assoc_id].Source.addrs[0].ch,24);*/
pathinfo.local_addr.pc.ss7 = sua.AssocDB.instance[assoc_id].Source.pc;
pathinfo.local_addr.pc.ss7 = sua.local_sua.instance[sua.AssocDB.instance[assoc_id].local_sua_id].Source.pc;
pathinfo.local_addr.ssn = sua.local_sua.instance[sua.AssocDB.instance[assoc_id].local_sua_id].ssn.ssn;
pathinfo.local_addr.name.GT = sua.local_sua.instance[sua.AssocDB.instance[assoc_id].local_sua_id].Name.GT;
return (result);
}

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_adapt.h,v 1.2 2002/11/12 11:02:49 p82609 Exp $
* $Id: sua_adapt.h,v 1.1 2003/01/14 14:15:36 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_asp_mgnt.cpp,v 1.3 2002/11/12 11:02:49 p82609 Exp $
* $Id: sua_asp_mgnt.cpp,v 1.1 2003/01/14 14:15:36 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_asp_mgnt.h,v 1.1.1.1 2002/02/04 14:30:41 p82609 Exp $
* $Id: sua_asp_mgnt.h,v 1.1 2003/01/14 14:15:37 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_cl.cpp,v 1.8 2002/10/29 16:00:54 p82609 Exp $
* $Id: sua_cl.cpp,v 1.4 2003/02/17 14:38:08 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*
@ -97,15 +97,15 @@ extern vector<sua_save_str> rec_msg_pool;
/* sua_send_Message */
/***********************************************************************/
int sua_send_Message( signed int sctp_assoc_id,
short int sctp_stream_id,
int sctp_delivery_type,
unsigned int sctp_loadshare,
char *databuf,
unsigned int datalen
)
short int sctp_stream_id,
int sctp_delivery_type,
unsigned int sctp_loadshare,
char *databuf,
unsigned int datalen
)
{
signed int result;
/* send data to SCTP */
/* send data to SCTP */
/* yes it does, continue, no problem, send the msg */
#ifdef DEBUG
/* display byte array */
@ -245,7 +245,7 @@ int sua_send_UDTService ( Sua_container &org_msg,
/***********************************************************************/
/* sua_route_Message */
/***********************************************************************/
int sua_route_Message( unsigned int sctp_assoc_id,
int sua_route_Message( unsigned int &sctp_assoc_id,
unsigned int local_sua_id,
Sua_container &msg,
sccp_addr_str &called_pty_address,
@ -691,9 +691,10 @@ short process_unitdata_msg ( int local_sua_id,
Sua_container &msg
)
{
sua_save_str temp;
int result = 0;
int sctp_assoc_id = 0;
sua_save_str temp;
int result = 0;
unsigned int sctp_assoc_id = 0;
char digit_char;
temp.primitive = N_UNITDATA;
temp.user_ref = 0;
@ -747,7 +748,19 @@ short process_unitdata_msg ( int local_sua_id,
}
if (msg.sua_prim.source_addr.gt_pres == TRUE)
{
cout << "Global Title : unsupported address format\n";
temp.calling_pty_address.address_fields_present.name_gt = GT_present;
temp.calling_pty_address.name.GT.Translation_Type = msg.sua_prim.source_addr.gt.translation_type ;
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 (int 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';
}
if (msg.sua_prim.source_addr.hostname_pres == TRUE)
{
@ -811,6 +824,23 @@ short process_unitdata_msg ( int local_sua_id,
temp.called_pty_address.pc.ss7.ITU24.pc = msg.sua_prim.dest_addr.pc;
}
if (msg.sua_prim.dest_addr.gt_pres == TRUE)
{
temp.called_pty_address.address_fields_present.name_gt = GT_present;
temp.called_pty_address.name.GT.Translation_Type = msg.sua_prim.dest_addr.gt.translation_type ;
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 (int 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';
}
if (msg.sua_prim.dest_addr.hostname_pres == TRUE)
{
temp.called_pty_address.address_fields_present.name_gt = hostname_present;
@ -885,8 +915,8 @@ short process_UDTService_msg ( int local_sua_id,
)
{
sua_save_str temp;
int i, result = 0;
int sctp_assoc_id = 0;
int i, result = 0;
unsigned int sctp_assoc_id = 0;
temp.primitive = N_NOTICE;
temp.user_ref = 0;

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_cl.h,v 1.4 2002/04/08 15:28:06 p82609 Exp $
* $Id: sua_cl.h,v 1.2 2003/01/24 11:48:54 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*
@ -72,42 +72,42 @@
using namespace std;
int sua_send_Message( signed int sctp_assoc_id,
short int sctp_stream_id,
int sctp_delivery_type,
unsigned int sctp_loadshare,
char *databuf,
unsigned int datalen
);
int sua_route_Message( unsigned int sctp_assoc_id,
unsigned int local_sua_id,
Sua_container &msg,
sccp_addr_str &called_pty_address,
sccp_addr_str &calling_pty_address
);
short int sctp_stream_id,
int sctp_delivery_type,
unsigned int sctp_loadshare,
char *databuf,
unsigned int datalen
);
int sua_route_Message( unsigned int &sctp_assoc_id,
unsigned int local_sua_id,
Sua_container &msg,
sccp_addr_str &called_pty_address,
sccp_addr_str &calling_pty_address
);
int sua_send_Unitdata( sccp_QOS_str &QOS,
sccp_addr_str &called_pty_address,
sccp_addr_str &calling_pty_address,
char *buffer,
unsigned int len
);
sccp_addr_str &called_pty_address,
sccp_addr_str &calling_pty_address,
char *buffer,
unsigned int len
);
int sua_send_UDTService( Sua_container &org_msg,
sccp_addr_str &called_pty_address,
sccp_addr_str &calling_pty_address,
unsigned int UDTS_reason
);
sccp_addr_str &called_pty_address,
sccp_addr_str &calling_pty_address,
unsigned int UDTS_reason
);
short process_unitdata_msg ( int local_sua_id,
unsigned int sua_assoc_id,
Sua_container &sua_msg
);
unsigned int sua_assoc_id,
Sua_container &sua_msg
);
short process_UDTService_msg ( int local_sua_id,
unsigned int sua_assoc_id,
Sua_container &sua_msg
);
unsigned int sua_assoc_id,
Sua_container &sua_msg
);
#endif // SUA_CL_H
@ -115,3 +115,5 @@ short process_UDTService_msg ( int local_sua_id,
// end of module sua_cl.h

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_co.cpp,v 1.7 2002/11/12 11:02:49 p82609 Exp $
* $Id: sua_co.cpp,v 1.5 2003/02/17 14:38:08 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*
@ -1164,12 +1164,13 @@ short process_CORE_msg ( unsigned int sua_assoc_id,
Sua_container &msg
)
{
int i, result = 0;
int sctp_assoc_id = 0;
int result = 0;
unsigned int sctp_assoc_id = 0;
unsigned int local_sua_id = 0;
sua_save_str temp;
unsigned int Sua_Out_ConnId;
tcb_Sua_TCB_str *tcb_out_ptr;
char digit_char;
temp.primitive = N_CONNECT_IND;
temp.user_ref = Sua_ConnId;
@ -1219,24 +1220,25 @@ short process_CORE_msg ( unsigned int sua_assoc_id,
if (msg.sua_prim.source_addr.pc_pres == TRUE)
{
temp.calling_pty_address.address_fields_present.pc = ss7_pc_present;
temp.calling_pty_address.pc.ss7.ITU24.family = ITU24bit;
temp.calling_pty_address.pc.ss7.ITU24.family = sua.AssocDB.instance[sua_assoc_id].Dest.pc.ITU24.family;
temp.calling_pty_address.pc.ss7.ITU24.pc = msg.sua_prim.source_addr.pc;
}
if (msg.sua_prim.source_addr.gt_pres == TRUE)
{
cout << "Global Title : unsupported address format\n";
}
if (msg.sua_prim.source_addr.gt_pres == TRUE)
{
temp.calling_pty_address.address_fields_present.name_gt = GT_present;
temp.calling_pty_address.name.GT.Translation_Type = msg.sua_prim.source_addr.gt.translation_type;
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];
temp.calling_pty_address.name.GT.Translation_Type = msg.sua_prim.source_addr.gt.translation_type ;
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 (int 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';
}
if (msg.sua_prim.source_addr.hostname_pres == TRUE)
@ -1303,7 +1305,7 @@ short process_CORE_msg ( unsigned int sua_assoc_id,
if (msg.sua_prim.dest_addr.pc_pres == TRUE)
{
temp.called_pty_address.address_fields_present.pc = ss7_pc_present;
temp.called_pty_address.pc.ss7.ITU24.family = ITU24bit;
temp.called_pty_address.pc.ss7.ITU24.family = sua.AssocDB.instance[sua_assoc_id].Dest.pc.ITU24.family;
temp.called_pty_address.pc.ss7.ITU24.pc = msg.sua_prim.dest_addr.pc;
}
@ -1314,8 +1316,12 @@ short process_CORE_msg ( unsigned int sua_assoc_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 (int 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';
}
@ -1916,6 +1922,11 @@ short process_CORELCO_msg ( unsigned int sua_assoc_id,
);
delete databuf;
// release the incoming TCB of this connection
tcb_pool.release_TCB(sua_ConnId);
// release outgoing TCB of this connection
tcb_pool.release_TCB(Sua_Out_ConnId);
}
return(0);
@ -2038,6 +2049,12 @@ short process_COREF_msg ( unsigned int sua_assoc_id,
);
delete databuf;
// release the incoming TCB of this connection
tcb_pool.release_TCB(sua_ConnId);
// release outgoing TCB of this connection
tcb_pool.release_TCB(Sua_Out_ConnId);
}
return(0);

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_co.h,v 1.1.1.1 2002/02/04 14:30:41 p82609 Exp $
* $Id: sua_co.h,v 1.1 2003/01/14 14:15:37 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_database.cpp,v 1.2 2002/10/30 16:04:09 p82609 Exp $
* $Id: sua_database.cpp,v 1.2 2003/01/16 15:07:56 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*
@ -358,20 +358,55 @@ short db_Sua_LocalList:: unregister_instance(){
/* Sua_LocalList::register_instance */
/***********************************************************************/
short db_Sua_LocalList::
register_instance( unsigned int local_sua_id,
Sua_ULP_CallBacks SUACallbackFunctions,
unsigned int init_association
register_instance( SCTP_ulp_Callbacks APLCallbackFunctions,
Sua_ULP_CallBacks SUACallbackFunctions
){
int i;
short sua_portnumber = SUA_PORT;
#ifdef DEBUG
cout << "Number of local sua instance to register = " << num_of_instance << "\n";
#endif
instance[local_sua_id].SUA_APLCallBack.ulp_ClDataIndNotif = SUACallbackFunctions.ulp_ClDataIndNotif;
instance[local_sua_id].SUA_APLCallBack.ulp_ConnIndNotif = SUACallbackFunctions.ulp_ConnIndNotif;
instance[local_sua_id].SUA_APLCallBack.ulp_ConnConfIndNotif = SUACallbackFunctions.ulp_ConnConfIndNotif;
instance[local_sua_id].SUA_APLCallBack.ulp_ConnDataIndNotif = SUACallbackFunctions.ulp_ConnDataIndNotif;
instance[local_sua_id].SUA_APLCallBack.ulp_DisConnIndNotif = SUACallbackFunctions.ulp_DisConnIndNotif;
instance[local_sua_id].init_assoc_id = init_association;
for(i=1; i <= num_of_instance; i++)
{
#ifdef DEBUG
cout << "Register SUA(& SCTP) local instance nr " << i << ", SSN = "<< instance[i].ssn.ssn <<" \n";
#endif
char logstring[100];
sprintf(logstring, "Register SUA(& SCTP) local instance nr %d, SSN = %d",i,instance[i].ssn.ssn );
event_log("sua_database.c",logstring);
instance[i].SUA_APLCallBack.ulp_ClDataIndNotif = SUACallbackFunctions.ulp_ClDataIndNotif;
instance[i].SUA_APLCallBack.ulp_ConnIndNotif = SUACallbackFunctions.ulp_ConnIndNotif;
instance[i].SUA_APLCallBack.ulp_ConnConfIndNotif = SUACallbackFunctions.ulp_ConnConfIndNotif;
instance[i].SUA_APLCallBack.ulp_ConnDataIndNotif = SUACallbackFunctions.ulp_ConnDataIndNotif;
instance[i].SUA_APLCallBack.ulp_DisConnIndNotif = SUACallbackFunctions.ulp_DisConnIndNotif;
if (instance[i].Source.addrs[0].sa.sa_family == AF_INET)
sua_portnumber = instance[i].Source.addrs[0].sin.sin_port;
else if (instance[i].Source.addrs[0].sa.sa_family == AF_INET6)
sua_portnumber = instance[i].Source.addrs[0].sin6.sin6_port;
instance[i].SCTP_instance_name =
sctp_registerInstance( sua_portnumber,
instance[i].max_streams,
instance[i].max_streams,
instance[i].Source.nr_of_addrs,
instance[i].Source.address_string,
APLCallbackFunctions
);
#ifdef DEBUG
cout << "SCTP instance name = " << instance[i].SCTP_instance_name << " \n";
#endif
sprintf(logstring, "Local SCTP instance nr %d name = %d", i, instance[i].SCTP_instance_name);
event_log("sua_database.c",logstring);
}
return(0);
return(0);
}
@ -424,6 +459,7 @@ void db_Sua_RemoteList:: increase_instance(){
event_log("sua_database.c",logstring);
};
/***********************************************************************/
/* functions of the object class SUA Application Server Process (ASP) */
/***********************************************************************/

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_database.h,v 1.8 2002/11/12 11:02:49 p82609 Exp $
* $Id: sua_database.h,v 1.4 2003/01/31 11:36:39 p82609 Exp $
*
* SUA implementation according to SUA draft issue 8.
*
@ -76,7 +76,7 @@
typedef enum {nc_empty, nc_ipv4, nc_ipv6} db_net_class;
const int db_MAX_MULTIHOME_ADDR = 10;
const int db_MAX_MULTIHOME_ADDR = 2;
const int db_MAX_LOCAL_SUA = 10;
const int db_MAX_REMOTE_SUA = 1000;
const int db_MAX_SSN_SUA = 256;
@ -94,17 +94,36 @@ class db_Sua_SSNObject {
void read_ssn(string ssn);
}; ///:~
/***********************************************************************/
/* Sua_AddressObject */
/***********************************************************************/
class db_Sua_AddressObject {
public:
int nr_of_addrs; // number of ip addresses used(multihoming)
unsigned char address_string[db_MAX_MULTIHOME_ADDR][SCTP_MAX_IP_LEN];
ipvxunion addrs[db_MAX_MULTIHOME_ADDR];
SS7union pc;
public:
void read_addr_param(string address);
void read_pointcode_param(string point_code);
void read_port_num(string port);
}; ///:~
/***********************************************************************/
/* Sua_LocalObject */
/***********************************************************************/
class db_Sua_LocalObject{
public:
db_Sua_SSNObject ssn;
/* contains the initial SUA association */
unsigned int init_assoc_id;
/* the local sua id with which it is linked. */
unsigned int sua_id;
Sua_ULP_CallBacks SUA_APLCallBack;
/* ssn supported */
db_Sua_SSNObject ssn;
/* maximum number of streams for this instance */
unsigned int max_streams;
/* SCTP registered local instance name */
unsigned int SCTP_instance_name;
Sua_ULP_CallBacks SUA_APLCallBack;
/* local source address(es) of instance */
db_Sua_AddressObject Source;
name_str Name;
public:
// functions of the Class
void initialize();
@ -119,9 +138,8 @@ class db_Sua_LocalList{
db_Sua_LocalObject instance[db_MAX_LOCAL_SUA];
void initialize();
void read_ssn(string ssn);
short register_instance( unsigned int local_sua_id,
Sua_ULP_CallBacks SUACallbackFunctions,
unsigned int init_assoc_id
short register_instance( SCTP_ulp_Callbacks APLCallbackFunctions,
Sua_ULP_CallBacks SUACallbackFunctions
);
short unregister_instance();
void increase_instance();
@ -133,10 +151,10 @@ class db_Sua_LocalList{
class db_Sua_RemoteObject{
public:
db_Sua_SSNObject ssn;
/* contains the SCTP assoc id */
unsigned int SCTP_assoc_id;
/* contains the local sua id with which it is linked. */
unsigned int sua_id;
/* contains the association sua id with which it is linked. */
unsigned int SUA_assoc_id;
/* dest address of the remote sua node */
db_Sua_AddressObject Dest;
public:
// functions of the Class
void initialize();
@ -153,23 +171,6 @@ class db_Sua_RemoteList{
void initialize();
void read_ssn(string ssn);
void increase_instance();
}; ///:~
/***********************************************************************/
/* Sua_AddressObject */
/***********************************************************************/
class db_Sua_AddressObject {
public:
int nr_of_addrs; // number of ip addresses used(multihoming)
unsigned char address_string[db_MAX_MULTIHOME_ADDR][SCTP_MAX_IP_LEN];
ipvxunion addrs[db_MAX_MULTIHOME_ADDR];
SS7union pc;
public:
void read_addr_param(string address);
void read_pointcode_param(string point_code);
void read_port_num(string port);
}; ///:~
/***********************************************************************/
@ -190,7 +191,7 @@ class db_Sua_GlobalTitle {
class db_Sua_NameObject {
public:
unsigned int SUA_assoc_id;
unsigned int sctp_assoc_id;
boolean GT_present;
db_Sua_GlobalTitle GT;
string hostname;
public:
@ -207,11 +208,14 @@ class db_Sua_NameList{
db_Sua_NameObject instance[db_MAX_REMOTE_SUA];
public:
void initialize();
string read_host_name( unsigned int sua_assoc_id,
string name
void read_host_name( unsigned int gtname_id,
string name
);
void read_Global_Title( unsigned int sua_assoc_id,
string name
void read_Global_Title( unsigned int gtname_id,
unsigned int tt,
unsigned int na,
unsigned int np,
string digits
);
signed int resolve_host_name( hostname_str& dest_name,
pointcode_str& dest_pc
@ -314,6 +318,7 @@ class db_Sua_AssociationObject {
unsigned int local_sua_id;
short nr_of_inbound_streams;
short nr_of_outbound_streams;
boolean init_assoc;
db_Sua_ASPObject asp;
db_net_class netw; // sort of network(v4/v6) to be used
// ip source/destination addresses , should be the same network type
@ -339,21 +344,7 @@ class db_Sua_AssociationList{
void read_Dest_pointcode(string address);
void read_Source_port(string port);
void read_Dest_port(string port);
void read_Source_GT( db_Sua_NameList &NameDB,
string address
);
void read_Dest_GT( db_Sua_NameList &NameDB,
string address
);
string read_host_name( db_Sua_NameList &NameDB,
string address
);
void read_stream_number(string stream_num);
short register_instance(SCTP_ulp_Callbacks APLCallbackFunctions,
Sua_ULP_CallBacks SUACallbackFunctions,
db_Sua_LocalList& local_sua
);
short unregister_instance();
unsigned int Find_association( unsigned int sctp_assoc_id,
unsigned int &Local_sua_id,
unsigned int &Remote_sua_id
@ -378,14 +369,6 @@ class db_Sua_AssociationList{
);
short Terminate_remote_assoc_instance();
short shutdown();
signed int route_on_IPpc ( ipvxunion& dest_pc,
ipvxunion& org_pc,
int& sua_assoc_id
);
signed int route_on_SS7pc ( SS7union& dest_pc,
SS7union& org_pc,
int& sua_assoc_id
);
void increase_instance();
bool activate( unsigned int sua_id,
short mode
@ -413,6 +396,7 @@ class db_Sua_DatabaseList{
db_Sua_NameList NameDB;
db_Sua_ASList ApplicServ;
public:
void initialize();
unsigned int Find_local_sua( sccp_addr_str& local_address
);
unsigned int Dynamic_Associate( sccp_addr_str& cld,
@ -421,6 +405,14 @@ class db_Sua_DatabaseList{
unsigned short nr_of_input_streams,
unsigned short nr_of_output_streams
);
signed int route_on_SS7pc ( SS7union& dest_pc,
SS7union& org_pc,
int& sua_assoc_id
);
signed int route_on_IPpc ( ipvxunion& dest_pc,
ipvxunion& org_pc,
int& sua_assoc_id
);
signed int route_on_GTname ( hostname_str& dest_name,
hostname_str& org_name,
int& sua_assoc_id,

@ -15,7 +15,7 @@
* *
***************************************************************************/
/*
* $Id: sua_dataname.cpp,v 1.6 2002/11/12 11:04:12 p82609 Exp $
* $Id: sua_dataname.cpp,v 1.2 2003/01/31 11:36:39 p82609 Exp $
*
* SUA implementation according to SUA draft issue 6.
*
@ -89,7 +89,7 @@ void db_Sua_NameObject::initialize(){
// initialise to point to a invalid SUA association
SUA_assoc_id = 0;
sctp_assoc_id = 0;
GT.Translation_Type = 0;
GT.Numbering_Plan = 0;
GT.Nature_of_Address = 0;
@ -119,9 +119,9 @@ void db_Sua_NameList::initialize(){
/***********************************************************************/
/* Sua_NameList::read_host_name */
/***********************************************************************/
string db_Sua_NameList::read_host_name( unsigned int sua_assoc_id,
string name
){
void db_Sua_NameList::read_host_name( unsigned int gtname_id,
string name
){
char *hostname;
const char *ip_addr_ptr;
@ -137,74 +137,66 @@ string db_Sua_NameList::read_host_name( unsigned int sua_assoc_id,
if ((hptr = gethostbyname(hostname)) == NULL){
cout << "Determination of hostname failed\n";
return("127.0.0.1");
}
else
{
#ifdef DEBUG
cout << "Hostname " << hptr->h_name << " has the following IP address(es)\n";
cout << "Hostname " << hptr->h_name << " has the following IP address(es)\n";
#endif
pptr = hptr->h_addr_list;
for ( ; *pptr != NULL;pptr++)
{
ip_addr_ptr = inet_ntop(hptr->h_addrtype, *pptr, str,sizeof(str));
addr_str = addr_str + ip_addr_ptr;
if ((*(pptr+1)) != NULL)
/* another ip address is comming after the present one */
addr_str = addr_str + ",";
/*else this is the last ip address */
pptr = hptr->h_addr_list;
for ( ; *pptr != NULL;pptr++)
{
ip_addr_ptr = inet_ntop(hptr->h_addrtype, *pptr, str,sizeof(str));
addr_str = addr_str + ip_addr_ptr;
if ((*(pptr+1)) != NULL)
/* another ip address is comming after the present one */
addr_str = addr_str + ",";
/*else this is the last ip address */
#ifdef DEBUG
cout << ip_addr_ptr << "\n";
cout << ip_addr_ptr << "\n";
#endif
}
}
#ifdef DEBUG
cout << "output IP list = " << addr_str << "\n";
cout << "output IP list = " << addr_str << "\n";
#endif
}
/* initialise */
instance[gtname_id].SUA_assoc_id = 0;
instance[num_of_instance].SUA_assoc_id = sua_assoc_id;
instance[num_of_instance].hostname = name;
/* no GT present -> hostname present */
instance[gtname_id].GT_present = false;
instance[gtname_id].hostname = name;
return(addr_str);
return;
}
/***********************************************************************/
/* Sua_NameList::read_Global_Title */
/***********************************************************************/
void db_Sua_NameList::read_Global_Title( unsigned int sua_assoc_id,
string gt
void db_Sua_NameList::read_Global_Title( unsigned int gtname_id,
unsigned int tt,
unsigned int na,
unsigned int np,
string digits
)
{
string GT_TT_str, GT_NP_str, GT_NA_str, GT_Digits_str;
unsigned int first = 0, last = 0;
unsigned int current = gt.find('-', first);
first = 1;
last = current - 1;
GT_TT_str = gt.substr( first, last);
first = current + 1;
current = gt.find('-', first);
last = current - 1;
GT_NP_str = gt.substr( first , last);
first = current + 1;
current = gt.find('-', first);
last = current - 1;
GT_NA_str = gt.substr( first , last);
first = current + 1;
last = gt.size();
GT_Digits_str = gt.substr( first , last);
instance[num_of_instance].SUA_assoc_id = sua_assoc_id;
/*unsigned short i;*/
instance[gtname_id].SUA_assoc_id = 0;
instance[num_of_instance].GT.Translation_Type = atoi(GT_TT_str.c_str());
instance[num_of_instance].GT.Numbering_Plan = atoi(GT_NP_str.c_str());
instance[num_of_instance].GT.Nature_of_Address = atoi(GT_NA_str.c_str());
instance[num_of_instance].GT.digits = GT_Digits_str;
/* GT present */
instance[gtname_id].GT_present = true;
instance[gtname_id].GT.Translation_Type = tt;
instance[gtname_id].GT.Numbering_Plan = np;
instance[gtname_id].GT.Nature_of_Address = na;
instance[gtname_id].GT.digits.resize( digits.length(