diff options
Diffstat (limited to 'lib/megaco')
76 files changed, 2156 insertions, 2559 deletions
diff --git a/lib/megaco/aclocal.m4 b/lib/megaco/aclocal.m4 new file mode 100644 index 0000000000..25f40944e7 --- /dev/null +++ b/lib/megaco/aclocal.m4 @@ -0,0 +1,1905 @@ +dnl +dnl %CopyrightBegin% +dnl +dnl Copyright Ericsson AB 1998-2013. All Rights Reserved. +dnl +dnl The contents of this file are subject to the Erlang Public License, +dnl Version 1.1, (the "License"); you may not use this file except in +dnl compliance with the License. You should have received a copy of the +dnl Erlang Public License along with this software. If not, it can be +dnl retrieved online at http://www.erlang.org/. +dnl +dnl Software distributed under the License is distributed on an "AS IS" +dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +dnl the License for the specific language governing rights and limitations +dnl under the License. +dnl +dnl %CopyrightEnd% +dnl + +dnl +dnl aclocal.m4 +dnl +dnl Local macros used in configure.in. The Local Macros which +dnl could/should be part of autoconf are prefixed LM_, macros specific +dnl to the Erlang system are prefixed ERL_. +dnl + +AC_DEFUN(LM_PRECIOUS_VARS, +[ + +dnl ERL_TOP +AC_ARG_VAR(ERL_TOP, [Erlang/OTP top source directory]) + +dnl Tools +AC_ARG_VAR(CC, [C compiler]) +AC_ARG_VAR(CFLAGS, [C compiler flags]) +AC_ARG_VAR(STATIC_CFLAGS, [C compiler static flags]) +AC_ARG_VAR(CFLAG_RUNTIME_LIBRARY_PATH, [runtime library path linker flag passed via C compiler]) +AC_ARG_VAR(CPP, [C/C++ preprocessor]) +AC_ARG_VAR(CPPFLAGS, [C/C++ preprocessor flags]) +AC_ARG_VAR(CXX, [C++ compiler]) +AC_ARG_VAR(CXXFLAGS, [C++ compiler flags]) +AC_ARG_VAR(LD, [linker (is often overridden by configure)]) +AC_ARG_VAR(LDFLAGS, [linker flags (can be risky to set since LD may be overriden by configure)]) +AC_ARG_VAR(LIBS, [libraries]) +AC_ARG_VAR(DED_LD, [linker for Dynamic Erlang Drivers (set all DED_LD* variables or none)]) +AC_ARG_VAR(DED_LDFLAGS, [linker flags for Dynamic Erlang Drivers (set all DED_LD* variables or none)]) +AC_ARG_VAR(DED_LD_FLAG_RUNTIME_LIBRARY_PATH, [runtime library path linker flag for Dynamic Erlang Drivers (set all DED_LD* variables or none)]) +AC_ARG_VAR(LFS_CFLAGS, [large file support C compiler flags (set all LFS_* variables or none)]) +AC_ARG_VAR(LFS_LDFLAGS, [large file support linker flags (set all LFS_* variables or none)]) +AC_ARG_VAR(LFS_LIBS, [large file support libraries (set all LFS_* variables or none)]) +AC_ARG_VAR(RANLIB, [ranlib]) +AC_ARG_VAR(AR, [ar]) +AC_ARG_VAR(GETCONF, [getconf]) + +dnl Cross system root +AC_ARG_VAR(erl_xcomp_sysroot, [Absolute cross system root path (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_isysroot, [Absolute cross system root include path (only used when cross compiling)]) + +dnl Cross compilation variables +AC_ARG_VAR(erl_xcomp_bigendian, [big endian system: yes|no (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_double_middle_endian, [double-middle-endian system: yes|no (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_linux_clock_gettime_correction, [clock_gettime() can be used for time correction: yes|no (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_linux_nptl, [have Native POSIX Thread Library: yes|no (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_linux_usable_sigusrx, [SIGUSR1 and SIGUSR2 can be used: yes|no (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_linux_usable_sigaltstack, [have working sigaltstack(): yes|no (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_poll, [have working poll(): yes|no (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_kqueue, [have working kqueue(): yes|no (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_putenv_copy, [putenv() stores key-value copy: yes|no (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_reliable_fpe, [have reliable floating point exceptions: yes|no (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_getaddrinfo, [have working getaddrinfo() for both IPv4 and IPv6: yes|no (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_gethrvtime_procfs_ioctl, [have working gethrvtime() which can be used with procfs ioctl(): yes|no (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_clock_gettime_cpu_time, [clock_gettime() can be used for retrieving process CPU time: yes|no (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_after_morecore_hook, [__after_morecore_hook can track malloc()s core memory usage: yes|no (only used when cross compiling)]) +AC_ARG_VAR(erl_xcomp_dlsym_brk_wrappers, [dlsym(RTLD_NEXT, _) brk wrappers can track malloc()s core memory usage: yes|no (only used when cross compiling)]) + +]) + +AC_DEFUN(ERL_XCOMP_SYSROOT_INIT, +[ +erl_xcomp_without_sysroot=no +if test "$cross_compiling" = "yes"; then + test "$erl_xcomp_sysroot" != "" || erl_xcomp_without_sysroot=yes + test "$erl_xcomp_isysroot" != "" || erl_xcomp_isysroot="$erl_xcomp_sysroot" +else + erl_xcomp_sysroot= + erl_xcomp_isysroot= +fi +]) + +AC_DEFUN(LM_CHECK_GETCONF, +[ +if test "$cross_compiling" != "yes"; then + AC_CHECK_PROG([GETCONF], [getconf], [getconf], [false]) +else + dnl First check if we got a `<HOST>-getconf' in $PATH + host_getconf="$host_alias-getconf" + AC_CHECK_PROG([GETCONF], [$host_getconf], [$host_getconf], [false]) + if test "$GETCONF" = "false" && test "$erl_xcomp_sysroot" != ""; then + dnl We should perhaps give up if we have'nt found it by now, but at + dnl least in one Tilera MDE `getconf' under sysroot is a bourne + dnl shell script which we can use. We try to find `<HOST>-getconf' + dnl or `getconf' under sysconf, but only under sysconf since + dnl `getconf' in $PATH is almost guaranteed to be for the build + dnl machine. + GETCONF= + prfx="$erl_xcomp_sysroot" + AC_PATH_TOOL([GETCONF], [getconf], [false], + ["$prfx/usr/bin:$prfx/bin:$prfx/usr/local/bin"]) + fi +fi +]) + +dnl ---------------------------------------------------------------------- +dnl +dnl LM_WINDOWS_ENVIRONMENT +dnl +dnl +dnl Tries to determine thw windows build environment, i.e. +dnl MIXED_CYGWIN_VC or MIXED_MSYS_VC +dnl + +AC_DEFUN(LM_WINDOWS_ENVIRONMENT, +[ +MIXED_CYGWIN=no +MIXED_MSYS=no + +AC_MSG_CHECKING(for mixed cygwin or msys and native VC++ environment) +if test "X$host" = "Xwin32" -a "x$GCC" != "xyes"; then + if test -x /usr/bin/cygpath; then + CFLAGS="-O2" + MIXED_CYGWIN=yes + AC_MSG_RESULT([Cygwin and VC]) + MIXED_CYGWIN_VC=yes + CPPFLAGS="$CPPFLAGS -DERTS_MIXED_CYGWIN_VC" + elif test -x /usr/bin/msysinfo; then + CFLAGS="-O2" + MIXED_MSYS=yes + AC_MSG_RESULT([MSYS and VC]) + MIXED_MSYS_VC=yes + CPPFLAGS="$CPPFLAGS -DERTS_MIXED_MSYS_VC" + else + AC_MSG_RESULT([undeterminable]) + AC_MSG_ERROR(Seems to be mixed windows but not with cygwin, cannot handle this!) + fi +else + AC_MSG_RESULT([no]) + MIXED_CYGWIN_VC=no + MIXED_MSYS_VC=no +fi +AC_SUBST(MIXED_CYGWIN_VC) +AC_SUBST(MIXED_MSYS_VC) + +MIXED_VC=no +if test "x$MIXED_MSYS_VC" = "xyes" -o "x$MIXED_CYGWIN_VC" = "xyes" ; then + MIXED_VC=yes +fi + +AC_SUBST(MIXED_VC) + +if test "x$MIXED_MSYS" != "xyes"; then + AC_MSG_CHECKING(for mixed cygwin and native MinGW environment) + if test "X$host" = "Xwin32" -a "x$GCC" = x"yes"; then + if test -x /usr/bin/cygpath; then + CFLAGS="-O2" + MIXED_CYGWIN=yes + AC_MSG_RESULT([yes]) + MIXED_CYGWIN_MINGW=yes + CPPFLAGS="$CPPFLAGS -DERTS_MIXED_CYGWIN_MINGW" + else + AC_MSG_RESULT([undeterminable]) + AC_MSG_ERROR(Seems to be mixed windows but not with cygwin, cannot handle this!) + fi + else + AC_MSG_RESULT([no]) + MIXED_CYGWIN_MINGW=no + fi +else + MIXED_CYGWIN_MINGW=no +fi +AC_SUBST(MIXED_CYGWIN_MINGW) + +AC_MSG_CHECKING(if we mix cygwin with any native compiler) +if test "X$MIXED_CYGWIN" = "Xyes"; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +AC_SUBST(MIXED_CYGWIN) + +AC_MSG_CHECKING(if we mix msys with another native compiler) +if test "X$MIXED_MSYS" = "Xyes" ; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +AC_SUBST(MIXED_MSYS) +]) + +dnl ---------------------------------------------------------------------- +dnl +dnl LM_FIND_EMU_CC +dnl +dnl +dnl Tries fairly hard to find a C compiler that can handle jump tables. +dnl Defines the @EMU_CC@ variable for the makefiles and +dnl inserts NO_JUMP_TABLE in the header if one cannot be found... +dnl + +AC_DEFUN(LM_FIND_EMU_CC, + [AC_CACHE_CHECK(for a compiler that handles jumptables, + ac_cv_prog_emu_cc, + [ +AC_TRY_COMPILE([],[ +#if defined(__clang_major__) && __clang_major__ >= 3 + /* clang 3.x or later is fine */ +#elif defined(__llvm__) +#error "this version of llvm is unable to correctly compile beam_emu.c" +#endif + __label__ lbl1; + __label__ lbl2; + int x = magic(); + static void *jtab[2]; + + jtab[0] = &&lbl1; + jtab[1] = &&lbl2; + goto *jtab[x]; +lbl1: + return 1; +lbl2: + return 2; +],ac_cv_prog_emu_cc=$CC,ac_cv_prog_emu_cc=no) + +if test $ac_cv_prog_emu_cc = no; then + for ac_progname in emu_cc.sh gcc-4.2 gcc; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_progname; then + ac_cv_prog_emu_cc=$ac_dir/$ac_progname + break + fi + done + IFS="$ac_save_ifs" + if test $ac_cv_prog_emu_cc != no; then + break + fi + done +fi + +if test $ac_cv_prog_emu_cc != no; then + save_CC=$CC + save_CFLAGS=$CFLAGS + save_CPPFLAGS=$CPPFLAGS + CC=$ac_cv_prog_emu_cc + CFLAGS="" + CPPFLAGS="" + AC_TRY_COMPILE([],[ +#if defined(__clang_major__) && __clang_major__ >= 3 + /* clang 3.x or later is fine */ +#elif defined(__llvm__) +#error "this version of llvm is unable to correctly compile beam_emu.c" +#endif + __label__ lbl1; + __label__ lbl2; + int x = magic(); + static void *jtab[2]; + + jtab[0] = &&lbl1; + jtab[1] = &&lbl2; + goto *jtab[x]; + lbl1: + return 1; + lbl2: + return 2; + ],ac_cv_prog_emu_cc=$CC,ac_cv_prog_emu_cc=no) + CC=$save_CC + CFLAGS=$save_CFLAGS + CPPFLAGS=$save_CPPFLAGS +fi +]) +if test $ac_cv_prog_emu_cc = no; then + AC_DEFINE(NO_JUMP_TABLE,[],[Defined if no found C compiler can handle jump tables]) + EMU_CC=$CC +else + EMU_CC=$ac_cv_prog_emu_cc +fi +AC_SUBST(EMU_CC) +]) + + + +dnl ---------------------------------------------------------------------- +dnl +dnl LM_PROG_INSTALL_DIR +dnl +dnl This macro may be used by any OTP application. +dnl +dnl Figure out how to create directories with parents. +dnl (In my opinion INSTALL_DIR is a bad name, MKSUBDIRS or something is better) +dnl +dnl We prefer 'install -d', but use 'mkdir -p' if it exists. +dnl If none of these methods works, we give up. +dnl + + +AC_DEFUN(LM_PROG_INSTALL_DIR, +[AC_CACHE_CHECK(how to create a directory including parents, +ac_cv_prog_mkdir_p, +[ +temp_name_base=config.$$ +temp_name=$temp_name_base/x/y/z +$INSTALL -d $temp_name >/dev/null 2>&1 +ac_cv_prog_mkdir_p=none +if test -d $temp_name; then + ac_cv_prog_mkdir_p="$INSTALL -d" +else + mkdir -p $temp_name >/dev/null 2>&1 + if test -d $temp_name; then + ac_cv_prog_mkdir_p="mkdir -p" + fi +fi +rm -fr $temp_name_base +]) + +case "${ac_cv_prog_mkdir_p}" in + none) AC_MSG_ERROR(don't know how create directories with parents) ;; + *) INSTALL_DIR="$ac_cv_prog_mkdir_p" AC_SUBST(INSTALL_DIR) ;; +esac +]) + + +dnl ---------------------------------------------------------------------- +dnl +dnl LM_PROG_PERL5 +dnl +dnl Try to find perl version 5. If found set PERL to the absolute path +dnl of the program, if not found set PERL to false. +dnl +dnl On some systems /usr/bin/perl is perl 4 and e.g. +dnl /usr/local/bin/perl is perl 5. We try to handle this case by +dnl putting a couple of +dnl Tries to handle the case that there are two programs called perl +dnl in the path and one of them is perl 5 and the other isn't. +dnl +AC_DEFUN(LM_PROG_PERL5, +[AC_PATH_PROGS(PERL, perl5 perl, false, + /usr/local/bin:/opt/local/bin:/usr/local/gnu/bin:${PATH}) +changequote(, )dnl +dnl[ That bracket is needed to balance the right bracket below +if test "$PERL" = "false" || $PERL -e 'exit ($] >= 5)'; then +changequote([, ])dnl + ac_cv_path_PERL=false + PERL=false +dnl AC_MSG_WARN(perl version 5 not found) +fi +])dnl + + +dnl ---------------------------------------------------------------------- +dnl +dnl LM_DECL_SO_BSDCOMPAT +dnl +dnl Check if the system has the SO_BSDCOMPAT flag on sockets (linux) +dnl +AC_DEFUN(LM_DECL_SO_BSDCOMPAT, +[AC_CACHE_CHECK([for SO_BSDCOMPAT declaration], ac_cv_decl_so_bsdcompat, +AC_TRY_COMPILE([#include <sys/socket.h>], [int i = SO_BSDCOMPAT;], + ac_cv_decl_so_bsdcompat=yes, + ac_cv_decl_so_bsdcompat=no)) + +case "${ac_cv_decl_so_bsdcompat}" in + "yes" ) AC_DEFINE(HAVE_SO_BSDCOMPAT,[], + [Define if you have SO_BSDCOMPAT flag on sockets]) ;; + * ) ;; +esac +]) + + +dnl ---------------------------------------------------------------------- +dnl +dnl LM_DECL_INADDR_LOOPBACK +dnl +dnl Try to find declaration of INADDR_LOOPBACK, if nowhere provide a default +dnl + +AC_DEFUN(LM_DECL_INADDR_LOOPBACK, +[AC_CACHE_CHECK([for INADDR_LOOPBACK in netinet/in.h], + ac_cv_decl_inaddr_loopback, +[AC_TRY_COMPILE([#include <sys/types.h> +#include <netinet/in.h>], [int i = INADDR_LOOPBACK;], +ac_cv_decl_inaddr_loopback=yes, ac_cv_decl_inaddr_loopback=no) +]) + +if test ${ac_cv_decl_inaddr_loopback} = no; then + AC_CACHE_CHECK([for INADDR_LOOPBACK in rpc/types.h], + ac_cv_decl_inaddr_loopback_rpc, + AC_TRY_COMPILE([#include <rpc/types.h>], + [int i = INADDR_LOOPBACK;], + ac_cv_decl_inaddr_loopback_rpc=yes, + ac_cv_decl_inaddr_loopback_rpc=no)) + + case "${ac_cv_decl_inaddr_loopback_rpc}" in + "yes" ) + AC_DEFINE(DEF_INADDR_LOOPBACK_IN_RPC_TYPES_H,[], + [Define if you need to include rpc/types.h to get INADDR_LOOPBACK defined]) ;; + * ) + AC_CACHE_CHECK([for INADDR_LOOPBACK in winsock2.h], + ac_cv_decl_inaddr_loopback_winsock2, + AC_TRY_COMPILE([#define WIN32_LEAN_AND_MEAN + #include <winsock2.h>], + [int i = INADDR_LOOPBACK;], + ac_cv_decl_inaddr_loopback_winsock2=yes, + ac_cv_decl_inaddr_loopback_winsock2=no)) + case "${ac_cv_decl_inaddr_loopback_winsock2}" in + "yes" ) + AC_DEFINE(DEF_INADDR_LOOPBACK_IN_WINSOCK2_H,[], + [Define if you need to include winsock2.h to get INADDR_LOOPBACK defined]) ;; + * ) + # couldn't find it anywhere + AC_DEFINE(HAVE_NO_INADDR_LOOPBACK,[], + [Define if you don't have a definition of INADDR_LOOPBACK]) ;; + esac;; + esac +fi +]) + + +dnl ---------------------------------------------------------------------- +dnl +dnl LM_STRUCT_SOCKADDR_SA_LEN +dnl +dnl Check if the sockaddr structure has the field sa_len +dnl + +AC_DEFUN(LM_STRUCT_SOCKADDR_SA_LEN, +[AC_CACHE_CHECK([whether struct sockaddr has sa_len field], + ac_cv_struct_sockaddr_sa_len, +AC_TRY_COMPILE([#include <sys/types.h> +#include <sys/socket.h>], [struct sockaddr s; s.sa_len = 10;], + ac_cv_struct_sockaddr_sa_len=yes, ac_cv_struct_sockaddr_sa_len=no)) + +dnl FIXME convbreak +case ${ac_cv_struct_sockaddr_sa_len} in + "no" ) AC_DEFINE(NO_SA_LEN,[1],[Define if you dont have salen]) ;; + *) ;; +esac +]) + +dnl ---------------------------------------------------------------------- +dnl +dnl LM_STRUCT_EXCEPTION +dnl +dnl Check to see whether the system supports the matherr function +dnl and its associated type "struct exception". +dnl + +AC_DEFUN(LM_STRUCT_EXCEPTION, +[AC_CACHE_CHECK([for struct exception (and matherr function)], + ac_cv_struct_exception, +AC_TRY_COMPILE([#include <math.h>], + [struct exception x; x.type = DOMAIN; x.type = SING;], + ac_cv_struct_exception=yes, ac_cv_struct_exception=no)) + +case "${ac_cv_struct_exception}" in + "yes" ) AC_DEFINE(USE_MATHERR,[1],[Define if you have matherr() function and struct exception type]) ;; + * ) ;; +esac +]) + + +dnl ---------------------------------------------------------------------- +dnl +dnl LM_SYS_IPV6 +dnl +dnl Check for ipv6 support and what the in6_addr structure is called. +dnl (early linux used in_addr6 insted of in6_addr) +dnl + +AC_DEFUN(LM_SYS_IPV6, +[AC_MSG_CHECKING(for IP version 6 support) +AC_CACHE_VAL(ac_cv_sys_ipv6_support, +[ok_so_far=yes + AC_TRY_COMPILE([#include <sys/types.h> +#ifdef __WIN32__ +#include <winsock2.h> +#include <ws2tcpip.h> +#else +#include <netinet/in.h> +#endif], + [struct in6_addr a6; struct sockaddr_in6 s6;], ok_so_far=yes, ok_so_far=no) + +if test $ok_so_far = yes; then + ac_cv_sys_ipv6_support=yes +else + AC_TRY_COMPILE([#include <sys/types.h> +#ifdef __WIN32__ +#include <winsock2.h> +#include <ws2tcpip.h> +#else +#include <netinet/in.h> +#endif], + [struct in_addr6 a6; struct sockaddr_in6 s6;], + ac_cv_sys_ipv6_support=in_addr6, ac_cv_sys_ipv6_support=no) +fi +])dnl + +dnl +dnl Have to use old style AC_DEFINE due to BC with old autoconf. +dnl + +case ${ac_cv_sys_ipv6_support} in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_IN6,[1],[Define if ipv6 is present]) + ;; + in_addr6) + AC_MSG_RESULT([yes (but I am redefining in_addr6 to in6_addr)]) + AC_DEFINE(HAVE_IN6,[1],[Define if ipv6 is present]) + AC_DEFINE(HAVE_IN_ADDR6_STRUCT,[],[Early linux used in_addr6 instead of in6_addr, define if you have this]) + ;; + *) + AC_MSG_RESULT(no) + ;; +esac +]) + + +dnl ---------------------------------------------------------------------- +dnl +dnl LM_SYS_MULTICAST +dnl +dnl Check for multicast support. Only checks for multicast options in +dnl setsockopt(), no check is performed that multicasting actually works. +dnl If options are found defines HAVE_MULTICAST_SUPPORT +dnl + +AC_DEFUN(LM_SYS_MULTICAST, +[AC_CACHE_CHECK([for multicast support], ac_cv_sys_multicast_support, +[AC_EGREP_CPP(yes, +[#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#if defined(IP_MULTICAST_TTL) && defined(IP_MULTICAST_LOOP) && defined(IP_MULTICAST_IF) && defined(IP_ADD_MEMBERSHIP) && defined(IP_DROP_MEMBERSHIP) +yes +#endif +], ac_cv_sys_multicast_support=yes, ac_cv_sys_multicast_support=no)]) +if test $ac_cv_sys_multicast_support = yes; then + AC_DEFINE(HAVE_MULTICAST_SUPPORT,[1], + [Define if setsockopt() accepts multicast options]) +fi +])dnl + + +dnl ---------------------------------------------------------------------- +dnl +dnl LM_DECL_SYS_ERRLIST +dnl +dnl Define SYS_ERRLIST_DECLARED if the variable sys_errlist is declared +dnl in a system header file, stdio.h or errno.h. +dnl + +AC_DEFUN(LM_DECL_SYS_ERRLIST, +[AC_CACHE_CHECK([for sys_errlist declaration in stdio.h or errno.h], + ac_cv_decl_sys_errlist, +[AC_TRY_COMPILE([#include <stdio.h> +#include <errno.h>], [char *msg = *(sys_errlist + 1);], + ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)]) +if test $ac_cv_decl_sys_errlist = yes; then + AC_DEFINE(SYS_ERRLIST_DECLARED,[], + [define if the variable sys_errlist is declared in a system header file]) +fi +]) + + +dnl ---------------------------------------------------------------------- +dnl +dnl LM_CHECK_FUNC_DECL( funname, declaration [, extra includes +dnl [, action-if-found [, action-if-not-found]]] ) +dnl +dnl Checks if the declaration "declaration" of "funname" conflicts +dnl with the header files idea of how the function should be +dnl declared. It is useful on systems which lack prototypes and you +dnl need to provide your own (e.g. when you want to take the address +dnl of a function). The 4'th argument is expanded if conflicting, +dnl the 5'th argument otherwise +dnl +dnl + +AC_DEFUN(LM_CHECK_FUNC_DECL, +[AC_MSG_CHECKING([for conflicting declaration of $1]) +AC_CACHE_VAL(ac_cv_func_decl_$1, +[AC_TRY_COMPILE([#include <stdio.h> +$3],[$2 +char *c = (char *)$1; +], eval "ac_cv_func_decl_$1=no", eval "ac_cv_func_decl_$1=yes")]) +if eval "test \"`echo '$ac_cv_func_decl_'$1`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$4], , :, [$4]) +else + AC_MSG_RESULT(no) +ifelse([$5], , , [$5 +])dnl +fi +]) + +dnl ---------------------------------------------------------------------- +dnl +dnl AC_DOUBLE_MIDDLE_ENDIAN +dnl +dnl Checks whether doubles are represented in "middle-endian" format. +dnl Sets ac_cv_double_middle_endian={no,yes,unknown} accordingly, +dnl as well as DOUBLE_MIDDLE_ENDIAN. +dnl +dnl + +AC_DEFUN([AC_C_DOUBLE_MIDDLE_ENDIAN], +[AC_CACHE_CHECK(whether double word ordering is middle-endian, ac_cv_c_double_middle_endian, +[# It does not; compile a test program. +AC_RUN_IFELSE( +[AC_LANG_SOURCE([[#include <stdlib.h> + +int +main(void) +{ + int i = 0; + int zero = 0; + int bigendian; + int zero_index = 0; + + union + { + long int l; + char c[sizeof (long int)]; + } u; + + /* we'll use the one with 32-bit words */ + union + { + double d; + unsigned int c[2]; + } vint; + + union + { + double d; + unsigned long c[2]; + } vlong; + + union + { + double d; + unsigned short c[2]; + } vshort; + + + /* Are we little or big endian? From Harbison&Steele. */ + u.l = 1; + bigendian = (u.c[sizeof (long int) - 1] == 1); + + zero_index = bigendian ? 1 : 0; + + vint.d = 1.0; + vlong.d = 1.0; + vshort.d = 1.0; + + if (sizeof(unsigned int) == 4) + { + if (vint.c[zero_index] != 0) + zero = 1; + } + else if (sizeof(unsigned long) == 4) + { + if (vlong.c[zero_index] != 0) + zero = 1; + } + else if (sizeof(unsigned short) == 4) + { + if (vshort.c[zero_index] != 0) + zero = 1; + } + + exit (zero); +} +]])], + [ac_cv_c_double_middle_endian=no], + [ac_cv_c_double_middle_endian=yes], + [ac_cv_c_double_middle=unknown])]) +case $ac_cv_c_double_middle_endian in + yes) + m4_default([$1], + [AC_DEFINE([DOUBLE_MIDDLE_ENDIAN], 1, + [Define to 1 if your processor stores the words in a double in + middle-endian format (like some ARMs).])]) ;; + no) + $2 ;; + *) + m4_default([$3], + [AC_MSG_WARN([unknown double endianness +presetting ac_cv_c_double_middle_endian=no (or yes) will help])]) ;; +esac +])# AC_C_DOUBLE_MIDDLE_ENDIAN + + +dnl ---------------------------------------------------------------------- +dnl +dnl LM_CHECK_THR_LIB +dnl +dnl This macro may be used by any OTP application. +dnl +dnl LM_CHECK_THR_LIB sets THR_LIBS, THR_DEFS, and THR_LIB_NAME. It also +dnl checks for some pthread headers which will appear in DEFS or config.h. +dnl + +AC_DEFUN(LM_CHECK_THR_LIB, +[ + +NEED_NPTL_PTHREAD_H=no + +dnl win32? +AC_MSG_CHECKING([for native win32 threads]) +if test "X$host_os" = "Xwin32"; then + AC_MSG_RESULT(yes) + THR_DEFS="-DWIN32_THREADS" + THR_LIBS= + THR_LIB_NAME=win32_threads + THR_LIB_TYPE=win32_threads +else + AC_MSG_RESULT(no) + THR_DEFS= + THR_LIBS= + THR_LIB_NAME= + THR_LIB_TYPE=posix_unknown + +dnl Try to find POSIX threads + +dnl The usual pthread lib... + AC_CHECK_LIB(pthread, pthread_create, THR_LIBS="-lpthread") + +dnl Very old versions of FreeBSD have pthreads in special c library, c_r... + if test "x$THR_LIBS" = "x"; then + AC_CHECK_LIB(c_r, pthread_create, THR_LIBS="-lc_r") + fi + +dnl QNX has pthreads in standard C library + if test "x$THR_LIBS" = "x"; then + AC_CHECK_FUNC(pthread_create, THR_LIBS="none_needed") + fi + +dnl On ofs1 the '-pthread' switch should be used + if test "x$THR_LIBS" = "x"; then + AC_MSG_CHECKING([if the '-pthread' switch can be used]) + saved_cflags=$CFLAGS + CFLAGS="$CFLAGS -pthread" + AC_TRY_LINK([#include <pthread.h>], + pthread_create((void*)0,(void*)0,(void*)0,(void*)0);, + [THR_DEFS="-pthread" + THR_LIBS="-pthread"]) + CFLAGS=$saved_cflags + if test "x$THR_LIBS" != "x"; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + fi + + if test "x$THR_LIBS" != "x"; then + THR_DEFS="$THR_DEFS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS" + THR_LIB_NAME=pthread + if test "x$THR_LIBS" = "xnone_needed"; then + THR_LIBS= + fi + case $host_os in + solaris*) + THR_DEFS="$THR_DEFS -D_POSIX_PTHREAD_SEMANTICS" ;; + linux*) + THR_DEFS="$THR_DEFS -D_POSIX_THREAD_SAFE_FUNCTIONS" + + LM_CHECK_GETCONF + AC_MSG_CHECKING(for Native POSIX Thread Library) + libpthr_vsn=`$GETCONF GNU_LIBPTHREAD_VERSION 2>/dev/null` + if test $? -eq 0; then + case "$libpthr_vsn" in + *nptl*|*NPTL*) nptl=yes;; + *) nptl=no;; + esac + elif test "$cross_compiling" = "yes"; then + case "$erl_xcomp_linux_nptl" in + "") nptl=cross;; + yes|no) nptl=$erl_xcomp_linux_nptl;; + *) AC_MSG_ERROR([Bad erl_xcomp_linux_nptl value: $erl_xcomp_linux_nptl]);; + esac + else + nptl=no + fi + AC_MSG_RESULT($nptl) + if test $nptl = cross; then + nptl=yes + AC_MSG_WARN([result yes guessed because of cross compilation]) + fi + if test $nptl = yes; then + THR_LIB_TYPE=posix_nptl + need_nptl_incldir=no + AC_CHECK_HEADER(nptl/pthread.h, + [need_nptl_incldir=yes + NEED_NPTL_PTHREAD_H=yes]) + if test $need_nptl_incldir = yes; then + # Ahh... + nptl_path="$C_INCLUDE_PATH:$CPATH" + if test X$cross_compiling != Xyes; then + nptl_path="$nptl_path:/usr/local/include:/usr/include" + else + IROOT="$erl_xcomp_isysroot" + test "$IROOT" != "" || IROOT="$erl_xcomp_sysroot" + test "$IROOT" != "" || AC_MSG_ERROR([Don't know where to search for includes! Please set erl_xcomp_isysroot]) + nptl_path="$nptl_path:$IROOT/usr/local/include:$IROOT/usr/include" + fi + nptl_ws_path= + save_ifs="$IFS"; IFS=":" + for dir in $nptl_path; do + if test "x$dir" != "x"; then + nptl_ws_path="$nptl_ws_path $dir" + fi + done + IFS=$save_ifs + nptl_incldir= + for dir in $nptl_ws_path; do + AC_CHECK_HEADER($dir/nptl/pthread.h, + nptl_incldir=$dir/nptl) + if test "x$nptl_incldir" != "x"; then + THR_DEFS="$THR_DEFS -isystem $nptl_incldir" + break + fi + done + if test "x$nptl_incldir" = "x"; then + AC_MSG_ERROR(Failed to locate nptl system include directory) + fi + fi + fi + ;; + *) ;; + esac + + dnl We sometimes need THR_DEFS in order to find certain headers + dnl (at least for pthread.h on osf1). + saved_cppflags=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $THR_DEFS" + + dnl + dnl Check for headers + dnl + + AC_CHECK_HEADER(pthread.h, + AC_DEFINE(HAVE_PTHREAD_H, 1, \ +[Define if you have the <pthread.h> header file.])) + + dnl Some Linuxes have <pthread/mit/pthread.h> instead of <pthread.h> + AC_CHECK_HEADER(pthread/mit/pthread.h, \ + AC_DEFINE(HAVE_MIT_PTHREAD_H, 1, \ +[Define if the pthread.h header file is in pthread/mit directory.])) + + dnl restore CPPFLAGS + CPPFLAGS=$saved_cppflags + + fi +fi + +]) + +AC_DEFUN(ERL_INTERNAL_LIBS, +[ + +ERTS_INTERNAL_X_LIBS= + +AC_CHECK_LIB(kstat, kstat_open, +[AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat]) +ERTS_INTERNAL_X_LIBS="$ERTS_INTERNAL_X_LIBS -lkstat"]) + +AC_SUBST(ERTS_INTERNAL_X_LIBS) + +]) + +AC_DEFUN(ETHR_CHK_SYNC_OP, +[ + AC_MSG_CHECKING([for $3-bit $1()]) + case "$2" in + "1") sync_call="$1(&var);";; + "2") sync_call="$1(&var, ($4) 0);";; + "3") sync_call="$1(&var, ($4) 0, ($4) 0);";; + esac + have_sync_op=no + AC_TRY_LINK([], + [ + $4 res; + volatile $4 var; + res = $sync_call + ], + [have_sync_op=yes]) + test $have_sync_op = yes && $5 + AC_MSG_RESULT([$have_sync_op]) +]) + +AC_DEFUN(ETHR_CHK_INTERLOCKED, +[ + ilckd="$1" + AC_MSG_CHECKING([for ${ilckd}()]) + case "$2" in + "1") ilckd_call="${ilckd}(var);";; + "2") ilckd_call="${ilckd}(var, ($3) 0);";; + "3") ilckd_call="${ilckd}(var, ($3) 0, ($3) 0);";; + "4") ilckd_call="${ilckd}(var, ($3) 0, ($3) 0, arr);";; + esac + have_interlocked_op=no + AC_TRY_LINK( + [ + #define WIN32_LEAN_AND_MEAN + #include <windows.h> + #include <intrin.h> + ], + [ + volatile $3 *var; + volatile $3 arr[2]; + + $ilckd_call + return 0; + ], + [have_interlocked_op=yes]) + test $have_interlocked_op = yes && $4 + AC_MSG_RESULT([$have_interlocked_op]) +]) + +dnl ---------------------------------------------------------------------- +dnl +dnl ERL_FIND_ETHR_LIB +dnl +dnl NOTE! This macro may be changed at any time! Should *only* be used by +dnl ERTS! +dnl +dnl Find a thread library to use. Sets ETHR_LIBS to libraries to link +dnl with, ETHR_X_LIBS to extra libraries to link with (same as ETHR_LIBS +dnl except that the ethread lib itself is not included), ETHR_DEFS to +dnl defines to compile with, ETHR_THR_LIB_BASE to the name of the +dnl thread library which the ethread library is based on, and ETHR_LIB_NAME +dnl to the name of the library where the ethread implementation is located. +dnl ERL_FIND_ETHR_LIB currently searches for 'pthreads', and +dnl 'win32_threads'. If no thread library was found ETHR_LIBS, ETHR_X_LIBS, +dnl ETHR_DEFS, ETHR_THR_LIB_BASE, and ETHR_LIB_NAME are all set to the +dnl empty string. +dnl + +AC_DEFUN(ERL_FIND_ETHR_LIB, +[ + +LM_CHECK_THR_LIB +ERL_INTERNAL_LIBS + +ethr_have_native_atomics=no +ethr_have_native_spinlock=no +ETHR_THR_LIB_BASE="$THR_LIB_NAME" +ETHR_THR_LIB_BASE_TYPE="$THR_LIB_TYPE" +ETHR_DEFS="$THR_DEFS" +ETHR_X_LIBS="$THR_LIBS $ERTS_INTERNAL_X_LIBS" +ETHR_LIBS= +ETHR_LIB_NAME= + +ethr_modified_default_stack_size= + +dnl Name of lib where ethread implementation is located +ethr_lib_name=ethread + +case "$THR_LIB_NAME" in + + win32_threads) + ETHR_THR_LIB_BASE_DIR=win + # * _WIN32_WINNT >= 0x0400 is needed for + # TryEnterCriticalSection + # * _WIN32_WINNT >= 0x0403 is needed for + # InitializeCriticalSectionAndSpinCount + # The ethread lib will refuse to build if _WIN32_WINNT < 0x0403. + # + # -D_WIN32_WINNT should have been defined in $CPPFLAGS; fetch it + # and save it in ETHR_DEFS. + found_win32_winnt=no + for cppflag in $CPPFLAGS; do + case $cppflag in + -DWINVER*) + ETHR_DEFS="$ETHR_DEFS $cppflag" + ;; + -D_WIN32_WINNT*) + ETHR_DEFS="$ETHR_DEFS $cppflag" + found_win32_winnt=yes + ;; + *) + ;; + esac + done + if test $found_win32_winnt = no; then + AC_MSG_ERROR([-D_WIN32_WINNT missing in CPPFLAGS]) + fi + + AC_DEFINE(ETHR_WIN32_THREADS, 1, [Define if you have win32 threads]) + + ETHR_CHK_INTERLOCKED([_InterlockedDecrement], [1], [long], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDDECREMENT, 1, [Define if you have _InterlockedDecrement()])) + ETHR_CHK_INTERLOCKED([_InterlockedDecrement_rel], [1], [long], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDDECREMENT_REL, 1, [Define if you have _InterlockedDecrement_rel()])) + ETHR_CHK_INTERLOCKED([_InterlockedIncrement], [1], [long], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDINCREMENT, 1, [Define if you have _InterlockedIncrement()])) + ETHR_CHK_INTERLOCKED([_InterlockedIncrement_acq], [1], [long], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDINCREMENT_ACQ, 1, [Define if you have _InterlockedIncrement_acq()])) + ETHR_CHK_INTERLOCKED([_InterlockedExchangeAdd], [2], [long], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDEXCHANGEADD, 1, [Define if you have _InterlockedExchangeAdd()])) + ETHR_CHK_INTERLOCKED([_InterlockedExchangeAdd_acq], [2], [long], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDEXCHANGEADD_ACQ, 1, [Define if you have _InterlockedExchangeAdd_acq()])) + ETHR_CHK_INTERLOCKED([_InterlockedAnd], [2], [long], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDAND, 1, [Define if you have _InterlockedAnd()])) + ETHR_CHK_INTERLOCKED([_InterlockedOr], [2], [long], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDOR, 1, [Define if you have _InterlockedOr()])) + ETHR_CHK_INTERLOCKED([_InterlockedExchange], [2], [long], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDEXCHANGE, 1, [Define if you have _InterlockedExchange()])) + ETHR_CHK_INTERLOCKED([_InterlockedCompareExchange], [3], [long], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDCOMPAREEXCHANGE, 1, [Define if you have _InterlockedCompareExchange()])) + test "$have_interlocked_op" = "yes" && ethr_have_native_atomics=yes + ETHR_CHK_INTERLOCKED([_InterlockedCompareExchange_acq], [3], [long], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDCOMPAREEXCHANGE_ACQ, 1, [Define if you have _InterlockedCompareExchange_acq()])) + test "$have_interlocked_op" = "yes" && ethr_have_native_atomics=yes + ETHR_CHK_INTERLOCKED([_InterlockedCompareExchange_rel], [3], [long], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDCOMPAREEXCHANGE_REL, 1, [Define if you have _InterlockedCompareExchange_rel()])) + test "$have_interlocked_op" = "yes" && ethr_have_native_atomics=yes + + ETHR_CHK_INTERLOCKED([_InterlockedDecrement64], [1], [__int64], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDDECREMENT64, 1, [Define if you have _InterlockedDecrement64()])) + ETHR_CHK_INTERLOCKED([_InterlockedDecrement64_rel], [1], [__int64], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDDECREMENT64_REL, 1, [Define if you have _InterlockedDecrement64_rel()])) + ETHR_CHK_INTERLOCKED([_InterlockedIncrement64], [1], [__int64], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDINCREMENT64, 1, [Define if you have _InterlockedIncrement64()])) + ETHR_CHK_INTERLOCKED([_InterlockedIncrement64_acq], [1], [__int64], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDINCREMENT64_ACQ, 1, [Define if you have _InterlockedIncrement64_acq()])) + ETHR_CHK_INTERLOCKED([_InterlockedExchangeAdd64], [2], [__int64], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDEXCHANGEADD64, 1, [Define if you have _InterlockedExchangeAdd64()])) + ETHR_CHK_INTERLOCKED([_InterlockedExchangeAdd64_acq], [2], [__int64], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDEXCHANGEADD64_ACQ, 1, [Define if you have _InterlockedExchangeAdd64_acq()])) + ETHR_CHK_INTERLOCKED([_InterlockedAnd64], [2], [__int64], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDAND64, 1, [Define if you have _InterlockedAnd64()])) + ETHR_CHK_INTERLOCKED([_InterlockedOr64], [2], [__int64], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDOR64, 1, [Define if you have _InterlockedOr64()])) + ETHR_CHK_INTERLOCKED([_InterlockedExchange64], [2], [__int64], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDEXCHANGE64, 1, [Define if you have _InterlockedExchange64()])) + ETHR_CHK_INTERLOCKED([_InterlockedCompareExchange64], [3], [__int64], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDCOMPAREEXCHANGE64, 1, [Define if you have _InterlockedCompareExchange64()])) + test "$have_interlocked_op" = "yes" && ethr_have_native_atomics=yes + ETHR_CHK_INTERLOCKED([_InterlockedCompareExchange64_acq], [3], [__int64], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDCOMPAREEXCHANGE64_ACQ, 1, [Define if you have _InterlockedCompareExchange64_acq()])) + test "$have_interlocked_op" = "yes" && ethr_have_native_atomics=yes + ETHR_CHK_INTERLOCKED([_InterlockedCompareExchange64_rel], [3], [__int64], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDCOMPAREEXCHANGE64_REL, 1, [Define if you have _InterlockedCompareExchange64_rel()])) + test "$have_interlocked_op" = "yes" && ethr_have_native_atomics=yes + + ETHR_CHK_INTERLOCKED([_InterlockedCompareExchange128], [4], [__int64], AC_DEFINE_UNQUOTED(ETHR_HAVE__INTERLOCKEDCOMPAREEXCHANGE128, 1, [Define if you have _InterlockedCompareExchange128()])) + + test "$ethr_have_native_atomics" = "yes" && ethr_have_native_spinlock=yes + ;; + + pthread) + ETHR_THR_LIB_BASE_DIR=pthread + AC_DEFINE(ETHR_PTHREADS, 1, [Define if you have pthreads]) + case $host_os in + openbsd*) + # The default stack size is insufficient for our needs + # on OpenBSD. We increase it to 256 kilo words. + ethr_modified_default_stack_size=256;; + linux*) + ETHR_DEFS="$ETHR_DEFS -D_GNU_SOURCE" + + if test X$cross_compiling = Xyes; then + case X$erl_xcomp_linux_usable_sigusrx in + X) usable_sigusrx=cross;; + Xyes|Xno) usable_sigusrx=$erl_xcomp_linux_usable_sigusrx;; + *) AC_MSG_ERROR([Bad erl_xcomp_linux_usable_sigusrx value: $erl_xcomp_linux_usable_sigusrx]);; + esac + case X$erl_xcomp_linux_usable_sigaltstack in + X) usable_sigaltstack=cross;; + Xyes|Xno) usable_sigaltstack=$erl_xcomp_linux_usable_sigaltstack;; + *) AC_MSG_ERROR([Bad erl_xcomp_linux_usable_sigaltstack value: $erl_xcomp_linux_usable_sigaltstack]);; + esac + else + # FIXME: Test for actual problems instead of kernel versions + linux_kernel_vsn_=`uname -r` + case $linux_kernel_vsn_ in + [[0-1]].*|2.[[0-1]]|2.[[0-1]].*) + usable_sigusrx=no + usable_sigaltstack=no;; + 2.[[2-3]]|2.[[2-3]].*) + usable_sigusrx=yes + usable_sigaltstack=no;; + *) + usable_sigusrx=yes + usable_sigaltstack=yes;; + esac + fi + + AC_MSG_CHECKING(if SIGUSR1 and SIGUSR2 can be used) + AC_MSG_RESULT($usable_sigusrx) + if test $usable_sigusrx = cross; then + usable_sigusrx=yes + AC_MSG_WARN([result yes guessed because of cross compilation]) + fi + if test $usable_sigusrx = no; then + ETHR_DEFS="$ETHR_DEFS -DETHR_UNUSABLE_SIGUSRX" + fi + + AC_MSG_CHECKING(if sigaltstack can be used) + AC_MSG_RESULT($usable_sigaltstack) + if test $usable_sigaltstack = cross; then + usable_sigaltstack=yes + AC_MSG_WARN([result yes guessed because of cross compilation]) + fi + if test $usable_sigaltstack = no; then + ETHR_DEFS="$ETHR_DEFS -DETHR_UNUSABLE_SIGALTSTACK" + fi + ;; + *) ;; + esac + + dnl We sometimes need ETHR_DEFS in order to find certain headers + dnl (at least for pthread.h on osf1). + saved_cppflags="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $ETHR_DEFS" + + dnl We need the thread library in order to find some functions + saved_libs="$LIBS" + LIBS="$LIBS $ETHR_X_LIBS" + + dnl + dnl Check for headers + dnl + + AC_CHECK_HEADER(pthread.h, \ + AC_DEFINE(ETHR_HAVE_PTHREAD_H, 1, \ +[Define if you have the <pthread.h> header file.])) + + dnl Some Linuxes have <pthread/mit/pthread.h> instead of <pthread.h> + AC_CHECK_HEADER(pthread/mit/pthread.h, \ + AC_DEFINE(ETHR_HAVE_MIT_PTHREAD_H, 1, \ +[Define if the pthread.h header file is in pthread/mit directory.])) + + if test $NEED_NPTL_PTHREAD_H = yes; then + AC_DEFINE(ETHR_NEED_NPTL_PTHREAD_H, 1, \ +[Define if you need the <nptl/pthread.h> header file.]) + fi + + AC_CHECK_HEADER(sched.h, \ + AC_DEFINE(ETHR_HAVE_SCHED_H, 1, \ +[Define if you have the <sched.h> header file.])) + + AC_CHECK_HEADER(sys/time.h, \ + AC_DEFINE(ETHR_HAVE_SYS_TIME_H, 1, \ +[Define if you have the <sys/time.h> header file.])) + + AC_TRY_COMPILE([#include <time.h> + #include <sys/time.h>], + [struct timeval *tv; return 0;], + AC_DEFINE(ETHR_TIME_WITH_SYS_TIME, 1, \ +[Define if you can safely include both <sys/time.h> and <time.h>.])) + + + dnl + dnl Check for functions + dnl + + AC_CHECK_FUNC(pthread_spin_lock, \ + [ethr_have_native_spinlock=yes \ + AC_DEFINE(ETHR_HAVE_PTHREAD_SPIN_LOCK, 1, \ +[Define if you have the pthread_spin_lock function.])]) + + have_sched_yield=no + have_librt_sched_yield=no + AC_CHECK_FUNC(sched_yield, [have_sched_yield=yes]) + if test $have_sched_yield = no; then + AC_CHECK_LIB(rt, sched_yield, + [have_librt_sched_yield=yes + ETHR_X_LIBS="$ETHR_X_LIBS -lrt"]) + fi + if test $have_sched_yield = yes || test $have_librt_sched_yield = yes; then + AC_DEFINE(ETHR_HAVE_SCHED_YIELD, 1, [Define if you have the sched_yield() function.]) + AC_MSG_CHECKING([whether sched_yield() returns an int]) + sched_yield_ret_int=no + AC_TRY_COMPILE([ + #ifdef ETHR_HAVE_SCHED_H + #include <sched.h> + #endif + ], + [int sched_yield();], + [sched_yield_ret_int=yes]) + AC_MSG_RESULT([$sched_yield_ret_int]) + if test $sched_yield_ret_int = yes; then + AC_DEFINE(ETHR_SCHED_YIELD_RET_INT, 1, [Define if sched_yield() returns an int.]) + fi + fi + + have_pthread_yield=no + AC_CHECK_FUNC(pthread_yield, [have_pthread_yield=yes]) + if test $have_pthread_yield = yes; then + AC_DEFINE(ETHR_HAVE_PTHREAD_YIELD, 1, [Define if you have the pthread_yield() function.]) + AC_MSG_CHECKING([whether pthread_yield() returns an int]) + pthread_yield_ret_int=no + AC_TRY_COMPILE([ + #if defined(ETHR_NEED_NPTL_PTHREAD_H) + #include <nptl/pthread.h> + #elif defined(ETHR_HAVE_MIT_PTHREAD_H) + #include <pthread/mit/pthread.h> + #elif defined(ETHR_HAVE_PTHREAD_H) + #include <pthread.h> + #endif + ], + [int pthread_yield();], + [pthread_yield_ret_int=yes]) + AC_MSG_RESULT([$pthread_yield_ret_int]) + if test $pthread_yield_ret_int = yes; then + AC_DEFINE(ETHR_PTHREAD_YIELD_RET_INT, 1, [Define if pthread_yield() returns an int.]) + fi + fi + + have_pthread_rwlock_init=no + AC_CHECK_FUNC(pthread_rwlock_init, [have_pthread_rwlock_init=yes]) + if test $have_pthread_rwlock_init = yes; then + + ethr_have_pthread_rwlockattr_setkind_np=no + AC_CHECK_FUNC(pthread_rwlockattr_setkind_np, + [ethr_have_pthread_rwlockattr_setkind_np=yes]) + + if test $ethr_have_pthread_rwlockattr_setkind_np = yes; then + AC_DEFINE(ETHR_HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP, 1, \ +[Define if you have the pthread_rwlockattr_setkind_np() function.]) + + AC_MSG_CHECKING([for PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP]) + ethr_pthread_rwlock_writer_nonrecursive_initializer_np=no + AC_TRY_LINK([ + #if defined(ETHR_NEED_NPTL_PTHREAD_H) + #include <nptl/pthread.h> + #elif defined(ETHR_HAVE_MIT_PTHREAD_H) + #include <pthread/mit/pthread.h> + #elif defined(ETHR_HAVE_PTHREAD_H) + #include <pthread.h> + #endif + ], + [ + pthread_rwlockattr_t *attr; + return pthread_rwlockattr_setkind_np(attr, + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); + ], + [ethr_pthread_rwlock_writer_nonrecursive_initializer_np=yes]) + AC_MSG_RESULT([$ethr_pthread_rwlock_writer_nonrecursive_initializer_np]) + if test $ethr_pthread_rwlock_writer_nonrecursive_initializer_np = yes; then + AC_DEFINE(ETHR_HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, 1, \ +[Define if you have the PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP rwlock attribute.]) + fi + fi + fi + + if test "$force_pthread_rwlocks" = "yes"; then + + AC_DEFINE(ETHR_FORCE_PTHREAD_RWLOCK, 1, \ +[Define if you want to force usage of pthread rwlocks]) + + if test $have_pthread_rwlock_init = yes; then + AC_MSG_WARN([Forced usage of pthread rwlocks. Note that this implementation may suffer from starvation issues.]) + else + AC_MSG_ERROR([User forced usage of pthread rwlock, but no such implementation was found]) + fi + fi + + AC_CHECK_FUNC(pthread_attr_setguardsize, \ + AC_DEFINE(ETHR_HAVE_PTHREAD_ATTR_SETGUARDSIZE, 1, \ +[Define if you have the pthread_attr_setguardsize function.])) + + linux_futex=no + AC_MSG_CHECKING([for Linux futexes]) + AC_TRY_LINK([ + #include <sys/syscall.h> + #include <unistd.h> + #include <linux/futex.h> + #include <sys/time.h> + ], + [ + int i = 1; + syscall(__NR_futex, (void *) &i, FUTEX_WAKE, 1, + (void*)0,(void*)0, 0); + syscall(__NR_futex, (void *) &i, FUTEX_WAIT, 0, + (void*)0,(void*)0, 0); + return 0; + ], + linux_futex=yes) + AC_MSG_RESULT([$linux_futex]) + test $linux_futex = yes && AC_DEFINE(ETHR_HAVE_LINUX_FUTEX, 1, [Define if you have a linux futex implementation.]) + + AC_CHECK_SIZEOF(int) + AC_CHECK_SIZEOF(long) + AC_CHECK_SIZEOF(long long) + AC_CHECK_SIZEOF(__int128_t) + + if test "$ac_cv_sizeof_int" = "4"; then + int32="int" + elif test "$ac_cv_sizeof_long" = "4"; then + int32="long" + elif test "$ac_cv_sizeof_long_long" = "4"; then + int32="long long" + else + AC_MSG_ERROR([No 32-bit type found]) + fi + + if test "$ac_cv_sizeof_int" = "8"; then + int64="int" + elif test "$ac_cv_sizeof_long" = "8"; then + int64="long" + elif test "$ac_cv_sizeof_long_long" = "8"; then + int64="long long" + else + AC_MSG_ERROR([No 64-bit type found]) + fi + + int128=no + if test "$ac_cv_sizeof___int128_t" = "16"; then + int128="__int128_t" + fi + + ETHR_CHK_SYNC_OP([__sync_val_compare_and_swap], [3], [32], [$int32], AC_DEFINE(ETHR_HAVE___SYNC_VAL_COMPARE_AND_SWAP32, 1, [Define if you have __sync_val_compare_and_swap() for 32-bit integers])) + test "$have_sync_op" = "yes" && ethr_have_native_atomics=yes + ETHR_CHK_SYNC_OP([__sync_add_and_fetch], [2], [32], [$int32], AC_DEFINE(ETHR_HAVE___SYNC_ADD_AND_FETCH32, 1, [Define if you have __sync_add_and_fetch() for 32-bit integers])) + ETHR_CHK_SYNC_OP([__sync_fetch_and_and], [2], [32], [$int32], AC_DEFINE(ETHR_HAVE___SYNC_FETCH_AND_AND32, 1, [Define if you have __sync_fetch_and_and() for 32-bit integers])) + ETHR_CHK_SYNC_OP([__sync_fetch_and_or], [2], [32], [$int32], AC_DEFINE(ETHR_HAVE___SYNC_FETCH_AND_OR32, 1, [Define if you have __sync_fetch_and_or() for 32-bit integers])) + + ETHR_CHK_SYNC_OP([__sync_val_compare_and_swap], [3], [64], [$int64], AC_DEFINE(ETHR_HAVE___SYNC_VAL_COMPARE_AND_SWAP64, 1, [Define if you have __sync_val_compare_and_swap() for 64-bit integers])) + test "$have_sync_op" = "yes" && ethr_have_native_atomics=yes + ETHR_CHK_SYNC_OP([__sync_add_and_fetch], [2], [64], [$int64], AC_DEFINE(ETHR_HAVE___SYNC_ADD_AND_FETCH64, 1, [Define if you have __sync_add_and_fetch() for 64-bit integers])) + ETHR_CHK_SYNC_OP([__sync_fetch_and_and], [2], [64], [$int64], AC_DEFINE(ETHR_HAVE___SYNC_FETCH_AND_AND64, 1, [Define if you have __sync_fetch_and_and() for 64-bit integers])) + ETHR_CHK_SYNC_OP([__sync_fetch_and_or], [2], [64], [$int64], AC_DEFINE(ETHR_HAVE___SYNC_FETCH_AND_OR64, 1, [Define if you have __sync_fetch_and_or() for 64-bit integers])) + + if test $int128 != no; then + ETHR_CHK_SYNC_OP([__sync_val_compare_and_swap], [3], [128], [$int128], AC_DEFINE(ETHR_HAVE___SYNC_VAL_COMPARE_AND_SWAP128, 1, [Define if you have __sync_val_compare_and_swap() for 128-bit integers])) + fi + + AC_MSG_CHECKING([for a usable libatomic_ops implementation]) + case "x$with_libatomic_ops" in + xno | xyes | x) + libatomic_ops_include= + ;; + *) + if test -d "${with_libatomic_ops}/include"; then + libatomic_ops_include="-I$with_libatomic_ops/include" + CPPFLAGS="$CPPFLAGS $libatomic_ops_include" + else + AC_MSG_ERROR([libatomic_ops include directory $with_libatomic_ops/include not found]) + fi;; + esac + ethr_have_libatomic_ops=no + AC_TRY_LINK([#include "atomic_ops.h"], + [ + volatile AO_t x; + AO_t y; + int z; + + AO_nop_full(); + AO_store(&x, (AO_t) 0); + z = AO_load(&x); + z = AO_compare_and_swap_full(&x, (AO_t) 0, (AO_t) 1); + ], + [ethr_have_native_atomics=yes + ethr_have_libatomic_ops=yes]) + AC_MSG_RESULT([$ethr_have_libatomic_ops]) + if test $ethr_have_libatomic_ops = yes; then + AC_CHECK_SIZEOF(AO_t, , + [ + #include <stdio.h> + #include "atomic_ops.h" + ]) + AC_DEFINE_UNQUOTED(ETHR_SIZEOF_AO_T, $ac_cv_sizeof_AO_t, [Define to the size of AO_t if libatomic_ops is used]) + + AC_DEFINE(ETHR_HAVE_LIBATOMIC_OPS, 1, [Define if you have libatomic_ops atomic operations]) + if test "x$with_libatomic_ops" != "xno" && test "x$with_libatomic_ops" != "x"; then + AC_DEFINE(ETHR_PREFER_LIBATOMIC_OPS_NATIVE_IMPLS, 1, [Define if you prefer libatomic_ops native ethread implementations]) + fi + ETHR_DEFS="$ETHR_DEFS $libatomic_ops_include" + elif test "x$with_libatomic_ops" != "xno" && test "x$with_libatomic_ops" != "x"; then + AC_MSG_ERROR([No usable libatomic_ops implementation found]) + fi + + case "$host_cpu" in + sparc | sun4u | sparc64 | sun4v) + case "$with_sparc_memory_order" in + "TSO") + AC_DEFINE(ETHR_SPARC_TSO, 1, [Define if only run in Sparc TSO mode]);; + "PSO") + AC_DEFINE(ETHR_SPARC_PSO, 1, [Define if only run in Sparc PSO, or TSO mode]);; + "RMO"|"") + AC_DEFINE(ETHR_SPARC_RMO, 1, [Define if run in Sparc RMO, PSO, or TSO mode]);; + *) + AC_MSG_ERROR([Unsupported Sparc memory order: $with_sparc_memory_order]);; + esac + ethr_have_native_atomics=yes;; + i86pc | i*86 | x86_64 | amd64) + if test "$enable_x86_out_of_order" = "yes"; then + AC_DEFINE(ETHR_X86_OUT_OF_ORDER, 1, [Define if x86/x86_64 out of order instructions should be synchronized]) + fi + ethr_have_native_atomics=yes;; + macppc | ppc | "Power Macintosh") + ethr_have_native_atomics=yes;; + tile) + ethr_have_native_atomics=yes;; + *) + ;; + esac + + test ethr_have_native_atomics = "yes" && ethr_have_native_spinlock=yes + + dnl Restore LIBS + LIBS=$saved_libs + dnl restore CPPFLAGS + CPPFLAGS=$saved_cppflags + + ;; + *) + ;; +esac + +AC_MSG_CHECKING([whether default stack size should be modified]) +if test "x$ethr_modified_default_stack_size" != "x"; then + AC_DEFINE_UNQUOTED(ETHR_MODIFIED_DEFAULT_STACK_SIZE, $ethr_modified_default_stack_size, [Define if you want to modify the default stack size]) + AC_MSG_RESULT([yes; to $ethr_modified_default_stack_size kilo words]) +else + AC_MSG_RESULT([no]) +fi + +if test "x$ETHR_THR_LIB_BASE" != "x"; then + ETHR_DEFS="-DUSE_THREADS $ETHR_DEFS" + ETHR_LIBS="-l$ethr_lib_name -lerts_internal_r $ETHR_X_LIBS" + ETHR_LIB_NAME=$ethr_lib_name +fi + +AC_CHECK_SIZEOF(void *) +AC_DEFINE_UNQUOTED(ETHR_SIZEOF_PTR, $ac_cv_sizeof_void_p, [Define to the size of pointers]) + +AC_CHECK_SIZEOF(int) +AC_DEFINE_UNQUOTED(ETHR_SIZEOF_INT, $ac_cv_sizeof_int, [Define to the size of int]) +AC_CHECK_SIZEOF(long) +AC_DEFINE_UNQUOTED(ETHR_SIZEOF_LONG, $ac_cv_sizeof_long, [Define to the size of long]) +AC_CHECK_SIZEOF(long long) +AC_DEFINE_UNQUOTED(ETHR_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long, [Define to the size of long long]) +AC_CHECK_SIZEOF(__int64) +AC_DEFINE_UNQUOTED(ETHR_SIZEOF___INT64, $ac_cv_sizeof___int64, [Define to the size of __int64]) +AC_CHECK_SIZEOF(__int128_t) +AC_DEFINE_UNQUOTED(ETHR_SIZEOF___INT128_T, $ac_cv_sizeof___int128_t, [Define to the size of __int128_t]) + + +case X$erl_xcomp_bigendian in + X) ;; + Xyes|Xno) ac_cv_c_bigendian=$erl_xcomp_bigendian;; + *) AC_MSG_ERROR([Bad erl_xcomp_bigendian value: $erl_xcomp_bigendian]);; +esac + +AC_C_BIGENDIAN + +if test "$ac_cv_c_bigendian" = "yes"; then + AC_DEFINE(ETHR_BIGENDIAN, 1, [Define if bigendian]) +fi + +case X$erl_xcomp_double_middle_endian in + X) ;; + Xyes|Xno|Xunknown) ac_cv_c_double_middle_endian=$erl_xcomp_double_middle_endian;; + *) AC_MSG_ERROR([Bad erl_xcomp_double_middle_endian value: $erl_xcomp_double_middle_endian]);; +esac + +AC_C_DOUBLE_MIDDLE_ENDIAN + +AC_ARG_ENABLE(native-ethr-impls, + AS_HELP_STRING([--disable-native-ethr-impls], + [disable native ethread implementations]), +[ case "$enableval" in + no) disable_native_ethr_impls=yes ;; + *) disable_native_ethr_impls=no ;; + esac ], disable_native_ethr_impls=no) + +AC_ARG_ENABLE(x86-out-of-order, + AS_HELP_STRING([--enable-x86-out-of-order], + [enable x86/x84_64 out of order support (default disabled)])) + +test "X$disable_native_ethr_impls" = "Xyes" && + AC_DEFINE(ETHR_DISABLE_NATIVE_IMPLS, 1, [Define if you want to disable native ethread implementations]) + +AC_ARG_ENABLE(prefer-gcc-native-ethr-impls, + AS_HELP_STRING([--enable-prefer-gcc-native-ethr-impls], + [prefer gcc native ethread implementations]), +[ case "$enableval" in + yes) enable_prefer_gcc_native_ethr_impls=yes ;; + *) enable_prefer_gcc_native_ethr_impls=no ;; + esac ], enable_prefer_gcc_native_ethr_impls=no) + +test $enable_prefer_gcc_native_ethr_impls = yes && + AC_DEFINE(ETHR_PREFER_GCC_NATIVE_IMPLS, 1, [Define if you prefer gcc native ethread implementations]) + +AC_ARG_WITH(libatomic_ops, + AS_HELP_STRING([--with-libatomic_ops=PATH], + [specify and prefer usage of libatomic_ops in the ethread library])) + +AC_ARG_WITH(with_sparc_memory_order, + AS_HELP_STRING([--with-sparc-memory-order=TSO|PSO|RMO], + [specify sparc memory order (defaults to RMO)])) + +ETHR_X86_SSE2_ASM=no +case "$GCC-$ac_cv_sizeof_void_p-$host_cpu" in + yes-4-i86pc | yes-4-i*86 | yes-4-x86_64 | yes-4-amd64) + AC_MSG_CHECKING([for gcc sse2 asm support]) + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -msse2" + gcc_sse2_asm=no + AC_TRY_COMPILE([], + [ + long long x, *y; + __asm__ __volatile__("movq %1, %0\n\t" : "=x"(x) : "m"(*y) : "memory"); + ], + [gcc_sse2_asm=yes]) + CFLAGS="$save_CFLAGS" + AC_MSG_RESULT([$gcc_sse2_asm]) + if test "$gcc_sse2_asm" = "yes"; then + AC_DEFINE(ETHR_GCC_HAVE_SSE2_ASM_SUPPORT, 1, [Define if you use a gcc that supports -msse2 and understand sse2 specific asm statements]) + ETHR_X86_SSE2_ASM=yes + fi + ;; + *) + ;; +esac + +case "$GCC-$host_cpu" in + yes-i86pc | yes-i*86 | yes-x86_64 | yes-amd64) + gcc_dw_cmpxchg_asm=no + AC_MSG_CHECKING([for gcc double word cmpxchg asm support]) + AC_TRY_COMPILE([], + [ + char xchgd; + long new[2], xchg[2], *p; + __asm__ __volatile__( +#if ETHR_SIZEOF_PTR == 4 && defined(__PIC__) && __PIC__ + "pushl %%ebx\n\t" + "movl %8, %%ebx\n\t" +#endif +#if ETHR_SIZEOF_PTR == 4 + "lock; cmpxchg8b %0\n\t" +#else + "lock; cmpxchg16b %0\n\t" +#endif + "setz %3\n\t" +#if ETHR_SIZEOF_PTR == 4 && defined(__PIC__) && __PIC__ + "popl %%ebx\n\t" +#endif + : "=m"(*p), "=d"(xchg[1]), "=a"(xchg[0]), "=c"(xchgd) + : "m"(*p), "1"(xchg[1]), "2"(xchg[0]), "3"(new[1]), +#if ETHR_SIZEOF_PTR == 4 && defined(__PIC__) && __PIC__ + "r"(new[0]) +#else + "b"(new[0]) +#endif + : "cc", "memory"); + + ], + [gcc_dw_cmpxchg_asm=yes]) + if test $gcc_dw_cmpxchg_asm = no && test $ac_cv_sizeof_void_p = 4; then + AC_TRY_COMPILE([], + [ + char xchgd; + long new[2], xchg[2], *p; +#if !defined(__PIC__) || !__PIC__ +# error nope +#endif + __asm__ __volatile__( + "pushl %%ebx\n\t" + "movl (%7), %%ebx\n\t" + "movl 4(%7), %%ecx\n\t" + "lock; cmpxchg8b %0\n\t" + "setz %3\n\t" + "popl %%ebx\n\t" + : "=m"(*p), "=d"(xchg[1]), "=a"(xchg[0]), "=c"(xchgd) + : "m"(*p), "1"(xchg[1]), "2"(xchg[0]), "3"(new) + : "cc", "memory"); + + ], + [gcc_dw_cmpxchg_asm=yes]) + if test "$gcc_dw_cmpxchg_asm" = "yes"; then + AC_DEFINE(ETHR_CMPXCHG8B_REGISTER_SHORTAGE, 1, [Define if you get a register shortage with cmpxchg8b and position independent code]) + fi + fi + AC_MSG_RESULT([$gcc_dw_cmpxchg_asm]) + if test "$gcc_dw_cmpxchg_asm" = "yes"; then + AC_DEFINE(ETHR_GCC_HAVE_DW_CMPXCHG_ASM_SUPPORT, 1, [Define if you use a gcc that supports the double word cmpxchg instruction]) + fi;; + *) + ;; +esac + +AC_DEFINE(ETHR_HAVE_ETHREAD_DEFINES, 1, \ +[Define if you have all ethread defines]) + +AC_SUBST(ETHR_X_LIBS) +AC_SUBST(ETHR_LIBS) +AC_SUBST(ETHR_LIB_NAME) +AC_SUBST(ETHR_DEFS) +AC_SUBST(ETHR_THR_LIB_BASE) +AC_SUBST(ETHR_THR_LIB_BASE_DIR) +AC_SUBST(ETHR_X86_SSE2_ASM) + +]) + + + +dnl ---------------------------------------------------------------------- +dnl +dnl ERL_TIME_CORRECTION +dnl +dnl In the presence of a high resolution realtime timer Erlang can adapt +dnl its view of time relative to this timer. On solaris such a timer is +dnl available with the syscall gethrtime(). On other OS's a fallback +dnl solution using times() is implemented. (However on e.g. FreeBSD times() +dnl is implemented using gettimeofday so it doesn't make much sense to +dnl use it there...) On second thought, it seems to be safer to do it the +dnl other way around. I.e. only use times() on OS's where we know it will +dnl work... +dnl + +AC_DEFUN(ERL_TIME_CORRECTION, +[if test x$ac_cv_func_gethrtime = x; then + AC_CHECK_FUNC(gethrtime) +fi +if test x$clock_gettime_correction = xunknown; then + AC_TRY_COMPILE([#include <time.h>], + [struct timespec ts; + long long result; + clock_gettime(CLOCK_MONOTONIC,&ts); + result = ((long long) ts.tv_sec) * 1000000000LL + + ((long long) ts.tv_nsec);], + clock_gettime_compiles=yes, + clock_gettime_compiles=no) +else + clock_gettime_compiles=no +fi + + +AC_CACHE_CHECK([how to correct for time adjustments], erl_cv_time_correction, +[ +case $clock_gettime_correction in + yes) + erl_cv_time_correction=clock_gettime;; + no|unknown) + case $ac_cv_func_gethrtime in + yes) + erl_cv_time_correction=hrtime ;; + no) + case $host_os in + linux*) + case $clock_gettime_correction in + unknown) + if test x$clock_gettime_compiles = xyes; then + if test X$cross_compiling != Xyes; then + linux_kernel_vsn_=`uname -r` + case $linux_kernel_vsn_ in + [[0-1]].*|2.[[0-5]]|2.[[0-5]].*) + erl_cv_time_correction=times ;; + *) + erl_cv_time_correction=clock_gettime;; + esac + else + case X$erl_xcomp_linux_clock_gettime_correction in + X) + erl_cv_time_correction=cross;; + Xyes|Xno) + if test $erl_xcomp_linux_clock_gettime_correction = yes; then + erl_cv_time_correction=clock_gettime + else + erl_cv_time_correction=times + fi;; + *) + AC_MSG_ERROR([Bad erl_xcomp_linux_clock_gettime_correction value: $erl_xcomp_linux_clock_gettime_correction]);; + esac + fi + else + erl_cv_time_correction=times + fi + ;; + *) + erl_cv_time_correction=times ;; + esac + ;; + *) + erl_cv_time_correction=none ;; + esac + ;; + esac + ;; +esac +]) + +xrtlib="" +case $erl_cv_time_correction in + times) + AC_DEFINE(CORRECT_USING_TIMES,[], + [Define if you do not have a high-res. timer & want to use times() instead]) + ;; + clock_gettime|cross) + if test $erl_cv_time_correction = cross; then + erl_cv_time_correction=clock_gettime + AC_MSG_WARN([result clock_gettime guessed because of cross compilation]) + fi + xrtlib="-lrt" + AC_DEFINE(GETHRTIME_WITH_CLOCK_GETTIME,[1], + [Define if you want to use clock_gettime to simulate gethrtime]) + ;; +esac +dnl +dnl Check if gethrvtime is working, and if to use procfs ioctl +dnl or (yet to be written) write to the procfs ctl file. +dnl + +AC_MSG_CHECKING([if gethrvtime works and how to use it]) +AC_TRY_RUN([ +/* gethrvtime procfs ioctl test */ +/* These need to be undef:ed to not break activation of + * micro level process accounting on /proc/self + */ +#ifdef _LARGEFILE_SOURCE +# undef _LARGEFILE_SOURCE +#endif +#ifdef _FILE_OFFSET_BITS +# undef _FILE_OFFSET_BITS +#endif +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <stdio.h> +#include <sys/time.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/signal.h> +#include <sys/fault.h> +#include <sys/syscall.h> +#include <sys/procfs.h> +#include <fcntl.h> + +int main() { + long msacct = PR_MSACCT; + int fd; + long long start, stop; + int i; + pid_t pid = getpid(); + char proc_self[30] = "/proc/"; + + sprintf(proc_self+strlen(proc_self), "%lu", (unsigned long) pid); + if ( (fd = open(proc_self, O_WRONLY)) == -1) + exit(1); + if (ioctl(fd, PIOCSET, &msacct) < 0) + exit(2); + if (close(fd) < 0) + exit(3); + start = gethrvtime(); + for (i = 0; i < 100; i++) + stop = gethrvtime(); + if (start == 0) + exit(4); + if (start == stop) + exit(5); + exit(0); return 0; +} +], +erl_gethrvtime=procfs_ioctl, +erl_gethrvtime=false, +[ +case X$erl_xcomp_gethrvtime_procfs_ioctl in + X) + erl_gethrvtime=cross;; + Xyes|Xno) + if test $erl_xcomp_gethrvtime_procfs_ioctl = yes; then + erl_gethrvtime=procfs_ioctl + else + erl_gethrvtime=false + fi;; + *) + AC_MSG_ERROR([Bad erl_xcomp_gethrvtime_procfs_ioctl value: $erl_xcomp_gethrvtime_procfs_ioctl]);; +esac +]) + +case $erl_gethrvtime in + procfs_ioctl) + AC_DEFINE(HAVE_GETHRVTIME_PROCFS_IOCTL,[1], + [define if gethrvtime() works and uses ioctl() to /proc/self]) + AC_MSG_RESULT(uses ioctl to procfs) + ;; + *) + if test $erl_gethrvtime = cross; then + erl_gethrvtime=false + AC_MSG_RESULT(cross) + AC_MSG_WARN([result 'not working' guessed because of cross compilation]) + else + AC_MSG_RESULT(not working) + fi + + dnl + dnl Check if clock_gettime (linux) is working + dnl + + AC_MSG_CHECKING([if clock_gettime can be used to get process CPU time]) + save_libs=$LIBS + LIBS="-lrt" + AC_TRY_RUN([ + #include <stdlib.h> + #include <unistd.h> + #include <string.h> + #include <stdio.h> + #include <time.h> + int main() { + long long start, stop; + int i; + struct timespec tp; + + if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tp) < 0) + exit(1); + start = ((long long)tp.tv_sec * 1000000000LL) + (long long)tp.tv_nsec; + for (i = 0; i < 100; i++) + clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tp); + stop = ((long long)tp.tv_sec * 1000000000LL) + (long long)tp.tv_nsec; + if (start == 0) + exit(4); + if (start == stop) + exit(5); + exit(0); return 0; + } + ], + erl_clock_gettime=yes, + erl_clock_gettime=no, + [ + case X$erl_xcomp_clock_gettime_cpu_time in + X) erl_clock_gettime=cross;; + Xyes|Xno) erl_clock_gettime=$erl_xcomp_clock_gettime_cpu_time;; + *) AC_MSG_ERROR([Bad erl_xcomp_clock_gettime_cpu_time value: $erl_xcomp_clock_gettime_cpu_time]);; + esac + ]) + LIBS=$save_libs + case $host_os in + linux*) + AC_MSG_RESULT([no; not stable]) + LIBRT=$xrtlib + ;; + *) + AC_MSG_RESULT($erl_clock_gettime) + case $erl_clock_gettime in + yes) + AC_DEFINE(HAVE_CLOCK_GETTIME,[], + [define if clock_gettime() works for getting process time]) + LIBRT=-lrt + ;; + cross) + erl_clock_gettime=no + AC_MSG_WARN([result no guessed because of cross compilation]) + LIBRT=$xrtlib + ;; + *) + LIBRT=$xrtlib + ;; + esac + ;; + esac + AC_SUBST(LIBRT) + ;; +esac +])dnl + +dnl ---------------------------------------------------------------------- +dnl +dnl LM_TRY_ENABLE_CFLAG +dnl +dnl +dnl Tries a CFLAG and sees if it can be enabled without compiler errors +dnl $1: textual cflag to add +dnl $2: variable to store the modified CFLAG in +dnl Usage example LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) +dnl +dnl +AC_DEFUN([LM_TRY_ENABLE_CFLAG], [ + AC_MSG_CHECKING([if we can add $1 to $2 (via CFLAGS)]) + saved_CFLAGS=$CFLAGS; + CFLAGS="$1 $$2"; + AC_TRY_COMPILE([],[return 0;],can_enable_flag=true,can_enable_flag=false) + CFLAGS=$saved_CFLAGS; + if test "X$can_enable_flag" = "Xtrue"; then + AC_MSG_RESULT([yes]) + AS_VAR_SET($2, "$1 $$2") + else + AC_MSG_RESULT([no]) + fi +]) + +dnl ERL_TRY_LINK_JAVA(CLASSES, FUNCTION-BODY +dnl [ACTION_IF_FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Freely inspired by AC_TRY_LINK. (Maybe better to create a +dnl AC_LANG_JAVA instead...) +AC_DEFUN(ERL_TRY_LINK_JAVA, +[java_link='$JAVAC conftest.java 1>&AC_FD_CC' +changequote(, )dnl +cat > conftest.java <<EOF +$1 +class conftest { public static void main(String[] args) { + $2 + ; return; }} +EOF +changequote([, ])dnl +if AC_TRY_EVAL(java_link) && test -s conftest.class; then + ifelse([$3], , :, [rm -rf conftest* + $3]) +else + echo "configure: failed program was:" 1>&AC_FD_CC + cat conftest.java 1>&AC_FD_CC + echo "configure: PATH was $PATH" 1>&AC_FD_CC +ifelse([$4], , , [ rm -rf conftest* + $4 +])dnl +fi +rm -f conftest*]) +#define UNSAFE_MASK 0xc0000000 /* Mask for bits that must be constant */ + + diff --git a/lib/megaco/configure.in b/lib/megaco/configure.in index 42c50b8961..64daa959b5 100644 --- a/lib/megaco/configure.in +++ b/lib/megaco/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. -*-m4-*- dnl dnl %CopyrightBegin% dnl -dnl Copyright Ericsson AB 2001-2011. All Rights Reserved. +dnl Copyright Ericsson AB 2001-2013. All Rights Reserved. dnl dnl The contents of this file are subject to the Erlang Public License, dnl Version 1.1, (the "License"); you may not use this file except in @@ -145,7 +145,7 @@ AC_ARG_ENABLE(megaco_flex_scanner_lineno, AC_SUBST(ENABLE_MEGACO_FLEX_SCANNER_LINENO) -dnl This is the os flavour, should be unix, vxworks or win32 +dnl This is the os flavour, should be unix or win32 if test "X$host" = "Xwin32"; then ERLANG_OSTYPE=win32 else @@ -162,6 +162,11 @@ else fi AC_SUBST(OTP_EXTRA_FLAGS) +if test "x$GCC" = xyes; then + # Treat certain GCC warnings as errors + LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) +fi + dnl dnl If ${ERL_TOP}/make/otp_ded.mk.in exists and contains DED_MK_VSN > 0, dnl every thing releted to compiling Dynamic Erlang Drivers can be found diff --git a/lib/megaco/doc/src/definitions/term.defs b/lib/megaco/doc/src/definitions/term.defs index f3d6f865d2..57379eaa5d 100644 --- a/lib/megaco/doc/src/definitions/term.defs +++ b/lib/megaco/doc/src/definitions/term.defs @@ -110,7 +110,6 @@ the module Erlang in the application kernel","kenneth"}, {"Master Agent","Master Agent","The SNMP agent system consists of one Master Agent which terminates the SNMP protocol","mbj"}, {"MIB","Management Information Base (MIB)","An abstract definition of the management information available through a management interface in a system.","mbj"}, {"matching","matching","See pattern matching.","kenneth"}, {"message queue","message queue","The queue of not yet received messages that are in the mailbox of a process.","olin"}, -{"Mnemosyne","Mnemosyne","Mnemosyne was the query language of Mnesia up to the R11B release. Supersed by QLC.","hakan"}, {"Mnesia","Mnesia","Mnesia is a distributed Database Management System, appropriate for telecommunications applications and other applications with need of continuous operation and soft real-time properties.","hakan"}, {"MIBshort","MIB","See Management Information Base.","mbj"}, {"MIME","MIME","Multi-purpose Internet Mail Extensions.","jocke"}, diff --git a/lib/megaco/doc/src/definitions/term.defs.xml b/lib/megaco/doc/src/definitions/term.defs.xml index 28ac0d6eaf..1c80ee8d80 100644 --- a/lib/megaco/doc/src/definitions/term.defs.xml +++ b/lib/megaco/doc/src/definitions/term.defs.xml @@ -794,13 +794,6 @@ The queue of not yet received messages that are in the mailbox of a process. <resp>olin</resp> </term> <term> - <id>Mnemosyne</id> - <shortdef>Mnemosyne</shortdef> - <def> -Mnemosyne was the query language of Mnesia up to the R11B release. Supersed by QLC.</def> - <resp>hakan</resp> - </term> - <term> <id>Mnesia</id> <shortdef>Mnesia</shortdef> <def> diff --git a/lib/megaco/doc/src/megaco_encode.xml b/lib/megaco/doc/src/megaco_encode.xml index 410e4f3b31..4b5adab262 100644 --- a/lib/megaco/doc/src/megaco_encode.xml +++ b/lib/megaco/doc/src/megaco_encode.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2000</year><year>2009</year> + <year>2000</year><year>2013</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -224,22 +224,11 @@ messages.</p> </item> <item> - <p>megaco_ber_bin_encoder - encode/decode ASN.1 BER - messages. This encoder uses ASN.1 ber_bin which - has been optimized using the bit syntax.</p> - </item> - <item> <p>megaco_per_encoder - encode/decode ASN.1 PER messages. N.B. that this format is not included in the Megaco standard.</p> </item> <item> - <p>megaco_per_bin_encoder - encode/decode ASN.1 PER - messages. N.B. that this format is not included in the - Megaco standard. This encoder uses ASN.1 per_bin which - has been optimized using the bit syntax.</p> - </item> - <item> <p>megaco_erl_dist_encoder - encodes messages into Erlangs distribution format. It is rather verbose but encoding and decoding is blinding fast. N.B. that this format is not @@ -370,18 +359,6 @@ needs to be specified.</p> <list type="bulleted"> <item> - <p><c><![CDATA[[driver|_]]]></c> - make use of the asn1 driver for decode - (ber_bin) and encode (per_bin). This option is only available for - encoding modules: <c><![CDATA[megaco_binary_encoder]]></c>, - <c><![CDATA[megaco_ber_bin_encoder]]></c> and <c><![CDATA[megaco_per_bin_encoder]]></c>.</p> - <p>If this option is present in the encoding config, it <em>must</em> - to be the <em>first</em>, unless the - <seealso marker="#handling_versions">version3</seealso> encoding - config is present, in which case it must come second, after - the version3 encoding config, - e.g. <c><![CDATA[[{version3,prev3b},driver]]]></c>.</p> - </item> - <item> <p><c><![CDATA[[native]]]></c> - skips the transformation phase, i.e. the decoded message(s) will not be transformed into our internal form.</p> diff --git a/lib/megaco/doc/src/notes.xml b/lib/megaco/doc/src/notes.xml index 928e3bea82..a092946fef 100644 --- a/lib/megaco/doc/src/notes.xml +++ b/lib/megaco/doc/src/notes.xml @@ -36,7 +36,24 @@ section is the version number of Megaco.</p> - <section><title>Megaco 3.16.0.2</title> + <section><title>Megaco 3.16.0.3</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p>Where necessary a comment stating encoding has been + added to Erlang files. The comment is meant to be removed + in Erlang/OTP R17B when UTF-8 becomes the default + encoding. </p> + <p> + Own Id: OTP-10630</p> + </item> + </list> + </section> + +</section> + +<section><title>Megaco 3.16.0.2</title> <p>Version 3.16.0.2 supports code replacement in runtime from/to version 3.16.0.1, 3.16, 3.15.1.1, 3.15.1 and 3.15.</p> diff --git a/lib/megaco/examples/meas/Makefile.in b/lib/megaco/examples/meas/Makefile.in index c517fd21cf..91e342cd9a 100644 --- a/lib/megaco/examples/meas/Makefile.in +++ b/lib/megaco/examples/meas/Makefile.in @@ -147,12 +147,12 @@ release_docs_spec: # ---------------------------------------------------- meas.sh.skel: meas.sh.skel.src - @echo "transforming $< to $@" - $(PERL) -p -e 's?%VSN%?$(VSN)? ' < $< > $@ + $(V_colon)@echo "transforming $< to $@" + $(vsn_verbose)$(PERL) -p -e 's?%VSN%?$(VSN)? ' < $< > $@ mstone1.sh.skel: mstone1.sh.skel.src - @echo "transforming $< to $@" - $(PERL) -p -e 's?%VSN%?$(VSN)? ' < $< > $@ + $(V_colon)@echo "transforming $< to $@" + $(vsn_verbose)$(PERL) -p -e 's?%VSN%?$(VSN)? ' < $< > $@ megaco_codec_transform.$(EMULATOR): megaco_codec_transform.erl diff --git a/lib/megaco/examples/meas/megaco_codec_meas.erl b/lib/megaco/examples/meas/megaco_codec_meas.erl index 51ee396338..5af40eea7d 100644 --- a/lib/megaco/examples/meas/megaco_codec_meas.erl +++ b/lib/megaco/examples/meas/megaco_codec_meas.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2010. All Rights Reserved. +%% Copyright Ericsson AB 2002-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -176,7 +176,7 @@ display_megaco_info() -> io:format("Megaco version: ~s (~s)~n", [Ver, FlexStr]). display_asn1_info() -> - AI = megaco_ber_bin_drv_media_gateway_control_v1:info(), + AI = megaco_ber_media_gateway_control_v1:info(), Vsn = case lists:keysearch(vsn, 1, AI) of {value, {vsn, V}} when is_atom(V) -> @@ -281,15 +281,11 @@ expand_codec(Codec) -> [{Codec, megaco_compact_text_encoder, [flex_scanner], 3000}, {Codec, megaco_compact_text_encoder, [], 1500}]; ber -> - [{Codec, megaco_ber_bin_encoder, [driver,native], 4000}, - {Codec, megaco_ber_bin_encoder, [native], 3000}, - {Codec, megaco_ber_bin_encoder, [driver], 3000}, - {Codec, megaco_ber_bin_encoder, [], 1000}]; + [{Codec, megaco_ber_encoder, [native], 3000}, + {Codec, megaco_ber_encoder, [], 1000}]; per -> - [{Codec, megaco_per_bin_encoder, [driver,native], 4000}, - {Codec, megaco_per_bin_encoder, [native], 3000}, - {Codec, megaco_per_bin_encoder, [driver], 3000}, - {Codec, megaco_per_bin_encoder, [], 1000}]; + [{Codec, megaco_per_encoder, [native], 3000}, + {Codec, megaco_per_encoder, [], 1000}]; erlang -> [ {Codec, megaco_erl_dist_encoder, [megaco_compressed,compressed], 500}, diff --git a/lib/megaco/examples/meas/megaco_codec_mstone_lib.erl b/lib/megaco/examples/meas/megaco_codec_mstone_lib.erl index 9af88d9f50..b527ff2e89 100644 --- a/lib/megaco/examples/meas/megaco_codec_mstone_lib.erl +++ b/lib/megaco/examples/meas/megaco_codec_mstone_lib.erl @@ -268,7 +268,7 @@ display_megaco_info() -> io:format("Megaco version: ~s~n", [Ver]). display_asn1_info() -> - AI = megaco_ber_bin_drv_media_gateway_control_v1:info(), + AI = megaco_ber__media_gateway_control_v1:info(), Vsn = case lists:keysearch(vsn, 1, AI) of {value, {vsn, V}} when is_atom(V) -> @@ -361,15 +361,11 @@ expand_codec(Codec, only_drv) -> [{Codec, megaco_compact_text_encoder, [flex_scanner]}, {Codec, megaco_compact_text_encoder, [flex_scanner]}]; ber -> - [{Codec, megaco_ber_bin_encoder, [driver,native]}, - {Codec, megaco_ber_bin_encoder, [driver]}, - {Codec, megaco_ber_bin_encoder, [driver,native]}, - {Codec, megaco_ber_bin_encoder, [driver]}]; + [{Codec, megaco_ber_encoder, [native]}, + {Codec, megaco_ber_encoder, []}]; per -> - [{Codec, megaco_per_bin_encoder, [driver,native]}, - {Codec, megaco_per_bin_encoder, [native]}, - {Codec, megaco_per_bin_encoder, [driver,native]}, - {Codec, megaco_per_bin_encoder, [native]}]; + [{Codec, megaco_per_encoder, [native]}, + {Codec, megaco_per_encoder, []}]; erlang -> Encoder = megaco_erl_dist_encoder, [ @@ -390,15 +386,11 @@ expand_codec(Codec, no_drv) -> [{Codec, megaco_compact_text_encoder, []}, {Codec, megaco_compact_text_encoder, []}]; ber -> - [{Codec, megaco_ber_bin_encoder, [native]}, - {Codec, megaco_ber_bin_encoder, []}, - {Codec, megaco_ber_bin_encoder, [native]}, - {Codec, megaco_ber_bin_encoder, []}]; + [{Codec, megaco_ber_encoder, [native]}, + {Codec, megaco_ber_encoder, []}]; per -> - [{Codec, megaco_per_bin_encoder, [native]}, - {Codec, megaco_per_bin_encoder, []}, - {Codec, megaco_per_bin_encoder, [native]}, - {Codec, megaco_per_bin_encoder, []}]; + [{Codec, megaco_per_encoder, [native]}, + {Codec, megaco_per_encoder, []}]; erlang -> Encoder = megaco_erl_dist_encoder, [ @@ -419,15 +411,11 @@ expand_codec(Codec, _) -> [{Codec, megaco_compact_text_encoder, [flex_scanner]}, {Codec, megaco_compact_text_encoder, []}]; ber -> - [{Codec, megaco_ber_bin_encoder, [driver,native]}, - {Codec, megaco_ber_bin_encoder, [native]}, - {Codec, megaco_ber_bin_encoder, [driver]}, - {Codec, megaco_ber_bin_encoder, []}]; + [{Codec, megaco_ber_encoder, [native]}, + {Codec, megaco_ber_encoder, []}]; per -> - [{Codec, megaco_per_bin_encoder, [driver,native]}, - {Codec, megaco_per_bin_encoder, [native]}, - {Codec, megaco_per_bin_encoder, [driver]}, - {Codec, megaco_per_bin_encoder, []}]; + [{Codec, megaco_per_encoder, [native]}, + {Codec, megaco_per_encoder, []}]; erlang -> Encoder = megaco_erl_dist_encoder, [ diff --git a/lib/megaco/examples/meas/megaco_codec_transform.erl b/lib/megaco/examples/meas/megaco_codec_transform.erl index cfe832ff26..7825e7856f 100644 --- a/lib/megaco/examples/meas/megaco_codec_transform.erl +++ b/lib/megaco/examples/meas/megaco_codec_transform.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -213,11 +213,11 @@ decode_message(compact, BinMsg) -> Conf = [{version3,?V3}], do_decode(Mod, Conf, BinMsg); decode_message(ber, BinMsg) -> - Mod = megaco_ber_bin_encoder, + Mod = megaco_ber_encoder, Conf = [{version3,?V3}], do_decode(Mod, Conf, BinMsg); decode_message(per, BinMsg) -> - Mod = megaco_per_bin_encoder, + Mod = megaco_per_encoder, Conf = [{version3,?V3}], do_decode(Mod, Conf, BinMsg); decode_message(erlang, BinMsg) -> diff --git a/lib/megaco/src/app/Makefile b/lib/megaco/src/app/Makefile index 42030c5b1c..d18da5326a 100644 --- a/lib/megaco/src/app/Makefile +++ b/lib/megaco/src/app/Makefile @@ -94,10 +94,10 @@ info: # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ diff --git a/lib/megaco/src/app/megaco.app.src b/lib/megaco/src/app/megaco.app.src index c0d8218ac8..40265166ae 100644 --- a/lib/megaco/src/app/megaco.app.src +++ b/lib/megaco/src/app/megaco.app.src @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2011. All Rights Reserved. +%% Copyright Ericsson AB 1999-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,19 +23,6 @@ {modules, [ megaco, - megaco_ber_bin_encoder, - megaco_ber_bin_drv_media_gateway_control_v1, - megaco_ber_bin_drv_media_gateway_control_v2, - megaco_ber_bin_drv_media_gateway_control_prev3a, - megaco_ber_bin_drv_media_gateway_control_prev3b, - megaco_ber_bin_drv_media_gateway_control_prev3c, - megaco_ber_bin_drv_media_gateway_control_v3, - megaco_ber_bin_media_gateway_control_v1, - megaco_ber_bin_media_gateway_control_v2, - megaco_ber_bin_media_gateway_control_prev3a, - megaco_ber_bin_media_gateway_control_prev3b, - megaco_ber_bin_media_gateway_control_prev3c, - megaco_ber_bin_media_gateway_control_v3, megaco_ber_encoder, megaco_ber_media_gateway_control_v1, megaco_ber_media_gateway_control_v2, @@ -87,19 +74,6 @@ megaco_per_media_gateway_control_prev3b, megaco_per_media_gateway_control_prev3c, megaco_per_media_gateway_control_v3, - megaco_per_bin_encoder, - megaco_per_bin_drv_media_gateway_control_v1, - megaco_per_bin_drv_media_gateway_control_v2, - megaco_per_bin_drv_media_gateway_control_prev3a, - megaco_per_bin_drv_media_gateway_control_prev3b, - megaco_per_bin_drv_media_gateway_control_prev3c, - megaco_per_bin_drv_media_gateway_control_v3, - megaco_per_bin_media_gateway_control_v1, - megaco_per_bin_media_gateway_control_v2, - megaco_per_bin_media_gateway_control_prev3a, - megaco_per_bin_media_gateway_control_prev3b, - megaco_per_bin_media_gateway_control_prev3c, - megaco_per_bin_media_gateway_control_v3, megaco_pretty_text_encoder, megaco_pretty_text_encoder_v1, megaco_pretty_text_encoder_v2, diff --git a/lib/megaco/src/binary/Makefile b/lib/megaco/src/binary/Makefile index 695599b9dc..c1fd66b848 100644 --- a/lib/megaco/src/binary/Makefile +++ b/lib/megaco/src/binary/Makefile @@ -50,46 +50,22 @@ ASN1_SPECS = $(ASN1_V1_SPEC) \ ASN1_FILES = $(ASN1_SPECS:%=%.asn) V1_SPECS = $(BER_ASN1_V1_SPEC) \ - $(BER_BIN_ASN1_V1_SPEC) \ - $(BER_BIN_DRV_ASN1_V1_SPEC) \ - $(PER_ASN1_V1_SPEC) \ - $(PER_BIN_ASN1_V1_SPEC) \ - $(PER_BIN_DRV_ASN1_V1_SPEC) + $(PER_ASN1_V1_SPEC) V2_SPECS = $(BER_ASN1_V2_SPEC) \ - $(BER_BIN_ASN1_V2_SPEC) \ - $(BER_BIN_DRV_ASN1_V2_SPEC) \ - $(PER_ASN1_V2_SPEC) \ - $(PER_BIN_ASN1_V2_SPEC) \ - $(PER_BIN_DRV_ASN1_V2_SPEC) + $(PER_ASN1_V2_SPEC) PREV3A_SPECS = $(BER_ASN1_PREV3A_SPEC) \ - $(BER_BIN_ASN1_PREV3A_SPEC) \ - $(BER_BIN_DRV_ASN1_PREV3A_SPEC) \ - $(PER_ASN1_PREV3A_SPEC) \ - $(PER_BIN_ASN1_PREV3A_SPEC) \ - $(PER_BIN_DRV_ASN1_PREV3A_SPEC) + $(PER_ASN1_PREV3A_SPEC) PREV3B_SPECS = $(BER_ASN1_PREV3B_SPEC) \ - $(BER_BIN_ASN1_PREV3B_SPEC) \ - $(BER_BIN_DRV_ASN1_PREV3B_SPEC) \ - $(PER_ASN1_PREV3B_SPEC) \ - $(PER_BIN_ASN1_PREV3B_SPEC) \ - $(PER_BIN_DRV_ASN1_PREV3B_SPEC) + $(PER_ASN1_PREV3B_SPEC) PREV3C_SPECS = $(BER_ASN1_PREV3C_SPEC) \ - $(BER_BIN_ASN1_PREV3C_SPEC) \ - $(BER_BIN_DRV_ASN1_PREV3C_SPEC) \ - $(PER_ASN1_PREV3C_SPEC) \ - $(PER_BIN_ASN1_PREV3C_SPEC) \ - $(PER_BIN_DRV_ASN1_PREV3C_SPEC) + $(PER_ASN1_PREV3C_SPEC) V3_SPECS = $(BER_ASN1_V3_SPEC) \ - $(BER_BIN_ASN1_V3_SPEC) \ - $(BER_BIN_DRV_ASN1_V3_SPEC) \ $(PER_ASN1_V3_SPEC) \ - $(PER_BIN_ASN1_V3_SPEC) \ - $(PER_BIN_DRV_ASN1_V3_SPEC) \ $(PREV3A_SPECS) $(PREV3B_SPECS) $(PREV3C_SPECS) SPECS = $(V1_SPECS) $(V2_SPECS) $(V3_SPECS) @@ -153,12 +129,13 @@ opt: prebuild $(TARGET_FILES) prebuild: prebuild.skip prebuild.skip: - @echo "Building prebuild.skip\c" + $(gen_verbose) + $(V_colon)@echo "Building prebuild.skip\c" @touch prebuild.skip @for a in $(SPEC_ASN1DB); do \ echo $$a >> prebuild.skip; \ done - @echo "" + $(V_colon)@echo "" v1: $(V2_SPEC_BINS) diff --git a/lib/megaco/src/binary/depend.mk b/lib/megaco/src/binary/depend.mk index c9ca34bcf6..b9b86d3183 100644 --- a/lib/megaco/src/binary/depend.mk +++ b/lib/megaco/src/binary/depend.mk @@ -2,7 +2,7 @@ # %CopyrightBegin% # -# Copyright Ericsson AB 2001-2011. All Rights Reserved. +# Copyright Ericsson AB 2001-2013. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -19,17 +19,8 @@ # Flag description: # -# +optimize -# For ber_bin this means "optimize" (whatever that is), -# but for per_bin it means that a stage in the encode -# is done in the asn1 driver. -# -# +nif -# For ber_bin this means that part of the decode is done -# in the asn1 nif. -# # +asn1config -# This is only used by the ber_bin, and means that +# This is only used by the ber, and means that # some partial decode functions will be created # (as described by the asn1config file). # @@ -43,42 +34,18 @@ ifeq ($(MEGACO_INLINE_ASN1_RT),true) ASN1_CT_OPTS += +inline endif -BER_V1_FLAGS = $(ASN1_CT_OPTS) -BER_BIN_V1_FLAGS = $(ASN1_CT_OPTS) +asn1config +optimize -BER_BIN_DRV_V1_FLAGS = $(ASN1_CT_OPTS) +asn1config +optimize +nif -BER_V2_FLAGS = $(ASN1_CT_OPTS) -BER_BIN_V2_FLAGS = $(ASN1_CT_OPTS) +asn1config +optimize -BER_BIN_DRV_V2_FLAGS = $(ASN1_CT_OPTS) +asn1config +optimize +nif -BER_PREV3A_FLAGS = $(ASN1_CT_OPTS) -BER_BIN_PREV3A_FLAGS = $(ASN1_CT_OPTS) +asn1config +optimize -BER_BIN_DRV_PREV3A_FLAGS = $(ASN1_CT_OPTS) +asn1config +optimize +nif -BER_PREV3B_FLAGS = $(ASN1_CT_OPTS) -BER_BIN_PREV3B_FLAGS = $(ASN1_CT_OPTS) +asn1config +optimize -BER_BIN_DRV_PREV3B_FLAGS = $(ASN1_CT_OPTS) +asn1config +optimize +nif -BER_PREV3C_FLAGS = $(ASN1_CT_OPTS) -BER_BIN_PREV3C_FLAGS = $(ASN1_CT_OPTS) +asn1config +optimize -BER_BIN_DRV_PREV3C_FLAGS = $(ASN1_CT_OPTS) +asn1config +optimize +nif -BER_V3_FLAGS = $(ASN1_CT_OPTS) -BER_BIN_V3_FLAGS = $(ASN1_CT_OPTS) +asn1config +optimize -BER_BIN_DRV_V3_FLAGS = $(ASN1_CT_OPTS) +asn1config +optimize +nif +BER_V1_FLAGS = $(ASN1_CT_OPTS) +asn1config +BER_V2_FLAGS = $(ASN1_CT_OPTS) +asn1config +BER_PREV3A_FLAGS = $(ASN1_CT_OPTS) +asn1config +BER_PREV3B_FLAGS = $(ASN1_CT_OPTS) +asn1config +BER_PREV3C_FLAGS = $(ASN1_CT_OPTS) +asn1config +BER_V3_FLAGS = $(ASN1_CT_OPTS) +asn1config PER_V1_FLAGS = $(ASN1_CT_OPTS) -PER_BIN_V1_FLAGS = $(ASN1_CT_OPTS) -PER_BIN_DRV_V1_FLAGS = $(ASN1_CT_OPTS) +optimize PER_V2_FLAGS = $(ASN1_CT_OPTS) -PER_BIN_V2_FLAGS = $(ASN1_CT_OPTS) -PER_BIN_DRV_V2_FLAGS = $(ASN1_CT_OPTS) +optimize PER_PREV3A_FLAGS = $(ASN1_CT_OPTS) -PER_BIN_PREV3A_FLAGS = $(ASN1_CT_OPTS) -PER_BIN_DRV_PREV3A_FLAGS = $(ASN1_CT_OPTS) +optimize PER_PREV3B_FLAGS = $(ASN1_CT_OPTS) -PER_BIN_PREV3B_FLAGS = $(ASN1_CT_OPTS) -PER_BIN_DRV_PREV3B_FLAGS = $(ASN1_CT_OPTS) +optimize PER_PREV3C_FLAGS = $(ASN1_CT_OPTS) -PER_BIN_PREV3C_FLAGS = $(ASN1_CT_OPTS) -PER_BIN_DRV_PREV3C_FLAGS = $(ASN1_CT_OPTS) +optimize PER_V3_FLAGS = $(ASN1_CT_OPTS) -PER_BIN_V3_FLAGS = $(ASN1_CT_OPTS) -PER_BIN_DRV_V3_FLAGS = $(ASN1_CT_OPTS) +optimize # --- Version 1 --- @@ -86,119 +53,42 @@ PER_BIN_DRV_V3_FLAGS = $(ASN1_CT_OPTS) +optimize $(BER_ASN1_V1_SPEC).erl: \ $(BER_ASN1_V1_SPEC).set.asn \ $(ASN1_V1_SPEC).asn - @echo "$(BER_ASN1_V1_SPEC):" - $(ERLC) -bber $(BER_V1_FLAGS) $(BER_ASN1_V1_SPEC).set.asn + $(V_colon)@echo "$(BER_ASN1_V1_SPEC):" + $(asn_verbose)$(ERLC) -bber $(BER_V1_FLAGS) $(BER_ASN1_V1_SPEC).set.asn $(EBIN)/$(BER_ASN1_V1_SPEC).$(EMULATOR): \ $(BER_ASN1_V1_SPEC).erl -$(BER_BIN_ASN1_V1_SPEC).erl: \ - $(BER_BIN_ASN1_V1_SPEC).set.asn \ - $(BER_BIN_ASN1_V1_SPEC).asn1config \ - $(ASN1_V1_SPEC).asn - @echo "$(BER_BIN_ASN1_V1_SPEC):" - $(ERLC) -bber_bin $(BER_BIN_V1_FLAGS) $(BER_BIN_ASN1_V1_SPEC).set.asn - -$(EBIN)/$(BER_BIN_ASN1_V1_SPEC).$(EMULATOR): \ - $(BER_BIN_ASN1_V1_SPEC).erl - -$(BER_BIN_DRV_ASN1_V1_SPEC).erl: \ - $(BER_BIN_DRV_ASN1_V1_SPEC).set.asn \ - $(BER_BIN_DRV_ASN1_V1_SPEC).asn1config \ - $(ASN1_V1_SPEC).asn - @echo "$(BER_BIN_DRV_ASN1_V1_SPEC):" - $(ERLC) -bber_bin $(BER_BIN_DRV_V1_FLAGS) $(BER_BIN_DRV_ASN1_V1_SPEC).set.asn - -$(EBIN)/$(BER_BIN_DRV_ASN1_V1_SPEC).$(EMULATOR): \ - $(BER_BIN_DRV_ASN1_V1_SPEC).erl - $(PER_ASN1_V1_SPEC).erl: \ $(PER_ASN1_V1_SPEC).set.asn \ $(ASN1_V1_SPEC).asn - @echo "$(PER_ASN1_V1_SPEC):" - $(ERLC) -bper $(PER_V1_FLAGS) $(PER_ASN1_V1_SPEC).set.asn + $(V_colon)@echo "$(PER_ASN1_V1_SPEC):" + $(asn_verbose)$(ERLC) -bper $(PER_V1_FLAGS) $(PER_ASN1_V1_SPEC).set.asn $(EBIN)/$(PER_ASN1_V1_SPEC).$(EMULATOR): \ $(PER_ASN1_V1_SPEC).erl -$(PER_BIN_ASN1_V1_SPEC).erl: \ - $(PER_BIN_ASN1_V1_SPEC).set.asn \ - $(ASN1_V1_SPEC).asn - @echo "$(PER_BIN_ASN1_V1_SPEC):" - $(ERLC) -bper_bin $(PER_BIN_V1_FLAGS) $(PER_BIN_ASN1_V1_SPEC).set.asn - -$(EBIN)/$(PER_BIN_ASN1_V1_SPEC).$(EMULATOR): \ - $(PER_BIN_ASN1_V1_SPEC).erl - -$(PER_BIN_DRV_ASN1_V1_SPEC).erl: \ - $(PER_BIN_DRV_ASN1_V1_SPEC).set.asn \ - $(ASN1_V1_SPEC).asn - @echo "$(PER_BIN_DRV_ASN1_V1_SPEC):" - $(ERLC) -bper_bin $(PER_BIN_DRV_V1_FLAGS) $(PER_BIN_DRV_ASN1_V1_SPEC).set.asn - -$(EBIN)/$(PER_BIN_DRV_ASN1_V1_SPEC).$(EMULATOR): \ - $(PER_BIN_DRV_ASN1_V1_SPEC).erl - # --- Version 2 --- $(BER_ASN1_V2_SPEC).erl: \ $(BER_ASN1_V2_SPEC).set.asn \ $(ASN1_V2_SPEC).asn - @echo "$(BER_ASN1_V2_SPEC):" - $(ERLC) -bber $(BER_V2_FLAGS) $(BER_ASN1_V2_SPEC).set.asn + $(V_colon)@echo "$(BER_ASN1_V2_SPEC):" + $(asn_verbose)$(ERLC) -bber $(BER_V2_FLAGS) $(BER_ASN1_V2_SPEC).set.asn $(EBIN)/$(BER_ASN1_V2_SPEC).$(EMULATOR): \ $(BER_ASN1_V2_SPEC).erl -$(BER_BIN_ASN1_V2_SPEC).erl: \ - $(BER_BIN_ASN1_V2_SPEC).set.asn \ - $(BER_BIN_ASN1_V2_SPEC).asn1config \ - $(ASN1_V2_SPEC).asn - @echo "$(BER_BIN_ASN1_V2_SPEC):" - $(ERLC) -bber_bin $(BER_BIN_V2_FLAGS) $(BER_BIN_ASN1_V2_SPEC).set.asn - -$(EBIN)/$(BER_BIN_ASN1_V2_SPEC).$(EMULATOR): \ - $(BER_BIN_ASN1_V2_SPEC).erl - -$(BER_BIN_DRV_ASN1_V2_SPEC).erl: \ - $(BER_BIN_DRV_ASN1_V2_SPEC).set.asn \ - $(BER_BIN_DRV_ASN1_V2_SPEC).asn1config \ - $(ASN1_V2_SPEC).asn - @echo "$(BER_BIN_DRV_ASN1_V2_SPEC):" - $(ERLC) -bber_bin $(BER_BIN_DRV_V2_FLAGS) $(BER_BIN_DRV_ASN1_V2_SPEC).set.asn - -$(EBIN)/$(BER_BIN_DRV_ASN1_V2_SPEC).$(EMULATOR): \ - $(BER_BIN_DRV_ASN1_V2_SPEC).erl - $(PER_ASN1_V2_SPEC).erl: \ $(PER_ASN1_V2_SPEC).set.asn \ $(ASN1_V2_SPEC).asn - @echo "$(PER_ASN1_V2_SPEC):" - $(ERLC) -bper $(PER_V2_FLAGS) $(PER_ASN1_V2_SPEC).set.asn + $(V_colon)@echo "$(PER_ASN1_V2_SPEC):" + $(asn_verbose)$(ERLC) -bper $(PER_V2_FLAGS) $(PER_ASN1_V2_SPEC).set.asn $(EBIN)/$(PER_ASN1_V2_SPEC).$(EMULATOR): \ $(PER_ASN1_V2_SPEC).erl -$(PER_BIN_ASN1_V2_SPEC).erl: \ - $(PER_BIN_ASN1_V2_SPEC).set.asn \ - $(ASN1_V2_SPEC).asn - @echo "$(PER_BIN_ASN1_V2_SPEC):" - $(ERLC) -bper_bin $(PER_BIN_V2_FLAGS) $(PER_BIN_ASN1_V2_SPEC).set.asn - -$(EBIN)/$(PER_BIN_ASN1_V2_SPEC).$(EMULATOR): \ - $(PER_BIN_ASN1_V2_SPEC).erl - -$(PER_BIN_DRV_ASN1_V2_SPEC).erl: \ - $(PER_BIN_DRV_ASN1_V2_SPEC).set.asn \ - $(ASN1_V2_SPEC).asn - @echo "$(PER_BIN_DRV_ASN1_V2_SPEC):" - $(ERLC) -bper_bin $(PER_BIN_DRV_V2_FLAGS) $(PER_BIN_DRV_ASN1_V2_SPEC).set.asn - -$(EBIN)/$(PER_BIN_DRV_ASN1_V2_SPEC).$(EMULATOR): \ - $(PER_BIN_DRV_ASN1_V2_SPEC).erl - - # --- Version 3 --- # -- (prev3a) -- @@ -206,250 +96,93 @@ $(EBIN)/$(PER_BIN_DRV_ASN1_V2_SPEC).$(EMULATOR): \ $(BER_ASN1_PREV3A_SPEC).erl: \ $(BER_ASN1_PREV3A_SPEC).set.asn \ $(ASN1_PREV3A_SPEC).asn - @echo "$(BER_ASN1_PREV3A_SPEC):" - $(ERLC) -bber $(BER_PREV3A_FLAGS) $(BER_ASN1_PREV3A_SPEC).set.asn + $(V_colon)@echo "$(BER_ASN1_PREV3A_SPEC):" + $(asn_verbose)$(ERLC) -bber $(BER_PREV3A_FLAGS) $(BER_ASN1_PREV3A_SPEC).set.asn $(EBIN)/$(BER_ASN1_PREV3A_SPEC).$(EMULATOR): \ $(BER_ASN1_PREV3A_SPEC).erl -$(BER_BIN_ASN1_PREV3A_SPEC).erl: \ - $(BER_BIN_ASN1_PREV3A_SPEC).set.asn \ - $(BER_BIN_ASN1_PREV3A_SPEC).asn1config \ - $(ASN1_PREV3A_SPEC).asn - @echo "$(BER_BIN_ASN1_PREV3A_SPEC):" - $(ERLC) -bber_bin $(BER_BIN_PREV3A_FLAGS) $(BER_BIN_ASN1_PREV3A_SPEC).set.asn - -$(EBIN)/$(BER_BIN_ASN1_PREV3A_SPEC).$(EMULATOR): \ - $(BER_BIN_ASN1_PREV3A_SPEC).erl - -$(BER_BIN_DRV_ASN1_PREV3A_SPEC).erl: \ - $(BER_BIN_DRV_ASN1_PREV3A_SPEC).set.asn \ - $(BER_BIN_DRV_ASN1_PREV3A_SPEC).asn1config \ - $(ASN1_PREV3A_SPEC).asn - @echo "$(BER_BIN_DRV_ASN1_PREV3A_SPEC):" - $(ERLC) -bber_bin $(BER_BIN_DRV_PREV3A_FLAGS) $(BER_BIN_DRV_ASN1_PREV3A_SPEC).set.asn - -$(EBIN)/$(BER_BIN_DRV_ASN1_PREV3A_SPEC).$(EMULATOR): \ - $(BER_BIN_DRV_ASN1_PREV3A_SPEC).erl - $(PER_ASN1_PREV3A_SPEC).erl: \ $(PER_ASN1_PREV3A_SPEC).set.asn \ $(ASN1_PREV3A_SPEC).asn - @echo "$(PER_ASN1_PREV3A_SPEC):" - $(ERLC) -bper $(PER_PREV3A_FLAGS) $(PER_ASN1_PREV3A_SPEC).set.asn + $(V_colon)@echo "$(PER_ASN1_PREV3A_SPEC):" + $(asn_verbose)$(ERLC) -bper $(PER_PREV3A_FLAGS) $(PER_ASN1_PREV3A_SPEC).set.asn $(EBIN)/$(PER_ASN1_PREV3A_SPEC).$(EMULATOR): \ $(PER_ASN1_PREV3A_SPEC).erl -$(PER_BIN_ASN1_PREV3A_SPEC).erl: \ - $(PER_BIN_ASN1_PREV3A_SPEC).set.asn \ - $(ASN1_PREV3A_SPEC).asn - @echo "$(PER_BIN_ASN1_PREV3A_SPEC):" - $(ERLC) -bper_bin $(PER_BIN_PREV3A_FLAGS) $(PER_BIN_ASN1_PREV3A_SPEC).set.asn - -$(EBIN)/$(PER_BIN_ASN1_PREV3A_SPEC).$(EMULATOR): \ - $(PER_BIN_ASN1_PREV3A_SPEC).erl - -$(PER_BIN_DRV_ASN1_PREV3A_SPEC).erl: \ - $(PER_BIN_DRV_ASN1_PREV3A_SPEC).set.asn \ - $(ASN1_PREV3A_SPEC).asn - @echo "$(PER_BIN_DRV_ASN1_PREV3A_SPEC):" - $(ERLC) -bper_bin $(PER_BIN_DRV_PREV3A_FLAGS) $(PER_BIN_DRV_ASN1_PREV3A_SPEC).set.asn - -$(EBIN)/$(PER_BIN_DRV_ASN1_PREV3A_SPEC).$(EMULATOR): \ - $(PER_BIN_DRV_ASN1_PREV3A_SPEC).erl # -- (prev3b) -- $(BER_ASN1_PREV3B_SPEC).erl: \ $(BER_ASN1_PREV3B_SPEC).set.asn \ $(ASN1_PREV3B_SPEC).asn - @echo "$(BER_ASN1_PREV3B_SPEC):" - $(ERLC) -bber $(BER_PREV3B_FLAGS) $(BER_ASN1_PREV3B_SPEC).set.asn + $(V_colon)@echo "$(BER_ASN1_PREV3B_SPEC):" + $(asn_verbose)$(ERLC) -bber $(BER_PREV3B_FLAGS) $(BER_ASN1_PREV3B_SPEC).set.asn $(EBIN)/$(BER_ASN1_PREV3B_SPEC).$(EMULATOR): \ $(BER_ASN1_PREV3B_SPEC).erl -$(BER_BIN_ASN1_PREV3B_SPEC).erl: \ - $(BER_BIN_ASN1_PREV3B_SPEC).set.asn \ - $(BER_BIN_ASN1_PREV3B_SPEC).asn1config \ - $(ASN1_PREV3B_SPEC).asn - @echo "$(BER_BIN_ASN1_PREV3B_SPEC):" - $(ERLC) -bber_bin $(BER_BIN_PREV3B_FLAGS) $(BER_BIN_ASN1_PREV3B_SPEC).set.asn - -$(EBIN)/$(BER_BIN_ASN1_PREV3B_SPEC).$(EMULATOR): \ - $(BER_BIN_ASN1_PREV3B_SPEC).erl - -$(BER_BIN_DRV_ASN1_PREV3B_SPEC).erl: \ - $(BER_BIN_DRV_ASN1_PREV3B_SPEC).set.asn \ - $(BER_BIN_DRV_ASN1_PREV3B_SPEC).asn1config \ - $(ASN1_PREV3B_SPEC).asn - @echo "$(BER_BIN_DRV_ASN1_PREV3B_SPEC):" - $(ERLC) -bber_bin $(BER_BIN_DRV_PREV3B_FLAGS) $(BER_BIN_DRV_ASN1_PREV3B_SPEC).set.asn - -$(EBIN)/$(BER_BIN_DRV_ASN1_PREV3B_SPEC).$(EMULATOR): \ - $(BER_BIN_DRV_ASN1_PREV3B_SPEC).erl - $(PER_ASN1_PREV3B_SPEC).erl: \ $(PER_ASN1_PREV3B_SPEC).set.asn \ $(ASN1_PREV3B_SPEC).asn - @echo "$(PER_ASN1_PREV3B_SPEC):" - $(ERLC) -bper $(PER_PREV3B_FLAGS) $(PER_ASN1_PREV3B_SPEC).set.asn + $(V_colon)@echo "$(PER_ASN1_PREV3B_SPEC):" + $(asn_verbose)$(ERLC) -bper $(PER_PREV3B_FLAGS) $(PER_ASN1_PREV3B_SPEC).set.asn $(EBIN)/$(PER_ASN1_PREV3B_SPEC).$(EMULATOR): \ $(PER_ASN1_PREV3B_SPEC).erl -$(PER_BIN_ASN1_PREV3B_SPEC).erl: \ - $(PER_BIN_ASN1_PREV3B_SPEC).set.asn \ - $(ASN1_PREV3B_SPEC).asn - @echo "$(PER_BIN_ASN1_PREV3B_SPEC):" - $(ERLC) -bper_bin $(PER_BIN_PREV3B_FLAGS) $(PER_BIN_ASN1_PREV3B_SPEC).set.asn - -$(EBIN)/$(PER_BIN_ASN1_PREV3B_SPEC).$(EMULATOR): \ - $(PER_BIN_ASN1_PREV3B_SPEC).erl - -$(PER_BIN_DRV_ASN1_PREV3B_SPEC).erl: \ - $(PER_BIN_DRV_ASN1_PREV3B_SPEC).set.asn \ - $(ASN1_PREV3B_SPEC).asn - @echo "$(PER_BIN_DRV_ASN1_PREV3B_SPEC):" - $(ERLC) -bper_bin $(PER_BIN_DRV_PREV3B_FLAGS) $(PER_BIN_DRV_ASN1_PREV3B_SPEC).set.asn - -$(EBIN)/$(PER_BIN_DRV_ASN1_PREV3B_SPEC).$(EMULATOR): \ - $(PER_BIN_DRV_ASN1_PREV3B_SPEC).erl - # -- (prev3c) -- $(BER_ASN1_PREV3C_SPEC).erl: \ $(BER_ASN1_PREV3C_SPEC).set.asn \ $(ASN1_PREV3C_SPEC).asn - @echo "$(BER_ASN1_PREV3C_SPEC):" - $(ERLC) -bber $(BER_PREV3C_FLAGS) $(BER_ASN1_PREV3C_SPEC).set.asn + $(V_colon)@echo "$(BER_ASN1_PREV3C_SPEC):" + $(asn_verbose)$(ERLC) -bber $(BER_PREV3C_FLAGS) $(BER_ASN1_PREV3C_SPEC).set.asn $(EBIN)/$(BER_ASN1_PREV3C_SPEC).$(EMULATOR): \ $(BER_ASN1_PREV3C_SPEC).erl -$(BER_BIN_ASN1_PREV3C_SPEC).erl: \ - $(BER_BIN_ASN1_PREV3C_SPEC).set.asn \ - $(BER_BIN_ASN1_PREV3C_SPEC).asn1config \ - $(ASN1_PREV3C_SPEC).asn - @echo "$(BER_BIN_ASN1_PREV3C_SPEC):" - $(ERLC) -bber_bin $(BER_BIN_PREV3C_FLAGS) $(BER_BIN_ASN1_PREV3C_SPEC).set.asn - -$(EBIN)/$(BER_BIN_ASN1_PREV3C_SPEC).$(EMULATOR): \ - $(BER_BIN_ASN1_PREV3C_SPEC).erl - -$(BER_BIN_DRV_ASN1_PREV3C_SPEC).erl: \ - $(BER_BIN_DRV_ASN1_PREV3C_SPEC).set.asn \ - $(BER_BIN_DRV_ASN1_PREV3C_SPEC).asn1config \ - $(ASN1_PREV3C_SPEC).asn - @echo "$(BER_BIN_DRV_ASN1_PREV3C_SPEC):" - $(ERLC) -bber_bin $(BER_BIN_DRV_PREV3C_FLAGS) $(BER_BIN_DRV_ASN1_PREV3C_SPEC).set.asn - -$(EBIN)/$(BER_BIN_DRV_ASN1_PREV3C_SPEC).$(EMULATOR): \ - $(BER_BIN_DRV_ASN1_PREV3C_SPEC).erl - $(PER_ASN1_PREV3C_SPEC).erl: \ $(PER_ASN1_PREV3C_SPEC).set.asn \ $(ASN1_PREV3C_SPEC).asn - @echo "$(PER_ASN1_PREV3C_SPEC):" - $(ERLC) -bper $(PER_PREV3C_FLAGS) $(PER_ASN1_PREV3C_SPEC).set.asn + $(V_colon)@echo "$(PER_ASN1_PREV3C_SPEC):" + $(asn_verbose)$(ERLC) -bper $(PER_PREV3C_FLAGS) $(PER_ASN1_PREV3C_SPEC).set.asn $(EBIN)/$(PER_ASN1_PREV3C_SPEC).$(EMULATOR): \ $(PER_ASN1_PREV3C_SPEC).erl -$(PER_BIN_ASN1_PREV3C_SPEC).erl: \ - $(PER_BIN_ASN1_PREV3C_SPEC).set.asn \ - $(ASN1_PREV3C_SPEC).asn - @echo "$(PER_BIN_ASN1_PREV3C_SPEC):" - $(ERLC) -bper_bin $(PER_BIN_PREV3C_FLAGS) $(PER_BIN_ASN1_PREV3C_SPEC).set.asn - -$(EBIN)/$(PER_BIN_ASN1_PREV3C_SPEC).$(EMULATOR): \ - $(PER_BIN_ASN1_PREV3C_SPEC).erl - -$(PER_BIN_DRV_ASN1_PREV3C_SPEC).erl: \ - $(PER_BIN_DRV_ASN1_PREV3C_SPEC).set.asn \ - $(ASN1_PREV3C_SPEC).asn - @echo "$(PER_BIN_DRV_ASN1_PREV3C_SPEC):" - $(ERLC) -bper_bin $(PER_BIN_DRV_PREV3C_FLAGS) $(PER_BIN_DRV_ASN1_PREV3C_SPEC).set.asn - -$(EBIN)/$(PER_BIN_DRV_ASN1_PREV3C_SPEC).$(EMULATOR): \ - $(PER_BIN_DRV_ASN1_PREV3C_SPEC).erl - # -- (v3) -- $(BER_ASN1_V3_SPEC).erl: \ $(BER_ASN1_V3_SPEC).set.asn \ $(ASN1_V3_SPEC).asn - @echo "$(BER_ASN1_V3_SPEC):" - $(ERLC) -bber $(BER_V3_FLAGS) $(BER_ASN1_V3_SPEC).set.asn + $(V_colon)@echo "$(BER_ASN1_V3_SPEC):" + $(asn_verbose)$(ERLC) -bber $(BER_V3_FLAGS) $(BER_ASN1_V3_SPEC).set.asn $(EBIN)/$(BER_ASN1_V3_SPEC).$(EMULATOR): \ $(BER_ASN1_V3_SPEC).erl -$(BER_BIN_ASN1_V3_SPEC).erl: \ - $(BER_BIN_ASN1_V3_SPEC).set.asn \ - $(BER_BIN_ASN1_V3_SPEC).asn1config \ - $(ASN1_V3_SPEC).asn - @echo "$(BER_BIN_ASN1_V3_SPEC):" - $(ERLC) -bber_bin $(BER_BIN_V3_FLAGS) $(BER_BIN_ASN1_V3_SPEC).set.asn - -$(EBIN)/$(BER_BIN_ASN1_V3_SPEC).$(EMULATOR): \ - $(BER_BIN_ASN1_V3_SPEC).erl - -$(BER_BIN_DRV_ASN1_V3_SPEC).erl: \ - $(BER_BIN_DRV_ASN1_V3_SPEC).set.asn \ - $(BER_BIN_DRV_ASN1_V3_SPEC).asn1config \ - $(ASN1_V3_SPEC).asn - @echo "$(BER_BIN_DRV_ASN1_V3_SPEC):" - $(ERLC) -bber_bin $(BER_BIN_DRV_V3_FLAGS) $(BER_BIN_DRV_ASN1_V3_SPEC).set.asn - -$(EBIN)/$(BER_BIN_DRV_ASN1_V3_SPEC).$(EMULATOR): \ - $(BER_BIN_DRV_ASN1_V3_SPEC).erl - $(PER_ASN1_V3_SPEC).erl: \ $(PER_ASN1_V3_SPEC).set.asn \ $(ASN1_V3_SPEC).asn - @echo "$(PER_ASN1_V3_SPEC):" - $(ERLC) -bper $(PER_V3_FLAGS) $(PER_ASN1_V3_SPEC).set.asn + $(V_colon)@echo "$(PER_ASN1_V3_SPEC):" + $(asn_verbose)$(ERLC) -bper $(PER_V3_FLAGS) $(PER_ASN1_V3_SPEC).set.asn $(EBIN)/$(PER_ASN1_V3_SPEC).$(EMULATOR): \ $(PER_ASN1_V3_SPEC).erl -$(PER_BIN_ASN1_V3_SPEC).erl: \ - $(PER_BIN_ASN1_V3_SPEC).set.asn \ - $(ASN1_V3_SPEC).asn - @echo "$(PER_BIN_ASN1_V3_SPEC):" - $(ERLC) -bper_bin $(PER_BIN_V3_FLAGS) $(PER_BIN_ASN1_V3_SPEC).set.asn - -$(EBIN)/$(PER_BIN_ASN1_V3_SPEC).$(EMULATOR): \ - $(PER_BIN_ASN1_V3_SPEC).erl - -$(PER_BIN_DRV_ASN1_V3_SPEC).erl: \ - $(PER_BIN_DRV_ASN1_V3_SPEC).set.asn \ - $(ASN1_V3_SPEC).asn - @echo "$(PER_BIN_DRV_ASN1_V3_SPEC):" - $(ERLC) -bper_bin $(PER_BIN_DRV_V3_FLAGS) $(PER_BIN_DRV_ASN1_V3_SPEC).set.asn - -$(EBIN)/$(PER_BIN_DRV_ASN1_V3_SPEC).$(EMULATOR): \ - $(PER_BIN_DRV_ASN1_V3_SPEC).erl - # ------------- $(EBIN)/megaco_ber_encoder.$(EMULATOR): megaco_ber_encoder.erl \ $(MEGACO_ENGINEDIR)/megaco_message_internal.hrl -$(EBIN)/megaco_ber_bin_encoder.$(EMULATOR): megaco_ber_bin_encoder.erl \ - $(MEGACO_ENGINEDIR)/megaco_message_internal.hrl - $(EBIN)/megaco_per_encoder.$(EMULATOR): megaco_per_encoder.erl \ $(MEGACO_ENGINEDIR)/megaco_message_internal.hrl -$(EBIN)/megaco_per_bin_encoder.$(EMULATOR): megaco_per_bin_encoder.erl \ - $(MEGACO_ENGINEDIR)/megaco_message_internal.hrl - $(EBIN)/megaco_binary_encoder_lib.$(EMULATOR): megaco_binary_encoder_lib.erl \ $(MEGACO_ENGINEDIR)/megaco_message_internal.hrl diff --git a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3a.asn1config b/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3a.asn1config deleted file mode 100644 index 179473717d..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3a.asn1config +++ /dev/null @@ -1,43 +0,0 @@ -{exclusive_decode, - {'megaco_ber_bin_drv_media_gateway_control_prev3a', - [ - {decode_message_trans_partial, - [ - 'MegacoMessage',[{mess,[{messageBody,[{transactions,parts}]}]}] - ] - }, - {decode_message_acts_partial, - ['Transaction', - [ - {transactionRequest, - [ - {actions,parts} - ] - }, - {transactionReply, - [ - {transactionResult, [{actionReplies,parts}]} - ] - } - ] - ] - }, - {decode_message_version, - ['MegacoMessage', - [ - {authHeader,undecoded}, - {mess,[{mId,undecoded},{messageBody,undecoded}]} - ] - ] - }, - {decode_message_mId, - ['MegacoMessage', - [ - {authHeader,undecoded}, - {mess,[{messageBody,undecoded}]} - ] - ] - } - ] - } -}. diff --git a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3a.set.asn b/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3a.set.asn deleted file mode 100644 index b9ba7ffdb4..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3a.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-prev3a.asn diff --git a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3b.asn1config b/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3b.asn1config deleted file mode 100644 index ceda97fbd1..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3b.asn1config +++ /dev/null @@ -1,43 +0,0 @@ -{exclusive_decode, - {'megaco_ber_bin_drv_media_gateway_control_prev3b', - [ - {decode_message_trans_partial, - [ - 'MegacoMessage',[{mess,[{messageBody,[{transactions,parts}]}]}] - ] - }, - {decode_message_acts_partial, - ['Transaction', - [ - {transactionRequest, - [ - {actions,parts} - ] - }, - {transactionReply, - [ - {transactionResult, [{actionReplies,parts}]} - ] - } - ] - ] - }, - {decode_message_version, - ['MegacoMessage', - [ - {authHeader,undecoded}, - {mess,[{mId,undecoded},{messageBody,undecoded}]} - ] - ] - }, - {decode_message_mId, - ['MegacoMessage', - [ - {authHeader,undecoded}, - {mess,[{messageBody,undecoded}]} - ] - ] - } - ] - } -}. diff --git a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3b.set.asn b/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3b.set.asn deleted file mode 100644 index 0437bde310..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3b.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-prev3b.asn diff --git a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3c.asn1config b/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3c.asn1config deleted file mode 100644 index d181ef44bd..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3c.asn1config +++ /dev/null @@ -1,43 +0,0 @@ -{exclusive_decode, - {'megaco_ber_bin_drv_media_gateway_control_prev3c', - [ - {decode_message_trans_partial, - [ - 'MegacoMessage',[{mess,[{messageBody,[{transactions,parts}]}]}] - ] - }, - {decode_message_acts_partial, - ['Transaction', - [ - {transactionRequest, - [ - {actions,parts} - ] - }, - {transactionReply, - [ - {transactionResult, [{actionReplies,parts}]} - ] - } - ] - ] - }, - {decode_message_version, - ['MegacoMessage', - [ - {authHeader,undecoded}, - {mess,[{mId,undecoded},{messageBody,undecoded}]} - ] - ] - }, - {decode_message_mId, - ['MegacoMessage', - [ - {authHeader,undecoded}, - {mess,[{messageBody,undecoded}]} - ] - ] - } - ] - } -}. diff --git a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3c.set.asn b/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3c.set.asn deleted file mode 100644 index e78055fbad..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_prev3c.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-prev3c.asn diff --git a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v1.set.asn b/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v1.set.asn deleted file mode 100644 index 0f5a92dba1..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v1.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-v1.asn diff --git a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v2.asn1config b/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v2.asn1config deleted file mode 100644 index 3d0cb9a019..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v2.asn1config +++ /dev/null @@ -1,43 +0,0 @@ -{exclusive_decode, - {'megaco_ber_bin_drv_media_gateway_control_v2', - [ - {decode_message_trans_partial, - [ - 'MegacoMessage',[{mess,[{messageBody,[{transactions,parts}]}]}] - ] - }, - {decode_message_acts_partial, - ['Transaction', - [ - {transactionRequest, - [ - {actions,parts} - ] - }, - {transactionReply, - [ - {transactionResult, [{actionReplies,parts}]} - ] - } - ] - ] - }, - {decode_message_version, - ['MegacoMessage', - [ - {authHeader,undecoded}, - {mess,[{mId,undecoded},{messageBody,undecoded}]} - ] - ] - }, - {decode_message_mId, - ['MegacoMessage', - [ - {authHeader,undecoded}, - {mess,[{messageBody,undecoded}]} - ] - ] - } - ] - } -}. diff --git a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v2.set.asn b/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v2.set.asn deleted file mode 100644 index 7fc82b127f..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v2.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-v2.asn diff --git a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v3.asn1config b/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v3.asn1config deleted file mode 100644 index cc662c0145..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v3.asn1config +++ /dev/null @@ -1,43 +0,0 @@ -{exclusive_decode, - {'megaco_ber_bin_drv_media_gateway_control_v3', - [ - {decode_message_trans_partial, - [ - 'MegacoMessage',[{mess,[{messageBody,[{transactions,parts}]}]}] - ] - }, - {decode_message_acts_partial, - ['Transaction', - [ - {transactionRequest, - [ - {actions,parts} - ] - }, - {transactionReply, - [ - {transactionResult, [{actionReplies,parts}]} - ] - } - ] - ] - }, - {decode_message_version, - ['MegacoMessage', - [ - {authHeader,undecoded}, - {mess,[{mId,undecoded},{messageBody,undecoded}]} - ] - ] - }, - {decode_message_mId, - ['MegacoMessage', - [ - {authHeader,undecoded}, - {mess,[{messageBody,undecoded}]} - ] - ] - } - ] - } -}. diff --git a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v3.set.asn b/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v3.set.asn deleted file mode 100644 index 1d7950a283..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v3.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-v3.asn diff --git a/lib/megaco/src/binary/megaco_ber_bin_encoder.erl b/lib/megaco/src/binary/megaco_ber_bin_encoder.erl deleted file mode 100644 index bf9926c7e5..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_encoder.erl +++ /dev/null @@ -1,716 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - -%% -%%---------------------------------------------------------------------- -%% Purpose : Handle ASN.1 BER encoding of Megaco/H.248 -%%---------------------------------------------------------------------- - --module(megaco_ber_bin_encoder). - --behaviour(megaco_encoder). - --export([encode_message/3, decode_message/3, - decode_mini_message/3, - - encode_transaction/3, - encode_action_requests/3, - encode_action_request/3, - encode_action_reply/3, - - version_of/2]). - -%% Backward compatible functions: --export([encode_message/2, decode_message/2]). - --include_lib("megaco/src/engine/megaco_message_internal.hrl"). - --define(V1_ASN1_MOD, megaco_ber_bin_media_gateway_control_v1). --define(V2_ASN1_MOD, megaco_ber_bin_media_gateway_control_v2). --define(V3_ASN1_MOD, megaco_ber_bin_media_gateway_control_v3). --define(PREV3A_ASN1_MOD, megaco_ber_bin_media_gateway_control_prev3a). --define(PREV3B_ASN1_MOD, megaco_ber_bin_media_gateway_control_prev3b). --define(PREV3C_ASN1_MOD, megaco_ber_bin_media_gateway_control_prev3c). --define(V1_ASN1_MOD_DRV, megaco_ber_bin_drv_media_gateway_control_v1). --define(V2_ASN1_MOD_DRV, megaco_ber_bin_drv_media_gateway_control_v2). --define(V3_ASN1_MOD_DRV, megaco_ber_bin_drv_media_gateway_control_v3). --define(PREV3A_ASN1_MOD_DRV, megaco_ber_bin_drv_media_gateway_control_prev3a). --define(PREV3B_ASN1_MOD_DRV, megaco_ber_bin_drv_media_gateway_control_prev3b). --define(PREV3C_ASN1_MOD_DRV, megaco_ber_bin_drv_media_gateway_control_prev3c). - --define(V1_TRANS_MOD, megaco_binary_transformer_v1). --define(V2_TRANS_MOD, megaco_binary_transformer_v2). --define(V3_TRANS_MOD, megaco_binary_transformer_v3). --define(PREV3A_TRANS_MOD, megaco_binary_transformer_prev3a). --define(PREV3B_TRANS_MOD, megaco_binary_transformer_prev3b). --define(PREV3C_TRANS_MOD, megaco_binary_transformer_prev3c). - --define(BIN_LIB, megaco_binary_encoder_lib). - - -%%---------------------------------------------------------------------- -%% Detect (check/get) message version -%% Return {ok, Version} | {error, Reason} -%%---------------------------------------------------------------------- - -version_of([{version3,v3},driver|EC], Binary) -> - Decoders = [?V1_ASN1_MOD_DRV, ?V2_ASN1_MOD_DRV, ?V3_ASN1_MOD_DRV], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); -version_of([{version3,prev3c},driver|EC], Binary) -> - Decoders = [?V1_ASN1_MOD_DRV, ?V2_ASN1_MOD_DRV, ?PREV3C_ASN1_MOD_DRV], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); -version_of([{version3,prev3b},driver|EC], Binary) -> - Decoders = [?V1_ASN1_MOD_DRV, ?V2_ASN1_MOD_DRV, ?PREV3B_ASN1_MOD_DRV], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); -version_of([{version3,prev3a},driver|EC], Binary) -> - Decoders = [?V1_ASN1_MOD_DRV, ?V2_ASN1_MOD_DRV, ?PREV3A_ASN1_MOD_DRV], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); -version_of([{version3,v3}|EC], Binary) -> - Decoders = [?V1_ASN1_MOD, ?V2_ASN1_MOD, ?V3_ASN1_MOD], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); -version_of([{version3,prev3c}|EC], Binary) -> - Decoders = [?V1_ASN1_MOD, ?V2_ASN1_MOD, ?PREV3C_ASN1_MOD], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); -version_of([{version3,prev3b}|EC], Binary) -> - Decoders = [?V1_ASN1_MOD, ?V2_ASN1_MOD, ?PREV3B_ASN1_MOD], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); -version_of([{version3,prev3a}|EC], Binary) -> - Decoders = [?V1_ASN1_MOD, ?V2_ASN1_MOD, ?PREV3A_ASN1_MOD], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); -version_of([driver|EC], Binary) -> - Decoders = [?V1_ASN1_MOD_DRV, ?V2_ASN1_MOD_DRV, ?V3_ASN1_MOD_DRV], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -version_of(EC, Binary) -> - Decoders = [?V1_ASN1_MOD, ?V2_ASN1_MOD, ?V3_ASN1_MOD], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders). - - -%%---------------------------------------------------------------------- -%% Convert a 'MegacoMessage' record into a binary -%% Return {ok, Binary} | {error, Reason} -%%---------------------------------------------------------------------- - - -encode_message(EC, - #'MegacoMessage'{mess = #'Message'{version = V}} = MegaMsg) -> - encode_message(EC, V, MegaMsg). - - -%% -- Version 1 -- - -encode_message([{version3, _},driver|EC], 1, MegaMsg) -> - AsnMod = ?V1_ASN1_MOD_DRV, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([driver|EC], 1, MegaMsg) -> - AsnMod = ?V1_ASN1_MOD_DRV, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,_}|EC], 1, MegaMsg) -> - AsnMod = ?V1_ASN1_MOD, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -encode_message(EC, 1, MegaMsg) -> - AsnMod = ?V1_ASN1_MOD, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); - - -%% -- Version 2 -- - -encode_message([{version3,_},driver|EC], 2, MegaMsg) -> - AsnMod = ?V2_ASN1_MOD_DRV, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([driver|EC], 2, MegaMsg) -> - AsnMod = ?V2_ASN1_MOD_DRV, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,_}|EC], 2, MegaMsg) -> - AsnMod = ?V2_ASN1_MOD, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -encode_message(EC, 2, MegaMsg) -> - AsnMod = ?V2_ASN1_MOD, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); - - -%% -- Version 3 -- - -encode_message([{version3,v3},driver|EC], 3, MegaMsg) -> - AsnMod = ?V3_ASN1_MOD_DRV, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,prev3c},driver|EC], 3, MegaMsg) -> - AsnMod = ?PREV3C_ASN1_MOD_DRV, - TransMod = ?PREV3C_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,prev3b},driver|EC], 3, MegaMsg) -> - AsnMod = ?PREV3B_ASN1_MOD_DRV, - TransMod = ?PREV3B_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,prev3a},driver|EC], 3, MegaMsg) -> - AsnMod = ?PREV3A_ASN1_MOD_DRV, - TransMod = ?PREV3A_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,v3}|EC], 3, MegaMsg) -> - AsnMod = ?V3_ASN1_MOD, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,prev3c}|EC], 3, MegaMsg) -> - AsnMod = ?PREV3C_ASN1_MOD, - TransMod = ?PREV3C_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,prev3b}|EC], 3, MegaMsg) -> - AsnMod = ?PREV3B_ASN1_MOD, - TransMod = ?PREV3B_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,prev3a}|EC], 3, MegaMsg) -> - AsnMod = ?PREV3A_ASN1_MOD, - TransMod = ?PREV3A_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([driver|EC], 3, MegaMsg) -> - AsnMod = ?V3_ASN1_MOD_DRV, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -encode_message(EC, 3, MegaMsg) -> - AsnMod = ?V3_ASN1_MOD, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list). - - -%%---------------------------------------------------------------------- -%% Convert a transaction (or transactions in the case of ack) record(s) -%% into a binary -%% Return {ok, Binary} | {error, Reason} -%%---------------------------------------------------------------------- - -%% encode_transaction([] = EC, 1, Trans) -> -%% AsnMod = ?V1_ASN1_MOD, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%% encode_transaction([native] = EC, 1, Trans) -> -%% AsnMod = ?V1_ASN1_MOD, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%% encode_transaction([driver|EC], 1, Trans) -> -%% AsnMod = ?V1_ASN1_MOD_DRV, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%% encode_transaction(_EC, 1, _Trans) -> -%% AsnMod = ?V1_ASN1_MOD, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%% encode_transaction([] = EC, 2, Trans) -> -%% AsnMod = ?V2_ASN1_MOD, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%% encode_transaction([native] = EC, 2, Trans) -> -%% AsnMod = ?V2_ASN1_MOD, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%% encode_transaction([driver|EC], 2, Trans) -> -%% AsnMod = ?V2_ASN1_MOD_DRV, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%%encode_transaction(_EC, 2, _Trans) -> -%% AsnMod = ?V2_ASN1_MOD, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list). -%% encode_transaction([] = EC, 3, Trans) -> -%% AsnMod = ?V3_ASN1_MOD, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%% encode_transaction([native] = EC, 3, Trans) -> -%% AsnMod = ?V3_ASN1_MOD, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%% encode_transaction([driver|EC], 3, Trans) -> -%% AsnMod = ?V3_ASN1_MOD_DRV, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%%encode_transaction(_EC, 3, _Trans) -> -%% AsnMod = ?V3_ASN1_MOD, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list). -encode_transaction(_EC, _V, _Trans) -> - {error, not_implemented}. - - -%%---------------------------------------------------------------------- -%% Convert a list of ActionRequest record's into a binary -%% Return {ok, DeepIoList} | {error, Reason} -%%---------------------------------------------------------------------- -%% encode_action_requests([] = EC, 1, ActReqs) when is_list(ActReqs) -> -%% AsnMod = ?V1_ASN1_MOD, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_action_requests(EC, ActReqs, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_requests([native] = EC, 1, ActReqs) when is_list(ActReqs) -> -%% AsnMod = ?V1_ASN1_MOD, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_action_requests(EC, ActReqs, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_requests([driver|EC], 1, ActReqs) when is_list(ActReqs) -> -%% AsnMod = ?V1_ASN1_MOD_DRV, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_action_requests(EC, ActReqs, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_requests(_EC, 1, ActReqs) when is_list(ActReqs) -> -%% AsnMod = ?V1_ASN1_MOD, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_action_requests(EC, ActReqs, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_requests([] = EC, 2, ActReqs) when is_list(ActReqs) -> -%% AsnMod = ?V2_ASN1_MOD, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_action_requests(EC, ActReqs, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_requests([native] = EC, 2, ActReqs) when is_list(ActReqs) -> -%% AsnMod = ?V2_ASN1_MOD, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_action_requests(EC, ActReqs, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_requests([driver|EC], 2, ActReqs) when is_list(ActReqs) -> -%% AsnMod = ?V2_ASN1_MOD_DRV, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_action_requests(EC, ActReqs, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_requests(_EC, 2, ActReqs) when is_list(ActReqs) -> -%% AsnMod = ?V2_ASN1_MOD, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_action_requests(EC, ActReqs, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_requests([] = EC, 3, ActReqs) when is_list(ActReqs) -> -%% AsnMod = ?V3_ASN1_MOD, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_action_requests(EC, ActReqs, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_requests([native] = EC, 3, ActReqs) when is_list(ActReqs) -> -%% AsnMod = ?V3_ASN1_MOD, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_action_requests(EC, ActReqs, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_requests([driver|EC], 3, ActReqs) when is_list(ActReqs) -> -%% AsnMod = ?V3_ASN1_MOD_DRV, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_action_requests(EC, ActReqs, -%% AsnMod, TransMod, -%% io_list); -%%encode_action_requests(_EC, 3, ActReqs) when is_list(ActReqs) -> -%% AsnMod = ?V3_ASN1_MOD, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_action_requests(EC, ActReqs, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_requests(_EC, V, _ActReqs) -> -%% {error, {bad_version, V}}. -encode_action_requests(_EC, _V, _ActReqs) -> - {error, not_implemented}. - - -%%---------------------------------------------------------------------- -%% Convert a ActionRequest record into a binary -%% Return {ok, DeepIoList} | {error, Reason} -%%---------------------------------------------------------------------- -%% encode_action_request([] = EC, 1, ActReq) -> -%% AsnMod = ?V1_ASN1_MOD, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_action_request(EC, ActReq, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_request([native] = EC, 1, ActReq) -> -%% AsnMod = ?V1_ASN1_MOD, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_action_request(EC, ActReq, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_request([driver|EC], 1, ActReq) -> -%% AsnMod = ?V1_ASN1_MOD_DRV, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_action_request(EC, ActReq, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_request(_EC, 1, ActReq) -> -%% AsnMod = ?V1_ASN1_MOD, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_action_request(EC, ActReq, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_request([] = EC, 2, ActReq) -> -%% AsnMod = ?V2_ASN1_MOD, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_action_request(EC, ActReq, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_request([native] = EC, 2, ActReq) -> -%% AsnMod = ?V2_ASN1_MOD, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_action_request(EC, ActReq, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_request([driver|EC], 2, ActReq) -> -%% AsnMod = ?V2_ASN1_MOD_DRV, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_action_request(EC, ActReq, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_request(_EC, 2, ActReq) -> -%% AsnMod = ?V2_ASN1_MOD, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_action_request(EC, ActReq, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_request([] = EC, 3, ActReq) -> -%% AsnMod = ?V3_ASN1_MOD, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_action_request(EC, ActReq, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_request([native] = EC, 3, ActReq) -> -%% AsnMod = ?V3_ASN1_MOD, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_action_request(EC, ActReq, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_request([driver|EC], 3, ActReq) -> -%% AsnMod = ?V3_ASN1_MOD_DRV, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_action_request(EC, ActReq, -%% AsnMod, TransMod, -%% io_list); -%% encode_action_request(_EC, 3, ActReq) -> -%% AsnMod = ?V3_ASN1_MOD, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_action_request(EC, ActReq, -%% AsnMod, TransMod, -%% io_list); -encode_action_request(_EC, _V, _ActReq) -> - {error, not_implemented}. - - -%%---------------------------------------------------------------------- -%% Convert a action reply into a deep io list -%% Not yest supported by this binary codec! -%% Return {ok, DeepIoList} | {error, Reason} -%%---------------------------------------------------------------------- - -encode_action_reply(_EC, _V, _AcionReply) -> - {error, not_implemented}. - - -%%---------------------------------------------------------------------- -%% Convert a binary into a 'MegacoMessage' record -%% Return {ok, MegacoMessageRecord} | {error, Reason} -%%---------------------------------------------------------------------- - -%% Old decode function -decode_message(EC, Binary) -> - decode_message(EC, 1, Binary). - -%% -- Dynamic version detection -- - -%% Select from message -decode_message([{version3,v3},driver|EC], dynamic, Binary) -> - Mods = [{?V1_ASN1_MOD_DRV, ?V1_TRANS_MOD}, - {?V2_ASN1_MOD_DRV, ?V2_TRANS_MOD}, - {?V3_ASN1_MOD_DRV, ?V3_TRANS_MOD}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Mods, binary); -decode_message([{version3,prev3c},driver|EC], dynamic, Binary) -> - Mods = [{?V1_ASN1_MOD_DRV, ?V1_TRANS_MOD}, - {?V2_ASN1_MOD_DRV, ?V2_TRANS_MOD}, - {?PREV3C_ASN1_MOD_DRV, ?PREV3C_TRANS_MOD}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Mods, binary); -decode_message([{version3,prev3b},driver|EC], dynamic, Binary) -> - Mods = [{?V1_ASN1_MOD_DRV, ?V1_TRANS_MOD}, - {?V2_ASN1_MOD_DRV, ?V2_TRANS_MOD}, - {?PREV3B_ASN1_MOD_DRV, ?PREV3B_TRANS_MOD}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Mods, binary); -decode_message([{version3,prev3a},driver|EC], dynamic, Binary) -> - Mods = [{?V1_ASN1_MOD_DRV, ?V1_TRANS_MOD}, - {?V2_ASN1_MOD_DRV, ?V2_TRANS_MOD}, - {?PREV3A_ASN1_MOD_DRV, ?PREV3A_TRANS_MOD}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Mods, binary); -decode_message([{version3,v3}|EC], dynamic, Binary) -> - Mods = [{?V1_ASN1_MOD, ?V1_TRANS_MOD}, - {?V2_ASN1_MOD, ?V2_TRANS_MOD}, - {?V3_ASN1_MOD, ?V3_TRANS_MOD}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Mods, binary); -decode_message([{version3,prev3c}|EC], dynamic, Binary) -> - Mods = [{?V1_ASN1_MOD, ?V1_TRANS_MOD}, - {?V2_ASN1_MOD, ?V2_TRANS_MOD}, - {?PREV3C_ASN1_MOD, ?PREV3C_TRANS_MOD}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Mods, binary); -decode_message([{version3,prev3b}|EC], dynamic, Binary) -> - Mods = [{?V1_ASN1_MOD, ?V1_TRANS_MOD}, - {?V2_ASN1_MOD, ?V2_TRANS_MOD}, - {?PREV3B_ASN1_MOD, ?PREV3B_TRANS_MOD}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Mods, binary); -decode_message([{version3,prev3a}|EC], dynamic, Binary) -> - Mods = [{?V1_ASN1_MOD, ?V1_TRANS_MOD}, - {?V2_ASN1_MOD, ?V2_TRANS_MOD}, - {?PREV3A_ASN1_MOD, ?PREV3A_TRANS_MOD}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Mods, binary); -decode_message([driver|EC], dynamic, Binary) -> - Mods = [{?V1_ASN1_MOD_DRV, ?V1_TRANS_MOD}, - {?V2_ASN1_MOD_DRV, ?V2_TRANS_MOD}, - {?V3_ASN1_MOD_DRV, ?V3_TRANS_MOD}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Mods, binary); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -decode_message(EC, dynamic, Binary) -> - Mods = [{?V1_ASN1_MOD, ?V1_TRANS_MOD}, - {?V2_ASN1_MOD, ?V2_TRANS_MOD}, - {?V3_ASN1_MOD, ?V3_TRANS_MOD}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Mods, binary); - - -%% -- Version 1 -- - -decode_message([{version3,_},driver|EC], 1, Binary) -> - AsnMod = ?V1_ASN1_MOD_DRV, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([driver|EC], 1, Binary) -> - AsnMod = ?V1_ASN1_MOD_DRV, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,_}|EC], 1, Binary) -> - AsnMod = ?V1_ASN1_MOD, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -decode_message(EC, 1, Binary) -> - AsnMod = ?V1_ASN1_MOD, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - - -%% -- Version 2 -- - -decode_message([{version3,_},driver|EC], 2, Binary) -> - AsnMod = ?V2_ASN1_MOD_DRV, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([driver|EC], 2, Binary) -> - AsnMod = ?V2_ASN1_MOD_DRV, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,_}|EC], 2, Binary) -> - AsnMod = ?V2_ASN1_MOD, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -decode_message(EC, 2, Binary) -> - AsnMod = ?V2_ASN1_MOD, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - - -%% -- Version 3 -- - -decode_message([{version3,v3},driver|EC], 3, Binary) -> - AsnMod = ?V3_ASN1_MOD_DRV, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3c},driver|EC], 3, Binary) -> - AsnMod = ?PREV3C_ASN1_MOD_DRV, - TransMod = ?PREV3C_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3b},driver|EC], 3, Binary) -> - AsnMod = ?PREV3B_ASN1_MOD_DRV, - TransMod = ?PREV3B_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3a},driver|EC], 3, Binary) -> - AsnMod = ?PREV3A_ASN1_MOD_DRV, - TransMod = ?PREV3A_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,v3}|EC], 3, Binary) -> - AsnMod = ?V3_ASN1_MOD, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3c}|EC], 3, Binary) -> - AsnMod = ?PREV3C_ASN1_MOD, - TransMod = ?PREV3C_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3b}|EC], 3, Binary) -> - AsnMod = ?PREV3B_ASN1_MOD, - TransMod = ?PREV3B_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3a}|EC], 3, Binary) -> - AsnMod = ?PREV3A_ASN1_MOD, - TransMod = ?PREV3A_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([driver|EC], 3, Binary) -> - AsnMod = ?V3_ASN1_MOD_DRV, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -decode_message(EC, 3, Binary) -> - AsnMod = ?V3_ASN1_MOD, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary). - - -decode_mini_message([{version3,v3},driver|EC], dynamic, Bin) -> - Mods = [?V1_ASN1_MOD_DRV, - ?V2_ASN1_MOD_DRV, - ?V3_ASN1_MOD_DRV], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message([{version3,prev3c},driver|EC], dynamic, Bin) -> - Mods = [?V1_ASN1_MOD_DRV, - ?V2_ASN1_MOD_DRV, - ?PREV3C_ASN1_MOD_DRV], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message([{version3,prev3b},driver|EC], dynamic, Bin) -> - Mods = [?V1_ASN1_MOD_DRV, - ?V2_ASN1_MOD_DRV, - ?PREV3B_ASN1_MOD_DRV], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message([{version3,prev3a},driver|EC], dynamic, Bin) -> - Mods = [?V1_ASN1_MOD_DRV, - ?V2_ASN1_MOD_DRV, - ?PREV3A_ASN1_MOD_DRV], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message([{version3,v3}|EC], dynamic, Bin) -> - Mods = [?V1_ASN1_MOD, - ?V2_ASN1_MOD, - ?V3_ASN1_MOD], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message([{version3,prev3c}|EC], dynamic, Bin) -> - Mods = [?V1_ASN1_MOD, - ?V2_ASN1_MOD, - ?PREV3C_ASN1_MOD], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message([{version3,prev3b}|EC], dynamic, Bin) -> - Mods = [?V1_ASN1_MOD, - ?V2_ASN1_MOD, - ?PREV3B_ASN1_MOD], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message([{version3,prev3a}|EC], dynamic, Bin) -> - Mods = [?V1_ASN1_MOD, - ?V2_ASN1_MOD, - ?PREV3A_ASN1_MOD], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message([driver|EC], dynamic, Bin) -> - Mods = [?V1_ASN1_MOD_DRV, - ?V2_ASN1_MOD_DRV, - ?V3_ASN1_MOD_DRV], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message(EC, dynamic, Bin) -> - Mods = [?V1_ASN1_MOD, - ?V2_ASN1_MOD, - ?V3_ASN1_MOD], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message([{version3,_},driver|EC], 1, Bin) -> - AsnMod = ?V1_ASN1_MOD_DRV, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,_}|EC], 1, Bin) -> - AsnMod = ?V1_ASN1_MOD, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([driver|EC], 1, Bin) -> - AsnMod = ?V1_ASN1_MOD_DRV, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message(EC, 1, Bin) -> - AsnMod = ?V1_ASN1_MOD, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,_},driver|EC], 2, Bin) -> - AsnMod = ?V2_ASN1_MOD_DRV, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,_}|EC], 2, Bin) -> - AsnMod = ?V2_ASN1_MOD, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([driver|EC], 2, Bin) -> - AsnMod = ?V2_ASN1_MOD_DRV, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message(EC, 2, Bin) -> - AsnMod = ?V2_ASN1_MOD, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,v3},driver|EC], 3, Bin) -> - AsnMod = ?V3_ASN1_MOD_DRV, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,prev3c},driver|EC], 3, Bin) -> - AsnMod = ?PREV3C_ASN1_MOD_DRV, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,prev3b},driver|EC], 3, Bin) -> - AsnMod = ?PREV3B_ASN1_MOD_DRV, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,prev3a},driver|EC], 3, Bin) -> - AsnMod = ?PREV3A_ASN1_MOD_DRV, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,v3}|EC], 3, Bin) -> - AsnMod = ?V3_ASN1_MOD, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,prev3c}|EC], 3, Bin) -> - AsnMod = ?PREV3C_ASN1_MOD, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,prev3b}|EC], 3, Bin) -> - AsnMod = ?PREV3B_ASN1_MOD, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,prev3a}|EC], 3, Bin) -> - AsnMod = ?PREV3A_ASN1_MOD, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([driver|EC], 3, Bin) -> - AsnMod = ?V3_ASN1_MOD_DRV, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message(EC, 3, Bin) -> - AsnMod = ?V3_ASN1_MOD, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary). diff --git a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3a.set.asn b/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3a.set.asn deleted file mode 100644 index b9ba7ffdb4..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3a.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-prev3a.asn diff --git a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3b.set.asn b/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3b.set.asn deleted file mode 100644 index 0437bde310..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3b.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-prev3b.asn diff --git a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3c.asn1config b/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3c.asn1config deleted file mode 100644 index c74422b9a2..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3c.asn1config +++ /dev/null @@ -1,43 +0,0 @@ -{exclusive_decode, - {'megaco_ber_bin_media_gateway_control_prev3c', - [ - {decode_message_trans_partial, - [ - 'MegacoMessage',[{mess,[{messageBody,[{transactions,parts}]}]}] - ] - }, - {decode_message_acts_partial, - ['Transaction', - [ - {transactionRequest, - [ - {actions,parts} - ] - }, - {transactionReply, - [ - {transactionResult, [{actionReplies,parts}]} - ] - } - ] - ] - }, - {decode_message_version, - ['MegacoMessage', - [ - {authHeader,undecoded}, - {mess,[{mId,undecoded},{messageBody,undecoded}]} - ] - ] - }, - {decode_message_mId, - ['MegacoMessage', - [ - {authHeader,undecoded}, - {mess,[{messageBody,undecoded}]} - ] - ] - } - ] - } -}. diff --git a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3c.set.asn b/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3c.set.asn deleted file mode 100644 index e78055fbad..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3c.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-prev3c.asn diff --git a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v1.asn1config b/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v1.asn1config deleted file mode 100644 index e815e90948..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v1.asn1config +++ /dev/null @@ -1,44 +0,0 @@ -{exclusive_decode, - {'megaco_ber_bin_media_gateway_control_v1', - [ - {decode_message_trans_partial, - [ - 'MegacoMessage',[{mess,[{messageBody,[{transactions,parts}]}]}] - ] - }, - {decode_message_acts_partial, - ['Transaction', - [ - {transactionRequest, - [ - {actions,parts} - ] - }, - {transactionReply, - [ - {transactionResult, [{actionReplies,parts}]} - ] - } - ] - ] - }, - {decode_message_version, - ['MegacoMessage', - [ - {authHeader,undecoded}, - {mess,[{mId,undecoded},{messageBody,undecoded}]} - ] - ] - }, - {decode_message_mId, - ['MegacoMessage', - [ - {authHeader,undecoded}, - {mess,[{messageBody,undecoded}]} - ] - ] - } - - ] - } -}. diff --git a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v1.set.asn b/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v1.set.asn deleted file mode 100644 index 0f5a92dba1..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v1.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-v1.asn diff --git a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v2.set.asn b/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v2.set.asn deleted file mode 100644 index 7fc82b127f..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v2.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-v2.asn diff --git a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v3.set.asn b/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v3.set.asn deleted file mode 100644 index 1d7950a283..0000000000 --- a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v3.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-v3.asn diff --git a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v2.asn1config b/lib/megaco/src/binary/megaco_ber_media_gateway_control_prev3a.asn1config index cc072b30ee..da67561f1b 100644 --- a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v2.asn1config +++ b/lib/megaco/src/binary/megaco_ber_media_gateway_control_prev3a.asn1config @@ -1,5 +1,5 @@ {exclusive_decode, - {'megaco_ber_bin_media_gateway_control_v2', + {'megaco_ber_media_gateway_control_prev3a', [ {decode_message_trans_partial, [ @@ -14,7 +14,7 @@ {actions,parts} ] }, - {transactionReply, + {transactionReply, [ {transactionResult, [{actionReplies,parts}]} ] diff --git a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v3.asn1config b/lib/megaco/src/binary/megaco_ber_media_gateway_control_prev3b.asn1config index deeb2b2da9..2f25f03d97 100644 --- a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_v3.asn1config +++ b/lib/megaco/src/binary/megaco_ber_media_gateway_control_prev3b.asn1config @@ -1,5 +1,5 @@ {exclusive_decode, - {'megaco_ber_bin_media_gateway_control_v3', + {'megaco_ber_media_gateway_control_prev3b', [ {decode_message_trans_partial, [ @@ -14,7 +14,7 @@ {actions,parts} ] }, - {transactionReply, + {transactionReply, [ {transactionResult, [{actionReplies,parts}]} ] diff --git a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3a.asn1config b/lib/megaco/src/binary/megaco_ber_media_gateway_control_prev3c.asn1config index 456ce750ad..23c343eed0 100644 --- a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3a.asn1config +++ b/lib/megaco/src/binary/megaco_ber_media_gateway_control_prev3c.asn1config @@ -1,5 +1,5 @@ {exclusive_decode, - {'megaco_ber_bin_media_gateway_control_prev3a', + {'megaco_ber_media_gateway_control_prev3c', [ {decode_message_trans_partial, [ @@ -14,7 +14,7 @@ {actions,parts} ] }, - {transactionReply, + {transactionReply, [ {transactionResult, [{actionReplies,parts}]} ] diff --git a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v1.asn1config b/lib/megaco/src/binary/megaco_ber_media_gateway_control_v1.asn1config index ea10a7d527..951825c0aa 100644 --- a/lib/megaco/src/binary/megaco_ber_bin_drv_media_gateway_control_v1.asn1config +++ b/lib/megaco/src/binary/megaco_ber_media_gateway_control_v1.asn1config @@ -1,5 +1,5 @@ {exclusive_decode, - {'megaco_ber_bin_drv_media_gateway_control_v1', + {'megaco_ber_media_gateway_control_v1', [ {decode_message_trans_partial, [ @@ -14,7 +14,7 @@ {actions,parts} ] }, - {transactionReply, + {transactionReply, [ {transactionResult, [{actionReplies,parts}]} ] @@ -38,7 +38,7 @@ ] ] } + ] } }. - diff --git a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3b.asn1config b/lib/megaco/src/binary/megaco_ber_media_gateway_control_v3.asn1config index fa5cd80baf..e4b1f9ece9 100644 --- a/lib/megaco/src/binary/megaco_ber_bin_media_gateway_control_prev3b.asn1config +++ b/lib/megaco/src/binary/megaco_ber_media_gateway_control_v3.asn1config @@ -1,5 +1,5 @@ {exclusive_decode, - {'megaco_ber_bin_media_gateway_control_prev3b', + {'megaco_ber_media_gateway_control_v3', [ {decode_message_trans_partial, [ @@ -14,7 +14,7 @@ {actions,parts} ] }, - {transactionReply, + {transactionReply, [ {transactionResult, [{actionReplies,parts}]} ] diff --git a/lib/megaco/src/binary/megaco_binary_encoder.erl b/lib/megaco/src/binary/megaco_binary_encoder.erl index f825f91a45..abb496c173 100644 --- a/lib/megaco/src/binary/megaco_binary_encoder.erl +++ b/lib/megaco/src/binary/megaco_binary_encoder.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -241,55 +241,30 @@ encode_action_reply(_EC, _V, _AcionReply) -> %% Return {ok, Version} | {error, Reason} %%---------------------------------------------------------------------- -version_of([{version3,v3},driver|EC], Binary) -> - Decoders = [megaco_ber_bin_drv_media_gateway_control_v1, - megaco_ber_bin_drv_media_gateway_control_v2, - megaco_ber_bin_drv_media_gateway_control_v3], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); -version_of([{version3,prev3c},driver|EC], Binary) -> - Decoders = [megaco_ber_bin_drv_media_gateway_control_v1, - megaco_ber_bin_drv_media_gateway_control_v2, - megaco_ber_bin_drv_media_gateway_control_prev3c], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); -version_of([{version3,prev3b},driver|EC], Binary) -> - Decoders = [megaco_ber_bin_drv_media_gateway_control_v1, - megaco_ber_bin_drv_media_gateway_control_v2, - megaco_ber_bin_drv_media_gateway_control_prev3b], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); -version_of([{version3,prev3a},driver|EC], Binary) -> - Decoders = [megaco_ber_bin_drv_media_gateway_control_v1, - megaco_ber_bin_drv_media_gateway_control_v2, - megaco_ber_bin_drv_media_gateway_control_prev3a], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); -version_of([driver|EC], Binary) -> - Decoders = [megaco_ber_bin_drv_media_gateway_control_v1, - megaco_ber_bin_drv_media_gateway_control_v2, - megaco_ber_bin_drv_media_gateway_control_v3], - ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); version_of([{version3,v3}|EC], Binary) -> - Decoders = [megaco_ber_bin_media_gateway_control_v1, - megaco_ber_bin_media_gateway_control_v2, - megaco_ber_bin_media_gateway_control_v3], + Decoders = [megaco_ber_media_gateway_control_v1, + megaco_ber_media_gateway_control_v2, + megaco_ber_media_gateway_control_v3], ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); version_of([{version3,prev3c}|EC], Binary) -> - Decoders = [megaco_ber_bin_media_gateway_control_v1, - megaco_ber_bin_media_gateway_control_v2, - megaco_ber_bin_media_gateway_control_prev3c], + Decoders = [megaco_ber_media_gateway_control_v1, + megaco_ber_media_gateway_control_v2, + megaco_ber_media_gateway_control_prev3c], ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); version_of([{version3,prev3b}|EC], Binary) -> - Decoders = [megaco_ber_bin_media_gateway_control_v1, - megaco_ber_bin_media_gateway_control_v2, - megaco_ber_bin_media_gateway_control_prev3b], + Decoders = [megaco_ber_media_gateway_control_v1, + megaco_ber_media_gateway_control_v2, + megaco_ber_media_gateway_control_prev3b], ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); version_of([{version3,prev3a}|EC], Binary) -> - Decoders = [megaco_ber_bin_media_gateway_control_v1, - megaco_ber_bin_media_gateway_control_v2, - megaco_ber_bin_media_gateway_control_prev3a], + Decoders = [megaco_ber_media_gateway_control_v1, + megaco_ber_media_gateway_control_v2, + megaco_ber_media_gateway_control_prev3a], ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders); version_of(EC, Binary) -> - Decoders = [megaco_ber_bin_media_gateway_control_v1, - megaco_ber_bin_media_gateway_control_v2, - megaco_ber_bin_media_gateway_control_v3], + Decoders = [megaco_ber_media_gateway_control_v1, + megaco_ber_media_gateway_control_v2, + megaco_ber_media_gateway_control_v3], ?BIN_LIB:version_of(EC, Binary, dynamic, Decoders). @@ -301,287 +276,153 @@ version_of(EC, Binary) -> decode_message(EC, Binary) -> decode_message(EC, 1, Binary). -decode_message([{version3,v3},driver|EC], dynamic, Binary) -> - Decoders = [{megaco_ber_bin_drv_media_gateway_control_v1, - megaco_binary_transformer_v1}, - {megaco_ber_bin_drv_media_gateway_control_v2, - megaco_binary_transformer_v2}, - {megaco_ber_bin_drv_media_gateway_control_v3, - megaco_binary_transformer_v3}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Decoders, binary); -decode_message([{version3,prev3c},driver|EC], dynamic, Binary) -> - Decoders = [{megaco_ber_bin_drv_media_gateway_control_v1, - megaco_binary_transformer_v1}, - {megaco_ber_bin_drv_media_gateway_control_v2, - megaco_binary_transformer_v2}, - {megaco_ber_bin_drv_media_gateway_control_prev3c, - megaco_binary_transformer_prev3c}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Decoders, binary); -decode_message([{version3,prev3b},driver|EC], dynamic, Binary) -> - Decoders = [{megaco_ber_bin_drv_media_gateway_control_v1, - megaco_binary_transformer_v1}, - {megaco_ber_bin_drv_media_gateway_control_v2, - megaco_binary_transformer_v2}, - {megaco_ber_bin_drv_media_gateway_control_prev3b, - megaco_binary_transformer_prev3b}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Decoders, binary); -decode_message([{version3,prev3a},driver|EC], dynamic, Binary) -> - Decoders = [{megaco_ber_bin_drv_media_gateway_control_v1, - megaco_binary_transformer_v1}, - {megaco_ber_bin_drv_media_gateway_control_v2, - megaco_binary_transformer_v2}, - {megaco_ber_bin_drv_media_gateway_control_prev3a, - megaco_binary_transformer_prev3a}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Decoders, binary); -decode_message([driver|EC], dynamic, Binary) -> - Decoders = [{megaco_ber_bin_drv_media_gateway_control_v1, - megaco_binary_transformer_v1}, - {megaco_ber_bin_drv_media_gateway_control_v2, - megaco_binary_transformer_v2}, - {megaco_ber_bin_drv_media_gateway_control_v3, - megaco_binary_transformer_v3}], - ?BIN_LIB:decode_message_dynamic(EC, Binary, Decoders, binary); decode_message([{version3,v3}|EC], dynamic, Binary) -> - Decoders = [{megaco_ber_bin_media_gateway_control_v1, + Decoders = [{megaco_ber_media_gateway_control_v1, megaco_binary_transformer_v1}, - {megaco_ber_bin_media_gateway_control_v2, + {megaco_ber_media_gateway_control_v2, megaco_binary_transformer_v2}, - {megaco_ber_bin_media_gateway_control_v3, + {megaco_ber_media_gateway_control_v3, megaco_binary_transformer_v3}], ?BIN_LIB:decode_message_dynamic(EC, Binary, Decoders, binary); decode_message([{version3,prev3c}|EC], dynamic, Binary) -> - Decoders = [{megaco_ber_bin_media_gateway_control_v1, + Decoders = [{megaco_ber_media_gateway_control_v1, megaco_binary_transformer_v1}, - {megaco_ber_bin_media_gateway_control_v2, + {megaco_ber_media_gateway_control_v2, megaco_binary_transformer_v2}, - {megaco_ber_bin_media_gateway_control_prev3c, + {megaco_ber_media_gateway_control_prev3c, megaco_binary_transformer_prev3c}], ?BIN_LIB:decode_message_dynamic(EC, Binary, Decoders, binary); decode_message([{version3,prev3b}|EC], dynamic, Binary) -> - Decoders = [{megaco_ber_bin_media_gateway_control_v1, + Decoders = [{megaco_ber_media_gateway_control_v1, megaco_binary_transformer_v1}, - {megaco_ber_bin_media_gateway_control_v2, + {megaco_ber_media_gateway_control_v2, megaco_binary_transformer_v2}, - {megaco_ber_bin_media_gateway_control_prev3b, + {megaco_ber_media_gateway_control_prev3b, megaco_binary_transformer_prev3b}], ?BIN_LIB:decode_message_dynamic(EC, Binary, Decoders, binary); decode_message([{version3,prev3a}|EC], dynamic, Binary) -> - Decoders = [{megaco_ber_bin_media_gateway_control_v1, + Decoders = [{megaco_ber_media_gateway_control_v1, megaco_binary_transformer_v1}, - {megaco_ber_bin_media_gateway_control_v2, + {megaco_ber_media_gateway_control_v2, megaco_binary_transformer_v2}, - {megaco_ber_bin_media_gateway_control_prev3a, + {megaco_ber_media_gateway_control_prev3a, megaco_binary_transformer_prev3a}], ?BIN_LIB:decode_message_dynamic(EC, Binary, Decoders, binary); decode_message(EC, dynamic, Binary) -> - Decoders = [{megaco_ber_bin_media_gateway_control_v1, + Decoders = [{megaco_ber_media_gateway_control_v1, megaco_binary_transformer_v1}, - {megaco_ber_bin_media_gateway_control_v2, + {megaco_ber_media_gateway_control_v2, megaco_binary_transformer_v2}, - {megaco_ber_bin_media_gateway_control_v3, + {megaco_ber_media_gateway_control_v3, megaco_binary_transformer_v3}], ?BIN_LIB:decode_message_dynamic(EC, Binary, Decoders, binary); %% -- Version 1 -- -decode_message([{version3,_},driver|EC], 1, Binary) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_v1, - TransMod = megaco_binary_transformer_v1, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - -decode_message([driver|EC], 1, Binary) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_v1, - TransMod = megaco_binary_transformer_v1, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - decode_message([{version3,_}|EC], 1, Binary) -> - AsnMod = megaco_ber_bin_media_gateway_control_v1, + AsnMod = megaco_ber_media_gateway_control_v1, TransMod = megaco_binary_transformer_v1, ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); decode_message(EC, 1, Binary) -> - AsnMod = megaco_ber_bin_media_gateway_control_v1, + AsnMod = megaco_ber_media_gateway_control_v1, TransMod = megaco_binary_transformer_v1, ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); %% -- Version 2 -- -decode_message([{version3,_},driver|EC], 2, Binary) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_v2, - TransMod = megaco_binary_transformer_v2, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - -decode_message([driver|EC], 2, Binary) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_v2, - TransMod = megaco_binary_transformer_v2, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - decode_message([{version3,_}|EC], 2, Binary) -> - AsnMod = megaco_ber_bin_media_gateway_control_v2, + AsnMod = megaco_ber_media_gateway_control_v2, TransMod = megaco_binary_transformer_v2, ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); decode_message(EC, 2, Binary) -> - AsnMod = megaco_ber_bin_media_gateway_control_v2, + AsnMod = megaco_ber_media_gateway_control_v2, TransMod = megaco_binary_transformer_v2, ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); %% -- Version 3 -- -decode_message([{version3,v3},driver|EC], 3, Binary) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_v3, - TransMod = megaco_binary_transformer_v3, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3c},driver|EC], 3, Binary) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_prev3c, - TransMod = megaco_binary_transformer_prev3c, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3b},driver|EC], 3, Binary) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_prev3b, - TransMod = megaco_binary_transformer_prev3b, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3a},driver|EC], 3, Binary) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_prev3a, - TransMod = megaco_binary_transformer_prev3a, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - -decode_message([driver|EC], 3, Binary) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_v3, - TransMod = megaco_binary_transformer_v3, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - decode_message([{version3,v3}|EC], 3, Binary) -> - AsnMod = megaco_ber_bin_media_gateway_control_v3, + AsnMod = megaco_ber_media_gateway_control_v3, TransMod = megaco_binary_transformer_v3, ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); decode_message([{version3,prev3c}|EC], 3, Binary) -> - AsnMod = megaco_ber_bin_media_gateway_control_prev3c, + AsnMod = megaco_ber_media_gateway_control_prev3c, TransMod = megaco_binary_transformer_prev3c, ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); decode_message([{version3,prev3b}|EC], 3, Binary) -> - AsnMod = megaco_ber_bin_media_gateway_control_prev3b, + AsnMod = megaco_ber_media_gateway_control_prev3b, TransMod = megaco_binary_transformer_prev3b, ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); decode_message([{version3,prev3a}|EC], 3, Binary) -> - AsnMod = megaco_ber_bin_media_gateway_control_prev3a, + AsnMod = megaco_ber_media_gateway_control_prev3a, TransMod = megaco_binary_transformer_prev3a, ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); decode_message(EC, 3, Binary) -> - AsnMod = megaco_ber_bin_media_gateway_control_v3, + AsnMod = megaco_ber_media_gateway_control_v3, TransMod = megaco_binary_transformer_v3, ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary). -decode_mini_message([{version3,v3},driver|EC], dynamic, Bin) -> - Mods = [megaco_ber_bin_drv_media_gateway_control_v1, - megaco_ber_bin_drv_media_gateway_control_v2, - megaco_ber_bin_drv_media_gateway_control_v3], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message([{version3,prev3c},driver|EC], dynamic, Bin) -> - Mods = [megaco_ber_bin_drv_media_gateway_control_v1, - megaco_ber_bin_drv_media_gateway_control_v2, - megaco_ber_bin_drv_media_gateway_control_prev3c], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message([{version3,prev3b},driver|EC], dynamic, Bin) -> - Mods = [megaco_ber_bin_drv_media_gateway_control_v1, - megaco_ber_bin_drv_media_gateway_control_v2, - megaco_ber_bin_drv_media_gateway_control_prev3b], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message([{version3,prev3a},driver|EC], dynamic, Bin) -> - Mods = [megaco_ber_bin_drv_media_gateway_control_v1, - megaco_ber_bin_drv_media_gateway_control_v2, - megaco_ber_bin_drv_media_gateway_control_prev3a], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message([driver|EC], dynamic, Bin) -> - Mods = [megaco_ber_bin_drv_media_gateway_control_v1, - megaco_ber_bin_drv_media_gateway_control_v2, - megaco_ber_bin_drv_media_gateway_control_v3], - ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); decode_mini_message([{version3,v3}|EC], dynamic, Bin) -> - Mods = [megaco_ber_bin_media_gateway_control_v1, - megaco_ber_bin_media_gateway_control_v2, - megaco_ber_bin_media_gateway_control_v3], + Mods = [megaco_ber_media_gateway_control_v1, + megaco_ber_media_gateway_control_v2, + megaco_ber_media_gateway_control_v3], ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); decode_mini_message([{version3,prev3c}|EC], dynamic, Bin) -> - Mods = [megaco_ber_bin_media_gateway_control_v1, - megaco_ber_bin_media_gateway_control_v2, - megaco_ber_bin_media_gateway_control_prev3c], + Mods = [megaco_ber_media_gateway_control_v1, + megaco_ber_media_gateway_control_v2, + megaco_ber_media_gateway_control_prev3c], ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); decode_mini_message([{version3,prev3b}|EC], dynamic, Bin) -> - Mods = [megaco_ber_bin_media_gateway_control_v1, - megaco_ber_bin_media_gateway_control_v2, - megaco_ber_bin_media_gateway_control_prev3b], + Mods = [megaco_ber_media_gateway_control_v1, + megaco_ber_media_gateway_control_v2, + megaco_ber_media_gateway_control_prev3b], ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); decode_mini_message([{version3,prev3a}|EC], dynamic, Bin) -> - Mods = [megaco_ber_bin_media_gateway_control_v1, - megaco_ber_bin_media_gateway_control_v2, - megaco_ber_bin_media_gateway_control_prev3a], + Mods = [megaco_ber_media_gateway_control_v1, + megaco_ber_media_gateway_control_v2, + megaco_ber_media_gateway_control_prev3a], ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); decode_mini_message(EC, dynamic, Bin) -> - Mods = [megaco_ber_bin_media_gateway_control_v1, - megaco_ber_bin_media_gateway_control_v2, - megaco_ber_bin_media_gateway_control_v3], + Mods = [megaco_ber_media_gateway_control_v1, + megaco_ber_media_gateway_control_v2, + megaco_ber_media_gateway_control_v3], ?BIN_LIB:decode_mini_message_dynamic(EC, Bin, Mods, binary); -decode_mini_message([{version3,_},driver|EC], 1, Bin) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_v1, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([driver|EC], 1, Bin) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_v1, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); decode_mini_message([{version3,_}|EC], 1, Bin) -> - AsnMod = megaco_ber_bin_media_gateway_control_v1, + AsnMod = megaco_ber_media_gateway_control_v1, ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); decode_mini_message(EC, 1, Bin) -> - AsnMod = megaco_ber_bin_media_gateway_control_v1, + AsnMod = megaco_ber_media_gateway_control_v1, ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,_},driver|EC], 2, Bin) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_v2, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([driver|EC], 2, Bin) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_v2, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); decode_mini_message([{version3,_}|EC], 2, Bin) -> - AsnMod = megaco_ber_bin_media_gateway_control_v2, + AsnMod = megaco_ber_media_gateway_control_v2, ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); decode_mini_message(EC, 2, Bin) -> - AsnMod = megaco_ber_bin_media_gateway_control_v2, + AsnMod = megaco_ber_media_gateway_control_v2, ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,v3},driver|EC], 3, Bin) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_v3, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,prev3c},driver|EC], 3, Bin) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_prev3c, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,prev3b},driver|EC], 3, Bin) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_prev3b, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([{version3,prev3a},driver|EC], 3, Bin) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_prev3a, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); -decode_mini_message([driver|EC], 3, Bin) -> - AsnMod = megaco_ber_bin_drv_media_gateway_control_v3, - ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); decode_mini_message([{version3,v3}|EC], 3, Bin) -> - AsnMod = megaco_ber_bin_media_gateway_control_v3, + AsnMod = megaco_ber_media_gateway_control_v3, ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); decode_mini_message([{version3,prev3c}|EC], 3, Bin) -> - AsnMod = megaco_ber_bin_media_gateway_control_prev3c, + AsnMod = megaco_ber_media_gateway_control_prev3c, ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); decode_mini_message([{version3,prev3b}|EC], 3, Bin) -> - AsnMod = megaco_ber_bin_media_gateway_control_prev3b, + AsnMod = megaco_ber_media_gateway_control_prev3b, ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); decode_mini_message([{version3,prev3a}|EC], 3, Bin) -> - AsnMod = megaco_ber_bin_media_gateway_control_prev3a, + AsnMod = megaco_ber_media_gateway_control_prev3a, ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary); decode_mini_message(EC, 3, Bin) -> - AsnMod = megaco_ber_bin_media_gateway_control_v3, + AsnMod = megaco_ber_media_gateway_control_v3, ?BIN_LIB:decode_mini_message(EC, Bin, AsnMod, binary). diff --git a/lib/megaco/src/binary/megaco_binary_encoder_lib.erl b/lib/megaco/src/binary/megaco_binary_encoder_lib.erl index 967ee93935..8a4f4e7509 100644 --- a/lib/megaco/src/binary/megaco_binary_encoder_lib.erl +++ b/lib/megaco/src/binary/megaco_binary_encoder_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2011. All Rights Reserved. +%% Copyright Ericsson AB 2005-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -275,7 +275,7 @@ decode_message_dynamic(_EC, _BadBin, _Mods, _Type) -> {error, no_binary}. -decode_message(EC, Bin, AsnMod, TransMod, binary) -> +decode_message(EC, Bin, AsnMod, TransMod, _) -> case asn1rt:decode(AsnMod, 'MegacoMessage', Bin) of {ok, MegaMsg} -> case EC of @@ -286,19 +286,6 @@ decode_message(EC, Bin, AsnMod, TransMod, binary) -> end; {error, Reason} -> {error, Reason} - end; -decode_message(EC, Bin, AsnMod, TransMod, io_list) -> - ShallowIoList = erlang:binary_to_list(Bin), - case asn1rt:decode(AsnMod, 'MegacoMessage', ShallowIoList) of - {ok, MegaMsg} -> - case EC of - [native] -> - {ok, MegaMsg}; - _ -> - {ok, TransMod:tr_message(MegaMsg, decode, EC)} - end; - {error, Reason} -> - {error, Reason} end. diff --git a/lib/megaco/src/binary/megaco_binary_name_resolver_prev3a.erl b/lib/megaco/src/binary/megaco_binary_name_resolver_prev3a.erl index 72b3112053..24dc410dbe 100644 --- a/lib/megaco/src/binary/megaco_binary_name_resolver_prev3a.erl +++ b/lib/megaco/src/binary/megaco_binary_name_resolver_prev3a.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -204,7 +204,7 @@ decode_name(_Config, Scope, Item) -> %% to command requests from the MGC that audit %% ObservedEventsDescriptor, and found in the %% ObservedEventsDescriptor. See 12.2. If there are no parameters -%% for the ObservedEvents Descriptor, then �none� shall be specified. +%% for the ObservedEvents Descriptor, then 'none' shall be specified. %% %% %% 12.1.4 Signals @@ -225,7 +225,7 @@ decode_name(_Config, Scope, Item) -> %% %% BR (Brief) %% -%% NOTE -�SignalType may be defined such that it is dependent on +%% NOTE - SignalType may be defined such that it is dependent on %% the value of one or more parameters. The package MUST specify a %% default signal type. If the default type is TO, the package MUST %% specify a default duration which may be provisioned. A default diff --git a/lib/megaco/src/binary/megaco_binary_name_resolver_prev3b.erl b/lib/megaco/src/binary/megaco_binary_name_resolver_prev3b.erl index 12e673ac81..d89717c00a 100644 --- a/lib/megaco/src/binary/megaco_binary_name_resolver_prev3b.erl +++ b/lib/megaco/src/binary/megaco_binary_name_resolver_prev3b.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -204,7 +204,7 @@ decode_name(_Config, Scope, Item) -> %% to command requests from the MGC that audit %% ObservedEventsDescriptor, and found in the %% ObservedEventsDescriptor. See 12.2. If there are no parameters -%% for the ObservedEvents Descriptor, then �none� shall be specified. +%% for the ObservedEvents Descriptor, then 'none' shall be specified. %% %% %% 12.1.4 Signals @@ -225,7 +225,7 @@ decode_name(_Config, Scope, Item) -> %% %% BR (Brief) %% -%% NOTE -�SignalType may be defined such that it is dependent on +%% NOTE - SignalType may be defined such that it is dependent on %% the value of one or more parameters. The package MUST specify a %% default signal type. If the default type is TO, the package MUST %% specify a default duration which may be provisioned. A default diff --git a/lib/megaco/src/binary/megaco_binary_name_resolver_prev3c.erl b/lib/megaco/src/binary/megaco_binary_name_resolver_prev3c.erl index d08231caac..8b4192ad44 100644 --- a/lib/megaco/src/binary/megaco_binary_name_resolver_prev3c.erl +++ b/lib/megaco/src/binary/megaco_binary_name_resolver_prev3c.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -204,7 +204,7 @@ decode_name(_Config, Scope, Item) -> %% to command requests from the MGC that audit %% ObservedEventsDescriptor, and found in the %% ObservedEventsDescriptor. See 12.2. If there are no parameters -%% for the ObservedEvents Descriptor, then �none� shall be specified. +%% for the ObservedEvents Descriptor, then 'none' shall be specified. %% %% %% 12.1.4 Signals @@ -225,7 +225,7 @@ decode_name(_Config, Scope, Item) -> %% %% BR (Brief) %% -%% NOTE -�SignalType may be defined such that it is dependent on +%% NOTE - SignalType may be defined such that it is dependent on %% the value of one or more parameters. The package MUST specify a %% default signal type. If the default type is TO, the package MUST %% specify a default duration which may be provisioned. A default diff --git a/lib/megaco/src/binary/megaco_binary_name_resolver_v3.erl b/lib/megaco/src/binary/megaco_binary_name_resolver_v3.erl index c101aa15bc..20954d4c9d 100644 --- a/lib/megaco/src/binary/megaco_binary_name_resolver_v3.erl +++ b/lib/megaco/src/binary/megaco_binary_name_resolver_v3.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -204,7 +204,7 @@ decode_name(_Config, Scope, Item) -> %% to command requests from the MGC that audit %% ObservedEventsDescriptor, and found in the %% ObservedEventsDescriptor. See 12.2. If there are no parameters -%% for the ObservedEvents Descriptor, then �none� shall be specified. +%% for the ObservedEvents Descriptor, then 'none' shall be specified. %% %% %% 12.1.4 Signals @@ -225,7 +225,7 @@ decode_name(_Config, Scope, Item) -> %% %% BR (Brief) %% -%% NOTE -�SignalType may be defined such that it is dependent on +%% NOTE - SignalType may be defined such that it is dependent on %% the value of one or more parameters. The package MUST specify a %% default signal type. If the default type is TO, the package MUST %% specify a default duration which may be provisioned. A default diff --git a/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_prev3a.set.asn b/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_prev3a.set.asn deleted file mode 100644 index b9ba7ffdb4..0000000000 --- a/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_prev3a.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-prev3a.asn diff --git a/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_prev3b.set.asn b/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_prev3b.set.asn deleted file mode 100644 index 0437bde310..0000000000 --- a/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_prev3b.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-prev3b.asn diff --git a/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_prev3c.set.asn b/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_prev3c.set.asn deleted file mode 100644 index e78055fbad..0000000000 --- a/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_prev3c.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-prev3c.asn diff --git a/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_v1.set.asn b/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_v1.set.asn deleted file mode 100644 index 0f5a92dba1..0000000000 --- a/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_v1.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-v1.asn diff --git a/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_v2.set.asn b/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_v2.set.asn deleted file mode 100644 index 7fc82b127f..0000000000 --- a/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_v2.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-v2.asn diff --git a/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_v3.set.asn b/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_v3.set.asn deleted file mode 100644 index 1d7950a283..0000000000 --- a/lib/megaco/src/binary/megaco_per_bin_drv_media_gateway_control_v3.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-v3.asn diff --git a/lib/megaco/src/binary/megaco_per_bin_encoder.erl b/lib/megaco/src/binary/megaco_per_bin_encoder.erl deleted file mode 100644 index f7280f4e04..0000000000 --- a/lib/megaco/src/binary/megaco_per_bin_encoder.erl +++ /dev/null @@ -1,447 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - -%% -%%---------------------------------------------------------------------- -%% Purpose : Handle ASN.1 PER encoding of Megaco/H.248 -%%---------------------------------------------------------------------- - --module(megaco_per_bin_encoder). - --behaviour(megaco_encoder). - --export([encode_message/3, decode_message/3, - decode_mini_message/3, - - encode_transaction/3, - encode_action_requests/3, - encode_action_request/3, - encode_action_reply/3, - - version_of/2]). - -%% Backward compatible functions: --export([encode_message/2, decode_message/2]). - --include_lib("megaco/src/engine/megaco_message_internal.hrl"). - --define(V1_ASN1_MOD, megaco_per_bin_media_gateway_control_v1). --define(V2_ASN1_MOD, megaco_per_bin_media_gateway_control_v2). --define(V3_ASN1_MOD, megaco_per_bin_media_gateway_control_v3). --define(PREV3A_ASN1_MOD, megaco_per_bin_media_gateway_control_prev3a). --define(PREV3B_ASN1_MOD, megaco_per_bin_media_gateway_control_prev3b). --define(PREV3C_ASN1_MOD, megaco_per_bin_media_gateway_control_prev3c). --define(V1_ASN1_MOD_DRV, megaco_per_bin_drv_media_gateway_control_v1). --define(V2_ASN1_MOD_DRV, megaco_per_bin_drv_media_gateway_control_v2). --define(V3_ASN1_MOD_DRV, megaco_per_bin_drv_media_gateway_control_v3). --define(PREV3A_ASN1_MOD_DRV, megaco_per_bin_drv_media_gateway_control_prev3a). --define(PREV3B_ASN1_MOD_DRV, megaco_per_bin_drv_media_gateway_control_prev3b). --define(PREV3C_ASN1_MOD_DRV, megaco_per_bin_drv_media_gateway_control_prev3c). - --define(V1_TRANS_MOD, megaco_binary_transformer_v1). --define(V2_TRANS_MOD, megaco_binary_transformer_v2). --define(V3_TRANS_MOD, megaco_binary_transformer_v3). --define(PREV3A_TRANS_MOD, megaco_binary_transformer_prev3a). --define(PREV3B_TRANS_MOD, megaco_binary_transformer_prev3b). --define(PREV3C_TRANS_MOD, megaco_binary_transformer_prev3c). - --define(BIN_LIB, megaco_binary_encoder_lib). - - -%%---------------------------------------------------------------------- -%% Detect (check/get) message version -%% Return {ok, Version} | {error, Reason} -%%---------------------------------------------------------------------- - -version_of([{version3,v3},driver|EC], Binary) -> - Decoders = [?V1_ASN1_MOD_DRV, ?V2_ASN1_MOD_DRV, ?V3_ASN1_MOD_DRV], - ?BIN_LIB:version_of(EC, Binary, 1, Decoders); -version_of([{version3,prev3c},driver|EC], Binary) -> - Decoders = [?V1_ASN1_MOD_DRV, ?V2_ASN1_MOD_DRV, ?PREV3C_ASN1_MOD_DRV], - ?BIN_LIB:version_of(EC, Binary, 1, Decoders); -version_of([{version3,prev3b},driver|EC], Binary) -> - Decoders = [?V1_ASN1_MOD_DRV, ?V2_ASN1_MOD_DRV, ?PREV3B_ASN1_MOD_DRV], - ?BIN_LIB:version_of(EC, Binary, 1, Decoders); -version_of([{version3,prev3a},driver|EC], Binary) -> - Decoders = [?V1_ASN1_MOD_DRV, ?V2_ASN1_MOD_DRV, ?PREV3A_ASN1_MOD_DRV], - ?BIN_LIB:version_of(EC, Binary, 1, Decoders); -version_of([driver|EC], Binary) -> - Decoders = [?V1_ASN1_MOD_DRV, ?V2_ASN1_MOD_DRV, ?V3_ASN1_MOD_DRV], - ?BIN_LIB:version_of(EC, Binary, 1, Decoders); -version_of([{version3,v3}|EC], Binary) -> - Decoders = [?V1_ASN1_MOD, ?V2_ASN1_MOD, ?V3_ASN1_MOD], - ?BIN_LIB:version_of(EC, Binary, 1, Decoders); -version_of([{version3,prev3c}|EC], Binary) -> - Decoders = [?V1_ASN1_MOD, ?V2_ASN1_MOD, ?PREV3C_ASN1_MOD], - ?BIN_LIB:version_of(EC, Binary, 1, Decoders); -version_of([{version3,prev3b}|EC], Binary) -> - Decoders = [?V1_ASN1_MOD, ?V2_ASN1_MOD, ?PREV3B_ASN1_MOD], - ?BIN_LIB:version_of(EC, Binary, 1, Decoders); -version_of([{version3,prev3a}|EC], Binary) -> - Decoders = [?V1_ASN1_MOD, ?V2_ASN1_MOD, ?PREV3A_ASN1_MOD], - ?BIN_LIB:version_of(EC, Binary, 1, Decoders); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -version_of(EC, Binary) -> - Decoders = [?V1_ASN1_MOD, ?V2_ASN1_MOD, ?V3_ASN1_MOD], - ?BIN_LIB:version_of(EC, Binary, 1, Decoders). - - -%%---------------------------------------------------------------------- -%% Convert a 'MegacoMessage' record into a binary -%% Return {ok, Binary} | {error, Reason} -%%---------------------------------------------------------------------- - -encode_message(EC, - #'MegacoMessage'{mess = #'Message'{version = V}} = MegaMsg) -> - encode_message(EC, V, MegaMsg). - - -%% -- Version 1 -- - -encode_message([{version3, _},driver|EC], 1, MegaMsg) -> - AsnMod = ?V1_ASN1_MOD_DRV, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([driver|EC], 1, MegaMsg) -> - AsnMod = ?V1_ASN1_MOD_DRV, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,_}|EC], 1, MegaMsg) -> - AsnMod = ?V1_ASN1_MOD, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -encode_message(EC, 1, MegaMsg) -> - AsnMod = ?V1_ASN1_MOD, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); - - -%% -- Version 2 -- - -encode_message([{version3,_},driver|EC], 2, MegaMsg) -> - AsnMod = ?V2_ASN1_MOD_DRV, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([driver|EC], 2, MegaMsg) -> - AsnMod = ?V2_ASN1_MOD_DRV, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,_}|EC], 2, MegaMsg) -> - AsnMod = ?V2_ASN1_MOD, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -encode_message(EC, 2, MegaMsg) -> - AsnMod = ?V2_ASN1_MOD, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); - - -%% -- Version 3 -- - -encode_message([{version3,v3},driver|EC], 3, MegaMsg) -> - AsnMod = ?V3_ASN1_MOD_DRV, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,prev3c},driver|EC], 3, MegaMsg) -> - AsnMod = ?PREV3C_ASN1_MOD_DRV, - TransMod = ?PREV3C_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,prev3b},driver|EC], 3, MegaMsg) -> - AsnMod = ?PREV3B_ASN1_MOD_DRV, - TransMod = ?PREV3B_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,prev3a},driver|EC], 3, MegaMsg) -> - AsnMod = ?PREV3A_ASN1_MOD_DRV, - TransMod = ?PREV3A_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([driver|EC], 3, MegaMsg) -> - AsnMod = ?V3_ASN1_MOD_DRV, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,v3}|EC], 3, MegaMsg) -> - AsnMod = ?V3_ASN1_MOD, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,prev3c}|EC], 3, MegaMsg) -> - AsnMod = ?PREV3C_ASN1_MOD, - TransMod = ?PREV3C_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,prev3b}|EC], 3, MegaMsg) -> - AsnMod = ?PREV3B_ASN1_MOD, - TransMod = ?PREV3B_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); -encode_message([{version3,prev3a}|EC], 3, MegaMsg) -> - AsnMod = ?PREV3A_ASN1_MOD, - TransMod = ?PREV3A_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -encode_message(EC, 3, MegaMsg) -> - AsnMod = ?V3_ASN1_MOD, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:encode_message(EC, MegaMsg, AsnMod, TransMod, io_list). - - -%%---------------------------------------------------------------------- -%% Convert a transaction (or transactions in the case of ack) record(s) -%% into a binary -%% Return {ok, Binary} | {error, Reason} -%%---------------------------------------------------------------------- - -%% encode_transaction([] = EC, 1, Trans) -> -%% AsnMod = ?V1_ASN1_MOD, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%% encode_transaction([native] = EC, 1, Trans) -> -%% AsnMod = ?V1_ASN1_MOD, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%% encode_transaction([driver|EC], 1, Trans) -> -%% AsnMod = ?V1_ASN1_MOD_DRV, -%% TransMod = ?V1_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -encode_transaction(_EC, 1, _Trans) -> - %% AsnMod = ?V1_ASN1_MOD, - %% TransMod = ?V1_TRANS_MOD, - %% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, - %% io_list); - {error, not_implemented}; - -%% encode_transaction([] = EC, 2, Trans) -> -%% AsnMod = ?V2_ASN1_MOD, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%% encode_transaction([native] = EC, 2, Trans) -> -%% AsnMod = ?V2_ASN1_MOD, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%% encode_transaction([driver|EC], 2, Trans) -> -%% AsnMod = ?V2_ASN1_MOD_DRV, -%% TransMod = ?V2_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -encode_transaction(_EC, 2, _Trans) -> - %% AsnMod = ?V2_ASN1_MOD, - %% TransMod = ?V2_TRANS_MOD, - %% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, - %% io_list). - {error, not_implemented}; - -%% encode_transaction([] = EC, 3, Trans) -> -%% AsnMod = ?V3_ASN1_MOD, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%% encode_transaction([native] = EC, 3, Trans) -> -%% AsnMod = ?V3_ASN1_MOD, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -%% encode_transaction([driver|EC], 3, Trans) -> -%% AsnMod = ?V3_ASN1_MOD_DRV, -%% TransMod = ?V3_TRANS_MOD, -%% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, -%% io_list); -encode_transaction(_EC, 3, _Trans) -> - %% AsnMod = ?V3_ASN1_MOD, - %% TransMod = ?V3_TRANS_MOD, - %% ?BIN_LIB:encode_transaction(EC, Trans, AsnMod, TransMod, %% io_list). - {error, not_implemented}. - - -%%---------------------------------------------------------------------- -%% Convert a list of ActionRequest record's into a binary -%% Return {ok, DeepIoList} | {error, Reason} -%%---------------------------------------------------------------------- -encode_action_requests(_EC, 1, ActReqs) when is_list(ActReqs) -> - %% ?BIN_LIB:encode_action_requests(EC, ActReqs, - %% ?V1_ASN1_MOD, - %% ?V1_TRANS_MOD, - %% io_list); - {error, not_implemented}; -encode_action_requests(_EC, 2, ActReqs) when is_list(ActReqs) -> - %% ?BIN_LIB:encode_action_requests(EC, ActReqs, - %% ?V1_ASN1_MOD, - %% ?V1_TRANS_MOD, - %% io_list). - {error, not_implemented}; -encode_action_requests(_EC, 3, ActReqs) when is_list(ActReqs) -> - %% ?BIN_LIB:encode_action_requests(EC, ActReqs, - %% ?V1_ASN1_MOD, - %% ?V1_TRANS_MOD, - %% io_list). - {error, not_implemented}. - - -%%---------------------------------------------------------------------- -%% Convert a ActionRequest record into a binary -%% Return {ok, DeepIoList} | {error, Reason} -%%---------------------------------------------------------------------- -encode_action_request(_EC, 1, _ActReq) -> - %% ?BIN_LIB:encode_action_request(EC, ActReq, - %% ?V1_ASN1_MOD, - %% ?V1_TRANS_MOD, - %% io_list); - {error, not_implemented}; -encode_action_request(_EC, 2, _ActReq) -> - %% ?BIN_LIB:encode_action_request(EC, ActReq, - %% ?V1_ASN1_MOD, - %% ?V1_TRANS_MOD, - %% io_list). - {error, not_implemented}; -encode_action_request(_EC, 3, _ActReq) -> - %% ?BIN_LIB:encode_action_request(EC, ActReq, - %% ?V1_ASN1_MOD, - %% ?V1_TRANS_MOD, - %% io_list). - {error, not_implemented}. - - -%%---------------------------------------------------------------------- -%% Convert a action reply into a deep io list -%% Not yest supported by this binary codec! -%% Return {ok, DeepIoList} | {error, Reason} -%%---------------------------------------------------------------------- - -encode_action_reply(_EC, _V, _AcionReply) -> - {error, not_implemented}. - - -%%---------------------------------------------------------------------- -%% Convert a binary into a 'MegacoMessage' record -%% Return {ok, MegacoMessageRecord} | {error, Reason} -%%---------------------------------------------------------------------- - -decode_message(EC, Binary) -> - decode_message(EC, 1, Binary). - -%% PER does not support partial decode, so this means V1 -decode_message(EC, dynamic, Binary) -> - decode_message(EC, 1, Binary); - - -%% -- Version 1 -- - -decode_message([{version3,_},driver|EC], 1, Binary) -> - AsnMod = ?V1_ASN1_MOD_DRV, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([driver|EC], 1, Binary) -> - AsnMod = ?V1_ASN1_MOD_DRV, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,_}|EC], 1, Binary) -> - AsnMod = ?V1_ASN1_MOD, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -decode_message(EC, 1, Binary) -> - AsnMod = ?V1_ASN1_MOD, - TransMod = ?V1_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - - -%% -- Version 2 -- - -decode_message([{version3,_},driver|EC], 2, Binary) -> - AsnMod = ?V2_ASN1_MOD_DRV, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([driver|EC], 2, Binary) -> - AsnMod = ?V2_ASN1_MOD_DRV, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,_}|EC], 2, Binary) -> - AsnMod = ?V2_ASN1_MOD, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -decode_message(EC, 2, Binary) -> - AsnMod = ?V2_ASN1_MOD, - TransMod = ?V2_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - - -%% -- Version 3 -- - -decode_message([{version3,v3},driver|EC], 3, Binary) -> - AsnMod = ?V3_ASN1_MOD_DRV, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3c},driver|EC], 3, Binary) -> - AsnMod = ?PREV3C_ASN1_MOD_DRV, - TransMod = ?PREV3C_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3b},driver|EC], 3, Binary) -> - AsnMod = ?PREV3B_ASN1_MOD_DRV, - TransMod = ?PREV3B_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3a},driver|EC], 3, Binary) -> - AsnMod = ?PREV3A_ASN1_MOD_DRV, - TransMod = ?PREV3A_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([driver|EC], 3, Binary) -> - AsnMod = ?V3_ASN1_MOD_DRV, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,v3}|EC], 3, Binary) -> - AsnMod = ?V3_ASN1_MOD, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3c}|EC], 3, Binary) -> - AsnMod = ?PREV3C_ASN1_MOD, - TransMod = ?PREV3C_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3b}|EC], 3, Binary) -> - AsnMod = ?PREV3B_ASN1_MOD, - TransMod = ?PREV3B_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); -decode_message([{version3,prev3a}|EC], 3, Binary) -> - AsnMod = ?PREV3A_ASN1_MOD, - TransMod = ?PREV3A_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary); - -%% All values we need to take (special) care of has been delt with, -%% so just pass the rest on -decode_message(EC, 3, Binary) -> - AsnMod = ?V3_ASN1_MOD, - TransMod = ?V3_TRANS_MOD, - ?BIN_LIB:decode_message(EC, Binary, AsnMod, TransMod, binary). - - -decode_mini_message(_EC, _Vsn, _Bin) -> - {error, not_implemented}. diff --git a/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_prev3a.set.asn b/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_prev3a.set.asn deleted file mode 100644 index b9ba7ffdb4..0000000000 --- a/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_prev3a.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-prev3a.asn diff --git a/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_prev3b.set.asn b/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_prev3b.set.asn deleted file mode 100644 index 0437bde310..0000000000 --- a/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_prev3b.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-prev3b.asn diff --git a/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_prev3c.set.asn b/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_prev3c.set.asn deleted file mode 100644 index e78055fbad..0000000000 --- a/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_prev3c.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-prev3c.asn diff --git a/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_v1.set.asn b/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_v1.set.asn deleted file mode 100644 index 0f5a92dba1..0000000000 --- a/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_v1.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-v1.asn diff --git a/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_v2.set.asn b/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_v2.set.asn deleted file mode 100644 index 7fc82b127f..0000000000 --- a/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_v2.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-v2.asn diff --git a/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_v3.set.asn b/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_v3.set.asn deleted file mode 100644 index 1d7950a283..0000000000 --- a/lib/megaco/src/binary/megaco_per_bin_media_gateway_control_v3.set.asn +++ /dev/null @@ -1 +0,0 @@ -MEDIA-GATEWAY-CONTROL-v3.asn diff --git a/lib/megaco/src/binary/modules.mk b/lib/megaco/src/binary/modules.mk index a86ce2aecc..d0765b7a6b 100644 --- a/lib/megaco/src/binary/modules.mk +++ b/lib/megaco/src/binary/modules.mk @@ -2,7 +2,7 @@ # %CopyrightBegin% # -# Copyright Ericsson AB 2001-2009. All Rights Reserved. +# Copyright Ericsson AB 2001-2013. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -27,19 +27,6 @@ MODULES = \ megaco_ber_media_gateway_control_prev3b \ megaco_ber_media_gateway_control_prev3c \ megaco_ber_media_gateway_control_v3 \ - megaco_ber_bin_encoder \ - megaco_ber_bin_media_gateway_control_v1 \ - megaco_ber_bin_media_gateway_control_v2 \ - megaco_ber_bin_media_gateway_control_prev3a \ - megaco_ber_bin_media_gateway_control_prev3b \ - megaco_ber_bin_media_gateway_control_prev3c \ - megaco_ber_bin_media_gateway_control_v3 \ - megaco_ber_bin_drv_media_gateway_control_v1 \ - megaco_ber_bin_drv_media_gateway_control_v2 \ - megaco_ber_bin_drv_media_gateway_control_prev3a \ - megaco_ber_bin_drv_media_gateway_control_prev3b \ - megaco_ber_bin_drv_media_gateway_control_prev3c \ - megaco_ber_bin_drv_media_gateway_control_v3 \ megaco_per_encoder \ megaco_per_media_gateway_control_v1 \ megaco_per_media_gateway_control_v2 \ @@ -47,19 +34,6 @@ MODULES = \ megaco_per_media_gateway_control_prev3b \ megaco_per_media_gateway_control_prev3c \ megaco_per_media_gateway_control_v3 \ - megaco_per_bin_encoder \ - megaco_per_bin_media_gateway_control_v1 \ - megaco_per_bin_media_gateway_control_v2 \ - megaco_per_bin_media_gateway_control_prev3a \ - megaco_per_bin_media_gateway_control_prev3b \ - megaco_per_bin_media_gateway_control_prev3c \ - megaco_per_bin_media_gateway_control_v3 \ - megaco_per_bin_drv_media_gateway_control_v1 \ - megaco_per_bin_drv_media_gateway_control_v2 \ - megaco_per_bin_drv_media_gateway_control_prev3a \ - megaco_per_bin_drv_media_gateway_control_prev3b \ - megaco_per_bin_drv_media_gateway_control_prev3c \ - megaco_per_bin_drv_media_gateway_control_v3 \ megaco_binary_name_resolver_v1 \ megaco_binary_name_resolver_v2 \ megaco_binary_name_resolver_prev3a \ @@ -85,44 +59,20 @@ ASN1_PREV3C_SPEC = MEDIA-GATEWAY-CONTROL-prev3c ASN1_V3_SPEC = MEDIA-GATEWAY-CONTROL-v3 BER_ASN1_V1_SPEC = megaco_ber_media_gateway_control_v1 -BER_BIN_ASN1_V1_SPEC = megaco_ber_bin_media_gateway_control_v1 -BER_BIN_DRV_ASN1_V1_SPEC = megaco_ber_bin_drv_media_gateway_control_v1 PER_ASN1_V1_SPEC = megaco_per_media_gateway_control_v1 -PER_BIN_ASN1_V1_SPEC = megaco_per_bin_media_gateway_control_v1 -PER_BIN_DRV_ASN1_V1_SPEC = megaco_per_bin_drv_media_gateway_control_v1 BER_ASN1_V2_SPEC = megaco_ber_media_gateway_control_v2 -BER_BIN_ASN1_V2_SPEC = megaco_ber_bin_media_gateway_control_v2 -BER_BIN_DRV_ASN1_V2_SPEC = megaco_ber_bin_drv_media_gateway_control_v2 PER_ASN1_V2_SPEC = megaco_per_media_gateway_control_v2 -PER_BIN_ASN1_V2_SPEC = megaco_per_bin_media_gateway_control_v2 -PER_BIN_DRV_ASN1_V2_SPEC = megaco_per_bin_drv_media_gateway_control_v2 BER_ASN1_PREV3A_SPEC = megaco_ber_media_gateway_control_prev3a -BER_BIN_ASN1_PREV3A_SPEC = megaco_ber_bin_media_gateway_control_prev3a -BER_BIN_DRV_ASN1_PREV3A_SPEC = megaco_ber_bin_drv_media_gateway_control_prev3a PER_ASN1_PREV3A_SPEC = megaco_per_media_gateway_control_prev3a -PER_BIN_ASN1_PREV3A_SPEC = megaco_per_bin_media_gateway_control_prev3a -PER_BIN_DRV_ASN1_PREV3A_SPEC = megaco_per_bin_drv_media_gateway_control_prev3a BER_ASN1_PREV3B_SPEC = megaco_ber_media_gateway_control_prev3b -BER_BIN_ASN1_PREV3B_SPEC = megaco_ber_bin_media_gateway_control_prev3b -BER_BIN_DRV_ASN1_PREV3B_SPEC = megaco_ber_bin_drv_media_gateway_control_prev3b PER_ASN1_PREV3B_SPEC = megaco_per_media_gateway_control_prev3b -PER_BIN_ASN1_PREV3B_SPEC = megaco_per_bin_media_gateway_control_prev3b -PER_BIN_DRV_ASN1_PREV3B_SPEC = megaco_per_bin_drv_media_gateway_control_prev3b BER_ASN1_PREV3C_SPEC = megaco_ber_media_gateway_control_prev3c -BER_BIN_ASN1_PREV3C_SPEC = megaco_ber_bin_media_gateway_control_prev3c -BER_BIN_DRV_ASN1_PREV3C_SPEC = megaco_ber_bin_drv_media_gateway_control_prev3c PER_ASN1_PREV3C_SPEC = megaco_per_media_gateway_control_prev3c -PER_BIN_ASN1_PREV3C_SPEC = megaco_per_bin_media_gateway_control_prev3c -PER_BIN_DRV_ASN1_PREV3C_SPEC = megaco_per_bin_drv_media_gateway_control_prev3c BER_ASN1_V3_SPEC = megaco_ber_media_gateway_control_v3 -BER_BIN_ASN1_V3_SPEC = megaco_ber_bin_media_gateway_control_v3 -BER_BIN_DRV_ASN1_V3_SPEC = megaco_ber_bin_drv_media_gateway_control_v3 PER_ASN1_V3_SPEC = megaco_per_media_gateway_control_v3 -PER_BIN_ASN1_V3_SPEC = megaco_per_bin_media_gateway_control_v3 -PER_BIN_DRV_ASN1_V3_SPEC = megaco_per_bin_drv_media_gateway_control_v3 diff --git a/lib/megaco/src/flex/Makefile.in b/lib/megaco/src/flex/Makefile.in index 69c2425d05..6111cf2304 100644 --- a/lib/megaco/src/flex/Makefile.in +++ b/lib/megaco/src/flex/Makefile.in @@ -104,10 +104,6 @@ ENABLE_MEGACO_FLEX_SCANNER_LINENO = @ENABLE_MEGACO_FLEX_SCANNER_LINENO@ endif endif -ifeq ($(findstring vxworks,$(TARGET)),vxworks) - DED_INCLUDES += -I$(ERL_TOP)/erts/etc/vxworks -endif - PRIVDIR = ../../priv LIBDIR = $(PRIVDIR)/lib/$(TARGET) OBJDIR = $(PRIVDIR)/obj/$(TARGET) @@ -146,15 +142,10 @@ ifeq ($(findstring win32,$(TARGET)), win32) FLEX_SCANNER_SO = SOLIBS = $(FLEX_SCANNER_SO) else -ifeq ($(findstring vxworks,$(TARGET)),vxworks) -FLEX_SCANNER_SO = -SOLIBS = $(FLEX_SCANNER_SO) -else FLEX_SCANNER_SO = $(LIBDIR)/$(STD_DRV).$(DED_EXT) FLEX_SCANNER_MT_SO = $(LIBDIR)/$(MT_DRV).$(DED_EXT) SOLIBS = $(FLEX_SCANNER_SO) $(FLEX_SCANNER_MT_SO) endif -endif # ---------------------------------------------------- @@ -328,16 +319,16 @@ release_docs_spec: $(STD_DRV).flex: megaco_flex_scanner_drv.flex.src ifeq ($(ENABLE_MEGACO_FLEX_SCANNER_LINENO),true) - @printf "std [flex] scanner - lineno enabled\n" - $(PERL) -p -e \ + $(V_colon)@printf "std [flex] scanner - lineno enabled\n" + $(gen_verbose)$(PERL) -p -e \ 's/%FLEX_VERSION%/$(FLEX_VSN)/ ; \ s/%MEGACO_YY_LINENO_OPTION%/%option yylineno/ ; \ s/%MEGACO_YY_REENTRANT_OPTION%/\/\* %option reentrant \*\// ; \ s/%MEGACO_DUMMY_DECL_YY_LINENO%/\/* static int yylineno = 1; *\//' \ < $< > $@ else - @printf "std [flex] scanner - lineno disabled\n" - $(PERL) -p -e \ + $(V_colon)@printf "std [flex] scanner - lineno disabled\n" + $(gen_verbose)$(PERL) -p -e \ 's/%FLEX_VERSION%/$(FLEX_VSN)/ ; \ s/%MEGACO_YY_LINENO_OPTION%/\/\* %option yylineno \*\// ; \ s/%MEGACO_YY_REENTRANT_OPTION%/\/\* %option reentrant \*\// ; \ @@ -348,16 +339,16 @@ endif $(MT_DRV).flex: megaco_flex_scanner_drv.flex.src ifeq ($(ENABLE_MEGACO_FLEX_SCANNER_LINENO),true) ifeq ($(ENABLE_REENTRANT_MEGACO_FLEX_SCANNER),true) - @printf "multi-threaded reentrant [flex] scanner - lineno enabled\n" - $(PERL) -p -e \ + $(V_colon)@printf "multi-threaded reentrant [flex] scanner - lineno enabled\n" + $(gen_verbose)$(PERL) -p -e \ 's/%FLEX_VERSION%/$(FLEX_VSN)/ ; \ s/%MEGACO_YY_LINENO_OPTION%/%option yylineno/ ; \ s/%MEGACO_YY_REENTRANT_OPTION%/%option reentrant/ ; \ s/%MEGACO_DUMMY_DECL_YY_LINENO%/\/* static int yylineno = 1; *\//' \ < $< > $@ else - @printf "multi-threaded non-reentrant [flex] scanner - lineno enabled\n" - $(PERL) -p -e \ + $(V_colon)@printf "multi-threaded non-reentrant [flex] scanner - lineno enabled\n" + $(gen_verbose)$(PERL) -p -e \ 's/%FLEX_VERSION%/$(FLEX_VSN)/ ; \ s/%MEGACO_YY_LINENO_OPTION%/%option yylineno/ ; \ s/%MEGACO_YY_REENTRANT_OPTION%/\/\* %option reentrant \*\// ; \ @@ -366,16 +357,16 @@ else endif else ifeq ($(ENABLE_REENTRANT_MEGACO_FLEX_SCANNER),true) - @printf "multi-threaded reentrant [flex] scanner - lineno disabled\n" - $(PERL) -p -e \ + $(V_colon)@printf "multi-threaded reentrant [flex] scanner - lineno disabled\n" + $(gen_verbose)$(PERL) -p -e \ 's/%FLEX_VERSION%/$(FLEX_VSN)/ ; \ s/%MEGACO_YY_LINENO_OPTION%/\/\* %option yylineno \*\// ; \ s/%MEGACO_YY_REENTRANT_OPTION%/%option reentrant/ ; \ s/%MEGACO_DUMMY_DECL_YY_LINENO%/\/* static int yylineno = 1; - REENTRANT SCANNER*\//' \ < $< > $@ else - @printf "multi-threaded non-reentrant [flex] scanner - lineno disabled\n" - $(PERL) -p -e \ + $(V_colon)@printf "multi-threaded non-reentrant [flex] scanner - lineno disabled\n" + $(gen_verbose)$(PERL) -p -e \ 's/%FLEX_VERSION%/$(FLEX_VSN)/ ; \ s/%MEGACO_YY_LINENO_OPTION%/\/\* %option yylineno \*\// ; \ s/%MEGACO_YY_REENTRANT_OPTION%/\/\* %option reentrant \*\// ; \ @@ -385,31 +376,31 @@ endif endif # megaco_flex_scanner_drv.c: megaco_flex_scanner_drv.flex -# $(LEX) $(LEX_FLAGS) -P$* -o$@ $< +# $(V_LEX) $(LEX_FLAGS) -P$* -o$@ $< $(STD_DRV).c: $(STD_DRV).flex - $(LEX) $(STD_LEX_FLAGS) -P$* -o$@ $< + $(V_LEX) $(STD_LEX_FLAGS) -P$* -o$@ $< $(MT_DRV).c: $(MT_DRV).flex - $(LEX) $(MT_LEX_FLAGS) -P$* -o$@ $< + $(V_LEX) $(MT_LEX_FLAGS) -P$* -o$@ $< _create_dirs := $(shell mkdir -p $(OBJDIR) $(LIBDIR)) solibs: $(SOLIBS) $(OBJDIR)/$(STD_DRV).o: $(STD_DRV).c - @echo "compiling std driver:" - $(CC) -c $(STD_DRV_NAME) $(CFLAGS) -o $@ $< + $(V_colon)@echo "compiling std driver:" + $(V_CC) -c $(STD_DRV_NAME) $(CFLAGS) -o $@ $< $(OBJDIR)/$(MT_DRV).o: $(MT_DRV).c - @echo "compiling multi-threaded driver:" - $(CC) -c $(MT_DRV_NAME) $(CFLAGS_MT) -o $@ $< + $(V_colon)@echo "compiling multi-threaded driver:" + $(V_CC) -c $(MT_DRV_NAME) $(CFLAGS_MT) -o $@ $< # No need to link with -lfl as we have also defined %option noyywrap - # and having -lfl doesn't work under Darwin for some reason. - Sean $(LIBDIR)/$(STD_DRV).$(DED_EXT): $(OBJDIR)/$(STD_DRV).o - @echo "linking std driver:" - $(LD) $(LDFLAGS) -o $@ $< + $(V_colon)@echo "linking std driver:" + $(V_LD) $(LDFLAGS) -o $@ $< $(LIBDIR)/$(MT_DRV).$(DED_EXT): $(OBJDIR)/$(MT_DRV).o - @echo "linking multi-threaded driver:" - $(LD) $(LDFLAGS) -o $@ $< + $(V_colon)@echo "linking multi-threaded driver:" + $(V_LD) $(LDFLAGS) -o $@ $< diff --git a/lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src b/lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src index b8146c345d..3914a81b8c 100644 --- a/lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src +++ b/lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2001-2011. All Rights Reserved. + * Copyright Ericsson AB 2001-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -76,6 +76,7 @@ typedef struct { ErlDrvPort port; + ErlDrvTermData port_id; char* digit_map_name_ptr; int digit_map_name_len; char* digit_map_value_ptr; @@ -1497,6 +1498,7 @@ static ErlDrvData mfs_start(ErlDrvPort port, char *buf) DBG( ("mfs_start -> entry\n") ); dataP->port = port; + dataP->port_id = driver_mk_port(port); dataP->digit_map_name_ptr = NULL; dataP->digit_map_name_len = 0; dataP->digit_map_value_ptr = NULL; @@ -1841,10 +1843,10 @@ static ErlDrvSSizeT mfs_control(ErlDrvData handle, "\n term_spec_size: %d\n", dataP->term_spec_index, dataP->term_spec_size) ); - driver_send_term(dataP->port, - driver_caller(dataP->port), - dataP->term_spec, - dataP->term_spec_index); + erl_drv_send_term(dataP->port_id, + driver_caller(dataP->port), + dataP->term_spec, + dataP->term_spec_index); if (dataP->text_buf != NULL) FREE(dataP->text_buf); if (dataP->term_spec != NULL) FREE(dataP->term_spec); diff --git a/lib/megaco/src/rules.mk b/lib/megaco/src/rules.mk index 20fbed2a76..d9473af26e 100644 --- a/lib/megaco/src/rules.mk +++ b/lib/megaco/src/rules.mk @@ -2,7 +2,7 @@ # %CopyrightBegin% # -# Copyright Ericsson AB 1999-2009. All Rights Reserved. +# Copyright Ericsson AB 1999-2013. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -29,10 +29,6 @@ PERL = perl # Erlang language section # ---------------------------------------------------- EMULATOR = beam -ifeq ($(findstring vxworks,$(TARGET)),vxworks) -# VxWorks jam object files should be compressed -ERL_COMPILE_FLAGS += +compressed -endif ERLC_WFLAGS = -W ERLC = erlc $(ERLC_WFLAGS) $(ERLC_FLAGS) ERL.beam = erl.beam -boot start_clean diff --git a/lib/megaco/test/megaco.spec.vxworks b/lib/megaco/test/megaco.spec.vxworks deleted file mode 100644 index 2ac250e443..0000000000 --- a/lib/megaco/test/megaco.spec.vxworks +++ /dev/null @@ -1,5 +0,0 @@ -{topcase, {dir, "../megaco_test"}}. -{require_nodenames, 1}. -{skip, {megaco_digit_map_test, all, "Not yet implemented"}}. -{skip, {megaco_measure_test, all, "Not yet implemented"}}. -%{skip, {M, F, "Not yet implemented"}}. diff --git a/lib/megaco/test/megaco_actions_test.erl b/lib/megaco/test/megaco_actions_test.erl index 2efb6e834a..cdf11f09cc 100644 --- a/lib/megaco/test/megaco_actions_test.erl +++ b/lib/megaco/test/megaco_actions_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% Copyright Ericsson AB 2004-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -80,8 +80,7 @@ end_per_testcase(Case, Config) -> all() -> [pretty_text, flex_pretty_text, compact_text, - flex_compact_text, erl_dist, erl_dist_mc, ber_bin, - ber_bin_drv, ber_bin_native, ber_bin_drv_native]. + flex_compact_text, erl_dist, erl_dist_mc]. groups() -> []. @@ -170,39 +169,6 @@ erl_dist_mc(Config) when is_list(Config) -> req_and_rep(Config, Codec, Version, EncodingConfig). -ber_bin(suite) -> - []; -ber_bin(doc) -> - []; -ber_bin(Config) when is_list(Config) -> - ?SKIP(currently_not_supported_by_asn1). - - -ber_bin_drv(suite) -> - []; -ber_bin_drv(doc) -> - []; -ber_bin_drv(Config) when is_list(Config) -> - ?SKIP(currently_not_supported_by_asn1). - - -ber_bin_native(suite) -> - []; -ber_bin_native(doc) -> - []; -ber_bin_native(Config) when is_list(Config) -> - ?SKIP(currently_not_supported_by_asn1). - - -ber_bin_drv_native(suite) -> - []; -ber_bin_drv_native(doc) -> - []; -ber_bin_drv_native(Config) when is_list(Config) -> - ?SKIP(currently_not_supported_by_asn1). - - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% req_and_rep(Config, Codec, _Version, EC) when is_list(Config) -> diff --git a/lib/megaco/test/megaco_call_flow_test.erl b/lib/megaco/test/megaco_call_flow_test.erl index b9d64ca8b2..8ad1cf6445 100644 --- a/lib/megaco/test/megaco_call_flow_test.erl +++ b/lib/megaco/test/megaco_call_flow_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2010. All Rights Reserved. +%% Copyright Ericsson AB 2000-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,6 @@ %% megaco_call_flow_test:compact_text(). %% megaco_call_flow_test:bin(). %% megaco_call_flow_test:asn1_ber(). -%% megaco_call_flow_test:asn1_ber_bin(). %% megaco_call_flow_test:asn1_per(). %% megaco_call_flow_test:erl_dist(). %% megaco_call_flow_test:compressed_erl_dist(). @@ -62,7 +61,7 @@ all() -> groups() -> [{text, [], [pretty, compact]}, {flex, [], [pretty_flex, compact_flex]}, - {binary, [], [bin, ber, ber_bin, per]}]. + {binary, [], [bin, ber, per]}]. init_per_group(_GroupName, Config) -> Config. @@ -106,12 +105,6 @@ ber(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), asn1_ber(). -ber_bin(suite) -> - []; -ber_bin(Config) when is_list(Config) -> - ?ACQUIRE_NODES(1, Config), - asn1_ber_bin(). - per(suite) -> []; per(Config) when is_list(Config) -> @@ -1198,8 +1191,7 @@ encoders() -> {megaco_pretty_text_encoder, [], []}, {megaco_compact_text_encoder, [], []}, {megaco_binary_encoder, [], [native]}, - %% {megaco_ber_encoder, [], [native]}, - %% {megaco_ber_bin_encoder, [], [native]}, + {megaco_ber_encoder, [], [native]}, {megaco_per_encoder, [], [native]}, {megaco_erl_dist_encoder, [], []}, {megaco_erl_dist_encoder, [compressed], [compressed]} @@ -1214,7 +1206,6 @@ pretty_mod({Mod, Opt, _Opt2}) -> megaco_compact_text_encoder -> compact_text; megaco_binary_encoder -> asn1_ber; megaco_ber_encoder -> asn1_ber_old; - megaco_ber_bin_encoder -> asn1_ber_bin; megaco_per_encoder -> asn1_per; megaco_erl_dist_encoder when Opt == [] -> standard_erl; megaco_erl_dist_encoder when Opt == [compressed] -> compressed_erl; @@ -1263,13 +1254,6 @@ asn1_ber() -> All = [encode(Slogan, Msg, Encoder) || {Slogan, Msg} <- messages()], compute_res(All). -asn1_ber_bin() -> - Default = [], - Native = [native], - Encoder = {megaco_ber_bin_encoder, Default, Native}, - All = [encode(Slogan, Msg, Encoder) || {Slogan, Msg} <- messages()], - compute_res(All). - asn1_per() -> Default = [], Native = [native], @@ -1634,7 +1618,7 @@ gen_ber_header() -> %% Generate headerfile for asn.1 BER test in C %%---------------------------------------------------------------------- gen_ber_bin_header() -> - Encoder = {megaco_ber_bin_encoder, [], []}, + Encoder = {megaco_ber_encoder, [], []}, L = [{S, gen_byte_msg(Msg, Encoder)} || {S, Msg} <- messages()], gen_header_file_binary(L). diff --git a/lib/megaco/test/megaco_codec_prev3a_test.erl b/lib/megaco/test/megaco_codec_prev3a_test.erl index d50e72aef1..b2316eb509 100644 --- a/lib/megaco/test/megaco_codec_prev3a_test.erl +++ b/lib/megaco/test/megaco_codec_prev3a_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2010. All Rights Reserved. +%% Copyright Ericsson AB 2005-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -63,12 +63,8 @@ ber_test_msgs/1, - ber_bin_test_msgs/1, - per_test_msgs/1, - per_bin_test_msgs/1, - erl_dist_m_test_msgs/1, tickets/0, @@ -280,17 +276,14 @@ groups() -> [{group, pretty}, {group, flex_pretty}, {group, compact}, {group, flex_compact}]}, {binary, [], - [{group, bin}, {group, ber}, {group, ber_bin}, - {group, per}, {group, per_bin}]}, + [{group, bin}, {group, ber}, {group, per}]}, {erl_dist, [], [{group, erl_dist_m}]}, {pretty, [], [pretty_test_msgs]}, {compact, [], [compact_test_msgs]}, {flex_pretty, [], flex_pretty_cases()}, {flex_compact, [], flex_compact_cases()}, {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, - {ber_bin, [], [ber_bin_test_msgs]}, {per, [], [per_test_msgs]}, - {per_bin, [], [per_bin_test_msgs]}, {erl_dist_m, [], [erl_dist_m_test_msgs]}, {tickets, [], [{group, compact_tickets}, @@ -1106,17 +1099,6 @@ ber_test_msgs(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -ber_bin_test_msgs(suite) -> - []; -ber_bin_test_msgs(Config) when is_list(Config) -> - ?ACQUIRE_NODES(1, Config), - Msgs = msgs1(binary) ++ msgs4(binary) ++ msgs5(binary) ++ msgs6(binary), - DynamicDecode = true, - test_msgs(megaco_ber_bin_encoder, DynamicDecode, ?EC, Msgs). - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - per_test_msgs(suite) -> []; per_test_msgs(Config) when is_list(Config) -> @@ -1128,17 +1110,6 @@ per_test_msgs(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -per_bin_test_msgs(suite) -> - []; -per_bin_test_msgs(Config) when is_list(Config) -> - ?ACQUIRE_NODES(1, Config), - Msgs = msgs1(binary) ++ msgs4(binary) ++ msgs5(binary) ++ msgs6(binary), - DynamicDecode = false, - test_msgs(megaco_per_bin_encoder, DynamicDecode, ?EC, Msgs). - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - erl_dist_m_test_msgs(suite) -> []; erl_dist_m_test_msgs(Config) when is_list(Config) -> @@ -3133,7 +3104,7 @@ pretty_otp5068_msg1() -> 190, asn1_NOVALUE, {actionReplies, - [{'ActionReply', %% Comments: Detta upprepas m�nga g�nger + [{'ActionReply', %% Comments: This is repeated many times. 0, asn1_NOVALUE, asn1_NOVALUE, diff --git a/lib/megaco/test/megaco_codec_prev3b_test.erl b/lib/megaco/test/megaco_codec_prev3b_test.erl index eaab8f37c1..fa24f49372 100644 --- a/lib/megaco/test/megaco_codec_prev3b_test.erl +++ b/lib/megaco/test/megaco_codec_prev3b_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2010. All Rights Reserved. +%% Copyright Ericsson AB 2005-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -63,12 +63,8 @@ ber_test_msgs/1, - ber_bin_test_msgs/1, - per_test_msgs/1, - per_bin_test_msgs/1, - erl_dist_m_test_msgs/1, tickets/0, @@ -296,17 +292,14 @@ groups() -> [{group, pretty}, {group, flex_pretty}, {group, compact}, {group, flex_compact}]}, {binary, [], - [{group, bin}, {group, ber}, {group, ber_bin}, - {group, per}, {group, per_bin}]}, + [{group, bin}, {group, ber}, {group, per}]}, {erl_dist, [], [{group, erl_dist_m}]}, {pretty, [], [pretty_test_msgs]}, {compact, [], [compact_test_msgs]}, {flex_pretty, [], flex_pretty_cases()}, {flex_compact, [], flex_compact_cases()}, {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, - {ber_bin, [], [ber_bin_test_msgs]}, {per, [], [per_test_msgs]}, - {per_bin, [], [per_bin_test_msgs]}, {erl_dist_m, [], [erl_dist_m_test_msgs]}, {tickets, [], [{group, compact_tickets}, @@ -1171,16 +1164,6 @@ ber_test_msgs(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -ber_bin_test_msgs(suite) -> - []; -ber_bin_test_msgs(Config) when is_list(Config) -> - ?ACQUIRE_NODES(1, Config), - Msgs = msgs1(binary) ++ msgs4(binary) ++ msgs5(binary) ++ msgs6(binary), - DynamicDecode = true, - test_msgs(megaco_ber_bin_encoder, DynamicDecode, ?EC, Msgs). - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% per_test_msgs(suite) -> []; @@ -1193,17 +1176,6 @@ per_test_msgs(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -per_bin_test_msgs(suite) -> - []; -per_bin_test_msgs(Config) when is_list(Config) -> - ?ACQUIRE_NODES(1, Config), - Msgs = msgs1(binary) ++ msgs4(binary) ++ msgs5(binary) ++ msgs6(binary), - DynamicDecode = false, - test_msgs(megaco_per_bin_encoder, DynamicDecode, ?EC, Msgs). - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - erl_dist_m_test_msgs(suite) -> []; erl_dist_m_test_msgs(Config) when is_list(Config) -> @@ -3251,7 +3223,7 @@ pretty_otp5068_msg1() -> 190, asn1_NOVALUE, {actionReplies, - [{'ActionReply', %% Comments: Detta upprepas m�nga g�nger + [{'ActionReply', %% Comments: This is repeated many times. 0, asn1_NOVALUE, asn1_NOVALUE, diff --git a/lib/megaco/test/megaco_codec_prev3c_test.erl b/lib/megaco/test/megaco_codec_prev3c_test.erl index 7f9c0fe4e7..7f6d098ed8 100644 --- a/lib/megaco/test/megaco_codec_prev3c_test.erl +++ b/lib/megaco/test/megaco_codec_prev3c_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2010. All Rights Reserved. +%% Copyright Ericsson AB 2006-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -65,12 +65,8 @@ ber_test_msgs/1, - ber_bin_test_msgs/1, - per_test_msgs/1, - per_bin_test_msgs/1, - erl_dist_m_test_msgs/1, tickets/0, @@ -301,17 +297,14 @@ groups() -> [{group, pretty}, {group, flex_pretty}, {group, compact}, {group, flex_compact}]}, {binary, [], - [{group, bin}, {group, ber}, {group, ber_bin}, - {group, per}, {group, per_bin}]}, + [{group, bin}, {group, ber}, {group, per}]}, {erl_dist, [], [{group, erl_dist_m}]}, {pretty, [], [pretty_test_msgs]}, {compact, [], [compact_test_msgs]}, {flex_pretty, [], flex_pretty_cases()}, {flex_compact, [], flex_compact_cases()}, {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, - {ber_bin, [], [ber_bin_test_msgs]}, {per, [], [per_test_msgs]}, - {per_bin, [], [per_bin_test_msgs]}, {erl_dist_m, [], [erl_dist_m_test_msgs]}, {tickets, [], [{group, compact_tickets}, @@ -823,21 +816,6 @@ ber_test_msgs(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -ber_bin_test_msgs(suite) -> - []; -ber_bin_test_msgs(Config) when is_list(Config) -> - ?ACQUIRE_NODES(1, Config), - Msgs = - msgs1a(binary) ++ - msgs5(binary) ++ - msgs6(binary) ++ - msgs7(binary), - DynamicDecode = true, - test_msgs(megaco_ber_bin_encoder, DynamicDecode, ?EC, Msgs). - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - per_test_msgs(suite) -> []; per_test_msgs(Config) when is_list(Config) -> @@ -853,21 +831,6 @@ per_test_msgs(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -per_bin_test_msgs(suite) -> - []; -per_bin_test_msgs(Config) when is_list(Config) -> - ?ACQUIRE_NODES(1, Config), - Msgs = - msgs1a(binary) ++ - msgs5(binary) ++ - msgs6(binary) ++ - msgs7(binary), - DynamicDecode = false, - test_msgs(megaco_per_bin_encoder, DynamicDecode, ?EC, Msgs). - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - erl_dist_m_test_msgs(suite) -> []; erl_dist_m_test_msgs(Config) when is_list(Config) -> @@ -2716,7 +2679,7 @@ pretty_otp5068_msg1() -> 190, asn1_NOVALUE, {actionReplies, - [{'ActionReply', %% Comments: Detta upprepas m�nga g�nger + [{'ActionReply', %% Comments: This is repeated many times. 0, asn1_NOVALUE, asn1_NOVALUE, diff --git a/lib/megaco/test/megaco_codec_v1_test.erl b/lib/megaco/test/megaco_codec_v1_test.erl index e9c19605dd..3be0da3ae4 100644 --- a/lib/megaco/test/megaco_codec_v1_test.erl +++ b/lib/megaco/test/megaco_codec_v1_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2011. All Rights Reserved. +%% Copyright Ericsson AB 2003-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -66,12 +66,8 @@ ber_test_msgs/1, - ber_bin_test_msgs/1, - per_test_msgs/1, - per_bin_test_msgs/1, - erl_dist_m_test_msgs/1, tickets/0, @@ -476,9 +472,7 @@ groups() -> {group, flex_compact}]}, {binary, [], [{group, bin}, {group, ber}, - {group, ber_bin}, - {group, per}, - {group, per_bin}]}, + {group, per}]}, {erl_dist, [], [{group, erl_dist_m}]}, {pretty, [], [pretty_test_msgs]}, {compact, [], [compact_test_msgs]}, @@ -486,9 +480,7 @@ groups() -> {flex_compact, [], flex_compact_cases()}, {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, - {ber_bin, [], [ber_bin_test_msgs]}, {per, [], [per_test_msgs]}, - {per_bin, [], [per_bin_test_msgs]}, {erl_dist_m, [], [erl_dist_m_test_msgs]}, {tickets, [], [{group, compact_tickets}, {group, pretty_tickets}, @@ -1266,17 +1258,6 @@ ber_test_msgs(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -ber_bin_test_msgs(suite) -> - []; -ber_bin_test_msgs(Config) when is_list(Config) -> - ?ACQUIRE_NODES(1, Config), - Msgs = msgs1(), - DynamicDecode = true, - test_msgs(megaco_ber_bin_encoder, DynamicDecode, [], Msgs). - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - per_test_msgs(suite) -> []; per_test_msgs(Config) when is_list(Config) -> @@ -1288,17 +1269,6 @@ per_test_msgs(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -per_bin_test_msgs(suite) -> - []; -per_bin_test_msgs(Config) when is_list(Config) -> - ?ACQUIRE_NODES(1, Config), - Msgs = msgs1(), - DynamicDecode = false, - test_msgs(megaco_per_bin_encoder, DynamicDecode, [], Msgs). - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - erl_dist_m_test_msgs(suite) -> []; erl_dist_m_test_msgs(Config) when is_list(Config) -> @@ -3328,7 +3298,7 @@ pretty_otp5068_msg1() -> 190, asn1_NOVALUE, {actionReplies, - [{'ActionReply', %% Comments: Detta upprepas m�nga g�nger + [{'ActionReply', %% Comments: This is repeated many times. 0, asn1_NOVALUE, asn1_NOVALUE, diff --git a/lib/megaco/test/megaco_codec_v2_test.erl b/lib/megaco/test/megaco_codec_v2_test.erl index a44f74166c..1f522504d6 100644 --- a/lib/megaco/test/megaco_codec_v2_test.erl +++ b/lib/megaco/test/megaco_codec_v2_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2011. All Rights Reserved. +%% Copyright Ericsson AB 2003-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -64,12 +64,8 @@ ber_test_msgs/1, - ber_bin_test_msgs/1, - per_test_msgs/1, - per_bin_test_msgs/1, - erl_dist_m_test_msgs/1, tickets/0, @@ -447,17 +443,14 @@ groups() -> [{group, pretty}, {group, flex_pretty}, {group, compact}, {group, flex_compact}]}, {binary, [], - [{group, bin}, {group, ber}, {group, ber_bin}, - {group, per}, {group, per_bin}]}, + [{group, bin}, {group, ber}, {group, per}]}, {erl_dist, [], [{group, erl_dist_m}]}, {pretty, [], [pretty_test_msgs]}, {compact, [], [compact_test_msgs]}, {flex_pretty, [], flex_pretty_cases()}, {flex_compact, [], flex_compact_cases()}, {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, - {ber_bin, [], [ber_bin_test_msgs]}, {per, [], [per_test_msgs]}, - {per_bin, [], [per_bin_test_msgs]}, {erl_dist_m, [], [erl_dist_m_test_msgs]}, {tickets, [], [{group, compact_tickets}, {group, pretty_tickets}, @@ -1285,17 +1278,6 @@ ber_test_msgs(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -ber_bin_test_msgs(suite) -> - []; -ber_bin_test_msgs(Config) when is_list(Config) -> - ?ACQUIRE_NODES(1, Config), - Msgs = msgs1() ++ msgs4(), - DynamicDecode = true, - test_msgs(megaco_ber_bin_encoder, DynamicDecode, [], Msgs). - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - per_test_msgs(suite) -> []; per_test_msgs(Config) when is_list(Config) -> @@ -1307,17 +1289,6 @@ per_test_msgs(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -per_bin_test_msgs(suite) -> - []; -per_bin_test_msgs(Config) when is_list(Config) -> - ?ACQUIRE_NODES(1, Config), - Msgs = msgs1() ++ msgs4(), - DynamicDecode = false, - test_msgs(megaco_per_bin_encoder, DynamicDecode, [], Msgs). - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - erl_dist_m_test_msgs(suite) -> []; erl_dist_m_test_msgs(Config) when is_list(Config) -> @@ -3751,7 +3722,7 @@ pretty_otp5068_msg1() -> 190, asn1_NOVALUE, {actionReplies, - [{'ActionReply', %% Comments: Detta upprepas m�nga g�nger + [{'ActionReply', %% Comments: This is repeated many times. 0, asn1_NOVALUE, asn1_NOVALUE, diff --git a/lib/megaco/test/megaco_codec_v3_test.erl b/lib/megaco/test/megaco_codec_v3_test.erl index 2c35ce13b3..9d564a0ae3 100644 --- a/lib/megaco/test/megaco_codec_v3_test.erl +++ b/lib/megaco/test/megaco_codec_v3_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2010. All Rights Reserved. +%% Copyright Ericsson AB 2006-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -56,9 +56,7 @@ flex_compact_dm_timers8/1, bin_test_msgs/1, ber_test_msgs/1, - ber_bin_test_msgs/1, per_test_msgs/1, - per_bin_test_msgs/1, erl_dist_m_test_msgs/1, tickets/0, @@ -288,17 +286,14 @@ groups() -> [{group, pretty}, {group, flex_pretty}, {group, compact}, {group, flex_compact}]}, {binary, [], - [{group, bin}, {group, ber}, {group, ber_bin}, - {group, per}, {group, per_bin}]}, + [{group, bin}, {group, ber}, {group, per}]}, {erl_dist, [], [{group, erl_dist_m}]}, {pretty, [], [pretty_test_msgs]}, {compact, [], [compact_test_msgs]}, {flex_pretty, [], flex_pretty_cases()}, {flex_compact, [], flex_compact_cases()}, {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, - {ber_bin, [], [ber_bin_test_msgs]}, {per, [], [per_test_msgs]}, - {per_bin, [], [per_bin_test_msgs]}, {erl_dist_m, [], [erl_dist_m_test_msgs]}, {tickets, [], [{group, compact_tickets}, @@ -823,22 +818,6 @@ ber_test_msgs(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -ber_bin_test_msgs(suite) -> - []; -ber_bin_test_msgs(Config) when is_list(Config) -> - ?ACQUIRE_NODES(1, Config), - Msgs = - msgs1a(binary) ++ - msgs5(binary) ++ - msgs6(binary) ++ - msgs7(binary) ++ - msgs8(binary), - DynamicDecode = true, - test_msgs(megaco_ber_bin_encoder, DynamicDecode, ?EC, Msgs). - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - per_test_msgs(suite) -> []; per_test_msgs(Config) when is_list(Config) -> @@ -855,22 +834,6 @@ per_test_msgs(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -per_bin_test_msgs(suite) -> - []; -per_bin_test_msgs(Config) when is_list(Config) -> - ?ACQUIRE_NODES(1, Config), - Msgs = - msgs1a(binary) ++ - msgs5(binary) ++ - msgs6(binary) ++ - msgs7(binary) ++ - msgs8(binary), - DynamicDecode = false, - test_msgs(megaco_per_bin_encoder, DynamicDecode, ?EC, Msgs). - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - erl_dist_m_test_msgs(suite) -> []; erl_dist_m_test_msgs(Config) when is_list(Config) -> @@ -2738,7 +2701,7 @@ pretty_otp5068_msg1() -> 190, asn1_NOVALUE, {actionReplies, - [{'ActionReply', %% Comments: Detta upprepas m�nga g�nger + [{'ActionReply', %% Comments: This is repeated many times. 0, asn1_NOVALUE, asn1_NOVALUE, diff --git a/lib/megaco/test/megaco_mess_test.erl b/lib/megaco/test/megaco_mess_test.erl index 663ac8c329..f8be96c254 100644 --- a/lib/megaco/test/megaco_mess_test.erl +++ b/lib/megaco/test/megaco_mess_test.erl @@ -1393,7 +1393,7 @@ rarpaop_mgc_event_sequence(text, tcp) -> rarpaop_mgc_event_sequence(binary, tcp) -> Port = 2945, TranspMod = megaco_tcp, - EncMod = megaco_ber_bin_encoder, + EncMod = megaco_ber_encoder, EncConf = [], rarpaop_mgc_event_sequence(Port, TranspMod, EncMod, EncConf). @@ -1680,7 +1680,7 @@ rarpaop_mg_event_sequence(text, tcp) -> rarpaop_mg_event_sequence(Port, EncMod, EncConf); rarpaop_mg_event_sequence(binary, tcp) -> Port = 2945, - EncMod = megaco_ber_bin_encoder, + EncMod = megaco_ber_encoder, EncConf = [], rarpaop_mg_event_sequence(Port, EncMod, EncConf). diff --git a/lib/megaco/test/megaco_mib_test.erl b/lib/megaco/test/megaco_mib_test.erl index 52d99d1442..96d7248726 100644 --- a/lib/megaco/test/megaco_mib_test.erl +++ b/lib/megaco/test/megaco_mib_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2010. All Rights Reserved. +%% Copyright Ericsson AB 2002-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -647,13 +647,13 @@ mk_recv_info([{text,udp}|ET], Acc) -> {port, 2944}], mk_recv_info(ET, [RI|Acc]); mk_recv_info([{binary,tcp}|ET], Acc) -> - RI = [{encoding_module, megaco_ber_bin_encoder}, + RI = [{encoding_module, megaco_ber_encoder}, {encoding_config, []}, {transport_module, megaco_tcp}, {port, 2945}], mk_recv_info(ET, [RI|Acc]); mk_recv_info([{binary,udp}|ET], Acc) -> - RI = [{encoding_module, megaco_ber_bin_encoder}, + RI = [{encoding_module, megaco_ber_encoder}, {encoding_config, []}, {transport_module, megaco_udp}, {port, 2945}], @@ -1013,7 +1013,7 @@ start_mg(Node, Mid, Encoding, Transport, Verbosity) -> {encoding_config, []}, {port,2944}]; binary -> - [{encoding_module, megaco_ber_bin_encoder}, + [{encoding_module, megaco_ber_encoder}, {encoding_config, []}, {port,2945}] end, diff --git a/lib/megaco/test/megaco_test_mg.erl b/lib/megaco/test/megaco_test_mg.erl index ecb3cedc83..cc1d2dd1b9 100644 --- a/lib/megaco/test/megaco_test_mg.erl +++ b/lib/megaco/test/megaco_test_mg.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2010. All Rights Reserved. +%% Copyright Ericsson AB 2003-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -158,7 +158,7 @@ select_encoding(pretty_text) -> select_encoding(compact_text) -> {megaco_compact_text_encoder, 2944}; select_encoding(binary) -> - {megaco_ber_bin_encoder, 2945}; + {megaco_ber_encoder, 2945}; select_encoding(erl_dist) -> {megaco_erl_dist_encoder, 2946}; select_encoding(Encoding) -> diff --git a/lib/megaco/test/megaco_test_mgc.erl b/lib/megaco/test/megaco_test_mgc.erl index 13c1cebe56..d9183f847e 100644 --- a/lib/megaco/test/megaco_test_mgc.erl +++ b/lib/megaco/test/megaco_test_mgc.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2010. All Rights Reserved. +%% Copyright Ericsson AB 2003-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -135,7 +135,7 @@ select_encoding(pretty_text) -> select_encoding(compact_text) -> {megaco_compact_text_encoder, 2944}; select_encoding(binary) -> - {megaco_ber_bin_encoder, 2945}; + {megaco_ber_encoder, 2945}; select_encoding(erl_dist) -> {megaco_erl_dist_encoder, 2946}; select_encoding(Encoding) -> diff --git a/lib/megaco/vsn.mk b/lib/megaco/vsn.mk index 5e72ade769..a8f9c5917a 100644 --- a/lib/megaco/vsn.mk +++ b/lib/megaco/vsn.mk @@ -18,6 +18,6 @@ # %CopyrightEnd% APPLICATION = megaco -MEGACO_VSN = 3.16.0.2 +MEGACO_VSN = 3.16.0.3 PRE_VSN = APP_VSN = "$(APPLICATION)-$(MEGACO_VSN)$(PRE_VSN)" |