update to sualibrary-0.1.2 from 2002-11-26

* Contains Relaying functionality using hostnames.
    * 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
This commit is contained in:
Harald Welte 2010-07-09 20:57:43 +02:00
parent 7e7186ca00
commit 3dc72b8cff
32 changed files with 3451 additions and 1741 deletions

View File

@ -8,7 +8,7 @@ AC_INIT(acconfig.h)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM AC_ARG_PROGRAM
AM_INIT_AUTOMAKE(sualibrary,0.1.0) AM_INIT_AUTOMAKE(sualibrary,0.1.2)
AC_PREFIX_DEFAULT(/usr/local) AC_PREFIX_DEFAULT(/usr/local)
if test "x$prefix" = "xNONE"; then if test "x$prefix" = "xNONE"; then
@ -16,10 +16,10 @@ if test "x$prefix" = "xNONE"; then
ac_configure_args="$ac_configure_args --prefix $prefix" ac_configure_args="$ac_configure_args --prefix $prefix"
fi fi
dnl keep this order because automake gets confused apart from the authors # keep this order because automake gets confused apart from the authors
AM_CONFIG_HEADER(config.h:config.h.in) AM_CONFIG_HEADER(config.h:config.h.in)
dnl Checks for programs. # Checks for programs.
AC_PROG_AWK AC_PROG_AWK
AC_PROG_CC AC_PROG_CC
AC_PROG_INSTALL AC_PROG_INSTALL
@ -28,23 +28,23 @@ AC_PROG_CXX
AC_PROG_RANLIB AC_PROG_RANLIB
dnl Checks for libraries. # Checks for libraries.
dnl create only shared libtool-libraries (add --enable-shared) # create only shared libtool-libraries (add --enable-shared)
AC_ENABLE_SHARED(no) AC_ENABLE_SHARED(no)
dnl AM_DISABLE_SHARED # AM_DISABLE_SHARED
dnl set the following to yes, if you want to create static # set the following to yes, if you want to create static
dnl libtool-libraries, else no # libtool-libraries, else no
AC_ENABLE_STATIC(yes) AC_ENABLE_STATIC(yes)
dnl create a working libtool-script # create a working libtool-script
if test -z "$LIBTOOL"; then if test -z "$LIBTOOL"; then
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
AC_LIBTOOL_DLOPEN AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL AM_PROG_LIBTOOL
dnl LIBTOOL="$LIBTOOL --silent" # LIBTOOL="$LIBTOOL --silent"
dnl AC_SUBST(LIBTOOL) # AC_SUBST(LIBTOOL)
AC_LANG_RESTORE AC_LANG_RESTORE
LIBTOOL_SHELL='/bin/sh ./libtool' LIBTOOL_SHELL='/bin/sh ./libtool'
else else
@ -52,8 +52,8 @@ else
fi fi
dnl activate the following for some additional tests # activate the following for some additional tests
dnl (compat, crypt, socket, nsl, ...) # (compat, crypt, socket, nsl, ...)
all_libraries="$USER_LDFLAGS $all_libraries" all_libraries="$USER_LDFLAGS $all_libraries"
all_includes="$all_includes $USER_INCLUDES" all_includes="$all_includes $USER_INCLUDES"
@ -61,7 +61,7 @@ AC_SUBST(all_includes)
AC_SUBST(all_libraries) AC_SUBST(all_libraries)
AC_SUBST(AUTODIRS) AC_SUBST(AUTODIRS)
dnl Checks for header files. # Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
AC_HEADER_TIME AC_HEADER_TIME
@ -70,24 +70,24 @@ sys/socket.h netinet/icmp6.h)
AC_CHECK_HEADERS(sys/poll.h, AC_DEFINE(HAVE_SYS_POLL_H)) AC_CHECK_HEADERS(sys/poll.h, AC_DEFINE(HAVE_SYS_POLL_H))
dnl Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
dnl ---------------------- # ----------------------
dnl Packages configuration - Blatantly stolen from zebra ! # Packages configuration - Blatantly stolen from zebra !
dnl ---------------------- # ----------------------
AC_ARG_ENABLE(ipv6, AC_ARG_ENABLE(ipv6,
[ --disable-ipv6 turn off IPv6 support ]) [ --disable-ipv6 turn off IPv6 support ])
dnl ---------- # ----------
dnl IPv6 check # IPv6 check
dnl ---------- # ----------
AC_MSG_CHECKING(whether this OS does have IPv6 stack) AC_MSG_CHECKING(whether this OS does have IPv6 stack)
if test "${enable_ipv6}" = "no"; then if test "${enable_ipv6}" = "no"; then
AC_MSG_RESULT(disabled) AC_MSG_RESULT(disabled)
else else
dnl ---------- # ----------
dnl INRIA IPv6 # INRIA IPv6
dnl ---------- # ----------
if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
cv_ipv6=yes cv_ipv6=yes
AC_DEFINE(HAVE_IPV6) AC_DEFINE(HAVE_IPV6)
@ -95,9 +95,9 @@ if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
LIB_IPV6="" LIB_IPV6=""
AC_MSG_RESULT(INRIA IPv6) AC_MSG_RESULT(INRIA IPv6)
fi fi
dnl --------- # ---------
dnl KAME IPv6 # KAME IPv6
dnl --------- # ---------
if grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then if grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
cv_ipv6=yes cv_ipv6=yes
AC_DEFINE(HAVE_IPV6) AC_DEFINE(HAVE_IPV6)
@ -107,9 +107,9 @@ if grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
fi fi
AC_MSG_RESULT(KAME) AC_MSG_RESULT(KAME)
fi fi
dnl --------- # ---------
dnl NRL check # NRL check
dnl --------- # ---------
if grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then if grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
cv_ipv6=yes cv_ipv6=yes
AC_DEFINE(HAVE_IPV6) AC_DEFINE(HAVE_IPV6)
@ -121,11 +121,11 @@ if grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
AC_MSG_RESULT(NRL) AC_MSG_RESULT(NRL)
fi fi
fi fi
dnl ---------- # ----------
dnl Linux IPv6 # Linux IPv6
dnl ---------- # ----------
if test "${enable_ipv6}" = "yes"; then if test "${enable_ipv6}" = "yes"; then
AC_EGREP_CPP(yes, [dnl AC_EGREP_CPP(yes, [#
#include <linux/version.h> #include <linux/version.h>
/* 2.1.128 or later */ /* 2.1.128 or later */
#if LINUX_VERSION_CODE >= 0x020180 #if LINUX_VERSION_CODE >= 0x020180
@ -159,15 +159,15 @@ fi
fi fi
dnl ----------------------- # -----------------------
dnl Set IPv6 related values # Set IPv6 related values
dnl ----------------------- # -----------------------
LIBS="$LIB_IPV6 $LIBS" LIBS="$LIB_IPV6 $LIBS"
AC_SUBST(LIB_IPV6) AC_SUBST(LIB_IPV6)
dnl ----------------------------------- # -----------------------------------
dnl check sin6_scope_id of sockaddr_in6 # check sin6_scope_id of sockaddr_in6
dnl ----------------------------------- # -----------------------------------
if test "$cv_ipv6" = yes; then if test "$cv_ipv6" = yes; then
AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field) AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field)
AC_TRY_COMPILE([#include <sys/types.h> AC_TRY_COMPILE([#include <sys/types.h>
@ -178,9 +178,9 @@ if test "$cv_ipv6" = yes; then
AC_MSG_RESULT(no)) AC_MSG_RESULT(no))
fi fi
dnl ----------------------------------- # -----------------------------------
dnl Check for New Socket API (RFC2292BIS) # Check for New Socket API (RFC2292BIS)
dnl ----------------------------------- # -----------------------------------
AC_MSG_CHECKING(for rfc2292bis support) AC_MSG_CHECKING(for rfc2292bis support)
AC_TRY_COMPILE([#include <sys/types.h> AC_TRY_COMPILE([#include <sys/types.h>
#include <netinet/in.h>], #include <netinet/in.h>],
@ -198,9 +198,9 @@ AC_TRY_COMPILE([#include <sys/types.h>
AC_MSG_RESULT(yes)], AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)]) [AC_MSG_RESULT(no)])
dnl This is taken from the ethereal configuration scripts. # This is taken from the ethereal configuration scripts.
dnl We check whether user wants to build gtk-based programs # We check whether user wants to build gtk-based programs
dnl These need to be enabled explicitly # These need to be enabled explicitly
GTK_OK=yes GTK_OK=yes
# GTK checks # GTK checks
@ -236,12 +236,12 @@ AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distributio
AC_SUBST(sctp_SUBDIRS) AC_SUBST(sctp_SUBDIRS)
dnl Checks for library functions. # Checks for library functions.
AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyname) AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(sctp, sctp_eventloop) AC_CHECK_LIB(sctp, sctp_eventloop)
dnl removed libefence....this should be used though, when we REALLY debug :-) # removed libefence....this should be used though, when we REALLY debug :-)
AC_CHECK_LIB(efence, malloc) AC_CHECK_LIB(efence, malloc)
AC_CHECK_LIB(glib, g_main_add_poll) AC_CHECK_LIB(glib, g_main_add_poll)
@ -287,14 +287,14 @@ AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON)]) AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
AC_CHECK_LIB(c, inet_aton, [AC_DEFINE(HAVE_INET_ATON)]) AC_CHECK_LIB(c, inet_aton, [AC_DEFINE(HAVE_INET_ATON)])
dnl Checks for library functions. # Checks for library functions.
AC_FUNC_VPRINTF AC_FUNC_VPRINTF
AC_FUNC_MEMCMP AC_FUNC_MEMCMP
AC_CHECK_FUNCS(gettimeofday socket strerror poll getuid setuid geteuid random) AC_CHECK_FUNCS(gettimeofday socket strerror poll getuid setuid geteuid random)
AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no]) AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
dnl checks for host/build/target system type # checks for host/build/target system type
AC_CANONICAL_HOST AC_CANONICAL_HOST
case $host_os in case $host_os in
bsdi*) bsdi*)
@ -356,7 +356,7 @@ AC_SUBST(thread_LIBS)
dnl Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST AC_C_CONST
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
AC_STRUCT_TM AC_STRUCT_TM
@ -379,5 +379,5 @@ AC_TRY_COMPILE([#include <sys/types.h>
dnl add here all your Makefiles. These will be created by configure # add here all your Makefiles. These will be created by configure
AC_OUTPUT(Makefile sualibrary/Makefile sualibrary/docs/Makefile sualibrary/docs/en/Makefile sualibrary/sua/Makefile sualibrary/testup/Makefile ) AC_OUTPUT(Makefile sualibrary/Makefile sualibrary/docs/Makefile sualibrary/docs/en/Makefile sualibrary/sua/Makefile sualibrary/testup/Makefile )

View File

@ -1,290 +1,347 @@
# KDE Config File [AUTHORS]
[sualibrary/docs/en/index-6.html]
install_location=
dist=true dist=true
install=false install=false
install_location=
type=DATA type=DATA
[Workspace_1]
openfiles=Untitled.h,Untitled.cpp,/home/p82609/siemens/sualibrary/sualibrary/sua/sua_datassoc.cpp,/home/p82609/siemens/sualibrary/sualibrary/sua/sua_distribution.cpp,
show_outputview=true
show_treeview=true
header_file=Untitled.h
cpp_file=/home/p82609/siemens/sualibrary/sualibrary/sua/sua_datassoc.cpp
browser_file=file:/opt/kde/share/doc/HTML/default/kdevelop/reference/C/LIBRARIES/libraries.html
[COPYING] [COPYING]
install_location=
dist=true dist=true
install=false install=false
install_location=
type=DATA type=DATA
[sualibrary/sua/sua_adapt.cpp]
install_location=
dist=true
install=false
type=SOURCE
[sualibrary/sua/sua_logging.cpp]
install_location=
dist=true
install=false
type=SOURCE
[sualibrary/sua/sua_logging.h]
install_location=
dist=true
install=false
type=HEADER
[sualibrary/sua/sua_database.h]
install_location=
dist=true
install=false
type=HEADER
[Config for BinMakefileAm]
ldflags=
addcxxflags=
ldadd=
cxxflags=-O0 -g3 -Wall
bin_program=sualibrary
[sualibrary/sua/sua.h]
install_location=
dist=true
install=false
type=HEADER
[sualibrary/sua/sua_tcb.h]
install_location=
dist=true
install=false
type=HEADER
[sualibrary/testup/main.cpp]
install_location=
dist=true
install=false
type=SOURCE
[README]
install_location=
dist=true
install=false
type=DATA
[sualibrary/sua/sua_asp_mgnt.h]
install_location=
dist=true
install=false
type=HEADER
[sualibrary/sua/sua_file.h]
install_location=
dist=true
install=false
type=HEADER
[sualibrary/docs/en/index-1.html]
install_location=
dist=true
install=false
type=DATA
[sualibrary.kdevprj]
install_location=
dist=true
install=false
type=DATA
[LFV Groups]
GNU=AUTHORS,COPYING,ChangeLog,INSTALL,README,TODO,NEWS,
Others=*,
groups=Headers,Sources,GNU,Others,
Sources=*.cpp,*.c,*.cc,*.C,*.cxx,*.ec,*.ecpp,*.lxx,*.l++,*.ll,*.l,
Headers=*.h,*.hh,*.hxx,*.hpp,*.H,
[sualibrary/docs/en/index-2.html]
install_location=
dist=true
install=false
type=DATA
[sualibrary/docs/en/Makefile.am]
files=sualibrary/docs/en/index.html,sualibrary/docs/en/index-1.html,sualibrary/docs/en/index-2.html,sualibrary/docs/en/index-3.html,sualibrary/docs/en/index-4.html,sualibrary/docs/en/index-5.html,sualibrary/docs/en/index-6.html,
sub_dirs=
type=normal
[sualibrary/sua/sua_sual.cpp]
install_location=
dist=true
install=false
type=SOURCE
[sualibrary/docs/en/index.html]
install_location=
dist=true
install=false
type=DATA
[sualibrary/docs/en/index-3.html]
install_location=
dist=true
install=false
type=DATA
[sualibrary/sua/sua_asp_mgnt.cpp]
install_location=
dist=true
install=false
type=SOURCE
[sualibrary/sua/sua_dataname.cpp]
install_location=
dist=true
install=false
type=SOURCE
[sualibrary/sua/sua_file.cpp]
install_location=
dist=true
install=false
type=SOURCE
[sualibrary/testup/assoc.sua]
install_location=
dist=false
install=false
type=DATA
[sualibrary/docs/Makefile.am]
sub_dirs=en,
type=normal
[sualibrary/docs/en/index-4.html]
install_location=
dist=true
install=false
type=DATA
[sualibrary/sua/sua_distribution.h]
install_location=
dist=true
install=false
type=HEADER
[sualibrary/sua/sua_syntax.cpp]
install_location=
dist=true
install=false
type=SOURCE
[sualibrary/testup/testuser.h]
install_location=
dist=true
install=false
type=HEADER
[sualibrary.lsm]
install_location=
dist=true
install=false
type=DATA
[sualibrary/Makefile.am]
files=
sub_dirs=docs,sua,testup,
type=prog_main
[sualibrary/sua/sua_tcb.cpp]
install_location=
dist=true
install=false
type=SOURCE
[sualibrary/docs/en/index-5.html]
install_location=
dist=true
install=false
type=DATA
[sualibrary/sua/sua_datassoc.cpp]
install_location=
dist=true
install=false
type=SOURCE
[ChangeLog] [ChangeLog]
install_location=
dist=true dist=true
install=false install=false
install_location=
type=DATA type=DATA
[sualibrary/sua/sua_cl.cpp]
install_location= [Config for BinMakefileAm]
dist=true addcxxflags=
install=false bin_program=sualibrary
type=SOURCE cxxflags=-O0 -g3 -Wall
ldadd=
ldflags=
[General] [General]
make_options=-j1
makefiles=Makefile.am,sualibrary/Makefile.am,sualibrary/docs/Makefile.am,sualibrary/docs/en/Makefile.am,sualibrary/sua/Makefile.am,sualibrary/testup/Makefile.am,
version_control=None
author=Lode Coene
project_type=normal_cpp
sub_dir=sualibrary/
lfv_open_groups=
workspace=1
version=0.1
project_name=Sualibrary
AMChanged=false AMChanged=false
sgml_file=/home/p82609/sualibrary/sualibrary/docs/en/index.sgml author=Lode Coene
short_info=, configure_args=
email=lode.coene@siemens.atea.be email=lode.coene@siemens.atea.be
kdevprj_version=1.2 kdevprj_version=1.2
configure_args= lfv_open_groups=
make_options=-j1
makefiles=Makefile.am,sualibrary/Makefile.am,sualibrary/docs/Makefile.am,sualibrary/docs/en/Makefile.am,sualibrary/sua/Makefile.am,sualibrary/testup/Makefile.am,
modifyMakefiles=true modifyMakefiles=true
[sualibrary/sua/Makefile.am] project_name=Sualibrary
files=sualibrary/sua/sua.h,sualibrary/sua/sua_adapt.cpp,sualibrary/sua/sua_adapt.h,sualibrary/sua/sua_asp_mgnt.cpp,sualibrary/sua/sua_asp_mgnt.h,sualibrary/sua/sua_cl.cpp,sualibrary/sua/sua_cl.h,sualibrary/sua/sua_datassoc.cpp,sualibrary/sua/sua_co.cpp,sualibrary/sua/sua_co.h,sualibrary/sua/sua_database.cpp,sualibrary/sua/sua_database.h,sualibrary/sua/sua_dataname.cpp,sualibrary/sua/sua_debug.h,sualibrary/sua/sua_distribution.cpp,sualibrary/sua/sua_distribution.h,sualibrary/sua/sua_file.cpp,sualibrary/sua/sua_file.h,sualibrary/sua/sua_logging.cpp,sualibrary/sua/sua_logging.h,sualibrary/sua/sua_sual.cpp,sualibrary/sua/sua_sual.h,sualibrary/sua/sua_syntax.cpp,sualibrary/sua/sua_syntax.h,sualibrary/sua/sua_tcb.cpp,sualibrary/sua/sua_tcb.h, project_type=normal_cpp
type=static_library sgml_file=/home/p82609/sualibrary/sualibrary/docs/en/index.sgml
[TODO] short_info=,
install_location= sub_dir=sualibrary/
dist=true version=0.1
install=false version_control=None
type=DATA workspace=1
[INSTALL] [INSTALL]
install_location=
dist=true dist=true
install=false install=false
install_location=
type=DATA type=DATA
[sualibrary/sua/sua_syntax.h]
install_location= [LFV Groups]
dist=true GNU=AUTHORS,COPYING,ChangeLog,INSTALL,README,TODO,NEWS,
install=false Headers=*.h,*.hh,*.hxx,*.hpp,*.H,
type=HEADER Others=*,
[sualibrary/testup/local.sua] Sources=*.cpp,*.c,*.cc,*.C,*.cxx,*.ec,*.ecpp,*.lxx,*.l++,*.ll,*.l,
install_location=local.sua groups=Headers,Sources,GNU,Others,
dist=false
install=false
type=DATA
[sualibrary/sua/sua_co.h]
install_location=
dist=true
install=false
type=HEADER
[sualibrary/sua/sua_adapt.h]
install_location=
dist=true
install=false
type=HEADER
[sualibrary/sua/sua_co.cpp]
install_location=
dist=true
install=false
type=SOURCE
[sualibrary/sua/sua_database.cpp]
install_location=
dist=true
install=false
type=SOURCE
[sualibrary/testup/testuser.cpp]
install_location=
dist=true
install=false
type=SOURCE
[Makefile.am] [Makefile.am]
files=sualibrary.kdevprj,AUTHORS,COPYING,ChangeLog,INSTALL,README,TODO,sualibrary.lsm, files=sualibrary.kdevprj,AUTHORS,COPYING,ChangeLog,INSTALL,README,TODO,sualibrary.lsm,
sub_dirs=sualibrary, sub_dirs=sualibrary,
type=normal type=normal
[sualibrary/sua/sua_cl.h]
install_location= [README]
dist=true dist=true
install=false install=false
type=HEADER
[sualibrary/sua/sua_distribution.cpp]
install_location= install_location=
dist=true
install=false
type=SOURCE
[sualibrary/sua/sua_sual.h]
install_location=
dist=true
install=false
type=HEADER
[AUTHORS]
install_location=
dist=true
install=false
type=DATA type=DATA
[sualibrary/testup/Makefile.am]
files=sualibrary/testup/main.cpp,sualibrary/testup/testuser.cpp,sualibrary/testup/testuser.h,sualibrary/testup/local.sua,sualibrary/testup/assoc.sua, [TODO]
type=static_library
sub_dirs=
[sualibrary/sua/sua_debug.h]
install_location=
dist=true dist=true
install=false install=false
install_location=
type=DATA
[Workspace_1]
browser_file=file:/opt/kde/share/doc/HTML/default/kdevelop/reference/C/LIBRARIES/libraries.html
cpp_file=/home/p82609/sualibrary/sualibrary/testup/testuser.cpp
header_file=/home/p82609/sualibrary/sualibrary/testup/testuser.h
openfiles=Untitled.h,Untitled.cpp,/home/p82609/sualibrary/sualibrary/testup/main.cpp,/home/p82609/sualibrary/sualibrary/testup/testuser.cpp,/home/p82609/sualibrary/sualibrary/testup/testuser.h,
show_outputview=true
show_treeview=true
[sualibrary.kdevprj]
dist=true
install=false
install_location=
type=DATA
[sualibrary.lsm]
dist=true
install=false
install_location=
type=DATA
[sualibrary/Makefile.am]
files=
sub_dirs=docs,sua,testup,
type=prog_main
[sualibrary/docs/Makefile.am]
sub_dirs=en,
type=normal
[sualibrary/docs/en/Makefile.am]
files=sualibrary/docs/en/index.html,sualibrary/docs/en/index-1.html,sualibrary/docs/en/index-2.html,sualibrary/docs/en/index-3.html,sualibrary/docs/en/index-4.html,sualibrary/docs/en/index-5.html,sualibrary/docs/en/index-6.html,
sub_dirs=
type=normal
[sualibrary/docs/en/index-1.html]
dist=true
install=false
install_location=
type=DATA
[sualibrary/docs/en/index-2.html]
dist=true
install=false
install_location=
type=DATA
[sualibrary/docs/en/index-3.html]
dist=true
install=false
install_location=
type=DATA
[sualibrary/docs/en/index-4.html]
dist=true
install=false
install_location=
type=DATA
[sualibrary/docs/en/index-5.html]
dist=true
install=false
install_location=
type=DATA
[sualibrary/docs/en/index-6.html]
dist=true
install=false
install_location=
type=DATA
[sualibrary/docs/en/index.html]
dist=true
install=false
install_location=
type=DATA
[sualibrary/sua/Makefile.am]
files=sualibrary/sua/sua.h,sualibrary/sua/sua_adapt.cpp,sualibrary/sua/sua_adapt.h,sualibrary/sua/sua_asp_mgnt.cpp,sualibrary/sua/sua_asp_mgnt.h,sualibrary/sua/sua_cl.cpp,sualibrary/sua/sua_cl.h,sualibrary/sua/sua_datassoc.cpp,sualibrary/sua/sua_co.cpp,sualibrary/sua/sua_co.h,sualibrary/sua/sua_database.cpp,sualibrary/sua/sua_database.h,sualibrary/sua/sua_dataname.cpp,sualibrary/sua/sua_debug.h,sualibrary/sua/sua_distribution.cpp,sualibrary/sua/sua_distribution.h,sualibrary/sua/sua_file.cpp,sualibrary/sua/sua_file.h,sualibrary/sua/sua_logging.cpp,sualibrary/sua/sua_logging.h,sualibrary/sua/sua_sual.cpp,sualibrary/sua/sua_sual.h,sualibrary/sua/sua_syntax.cpp,sualibrary/sua/sua_syntax.h,sualibrary/sua/sua_tcb.cpp,sualibrary/sua/sua_tcb.h,sualibrary/sua/sua_snm_mgnt.cpp,sualibrary/sua/sua_snm_mgnt.h
sharedlib_LDFLAGS=
sharedlib_rootname=
sub_dirs=
type=static_library
[sualibrary/sua/sua.h]
dist=true
install=false
install_location=
type=HEADER
[sualibrary/sua/sua_adapt.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/sua/sua_adapt.h]
dist=true
install=false
install_location=
type=HEADER
[sualibrary/sua/sua_asp_mgnt.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/sua/sua_asp_mgnt.h]
dist=true
install=false
install_location=
type=HEADER
[sualibrary/sua/sua_cl.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/sua/sua_cl.h]
dist=true
install=false
install_location=
type=HEADER
[sualibrary/sua/sua_co.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/sua/sua_co.h]
dist=true
install=false
install_location=
type=HEADER
[sualibrary/sua/sua_database.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/sua/sua_database.h]
dist=true
install=false
install_location=
type=HEADER
[sualibrary/sua/sua_dataname.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/sua/sua_datassoc.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/sua/sua_debug.h]
dist=true
install=false
install_location=
type=HEADER
[sualibrary/sua/sua_distribution.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/sua/sua_distribution.h]
dist=true
install=false
install_location=
type=HEADER
[sualibrary/sua/sua_file.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/sua/sua_file.h]
dist=true
install=false
install_location=
type=HEADER
[sualibrary/sua/sua_logging.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/sua/sua_logging.h]
dist=true
install=false
install_location=
type=HEADER
[sualibrary/sua/sua_snm_mgnt.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/sua/sua_snm_mgnt.h]
dist=true
install=false
install_location=
type=HEADER
[sualibrary/sua/sua_sual.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/sua/sua_sual.h]
dist=true
install=false
install_location=
type=HEADER
[sualibrary/sua/sua_syntax.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/sua/sua_syntax.h]
dist=true
install=false
install_location=
type=HEADER
[sualibrary/sua/sua_tcb.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/sua/sua_tcb.h]
dist=true
install=false
install_location=
type=HEADER
[sualibrary/testup/Makefile.am]
files=sualibrary/testup/main.cpp,sualibrary/testup/testuser.cpp,sualibrary/testup/testuser.h,
sub_dirs=
type=static_library
[sualibrary/testup/main.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/testup/testuser.cpp]
dist=true
install=false
install_location=
type=SOURCE
[sualibrary/testup/testuser.h]
dist=true
install=false
install_location=
type=HEADER type=HEADER

View File

@ -1,6 +1,6 @@
Begin3 Begin3
Title: Sualibrary Title: Sualibrary
Version: 0.1 Version: 0.1.2
Entered-date: Entered-date:
Description: Description:
Keywords: Keywords:
@ -9,6 +9,6 @@ Maintained-by: Lode Coene <lode.coene@siemens.atea.be>
Primary-site: Primary-site:
Home-page: http://www.sctp.be/sua Home-page: http://www.sctp.be/sua
Original-site: Original-site:
Platforms: Linux and other Unices Platforms: Linux, FreeBSD, Mac OSX and other Unixes
Copying-policy: GNU Public License Copying-policy: GNU Public License
End End

View File

@ -1,9 +1,10 @@
####### kdevelop will overwrite this part!!! (begin)########## ####### kdevelop will overwrite this part!!! (begin)##########
SUBDIRS = docs sua testup
####### kdevelop will overwrite this part!!! (end)############ ####### kdevelop will overwrite this part!!! (end)############
SUBDIRS = docs sua testup SUBDIRS = docs sua testup

View File

@ -1,10 +1,10 @@
####### kdevelop will overwrite this part!!! (begin)########## ####### kdevelop will overwrite this part!!! (begin)##########
noinst_LIBRARIES = libsua.a noinst_LIBRARIES = libsua.a
libsua_a_SOURCES = sua_tcb.cpp sua_syntax.cpp sua_sual.cpp sua_logging.cpp sua_file.cpp sua_distribution.cpp sua_dataname.cpp sua_database.cpp sua_co.cpp sua_datassoc.cpp sua_cl.cpp sua_asp_mgnt.cpp sua_adapt.cpp libsua_a_SOURCES = sua_snm_mgnt.cpp sua_tcb.cpp sua_syntax.cpp sua_sual.cpp sua_logging.cpp sua_file.cpp sua_distribution.cpp sua_dataname.cpp sua_database.cpp sua_co.cpp sua_datassoc.cpp sua_cl.cpp sua_asp_mgnt.cpp sua_adapt.cpp
EXTRA_DIST = sua.h sua_adapt.cpp sua_adapt.h sua_asp_mgnt.cpp sua_asp_mgnt.h sua_cl.cpp sua_cl.h sua_datassoc.cpp sua_co.cpp sua_co.h sua_database.cpp sua_database.h sua_dataname.cpp sua_debug.h sua_distribution.cpp sua_distribution.h sua_file.cpp sua_file.h sua_logging.cpp sua_logging.h sua_sual.cpp sua_sual.h sua_syntax.cpp sua_syntax.h sua_tcb.cpp sua_tcb.h EXTRA_DIST = sua.h sua_adapt.cpp sua_adapt.h sua_asp_mgnt.cpp sua_asp_mgnt.h sua_cl.cpp sua_cl.h sua_datassoc.cpp sua_co.cpp sua_co.h sua_database.cpp sua_database.h sua_dataname.cpp sua_debug.h sua_distribution.cpp sua_distribution.h sua_file.cpp sua_file.h sua_logging.cpp sua_logging.h sua_sual.cpp sua_sual.h sua_syntax.cpp sua_syntax.h sua_tcb.cpp sua_tcb.h sua_snm_mgnt.cpp sua_snm_mgnt.h
####### kdevelop will overwrite this part!!! (end)############ ####### kdevelop will overwrite this part!!! (end)############
SOMAJOR = 1 SOMAJOR = 1
@ -21,10 +21,16 @@ INCLUDES = -I/usr/local/include
#build a libtool library for installation in libdir #build a libtool library for installation in libdir
lib_LTLIBRARIES = libsua.la lib_LTLIBRARIES = libsua.la
libsua_la_SOURCES = sua_tcb.cpp sua_syntax.cpp sua_sual.cpp sua_logging.cpp sua_file.cpp sua_distribution.cpp sua_dataname.cpp sua_database.cpp sua_co.cpp sua_datassoc.cpp sua_cl.cpp sua_asp_mgnt.cpp sua_adapt.cpp libsua_la_SOURCES = sua_tcb.cpp sua_syntax.cpp sua_sual.cpp sua_logging.cpp sua_file.cpp sua_distribution.cpp sua_dataname.cpp sua_database.cpp sua_co.cpp sua_datassoc.cpp sua_cl.cpp sua_asp_mgnt.cpp sua_adapt.cpp sua_snm_mgnt.cpp
libsua_la_LDFLAGS = -no-undefined -version-info $(SOMAJOR):$(SOMINOR):$(SOSUBMINOR) $(LDFLAGS) libsua_la_LDFLAGS = -no-undefined -version-info $(SOMAJOR):$(SOMINOR):$(SOSUBMINOR) $(LDFLAGS)

View File

@ -15,9 +15,9 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua.h,v 1.3 2002/02/15 16:19:46 p82609 Exp $ * $Id: sua.h,v 1.8 2002/11/12 11:02:49 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 13.
* *
* Author(s): Lode Coene * Author(s): Lode Coene
* *
@ -102,6 +102,9 @@
#include <netinet/in.h> #include <netinet/in.h>
#ifdef DARWIN
#include <stdint.h>
#endif
/* turn on Posix 1g for compatible cmsg structure */ /* turn on Posix 1g for compatible cmsg structure */
#ifdef USE_RFC2292BIS #ifdef USE_RFC2292BIS
@ -120,6 +123,8 @@
#include "sctp.h" /* SCTP library */ #include "sctp.h" /* SCTP library */
using namespace std;
#define SUA_PORT 14001 #define SUA_PORT 14001
#define SUA_PPI 4 #define SUA_PPI 4
#define IPPROTO_SCTP 132 #define IPPROTO_SCTP 132
@ -128,6 +133,11 @@
/*#define HAVE_UNISTD_H TRUE */ /*#define HAVE_UNISTD_H TRUE */
#ifndef FALSE
#define FALSE (0)
#define TRUE (!FALSE)
#endif
#define N_UNITDATA 1 #define N_UNITDATA 1
#define N_NOTICE 2 #define N_NOTICE 2
#define N_CONNECT_REQ 10 #define N_CONNECT_REQ 10
@ -140,12 +150,24 @@
#define N_RELEASE_REQ 30 #define N_RELEASE_REQ 30
#define N_RELEASE_CONF 31 #define N_RELEASE_CONF 31
#define SUA_UDTS_NO_TRANSLATION_FOR_NATURE_OF_ADDRES 0x00
#define SUA_UDTS_NO_TRANSLATION_FOR_SPECIFIC_ADDRES 0x01
#define SUA_UDTS_SUBSYTEM_CONGESTION 0x02
#define SUA_UDTS_SUBSYTEM_FAILURE 0x03
#define SUA_UDTS_UNEQUIPPED_USER 0x04
#define SUA_UDTS_MTP_FAILURE 0x05
#define SUA_UDTS_NETWORK_CONGESTION 0x06
#define SUA_UDTS_UNQUALIFIED 0x07
#define SUA_UDTS_ERROR_IN_MSG_TRANSPORT 0x08
#define SUA_UDTS_ERROR_IN_LOCAL_PROCESSING 0x09
#define SUA_UDTS_DESTINATION_REASSEMBLY_FAILURE 0x0A
#define SUA_UDTS_SCCP_FAILURE 0x0B
#define SUA_UDTS_HOP_COUNTER_VIOLATION 0x0C
#define SUA_UDTS_SEGMENTATION_NOT_SUPPORTED 0x0D
#define SUA_UDTS_SEGMENTATION_FAILURE 0x0E
typedef unsigned char boolean; typedef unsigned char boolean;
#define FALSE (0)
#define TRUE (!FALSE)
#define OK 0 #define OK 0
#define PROTOCOL_CLASS_NOT_SPECIFIED -10 #define PROTOCOL_CLASS_NOT_SPECIFIED -10
#define INVALID_CLG_ADDRESS -20 #define INVALID_CLG_ADDRESS -20
@ -214,7 +236,7 @@ typedef enum { no_name_present,
} name_gt_set; } name_gt_set;
typedef enum { no_sap_present, typedef enum { no_sap_present,
ssn_present, ssn_present,
portnumber_presentr portnumber_presentr
} application_SAP_set; } application_SAP_set;
@ -238,7 +260,13 @@ typedef struct {
typedef char hostname_str[255]; typedef char hostname_str[255];
typedef char global_title_str[255]; typedef struct {
short Translation_Type;
short Numbering_Plan;
short Nature_of_Address;
short nr_of_digits;
char digits[255];
} global_title_str;
typedef union { typedef union {
global_title_str GT; global_title_str GT;
@ -264,7 +292,7 @@ typedef struct {
typedef enum { class0, // connectionless transport, non-sequenced typedef enum { class0, // connectionless transport, non-sequenced
class1, // connectionless transport, sequenced class1, // connectionless transport, sequenced
class2, // connectionoriented class2, // connectionoriented
class3 // connectionoriented with flow control class3 // connectionoriented with flow control
} protocol_class_set; } protocol_class_set;
@ -279,26 +307,26 @@ typedef struct {
typedef struct { typedef struct {
void (*ulp_ClDataIndNotif) ( unsigned int local_sua_Id, void (*ulp_ClDataIndNotif) ( unsigned int local_sua_Id,
unsigned int primitive, unsigned int primitive,
unsigned int datalen unsigned int datalen
); );
void (*ulp_ConnIndNotif) ( unsigned int local_sua_id, void (*ulp_ConnIndNotif) ( unsigned int local_sua_id,
unsigned int local_sua_ref, unsigned int local_sua_ref,
unsigned int datalen unsigned int datalen
); );
void (*ulp_ConnConfIndNotif) ( unsigned int local_sua_id, void (*ulp_ConnConfIndNotif) ( unsigned int local_sua_id,
unsigned int local_sua_ref, unsigned int local_sua_ref,
unsigned int datalen unsigned int datalen
); );
void (*ulp_ConnDataIndNotif) ( unsigned int local_sua_id, void (*ulp_ConnDataIndNotif) ( unsigned int local_sua_id,
unsigned int local_sua_ref, unsigned int local_sua_ref,
unsigned int datalen unsigned int datalen
); );
void (*ulp_DisConnIndNotif) ( unsigned int local_sua_id, void (*ulp_DisConnIndNotif) ( unsigned int local_sua_id,
unsigned int local_sua_ref, unsigned int local_sua_ref,
unsigned int reason, unsigned int reason,
unsigned int datalen unsigned int datalen
); );
} Sua_ULP_CallBacks; } Sua_ULP_CallBacks;
@ -317,9 +345,9 @@ unsigned int sua_read_config_file
#define SUA_REG_NO_ERROR 0 #define SUA_REG_NO_ERROR 0
unsigned int sua_registerInstance unsigned int sua_registerInstance
( short local_ssn, ( short local_ssn,
Sua_ULP_CallBacks ulp_callback Sua_ULP_CallBacks ulp_callback
); );
#define SUA_ASS_NO_ERROR 0 #define SUA_ASS_NO_ERROR 0
@ -337,12 +365,14 @@ typedef struct {
#define SUA_PATH_NO_DEST_ADDR_PRESENT 1 #define SUA_PATH_NO_DEST_ADDR_PRESENT 1
unsigned int sua_getPath( unsigned int assoc_id, unsigned int sua_getPath( unsigned int assoc_id,
sua_Path_str &pathinfo sua_Path_str &pathinfo
); );
#define SUA_TERM_NO_ERROR 0 #define SUA_TERM_NO_ERROR 0
#define SUA_TERM_NO_DEST_ADDR_PRESENT 1 #define SUA_TERM_NO_DEST_ADDR_PRESENT 1
unsigned int sua_shutdown();
unsigned int sua_terminate(); unsigned int sua_terminate();

View File

@ -15,9 +15,9 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_adapt.cpp,v 1.2 2002/02/15 16:19:46 p82609 Exp $ * $Id: sua_adapt.cpp,v 1.5 2002/11/12 11:02:49 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 13.
* *
* Author(s): Lode Coene * Author(s): Lode Coene
* *
@ -87,25 +87,31 @@
#include <arpa/inet.h> #include <arpa/inet.h>
using namespace std; using namespace std;
/* definition of SUA local object and of remote object */
db_Sua_LocalList local_sua; /* definition of SUA database objects */
db_Sua_RemoteList remote_sua; db_Sua_DatabaseList sua;
db_Sua_AssociationList Assoc_sua;
db_Sua_NameList NameDB_sua;
db_Sua_ASList ApplicServ_sua;
/***********************************************************************/ /***********************************************************************/
/* sua_initialisation */ /* sua_initialisation */
/***********************************************************************/ /***********************************************************************/
void sua_initialisation() void sua_initialisation()
{ {
int res; int res;
SCTP_LibraryParameters params;
cout << "Initialising SCTP & SUA\n "; cout << "Initialising SCTP & SUA\n ";
res = sctp_initLibrary(); res = sctp_initLibrary();
/* set checksum to CRC32C */
sctp_getLibraryParameters(&params);
params.checksumAlgorithm = SCTP_CHECKSUM_ALGORITHM_CRC32C;
params.supportPRSCTP = 0;
sctp_setLibraryParameters(&params);
init_logging_file(); init_logging_file();
local_sua.initialize(); sua.local_sua.initialize();
remote_sua.initialize(); sua.remote_sua.initialize();
Assoc_sua.initialize(); sua.AssocDB.initialize();
cout << "Finished initialising SUA data\n "; cout << "Finished initialising SUA data\n ";
} /* end of sua_initialisation */ } /* end of sua_initialisation */
@ -119,12 +125,13 @@ unsigned int sua_read_config_file( char *pConfFile)
string sua_filename; string sua_filename;
sua_filename = pConfFile; sua_filename = pConfFile;
result = read_sua_file( sua_filename, result = read_sua_file( sua_filename,
local_sua, sua.local_sua,
remote_sua, sua.remote_sua,
Assoc_sua, sua.AssocDB,
NameDB_sua, sua.NameDB,
ApplicServ_sua sua.ApplicServ
); );
return(result); return(result);
} }
@ -146,12 +153,12 @@ unsigned int sua_registerInstance ( short local_ssn,
SCTPCallbackFunctions.communicationErrorNotif = &sctp_CommunicationErrorNotif; SCTPCallbackFunctions.communicationErrorNotif = &sctp_CommunicationErrorNotif;
SCTPCallbackFunctions.restartNotif = &sctp_RestartNotif; SCTPCallbackFunctions.restartNotif = &sctp_RestartNotif;
SCTPCallbackFunctions.shutdownCompleteNotif = &sctp_ShutDownCompleteNotif; SCTPCallbackFunctions.shutdownCompleteNotif = &sctp_ShutDownCompleteNotif;
result = Assoc_sua.register_instance ( SCTPCallbackFunctions, result = sua.AssocDB.register_instance ( SCTPCallbackFunctions,
ulp_callback, ulp_callback,
local_sua sua.local_sua
); );
return(result); return(result);
} }
@ -162,9 +169,9 @@ unsigned int sua_registerInstance ( short local_ssn,
unsigned int sua_associate ( ) unsigned int sua_associate ( )
{ {
unsigned int result = SUA_ASS_NO_ERROR; unsigned int result = SUA_ASS_NO_ERROR;
result = Assoc_sua.associate_instance( local_sua, result = sua.AssocDB.associate_instance( sua.local_sua,
remote_sua sua.remote_sua
); );
return(result); return(result);
} }
@ -178,31 +185,75 @@ unsigned int sua_getPath( unsigned int assoc_id,
) )
{ {
unsigned int result = SUA_PATH_NO_ERROR; unsigned int result = SUA_PATH_NO_ERROR;
if ( Assoc_sua.instance[assoc_id].Dest.nr_of_addrs > 0) if ( sua.AssocDB.instance[assoc_id].Dest.nr_of_addrs > 0)
{ {
/*pathinfo.remote_addr.*/ /*pathinfo.remote_addr.*/
pathinfo.remote_addr.pc.ipvx = Assoc_sua.instance[assoc_id].Dest.addrs[0]; pathinfo.remote_addr.pc.ipvx = sua.AssocDB.instance[assoc_id].Dest.addrs[0];
/*pathinfo.remote_addr.pc.ss7 = Assoc_sua.instance[assoc_id].Dest.pc;*/
pathinfo.remote_addr.ssn = remote_sua.instance[Assoc_sua.instance[assoc_id].remote_sua_id].ssn.ssn; /*memcpy( pathinfo.remote_addr.pc.ipvx.ch, sua.AssocDB.instance[assoc_id].Dest.addrs[0].ch, 24);*/
pathinfo.ASP_status = Assoc_sua.instance[assoc_id].asp.status; pathinfo.remote_addr.pc.ss7 = sua.AssocDB.instance[assoc_id].Dest.pc;
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 #ifdef DEBUG
//cout << "remote ssn = " << pathinfo.remote_addr.ssn << "\n"; //cout << "remote ssn = " << pathinfo.remote_addr.ssn << "\n";
//cout << "remote sua_id = " << Assoc_sua.instance[assoc_id].remote_sua_id << "\n"; //cout << "remote sua_id = " << sua.AssocDB.instance[assoc_id].remote_sua_id << "\n";
#endif #endif
} }
else else
result = SUA_PATH_NO_DEST_ADDR_PRESENT; result = SUA_PATH_NO_DEST_ADDR_PRESENT;
pathinfo.local_addr.pc.ipvx = Assoc_sua.instance[assoc_id].Source.addrs[0];
pathinfo.local_addr.pc.ss7 = Assoc_sua.instance[assoc_id].Source.pc; pathinfo.local_addr.pc.ipvx.ch = sua.AssocDB.instance[assoc_id].Source.addrs[0].ch;
pathinfo.local_addr.ssn = local_sua.instance[Assoc_sua.instance[assoc_id].local_sua_id].ssn.ssn;
/*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.ssn = sua.local_sua.instance[sua.AssocDB.instance[assoc_id].local_sua_id].ssn.ssn;
return (result);
}
/***********************************************************************/
/* get destination pointcode address */
/***********************************************************************/
pointcode_str get_destpc_addr( unsigned int sua_id)
{
pointcode_str pc;
pc.ipvx = sua.AssocDB.instance[sua_id].Dest.addrs[0];
pc.ss7 = sua.AssocDB.instance[sua_id].Dest.pc;
return(pc);
}
/***********************************************************************/
/* get source pointcode address */
/***********************************************************************/
pointcode_str get_sourcepc_addr( unsigned int sua_id)
{
pointcode_str pc;
pc.ipvx = sua.AssocDB.instance[sua_id].Source.addrs[0];
pc.ss7 = sua.AssocDB.instance[sua_id].Source.pc;
return(pc);
}
/***********************************************************************/
/* sua_shutdown */
/***********************************************************************/
unsigned int sua_shutdown( )
{
unsigned int result = SUA_TERM_NO_ERROR;
sua.AssocDB.shutdown();
return (result); return (result);
} }
/***********************************************************************/ /***********************************************************************/
/* sua_terminate */ /* sua_terminate */
/***********************************************************************/ /***********************************************************************/
@ -210,7 +261,7 @@ unsigned int sua_terminate( )
{ {
unsigned int result = SUA_TERM_NO_ERROR; unsigned int result = SUA_TERM_NO_ERROR;
Assoc_sua.shutdown(); sua.AssocDB.shutdown();
close_logging_file(); close_logging_file();
return (result); return (result);

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_adapt.h,v 1.1.1.1 2002/02/04 14:30:41 p82609 Exp $ * $Id: sua_adapt.h,v 1.2 2002/11/12 11:02:49 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 6.
* *
@ -49,6 +49,7 @@
* - Nope * - Nope
*/ */
#include "sua.h"
#include "sua_database.h" #include "sua_database.h"
#ifdef LINUX #ifdef LINUX
@ -70,8 +71,8 @@
using namespace std; 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 // end of module sua_adapt.h

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_asp_mgnt.cpp,v 1.1.1.1 2002/02/04 14:30:41 p82609 Exp $ * $Id: sua_asp_mgnt.cpp,v 1.3 2002/11/12 11:02:49 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 6.
* *
@ -79,12 +79,13 @@
#include "sua_tcb.h" #include "sua_tcb.h"
#include <cstdio> #include <cstdio>
#include <iostream>
#include <string> #include <string>
extern db_Sua_LocalList local_sua; using namespace std;
extern db_Sua_RemoteList remote_sua;
extern db_Sua_AssociationList Assoc_sua; extern db_Sua_DatabaseList sua;
extern db_Sua_ASList ApplicServ_sua;
extern tcb_Sua_msgqueue_pool msg_store; extern tcb_Sua_msgqueue_pool msg_store;
/***********************************************************************/ /***********************************************************************/
@ -121,7 +122,7 @@ int sua_send_ASPUP( unsigned int Sua_assoc_id
delivery_type = SCTP_UNORDERED_DELIVERY; delivery_type = SCTP_UNORDERED_DELIVERY;
sctp_assoc_id = Assoc_sua.instance[Sua_assoc_id].SCTP_assoc_id; sctp_assoc_id = sua.AssocDB.instance[Sua_assoc_id].SCTP_assoc_id;
/* does association exist? */ /* does association exist? */
if (sctp_assoc_id > 0) if (sctp_assoc_id > 0)
@ -198,7 +199,7 @@ int sua_send_ASPUP_ACK( unsigned int Sua_assoc_id,
delivery_type = SCTP_UNORDERED_DELIVERY; delivery_type = SCTP_UNORDERED_DELIVERY;
sctp_assoc_id = Assoc_sua.instance[Sua_assoc_id].SCTP_assoc_id; sctp_assoc_id = sua.AssocDB.instance[Sua_assoc_id].SCTP_assoc_id;
/* does association exist? */ /* does association exist? */
if (sctp_assoc_id > 0) if (sctp_assoc_id > 0)
@ -268,7 +269,7 @@ int sua_send_ASPDOWN_ACK( unsigned int Sua_assoc_id
delivery_type = SCTP_UNORDERED_DELIVERY; delivery_type = SCTP_UNORDERED_DELIVERY;
sctp_assoc_id = Assoc_sua.instance[Sua_assoc_id].SCTP_assoc_id; sctp_assoc_id = sua.AssocDB.instance[Sua_assoc_id].SCTP_assoc_id;
/* does association exist? */ /* does association exist? */
if (sctp_assoc_id > 0) if (sctp_assoc_id > 0)
@ -338,7 +339,7 @@ int sua_send_BEAT( unsigned int Sua_assoc_id
delivery_type = SCTP_UNORDERED_DELIVERY; delivery_type = SCTP_UNORDERED_DELIVERY;
sctp_assoc_id = Assoc_sua.instance[Sua_assoc_id].SCTP_assoc_id; sctp_assoc_id = sua.AssocDB.instance[Sua_assoc_id].SCTP_assoc_id;
/* does association exist? */ /* does association exist? */
if (sctp_assoc_id > 0) if (sctp_assoc_id > 0)
@ -412,7 +413,7 @@ int sua_send_BEAT_ACK( unsigned int Sua_assoc_id,
delivery_type = SCTP_UNORDERED_DELIVERY; delivery_type = SCTP_UNORDERED_DELIVERY;
sctp_assoc_id = Assoc_sua.instance[Sua_assoc_id].SCTP_assoc_id; sctp_assoc_id = sua.AssocDB.instance[Sua_assoc_id].SCTP_assoc_id;
/* does association exist? */ /* does association exist? */
if (sctp_assoc_id > 0) if (sctp_assoc_id > 0)
@ -476,9 +477,10 @@ int sua_send_ASPAC( unsigned int Sua_assoc_id
msg.sua_prim.hdr_msg_type.asptm = asptm_act; msg.sua_prim.hdr_msg_type.asptm = asptm_act;
/* traffic mode is optional mandatory */ /* traffic mode is optional mandatory */
msg.sua_prim.traf_mode_pres = TRUE; msg.sua_prim.traf_mode_pres = TRUE;
msg.sua_prim.traf_mode = tmt_loadshare; msg.sua_prim.traf_mode = tmt_override;
/* rest is optional */ /* rest is optional */
msg.sua_prim.rout_con_pres = FALSE; msg.sua_prim.rout_con_pres = TRUE;
msg.sua_prim.rout_con = 1;
msg.sua_prim.info_pres = FALSE; msg.sua_prim.info_pres = FALSE;
// encode the SUA unitdata message // encode the SUA unitdata message
@ -487,7 +489,7 @@ int sua_send_ASPAC( unsigned int Sua_assoc_id
delivery_type = SCTP_UNORDERED_DELIVERY; delivery_type = SCTP_UNORDERED_DELIVERY;
sctp_assoc_id = Assoc_sua.instance[Sua_assoc_id].SCTP_assoc_id; sctp_assoc_id = sua.AssocDB.instance[Sua_assoc_id].SCTP_assoc_id;
/* does association exist? */ /* does association exist? */
if (sctp_assoc_id > 0) if (sctp_assoc_id > 0)
@ -571,7 +573,7 @@ int sua_send_ASPAC_ACK( unsigned int Sua_assoc_id,
delivery_type = SCTP_UNORDERED_DELIVERY; delivery_type = SCTP_UNORDERED_DELIVERY;
sctp_assoc_id = Assoc_sua.instance[Sua_assoc_id].SCTP_assoc_id; sctp_assoc_id = sua.AssocDB.instance[Sua_assoc_id].SCTP_assoc_id;
/* does association exist? */ /* does association exist? */
if (sctp_assoc_id > 0) if (sctp_assoc_id > 0)
@ -617,7 +619,9 @@ int sua_send_ASPAC_ACK( unsigned int Sua_assoc_id,
/***********************************************************************/ /***********************************************************************/
/* sua_send_ASPINAC_ACK */ /* sua_send_ASPINAC_ACK */
/***********************************************************************/ /***********************************************************************/
int sua_send_ASPINAC_ACK( unsigned int Sua_assoc_id int sua_send_ASPINAC_ACK( unsigned int Sua_assoc_id,
boolean routing_context_present,
uint32_t routing_context
) )
{ {
Sua_container msg; Sua_container msg;
@ -634,7 +638,8 @@ int sua_send_ASPINAC_ACK( unsigned int Sua_assoc_id
// fill in the main sua header // fill in the main sua header
msg.sua_prim.hdr_msg_class = sua_asptm; msg.sua_prim.hdr_msg_class = sua_asptm;
msg.sua_prim.hdr_msg_type.asptm = asptm_inact_ack; msg.sua_prim.hdr_msg_type.asptm = asptm_inact_ack;
msg.sua_prim.rout_con_pres = FALSE; msg.sua_prim.rout_con_pres = routing_context_present;
msg.sua_prim.rout_con = routing_context;
msg.sua_prim.info_pres = FALSE; msg.sua_prim.info_pres = FALSE;
// encode the SUA unitdata message // encode the SUA unitdata message
@ -643,7 +648,7 @@ int sua_send_ASPINAC_ACK( unsigned int Sua_assoc_id
delivery_type = SCTP_UNORDERED_DELIVERY; delivery_type = SCTP_UNORDERED_DELIVERY;
sctp_assoc_id = Assoc_sua.instance[Sua_assoc_id].SCTP_assoc_id; sctp_assoc_id = sua.AssocDB.instance[Sua_assoc_id].SCTP_assoc_id;
/* does association exist? */ /* does association exist? */
if (sctp_assoc_id > 0) if (sctp_assoc_id > 0)
@ -704,7 +709,7 @@ int process_ASPUP_msg ( unsigned int sua_assoc_id,
cout << "sua_asp_mgnt.c:ASPUP received, send back a ASPUP_ACK and set state to ASP-INACTIVE.\n"; cout << "sua_asp_mgnt.c:ASPUP received, send back a ASPUP_ACK and set state to ASP-INACTIVE.\n";
#endif #endif
Assoc_sua.up(sua_assoc_id,0); sua.AssocDB.up(sua_assoc_id,0);
error_value = sua_send_ASPUP_ACK( sua_assoc_id , error_value = sua_send_ASPUP_ACK( sua_assoc_id ,
sua_asp_msg.sua_prim.ASP_id_pres, sua_asp_msg.sua_prim.ASP_id_pres,
@ -712,7 +717,15 @@ int process_ASPUP_msg ( unsigned int sua_assoc_id,
); );
#ifdef DEBUG #ifdef DEBUG
cout << "sua_asp_mgnt.c:result send ASPUP_ACK = "<< error_value << "\n"; cout << "sua_asp_mgnt.c:result send ASPUP_ACK = "<< error_value << "\n";
cout << "sua_asp_mgnt.c:ASPUP processing state = "<< Assoc_sua.instance[sua_assoc_id].asp.status << "\n"; cout << "sua_asp_mgnt.c:ASPUP processing state = "<< sua.AssocDB.instance[sua_assoc_id].asp.status << "\n";
#endif
#ifdef IPSP_SINGLE
error_value = sua_send_ASPAC( sua_assoc_id );
#ifdef DEBUG
cout << "sua_asp_mgnt.c:result send ASPAC = "<< error_value << "\n";
cout << "sua_asp_mgnt.c:ASPAC processing state = "<< sua.AssocDB.instance[sua_assoc_id].asp.status << "\n";
#endif
#endif #endif
return(error_value); return(error_value);
@ -732,14 +745,18 @@ int process_ASPUP_ACK_msg ( unsigned int sua_assoc_id,
cout << "sua_asp_mgnt.c:ASPUP_ACK received, looks like remote is inactive.\n"; cout << "sua_asp_mgnt.c:ASPUP_ACK received, looks like remote is inactive.\n";
#endif #endif
Assoc_sua.up(sua_assoc_id,0); sua.AssocDB.up(sua_assoc_id,0);
#ifndef IPSP_SINGLE
/* send activation to remote */ /* send activation to remote */
error_value = sua_send_ASPAC( sua_assoc_id ); error_value = sua_send_ASPAC( sua_assoc_id );
#ifdef DEBUG #ifdef DEBUG
cout << "sua_asp_mgnt.c:result send ASPAC = "<< error_value << "\n"; cout << "sua_asp_mgnt.c:result send ASPAC = "<< error_value << "\n";
cout << "sua_asp_mgnt.c:ASPUP_ACK processing state = "<< Assoc_sua.instance[sua_assoc_id].asp.status << "\n"; cout << "sua_asp_mgnt.c:ASPUP_ACK processing state = "<< sua.AssocDB.instance[sua_assoc_id].asp.status << "\n";
#endif #endif
#endif
return(error_value); return(error_value);
} }
@ -759,7 +776,7 @@ int process_ASPDOWN_msg ( unsigned int sua_assoc_id,
cout << "sua_asp_mgnt.c:ASPDOWN received, send back a ASPDOWN_ACK and set state to ASP-DOWN.\n"; cout << "sua_asp_mgnt.c:ASPDOWN received, send back a ASPDOWN_ACK and set state to ASP-DOWN.\n";
#endif #endif
Assoc_sua.down(sua_assoc_id,0); sua.AssocDB.down(sua_assoc_id,0);
error_value = sua_send_ASPDOWN_ACK( sua_assoc_id ); error_value = sua_send_ASPDOWN_ACK( sua_assoc_id );
@ -784,7 +801,7 @@ int process_ASPDOWN_ACK_msg ( unsigned int sua_assoc_id,
cout << "sua_asp_mgnt.c:ASPDOWN_ACK received, remote looks down.\n"; cout << "sua_asp_mgnt.c:ASPDOWN_ACK received, remote looks down.\n";
#endif #endif
Assoc_sua.down(sua_assoc_id,0); sua.AssocDB.down(sua_assoc_id,0);
return(error_value); return(error_value);
} }
@ -853,10 +870,10 @@ int process_ASPAC_msg ( unsigned int sua_assoc_id,
#endif #endif
if (sua_asp_msg.sua_prim.traf_mode_pres) if (sua_asp_msg.sua_prim.traf_mode_pres)
holdtraffic_pres = Assoc_sua.activate(sua_assoc_id, holdtraffic_pres = sua.AssocDB.activate(sua_assoc_id,
sua_asp_msg.sua_prim.traf_mode); sua_asp_msg.sua_prim.traf_mode);
else else
holdtraffic_pres = Assoc_sua.activate(sua_assoc_id,0); holdtraffic_pres = sua.AssocDB.activate(sua_assoc_id,0);
error_value = sua_send_ASPAC_ACK( sua_assoc_id, error_value = sua_send_ASPAC_ACK( sua_assoc_id,
sua_asp_msg.sua_prim.traf_mode_pres, sua_asp_msg.sua_prim.traf_mode_pres,
@ -867,7 +884,7 @@ int process_ASPAC_msg ( unsigned int sua_assoc_id,
#ifdef DEBUG #ifdef DEBUG
cout << "sua_asp_mgnt.c:result ASPAC_ACK send = "<< error_value << "\n"; cout << "sua_asp_mgnt.c:result ASPAC_ACK send = "<< error_value << "\n";
cout << "sua_asp_mgnt.c:ASPAC processing state = "<< Assoc_sua.instance[sua_assoc_id].asp.status << "\n"; cout << "sua_asp_mgnt.c:ASPAC processing state = "<< sua.AssocDB.instance[sua_assoc_id].asp.status << "\n";
#endif #endif
if (holdtraffic_pres) if (holdtraffic_pres)
@ -886,7 +903,7 @@ int process_ASPAC_msg ( unsigned int sua_assoc_id,
/* msg retrieved and copied, may now remove it from queue */ /* msg retrieved and copied, may now remove it from queue */
msg_store.delete_msg ( sua_assoc_id ); msg_store.delete_msg ( sua_assoc_id );
sctp_assoc_id = Assoc_sua.instance[sua_assoc_id].SCTP_assoc_id; sctp_assoc_id = sua.AssocDB.instance[sua_assoc_id].SCTP_assoc_id;
#ifdef DEBUG #ifdef DEBUG
display_byte_array(databuf , sua_msg.byte.length()); display_byte_array(databuf , sua_msg.byte.length());
@ -933,14 +950,14 @@ int process_ASPAC_ACK_msg ( unsigned int sua_assoc_id,
int error_value = 0; int error_value = 0;
bool holdtraffic_pres = FALSE; bool holdtraffic_pres = FALSE;
#ifdef SG_ASP_MODE /*#ifdef SG_ASP_MODE*/
if (sua_asp_msg.sua_prim.traf_mode_pres) if (sua_asp_msg.sua_prim.traf_mode_pres)
holdtraffic_pres = Assoc_sua.activate(sua_assoc_id, holdtraffic_pres = sua.AssocDB.activate(sua_assoc_id,
sua_asp_msg.sua_prim.traf_mode); sua_asp_msg.sua_prim.traf_mode);
else else
holdtraffic_pres = Assoc_sua.activate(sua_assoc_id,0); holdtraffic_pres = sua.AssocDB.activate(sua_assoc_id,0);
#endif /*#endif*/
#ifdef DEBUG #ifdef DEBUG
cout << "sua_asp_mgnt.c:ASPAC_ACK received, nothing further to do.\n"; cout << "sua_asp_mgnt.c:ASPAC_ACK received, nothing further to do.\n";
@ -963,9 +980,12 @@ int process_ASPINAC_msg ( unsigned int sua_assoc_id,
#ifdef DEBUG #ifdef DEBUG
cout << "sua_asp_mgnt.c:ASPINAC received, send back a ASPINAC_ACK and set state to ASP-INACTIVE.\n"; cout << "sua_asp_mgnt.c:ASPINAC received, send back a ASPINAC_ACK and set state to ASP-INACTIVE.\n";
#endif #endif
Assoc_sua.deactivate(sua_assoc_id,0); sua.AssocDB.deactivate(sua_assoc_id,0);
error_value = sua_send_ASPINAC_ACK( sua_assoc_id ); error_value = sua_send_ASPINAC_ACK( sua_assoc_id,
sua_asp_msg.sua_prim.rout_con_pres,
sua_asp_msg.sua_prim.rout_con
);
#ifdef DEBUG #ifdef DEBUG
cout << "sua_asp_mgnt.c:result ASPINAC_ACK send = "<< error_value << "\n"; cout << "sua_asp_mgnt.c:result ASPINAC_ACK send = "<< error_value << "\n";
#endif #endif
@ -997,20 +1017,26 @@ void Asp_mngt_standby ( unsigned int sua_AS_id,
short mode short mode
) )
{ {
ApplicServ_sua.override_ASP( sua_asp_id, sua.ApplicServ.override_ASP( sua_asp_id,
sua_AS_id, sua_AS_id,
mode mode
); );
} }
/***********************************************************************/
/* Asp_activate_override */
/***********************************************************************/
void asp_activate_override ( unsigned int asp_sua_assoc_id ) void asp_activate_override ( unsigned int asp_sua_assoc_id )
{ {
Assoc_sua.activate(asp_sua_assoc_id,0); sua.AssocDB.activate(asp_sua_assoc_id,0);
} }
/***********************************************************************/
/* Asp_asp_deactivate */
/***********************************************************************/
void asp_deactivate ( unsigned int asp_sua_assoc_id) void asp_deactivate ( unsigned int asp_sua_assoc_id)
{ {
Assoc_sua.deactivate(asp_sua_assoc_id,0); sua.AssocDB.deactivate(asp_sua_assoc_id,0);
} }

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_cl.h,v 1.2 2002/03/01 12:57:38 p82609 Exp $ * $Id: sua_cl.h,v 1.4 2002/04/08 15:28:06 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 6.
* *
@ -48,9 +48,9 @@
* - send a SUA message to SCTP * - send a SUA message to SCTP
* - route/relay a received SUA msg towards to the correct SCTP association * - route/relay a received SUA msg towards to the correct SCTP association
* - send a Unitdata msg to remote node * - send a Unitdata msg to remote node
* (- send a Unitdata Service msg to remote node) * - send a Unitdata Service msg to remote node
* - Process a Unitdata msg * - Process a Unitdata msg
* (- Process a Unitdata Service msg) * - Process a Unitdata Service msg
*/ */
#ifndef SUA_CL_H #ifndef SUA_CL_H
@ -92,12 +92,24 @@ int sua_send_Unitdata( sccp_QOS_str &QOS,
char *buffer, char *buffer,
unsigned int len 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
);
short process_unitdata_msg ( int local_sua_id, short process_unitdata_msg ( int local_sua_id,
unsigned int sua_assoc_id, unsigned int sua_assoc_id,
Sua_container &sua_msg Sua_container &sua_msg
); );
short process_UDTService_msg ( int local_sua_id,
unsigned int sua_assoc_id,
Sua_container &sua_msg
);
#endif // SUA_CL_H #endif // SUA_CL_H
// end of module sua_cl.h // end of module sua_cl.h

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_database.cpp,v 1.1.1.1 2002/02/04 14:30:41 p82609 Exp $ * $Id: sua_database.cpp,v 1.2 2002/10/30 16:04:09 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 6.
* *
@ -155,58 +155,58 @@ void db_Sua_AddressObject::read_addr_param(string address_str){
#ifdef DEBUG #ifdef DEBUG
cout << "address = " << address_str << " len = " <<address_str.length() << "\n"; cout << "address = " << address_str << " len = " <<address_str.length() << "\n";
#endif #endif
while ((i <= address_str.length())) while ((i <= address_str.length()))
{ {
if (address_str[i] == '.') count_punct++; if (address_str[i] == '.') count_punct++;
if (address_str[i] == ':') count_colon++; if (address_str[i] == ':') count_colon++;
if ((address_str[i] == ',') || (i == address_str.length())) if ((address_str[i] == ',') || (i == address_str.length()))
{ {
len = i - b; len = i - b;
string dest(address_str,b,len); string dest(address_str,b,len);
tokstr_len = dest.length()+1; tokstr_len = dest.length()+1;
tokstr = new char[tokstr_len]; tokstr = new char[tokstr_len];
dest.copy(tokstr,dest.length()); dest.copy(tokstr,dest.length());
// we are dealing with char arrays, so.... // we are dealing with char arrays, so....
tokstr[dest.length()] = '\0'; tokstr[dest.length()] = '\0';
short k; short k;
for(k=0; k < tokstr_len; k++) for(k=0; k < tokstr_len; k++)
address_string[nr_of_addrs][k] = tokstr[k]; address_string[nr_of_addrs][k] = tokstr[k];
if (count_punct == 3) if (count_punct == 3)
{ // IPv4 address parameters { // IPv4 address parameters
addrs[nr_of_addrs].sa.sa_family = AF_INET; addrs[nr_of_addrs].sa.sa_family = AF_INET;
addrs[nr_of_addrs].sin.sin_port = SUA_PORT; addrs[nr_of_addrs].sin.sin_port = SUA_PORT;
result = inet_pton(AF_INET, tokstr,&addrs[nr_of_addrs].sin.sin_addr); result = inet_pton(AF_INET, tokstr,&addrs[nr_of_addrs].sin.sin_addr);
if (result != 1) if (result != 1)
cout << "IPvx address conversion returned "<< result << " \n"; cout << "IPvx address conversion returned "<< result << " \n";
#ifdef DEBUG #ifdef DEBUG
cout << "IPv4 = " << addrs[nr_of_addrs].sin.sin_addr.s_addr << " \n"; cout << "IPv4 = " << addrs[nr_of_addrs].sin.sin_addr.s_addr << " \n";
#endif #endif
} }
if (count_colon >= 2) if (count_colon >= 2)
{ // IPv6 address parameters { // IPv6 address parameters
addrs[nr_of_addrs].sa.sa_family = AF_INET6; addrs[nr_of_addrs].sa.sa_family = AF_INET6;
addrs[nr_of_addrs].sin6.sin6_port = SUA_PORT; addrs[nr_of_addrs].sin6.sin6_port = SUA_PORT;
result = inet_pton(AF_INET6, tokstr,&addrs[nr_of_addrs].sin6.sin6_addr); result = inet_pton(AF_INET6, tokstr,&addrs[nr_of_addrs].sin6.sin6_addr);
if (result != 1) if (result != 1)
cout << "IPvx address conversion returned "<< result << " \n"; cout << "IPvx address conversion returned "<< result << " \n";
#ifdef DEBUG #ifdef DEBUG
cout << "IPv6 = " << &addrs[nr_of_addrs].sin6.sin6_addr << " \n"; cout << "IPv6 = " << &addrs[nr_of_addrs].sin6.sin6_addr << " \n";
#endif #endif
} }
nr_of_addrs++; nr_of_addrs++;
b = i + 1; b = i + 1;
count_punct = 0; count_punct = 0;
count_colon = 0; count_colon = 0;
} }
i++; i++;
} }
#ifdef DEBUG #ifdef DEBUG
cout << "number of address = " << nr_of_addrs << " \n"; cout << "number of address = " << nr_of_addrs << " \n";
#endif #endif

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_database.h,v 1.4 2002/03/01 12:57:38 p82609 Exp $ * $Id: sua_database.h,v 1.8 2002/11/12 11:02:49 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 8. * SUA implementation according to SUA draft issue 8.
* *
@ -172,6 +172,60 @@ class db_Sua_AddressObject {
void read_port_num(string port); void read_port_num(string port);
}; ///:~ }; ///:~
/***********************************************************************/
/* Sua_GlobalTitleObject */
/***********************************************************************/
class db_Sua_GlobalTitle {
public:
short Translation_Type;
short Numbering_Plan;
short Nature_of_Address;
/*short nr_of_digits;*/
string digits;
}; ///:~
/***********************************************************************/
/* Sua_NameObject */
/***********************************************************************/
class db_Sua_NameObject {
public:
unsigned int SUA_assoc_id;
unsigned int sctp_assoc_id;
db_Sua_GlobalTitle GT;
string hostname;
public:
void initialize();
}; ///:~
/***********************************************************************/
/* Sua_NameList */
/***********************************************************************/
class db_Sua_NameList{
public:
int num_of_instance;
db_Sua_NameObject instance[db_MAX_REMOTE_SUA];
public:
void initialize();
string read_host_name( unsigned int sua_assoc_id,
string name
);
void read_Global_Title( unsigned int sua_assoc_id,
string name
);
signed int resolve_host_name( hostname_str& dest_name,
pointcode_str& dest_pc
);
signed int perform_GTT( global_title_str& cld_in,
global_title_str& clg_in,
global_title_str& cld_out,
global_title_str& clg_out,
pointcode_str& dest_pc
);
void increase_instance();
}; ///:~
/***********************************************************************/ /***********************************************************************/
/* Sua_ApplicationServerProcessObject (ASP) */ /* Sua_ApplicationServerProcessObject (ASP) */
/***********************************************************************/ /***********************************************************************/
@ -285,6 +339,15 @@ class db_Sua_AssociationList{
void read_Dest_pointcode(string address); void read_Dest_pointcode(string address);
void read_Source_port(string port); void read_Source_port(string port);
void read_Dest_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); void read_stream_number(string stream_num);
short register_instance(SCTP_ulp_Callbacks APLCallbackFunctions, short register_instance(SCTP_ulp_Callbacks APLCallbackFunctions,
Sua_ULP_CallBacks SUACallbackFunctions, Sua_ULP_CallBacks SUACallbackFunctions,
@ -295,8 +358,6 @@ class db_Sua_AssociationList{
unsigned int &Local_sua_id, unsigned int &Local_sua_id,
unsigned int &Remote_sua_id unsigned int &Remote_sua_id
); );
unsigned int Find_local_sua( sccp_addr_str& local_address
);
short associate_instance( db_Sua_LocalList& local_sua, short associate_instance( db_Sua_LocalList& local_sua,
db_Sua_RemoteList& remote_sua db_Sua_RemoteList& remote_sua
); );
@ -317,72 +378,68 @@ class db_Sua_AssociationList{
); );
short Terminate_remote_assoc_instance(); short Terminate_remote_assoc_instance();
short shutdown(); short shutdown();
signed int resolve_host_name( hostname_str& dest_name,
pointcode_str& dest_pc
);
signed int route_msg( sccp_addr_str& cld,
sccp_addr_str& clg,
int& sua_assoc_id
);
signed int route_on_IPpc ( ipvxunion& dest_pc, signed int route_on_IPpc ( ipvxunion& dest_pc,
ipvxunion& org_pc, ipvxunion& org_pc,
int& sua_assoc_id int& sua_assoc_id
); );
signed int route_on_SS7pc ( SS7union& dest_pc, signed int route_on_SS7pc ( SS7union& dest_pc,
SS7union& org_pc, SS7union& org_pc,
int& sua_assoc_id int& sua_assoc_id
); );
signed int route_on_GTname ( hostname_str& dest_name,
hostname_str& org_name,
int& sua_assoc_id,
pointcode_str& dest_pc,
pointcode_str& org_pc
);
void increase_instance(); void increase_instance();
bool activate( unsigned int sua_id, bool activate( unsigned int sua_id,
short mode short mode
); );
void deactivate( unsigned int sua_id, void deactivate( unsigned int sua_id,
short mode short mode
); );
void down( unsigned int sua_id, void down( unsigned int sua_id,
short mode short mode
); );
void up( unsigned int sua_id, void up( unsigned int sua_id,
short mode short mode
); );
}; ///:~ }; ///:~
/***********************************************************************/
/* Sua_NameObject */
/***********************************************************************/
class db_Sua_NameObject {
public:
unsigned int SUA_assoc_id;
public:
void initialize();
}; ///:~
/***********************************************************************/ /***********************************************************************/
/* Sua_NameList */ /* Sua_DatabaseList */
/***********************************************************************/ /***********************************************************************/
class db_Sua_NameList{ class db_Sua_DatabaseList{
public: public:
int num_of_instance; db_Sua_LocalList local_sua;
db_Sua_NameObject instance[db_MAX_REMOTE_SUA]; db_Sua_RemoteList remote_sua;
public: db_Sua_AssociationList AssocDB;
void initialize(); db_Sua_NameList NameDB;
string read_host_name(string name); db_Sua_ASList ApplicServ;
string read_Global_Title(string name); public:
unsigned int perform_GTT( sccp_addr_str& cld_in, unsigned int Find_local_sua( sccp_addr_str& local_address
sccp_addr_str& clg_in, );
sccp_addr_str& cld_out, unsigned int Dynamic_Associate( sccp_addr_str& cld,
sccp_addr_str& clg_out sccp_addr_str& clg,
unsigned short nr_of_dest_addr,
unsigned short nr_of_input_streams,
unsigned short nr_of_output_streams
);
signed int route_on_GTname ( hostname_str& dest_name,
hostname_str& org_name,
int& sua_assoc_id,
pointcode_str& dest_pc,
pointcode_str& org_pc
);
signed int route_on_GTT( global_title_str& dest_GT,
global_title_str& org_GT,
int& sua_assoc_id,
pointcode_str& dest_pc,
pointcode_str& org_pc
); );
void increase_instance(); signed int route_msg( sccp_addr_str& cld,
sccp_addr_str& clg,
int& sua_assoc_id
);
}; ///:~ }; ///:~
#endif // SUA_DATABASE_H #endif // SUA_DATABASE_H
//end of module sua_database.h //end of module sua_database.h

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_dataname.cpp,v 1.2 2002/03/01 12:57:38 p82609 Exp $ * $Id: sua_dataname.cpp,v 1.6 2002/11/12 11:04:12 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 6.
* *
@ -53,7 +53,10 @@
* - initialise Name * - initialise Name
* SUA Name List: * SUA Name List:
* - initialise Name List * - initialise Name List
* - read hostname * - read hostname
* - read global title
* - resolve hostname
* - perform Global Title Translation
*/ */
#include "sctp.h" #include "sctp.h"
@ -62,6 +65,7 @@
#include "sua_database.h" #include "sua_database.h"
#include "sua_asp_mgnt.h" #include "sua_asp_mgnt.h"
#include "sua_logging.h" #include "sua_logging.h"
#include "sua_adapt.h"
#include <cstdio> #include <cstdio>
#include <iostream> #include <iostream>
@ -84,7 +88,15 @@ using namespace std;
void db_Sua_NameObject::initialize(){ void db_Sua_NameObject::initialize(){
// initialise to point to a invalid SUA association // initialise to point to a invalid SUA association
SUA_assoc_id = 0; SUA_assoc_id = 0;
sctp_assoc_id = 0;
GT.Translation_Type = 0;
GT.Numbering_Plan = 0;
GT.Nature_of_Address = 0;
/* initialise to empty string */
GT.digits="";
hostname = "";
} }
@ -107,7 +119,9 @@ void db_Sua_NameList::initialize(){
/***********************************************************************/ /***********************************************************************/
/* Sua_NameList::read_host_name */ /* Sua_NameList::read_host_name */
/***********************************************************************/ /***********************************************************************/
string db_Sua_NameList::read_host_name(string name){ string db_Sua_NameList::read_host_name( unsigned int sua_assoc_id,
string name
){
char *hostname; char *hostname;
const char *ip_addr_ptr; const char *ip_addr_ptr;
@ -129,7 +143,7 @@ string db_Sua_NameList::read_host_name(string name){
#ifdef DEBUG #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 #endif
pptr = hptr->h_addr_list; pptr = hptr->h_addr_list;
for ( ; *pptr != NULL;pptr++) for ( ; *pptr != NULL;pptr++)
{ {
@ -143,30 +157,152 @@ string db_Sua_NameList::read_host_name(string name){
cout << ip_addr_ptr << "\n"; cout << ip_addr_ptr << "\n";
#endif #endif
} }
#ifdef DEBUG #ifdef DEBUG
cout << "output IP list = " << addr_str << "\n"; cout << "output IP list = " << addr_str << "\n";
#endif #endif
string name_str; instance[num_of_instance].SUA_assoc_id = sua_assoc_id;
int last= name.size();
unsigned int current = name.rfind('.'); instance[num_of_instance].hostname = name;
while(current != string::npos){
name_str = name_str + name.substr(current+1,(last-current)) + ".";
last= current - 1;
current = name.rfind('.', last);
}
name_str = name_str + name.substr(0,last+1);
#ifdef DEBUG
cout << "Ready for storing SUA dest hostname = " << name_str << " in NameDB\n";
#endif
return(addr_str); return(addr_str);
} }
/***********************************************************************/
/* Sua_NameList::read_Global_Title */
/***********************************************************************/
void db_Sua_NameList::read_Global_Title( unsigned int sua_assoc_id,
string gt
)
{
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;
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;
}
/***********************************************************************/
/* db_Sua_NameList::resolve_host_name */
/***********************************************************************/
signed int db_Sua_NameList::resolve_host_name ( hostname_str& dest_name,
pointcode_str& dest_pc
)
{
struct hostent *hptr;
char **pptr;
char str[INET6_ADDRSTRLEN];
char *dest_carr;
/* resolving can be done via: */
/* - local global Titel database */
/* - resolve hostname via DNS(simplest for single hop translations) */
dest_carr = dest_name;
if ((hptr = gethostbyname( dest_carr )) == NULL)
{
cout << "Hostname " << dest_name << " not known in DNS.\n";
return(-1);
}
#ifdef DEBUG
cout << "Hostname " << dest_name << " resolved to dest IP address(es)\n";
cout << "IP address length = "<< hptr->h_length << "\n";
#endif
/* initialise the length field of the structure: */
/* length field is NOT always present in every Unix like operating system */
dest_pc.ipvx.ch[0] = 0;
pptr = hptr->h_addr_list;
for ( ; (*pptr != NULL) ;pptr++)
{
inet_ntop(hptr->h_addrtype, *pptr, str,sizeof(str));
#ifdef DEBUG
cout << str << "\n";
#endif
/* got a IP address */
dest_pc.ipvx.sa.sa_family = hptr->h_addrtype;
if (dest_pc.ipvx.sa.sa_family == AF_INET)
inet_pton( AF_INET,
str,
&dest_pc.ipvx.sin.sin_addr
);
else if (dest_pc.ipvx.sa.sa_family == AF_INET6)
inet_pton( AF_INET6,
str,
&dest_pc.ipvx.sin6.sin6_addr
);
else
{
cout << "ERROR resolve_host_name: Unknown IP addresstype\n";
return(-2);
}
}
return(0);
};
/***********************************************************************/
/* db_Sua_NameList::resolve_GT */
/***********************************************************************/
signed int db_Sua_NameList::perform_GTT ( global_title_str& cld_in,
global_title_str& clg_in,
global_title_str& cld_out,
global_title_str& clg_out,
pointcode_str& dest_pc
)
{
boolean search_gt = true, gt_entry_found = false;
int i, found_gt_entry;
/* resolving can be done via: */
/* - local global Titel database */
i= 0;
while (search_gt){
gt_entry_found = ((instance[i].GT.Translation_Type == cld_in.Translation_Type) &&
(instance[i].GT.Numbering_Plan == cld_in.Numbering_Plan) &&
(instance[i].GT.Nature_of_Address == cld_in.Nature_of_Address) &&
(instance[i].GT.digits == cld_in.digits));
found_gt_entry = i;
/* next entry of name table */
i++;
}
if (gt_entry_found) {
/* get the association number from gt database */
dest_pc = get_destpc_addr(instance[found_gt_entry].SUA_assoc_id);
return(0);
}
else
return(-1);
};
// end of module sua_dataname.c // end of module sua_dataname.c

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_debug.h,v 1.2 2002/02/22 16:12:11 p82609 Exp $ * $Id: sua_debug.h,v 1.5 2002/11/12 11:02:49 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 6.
* *
@ -57,11 +57,12 @@
#ifndef SUA_DEBUG_H #ifndef SUA_DEBUG_H
#define SUA_DEBUG_H #define SUA_DEBUG_H
//#define DEBUG /* activates debuging msg on screen */ #define DEBUG /* activates debuging msg on screen */
//#define FILE_DEBUG /* activates debugging info to output file */ #define FILE_DEBUG /* activates debugging info to output file */
#define SUA_MANAGEMENT /* activates SUA management */ #define SUA_MANAGEMENT /* activates SUA management */
#define SG_ASP_MODE /* implementation acts as ASP towards a SG */ /*#define SG_ASP_MODE implementation acts as ASP towards a SG */
/*#define SG_MODE implementation acts as SG */
/*#define IPSP_SINGLE implementation acts in IPSP single mode */
#endif // SUA_DEBUG_H #endif // SUA_DEBUG_H

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_distribution.cpp,v 1.1.1.1 2002/02/04 14:30:41 p82609 Exp $ * $Id: sua_distribution.cpp,v 1.7 2002/11/12 11:02:49 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 6.
* *
@ -73,6 +73,8 @@
#include "sua_cl.h" #include "sua_cl.h"
#include "sua_co.h" #include "sua_co.h"
#include "sua_distribution.h" #include "sua_distribution.h"
#include "sua_asp_mgnt.h"
#include "sua_snm_mgnt.h"
#include <cstdio> #include <cstdio>
@ -92,21 +94,23 @@ Sua_container msg;
// storage for received SUA messages // storage for received SUA messages
vector<sua_save_str> rec_msg_pool; vector<sua_save_str> rec_msg_pool;
extern db_Sua_LocalList local_sua; extern db_Sua_DatabaseList sua;
extern db_Sua_RemoteList remote_sua;
extern db_Sua_AssociationList Assoc_sua;
extern tcb_Sua_TCB_arr tcb_pool; extern tcb_Sua_TCB_arr tcb_pool;
extern tcb_Sua_msgqueue_pool msg_store; extern tcb_Sua_msgqueue_pool msg_store;
/* cvs shit */
/***********************************************************************/ /***********************************************************************/
/* sctp_DataArriveNotif */ /* sctp_DataArriveNotif */
/***********************************************************************/ /***********************************************************************/
void sctp_DataArriveNotif( unsigned int sctp_assoc_id, void sctp_DataArriveNotif( unsigned int sctp_assoc_id,
unsigned int stream_id, unsigned int stream_id,
unsigned int len, unsigned int len,
unsigned int protocol_id, unsigned short data_streamSN,
unsigned int unordered_flag, unsigned int data_tsn,
void * ulp_data_ptr unsigned int protocol_id,
unsigned int unordered_flag,
void * ulp_data_ptr
) )
{ {
@ -114,6 +118,8 @@ void sctp_DataArriveNotif( unsigned int sctp_assoc_id,
unsigned int Sua_ConnId; unsigned int Sua_ConnId;
unsigned int sua_assoc_id; unsigned int sua_assoc_id;
unsigned int local_sua_id,remote_sua_id; unsigned int local_sua_id,remote_sua_id;
unsigned short streamSN;
unsigned int tsn;
tcb_Sua_TCB_str *tcb_ptr; tcb_Sua_TCB_str *tcb_ptr;
Sua_syntax_error_struct error; Sua_syntax_error_struct error;
char databuf[BUFSIZE]; char databuf[BUFSIZE];
@ -130,6 +136,8 @@ void sctp_DataArriveNotif( unsigned int sctp_assoc_id,
stream_id, stream_id,
(unsigned char *) databuf, (unsigned char *) databuf,
&len, &len,
&streamSN,
&tsn,
flags flags
); );
@ -153,10 +161,10 @@ void sctp_DataArriveNotif( unsigned int sctp_assoc_id,
char logstring[100]; char logstring[100];
sprintf(logstring, "Decoding error in received SUA message : index = %d,", error.msg_index); sprintf(logstring, "Decoding error in received SUA message : index = %d,", error.msg_index);
event_log("sua_distribution.c",logstring); event_log("sua_distribution.c",logstring);
char *spare = new char[error.error_text.length()]; /*char *spare = new char[error.error_text.length()];*/
error.error_text.copy(spare, error.error_text.length()); /*error.error_text.copy(spare, error.error_text.length());*/
sprintf(logstring, "Error string = %s,", spare); /*sprintf(logstring, "Error string = %s,", spare);*/
event_log("sua_distribution.c",logstring); /*event_log("sua_distribution.c",logstring);*/
cout << "Decoding error in received SUA message : "<< error.error_text << ", index = " << error.msg_index << "\n"; cout << "Decoding error in received SUA message : "<< error.error_text << ", index = " << error.msg_index << "\n";
msg.sua_prim.hdr_msg_class = sua_max; msg.sua_prim.hdr_msg_class = sua_max;
return; return;
@ -176,11 +184,11 @@ void sctp_DataArriveNotif( unsigned int sctp_assoc_id,
#ifdef DEBUG #ifdef DEBUG
cout << "CL: Unitdata message handling\n"; cout << "CL: Unitdata message handling\n";
#endif #endif
unsigned int local_sua_id,remote_sua_id;
sua_assoc_id = Assoc_sua.Find_association( sctp_assoc_id, sua_assoc_id = sua.AssocDB.Find_association( sctp_assoc_id,
local_sua_id, local_sua_id,
remote_sua_id remote_sua_id
); );
result = process_unitdata_msg ( local_sua_id, result = process_unitdata_msg ( local_sua_id,
sua_assoc_id, sua_assoc_id,
msg msg
@ -197,6 +205,16 @@ void sctp_DataArriveNotif( unsigned int sctp_assoc_id,
#ifdef DEBUG #ifdef DEBUG
cout << "CL: Unitdata Service message handling\n"; cout << "CL: Unitdata Service message handling\n";
#endif #endif
sua_assoc_id = sua.AssocDB.Find_association( sctp_assoc_id,
local_sua_id,
remote_sua_id
);
result = process_UDTService_msg ( local_sua_id,
sua_assoc_id,
msg
);
char logstring[100]; char logstring[100];
sprintf(logstring, "Received Unitdata Service msg"); sprintf(logstring, "Received Unitdata Service msg");
event_log("sua_distribution.c",logstring); event_log("sua_distribution.c",logstring);
@ -232,7 +250,7 @@ void sctp_DataArriveNotif( unsigned int sctp_assoc_id,
unsigned int local_sua_id,remote_sua_id; unsigned int local_sua_id,remote_sua_id;
sua_assoc_id = Assoc_sua.Find_association( sctp_assoc_id, sua_assoc_id = sua.AssocDB.Find_association( sctp_assoc_id,
local_sua_id, local_sua_id,
remote_sua_id remote_sua_id
); );
@ -386,7 +404,7 @@ void sctp_DataArriveNotif( unsigned int sctp_assoc_id,
case (sua_mngt): case (sua_mngt):
// SUA management msg // SUA management msg
sua_assoc_id = Assoc_sua.Find_association( sctp_assoc_id, sua_assoc_id = sua.AssocDB.Find_association( sctp_assoc_id,
local_sua_id, local_sua_id,
remote_sua_id remote_sua_id
); );
@ -434,7 +452,7 @@ void sctp_DataArriveNotif( unsigned int sctp_assoc_id,
case (sua_ssnm): case (sua_ssnm):
// Signalling Network Management(SNM) msg // Signalling Network Management(SNM) msg
sua_assoc_id = Assoc_sua.Find_association( sctp_assoc_id, sua_assoc_id = sua.AssocDB.Find_association( sctp_assoc_id,
local_sua_id, local_sua_id,
remote_sua_id remote_sua_id
); );
@ -471,7 +489,11 @@ void sctp_DataArriveNotif( unsigned int sctp_assoc_id,
#ifdef DEBUG #ifdef DEBUG
cout << "SNM: Destination state audit message handling\n"; cout << "SNM: Destination state audit message handling\n";
#endif #endif
result = process_DAUD_msg ( sua_assoc_id,
local_sua_id,
remote_sua_id,
msg
);
char logstring[100]; char logstring[100];
sprintf(logstring, "Received DAUD msg"); sprintf(logstring, "Received DAUD msg");
event_log("sua_distribution.c",logstring); event_log("sua_distribution.c",logstring);
@ -529,7 +551,7 @@ void sctp_DataArriveNotif( unsigned int sctp_assoc_id,
case (sua_aspsm): case (sua_aspsm):
// ASP State maintenance msg // ASP State maintenance msg
sua_assoc_id = Assoc_sua.Find_association( sctp_assoc_id, sua_assoc_id = sua.AssocDB.Find_association( sctp_assoc_id,
local_sua_id, local_sua_id,
remote_sua_id remote_sua_id
); );
@ -653,7 +675,7 @@ void sctp_DataArriveNotif( unsigned int sctp_assoc_id,
case (sua_asptm): case (sua_asptm):
// ASP Traffic maintenance msg // ASP Traffic maintenance msg
sua_assoc_id = Assoc_sua.Find_association( sctp_assoc_id, sua_assoc_id = sua.AssocDB.Find_association( sctp_assoc_id,
local_sua_id, local_sua_id,
remote_sua_id remote_sua_id
); );
@ -805,11 +827,11 @@ void sctp_CommunicationLostNotif( unsigned int sctp_assoc_id,
event_log("sua_distribution.c",logstring); event_log("sua_distribution.c",logstring);
#ifdef SUA_MANAGEMENT #ifdef SUA_MANAGEMENT
if ((sua_assoc_id = Assoc_sua.Find_association(sctp_assoc_id, local_sua_id,remote_sua_id)) != 0) if ((sua_assoc_id = sua.AssocDB.Find_association(sctp_assoc_id, local_sua_id,remote_sua_id)) != 0)
{ {
/* if we found the sua assoc then the SUA ASP is marked down, */ /* if we found the sua assoc then the SUA ASP is marked down, */
/* as the sctp association has failed */ /* as the sctp association has failed */
Assoc_sua.down(sua_assoc_id, 0); sua.AssocDB.down(sua_assoc_id, 0);
#ifdef DEBUG #ifdef DEBUG
cout << "ASP down for SUA association " << sua_assoc_id << "\n"; cout << "ASP down for SUA association " << sua_assoc_id << "\n";
#endif #endif
@ -823,10 +845,11 @@ void sctp_CommunicationLostNotif( unsigned int sctp_assoc_id,
/* sctp_CommunicationUpNotif */ /* sctp_CommunicationUpNotif */
/***********************************************************************/ /***********************************************************************/
void *sctp_CommunicationUpNotif( unsigned int sctp_assoc_id, void *sctp_CommunicationUpNotif( unsigned int sctp_assoc_id,
unsigned short status_event, int status_event,
int nr_of_dest_addr, unsigned int nr_of_dest_addr,
unsigned short nr_of_input_streams, unsigned short nr_of_input_streams,
unsigned short nr_of_output_streams, unsigned short nr_of_output_streams,
int support_PRsctp,
void * ulp_data_ptr void * ulp_data_ptr
) )
{ {
@ -852,13 +875,13 @@ void *sctp_CommunicationUpNotif( unsigned int sctp_assoc_id,
if ((sua_assoc_id = Assoc_sua.Find_association(sctp_assoc_id, local_sua_id,remote_sua_id)) == 0) { if ((sua_assoc_id = sua.AssocDB.Find_association(sctp_assoc_id, local_sua_id,remote_sua_id)) == 0) {
#ifdef DEBUG #ifdef DEBUG
cout << "association " << sctp_assoc_id << " is not present\n"; cout << "association " << sctp_assoc_id << " is not present\n";
#endif #endif
sua_assoc_id = Assoc_sua.passive_associate( sctp_assoc_id, sua_assoc_id = sua.AssocDB.passive_associate( sctp_assoc_id,
local_sua, sua.local_sua,
remote_sua, sua.remote_sua,
nr_of_dest_addr, nr_of_dest_addr,
nr_of_input_streams, nr_of_input_streams,
nr_of_output_streams nr_of_output_streams
@ -867,7 +890,7 @@ void *sctp_CommunicationUpNotif( unsigned int sctp_assoc_id,
/* code include if SUA management is NOT used */ /* code include if SUA management is NOT used */
#ifndef SUA_MANAGEMENT #ifndef SUA_MANAGEMENT
if ( Assoc_sua.instance[sua_assoc_id].status == asp_down_traf_hold) if ( sua.AssocDB.instance[sua_assoc_id].status == asp_down_traf_hold)
{ {
/* - get the saved msg ansd send it on the association that is setup */ /* - get the saved msg ansd send it on the association that is setup */
sua_msg = msg_store.get_msg ( sua_assoc_id ); sua_msg = msg_store.get_msg ( sua_assoc_id );
@ -910,7 +933,7 @@ void *sctp_CommunicationUpNotif( unsigned int sctp_assoc_id,
} }
/* SUA ASP is marked down */ /* SUA ASP is marked down */
Assoc_sua.down(sua_assoc_id,0); sua.AssocDB.down(sua_assoc_id,0);
} }
#endif #endif
@ -920,12 +943,14 @@ void *sctp_CommunicationUpNotif( unsigned int sctp_assoc_id,
#ifdef DEBUG #ifdef DEBUG
cout << "sua_distribution.c:should send ASPUP\n"; cout << "sua_distribution.c:should send ASPUP\n";
#endif #endif
#ifndef SG_MODE
/* send ASP-UP to remote to start activating local & remote ASP */ /* send ASP-UP to remote to start activating local & remote ASP */
result = sua_send_ASPUP( sua_assoc_id result = sua_send_ASPUP( sua_assoc_id
); );
#endif
#endif #endif
return NULL; return NULL;
} }
/***********************************************************************/ /***********************************************************************/
@ -959,14 +984,14 @@ void sctp_RestartNotif( unsigned int sctp_assoc_id,
#endif #endif
#ifdef SUA_MANAGEMENT #ifdef SUA_MANAGEMENT
if ((sua_assoc_id = Assoc_sua.Find_association(sctp_assoc_id, local_sua_id,remote_sua_id)) == 0) if ((sua_assoc_id = sua.AssocDB.Find_association(sctp_assoc_id, local_sua_id,remote_sua_id)) == 0)
{ {
#ifdef DEBUG #ifdef DEBUG
cout << "ASP status = " << Assoc_sua.instance[sua_assoc_id].asp.status <<" for SUA association " << sua_assoc_id << "\n"; cout << "ASP status = " << sua.AssocDB.instance[sua_assoc_id].asp.status <<" for SUA association " << sua_assoc_id << "\n";
#endif #endif
/* restart association: ASP state should be set to down */ /* restart association: ASP state should be set to down */
Assoc_sua.down(sua_assoc_id,0); sua.AssocDB.down(sua_assoc_id,0);
/* if we found the sua assoc then we restart the ASP bringup sequence */ /* if we found the sua assoc then we restart the ASP bringup sequence */
/* as the sctp association has come back online */ /* as the sctp association has come back online */

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_distribution.h,v 1.1.1.1 2002/02/04 14:30:41 p82609 Exp $ * $Id: sua_distribution.h,v 1.2 2002/10/15 14:53:48 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 6.
* *
@ -89,12 +89,14 @@ typedef struct {
/***********************************************************************/ /***********************************************************************/
/* sctp_DataArriveNotif */ /* sctp_DataArriveNotif */
/***********************************************************************/ /***********************************************************************/
void sctp_DataArriveNotif( unsigned int assoc_id, void sctp_DataArriveNotif( unsigned int assoc_id,
unsigned int stream_id, unsigned int stream_id,
unsigned int len, unsigned int len,
unsigned int protocol_id, unsigned short streamSN,
unsigned int unordered_flag, unsigned int tsn,
void * ulp_data_ptr unsigned int protocol_id,
unsigned int unordered_flag,
void * ulp_data_ptr
); );
@ -131,10 +133,11 @@ void sctp_CommunicationLostNotif( unsigned int assoc_id,
/* sctp_CommunicationUpNotif */ /* sctp_CommunicationUpNotif */
/***********************************************************************/ /***********************************************************************/
void* sctp_CommunicationUpNotif( unsigned int assoc_id, void* sctp_CommunicationUpNotif( unsigned int assoc_id,
unsigned short status_event, int status_event,
int nr_of_dest_addr, unsigned int nr_of_dest_addr,
unsigned short nr_of_input_streams, unsigned short nr_of_input_streams,
unsigned short nr_of_output_streams, unsigned short nr_of_output_streams,
int support_PRsctp,
void * ulp_data_ptr void * ulp_data_ptr
); );

View File

@ -15,9 +15,9 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_file.cpp,v 1.1.1.1 2002/02/04 14:30:41 p82609 Exp $ * $Id: sua_file.cpp,v 1.3 2002/11/12 11:02:49 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 13.
* *
* Author(s): Lode Coene * Author(s): Lode Coene
* *
@ -80,11 +80,13 @@
using namespace std; using namespace std;
/***********************************************************************/
/* get_argument */
/***********************************************************************/
string get_argument(string line, string get_argument(string line,
int& begin, int& begin,
int& end, int& end,
unsigned int& num_of_char_in_line) unsigned int& num_of_char_in_line)
{ {
int len = 0; int len = 0;
bool cont = true; bool cont = true;
@ -125,7 +127,9 @@ string get_argument(string line,
return(sua_arg); return(sua_arg);
} }
/***********************************************************************/
/* read sua file */
/***********************************************************************/
int read_sua_file(string filename, int read_sua_file(string filename,
db_Sua_LocalList& local_sua, db_Sua_LocalList& local_sua,
db_Sua_RemoteList& remote_sua, db_Sua_RemoteList& remote_sua,
@ -149,17 +153,22 @@ int read_sua_file(string filename,
cout << "file to read = " << filename << " \n"; cout << "file to read = " << filename << " \n";
#endif #endif
cout << "SUA local sua instantation parameters(mandatory) \n"; cout << "SUA local sua instantation parameters(mandatory) \n";
cout << "-s x.x.x.x -l yyy [-u] \n"; cout << "-s[n] x.x.x.x -l yyy [-7s 7777] [-gs tt-nat-np-digits][-u] \n";
cout << "-s : source address \n"; cout << "-s : source address \n";
cout << "-l : source local sua portnumber \n"; cout << "-l : source local sua portnumber \n";
cout << "-sn: source name \n";
cout << "-7s: source SS7 pointcode\n";
cout << "-u : listen on local port number \n"; cout << "-u : listen on local port number \n";
cout << "SUA parameters of the sua tester (optional)\n"; cout << "SUA parameters of the sua tester (optional)\n";
cout << "Not supported yet (-b 1000 -o -v) \n"; cout << "Not supported yet (-b 1000 -o -v) \n";
cout << "SUA parameters of the SUA remote instantation(s) (optional)\n"; cout << "SUA parameters of the SUA remote instantation(s) (optional)\n";
cout << "-d x.x.x.x -r yyy [-g tt-nat-np-digits] [-a ASnumber] \n"; cout << "-d[n] x.x.x.x -r yyy [-7d 7777] [-gd tt-nat-np-digits] [-a ASnumber] \n";
cout << "-d : destination address \n"; cout << "-d : destination address \n";
cout << "-r : destination sua portnumber \n"; cout << "-r : destination sua portnumber \n";
cout << "-g : global title(TTID-NAT-NUMPLAN-Digits) linked to destination address \n"; cout << "-dn: destination name \n";
cout << "-7d: destination SS7 pointcode\n";
cout << "-gs: source global title(TTID-NAT-NUMPLAN-Digits) linked to -s address or -sn name \n";
cout << "-gd: destination global title(TTID-NAT-NUMPLAN-Digits) linked to -d address or -dn name\n";
cout << "-a : Application Server(AS) this address belongs to \n"; cout << "-a : Application Server(AS) this address belongs to \n";
ifstream infile(filename.c_str()); ifstream infile(filename.c_str());
@ -209,7 +218,7 @@ int read_sua_file(string filename,
Assoc_sua.instance[Assoc_sua.num_of_instance].nr_of_outbound_streams = 1; Assoc_sua.instance[Assoc_sua.num_of_instance].nr_of_outbound_streams = 1;
if (ch2 == 'n') { if (ch2 == 'n') {
ip_addr_str = NameDB_sua.read_host_name(address_str); ip_addr_str = Assoc_sua.read_host_name(NameDB_sua, address_str);
Assoc_sua.read_Source_addr(ip_addr_str); Assoc_sua.read_Source_addr(ip_addr_str);
} }
else { else {
@ -235,7 +244,7 @@ int read_sua_file(string filename,
present_remote_instance = 0; present_remote_instance = 0;
} }
if (ch2 == 'n') { if (ch2 == 'n') {
ip_addr_str = NameDB_sua.read_host_name(address_str); ip_addr_str = Assoc_sua.read_host_name(NameDB_sua, address_str);
Assoc_sua.read_Dest_addr(ip_addr_str); Assoc_sua.read_Dest_addr(ip_addr_str);
} }
else { else {
@ -328,6 +337,36 @@ int read_sua_file(string filename,
num_of_arg++; num_of_arg++;
break; break;
} }
case 'g':
{
/* read global title */
switch (ch2)
{
case 's': // read source Global Title for sua
{
num_of_arg++;
address_str = get_argument(sua_line,b,e,num_of_char_in_line);
Assoc_sua.read_Source_GT(NameDB_sua, address_str);
break;
}
case 'd':
{ // read destination Global Title for sua
num_of_arg++;
address_str = get_argument(sua_line,b,e,num_of_char_in_line);
Assoc_sua.read_Dest_GT(NameDB_sua, address_str);
break;
}
default:
{
break;
}
}
break;
}
case 'i': case 'i':
{ {
// ignore character, is not a error, go to next argument // ignore character, is not a error, go to next argument
@ -341,16 +380,16 @@ int read_sua_file(string filename,
{ {
num_of_arg++; num_of_arg++;
address_str = get_argument(sua_line,b,e,num_of_char_in_line); address_str = get_argument(sua_line,b,e,num_of_char_in_line);
Assoc_sua.read_Source_pointcode(address_str); Assoc_sua.read_Source_pointcode(address_str);
break; break;
} }
case 'd': case 'd':
{ // read destination pointcode for sua { // read destination pointcode for sua
num_of_arg++; num_of_arg++;
address_str = get_argument(sua_line,b,e,num_of_char_in_line); address_str = get_argument(sua_line,b,e,num_of_char_in_line);
Assoc_sua.read_Dest_pointcode(address_str); Assoc_sua.read_Dest_pointcode(address_str);
break; break;
@ -375,27 +414,159 @@ int read_sua_file(string filename,
break; break;
} }
} }
sua_arg = get_argument(sua_line,b,e,num_of_char_in_line); sua_arg = get_argument(sua_line,b,e,num_of_char_in_line);
num_of_arg++; num_of_arg++;
} }
// finished reading the whole line // finished reading the whole line
num_of_char = num_of_char + num_of_char_in_line; num_of_char = num_of_char + num_of_char_in_line;
cout << "Line " << num_of_lines << " : " << sua_line << "\n"; cout << "Line " << num_of_lines << " : " << sua_line << "\n";
} }
#ifdef DEBUG #ifdef DEBUG
cout << "End of file: statistics \n"; cout << "End of file: statistics \n";
cout << "Number of lines = " << num_of_lines <<"\n"; cout << "Number of lines = " << num_of_lines <<"\n";
cout << "Number of characters in file = " << num_of_char << "\n"; cout << "Number of characters in file = " << num_of_char << "\n";
#endif #endif
return (0); return (0);
} /* end of read_sua_file */ } /* end of read_sua_file */
/***********************************************************************/
/* create host parameter handling */
/***********************************************************************/
void sua_cr_host( string host_parm_str,
db_Sua_LocalList& local_sua
)
{
int host_id;
/* get host id from param string, use as index in local_sua table */
host_id = 1;
string ip_addr_str( host_parm_str, (host_parm_str.find("org_ip=")+7),host_parm_str.length());
/* get all(=multihomed) addresses till next parameter */
/* fill in IP address as string in local_sua */
/*local_sua.instance[host_id].ip_addr_str = ip_addr_str;*/
/* get the local port number for this instance */
/* local_sua.instance[host_id].portnumber=14001 */
/* get the local ssn for this local sua host instantiation */
/* local_sua.instance[host_id].ssn = 5 */
/* get the number of streams supported for this sua instantiation */
/* local_sua.instance[host_id].streams=16 */
}
/***********************************************************************/
/* create association parameter handling */
/***********************************************************************/
void sua_cr_assoc( string assoc_parm_str,
db_Sua_AssociationList& Assoc_sua,
db_Sua_LocalList& local_sua
)
{
int assoc_id;
/* get assoc id from param string, use as index in assoc_sua table */
assoc_id = 1;
string ip_addr_str( assoc_parm_str, (assoc_parm_str.find("dest_ip=")+8),assoc_parm_str.length());
/* get all(=multihomed) addresses till next parameter */
/* fill in IP address as string & network in assoc_sua */
/* Assoc_sua.instance[assoc_id].ip_addr_str = ip_addr_str;*/
/* get the local port number for this instance */
/* Assoc_sua.instance[assoc_id].portnumber=14001 */
/* get the local ssn for this local sua host instantiation */
/* local_sua.instance[host_id].ssn = 5 */
/* get the number of streams supported for this sua instantiation */
/* local_sua.instance[host_id].streams=16 */
}
/***********************************************************************/
/* read sua configuration file */
/***********************************************************************/
int read_sua_conf_file( string filename,
db_Sua_DatabaseList sua
)
{
string sua_filename;
string sua_arg;
char readBuffer[256];
cout << "SUA configuration file to read = " << filename << " \n";
cout << "SUA local sua instantation parameters(mandatory) \n";
cout << "cr host:host_id = j, org_ip= t.t.t.t, org_port= yyyyy \n";
cout << "cr assoc:assoc_id= i, init= false, host_id = j, dest_ip = x.x.x.x, dest_port= yyyy \n";
cout << "cr orgpc: pc = wwww, host_id = j\n";
cout << "cr destpc: pc = wwww, rc = x \n";
cout << "cr hostname: namegt_id= k name= www.sctp.be \n";
cout << "cr gt:namegt_id = k,tt= tt, na= nn, np= ppp, digits= 123456789abcdef \n";
cout << "cr route: dpc= www, assoc_id = i AND/OR\n";
cout << "cr route: dest_ip = x.x.x.x, assoc_id = i AND/OR\n";
cout << "cr route: namegt_id= k, assoc_id = i \n";
ifstream infile(filename.c_str());
while (infile.getline(readBuffer,256,'\n'))
{
string cmdline(readBuffer,strlen(readBuffer));
if (cmdline.length() == 0)
{
cout << "empty line?\n";
}
else if (cmdline.find("/") != cmdline.npos)
{
/* comment line: do not execute */
}
else if (cmdline.find("cr host:") != cmdline.npos)
{
string parm_str( cmdline, (cmdline.find("cr host:")+8),cmdline.length());
sua_cr_host( parm_str,
sua.local_sua
);
}
else if (cmdline.find("cr assoc:") != cmdline.npos)
{
string parm_str( cmdline, (cmdline.find("cr assoc:")+9),cmdline.length());
sua_cr_assoc( parm_str,
sua.AssocDB,
sua.local_sua
);
}
else if (cmdline.find("cr destpc:") != cmdline.npos)
{
}
else if (cmdline.find("cr hostname:") != cmdline.npos)
{
}
else if (cmdline.find("cr gt:") != cmdline.npos)
{
}
else if (cmdline.find("cr xxxx:") != cmdline.npos)
{
}
else
cout << "ERROR: Unknown " << cmdline << "command\n";
}
} /* end of read_sua_conf_file */
// end of module sua_file.c // end of module sua_file.c

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_file.h,v 1.1.1.1 2002/02/04 14:30:41 p82609 Exp $ * $Id: sua_file.h,v 1.2 2002/11/12 11:02:49 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 6.
* *
@ -69,6 +69,11 @@ int read_sua_file(string filename,
db_Sua_ASList& ApplicServ_sua db_Sua_ASList& ApplicServ_sua
); );
int read_sua_conf_file( string filename,
db_Sua_DatabaseList sua
);
#endif // SUA_FILE_H #endif // SUA_FILE_H
// end of module sua_file.h // end of module sua_file.h

View File

@ -81,6 +81,8 @@
#define MAX_BYTES_IN_LINE 20 #define MAX_BYTES_IN_LINE 20
using namespace std;
ofstream logfile; ofstream logfile;
char log_filename[100]; char log_filename[100];

View File

@ -0,0 +1,195 @@
/***************************************************************************
sua_snm_mgnt.cpp - description
-------------------
begin : Tue Nov 4 2002
copyright : (C) 2002 by Lode Coene
email : lode.coene@siemens.atea.be
***************************************************************************/
/***************************************************************************
* *
* 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 *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/*
* $Id: sua_snm_mgnt.cpp,v 1.1 2002/11/12 11:04:12 p82609 Exp $
*
* SUA implementation according to SUA draft issue 14.
*
* Author(s): Lode Coene
*
*
* Copyright (C) 2001 by Siemens Atea, Herentals, Belgium.
*
* Realized in co-operation between Siemens Atea and
* Siemens AG, Munich, Germany.
*
* 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 the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Contact: gery.verwimp@siemens.atea.be
* lode.coene@siemens.atea.be
*
* The alternative comment
* inspiration : Sabine
* "Due to small parts(Booleans), this code is not suitable for"
* "childeren under 3 years."
*
* Purpose: This code-file defines the SUA management handling functions for
* sending and receiving SignallingNetwork Management(SNM) messages:
* - send a Destination avialeble (DAVA) msg to remote node
* - Receive/process Destination State audit(DAUD) msg
*/
#include "sua_debug.h"
#include "sua_asp_mgnt.h"
#include "sua_database.h"
#include "sua_syntax.h"
#include "sua_logging.h"
#include "sua_tcb.h"
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
extern db_Sua_DatabaseList sua;
extern tcb_Sua_msgqueue_pool msg_store;
/***********************************************************************/
/* Sending SUA Signalling Network Management msg(SNM) */
/***********************************************************************/
/***********************************************************************/
/* sua_send_DAVA */
/***********************************************************************/
int sua_send_DAVA( 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_ssnm;
msg.sua_prim.hdr_msg_type.ssnm = ssnm_dava;
msg.sua_prim.aff_pc_pres = TRUE;
msg.sua_prim.aff_pc = 1;
msg.sua_prim.info_pres = FALSE;
// encode the SUA DAVA 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_snm_mgnt.c",logstring);
log_byte_array("sua_snm_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 DAVA sctp send = "<< result << "\n";
#endif
}
return(error_value);
}
/***********************************************************************/
/* Receiving SUA Signalling Network Management msg */
/***********************************************************************/
/***********************************************************************/
/* sua_process_ASPUP_msg */
/***********************************************************************/
int process_DAUD_msg ( unsigned int sua_assoc_id,
int local_sua_id,
int remote_sua_id,
Sua_container sua_asp_msg
)
{
int error_value;
#ifdef DEBUG
cout << "sua_snm_mgnt.c:DAUD received, send back a DAVA, DUNA or DRST.\n";
#endif
/*sua.AssocDB.up(sua_assoc_id,0);*/
error_value = sua_send_DAVA( sua_assoc_id );
#ifdef DEBUG
cout << "sua_asp_mgnt.c:result send DUNA/DAVA/DRST = "<< error_value << "\n";
#endif
return(error_value);
}
//end of module sua_asp_mgnt.c++

View File

@ -0,0 +1,85 @@
/***************************************************************************
sua_snm_mgnt.h - description
-------------------
begin : Tue Nov 5 2002
copyright : (C) 2002 by Lode Coene
email : lode.coene@siemens.atea.be
***************************************************************************/
/***************************************************************************
* *
* 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 *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/*
* $Id: sua_snm_mgnt.h,v 1.1 2002/11/12 11:04:12 p82609 Exp $
*
* SUA implementation according to SUA draft issue 14.
*
* Author(s): Lode Coene
*
*
* Copyright (C) 2001 by Siemens Atea, Herentals, Belgium.
*
* Realized in co-operation between Siemens Atea and
* Siemens AG, Munich, Germany.
*
* 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 the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Contact: gery.verwimp@siemens.atea.be
* lode.coene@siemens.atea.be
*
* Purpose: This header-file defines the SUA management handling functions for
* sending and receiving Application Server Process(ASP) messages:
*/
#ifndef SUA_SNM_MGNT_H
#define SUA_SNM_MGNT_H
#include "sua.h"
#include "sua_syntax.h"
#include <string>
int sua_send_DAVA( unsigned int Sua_assoc_id
);
int process_DAUD_msg ( unsigned int sua_assoc_id,
int local_sua_id,
int remote_sua_id,
Sua_container sua_asp_msg
);
#endif // SUA_SNM_MGNT_H
//end of module sua_snm_mgnt.h

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_sual.cpp,v 1.1.1.1 2002/02/04 14:30:41 p82609 Exp $ * $Id: sua_sual.cpp,v 1.2 2002/04/11 14:13:34 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 6.
* *
@ -95,10 +95,9 @@
#define MAX_DATA_LENGTH 2000 #define MAX_DATA_LENGTH 2000
using namespace std; using namespace std;
/* definition of SUA local object and of remote object */ /* definition of SUA local object and of remote object */
extern db_Sua_LocalList local_sua; extern db_Sua_DatabaseList sua;
extern db_Sua_RemoteList remote_sua;
extern db_Sua_AssociationList Assoc_sua;
typedef struct { typedef struct {
unsigned int local_sua_id; unsigned int local_sua_id;
@ -122,9 +121,9 @@ int sual_init(unsigned char *pConfFile)
cout << "Initialising SUA datastructures\n "; cout << "Initialising SUA datastructures\n ";
init_logging_file(); init_logging_file();
local_sua.initialize(); sua.local_sua.initialize();
remote_sua.initialize(); sua.remote_sua.initialize();
Assoc_sua.initialize(); sua.AssocDB.initialize();
cout << "Finished initialising SUAL data\n "; cout << "Finished initialising SUAL data\n ";
return (0); return (0);
} /* end of sua_initialisation */ } /* end of sua_initialisation */

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_syntax.cpp,v 1.1.1.1 2002/02/04 14:30:41 p82609 Exp $ * $Id: sua_syntax.cpp,v 1.2 2002/11/12 11:02:49 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 8. * SUA implementation according to SUA draft issue 8.
* *
@ -57,6 +57,7 @@
#include "sua_syntax.h" #include "sua_syntax.h"
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
using namespace std; using namespace std;
/********************************************************************/ /********************************************************************/
@ -178,7 +179,7 @@ boolean encode_data (string& msg, string& data) {
int pdu_index = msg.size(); int pdu_index = msg.size();
msg.resize(pdu_index + 4); msg.resize(pdu_index + 4);
/* Encode tag */ /* Encode tag */
OVERLAY.dw[0] = htons(0x0003); OVERLAY.dw[0] = htons(0x010b);
msg[pdu_index] = OVERLAY.db[0]; msg[pdu_index] = OVERLAY.db[0];
pdu_index++; pdu_index++;
msg[pdu_index] = OVERLAY.db[1]; msg[pdu_index] = OVERLAY.db[1];
@ -771,6 +772,29 @@ boolean encode_SCCP_cause (string& msg, SCCP_cause_struct cause) {
return TRUE; return TRUE;
} }
boolean encode_credit (string& msg, uint32_t credit) {
/* Reserve 8 bytes for credit number */
int pdu_index = msg.size();
msg.resize(pdu_index + 8);
/* Encode tag */
OVERLAY.dw[0] = htons(0x010A);
msg[pdu_index] = OVERLAY.db[0];
pdu_index++;
msg[pdu_index] = OVERLAY.db[1];
pdu_index++;
/* Encode length, always 8 bytes */
OVERLAY.dw[1] = htons(8);
msg[pdu_index] = OVERLAY.db[2];
pdu_index++;
msg[pdu_index] = OVERLAY.db[3];
pdu_index++;
/* Encode value : 2 spare bytes, then received seq nr, more data flag and sent seq nr */
OVERLAY.dq = htonl(credit); // fill in credit value
for(int i = 0; i < 4; i++)
msg[pdu_index + i] = OVERLAY.db[i];
return TRUE;
}
boolean encode_seq_nr (string& msg, Sua_seq_nr_struct seq_nr) { boolean encode_seq_nr (string& msg, Sua_seq_nr_struct seq_nr) {
/* Reserve 8 bytes for sequence number */ /* Reserve 8 bytes for sequence number */
int pdu_index = msg.size(); int pdu_index = msg.size();
@ -1422,6 +1446,7 @@ boolean encode_co_conn_ack_msg (Sua_primitive_struct& prim, string& msg) {
- Protocol class - Protocol class
- Destination reference - Destination reference
- Source reference - Source reference
- sequence control
Following parameters are optional : Following parameters are optional :
- Routing context - Routing context
- Destination address - Destination address
@ -1471,6 +1496,16 @@ boolean encode_co_conn_ack_msg (Sua_primitive_struct& prim, string& msg) {
return FALSE; return FALSE;
} }
} }
if (prim.seq_control_pres && no_error)
no_error = encode_seq_ctrl (msg, prim.seq_control);
else {
if (no_error) {
/* Signal error : mandatory parameter missing */
SYNTAX_ERR.error_text = "Encoding : Sequence Control parameter missing";
return FALSE;
}
}
if (prim.dest_addr_pres && no_error) if (prim.dest_addr_pres && no_error)
no_error = encode_dest_addr (msg, prim.dest_addr); no_error = encode_dest_addr (msg, prim.dest_addr);
if (prim.importance_pres && no_error) if (prim.importance_pres && no_error)
@ -3351,7 +3386,7 @@ boolean decode_cl_data_msg (Sua_primitive_struct& prim, string& msg) {
OVERLAY.db[1] = msg[pdu_index + 1]; OVERLAY.db[1] = msg[pdu_index + 1];
par_tag = ntohs(OVERLAY.dw[0]); par_tag = ntohs(OVERLAY.dw[0]);
switch (par_tag) { switch (par_tag) {
case 0x0003 : case 0x010b :
if (!prim.data_pres) if (!prim.data_pres)
no_error = decode_data (prim, msg, pdu_index); no_error = decode_data (prim, msg, pdu_index);
else { else {
@ -3401,7 +3436,7 @@ boolean decode_cl_data_msg (Sua_primitive_struct& prim, string& msg) {
return FALSE; return FALSE;
} }
break; break;
case 0x0116 : /* tag may change, see SUA v9 */ case 0x0116 :
if (!prim.seq_control_pres) if (!prim.seq_control_pres)
no_error = decode_seq_ctrl (prim, msg, pdu_index); no_error = decode_seq_ctrl (prim, msg, pdu_index);
else { else {
@ -3515,7 +3550,7 @@ boolean decode_cl_data_resp_msg (Sua_primitive_struct& prim, string& msg) {
OVERLAY.db[1] = msg[pdu_index + 1]; OVERLAY.db[1] = msg[pdu_index + 1];
par_tag = ntohs(OVERLAY.dw[0]); par_tag = ntohs(OVERLAY.dw[0]);
switch (par_tag) { switch (par_tag) {
case 0x0003 : case 0x010b :
if (!prim.data_pres) if (!prim.data_pres)
no_error = decode_data (prim, msg, pdu_index); no_error = decode_data (prim, msg, pdu_index);
else { else {
@ -3650,7 +3685,7 @@ boolean decode_co_conn_req_msg (Sua_primitive_struct& prim, string& msg) {
OVERLAY.db[1] = msg[pdu_index + 1]; OVERLAY.db[1] = msg[pdu_index + 1];
par_tag = ntohs(OVERLAY.dw[0]); par_tag = ntohs(OVERLAY.dw[0]);
switch (par_tag) { switch (par_tag) {
case 0x0003 : case 0x010b :
if (!prim.data_pres) if (!prim.data_pres)
no_error = decode_data (prim, msg, pdu_index); no_error = decode_data (prim, msg, pdu_index);
else { else {
@ -3793,7 +3828,7 @@ boolean decode_co_conn_ack_msg (Sua_primitive_struct& prim, string& msg) {
OVERLAY.db[1] = msg[pdu_index + 1]; OVERLAY.db[1] = msg[pdu_index + 1];
par_tag = ntohs(OVERLAY.dw[0]); par_tag = ntohs(OVERLAY.dw[0]);
switch (par_tag) { switch (par_tag) {
case 0x0003 : case 0x010b :
if (!prim.data_pres) if (!prim.data_pres)
no_error = decode_data (prim, msg, pdu_index); no_error = decode_data (prim, msg, pdu_index);
else { else {
@ -3926,7 +3961,7 @@ boolean decode_co_conn_ref_msg (Sua_primitive_struct& prim, string& msg) {
OVERLAY.db[1] = msg[pdu_index + 1]; OVERLAY.db[1] = msg[pdu_index + 1];
par_tag = ntohs(OVERLAY.dw[0]); par_tag = ntohs(OVERLAY.dw[0]);
switch (par_tag) { switch (par_tag) {
case 0x0003 : case 0x010b :
if (!prim.data_pres) if (!prim.data_pres)
no_error = decode_data (prim, msg, pdu_index); no_error = decode_data (prim, msg, pdu_index);
else { else {
@ -4042,7 +4077,7 @@ boolean decode_co_rel_req_msg (Sua_primitive_struct& prim, string& msg) {
OVERLAY.db[1] = msg[pdu_index + 1]; OVERLAY.db[1] = msg[pdu_index + 1];
par_tag = ntohs(OVERLAY.dw[0]); par_tag = ntohs(OVERLAY.dw[0]);
switch (par_tag) { switch (par_tag) {
case 0x0003 : case 0x010b :
if (!prim.data_pres) if (!prim.data_pres)
no_error = decode_data (prim, msg, pdu_index); no_error = decode_data (prim, msg, pdu_index);
else { else {
@ -4254,7 +4289,7 @@ boolean decode_co_data_msg (Sua_primitive_struct& prim, string& msg) {
OVERLAY.db[1] = msg[pdu_index + 1]; OVERLAY.db[1] = msg[pdu_index + 1];
par_tag = ntohs(OVERLAY.dw[0]); par_tag = ntohs(OVERLAY.dw[0]);
switch (par_tag) { switch (par_tag) {
case 0x0003 : case 0x010b :
if (!prim.data_pres) if (!prim.data_pres)
no_error = decode_data (prim, msg, pdu_index); no_error = decode_data (prim, msg, pdu_index);
else { else {

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_tcb.cpp,v 1.1.1.1 2002/02/04 14:30:42 p82609 Exp $ * $Id: sua_tcb.cpp,v 1.2 2002/10/24 16:12:06 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 6.
* *
@ -97,6 +97,7 @@ void tcb_Sua_TCB_str::init_TCB_elem()
Source_LR = 0; Source_LR = 0;
User_ref_id = 0; User_ref_id = 0;
sctp_Association_id = 0; sctp_Association_id = 0;
scoc_tcb_id = 0;
prcl_class = class0 ; prcl_class = class0 ;
return_option = FALSE; return_option = FALSE;
} }

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: sua_tcb.h,v 1.1.1.1 2002/02/04 14:30:42 p82609 Exp $ * $Id: sua_tcb.h,v 1.2 2002/10/24 16:12:06 p82609 Exp $
* *
* SUA implementation according to SUA draft issue 6. * SUA implementation according to SUA draft issue 6.
* *
@ -91,6 +91,7 @@ class tcb_Sua_TCB_str
unsigned int Source_LR; unsigned int Source_LR;
unsigned int User_ref_id; unsigned int User_ref_id;
unsigned int sctp_Association_id; unsigned int sctp_Association_id;
unsigned int scoc_tcb_id;
protocol_class_set prcl_class; protocol_class_set prcl_class;
unsigned int seq_number; unsigned int seq_number;
bool return_option; bool return_option;

View File

@ -1,7 +1,4 @@
####### kdevelop will overwrite this part!!! (begin)########## ####### kdevelop will overwrite this part!!! (begin)##########
noinst_LIBRARIES = libtestup.a
libtestup_a_SOURCES = testuser.cpp main.cpp
EXTRA_DIST = main.cpp testuser.cpp testuser.h EXTRA_DIST = main.cpp testuser.cpp testuser.h
@ -13,8 +10,6 @@ testup_SOURCES = main.cpp testuser.cpp testuser.h
#testup_LDADD = -L/usr/local/lib -lsua @glib_LIBS@ @sctp_LIBS@ #testup_LDADD = -L/usr/local/lib -lsua @glib_LIBS@ @sctp_LIBS@
testup_LDADD = ../sua/libsua.a @glib_LIBS@ @sctp_LIBS@ testup_LDADD = ../sua/libsua.a @glib_LIBS@ @sctp_LIBS@
INCLUDES = -I/usr/local/include INCLUDES = -I../sua -I/usr/local/include
#the library path search path
#sualib_LDFLAGS = $(all_libraries)
AUTOMAKE_OPTIONS = no-dependencies AUTOMAKE_OPTIONS = no-dependencies

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: main.cpp,v 1.1.1.1 2002/02/04 14:30:42 p82609 Exp $ * $Id: main.cpp,v 1.2 2002/10/15 14:37:59 p82609 Exp $
* *
* SUA Test user part implementation. * SUA Test user part implementation.
* *
@ -73,6 +73,15 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#else
#define POLLIN 0x001
#define POLLPRI 0x002
#define POLLOUT 0x004
#define POLLERR 0x008
#endif
using namespace std; using namespace std;
char own_hostname[512]; char own_hostname[512];
@ -290,10 +299,13 @@ int main(int argc, char **argv )
res = sua_associate(); res = sua_associate();
// register sua and its users // register sua and its users
sctp_registerUserCallback( fileno(stdin), res = sctp_registerUserCallback( fileno(stdin),
&testip_stdin_cb, &testip_stdin_cb,
NULL NULL,
); POLLIN|POLLPRI
);
cout << "sctp_registerUserCallback result = "<< res << "\n";
init_testip_stdin(); init_testip_stdin();

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: testuser.cpp,v 1.2 2002/02/15 16:20:29 p82609 Exp $ * $Id: testuser.cpp,v 1.7 2002/11/14 15:29:24 p82609 Exp $
* *
* SUA Test user part implementation. * SUA Test user part implementation.
* *
@ -189,13 +189,17 @@ void init_testip_stdin()
/***********************************************************************/ /***********************************************************************/
/* Test User Part : testip_stdin_cb */ /* Test User Part : testip_stdin_cb */
/***********************************************************************/ /***********************************************************************/
void testip_stdin_cb( int fd, void testip_stdin_cb( int fd,
short int revents, short int revents,
void *dummy short int *gotevents,
void *dummy
) )
{ {
int i,length; int i,length;
unsigned int k, outstr_len;
char readBuffer[256]; char readBuffer[256];
char output_str[INET6_ADDRSTRLEN];
const char *ptr;
unsigned int xsxx; unsigned int xsxx;
sccp_QOS_str udt_QOS, co_QOS; sccp_QOS_str udt_QOS, co_QOS;
@ -237,6 +241,12 @@ void testip_stdin_cb( int fd,
/* exit program */ /* exit program */
exit(0); exit(0);
} }
else if (cmdline.find("term") != cmdline.npos)
{
/* add some cleanups */
sua_shutdown();
cout << "Closing down the SCTP & SUA associations\n";
}
else if ((cmdline.find("rep:") != cmdline.npos)) else if ((cmdline.find("rep:") != cmdline.npos))
{ {
cout << "Repeat sending CL/CO data to remote end every " << rep_timer << " sec\n"; cout << "Repeat sending CL/CO data to remote end every " << rep_timer << " sec\n";
@ -254,15 +264,57 @@ void testip_stdin_cb( int fd,
else if (cmdline.find("disp mngt") != cmdline.npos) else if (cmdline.find("disp mngt") != cmdline.npos)
{ {
/* Display the management status of all SUA instances */ /* Display the management status of all SUA instances */
cout << "| Association | SUA management status |\n"; cout << "Display SUA administration and Mangagement data of all associations\n";
cout << "+-------------+-----------------------+\n"; cout << "|-------+--------+--------------------+--------------------+-----|\n";
cout << "| Assoc | status | local IP addr | Remote IP addr | SSN |\n";
cout << "|-------+--------+--------------------+--------------------+-----|\n";
i = 1; i = 1;
while ( SUA_PATH_NO_ERROR == sua_getPath(i,pathinfo) ) while ( SUA_PATH_NO_ERROR == sua_getPath(i,pathinfo) )
{ {
cout << "| " << i <<" | "<< pathinfo.ASP_status << " |\n"; cout << "| " << i <<" | "<< pathinfo.ASP_status << " | ";
if (pathinfo.local_addr.pc.ipvx.sa.sa_family == AF_INET)
{ /* ipv4 */
ptr = inet_ntop( pathinfo.local_addr.pc.ipvx.sa.sa_family,
&pathinfo.local_addr.pc.ipvx.sin.sin_addr,
output_str,
sizeof(output_str)
);
cout << output_str;
outstr_len = strlen(output_str);
for(k=0; k < (20 - 3 - outstr_len); k++)
cout << " ";
cout << "| ";
ptr = inet_ntop( pathinfo.remote_addr.pc.ipvx.sa.sa_family,
&pathinfo.remote_addr.pc.ipvx.sin.sin_addr,
output_str,
sizeof(output_str)
);
cout << output_str;
for(k=0; k < /*(20 -*/ 3 /*- outstr_len)*/; k++)
cout << " ";
cout << "| ";
cout << pathinfo.remote_addr.ssn << " |\n";
}
else
{ /* ipv6 */
ptr = inet_ntop( pathinfo.local_addr.pc.ipvx.sa.sa_family,
&pathinfo.local_addr.pc.ipvx.sin6.sin6_addr,
output_str,
sizeof(output_str)
);
cout << output_str << " | ";
ptr = inet_ntop( pathinfo.remote_addr.pc.ipvx.sa.sa_family,
&pathinfo.remote_addr.pc.ipvx.sin6.sin6_addr,
output_str,
sizeof(output_str)
);
cout << output_str << " | ";
cout << pathinfo.remote_addr.ssn << " |\n";
}
i++; i++;
} }
cout << "+-------------+-----------------------+\n"; cout << "|-------+--------+--------------------+--------------------+-----|\n";
cout << "ASP status values: see sua_asp_mgnt.h\n"; cout << "ASP status values: see sua_asp_mgnt.h\n";
} }
else if (cmdline.find("term") != cmdline.npos) else if (cmdline.find("term") != cmdline.npos)
@ -333,7 +385,7 @@ void testip_stdin_cb( int fd,
called_pty_addr.address_fields_present.ssn_port = ssn_present; called_pty_addr.address_fields_present.ssn_port = ssn_present;
called_pty_addr.address_fields_present.field_in_header = include_nothing; called_pty_addr.address_fields_present.field_in_header = include_nothing;
strcpy(called_pty_addr.name.HostName,addr_str.c_str()); strcpy(called_pty_addr.name.HostName,addr_str.c_str());
called_pty_addr.ssn = 255; called_pty_addr.ssn = calling_pty_addr.ssn;
called_pty_addr.routing_ind = route_on_name_gt; called_pty_addr.routing_ind = route_on_name_gt;
cout << "DNS/SUA dest hostname = " << addr_str << "\n"; cout << "DNS/SUA dest hostname = " << addr_str << "\n";
@ -345,7 +397,7 @@ void testip_stdin_cb( int fd,
calling_pty_addr.address_fields_present.name_gt = hostname_present; calling_pty_addr.address_fields_present.name_gt = hostname_present;
strcpy(calling_pty_addr.name.HostName, own_hostname); strcpy(calling_pty_addr.name.HostName, own_hostname);
calling_pty_addr.ssn = 255; calling_pty_addr.ssn = 5;
calling_pty_addr.routing_ind = route_on_name_gt; calling_pty_addr.routing_ind = route_on_name_gt;
cout << "DNS/SUA source hostname = " << addr2_str << "\n"; cout << "DNS/SUA source hostname = " << addr2_str << "\n";
@ -364,10 +416,10 @@ void testip_stdin_cb( int fd,
called_pty_addr.address_fields_present.field_in_header = include_nothing; called_pty_addr.address_fields_present.field_in_header = include_nothing;
called_pty_addr.pc.ss7.ITU24.family = ITU24bit; called_pty_addr.pc.ss7.ITU24.family = ITU24bit;
called_pty_addr.pc.ss7.ITU24.pc = atoi(addr_char); called_pty_addr.pc.ss7.ITU24.pc = atoi(addr_char);
called_pty_addr.ssn = 255; called_pty_addr.ssn = calling_pty_addr.ssn;
called_pty_addr.routing_ind = route_on_ssn; called_pty_addr.routing_ind = route_on_ssn;
calling_pty_addr.ssn = 255; calling_pty_addr.ssn = 5;
calling_pty_addr.routing_ind = route_on_ssn; calling_pty_addr.routing_ind = route_on_ssn;
cout << "Address of remote end stored. Msg will be sent to this one\n"; cout << "Address of remote end stored. Msg will be sent to this one\n";
@ -448,8 +500,6 @@ void testip_stdin_cb( int fd,
calling_pty_addr.address_fields_present.field_in_header = called_pty_addr.address_fields_present.field_in_header; calling_pty_addr.address_fields_present.field_in_header = called_pty_addr.address_fields_present.field_in_header;
string addr4_str = own_hostname; string addr4_str = own_hostname;
/*char *name4_char = new char [addr4_str.length()+1]; */
/*name4_char = shost_to_suaname ( addr4_str ); */
strcpy(calling_pty_addr.name.HostName, own_hostname); strcpy(calling_pty_addr.name.HostName, own_hostname);
calling_pty_addr.pc.ipvx = pathinfo.local_addr.pc.ipvx; calling_pty_addr.pc.ipvx = pathinfo.local_addr.pc.ipvx;
@ -503,7 +553,8 @@ void timer_expired(unsigned int tID,
sendcnt++; sendcnt++;
cout << "Send a PING\n"; cout << "Send a PING\n";
doPingPong(Sua_ConnId); doPingPong(Sua_ConnId);
timerID = sctp_startTimer( 10000, timerID = sctp_startTimer( 10, /* seconds */
0, /* microseconds */
&timer_expired, &timer_expired,
NULL, NULL,
NULL NULL
@ -728,7 +779,8 @@ void ulp_ConnConfIndNotif( unsigned int local_sua_Id,
// received the connection confirmed msg // received the connection confirmed msg
// this is the initiator of the connection // this is the initiator of the connection
// start a timer for sending the data to the responder // start a timer for sending the data to the responder
timerID = sctp_startTimer( 5000, timerID = sctp_startTimer( 15, /* seconds */
0, /* microseconds */
&timer_expired, &timer_expired,
NULL, NULL,
NULL NULL

View File

@ -15,7 +15,7 @@
* * * *
***************************************************************************/ ***************************************************************************/
/* /*
* $Id: testuser.h,v 1.1.1.1 2002/02/04 14:30:42 p82609 Exp $ * $Id: testuser.h,v 1.2 2002/10/22 13:45:11 p82609 Exp $
* *
* SUA Test user part implementation. * SUA Test user part implementation.
* *
@ -77,9 +77,10 @@ using namespace std;
void init_testip_stdin(void ); void init_testip_stdin(void );
void testip_stdin_cb( int fd, void testip_stdin_cb( int fd,
short int revents, short int revents,
void *dummy short int *gotevents,
void *dummy
); );