Changeset 1718


Ignore:
Timestamp:
Jan 19, 2008 3:51:56 PM (17 years ago)
Author:
bennylp
Message:

More work on ticket #452/SRTP. Please see this ticket for detailed changelog

Location:
pjproject/branches/users/nanang
Files:
1 added
10 edited
1 moved

Legend:

Unmodified
Added
Removed
  • pjproject/branches/users/nanang/pjmedia/build/Makefile

    r1664 r1718  
    33THIRD_PARTY:=$(PJDIR)/third_party 
    44PA_DIR := $(THIRD_PARTY)/build/portaudio/src 
     5 
     6SRTP_INC=$(CC_INC)$(THIRD_PARTY)/build/srtp \ 
     7         $(CC_INC)$(THIRD_PARTY)/srtp/crypto/include \ 
     8         $(CC_INC)$(THIRD_PARTY)/srtp/include 
    59 
    610include $(PJDIR)/build/common.mak 
     
    2630                   $(CC_INC)../../pjlib-util/include \ 
    2731                   $(CC_INC)../../pjnath/include \ 
    28                    $(CC_INC)../.. 
     32                   $(CC_INC)../.. \ 
     33                   $(SRTP_INC)  
    2934export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \ 
    3035                   $(HOST_CXXFLAGS) $(CXXFLAGS) 
     
    4954                        resample_port.o rtcp.o rtp.o sdp.o sdp_cmp.o sdp_neg.o \ 
    5055                        session.o silencedet.o sound_port.o stream.o \ 
    51                         tonegen.o transport_ice.o transport_udp.o \ 
     56                        tonegen.o transport_ice.o transport_srtp.o \ 
     57                        transport_udp.o \ 
    5258                        wav_player.o wav_playlist.o wav_writer.o wave.o \ 
    5359                        $(SOUND_OBJS) $(NULLSOUND_OBJS) 
  • pjproject/branches/users/nanang/pjmedia/include/pjmedia/transport.h

    r1702 r1718  
    167167PJ_BEGIN_DECL 
    168168 
     169#include <pjmedia/sdp.h> 
    169170 
    170171/* 
     
    172173 */ 
    173174typedef struct pjmedia_transport pjmedia_transport; 
    174 typedef struct pjmedia_sdp_session pjmedia_sdp_session; 
    175175 
    176176 
  • pjproject/branches/users/nanang/pjsip-apps/src/samples/streamutil.c

    r1698 r1718  
    176176    /* Check if SRTP enabled */ 
    177177    if (use_srtp) { 
    178         pjmedia_srtp_stream_policy tx_plc, rx_plc; 
     178        pjmedia_srtp_crypto tx_plc, rx_plc; 
    179179 
    180180        status = pjmedia_transport_srtp_create(med_endpt, transport,  
    181                             PJMEDIA_SRTP_AUTO_CLOSE_UNDERLYING_TRANSPORT, 
    182                             &srtp_tp); 
     181                                               NULL, &srtp_tp); 
    183182        if (status != PJ_SUCCESS) 
    184183            return status; 
    185184 
    186         pj_bzero(&tx_plc, sizeof(pjmedia_srtp_stream_policy)); 
    187         pj_bzero(&rx_plc, sizeof(pjmedia_srtp_stream_policy)); 
     185        pj_bzero(&tx_plc, sizeof(pjmedia_srtp_crypto)); 
     186        pj_bzero(&rx_plc, sizeof(pjmedia_srtp_crypto)); 
    188187 
    189188        tx_plc.key = *srtp_tx_key; 
    190         tx_plc.crypto_suite = *crypto_suite; 
     189        tx_plc.name = *crypto_suite; 
    191190        rx_plc.key = *srtp_rx_key; 
    192         rx_plc.crypto_suite = *crypto_suite; 
     191        rx_plc.name = *crypto_suite; 
    193192         
    194         status = pjmedia_transport_srtp_init_session(srtp_tp, &tx_plc, &rx_plc); 
     193        status = pjmedia_transport_srtp_start(srtp_tp, &tx_plc, &rx_plc); 
    195194        if (status != PJ_SUCCESS) 
    196195            return status; 
  • pjproject/branches/users/nanang/pjsip/src/pjsua-lib/pjsua_call.c

    r1709 r1718  
    24062406{ 
    24072407    pjsua_call *call; 
     2408    const pjmedia_sdp_session *c_local; 
    24082409    pjmedia_sdp_session *local_sdp; 
    24092410    const pjmedia_sdp_session *remote_sdp; 
     
    24352436 
    24362437    /* Get local and remote SDP */ 
    2437     status = pjmedia_sdp_neg_get_active_local(call->inv->neg, &local_sdp); 
     2438    status = pjmedia_sdp_neg_get_active_local(call->inv->neg, &c_local); 
    24382439    if (status != PJ_SUCCESS) { 
    24392440        pjsua_perror(THIS_FILE,  
     
    24442445        return; 
    24452446    } 
     2447    local_sdp = (pjmedia_sdp_session*) c_local; 
    24462448 
    24472449    status = pjmedia_sdp_neg_get_active_remote(call->inv->neg, &remote_sdp); 
  • pjproject/branches/users/nanang/third_party/build/Makefile

    r1488 r1718  
    1 DIRS = resample milenage 
     1DIRS = resample milenage srtp 
    22 
    33include ../../build.mak 
  • pjproject/branches/users/nanang/third_party/build/srtp

    • Property svn:ignore
      •  

        old new  
        11*.user 
        22*.plg 
         3.*depend 
  • pjproject/branches/users/nanang/third_party/build/srtp/srtp_config.h

    r1717 r1718  
    1 /* config.h for Win32/MSVC */ 
     1#include <pj/types.h> 
    22 
    33/* Define if building for a CISC machine (e.g. Intel). */ 
    4 #define CPU_CISC 1 
     4/* #define CPU_CISC 1 */ 
    55 
    66/* Define if building for a RISC machine (assume slow byte access). */ 
    77/* #undef CPU_RISC */ 
    88 
     9/* PJLIB can't detect CISC vs RISC CPU, so we'll just say RISC here */ 
     10#if defined(PJ_WIN32) && PJ_WIN32!=0 
     11#   define CPU_CISC     1 
     12#else 
     13#   define CPU_RISC     1 
     14#endif 
     15 
    916/* Path to random device */ 
    1017/* #define DEV_URANDOM "/dev/urandom" */ 
     
    1724 
    1825/* Define to use logging to stdout. */ 
    19 #define ERR_REPORTING_STDOUT 1 
     26//#define ERR_REPORTING_STDOUT 1 
    2027 
    2128/* Define this to use ISMAcryp code. */ 
     
    2330 
    2431/* Define to 1 if you have the <arpa/inet.h> header file. */ 
    25 /* #undef HAVE_ARPA_INET_H */ 
     32#ifdef PJ_HAS_ARPA_INET_H  
     33#   define HAVE_ARPA_INET_H 1 
     34#endif 
    2635 
    2736/* Define to 1 if you have the <byteswap.h> header file. */ 
     
    2938 
    3039/* Define to 1 if you have the `inet_aton' function. */ 
    31 /* #undef HAVE_INET_ATON */ 
     40#ifdef PJ_SOCK_HAS_INET_PTON 
     41#   define HAVE_INET_ATON   1 
     42#endif 
    3243 
    3344/* Define to 1 if the system has the type `int16_t'. */ 
     
    5061 
    5162/* Define to 1 if you have the <memory.h> header file. */ 
    52 #define HAVE_MEMORY_H 1 
     63//#define HAVE_MEMORY_H 1 
    5364 
    5465/* Define to 1 if you have the <netinet/in.h> header file. */ 
    55 /* #undef HAVE_NETINET_IN_H */ 
     66#ifdef PJ_HAS_NETINET_IN_H 
     67#   define HAVE_NETINET_IN_H    1 
     68#endif 
    5669 
    5770/* Define to 1 if you have the `socket' function. */ 
     
    6275 
    6376/* Define to 1 if you have the <stdlib.h> header file. */ 
    64 #define HAVE_STDLIB_H 1 
     77#ifdef PJ_HAS_STDLIB_H 
     78#   define HAVE_STDLIB_H 1 
     79#endif 
    6580 
    6681/* Define to 1 if you have the <strings.h> header file. */ 
    67 #define HAVE_STRINGS_H 1 
     82//#define HAVE_STRINGS_H 1 
    6883 
    6984/* Define to 1 if you have the <string.h> header file. */ 
    70 #define HAVE_STRING_H 1 
     85#ifdef PJ_HAS_STRING_H 
     86#   define HAVE_STRING_H 1 
     87#endif 
    7188 
    7289/* Define to 1 if you have the <syslog.h> header file. */ 
     
    7794 
    7895/* Define to 1 if you have the <sys/socket.h> header file. */ 
    79 /* #undef HAVE_SYS_SOCKET_H */ 
     96#ifdef PJ_HAS_SYS_SOCKET_H 
     97#   define HAVE_SYS_SOCKET_H    1 
     98#endif 
    8099 
    81100/* Define to 1 if you have the <sys/stat.h> header file. */ 
    82 #define HAVE_SYS_STAT_H 1 
     101//#define HAVE_SYS_STAT_H 1 
    83102 
    84103/* Define to 1 if you have the <sys/types.h> header file. */ 
    85 #define HAVE_SYS_TYPES_H 1 
     104#ifdef PJ_HAS_SYS_TYPES_H 
     105#   define HAVE_SYS_TYPES_H 1 
     106#endif 
    86107 
    87108/* Define to 1 if you have the <sys/uio.h> header file. */ 
    88109/* #undef HAVE_SYS_UIO_H */ 
    89110 
     111/* Define to 1 if the system has the type `uint8_t'. */ 
     112#define HAVE_UINT8_T 1 
     113 
    90114/* Define to 1 if the system has the type `uint16_t'. */ 
    91115#define HAVE_UINT16_T 1 
     
    97121#define HAVE_UINT64_T 1 
    98122 
    99 /* Define to 1 if the system has the type `uint8_t'. */ 
    100 #define HAVE_UINT8_T 1 
    101  
    102123/* Define to 1 if you have the <unistd.h> header file. */ 
    103 /* #undef HAVE_UNISTD_H */ 
    104  
    105124/* Define to 1 if you have the `usleep' function. */ 
    106 /* #undef HAVE_USLEEP */ 
     125#ifdef PJ_HAS_UNISTD_H 
     126#   define HAVE_UNISTD_H    1 
     127#   define HAVE_USLEEP      1 
     128#endif 
     129 
    107130 
    108131/* Define to 1 if you have the <windows.h> header file. */ 
    109 #define HAVE_WINDOWS_H 1 
     132#if defined(PJ_WIN32) && PJ_WIN32!=0 
     133#   define HAVE_WINDOWS_H 1 
     134#endif 
    110135 
    111136/* Define to 1 if you have the <winsock2.h> header file. */ 
    112 #define HAVE_WINSOCK2_H 1 
     137#ifdef PJ_HAS_WINSOCK2_H  
     138#   define HAVE_WINSOCK2_H 1 
     139#endif 
    113140 
    114141/* Define to use X86 inlined assembly code */ 
     
    131158 
    132159/* The size of a `unsigned long', as computed by sizeof. */ 
    133 #define SIZEOF_UNSIGNED_LONG 4 
     160#define SIZEOF_UNSIGNED_LONG (sizeof(unsigned long)) 
    134161 
    135162/* The size of a `unsigned long long', as computed by sizeof. */ 
     
    146173 
    147174/* Define to 1 if you have the ANSI C header files. */ 
    148 #define STDC_HEADERS 1 
     175//#define STDC_HEADERS 1 
    149176 
    150177/* Write errors to this file */ 
     
    161188/* #undef const */ 
    162189 
    163 /* Define 'inline' to nothing, since the MSVC compiler doesn't support it.  */ 
    164 #define inline  
     190/* MSVC does't have "inline" */ 
     191#if defined(_MSC_VER) 
     192#   define inline _inline 
     193#endif 
    165194 
    166195/* Define to `unsigned' if <sys/types.h> does not define. */ 
     
    176205#endif // VC8+ 
    177206 
    178 #ifndef uint32_t 
    179     typedef unsigned char       uint8_t; 
    180     typedef unsigned short      uint16_t; 
    181     typedef unsigned int        uint32_t; 
    182     typedef unsigned __int64    uint64_t; 
    183     typedef signed char         int8_t; 
    184     typedef short               int16_t; 
    185     typedef int                 int32_t; 
    186     typedef __int64             int64_t; 
     207#ifndef int_types_defined 
     208    typedef pj_uint8_t  uint8_t; 
     209    typedef pj_uint16_t uint16_t; 
     210    typedef pj_uint32_t uint32_t; 
     211    typedef pj_uint64_t uint64_t; 
     212    typedef pj_int8_t   int8_t; 
     213    typedef pj_int16_t  int16_t; 
     214    typedef pj_int32_t  int32_t; 
     215    typedef pj_int64_t  int64_t; 
     216#   define int_types_defined 
    187217#endif 
    188218 
     
    193223    #pragma warning(disable:4244) // conversion from int64 to int 
    194224#endif 
     225 
  • pjproject/branches/users/nanang/third_party/srtp/crypto/include/aes.h

    r1697 r1718  
    4747#define _AES_H 
    4848 
    49 #include "config.h" 
     49#include "srtp_config.h" 
    5050 
    5151#include "datatypes.h" 
  • pjproject/branches/users/nanang/third_party/srtp/crypto/include/integers.h

    r1697 r1718  
    4848#define INTEGERS_H 
    4949 
    50 #include "config.h"     /* configuration file, using autoconf          */ 
     50#include "srtp_config.h"        /* configuration file, using autoconf  */ 
    5151 
    5252#ifdef SRTP_KERNEL 
  • pjproject/branches/users/nanang/third_party/srtp/crypto/rng/rand_source.c

    r1701 r1718  
    4343 */ 
    4444 
    45 #include "config.h" 
     45#include "srtp_config.h" 
    4646 
    4747#ifdef DEV_URANDOM 
  • pjproject/branches/users/nanang/third_party/srtp/srtp/srtp.c

    r1699 r1718  
    484484} 
    485485#else 
    486 #if _MSC_VER <= 1200 
    487    key_limit_set(srtp->limit, 0xffffffffffffI64); 
    488 #else 
    489    key_limit_set(srtp->limit, 0xffffffffffffLL); 
    490 #endif 
     486   key_limit_set(srtp->limit, PJ_UINT64(0xffffffffffff)); 
    491487#endif 
    492488 
Note: See TracChangeset for help on using the changeset viewer.