Navigation


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


Ignore:
Files:
1 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

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

    r861 r1561  
    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 libidn-devel
     6# yum install cmake make gcc gcc-c++ flex bison lksctp-tools-devel gnutls-devel libgcrypt-devel libidn2-devel
    77
    88In addition, if you have not already retrieved the latest source:
  • INSTALL.FreeBSD

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

    r1288 r1561  
    4040
    41412) Install dependencies:
    42     $ brew install mercurial cmake gnutls libgcrypt postgres mysql libidn
     42    $ brew install mercurial cmake gnutls libgcrypt postgres mysql libidn2
    4343
    4444   Notes:
    45     * GNU IDN (libidn) is optional, see below
     45    * GNU IDN (libidn2) 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

    r858 r1561  
    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 libidn-devel
     6# zypper install cmake make gcc gcc-c++ flex bison lksctp-tools-devel libgnutls-devel libgcrypt-devel libidn2-devel
    77# zypper install mercurial
    88
  • INSTALL.Ubuntu

    r1351 r1561  
    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 libidn11-dev
     20 cmake make gcc g++ flex bison libsctp1 libsctp-dev libgnutls-dev libgcrypt-dev libidn2-dev
    2121 
    22 (note that libidn and libsctp can be avoided by defining DISABLE_SCTP and DIAMID_IDNA_REJECT)
     22(note that libidn2 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 libidn11-dev ssl-cert debhelper fakeroot \
     47sudo apt-get -y install mercurial cmake make gcc g++ bison flex libsctp-dev libgnutls-dev libgcrypt-dev libidn2-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 libidn11-dev
     87# sudo apt-get install mercurial cmake make gcc g++ bison flex libsctp-dev libgnutls-dev libgcrypt-dev libidn2-dev
    8888
    89892) (OPTION) If you will compile modules that require postgresql, also install:
  • INSTALL.pkgsrc

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

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

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

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

    r1406 r1561  
    22
    33Project("freeDiameter includes directory" C)
     4
     5INCLUDE(FindPkgConfig)
    46
    57########################
     
    136138SET(SCTP_LIBRARIES ${SCTP_LIBRARIES} PARENT_SCOPE)
    137139
    138 # IDNA process: we use libidn from GNU (unless the function & header files are included in libc)
     140# IDNA process: we use GNU libidn2
    139141IF(NOT DIAMID_IDNA_IGNORE AND NOT DIAMID_IDNA_REJECT)
    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)
     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()
    153146ELSE (NOT DIAMID_IDNA_IGNORE  AND NOT DIAMID_IDNA_REJECT)
    154147        MESSAGE(STATUS "Non-default Internationalized Domain Names (IDN) behavior selected (no stringprep).")
    155148ENDIF(NOT DIAMID_IDNA_IGNORE  AND NOT DIAMID_IDNA_REJECT)
    156 SET(IDNA_INCLUDE_DIR ${IDNA_INCLUDE_DIR} PARENT_SCOPE)
    157 SET(IDNA_LIBRARIES ${IDNA_LIBRARIES} PARENT_SCOPE)
    158149
    159150
     
    221212
    222213# LFDPROTO_LIBS = libraries required by the libfdproto.
    223 SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${IDNA_LIBRARIES} PARENT_SCOPE)
     214SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${IDNA_LINK_LIBRARIES} PARENT_SCOPE)
    224215# And includes paths
    225 SET(LFDPROTO_INCLUDES ${IDNA_INCLUDE_DIR} PARENT_SCOPE)
     216SET(LFDPROTO_INCLUDES ${IDNA_INCLUDE_DIRS} PARENT_SCOPE)
    226217# Dependencies: the libraries required by any code linking to libfdproto.
    227218SET(LFDPROTO_LINK_INTERFACES ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
  • libfdcore/CMakeLists.txt

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

    r1554 r1559  
    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
    339347                                /* Save the value */
    340348                                CHECK_MALLOC(  peer->p_hdr.info.runtime.pir_realm = os0dup( hdr->avp_value->os.data, hdr->avp_value->os.len )  );
  • libfdproto/CMakeLists.txt

    r1286 r1561  
    33
    44# Configuration for newer cmake
    5 cmake_policy(VERSION 2.6)
    6 if (POLICY CMP0022)
    7         cmake_policy(SET CMP0022 OLD)
    8 endif (POLICY CMP0022)
     5cmake_policy(VERSION 2.8.12)
    96
    107# List of source files for the library
     
    3128SET(LFDPROTO_SRC ${LFDPROTO_SRC} PARENT_SCOPE)
    3229
    33 # Include path
    34 INCLUDE_DIRECTORIES(${LFDPROTO_INCLUDES})
    35 
    3630# Build as a shared library
    3731ADD_LIBRARY(libfdproto SHARED ${LFDPROTO_SRC})
     32
     33# Include path
     34TARGET_INCLUDE_DIRECTORIES(libfdproto PRIVATE /a/b/c ${LFDPROTO_INCLUDES})
    3835
    3936ADD_DEPENDENCIES(libfdproto version_information)
  • libfdproto/messages.c

    r1554 r1559  
    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                 CHECK_PARAMS( avp->avp_source || avp->avp_rawdata );
     1779                /* there might be no data if the AVP is empty */
    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 {
     1785                } else if ( avp->avp_source != NULL ) {
    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

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