Navigation


Changes in / [1562:6219359a36a9:1558:932fca1cbbe4] in freeDiameter


Ignore:
Files:
1 added
16 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r1562 r1557  
    2121
    2222# CMake version
    23 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
     23CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
    2424
    2525# Location of additional CMake modules
  • INSTALL.Fedora

    r1561 r861  
    44
    55Dependencies on Fedora 13 (from minimal system):
    6 # yum install cmake make gcc gcc-c++ flex bison lksctp-tools-devel gnutls-devel libgcrypt-devel libidn2-devel
     6# yum install cmake make gcc gcc-c++ flex bison lksctp-tools-devel gnutls-devel libgcrypt-devel libidn-devel
    77
    88In addition, if you have not already retrieved the latest source:
  • INSTALL.FreeBSD

    r1561 r921  
    35354) Install 'flex' and 'bison', same way.
    3636
    37 5) Install 'gnutls' and 'libidn2', same way also.
     375) Install 'gnutls' and 'libidn', same way also.
    3838
    39396) Retrieve freeDiameter source code:
  • INSTALL.OSX

    r1561 r1288  
    4040
    41412) Install dependencies:
    42     $ brew install mercurial cmake gnutls libgcrypt postgres mysql libidn2
     42    $ brew install mercurial cmake gnutls libgcrypt postgres mysql libidn
    4343
    4444   Notes:
    45     * GNU IDN (libidn2) is optional, see below
     45    * GNU IDN (libidn) is optional, see below
    4646    * When libusrsctp package is available, you can use it as well.
    4747        However, it requires some rework on the source code as libusrsctp is not fully
  • INSTALL.OpenSUSE

    r1561 r858  
    44
    55Dependencies on OpenSUSE 11.3 (from minimal server system installation):
    6 # zypper install cmake make gcc gcc-c++ flex bison lksctp-tools-devel libgnutls-devel libgcrypt-devel libidn2-devel
     6# zypper install cmake make gcc gcc-c++ flex bison lksctp-tools-devel libgnutls-devel libgcrypt-devel libidn-devel
    77# zypper install mercurial
    88
  • INSTALL.Ubuntu

    r1561 r1351  
    1818
    1919The following packages are required to compile freeDiameter from source:
    20  cmake make gcc g++ flex bison libsctp1 libsctp-dev libgnutls-dev libgcrypt-dev libidn2-dev
     20 cmake make gcc g++ flex bison libsctp1 libsctp-dev libgnutls-dev libgcrypt-dev libidn11-dev
    2121 
    22 (note that libidn2 and libsctp can be avoided by defining DISABLE_SCTP and DIAMID_IDNA_REJECT)
     22(note that libidn and libsctp can be avoided by defining DISABLE_SCTP and DIAMID_IDNA_REJECT)
    2323 
    2424Additionnaly, these ones may be useful:
     
    4545
    4646# Install the dependencies for building the source:
    47 sudo apt-get -y install mercurial cmake make gcc g++ bison flex libsctp-dev libgnutls-dev libgcrypt-dev libidn2-dev ssl-cert debhelper fakeroot \
     47sudo apt-get -y install mercurial cmake make gcc g++ bison flex libsctp-dev libgnutls-dev libgcrypt-dev libidn11-dev ssl-cert debhelper fakeroot \
    4848   libpq-dev libmysqlclient-dev libxml2-dev swig python-dev
    4949   
     
    8585
    86861) Install all packages dependencies
    87 # sudo apt-get install mercurial cmake make gcc g++ bison flex libsctp-dev libgnutls-dev libgcrypt-dev libidn2-dev
     87# sudo apt-get install mercurial cmake make gcc g++ bison flex libsctp-dev libgnutls-dev libgcrypt-dev libidn11-dev
    8888
    89892) (OPTION) If you will compile modules that require postgresql, also install:
  • INSTALL.pkgsrc

    r1561 r1334  
    99If you want to build and install freeDiameter from the repository,
    1010you'll need to install:
    11         pkg_add bison pkg-config libidn2 gnutls libgcrypt mercurial
     11        pkg_add bison pkg-config libidn gnutls libgcrypt mercurial
    1212and follow the usual installation note.
    1313
  • contrib/RPM/freeDiameter.spec

    r1561 r1224  
    1111
    1212BuildRequires: cmake make gcc gcc-c++ flex bison lksctp-tools-devel
    13 BuildRequires: gnutls-devel libgcrypt-devel libidn2-devel
     13BuildRequires: gnutls-devel libgcrypt-devel libidn-devel
    1414BuildRequires: mercurial       
    1515Requires: lksctp-tools 
  • contrib/debian/control

    r1561 r1310  
    55Build-Depends: debhelper ( >= 7.3.9),
    66 cmake, make, gcc, g++, bison, flex,
    7  libsctp-dev, libgnutls-dev | gnutls-dev, libidn2-dev,
     7 libsctp-dev, libgnutls-dev | gnutls-dev, libidn11-dev,
    88 libpq-dev, libmysqlclient-dev, libxml2-dev, swig, python-dev,
    99 libgcrypt11-dev | libgcrypt20-dev
  • contrib/nightly_tests/prereqs.fedora

    r1561 r1053  
    44postgresql-server postgresql-devel
    55mysql-server mysql-devel
    6 libxml2 libxml2-devel libidn2-devel
     6libxml2 libxml2-devel libidn-devel
    77swig python-devel
    88
  • include/freeDiameter/CMakeLists.txt

    r1561 r1406  
    22
    33Project("freeDiameter includes directory" C)
    4 
    5 INCLUDE(FindPkgConfig)
    64
    75########################
     
    138136SET(SCTP_LIBRARIES ${SCTP_LIBRARIES} PARENT_SCOPE)
    139137
    140 # IDNA process: we use GNU libidn2
     138# IDNA process: we use libidn from GNU (unless the function & header files are included in libc)
    141139IF(NOT DIAMID_IDNA_IGNORE AND NOT DIAMID_IDNA_REJECT)
    142         PKG_CHECK_MODULES(IDNA libidn2)
    143         IF(NOT IDNA_FOUND)
    144                 MESSAGE(SEND_ERROR "Unable to find libidn2, please install libidn2-dev or equivalent, or set DIAMID_IDNA_IGNORE or DIAMID_IDNA_REJECT")
    145         ENDIF()
     140        FIND_PACKAGE(IDNA)
     141        SET(CHECK_IDNA_SOURCE_CODE "
     142                #include <idna.h>
     143                int main() {
     144                   return idna_to_ascii_8z(NULL, NULL, 0);
     145                }
     146                ")
     147        SET(CMAKE_REQUIRED_INCLUDES ${IDNA_INCLUDE_DIR})
     148        SET(CMAKE_REQUIRED_LIBRARIES ${IDNA_LIBRARIES})
     149        CHECK_C_SOURCE_COMPILES("${CHECK_IDNA_SOURCE_CODE}" HAS_IDNA_SUPPORT)
     150        IF(NOT HAS_IDNA_SUPPORT)
     151                MESSAGE(SEND_ERROR "Unable to find idna.h header or idna_to_ascii_8z function, please install libidn-dev or equivalent, or set DIAMID_IDNA_IGNORE or DIAMID_IDNA_REJECT")
     152        ENDIF(NOT HAS_IDNA_SUPPORT)
    146153ELSE (NOT DIAMID_IDNA_IGNORE  AND NOT DIAMID_IDNA_REJECT)
    147154        MESSAGE(STATUS "Non-default Internationalized Domain Names (IDN) behavior selected (no stringprep).")
    148155ENDIF(NOT DIAMID_IDNA_IGNORE  AND NOT DIAMID_IDNA_REJECT)
     156SET(IDNA_INCLUDE_DIR ${IDNA_INCLUDE_DIR} PARENT_SCOPE)
     157SET(IDNA_LIBRARIES ${IDNA_LIBRARIES} PARENT_SCOPE)
    149158
    150159
     
    212221
    213222# LFDPROTO_LIBS = libraries required by the libfdproto.
    214 SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${IDNA_LINK_LIBRARIES} PARENT_SCOPE)
     223SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${IDNA_LIBRARIES} PARENT_SCOPE)
    215224# And includes paths
    216 SET(LFDPROTO_INCLUDES ${IDNA_INCLUDE_DIRS} PARENT_SCOPE)
     225SET(LFDPROTO_INCLUDES ${IDNA_INCLUDE_DIR} PARENT_SCOPE)
    217226# Dependencies: the libraries required by any code linking to libfdproto.
    218227SET(LFDPROTO_LINK_INTERFACES ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
  • libfdcore/CMakeLists.txt

    r1560 r1286  
    33
    44# Configuration for newer cmake
    5 cmake_policy(VERSION 2.8.12)
     5cmake_policy(VERSION 2.6)
     6if (POLICY CMP0022)
     7        cmake_policy(SET CMP0022 OLD)
     8endif (POLICY CMP0022)
    69
    710# Configuration parser
  • libfdcore/p_ce.c

    r1559 r1554  
    337337                                }
    338338                               
    339                                 /* Origin-Realm is empty */
    340                                 if (hdr->avp_value->os.len == 0) {
    341                                         error->pei_errcode = "DIAMETER_INVALID_AVP_VALUE";
    342                                         error->pei_message = "Your Origin-Realm is empty.";
    343                                         error->pei_avp = avp;
    344                                         return EINVAL;
    345                                 }
    346 
    347339                                /* Save the value */
    348340                                CHECK_MALLOC(  peer->p_hdr.info.runtime.pir_realm = os0dup( hdr->avp_value->os.data, hdr->avp_value->os.len )  );
  • libfdproto/CMakeLists.txt

    r1561 r1286  
    33
    44# Configuration for newer cmake
    5 cmake_policy(VERSION 2.8.12)
     5cmake_policy(VERSION 2.6)
     6if (POLICY CMP0022)
     7        cmake_policy(SET CMP0022 OLD)
     8endif (POLICY CMP0022)
    69
    710# List of source files for the library
     
    2831SET(LFDPROTO_SRC ${LFDPROTO_SRC} PARENT_SCOPE)
    2932
     33# Include path
     34INCLUDE_DIRECTORIES(${LFDPROTO_INCLUDES})
     35
    3036# Build as a shared library
    3137ADD_LIBRARY(libfdproto SHARED ${LFDPROTO_SRC})
    32 
    33 # Include path
    34 TARGET_INCLUDE_DIRECTORIES(libfdproto PRIVATE /a/b/c ${LFDPROTO_INCLUDES})
    3538
    3639ADD_DEPENDENCIES(libfdproto version_information)
  • libfdproto/messages.c

    r1559 r1554  
    17771777        if (avp->avp_model == NULL) {
    17781778                /* In the case where we don't know the type of AVP, just copy the raw data or source */
    1779                 /* there might be no data if the AVP is empty */
     1779                CHECK_PARAMS( avp->avp_source || avp->avp_rawdata );
    17801780               
    17811781                if ( avp->avp_rawdata != NULL ) {
     
    17831783                        memcpy(&buffer[*offset], avp->avp_rawdata, avp->avp_rawlen);
    17841784                        *offset += PAD4(avp->avp_rawlen);
    1785                 } else if ( avp->avp_source != NULL ) {
     1785                } else {
    17861786                        /* the message was not parsed completely */
    17871787                        size_t datalen = avp->avp_public.avp_len - GETAVPHDRSZ(avp->avp_public.avp_flags);
  • libfdproto/ostr.c

    r1561 r1127  
    3737
    3838#if (!defined(DIAMID_IDNA_IGNORE) && !defined(DIAMID_IDNA_REJECT))
    39 /* Process IDNA with stringprep -- See RFC5890 -- and libidn2 documentation... */
    40 #include <idn2.h> /* idn2_to_ascii_8z() */
     39/* Process IDNA with stringprep -- See RFC5890 -- and libidn documentation... */
     40#include <idna.h> /* idna_to_ascii_8z() */
    4141#endif /* !defined(DIAMID_IDNA_IGNORE) && !defined(DIAMID_IDNA_REJECT) */
    4242
     
    227227                }
    228228               
    229                 ret = idn2_to_ascii_8z ( *id, &processed, IDNA_USE_STD3_ASCII_RULES );
    230                 if (ret == IDN2_OK) {
     229                ret = idna_to_ascii_8z ( *id, &processed, IDNA_USE_STD3_ASCII_RULES );
     230                if (ret == IDNA_SUCCESS) {
    231231                        TRACE_DEBUG(INFO, "The string '%s' is not a valid DiameterIdentity, it was changed to '%s'", *id, processed);
    232232                        if (memory == 0)
     
    236236                        /* Done! */
    237237                } else {
    238                         TRACE_DEBUG(INFO, "The string '%s' is not a valid DiameterIdentity and cannot be sanitized: %s", *id, idn2_strerror (ret));
     238                        TRACE_DEBUG(INFO, "The string '%s' is not a valid DiameterIdentity and cannot be sanitanized: %s", *id, idna_strerror (ret));
    239239                        return EINVAL;
    240240                }
Note: See TracChangeset for help on using the changeset viewer.