Changeset 1988
- Timestamp:
- Jun 6, 2008 2:47:10 PM (16 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 6 added
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/build.symbian/pjnath.mmp
r1913 r1988 38 38 SOURCE stun_msg_dump.c 39 39 SOURCE stun_session.c 40 SOURCE stun_sock.c 40 41 SOURCE stun_transaction.c 41 42 SOURCE turn_session.c -
pjproject/trunk/pjnath/build/Makefile
r1916 r1988 32 32 export PJNATH_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ 33 33 errno.o ice_session.o ice_strans.o nat_detect.o stun_auth.o \ 34 stun_msg.o stun_msg_dump.o stun_session.o stun_ transaction.o \35 turn_session.o turn_sock.o34 stun_msg.o stun_msg_dump.o stun_session.o stun_sock.o \ 35 stun_transaction.o turn_session.o turn_sock.o 36 36 export PJNATH_CFLAGS += $(_CFLAGS) 37 37 … … 40 40 # 41 41 export PJNATH_TEST_SRCDIR = ../src/pjnath-test 42 export PJNATH_TEST_OBJS += ice_test.o stun.o sess_auth.o test.o 42 export PJNATH_TEST_OBJS += ice_test.o stun.o sess_auth.o server.o \ 43 stun_sock_test.o turn_sock_test.o test.o 43 44 export PJNATH_TEST_CFLAGS += $(_CFLAGS) 44 45 export PJNATH_TEST_LDFLAGS += $(_LDFLAGS) -
pjproject/trunk/pjnath/build/pjnath.dsp
r1913 r1988 122 122 # Begin Source File 123 123 124 SOURCE=..\src\pjnath\stun_sock.c 125 # End Source File 126 # Begin Source File 127 124 128 SOURCE=..\src\pjnath\stun_transaction.c 125 129 # End Source File … … 175 179 176 180 SOURCE=..\include\pjnath\stun_session.h 181 # End Source File 182 # Begin Source File 183 184 SOURCE=..\include\pjnath\stun_sock.h 177 185 # End Source File 178 186 # Begin Source File -
pjproject/trunk/pjnath/build/pjnath.vcproj
r1913 r1988 299 299 </File> 300 300 <File 301 RelativePath="..\src\pjnath\stun_sock.c" 302 > 303 </File> 304 <File 301 305 RelativePath="..\src\pjnath\stun_transaction.c" 302 306 > -
pjproject/trunk/pjnath/build/pjnath_test.dsp
r1877 r1988 89 89 90 90 SOURCE="..\src\pjnath-test\ice_test.c" 91 92 !IF "$(CFG)" == "pjnath_test - Win32 Release" 93 94 !ELSEIF "$(CFG)" == "pjnath_test - Win32 Debug" 95 96 !ENDIF 97 91 98 # End Source File 92 99 # Begin Source File 93 100 94 101 SOURCE="..\src\pjnath-test\main.c" 102 # End Source File 103 # Begin Source File 104 105 SOURCE="..\src\pjnath-test\server.c" 95 106 # End Source File 96 107 # Begin Source File … … 104 115 # Begin Source File 105 116 117 SOURCE="..\src\pjnath-test\stun_sock_test.c" 118 # End Source File 119 # Begin Source File 120 106 121 SOURCE="..\src\pjnath-test\test.c" 122 # End Source File 123 # Begin Source File 124 125 SOURCE="..\src\pjnath-test\turn_sock_test.c" 107 126 # End Source File 108 127 # End Group … … 110 129 111 130 # PROP Default_Filter "h;hpp;hxx;hm;inl" 131 # Begin Source File 132 133 SOURCE="..\src\pjnath-test\server.h" 134 # End Source File 112 135 # Begin Source File 113 136 -
pjproject/trunk/pjnath/build/wince-evc4/pjnath_wince.vcp
r1913 r1988 582 582 583 583 DEP_CPP_ERRNO=\ 584 "..\..\..\pjlib\include\pj\activesock.h"\ 584 585 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 585 586 "..\..\..\pjlib\include\pj\array.h"\ … … 627 628 "..\..\..\pjlib\include\pj\lock.h"\ 628 629 "..\..\..\pjlib\include\pj\log.h"\ 630 "..\..\..\pjlib\include\pj\math.h"\ 629 631 "..\..\..\pjlib\include\pj\os.h"\ 630 632 "..\..\..\pjlib\include\pj\pool.h"\ … … 1257 1259 1258 1260 DEP_CPP_ICE_S=\ 1261 "..\..\..\pjlib\include\pj\activesock.h"\ 1259 1262 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 1260 1263 "..\..\..\pjlib\include\pj\array.h"\ … … 1302 1305 "..\..\..\pjlib\include\pj\lock.h"\ 1303 1306 "..\..\..\pjlib\include\pj\log.h"\ 1307 "..\..\..\pjlib\include\pj\math.h"\ 1304 1308 "..\..\..\pjlib\include\pj\os.h"\ 1305 1309 "..\..\..\pjlib\include\pj\pool.h"\ … … 1986 1990 "..\..\..\pjlib-util\include\pjlib-util\resolver.h"\ 1987 1991 "..\..\..\pjlib-util\include\pjlib-util\types.h"\ 1992 "..\..\..\pjlib\include\pj\activesock.h"\ 1988 1993 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 1989 1994 "..\..\..\pjlib\include\pj\array.h"\ … … 2032 2037 "..\..\..\pjlib\include\pj\lock.h"\ 2033 2038 "..\..\..\pjlib\include\pj\log.h"\ 2039 "..\..\..\pjlib\include\pj\math.h"\ 2034 2040 "..\..\..\pjlib\include\pj\os.h"\ 2035 2041 "..\..\..\pjlib\include\pj\pool.h"\ … … 2055 2061 "..\..\include\pjnath\stun_msg.h"\ 2056 2062 "..\..\include\pjnath\stun_session.h"\ 2063 "..\..\include\pjnath\stun_sock.h"\ 2057 2064 "..\..\include\pjnath\stun_transaction.h"\ 2065 "..\..\include\pjnath\turn_session.h"\ 2066 "..\..\include\pjnath\turn_sock.h"\ 2058 2067 "..\..\include\pjnath\types.h"\ 2059 2068 … … 2740 2749 2741 2750 DEP_CPP_NAT_D=\ 2751 "..\..\..\pjlib\include\pj\activesock.h"\ 2742 2752 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 2743 2753 "..\..\..\pjlib\include\pj\array.h"\ … … 2786 2796 "..\..\..\pjlib\include\pj\lock.h"\ 2787 2797 "..\..\..\pjlib\include\pj\log.h"\ 2798 "..\..\..\pjlib\include\pj\math.h"\ 2788 2799 "..\..\..\pjlib\include\pj\os.h"\ 2789 2800 "..\..\..\pjlib\include\pj\pool.h"\ … … 3470 3481 "..\..\..\pjlib-util\include\pjlib-util\md5.h"\ 3471 3482 "..\..\..\pjlib-util\include\pjlib-util\sha1.h"\ 3483 "..\..\..\pjlib\include\pj\activesock.h"\ 3472 3484 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 3473 3485 "..\..\..\pjlib\include\pj\array.h"\ … … 3515 3527 "..\..\..\pjlib\include\pj\lock.h"\ 3516 3528 "..\..\..\pjlib\include\pj\log.h"\ 3529 "..\..\..\pjlib\include\pj\math.h"\ 3517 3530 "..\..\..\pjlib\include\pj\os.h"\ 3518 3531 "..\..\..\pjlib\include\pj\pool.h"\ … … 4167 4180 "..\..\..\pjlib-util\include\pjlib-util\sha1.h"\ 4168 4181 "..\..\..\pjlib-util\include\pjlib-util\types.h"\ 4182 "..\..\..\pjlib\include\pj\activesock.h"\ 4169 4183 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 4170 4184 "..\..\..\pjlib\include\pj\array.h"\ … … 4212 4226 "..\..\..\pjlib\include\pj\lock.h"\ 4213 4227 "..\..\..\pjlib\include\pj\log.h"\ 4228 "..\..\..\pjlib\include\pj\math.h"\ 4214 4229 "..\..\..\pjlib\include\pj\os.h"\ 4215 4230 "..\..\..\pjlib\include\pj\pool.h"\ … … 4848 4863 4849 4864 DEP_CPP_STUN_MS=\ 4865 "..\..\..\pjlib\include\pj\activesock.h"\ 4850 4866 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 4851 4867 "..\..\..\pjlib\include\pj\array.h"\ … … 4893 4909 "..\..\..\pjlib\include\pj\lock.h"\ 4894 4910 "..\..\..\pjlib\include\pj\log.h"\ 4911 "..\..\..\pjlib\include\pj\math.h"\ 4895 4912 "..\..\..\pjlib\include\pj\os.h"\ 4896 4913 "..\..\..\pjlib\include\pj\pool.h"\ … … 5515 5532 5516 5533 DEP_CPP_STUN_S=\ 5534 "..\..\..\pjlib\include\pj\activesock.h"\ 5517 5535 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 5518 5536 "..\..\..\pjlib\include\pj\array.h"\ … … 5560 5578 "..\..\..\pjlib\include\pj\lock.h"\ 5561 5579 "..\..\..\pjlib\include\pj\log.h"\ 5580 "..\..\..\pjlib\include\pj\math.h"\ 5562 5581 "..\..\..\pjlib\include\pj\os.h"\ 5563 5582 "..\..\..\pjlib\include\pj\pool.h"\ … … 5926 5945 # Begin Source File 5927 5946 5928 SOURCE=..\..\src\pjnath\stun_ transaction.c5947 SOURCE=..\..\src\pjnath\stun_sock.c 5929 5948 5930 5949 !IF "$(CFG)" == "pjnath_wince - Win32 (WCE emulator) Release" 5931 5950 5932 DEP_CPP_STUN_T=\ 5933 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 5934 "..\..\..\pjlib\include\pj\array.h"\ 5935 "..\..\..\pjlib\include\pj\assert.h"\ 5936 "..\..\..\pjlib\include\pj\compat\assert.h"\ 5937 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 5938 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 5939 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 5940 "..\..\..\pjlib\include\pj\compat\errno.h"\ 5941 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 5942 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 5943 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 5944 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 5945 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 5946 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 5947 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 5948 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 5949 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 5950 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 5951 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 5952 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 5953 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 5954 "..\..\..\pjlib\include\pj\compat\string.h"\ 5955 "..\..\..\pjlib\include\pj\config.h"\ 5956 "..\..\..\pjlib\include\pj\config_site.h"\ 5957 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 5958 "..\..\..\pjlib\include\pj\ctype.h"\ 5959 "..\..\..\pjlib\include\pj\errno.h"\ 5960 "..\..\..\pjlib\include\pj\except.h"\ 5961 "..\..\..\pjlib\include\pj\fifobuf.h"\ 5962 "..\..\..\pjlib\include\pj\file_access.h"\ 5963 "..\..\..\pjlib\include\pj\file_io.h"\ 5964 "..\..\..\pjlib\include\pj\guid.h"\ 5965 "..\..\..\pjlib\include\pj\hash.h"\ 5966 "..\..\..\pjlib\include\pj\ioqueue.h"\ 5967 "..\..\..\pjlib\include\pj\ip_helper.h"\ 5968 "..\..\..\pjlib\include\pj\list.h"\ 5969 "..\..\..\pjlib\include\pj\list_i.h"\ 5970 "..\..\..\pjlib\include\pj\lock.h"\ 5971 "..\..\..\pjlib\include\pj\log.h"\ 5972 "..\..\..\pjlib\include\pj\os.h"\ 5973 "..\..\..\pjlib\include\pj\pool.h"\ 5974 "..\..\..\pjlib\include\pj\pool_alt.h"\ 5975 "..\..\..\pjlib\include\pj\pool_buf.h"\ 5976 "..\..\..\pjlib\include\pj\pool_i.h"\ 5977 "..\..\..\pjlib\include\pj\rand.h"\ 5978 "..\..\..\pjlib\include\pj\rbtree.h"\ 5979 "..\..\..\pjlib\include\pj\sock.h"\ 5980 "..\..\..\pjlib\include\pj\sock_select.h"\ 5981 "..\..\..\pjlib\include\pj\string.h"\ 5982 "..\..\..\pjlib\include\pj\string_i.h"\ 5983 "..\..\..\pjlib\include\pj\timer.h"\ 5984 "..\..\..\pjlib\include\pj\types.h"\ 5985 "..\..\..\pjlib\include\pj\unicode.h"\ 5986 "..\..\..\pjlib\include\pjlib.h"\ 5987 "..\..\include\pjnath\config.h"\ 5988 "..\..\include\pjnath\errno.h"\ 5989 "..\..\include\pjnath\stun_config.h"\ 5990 "..\..\include\pjnath\stun_msg.h"\ 5991 "..\..\include\pjnath\stun_transaction.h"\ 5992 "..\..\include\pjnath\types.h"\ 5993 5994 5995 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE emulator) Debug" 5996 5997 DEP_CPP_STUN_T=\ 5951 DEP_CPP_STUN_SO=\ 5952 "..\..\..\pjlib-util\include\pjlib-util\config.h"\ 5953 "..\..\..\pjlib-util\include\pjlib-util\dns.h"\ 5954 "..\..\..\pjlib-util\include\pjlib-util\resolver.h"\ 5955 "..\..\..\pjlib-util\include\pjlib-util\srv_resolver.h"\ 5956 "..\..\..\pjlib-util\include\pjlib-util\types.h"\ 5957 "..\..\..\pjlib\include\pj\activesock.h"\ 5998 5958 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 5999 5959 "..\..\..\pjlib\include\pj\array.h"\ … … 6041 6001 "..\..\..\pjlib\include\pj\lock.h"\ 6042 6002 "..\..\..\pjlib\include\pj\log.h"\ 6043 "..\..\..\pjlib\include\pj\os.h"\ 6044 "..\..\..\pjlib\include\pj\pool.h"\ 6045 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6046 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6047 "..\..\..\pjlib\include\pj\pool_i.h"\ 6048 "..\..\..\pjlib\include\pj\rand.h"\ 6049 "..\..\..\pjlib\include\pj\rbtree.h"\ 6050 "..\..\..\pjlib\include\pj\sock.h"\ 6051 "..\..\..\pjlib\include\pj\sock_select.h"\ 6052 "..\..\..\pjlib\include\pj\string.h"\ 6053 "..\..\..\pjlib\include\pj\string_i.h"\ 6054 "..\..\..\pjlib\include\pj\timer.h"\ 6055 "..\..\..\pjlib\include\pj\types.h"\ 6056 "..\..\..\pjlib\include\pj\unicode.h"\ 6057 "..\..\..\pjlib\include\pjlib.h"\ 6058 "..\..\include\pjnath\config.h"\ 6059 "..\..\include\pjnath\errno.h"\ 6003 "..\..\..\pjlib\include\pj\math.h"\ 6004 "..\..\..\pjlib\include\pj\os.h"\ 6005 "..\..\..\pjlib\include\pj\pool.h"\ 6006 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6007 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6008 "..\..\..\pjlib\include\pj\pool_i.h"\ 6009 "..\..\..\pjlib\include\pj\rand.h"\ 6010 "..\..\..\pjlib\include\pj\rbtree.h"\ 6011 "..\..\..\pjlib\include\pj\sock.h"\ 6012 "..\..\..\pjlib\include\pj\sock_select.h"\ 6013 "..\..\..\pjlib\include\pj\string.h"\ 6014 "..\..\..\pjlib\include\pj\string_i.h"\ 6015 "..\..\..\pjlib\include\pj\timer.h"\ 6016 "..\..\..\pjlib\include\pj\types.h"\ 6017 "..\..\..\pjlib\include\pj\unicode.h"\ 6018 "..\..\..\pjlib\include\pjlib.h"\ 6019 "..\..\include\pjnath\config.h"\ 6020 "..\..\include\pjnath\errno.h"\ 6021 "..\..\include\pjnath\stun_auth.h"\ 6060 6022 "..\..\include\pjnath\stun_config.h"\ 6061 6023 "..\..\include\pjnath\stun_msg.h"\ 6024 "..\..\include\pjnath\stun_session.h"\ 6025 "..\..\include\pjnath\stun_sock.h"\ 6062 6026 "..\..\include\pjnath\stun_transaction.h"\ 6063 6027 "..\..\include\pjnath\types.h"\ 6064 6028 6065 6029 6066 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE ARMV4I) Release" 6067 6068 DEP_CPP_STUN_T=\ 6069 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6070 "..\..\..\pjlib\include\pj\array.h"\ 6071 "..\..\..\pjlib\include\pj\assert.h"\ 6072 "..\..\..\pjlib\include\pj\compat\assert.h"\ 6073 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 6074 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 6075 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 6076 "..\..\..\pjlib\include\pj\compat\errno.h"\ 6077 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 6078 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 6079 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 6080 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 6081 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 6082 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 6083 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 6084 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 6085 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 6086 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 6087 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 6088 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 6089 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 6090 "..\..\..\pjlib\include\pj\compat\string.h"\ 6091 "..\..\..\pjlib\include\pj\config.h"\ 6092 "..\..\..\pjlib\include\pj\config_site.h"\ 6093 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 6094 "..\..\..\pjlib\include\pj\ctype.h"\ 6095 "..\..\..\pjlib\include\pj\errno.h"\ 6096 "..\..\..\pjlib\include\pj\except.h"\ 6097 "..\..\..\pjlib\include\pj\fifobuf.h"\ 6098 "..\..\..\pjlib\include\pj\file_access.h"\ 6099 "..\..\..\pjlib\include\pj\file_io.h"\ 6100 "..\..\..\pjlib\include\pj\guid.h"\ 6101 "..\..\..\pjlib\include\pj\hash.h"\ 6102 "..\..\..\pjlib\include\pj\ioqueue.h"\ 6103 "..\..\..\pjlib\include\pj\ip_helper.h"\ 6104 "..\..\..\pjlib\include\pj\list.h"\ 6105 "..\..\..\pjlib\include\pj\list_i.h"\ 6106 "..\..\..\pjlib\include\pj\lock.h"\ 6107 "..\..\..\pjlib\include\pj\log.h"\ 6108 "..\..\..\pjlib\include\pj\os.h"\ 6109 "..\..\..\pjlib\include\pj\pool.h"\ 6110 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6111 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6112 "..\..\..\pjlib\include\pj\pool_i.h"\ 6113 "..\..\..\pjlib\include\pj\rand.h"\ 6114 "..\..\..\pjlib\include\pj\rbtree.h"\ 6115 "..\..\..\pjlib\include\pj\sock.h"\ 6116 "..\..\..\pjlib\include\pj\sock_select.h"\ 6117 "..\..\..\pjlib\include\pj\string.h"\ 6118 "..\..\..\pjlib\include\pj\string_i.h"\ 6119 "..\..\..\pjlib\include\pj\timer.h"\ 6120 "..\..\..\pjlib\include\pj\types.h"\ 6121 "..\..\..\pjlib\include\pj\unicode.h"\ 6122 "..\..\..\pjlib\include\pjlib.h"\ 6123 "..\..\include\pjnath\config.h"\ 6124 "..\..\include\pjnath\errno.h"\ 6125 "..\..\include\pjnath\stun_config.h"\ 6126 "..\..\include\pjnath\stun_msg.h"\ 6127 "..\..\include\pjnath\stun_transaction.h"\ 6128 "..\..\include\pjnath\types.h"\ 6129 6130 6131 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE ARMV4I) Debug" 6132 6133 DEP_CPP_STUN_T=\ 6134 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6135 "..\..\..\pjlib\include\pj\array.h"\ 6136 "..\..\..\pjlib\include\pj\assert.h"\ 6137 "..\..\..\pjlib\include\pj\compat\assert.h"\ 6138 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 6139 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 6140 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 6141 "..\..\..\pjlib\include\pj\compat\errno.h"\ 6142 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 6143 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 6144 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 6145 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 6146 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 6147 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 6148 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 6149 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 6150 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 6151 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 6152 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 6153 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 6154 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 6155 "..\..\..\pjlib\include\pj\compat\string.h"\ 6156 "..\..\..\pjlib\include\pj\config.h"\ 6157 "..\..\..\pjlib\include\pj\config_site.h"\ 6158 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 6159 "..\..\..\pjlib\include\pj\ctype.h"\ 6160 "..\..\..\pjlib\include\pj\errno.h"\ 6161 "..\..\..\pjlib\include\pj\except.h"\ 6162 "..\..\..\pjlib\include\pj\fifobuf.h"\ 6163 "..\..\..\pjlib\include\pj\file_access.h"\ 6164 "..\..\..\pjlib\include\pj\file_io.h"\ 6165 "..\..\..\pjlib\include\pj\guid.h"\ 6166 "..\..\..\pjlib\include\pj\hash.h"\ 6167 "..\..\..\pjlib\include\pj\ioqueue.h"\ 6168 "..\..\..\pjlib\include\pj\ip_helper.h"\ 6169 "..\..\..\pjlib\include\pj\list.h"\ 6170 "..\..\..\pjlib\include\pj\list_i.h"\ 6171 "..\..\..\pjlib\include\pj\lock.h"\ 6172 "..\..\..\pjlib\include\pj\log.h"\ 6173 "..\..\..\pjlib\include\pj\os.h"\ 6174 "..\..\..\pjlib\include\pj\pool.h"\ 6175 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6176 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6177 "..\..\..\pjlib\include\pj\pool_i.h"\ 6178 "..\..\..\pjlib\include\pj\rand.h"\ 6179 "..\..\..\pjlib\include\pj\rbtree.h"\ 6180 "..\..\..\pjlib\include\pj\sock.h"\ 6181 "..\..\..\pjlib\include\pj\sock_select.h"\ 6182 "..\..\..\pjlib\include\pj\string.h"\ 6183 "..\..\..\pjlib\include\pj\string_i.h"\ 6184 "..\..\..\pjlib\include\pj\timer.h"\ 6185 "..\..\..\pjlib\include\pj\types.h"\ 6186 "..\..\..\pjlib\include\pj\unicode.h"\ 6187 "..\..\..\pjlib\include\pjlib.h"\ 6188 "..\..\include\pjnath\config.h"\ 6189 "..\..\include\pjnath\errno.h"\ 6190 "..\..\include\pjnath\stun_config.h"\ 6191 "..\..\include\pjnath\stun_msg.h"\ 6192 "..\..\include\pjnath\stun_transaction.h"\ 6193 "..\..\include\pjnath\types.h"\ 6194 6195 6196 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE ARMV4) Release" 6197 6198 DEP_CPP_STUN_T=\ 6030 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE emulator) Debug" 6031 6032 DEP_CPP_STUN_SO=\ 6033 "..\..\..\pjlib-util\include\pjlib-util\config.h"\ 6034 "..\..\..\pjlib-util\include\pjlib-util\dns.h"\ 6035 "..\..\..\pjlib-util\include\pjlib-util\resolver.h"\ 6036 "..\..\..\pjlib-util\include\pjlib-util\srv_resolver.h"\ 6037 "..\..\..\pjlib-util\include\pjlib-util\types.h"\ 6038 "..\..\..\pjlib\include\pj\activesock.h"\ 6199 6039 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6200 6040 "..\..\..\pjlib\include\pj\array.h"\ … … 6242 6082 "..\..\..\pjlib\include\pj\lock.h"\ 6243 6083 "..\..\..\pjlib\include\pj\log.h"\ 6084 "..\..\..\pjlib\include\pj\math.h"\ 6085 "..\..\..\pjlib\include\pj\os.h"\ 6086 "..\..\..\pjlib\include\pj\pool.h"\ 6087 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6088 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6089 "..\..\..\pjlib\include\pj\pool_i.h"\ 6090 "..\..\..\pjlib\include\pj\rand.h"\ 6091 "..\..\..\pjlib\include\pj\rbtree.h"\ 6092 "..\..\..\pjlib\include\pj\sock.h"\ 6093 "..\..\..\pjlib\include\pj\sock_select.h"\ 6094 "..\..\..\pjlib\include\pj\string.h"\ 6095 "..\..\..\pjlib\include\pj\string_i.h"\ 6096 "..\..\..\pjlib\include\pj\timer.h"\ 6097 "..\..\..\pjlib\include\pj\types.h"\ 6098 "..\..\..\pjlib\include\pj\unicode.h"\ 6099 "..\..\..\pjlib\include\pjlib.h"\ 6100 "..\..\include\pjnath\config.h"\ 6101 "..\..\include\pjnath\errno.h"\ 6102 "..\..\include\pjnath\stun_auth.h"\ 6103 "..\..\include\pjnath\stun_config.h"\ 6104 "..\..\include\pjnath\stun_msg.h"\ 6105 "..\..\include\pjnath\stun_session.h"\ 6106 "..\..\include\pjnath\stun_sock.h"\ 6107 "..\..\include\pjnath\stun_transaction.h"\ 6108 "..\..\include\pjnath\types.h"\ 6109 6110 6111 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE ARMV4I) Release" 6112 6113 DEP_CPP_STUN_SO=\ 6114 "..\..\..\pjlib-util\include\pjlib-util\config.h"\ 6115 "..\..\..\pjlib-util\include\pjlib-util\dns.h"\ 6116 "..\..\..\pjlib-util\include\pjlib-util\resolver.h"\ 6117 "..\..\..\pjlib-util\include\pjlib-util\srv_resolver.h"\ 6118 "..\..\..\pjlib-util\include\pjlib-util\types.h"\ 6119 "..\..\..\pjlib\include\pj\activesock.h"\ 6120 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6121 "..\..\..\pjlib\include\pj\array.h"\ 6122 "..\..\..\pjlib\include\pj\assert.h"\ 6123 "..\..\..\pjlib\include\pj\compat\assert.h"\ 6124 "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ 6125 "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ 6126 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 6127 "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ 6128 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 6129 "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ 6130 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 6131 "..\..\..\pjlib\include\pj\compat\errno.h"\ 6132 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 6133 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 6134 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 6135 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 6136 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 6137 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 6138 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 6139 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 6140 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 6141 "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ 6142 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 6143 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 6144 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 6145 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 6146 "..\..\..\pjlib\include\pj\compat\stdarg.h"\ 6147 "..\..\..\pjlib\include\pj\compat\string.h"\ 6148 "..\..\..\pjlib\include\pj\config.h"\ 6149 "..\..\..\pjlib\include\pj\config_site.h"\ 6150 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 6151 "..\..\..\pjlib\include\pj\ctype.h"\ 6152 "..\..\..\pjlib\include\pj\errno.h"\ 6153 "..\..\..\pjlib\include\pj\except.h"\ 6154 "..\..\..\pjlib\include\pj\fifobuf.h"\ 6155 "..\..\..\pjlib\include\pj\file_access.h"\ 6156 "..\..\..\pjlib\include\pj\file_io.h"\ 6157 "..\..\..\pjlib\include\pj\guid.h"\ 6158 "..\..\..\pjlib\include\pj\hash.h"\ 6159 "..\..\..\pjlib\include\pj\ioqueue.h"\ 6160 "..\..\..\pjlib\include\pj\ip_helper.h"\ 6161 "..\..\..\pjlib\include\pj\list.h"\ 6162 "..\..\..\pjlib\include\pj\list_i.h"\ 6163 "..\..\..\pjlib\include\pj\lock.h"\ 6164 "..\..\..\pjlib\include\pj\log.h"\ 6165 "..\..\..\pjlib\include\pj\math.h"\ 6166 "..\..\..\pjlib\include\pj\os.h"\ 6167 "..\..\..\pjlib\include\pj\pool.h"\ 6168 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6169 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6170 "..\..\..\pjlib\include\pj\pool_i.h"\ 6171 "..\..\..\pjlib\include\pj\rand.h"\ 6172 "..\..\..\pjlib\include\pj\rbtree.h"\ 6173 "..\..\..\pjlib\include\pj\sock.h"\ 6174 "..\..\..\pjlib\include\pj\sock_select.h"\ 6175 "..\..\..\pjlib\include\pj\string.h"\ 6176 "..\..\..\pjlib\include\pj\string_i.h"\ 6177 "..\..\..\pjlib\include\pj\timer.h"\ 6178 "..\..\..\pjlib\include\pj\types.h"\ 6179 "..\..\..\pjlib\include\pj\unicode.h"\ 6180 "..\..\..\pjlib\include\pjlib.h"\ 6181 "..\..\include\pjnath\config.h"\ 6182 "..\..\include\pjnath\errno.h"\ 6183 "..\..\include\pjnath\stun_auth.h"\ 6184 "..\..\include\pjnath\stun_config.h"\ 6185 "..\..\include\pjnath\stun_msg.h"\ 6186 "..\..\include\pjnath\stun_session.h"\ 6187 "..\..\include\pjnath\stun_sock.h"\ 6188 "..\..\include\pjnath\stun_transaction.h"\ 6189 "..\..\include\pjnath\types.h"\ 6190 6191 6192 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE ARMV4I) Debug" 6193 6194 DEP_CPP_STUN_SO=\ 6195 "..\..\..\pjlib-util\include\pjlib-util\config.h"\ 6196 "..\..\..\pjlib-util\include\pjlib-util\dns.h"\ 6197 "..\..\..\pjlib-util\include\pjlib-util\resolver.h"\ 6198 "..\..\..\pjlib-util\include\pjlib-util\srv_resolver.h"\ 6199 "..\..\..\pjlib-util\include\pjlib-util\types.h"\ 6200 "..\..\..\pjlib\include\pj\activesock.h"\ 6201 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6202 "..\..\..\pjlib\include\pj\array.h"\ 6203 "..\..\..\pjlib\include\pj\assert.h"\ 6204 "..\..\..\pjlib\include\pj\compat\assert.h"\ 6205 "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ 6206 "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ 6207 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 6208 "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ 6209 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 6210 "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ 6211 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 6212 "..\..\..\pjlib\include\pj\compat\errno.h"\ 6213 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 6214 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 6215 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 6216 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 6217 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 6218 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 6219 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 6220 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 6221 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 6222 "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ 6223 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 6224 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 6225 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 6226 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 6227 "..\..\..\pjlib\include\pj\compat\stdarg.h"\ 6228 "..\..\..\pjlib\include\pj\compat\string.h"\ 6229 "..\..\..\pjlib\include\pj\config.h"\ 6230 "..\..\..\pjlib\include\pj\config_site.h"\ 6231 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 6232 "..\..\..\pjlib\include\pj\ctype.h"\ 6233 "..\..\..\pjlib\include\pj\errno.h"\ 6234 "..\..\..\pjlib\include\pj\except.h"\ 6235 "..\..\..\pjlib\include\pj\fifobuf.h"\ 6236 "..\..\..\pjlib\include\pj\file_access.h"\ 6237 "..\..\..\pjlib\include\pj\file_io.h"\ 6238 "..\..\..\pjlib\include\pj\guid.h"\ 6239 "..\..\..\pjlib\include\pj\hash.h"\ 6240 "..\..\..\pjlib\include\pj\ioqueue.h"\ 6241 "..\..\..\pjlib\include\pj\ip_helper.h"\ 6242 "..\..\..\pjlib\include\pj\list.h"\ 6243 "..\..\..\pjlib\include\pj\list_i.h"\ 6244 "..\..\..\pjlib\include\pj\lock.h"\ 6245 "..\..\..\pjlib\include\pj\log.h"\ 6246 "..\..\..\pjlib\include\pj\math.h"\ 6247 "..\..\..\pjlib\include\pj\os.h"\ 6248 "..\..\..\pjlib\include\pj\pool.h"\ 6249 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6250 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6251 "..\..\..\pjlib\include\pj\pool_i.h"\ 6252 "..\..\..\pjlib\include\pj\rand.h"\ 6253 "..\..\..\pjlib\include\pj\rbtree.h"\ 6254 "..\..\..\pjlib\include\pj\sock.h"\ 6255 "..\..\..\pjlib\include\pj\sock_select.h"\ 6256 "..\..\..\pjlib\include\pj\string.h"\ 6257 "..\..\..\pjlib\include\pj\string_i.h"\ 6258 "..\..\..\pjlib\include\pj\timer.h"\ 6259 "..\..\..\pjlib\include\pj\types.h"\ 6260 "..\..\..\pjlib\include\pj\unicode.h"\ 6261 "..\..\..\pjlib\include\pjlib.h"\ 6262 "..\..\include\pjnath\config.h"\ 6263 "..\..\include\pjnath\errno.h"\ 6264 "..\..\include\pjnath\stun_auth.h"\ 6265 "..\..\include\pjnath\stun_config.h"\ 6266 "..\..\include\pjnath\stun_msg.h"\ 6267 "..\..\include\pjnath\stun_session.h"\ 6268 "..\..\include\pjnath\stun_sock.h"\ 6269 "..\..\include\pjnath\stun_transaction.h"\ 6270 "..\..\include\pjnath\types.h"\ 6271 6272 6273 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE ARMV4) Release" 6274 6275 DEP_CPP_STUN_SO=\ 6276 "..\..\..\pjlib-util\include\pjlib-util\config.h"\ 6277 "..\..\..\pjlib-util\include\pjlib-util\dns.h"\ 6278 "..\..\..\pjlib-util\include\pjlib-util\resolver.h"\ 6279 "..\..\..\pjlib-util\include\pjlib-util\srv_resolver.h"\ 6280 "..\..\..\pjlib-util\include\pjlib-util\types.h"\ 6281 "..\..\..\pjlib\include\pj\activesock.h"\ 6282 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6283 "..\..\..\pjlib\include\pj\array.h"\ 6284 "..\..\..\pjlib\include\pj\assert.h"\ 6285 "..\..\..\pjlib\include\pj\compat\assert.h"\ 6286 "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ 6287 "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ 6288 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 6289 "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ 6290 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 6291 "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ 6292 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 6293 "..\..\..\pjlib\include\pj\compat\errno.h"\ 6294 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 6295 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 6296 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 6297 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 6298 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 6299 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 6300 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 6301 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 6302 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 6303 "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ 6304 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 6305 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 6306 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 6307 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 6308 "..\..\..\pjlib\include\pj\compat\stdarg.h"\ 6309 "..\..\..\pjlib\include\pj\compat\string.h"\ 6310 "..\..\..\pjlib\include\pj\config.h"\ 6311 "..\..\..\pjlib\include\pj\config_site.h"\ 6312 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 6313 "..\..\..\pjlib\include\pj\ctype.h"\ 6314 "..\..\..\pjlib\include\pj\errno.h"\ 6315 "..\..\..\pjlib\include\pj\except.h"\ 6316 "..\..\..\pjlib\include\pj\fifobuf.h"\ 6317 "..\..\..\pjlib\include\pj\file_access.h"\ 6318 "..\..\..\pjlib\include\pj\file_io.h"\ 6319 "..\..\..\pjlib\include\pj\guid.h"\ 6320 "..\..\..\pjlib\include\pj\hash.h"\ 6321 "..\..\..\pjlib\include\pj\ioqueue.h"\ 6322 "..\..\..\pjlib\include\pj\ip_helper.h"\ 6323 "..\..\..\pjlib\include\pj\list.h"\ 6324 "..\..\..\pjlib\include\pj\list_i.h"\ 6325 "..\..\..\pjlib\include\pj\lock.h"\ 6326 "..\..\..\pjlib\include\pj\log.h"\ 6327 "..\..\..\pjlib\include\pj\math.h"\ 6328 "..\..\..\pjlib\include\pj\os.h"\ 6329 "..\..\..\pjlib\include\pj\pool.h"\ 6330 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6331 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6332 "..\..\..\pjlib\include\pj\pool_i.h"\ 6333 "..\..\..\pjlib\include\pj\rand.h"\ 6334 "..\..\..\pjlib\include\pj\rbtree.h"\ 6335 "..\..\..\pjlib\include\pj\sock.h"\ 6336 "..\..\..\pjlib\include\pj\sock_select.h"\ 6337 "..\..\..\pjlib\include\pj\string.h"\ 6338 "..\..\..\pjlib\include\pj\string_i.h"\ 6339 "..\..\..\pjlib\include\pj\timer.h"\ 6340 "..\..\..\pjlib\include\pj\types.h"\ 6341 "..\..\..\pjlib\include\pj\unicode.h"\ 6342 "..\..\..\pjlib\include\pjlib.h"\ 6343 "..\..\include\pjnath\config.h"\ 6344 "..\..\include\pjnath\errno.h"\ 6345 "..\..\include\pjnath\stun_auth.h"\ 6346 "..\..\include\pjnath\stun_config.h"\ 6347 "..\..\include\pjnath\stun_msg.h"\ 6348 "..\..\include\pjnath\stun_session.h"\ 6349 "..\..\include\pjnath\stun_sock.h"\ 6350 "..\..\include\pjnath\stun_transaction.h"\ 6351 "..\..\include\pjnath\types.h"\ 6352 6353 6354 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE ARMV4) Debug" 6355 6356 DEP_CPP_STUN_SO=\ 6357 "..\..\..\pjlib-util\include\pjlib-util\config.h"\ 6358 "..\..\..\pjlib-util\include\pjlib-util\dns.h"\ 6359 "..\..\..\pjlib-util\include\pjlib-util\resolver.h"\ 6360 "..\..\..\pjlib-util\include\pjlib-util\srv_resolver.h"\ 6361 "..\..\..\pjlib-util\include\pjlib-util\types.h"\ 6362 "..\..\..\pjlib\include\pj\activesock.h"\ 6363 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6364 "..\..\..\pjlib\include\pj\array.h"\ 6365 "..\..\..\pjlib\include\pj\assert.h"\ 6366 "..\..\..\pjlib\include\pj\compat\assert.h"\ 6367 "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ 6368 "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ 6369 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 6370 "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ 6371 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 6372 "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ 6373 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 6374 "..\..\..\pjlib\include\pj\compat\errno.h"\ 6375 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 6376 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 6377 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 6378 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 6379 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 6380 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 6381 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 6382 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 6383 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 6384 "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ 6385 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 6386 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 6387 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 6388 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 6389 "..\..\..\pjlib\include\pj\compat\stdarg.h"\ 6390 "..\..\..\pjlib\include\pj\compat\string.h"\ 6391 "..\..\..\pjlib\include\pj\config.h"\ 6392 "..\..\..\pjlib\include\pj\config_site.h"\ 6393 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 6394 "..\..\..\pjlib\include\pj\ctype.h"\ 6395 "..\..\..\pjlib\include\pj\errno.h"\ 6396 "..\..\..\pjlib\include\pj\except.h"\ 6397 "..\..\..\pjlib\include\pj\fifobuf.h"\ 6398 "..\..\..\pjlib\include\pj\file_access.h"\ 6399 "..\..\..\pjlib\include\pj\file_io.h"\ 6400 "..\..\..\pjlib\include\pj\guid.h"\ 6401 "..\..\..\pjlib\include\pj\hash.h"\ 6402 "..\..\..\pjlib\include\pj\ioqueue.h"\ 6403 "..\..\..\pjlib\include\pj\ip_helper.h"\ 6404 "..\..\..\pjlib\include\pj\list.h"\ 6405 "..\..\..\pjlib\include\pj\list_i.h"\ 6406 "..\..\..\pjlib\include\pj\lock.h"\ 6407 "..\..\..\pjlib\include\pj\log.h"\ 6408 "..\..\..\pjlib\include\pj\math.h"\ 6409 "..\..\..\pjlib\include\pj\os.h"\ 6410 "..\..\..\pjlib\include\pj\pool.h"\ 6411 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6412 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6413 "..\..\..\pjlib\include\pj\pool_i.h"\ 6414 "..\..\..\pjlib\include\pj\rand.h"\ 6415 "..\..\..\pjlib\include\pj\rbtree.h"\ 6416 "..\..\..\pjlib\include\pj\sock.h"\ 6417 "..\..\..\pjlib\include\pj\sock_select.h"\ 6418 "..\..\..\pjlib\include\pj\string.h"\ 6419 "..\..\..\pjlib\include\pj\string_i.h"\ 6420 "..\..\..\pjlib\include\pj\timer.h"\ 6421 "..\..\..\pjlib\include\pj\types.h"\ 6422 "..\..\..\pjlib\include\pj\unicode.h"\ 6423 "..\..\..\pjlib\include\pjlib.h"\ 6424 "..\..\include\pjnath\config.h"\ 6425 "..\..\include\pjnath\errno.h"\ 6426 "..\..\include\pjnath\stun_auth.h"\ 6427 "..\..\include\pjnath\stun_config.h"\ 6428 "..\..\include\pjnath\stun_msg.h"\ 6429 "..\..\include\pjnath\stun_session.h"\ 6430 "..\..\include\pjnath\stun_sock.h"\ 6431 "..\..\include\pjnath\stun_transaction.h"\ 6432 "..\..\include\pjnath\types.h"\ 6433 6434 6435 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE ARMV4T) Release" 6436 6437 DEP_CPP_STUN_SO=\ 6438 "..\..\..\pjlib-util\include\pjlib-util\config.h"\ 6439 "..\..\..\pjlib-util\include\pjlib-util\dns.h"\ 6440 "..\..\..\pjlib-util\include\pjlib-util\resolver.h"\ 6441 "..\..\..\pjlib-util\include\pjlib-util\srv_resolver.h"\ 6442 "..\..\..\pjlib-util\include\pjlib-util\types.h"\ 6443 "..\..\..\pjlib\include\pj\activesock.h"\ 6444 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6445 "..\..\..\pjlib\include\pj\array.h"\ 6446 "..\..\..\pjlib\include\pj\assert.h"\ 6447 "..\..\..\pjlib\include\pj\compat\assert.h"\ 6448 "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ 6449 "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ 6450 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 6451 "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ 6452 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 6453 "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ 6454 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 6455 "..\..\..\pjlib\include\pj\compat\errno.h"\ 6456 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 6457 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 6458 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 6459 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 6460 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 6461 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 6462 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 6463 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 6464 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 6465 "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ 6466 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 6467 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 6468 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 6469 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 6470 "..\..\..\pjlib\include\pj\compat\stdarg.h"\ 6471 "..\..\..\pjlib\include\pj\compat\string.h"\ 6472 "..\..\..\pjlib\include\pj\config.h"\ 6473 "..\..\..\pjlib\include\pj\config_site.h"\ 6474 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 6475 "..\..\..\pjlib\include\pj\ctype.h"\ 6476 "..\..\..\pjlib\include\pj\errno.h"\ 6477 "..\..\..\pjlib\include\pj\except.h"\ 6478 "..\..\..\pjlib\include\pj\fifobuf.h"\ 6479 "..\..\..\pjlib\include\pj\file_access.h"\ 6480 "..\..\..\pjlib\include\pj\file_io.h"\ 6481 "..\..\..\pjlib\include\pj\guid.h"\ 6482 "..\..\..\pjlib\include\pj\hash.h"\ 6483 "..\..\..\pjlib\include\pj\ioqueue.h"\ 6484 "..\..\..\pjlib\include\pj\ip_helper.h"\ 6485 "..\..\..\pjlib\include\pj\list.h"\ 6486 "..\..\..\pjlib\include\pj\list_i.h"\ 6487 "..\..\..\pjlib\include\pj\lock.h"\ 6488 "..\..\..\pjlib\include\pj\log.h"\ 6489 "..\..\..\pjlib\include\pj\math.h"\ 6490 "..\..\..\pjlib\include\pj\os.h"\ 6491 "..\..\..\pjlib\include\pj\pool.h"\ 6492 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6493 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6494 "..\..\..\pjlib\include\pj\pool_i.h"\ 6495 "..\..\..\pjlib\include\pj\rand.h"\ 6496 "..\..\..\pjlib\include\pj\rbtree.h"\ 6497 "..\..\..\pjlib\include\pj\sock.h"\ 6498 "..\..\..\pjlib\include\pj\sock_select.h"\ 6499 "..\..\..\pjlib\include\pj\string.h"\ 6500 "..\..\..\pjlib\include\pj\string_i.h"\ 6501 "..\..\..\pjlib\include\pj\timer.h"\ 6502 "..\..\..\pjlib\include\pj\types.h"\ 6503 "..\..\..\pjlib\include\pj\unicode.h"\ 6504 "..\..\..\pjlib\include\pjlib.h"\ 6505 "..\..\include\pjnath\config.h"\ 6506 "..\..\include\pjnath\errno.h"\ 6507 "..\..\include\pjnath\stun_auth.h"\ 6508 "..\..\include\pjnath\stun_config.h"\ 6509 "..\..\include\pjnath\stun_msg.h"\ 6510 "..\..\include\pjnath\stun_session.h"\ 6511 "..\..\include\pjnath\stun_sock.h"\ 6512 "..\..\include\pjnath\stun_transaction.h"\ 6513 "..\..\include\pjnath\types.h"\ 6514 6515 6516 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE ARMV4T) Debug" 6517 6518 DEP_CPP_STUN_SO=\ 6519 "..\..\..\pjlib-util\include\pjlib-util\config.h"\ 6520 "..\..\..\pjlib-util\include\pjlib-util\dns.h"\ 6521 "..\..\..\pjlib-util\include\pjlib-util\resolver.h"\ 6522 "..\..\..\pjlib-util\include\pjlib-util\srv_resolver.h"\ 6523 "..\..\..\pjlib-util\include\pjlib-util\types.h"\ 6524 "..\..\..\pjlib\include\pj\activesock.h"\ 6525 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6526 "..\..\..\pjlib\include\pj\array.h"\ 6527 "..\..\..\pjlib\include\pj\assert.h"\ 6528 "..\..\..\pjlib\include\pj\compat\assert.h"\ 6529 "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ 6530 "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ 6531 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 6532 "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ 6533 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 6534 "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ 6535 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 6536 "..\..\..\pjlib\include\pj\compat\errno.h"\ 6537 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 6538 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 6539 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 6540 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 6541 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 6542 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 6543 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 6544 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 6545 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 6546 "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ 6547 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 6548 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 6549 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 6550 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 6551 "..\..\..\pjlib\include\pj\compat\stdarg.h"\ 6552 "..\..\..\pjlib\include\pj\compat\string.h"\ 6553 "..\..\..\pjlib\include\pj\config.h"\ 6554 "..\..\..\pjlib\include\pj\config_site.h"\ 6555 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 6556 "..\..\..\pjlib\include\pj\ctype.h"\ 6557 "..\..\..\pjlib\include\pj\errno.h"\ 6558 "..\..\..\pjlib\include\pj\except.h"\ 6559 "..\..\..\pjlib\include\pj\fifobuf.h"\ 6560 "..\..\..\pjlib\include\pj\file_access.h"\ 6561 "..\..\..\pjlib\include\pj\file_io.h"\ 6562 "..\..\..\pjlib\include\pj\guid.h"\ 6563 "..\..\..\pjlib\include\pj\hash.h"\ 6564 "..\..\..\pjlib\include\pj\ioqueue.h"\ 6565 "..\..\..\pjlib\include\pj\ip_helper.h"\ 6566 "..\..\..\pjlib\include\pj\list.h"\ 6567 "..\..\..\pjlib\include\pj\list_i.h"\ 6568 "..\..\..\pjlib\include\pj\lock.h"\ 6569 "..\..\..\pjlib\include\pj\log.h"\ 6570 "..\..\..\pjlib\include\pj\math.h"\ 6571 "..\..\..\pjlib\include\pj\os.h"\ 6572 "..\..\..\pjlib\include\pj\pool.h"\ 6573 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6574 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6575 "..\..\..\pjlib\include\pj\pool_i.h"\ 6576 "..\..\..\pjlib\include\pj\rand.h"\ 6577 "..\..\..\pjlib\include\pj\rbtree.h"\ 6578 "..\..\..\pjlib\include\pj\sock.h"\ 6579 "..\..\..\pjlib\include\pj\sock_select.h"\ 6580 "..\..\..\pjlib\include\pj\string.h"\ 6581 "..\..\..\pjlib\include\pj\string_i.h"\ 6582 "..\..\..\pjlib\include\pj\timer.h"\ 6583 "..\..\..\pjlib\include\pj\types.h"\ 6584 "..\..\..\pjlib\include\pj\unicode.h"\ 6585 "..\..\..\pjlib\include\pjlib.h"\ 6586 "..\..\include\pjnath\config.h"\ 6587 "..\..\include\pjnath\errno.h"\ 6588 "..\..\include\pjnath\stun_auth.h"\ 6589 "..\..\include\pjnath\stun_config.h"\ 6590 "..\..\include\pjnath\stun_msg.h"\ 6591 "..\..\include\pjnath\stun_session.h"\ 6592 "..\..\include\pjnath\stun_sock.h"\ 6593 "..\..\include\pjnath\stun_transaction.h"\ 6594 "..\..\include\pjnath\types.h"\ 6595 6596 6597 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE x86) Release" 6598 6599 DEP_CPP_STUN_SO=\ 6600 "..\..\..\pjlib-util\include\pjlib-util\config.h"\ 6601 "..\..\..\pjlib-util\include\pjlib-util\dns.h"\ 6602 "..\..\..\pjlib-util\include\pjlib-util\resolver.h"\ 6603 "..\..\..\pjlib-util\include\pjlib-util\srv_resolver.h"\ 6604 "..\..\..\pjlib-util\include\pjlib-util\types.h"\ 6605 "..\..\..\pjlib\include\pj\activesock.h"\ 6606 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6607 "..\..\..\pjlib\include\pj\array.h"\ 6608 "..\..\..\pjlib\include\pj\assert.h"\ 6609 "..\..\..\pjlib\include\pj\compat\assert.h"\ 6610 "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ 6611 "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ 6612 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 6613 "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ 6614 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 6615 "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ 6616 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 6617 "..\..\..\pjlib\include\pj\compat\errno.h"\ 6618 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 6619 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 6620 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 6621 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 6622 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 6623 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 6624 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 6625 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 6626 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 6627 "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ 6628 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 6629 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 6630 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 6631 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 6632 "..\..\..\pjlib\include\pj\compat\stdarg.h"\ 6633 "..\..\..\pjlib\include\pj\compat\string.h"\ 6634 "..\..\..\pjlib\include\pj\config.h"\ 6635 "..\..\..\pjlib\include\pj\config_site.h"\ 6636 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 6637 "..\..\..\pjlib\include\pj\ctype.h"\ 6638 "..\..\..\pjlib\include\pj\errno.h"\ 6639 "..\..\..\pjlib\include\pj\except.h"\ 6640 "..\..\..\pjlib\include\pj\fifobuf.h"\ 6641 "..\..\..\pjlib\include\pj\file_access.h"\ 6642 "..\..\..\pjlib\include\pj\file_io.h"\ 6643 "..\..\..\pjlib\include\pj\guid.h"\ 6644 "..\..\..\pjlib\include\pj\hash.h"\ 6645 "..\..\..\pjlib\include\pj\ioqueue.h"\ 6646 "..\..\..\pjlib\include\pj\ip_helper.h"\ 6647 "..\..\..\pjlib\include\pj\list.h"\ 6648 "..\..\..\pjlib\include\pj\list_i.h"\ 6649 "..\..\..\pjlib\include\pj\lock.h"\ 6650 "..\..\..\pjlib\include\pj\log.h"\ 6651 "..\..\..\pjlib\include\pj\math.h"\ 6652 "..\..\..\pjlib\include\pj\os.h"\ 6653 "..\..\..\pjlib\include\pj\pool.h"\ 6654 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6655 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6656 "..\..\..\pjlib\include\pj\pool_i.h"\ 6657 "..\..\..\pjlib\include\pj\rand.h"\ 6658 "..\..\..\pjlib\include\pj\rbtree.h"\ 6659 "..\..\..\pjlib\include\pj\sock.h"\ 6660 "..\..\..\pjlib\include\pj\sock_select.h"\ 6661 "..\..\..\pjlib\include\pj\string.h"\ 6662 "..\..\..\pjlib\include\pj\string_i.h"\ 6663 "..\..\..\pjlib\include\pj\timer.h"\ 6664 "..\..\..\pjlib\include\pj\types.h"\ 6665 "..\..\..\pjlib\include\pj\unicode.h"\ 6666 "..\..\..\pjlib\include\pjlib.h"\ 6667 "..\..\include\pjnath\config.h"\ 6668 "..\..\include\pjnath\errno.h"\ 6669 "..\..\include\pjnath\stun_auth.h"\ 6670 "..\..\include\pjnath\stun_config.h"\ 6671 "..\..\include\pjnath\stun_msg.h"\ 6672 "..\..\include\pjnath\stun_session.h"\ 6673 "..\..\include\pjnath\stun_sock.h"\ 6674 "..\..\include\pjnath\stun_transaction.h"\ 6675 "..\..\include\pjnath\types.h"\ 6676 6677 6678 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE x86) Debug" 6679 6680 DEP_CPP_STUN_SO=\ 6681 "..\..\..\pjlib-util\include\pjlib-util\config.h"\ 6682 "..\..\..\pjlib-util\include\pjlib-util\dns.h"\ 6683 "..\..\..\pjlib-util\include\pjlib-util\resolver.h"\ 6684 "..\..\..\pjlib-util\include\pjlib-util\srv_resolver.h"\ 6685 "..\..\..\pjlib-util\include\pjlib-util\types.h"\ 6686 "..\..\..\pjlib\include\pj\activesock.h"\ 6687 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6688 "..\..\..\pjlib\include\pj\array.h"\ 6689 "..\..\..\pjlib\include\pj\assert.h"\ 6690 "..\..\..\pjlib\include\pj\compat\assert.h"\ 6691 "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ 6692 "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ 6693 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 6694 "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ 6695 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 6696 "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ 6697 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 6698 "..\..\..\pjlib\include\pj\compat\errno.h"\ 6699 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 6700 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 6701 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 6702 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 6703 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 6704 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 6705 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 6706 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 6707 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 6708 "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ 6709 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 6710 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 6711 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 6712 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 6713 "..\..\..\pjlib\include\pj\compat\stdarg.h"\ 6714 "..\..\..\pjlib\include\pj\compat\string.h"\ 6715 "..\..\..\pjlib\include\pj\config.h"\ 6716 "..\..\..\pjlib\include\pj\config_site.h"\ 6717 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 6718 "..\..\..\pjlib\include\pj\ctype.h"\ 6719 "..\..\..\pjlib\include\pj\errno.h"\ 6720 "..\..\..\pjlib\include\pj\except.h"\ 6721 "..\..\..\pjlib\include\pj\fifobuf.h"\ 6722 "..\..\..\pjlib\include\pj\file_access.h"\ 6723 "..\..\..\pjlib\include\pj\file_io.h"\ 6724 "..\..\..\pjlib\include\pj\guid.h"\ 6725 "..\..\..\pjlib\include\pj\hash.h"\ 6726 "..\..\..\pjlib\include\pj\ioqueue.h"\ 6727 "..\..\..\pjlib\include\pj\ip_helper.h"\ 6728 "..\..\..\pjlib\include\pj\list.h"\ 6729 "..\..\..\pjlib\include\pj\list_i.h"\ 6730 "..\..\..\pjlib\include\pj\lock.h"\ 6731 "..\..\..\pjlib\include\pj\log.h"\ 6732 "..\..\..\pjlib\include\pj\math.h"\ 6733 "..\..\..\pjlib\include\pj\os.h"\ 6734 "..\..\..\pjlib\include\pj\pool.h"\ 6735 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6736 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6737 "..\..\..\pjlib\include\pj\pool_i.h"\ 6738 "..\..\..\pjlib\include\pj\rand.h"\ 6739 "..\..\..\pjlib\include\pj\rbtree.h"\ 6740 "..\..\..\pjlib\include\pj\sock.h"\ 6741 "..\..\..\pjlib\include\pj\sock_select.h"\ 6742 "..\..\..\pjlib\include\pj\string.h"\ 6743 "..\..\..\pjlib\include\pj\string_i.h"\ 6744 "..\..\..\pjlib\include\pj\timer.h"\ 6745 "..\..\..\pjlib\include\pj\types.h"\ 6746 "..\..\..\pjlib\include\pj\unicode.h"\ 6747 "..\..\..\pjlib\include\pjlib.h"\ 6748 "..\..\include\pjnath\config.h"\ 6749 "..\..\include\pjnath\errno.h"\ 6750 "..\..\include\pjnath\stun_auth.h"\ 6751 "..\..\include\pjnath\stun_config.h"\ 6752 "..\..\include\pjnath\stun_msg.h"\ 6753 "..\..\include\pjnath\stun_session.h"\ 6754 "..\..\include\pjnath\stun_sock.h"\ 6755 "..\..\include\pjnath\stun_transaction.h"\ 6756 "..\..\include\pjnath\types.h"\ 6757 6758 6759 !ENDIF 6760 6761 # End Source File 6762 # Begin Source File 6763 6764 SOURCE=..\..\src\pjnath\stun_transaction.c 6765 6766 !IF "$(CFG)" == "pjnath_wince - Win32 (WCE emulator) Release" 6767 6768 DEP_CPP_STUN_T=\ 6769 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6770 "..\..\..\pjlib\include\pj\array.h"\ 6771 "..\..\..\pjlib\include\pj\assert.h"\ 6772 "..\..\..\pjlib\include\pj\compat\assert.h"\ 6773 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 6774 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 6775 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 6776 "..\..\..\pjlib\include\pj\compat\errno.h"\ 6777 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 6778 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 6779 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 6780 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 6781 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 6782 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 6783 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 6784 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 6785 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 6786 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 6787 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 6788 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 6789 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 6790 "..\..\..\pjlib\include\pj\compat\string.h"\ 6791 "..\..\..\pjlib\include\pj\config.h"\ 6792 "..\..\..\pjlib\include\pj\config_site.h"\ 6793 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 6794 "..\..\..\pjlib\include\pj\ctype.h"\ 6795 "..\..\..\pjlib\include\pj\errno.h"\ 6796 "..\..\..\pjlib\include\pj\except.h"\ 6797 "..\..\..\pjlib\include\pj\fifobuf.h"\ 6798 "..\..\..\pjlib\include\pj\file_access.h"\ 6799 "..\..\..\pjlib\include\pj\file_io.h"\ 6800 "..\..\..\pjlib\include\pj\guid.h"\ 6801 "..\..\..\pjlib\include\pj\hash.h"\ 6802 "..\..\..\pjlib\include\pj\ioqueue.h"\ 6803 "..\..\..\pjlib\include\pj\ip_helper.h"\ 6804 "..\..\..\pjlib\include\pj\list.h"\ 6805 "..\..\..\pjlib\include\pj\list_i.h"\ 6806 "..\..\..\pjlib\include\pj\lock.h"\ 6807 "..\..\..\pjlib\include\pj\log.h"\ 6808 "..\..\..\pjlib\include\pj\os.h"\ 6809 "..\..\..\pjlib\include\pj\pool.h"\ 6810 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6811 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6812 "..\..\..\pjlib\include\pj\pool_i.h"\ 6813 "..\..\..\pjlib\include\pj\rand.h"\ 6814 "..\..\..\pjlib\include\pj\rbtree.h"\ 6815 "..\..\..\pjlib\include\pj\sock.h"\ 6816 "..\..\..\pjlib\include\pj\sock_select.h"\ 6817 "..\..\..\pjlib\include\pj\string.h"\ 6818 "..\..\..\pjlib\include\pj\string_i.h"\ 6819 "..\..\..\pjlib\include\pj\timer.h"\ 6820 "..\..\..\pjlib\include\pj\types.h"\ 6821 "..\..\..\pjlib\include\pj\unicode.h"\ 6822 "..\..\..\pjlib\include\pjlib.h"\ 6823 "..\..\include\pjnath\config.h"\ 6824 "..\..\include\pjnath\errno.h"\ 6825 "..\..\include\pjnath\stun_config.h"\ 6826 "..\..\include\pjnath\stun_msg.h"\ 6827 "..\..\include\pjnath\stun_transaction.h"\ 6828 "..\..\include\pjnath\types.h"\ 6829 6830 6831 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE emulator) Debug" 6832 6833 DEP_CPP_STUN_T=\ 6834 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6835 "..\..\..\pjlib\include\pj\array.h"\ 6836 "..\..\..\pjlib\include\pj\assert.h"\ 6837 "..\..\..\pjlib\include\pj\compat\assert.h"\ 6838 "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ 6839 "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ 6840 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 6841 "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ 6842 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 6843 "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ 6844 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 6845 "..\..\..\pjlib\include\pj\compat\errno.h"\ 6846 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 6847 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 6848 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 6849 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 6850 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 6851 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 6852 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 6853 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 6854 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 6855 "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ 6856 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 6857 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 6858 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 6859 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 6860 "..\..\..\pjlib\include\pj\compat\stdarg.h"\ 6861 "..\..\..\pjlib\include\pj\compat\string.h"\ 6862 "..\..\..\pjlib\include\pj\config.h"\ 6863 "..\..\..\pjlib\include\pj\config_site.h"\ 6864 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 6865 "..\..\..\pjlib\include\pj\ctype.h"\ 6866 "..\..\..\pjlib\include\pj\errno.h"\ 6867 "..\..\..\pjlib\include\pj\except.h"\ 6868 "..\..\..\pjlib\include\pj\fifobuf.h"\ 6869 "..\..\..\pjlib\include\pj\file_access.h"\ 6870 "..\..\..\pjlib\include\pj\file_io.h"\ 6871 "..\..\..\pjlib\include\pj\guid.h"\ 6872 "..\..\..\pjlib\include\pj\hash.h"\ 6873 "..\..\..\pjlib\include\pj\ioqueue.h"\ 6874 "..\..\..\pjlib\include\pj\ip_helper.h"\ 6875 "..\..\..\pjlib\include\pj\list.h"\ 6876 "..\..\..\pjlib\include\pj\list_i.h"\ 6877 "..\..\..\pjlib\include\pj\lock.h"\ 6878 "..\..\..\pjlib\include\pj\log.h"\ 6879 "..\..\..\pjlib\include\pj\os.h"\ 6880 "..\..\..\pjlib\include\pj\pool.h"\ 6881 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6882 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6883 "..\..\..\pjlib\include\pj\pool_i.h"\ 6884 "..\..\..\pjlib\include\pj\rand.h"\ 6885 "..\..\..\pjlib\include\pj\rbtree.h"\ 6886 "..\..\..\pjlib\include\pj\sock.h"\ 6887 "..\..\..\pjlib\include\pj\sock_select.h"\ 6888 "..\..\..\pjlib\include\pj\string.h"\ 6889 "..\..\..\pjlib\include\pj\string_i.h"\ 6890 "..\..\..\pjlib\include\pj\timer.h"\ 6891 "..\..\..\pjlib\include\pj\types.h"\ 6892 "..\..\..\pjlib\include\pj\unicode.h"\ 6893 "..\..\..\pjlib\include\pjlib.h"\ 6894 "..\..\include\pjnath\config.h"\ 6895 "..\..\include\pjnath\errno.h"\ 6896 "..\..\include\pjnath\stun_config.h"\ 6897 "..\..\include\pjnath\stun_msg.h"\ 6898 "..\..\include\pjnath\stun_transaction.h"\ 6899 "..\..\include\pjnath\types.h"\ 6900 6901 6902 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE ARMV4I) Release" 6903 6904 DEP_CPP_STUN_T=\ 6905 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6906 "..\..\..\pjlib\include\pj\array.h"\ 6907 "..\..\..\pjlib\include\pj\assert.h"\ 6908 "..\..\..\pjlib\include\pj\compat\assert.h"\ 6909 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 6910 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 6911 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 6912 "..\..\..\pjlib\include\pj\compat\errno.h"\ 6913 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 6914 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 6915 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 6916 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 6917 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 6918 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 6919 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 6920 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 6921 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 6922 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 6923 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 6924 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 6925 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 6926 "..\..\..\pjlib\include\pj\compat\string.h"\ 6927 "..\..\..\pjlib\include\pj\config.h"\ 6928 "..\..\..\pjlib\include\pj\config_site.h"\ 6929 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 6930 "..\..\..\pjlib\include\pj\ctype.h"\ 6931 "..\..\..\pjlib\include\pj\errno.h"\ 6932 "..\..\..\pjlib\include\pj\except.h"\ 6933 "..\..\..\pjlib\include\pj\fifobuf.h"\ 6934 "..\..\..\pjlib\include\pj\file_access.h"\ 6935 "..\..\..\pjlib\include\pj\file_io.h"\ 6936 "..\..\..\pjlib\include\pj\guid.h"\ 6937 "..\..\..\pjlib\include\pj\hash.h"\ 6938 "..\..\..\pjlib\include\pj\ioqueue.h"\ 6939 "..\..\..\pjlib\include\pj\ip_helper.h"\ 6940 "..\..\..\pjlib\include\pj\list.h"\ 6941 "..\..\..\pjlib\include\pj\list_i.h"\ 6942 "..\..\..\pjlib\include\pj\lock.h"\ 6943 "..\..\..\pjlib\include\pj\log.h"\ 6944 "..\..\..\pjlib\include\pj\os.h"\ 6945 "..\..\..\pjlib\include\pj\pool.h"\ 6946 "..\..\..\pjlib\include\pj\pool_alt.h"\ 6947 "..\..\..\pjlib\include\pj\pool_buf.h"\ 6948 "..\..\..\pjlib\include\pj\pool_i.h"\ 6949 "..\..\..\pjlib\include\pj\rand.h"\ 6950 "..\..\..\pjlib\include\pj\rbtree.h"\ 6951 "..\..\..\pjlib\include\pj\sock.h"\ 6952 "..\..\..\pjlib\include\pj\sock_select.h"\ 6953 "..\..\..\pjlib\include\pj\string.h"\ 6954 "..\..\..\pjlib\include\pj\string_i.h"\ 6955 "..\..\..\pjlib\include\pj\timer.h"\ 6956 "..\..\..\pjlib\include\pj\types.h"\ 6957 "..\..\..\pjlib\include\pj\unicode.h"\ 6958 "..\..\..\pjlib\include\pjlib.h"\ 6959 "..\..\include\pjnath\config.h"\ 6960 "..\..\include\pjnath\errno.h"\ 6961 "..\..\include\pjnath\stun_config.h"\ 6962 "..\..\include\pjnath\stun_msg.h"\ 6963 "..\..\include\pjnath\stun_transaction.h"\ 6964 "..\..\include\pjnath\types.h"\ 6965 6966 6967 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE ARMV4I) Debug" 6968 6969 DEP_CPP_STUN_T=\ 6970 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6971 "..\..\..\pjlib\include\pj\array.h"\ 6972 "..\..\..\pjlib\include\pj\assert.h"\ 6973 "..\..\..\pjlib\include\pj\compat\assert.h"\ 6974 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 6975 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 6976 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 6977 "..\..\..\pjlib\include\pj\compat\errno.h"\ 6978 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 6979 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 6980 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 6981 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 6982 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 6983 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 6984 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 6985 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 6986 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 6987 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 6988 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 6989 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 6990 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 6991 "..\..\..\pjlib\include\pj\compat\string.h"\ 6992 "..\..\..\pjlib\include\pj\config.h"\ 6993 "..\..\..\pjlib\include\pj\config_site.h"\ 6994 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 6995 "..\..\..\pjlib\include\pj\ctype.h"\ 6996 "..\..\..\pjlib\include\pj\errno.h"\ 6997 "..\..\..\pjlib\include\pj\except.h"\ 6998 "..\..\..\pjlib\include\pj\fifobuf.h"\ 6999 "..\..\..\pjlib\include\pj\file_access.h"\ 7000 "..\..\..\pjlib\include\pj\file_io.h"\ 7001 "..\..\..\pjlib\include\pj\guid.h"\ 7002 "..\..\..\pjlib\include\pj\hash.h"\ 7003 "..\..\..\pjlib\include\pj\ioqueue.h"\ 7004 "..\..\..\pjlib\include\pj\ip_helper.h"\ 7005 "..\..\..\pjlib\include\pj\list.h"\ 7006 "..\..\..\pjlib\include\pj\list_i.h"\ 7007 "..\..\..\pjlib\include\pj\lock.h"\ 7008 "..\..\..\pjlib\include\pj\log.h"\ 7009 "..\..\..\pjlib\include\pj\os.h"\ 7010 "..\..\..\pjlib\include\pj\pool.h"\ 7011 "..\..\..\pjlib\include\pj\pool_alt.h"\ 7012 "..\..\..\pjlib\include\pj\pool_buf.h"\ 7013 "..\..\..\pjlib\include\pj\pool_i.h"\ 7014 "..\..\..\pjlib\include\pj\rand.h"\ 7015 "..\..\..\pjlib\include\pj\rbtree.h"\ 7016 "..\..\..\pjlib\include\pj\sock.h"\ 7017 "..\..\..\pjlib\include\pj\sock_select.h"\ 7018 "..\..\..\pjlib\include\pj\string.h"\ 7019 "..\..\..\pjlib\include\pj\string_i.h"\ 7020 "..\..\..\pjlib\include\pj\timer.h"\ 7021 "..\..\..\pjlib\include\pj\types.h"\ 7022 "..\..\..\pjlib\include\pj\unicode.h"\ 7023 "..\..\..\pjlib\include\pjlib.h"\ 7024 "..\..\include\pjnath\config.h"\ 7025 "..\..\include\pjnath\errno.h"\ 7026 "..\..\include\pjnath\stun_config.h"\ 7027 "..\..\include\pjnath\stun_msg.h"\ 7028 "..\..\include\pjnath\stun_transaction.h"\ 7029 "..\..\include\pjnath\types.h"\ 7030 7031 7032 !ELSEIF "$(CFG)" == "pjnath_wince - Win32 (WCE ARMV4) Release" 7033 7034 DEP_CPP_STUN_T=\ 7035 "..\..\..\pjlib\include\pj\activesock.h"\ 7036 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 7037 "..\..\..\pjlib\include\pj\array.h"\ 7038 "..\..\..\pjlib\include\pj\assert.h"\ 7039 "..\..\..\pjlib\include\pj\compat\assert.h"\ 7040 "..\..\..\pjlib\include\pj\compat\cc_armcc.h"\ 7041 "..\..\..\pjlib\include\pj\compat\cc_codew.h"\ 7042 "..\..\..\pjlib\include\pj\compat\cc_gcc.h"\ 7043 "..\..\..\pjlib\include\pj\compat\cc_gcce.h"\ 7044 "..\..\..\pjlib\include\pj\compat\cc_msvc.h"\ 7045 "..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\ 7046 "..\..\..\pjlib\include\pj\compat\ctype.h"\ 7047 "..\..\..\pjlib\include\pj\compat\errno.h"\ 7048 "..\..\..\pjlib\include\pj\compat\high_precision.h"\ 7049 "..\..\..\pjlib\include\pj\compat\m_auto.h"\ 7050 "..\..\..\pjlib\include\pj\compat\os_auto.h"\ 7051 "..\..\..\pjlib\include\pj\compat\os_darwinos.h"\ 7052 "..\..\..\pjlib\include\pj\compat\os_linux.h"\ 7053 "..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\ 7054 "..\..\..\pjlib\include\pj\compat\os_palmos.h"\ 7055 "..\..\..\pjlib\include\pj\compat\os_rtems.h"\ 7056 "..\..\..\pjlib\include\pj\compat\os_sunos.h"\ 7057 "..\..\..\pjlib\include\pj\compat\os_symbian.h"\ 7058 "..\..\..\pjlib\include\pj\compat\os_win32.h"\ 7059 "..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\ 7060 "..\..\..\pjlib\include\pj\compat\setjmp.h"\ 7061 "..\..\..\pjlib\include\pj\compat\size_t.h"\ 7062 "..\..\..\pjlib\include\pj\compat\stdarg.h"\ 7063 "..\..\..\pjlib\include\pj\compat\string.h"\ 7064 "..\..\..\pjlib\include\pj\config.h"\ 7065 "..\..\..\pjlib\include\pj\config_site.h"\ 7066 "..\..\..\pjlib\include\pj\config_site_sample.h"\ 7067 "..\..\..\pjlib\include\pj\ctype.h"\ 7068 "..\..\..\pjlib\include\pj\errno.h"\ 7069 "..\..\..\pjlib\include\pj\except.h"\ 7070 "..\..\..\pjlib\include\pj\fifobuf.h"\ 7071 "..\..\..\pjlib\include\pj\file_access.h"\ 7072 "..\..\..\pjlib\include\pj\file_io.h"\ 7073 "..\..\..\pjlib\include\pj\guid.h"\ 7074 "..\..\..\pjlib\include\pj\hash.h"\ 7075 "..\..\..\pjlib\include\pj\ioqueue.h"\ 7076 "..\..\..\pjlib\include\pj\ip_helper.h"\ 7077 "..\..\..\pjlib\include\pj\list.h"\ 7078 "..\..\..\pjlib\include\pj\list_i.h"\ 7079 "..\..\..\pjlib\include\pj\lock.h"\ 7080 "..\..\..\pjlib\include\pj\log.h"\ 7081 "..\..\..\pjlib\include\pj\math.h"\ 6244 7082 "..\..\..\pjlib\include\pj\os.h"\ 6245 7083 "..\..\..\pjlib\include\pj\pool.h"\ … … 6927 7765 "..\..\..\pjlib-util\include\pjlib-util\srv_resolver.h"\ 6928 7766 "..\..\..\pjlib-util\include\pjlib-util\types.h"\ 7767 "..\..\..\pjlib\include\pj\activesock.h"\ 6929 7768 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 6930 7769 "..\..\..\pjlib\include\pj\array.h"\ … … 6972 7811 "..\..\..\pjlib\include\pj\lock.h"\ 6973 7812 "..\..\..\pjlib\include\pj\log.h"\ 7813 "..\..\..\pjlib\include\pj\math.h"\ 6974 7814 "..\..\..\pjlib\include\pj\os.h"\ 6975 7815 "..\..\..\pjlib\include\pj\pool.h"\ … … 7719 8559 "..\..\..\pjlib-util\include\pjlib-util\resolver.h"\ 7720 8560 "..\..\..\pjlib-util\include\pjlib-util\types.h"\ 8561 "..\..\..\pjlib\include\pj\activesock.h"\ 7721 8562 "..\..\..\pjlib\include\pj\addr_resolv.h"\ 7722 8563 "..\..\..\pjlib\include\pj\array.h"\ … … 7764 8605 "..\..\..\pjlib\include\pj\lock.h"\ 7765 8606 "..\..\..\pjlib\include\pj\log.h"\ 8607 "..\..\..\pjlib\include\pj\math.h"\ 7766 8608 "..\..\..\pjlib\include\pj\os.h"\ 7767 8609 "..\..\..\pjlib\include\pj\pool.h"\ -
pjproject/trunk/pjnath/include/pjnath.h
r1913 r1988 27 27 #include <pjnath/stun_msg.h> 28 28 #include <pjnath/stun_session.h> 29 #include <pjnath/stun_sock.h> 29 30 #include <pjnath/stun_transaction.h> 30 31 #include <pjnath/turn_session.h> -
pjproject/trunk/pjnath/include/pjnath/config.h
r1654 r1988 143 143 144 144 /* ************************************************************************** 145 * STUN TRANSPORT CONFIGURATION 146 */ 147 148 /** 149 * The packet buffer size for the STUN transport. 150 */ 151 #ifndef PJ_STUN_SOCK_PKT_LEN 152 # define PJ_STUN_SOCK_PKT_LEN 2000 153 #endif 154 155 156 /** 157 * The duration of the STUN keep-alive period, in seconds. 158 */ 159 #ifndef PJ_STUN_KEEP_ALIVE_SEC 160 # define PJ_STUN_KEEP_ALIVE_SEC 15 161 #endif 162 163 164 /* ************************************************************************** 165 * TURN CONFIGURATION 166 */ 167 168 /** 169 * Maximum DNS SRV entries to be processed in the DNS SRV response 170 */ 171 #ifndef PJ_TURN_MAX_DNS_SRV_CNT 172 # define PJ_TURN_MAX_DNS_SRV_CNT 4 173 #endif 174 175 176 /** 177 * Maximum TURN packet size to be supported. 178 */ 179 #ifndef PJ_TURN_MAX_PKT_LEN 180 # define PJ_TURN_MAX_PKT_LEN 3000 181 #endif 182 183 184 /** 185 * The TURN permission lifetime setting. This value should be taken from the 186 * TURN protocol specification. 187 */ 188 #ifndef PJ_TURN_PERM_TIMEOUT 189 # define PJ_TURN_PERM_TIMEOUT 300 190 #endif 191 192 193 /** 194 * The TURN channel binding lifetime. This value should be taken from the 195 * TURN protocol specification. 196 */ 197 #ifndef PJ_TURN_CHANNEL_TIMEOUT 198 # define PJ_TURN_CHANNEL_TIMEOUT 600 199 #endif 200 201 202 /** 203 * Number of seconds to refresh the permission/channel binding before the 204 * permission/channel binding expires. This value should be greater than 205 * PJ_TURN_PERM_TIMEOUT setting. 206 */ 207 #ifndef PJ_TURN_REFRESH_SEC_BEFORE 208 # define PJ_TURN_REFRESH_SEC_BEFORE 60 209 #endif 210 211 212 /** 213 * The TURN session timer heart beat interval. When this timer occurs, the 214 * TURN session will scan all the permissions/channel bindings to see which 215 * need to be refreshed. 216 */ 217 #ifndef PJ_TURN_KEEP_ALIVE_SEC 218 # define PJ_TURN_KEEP_ALIVE_SEC 15 219 #endif 220 221 222 /* ************************************************************************** 145 223 * ICE CONFIGURATION 146 224 */ -
pjproject/trunk/pjnath/include/pjnath/errno.h
r1862 r1988 122 122 123 123 124 /************************************************************ 125 * STUN SESSION/TRANSPORT ERROR CODES 126 ***********************************************************/ 127 /** 128 * @hideinitializer 129 * STUN object has been destoyed. 130 */ 131 #define PJNATH_ESTUNDESTROYED (PJNATH_ERRNO_START+60) /* 370060 */ 132 124 133 125 134 /************************************************************ -
pjproject/trunk/pjnath/include/pjnath/ice_session.h
r1654 r1988 130 130 131 131 /** 132 * Forward declaration for checklist. 133 */ 134 typedef struct pj_ice_sess_checklist pj_ice_sess_checklist; 135 136 /** 132 137 * This enumeration describes the type of an ICE candidate. 133 138 */ … … 192 197 193 198 } pj_ice_sess_comp; 199 200 201 /** 202 * Data structure to be attached to internal message processing. 203 */ 204 typedef struct pj_ice_msg_data 205 { 206 unsigned transport_id; 207 pj_bool_t has_req_data; 208 209 union data { 210 struct request_data { 211 pj_ice_sess *ice; 212 pj_ice_sess_checklist *clist; 213 unsigned ckid; 214 } req; 215 } data; 216 } pj_ice_msg_data; 194 217 195 218 … … 205 228 { 206 229 /** 230 * The candidate type, as described in #pj_ice_cand_type enumeration. 231 */ 232 pj_ice_cand_type type; 233 234 /** 235 * Status of this candidate. The value will be PJ_SUCCESS if candidate 236 * address has been resolved successfully, PJ_EPENDING when the address 237 * resolution process is in progress, or other value when the address 238 * resolution has completed with failure. 239 */ 240 pj_status_t status; 241 242 /** 207 243 * The component ID of this candidate. Note that component IDs starts 208 244 * with one for RTP and two for RTCP. In other words, it's not zero 209 245 * based. 210 246 */ 211 pj_uint32_t comp_id; 212 213 /** 214 * The candidate type, as described in #pj_ice_cand_type enumeration. 215 */ 216 pj_ice_cand_type type; 247 pj_uint8_t comp_id; 248 249 /** 250 * Transport ID to be used to send packets for this candidate. 251 */ 252 pj_uint8_t transport_id; 253 254 /** 255 * Local preference value, which typically is 65535. 256 */ 257 pj_uint16_t local_pref; 217 258 218 259 /** … … 384 425 * candidate pairs that an agent will use to generate checks. 385 426 */ 386 typedefstruct pj_ice_sess_checklist427 struct pj_ice_sess_checklist 387 428 { 388 429 /** … … 406 447 pj_timer_entry timer; 407 448 408 } pj_ice_sess_checklist;449 }; 409 450 410 451 … … 431 472 * @param ice The ICE session. 432 473 * @param comp_id ICE component ID. 474 * @param transport_id Transport ID. 433 475 * @param pkt The STUN packet. 434 476 * @param size The size of the packet. … … 437 479 */ 438 480 pj_status_t (*on_tx_pkt)(pj_ice_sess *ice, unsigned comp_id, 481 unsigned transport_id, 439 482 const void *pkt, pj_size_t size, 440 483 const pj_sockaddr_t *dst_addr, … … 447 490 * @param ice The ICE session. 448 491 * @param comp_id ICE component ID. 492 * @param transport_id Transport ID. 449 493 * @param pkt The whole packet. 450 494 * @param size Size of the packet. … … 454 498 */ 455 499 void (*on_rx_data)(pj_ice_sess *ice, unsigned comp_id, 500 unsigned transport_id, 456 501 void *pkt, pj_size_t size, 457 502 const pj_sockaddr_t *src_addr, … … 497 542 498 543 unsigned comp_id; /**< Component ID. */ 544 unsigned transport_id; /**< Transport ID. */ 499 545 500 546 pj_sockaddr src_addr; /**< Source address of request */ … … 553 599 unsigned rcand_cnt; /**< # of remote cand. */ 554 600 pj_ice_sess_cand rcand[PJ_ICE_MAX_CAND]; /**< Array of cand. */ 601 602 /* Array of transport datas */ 603 pj_ice_msg_data tp_data[4]; 555 604 556 605 /* List of eearly checks */ … … 580 629 */ 581 630 PJ_DECL(const char*) pj_ice_get_cand_type_name(pj_ice_cand_type type); 631 632 633 /** 634 * This is a utility function to retrieve the string name for the 635 * particular role type. 636 * 637 * @param role Role type. 638 * 639 * @return The string representation of the role. 640 */ 641 PJ_DECL(const char*) pj_ice_sess_role_name(pj_ice_sess_role role); 582 642 583 643 … … 686 746 * @param ice ICE session instance. 687 747 * @param comp_id Component ID of this candidate. 748 * @param transport_id Transport ID to be used to send packets for this 749 * candidate. 688 750 * @param type Candidate type. 689 751 * @param local_pref Local preference for this candidate, which … … 700 762 PJ_DECL(pj_status_t) pj_ice_sess_add_cand(pj_ice_sess *ice, 701 763 unsigned comp_id, 764 unsigned transport_id, 702 765 pj_ice_cand_type type, 703 766 pj_uint16_t local_pref, … … 798 861 * @param ice The ICE session. 799 862 * @param comp_id Component ID. 863 * @param transport_id Number to identify where this packet was received 864 * from. This parameter will be returned back to 865 * application in \a on_tx_pkt() callback. 800 866 * @param pkt Incoming packet. 801 867 * @param pkt_size Size of incoming packet. … … 807 873 PJ_DECL(pj_status_t) pj_ice_sess_on_rx_pkt(pj_ice_sess *ice, 808 874 unsigned comp_id, 875 unsigned transport_id, 809 876 void *pkt, 810 877 pj_size_t pkt_size, -
pjproject/trunk/pjnath/include/pjnath/ice_strans.h
r1487 r1988 26 26 */ 27 27 #include <pjnath/ice_session.h> 28 #include <pjnath/stun_sock.h> 29 #include <pjnath/turn_sock.h> 28 30 #include <pjlib-util/resolver.h> 29 31 #include <pj/ioqueue.h> … … 45 47 * 46 48 * ICE stream transport, as represented by #pj_ice_strans structure, is an ICE 47 * capable c omponentfor transporting media streams within a media session.49 * capable class for transporting media streams within a media session. 48 50 * It consists of one or more transport sockets (typically two for RTP 49 51 * based communication - one for RTP and one for RTCP), and an … … 51 53 * various candidates of the transport addresses. 52 54 * 53 * \section PJNATH_ICE_STREAM_TRANSPORT_USING Using the ICE Stream Transport54 *55 * Application may use the ICE stream transport in two ways:56 * - it can create the ICE stream transports once during application57 * initialization and keep them alive throughout application lifetime, or58 * - it can create and destroy the ICE stream transport as needed everytime59 * a call is made and destroyed.60 *61 * Keeping the ICE stream transport alive throughout62 * application's lifetime is normally preferable, as initializing the63 * ICE stream transport may incur delay because the ICE stream transport64 * would need to communicate with the STUN/TURN server to get the65 * server reflexive and relayed candidates for the transports.66 *67 * Regardless of which usage scenario is being used, the ICE stream68 * transport is capable for restarting the ICE session being used and to69 * send STUN keep-alives for its STUN server reflexive and relayed70 * candidates. When ICE stream transport detects that the STUN mapped71 * address has changed in the keep-alive response, it will automatically72 * update its address to the new address, and notify the application via73 * \a on_addr_change() function of the #pj_ice_strans_cb callback.74 *75 * \subsection PJNATH_ICE_ST_TRA_INIT Initialization76 *77 * Application creates the ICE stream transport by calling78 * #pj_ice_strans_create() function. Among other things, application needs79 * to specify:80 * - STUN configuration (pj_stun_config), containing STUN settings81 * such as timeout values and the instances of timer heap and82 * ioqueue.83 * - Session name, useful for identifying this session in the log.84 * - Number of ICE components.85 * - Arbitrary user data, useful when associating the ICE session86 * with some application's data structure.87 * - A callback (#pj_ice_strans_cb) to receive events from the ICE88 * stream transport. Two of the most important fields in this89 * callback structure are \a on_rx_data() to notify application90 * about incoming data (perhaps RTP or RTCP packet), and91 * \a on_ice_complete() to notify application that ICE negotiation92 * has completed, either successfully or with failure.93 *94 * After the ICE stream transport is created, application may set up the95 * STUN servers to be used to obtain STUN server reflexive and relayed96 * candidate, by calling #pj_ice_strans_set_stun_domain() or97 * #pj_ice_strans_set_stun_srv().98 *99 * Application then creates each component by calling100 * #pj_ice_strans_create_comp(); this would create an actual socket101 * which listens to the specified local address, and it would also102 * perform lookup to find various transport address candidates for this103 * socket.104 *105 * Adding component may involve contacting STUN and TURN servers to get106 * STUN mapped address and allocate TURN relay channel, and this process107 * may take some time to complete. Once application has added all108 * components, it can check whether server reflexive and relayed109 * candidates have been acquired, by calling #pj_ice_strans_get_comps_status().110 *111 * \subsection PJNATH_ICE_ST_TRA_INIT_ICE Starting ICE Session112 *113 * When application is about to send an offer containing ICE capability,114 * or when it receives an offer containing ICE capability, it would115 * create the ICE session by calling #pj_ice_strans_init_ice(). This would116 * register all transport address aliases for each component to the ICE117 * session as candidates. After this application can enumerate all local118 * candidates by calling #pj_ice_strans_enum_cands(), and encode these119 * candidates in the SDP to be sent to remote agent.120 *121 * \subsection PJNATH_ICE_ST_TRA_START Starting Connectivity Checks122 *123 * Once application receives the SDP from remote, it pairs local candidates124 * with remote candidates, and can start ICE connectivity checks. This is125 * done by calling #pj_ice_strans_start_ice(), specifying126 * the remote candidate list, and remote username and password. If the127 * pairing process is successful, ICE connectivity checks will begin128 * immediately. The ICE session/transport will then notify the application129 * via the callback when ICE connectivity checks completes, either130 * successfully or with failure.131 *132 * \subsection PJNATH_ICE_ST_TRA_SEND_RECV Sending and Receiving Data133 *134 * Application can send data (normally RTP or RTCP packets) at any time135 * by calling #pj_ice_strans_sendto(). This function takes a destination136 * address as one of the arguments, and this destination address should137 * be taken from the default transport address of the component (that is138 * the address in SDP c= and m= lines, or in a=rtcp attribute).139 * If ICE negotiation is in progress, this function will send the data140 * to the destination address. Otherwise if ICE negotiation has completed141 * successfully, this function will send the data to the nominated remote142 * address, as negotiated by ICE.143 *144 * Upon receiving incoming data (that is a non-STUN message), the ICE145 * stream transport will notify the application by calling \a on_rx_data()146 * of the #pj_ice_strans_cb callback.147 *148 * \subsection PJNATH_ICE_ST_TRA_STOP Stopping ICE Session149 *150 * Once the call is terminated, application no longer needs to keep the151 * ICE session, so it should call #pj_ice_strans_stop_ice() to destroy the152 * ICE session within this ICE stream transport. Note that this WILL NOT153 * destroy the sockets/transports, it only destroys the ICE session154 * within this ICE stream transport. It is recommended that application155 * retains the ICE stream transport to speed up the process of setting up156 * the next call. The ICE stream transport will continue to send STUN157 * keep-alive packets to keep the NAT binding open and to detect change158 * in STUN mapped address.159 *160 * \subsection PJNATH_ICE_ST_TRA_RESTART Restarting ICE Session161 *162 * When a new call is made, application can repeat the above163 * #pj_ice_strans_init_ice() to #pj_ice_strans_stop_ice() cycle for164 * the new call, using this same ICE stream transport.165 *166 * \subsection PJNATH_ICE_ST_TRA_DESTROY Destroying ICE Stream Transport167 *168 * Finally, when the ICE stream transport itself is no longer needed,169 * for example when the application quits, application should call170 * #pj_ice_strans_destroy() to release back all resources allocated by this171 * ICE stream transport.172 *173 55 */ 174 56 175 57 /** Forward declaration for ICE stream transport. */ 176 58 typedef struct pj_ice_strans pj_ice_strans; 59 60 /** Transport operation types to be reported on \a on_status() callback */ 61 typedef enum pj_ice_strans_op 62 { 63 /** Initialization (candidate gathering) */ 64 PJ_ICE_STRANS_OP_INIT, 65 66 /** Negotiation */ 67 PJ_ICE_STRANS_OP_NEGOTIATION 68 69 } pj_ice_strans_op; 177 70 178 71 /** … … 201 94 202 95 /** 203 * This callback will be called when ICE checks have completed. 204 * This callback is optional. 96 * Callback to report status. 205 97 * 206 98 * @param ice_st The ICE stream transport. 207 * @param status The ICE connectivity check status. 99 * @param op The operation 100 * @param status Operation status. 208 101 */ 209 102 void (*on_ice_complete)(pj_ice_strans *ice_st, 103 pj_ice_strans_op op, 210 104 pj_status_t status); 211 105 212 /** 213 * This callback will be called when ICE transport has detected that 214 * the STUN mapped address of a candidate has changed. 106 } pj_ice_strans_cb; 107 108 109 /** 110 * This structure describes ICE stream transport configuration. Application 111 * should initialize the structure by calling #pj_ice_strans_cfg_default() 112 * before changing the settings. 113 */ 114 typedef struct pj_ice_strans_cfg 115 { 116 /** 117 * Address family, IPv4 or IPv6. Currently only pj_AF_INET() (IPv4) 118 * is supported, and this is the default value. 119 */ 120 int af; 121 122 /** 123 * STUN configuration which contains the timer heap and 124 * ioqueue instance to be used, and STUN retransmission 125 * settings. This setting is mandatory. 215 126 * 216 * @param ice_st The ICE stream transport. 217 * @param comp_id Component ID. 218 * @param cand_id Candidate ID. 219 */ 220 void (*on_addr_change)(pj_ice_strans *ice_st, 221 unsigned comp_id, 222 unsigned cand_id); 223 224 } pj_ice_strans_cb; 225 226 227 /** 228 * Various flags that can be specified when creating a component with 229 * #pj_ice_strans_create_comp(). These options may be combined together 230 * with bitmask operation. 231 */ 232 enum pj_ice_strans_option 233 { 234 /** 235 * If this option is specified, only a listening socket will be 236 * created for the component, and no candidate will be added to 237 * the component. Application must add the component manually 238 * by inspecting the socket and transport address of the component. 239 */ 240 PJ_ICE_ST_OPT_DONT_ADD_CAND = 1, 241 242 /** 243 * If this option is specified, then no STUN reflexive candidate 244 * will be added to the component. 245 */ 246 PJ_ICE_ST_OPT_DISABLE_STUN = 2, 247 248 /** 249 * If this option is specified, then no STUN relay candidate 250 * will be added to the component. 251 */ 252 PJ_ICE_ST_OPT_DISABLE_RELAY = 4, 253 254 /** 255 * If this option is specified, then when the function fails to 256 * bind the socket to the specified port, it WILL NOT try to 257 * bind the socket to the next available port. 127 * The default value is all zero. Application must initialize 128 * this setting with #pj_stun_config_init(). 129 */ 130 pj_stun_config stun_cfg; 131 132 /** 133 * DNS resolver to be used to resolve servers. If DNS SRV 134 * resolution is required, the resolver must be set. 258 135 * 259 * If this option is NOT specified, then the function will try to 260 * bind the socket to next port+2, repetitively until the socket 261 * is bound successfully. 262 */ 263 PJ_ICE_ST_OPT_NO_PORT_RETRY = 8, 264 }; 265 266 267 /** 268 * This structure describes ICE stream transport candidate. A "candidate" 269 * in ICE stream transport can be viewed as alias transport address 270 * for the socket. 271 */ 272 typedef struct pj_ice_strans_cand 273 { 274 /** 275 * Candidate type. 276 */ 277 pj_ice_cand_type type; 278 279 /** 280 * Status of this candidate. This status is useful for ICE reflexive 281 * and relay candidate, where the address needs to be resolved 282 * asynchronously by sending STUN request to STUN server. 283 * 284 * The value will be PJ_SUCCESS if candidate address has been resolved 285 * successfully, PJ_EPENDING when the address resolution process is 286 * in progress, or other value when the address resolution has 287 * completed with failure. 288 */ 289 pj_status_t status; 290 291 /** 292 * The candidate transport address. 293 */ 294 pj_sockaddr addr; 295 296 /** 297 * The ICE session candidate ID after this candidate has been registered 298 * to an ICE session. Before ICE session is created, or after ICE 299 * session has been destroyed, the value will be -1. 300 */ 301 int ice_cand_id; 302 303 /** 304 * Local preference value, which typically is 65535. 305 */ 306 pj_uint16_t local_pref; 307 308 /** 309 * Foundation associated with this candidate, which value normally will be 310 * calculated by the function. 311 */ 312 pj_str_t foundation; 313 314 } pj_ice_strans_cand; 315 316 317 /** 318 * This structure describes an ICE stream transport component. A component 319 * in ICE stream transport typically corresponds to a single socket created 320 * for this component, and bound to a specific transport address. This 321 * component may have multiple alias addresses, for example one alias 322 * address for each interfaces in multi-homed host, another for server 323 * reflexive alias, and another for relayed alias. For each transport 324 * address alias, an ICE stream transport candidate (#pj_ice_strans_cand) will 325 * be created, and these candidates will eventually registered to the ICE 326 * session. 327 */ 328 typedef struct pj_ice_strans_comp 329 { 330 pj_ice_strans *ice_st; /**< ICE stream transport. */ 331 unsigned comp_id; /**< Component ID. */ 332 pj_uint32_t options; /**< Option flags. */ 333 pj_sock_t sock; /**< Socket descriptor. */ 334 335 pj_stun_session *stun_sess; /**< STUN session. */ 336 pj_uint8_t ka_tsx_id[12]; /**< ID for keep STUN alives */ 337 338 pj_sockaddr local_addr; /**< Local/base address. */ 339 340 unsigned pending_cnt; /**< Pending resolution cnt. */ 341 pj_status_t last_status; /**< Last status. */ 342 343 unsigned cand_cnt; /**< # of candidates/aliaes. */ 344 pj_ice_strans_cand cand_list[PJ_ICE_ST_MAX_CAND]; /**< Cand array */ 345 int default_cand; /**< Default candidate selected */ 346 347 pj_ioqueue_key_t *key; /**< ioqueue key. */ 348 pj_uint8_t pkt[1500]; /**< Incoming packet buffer. */ 349 pj_ioqueue_op_key_t read_op; /**< ioqueue read operation key */ 350 pj_ioqueue_op_key_t write_op; /**< ioqueue write op. key */ 351 pj_sockaddr src_addr; /**< source packet address buf. */ 352 int src_addr_len; /**< length of src addr. buf. */ 353 354 } pj_ice_strans_comp; 355 356 357 /** 358 * This structure represents the ICE stream transport. 359 */ 360 struct pj_ice_strans 361 { 362 char obj_name[PJ_MAX_OBJ_NAME]; /**< Log ID. */ 363 364 pj_pool_t *pool; /**< Pool used by this object. */ 365 void *user_data; /**< Application data. */ 366 pj_stun_config stun_cfg; /**< STUN settings. */ 367 pj_ice_strans_cb cb; /**< Application callback. */ 368 369 pj_ice_sess *ice; /**< ICE session. */ 370 371 unsigned comp_cnt; /**< Number of components. */ 372 pj_ice_strans_comp **comp; /**< Components array. */ 373 374 pj_dns_resolver *resolver; /**< The resolver instance. */ 375 pj_bool_t has_rjob; /**< Has pending resolve? */ 376 pj_sockaddr_in stun_srv; /**< STUN server address. */ 377 pj_sockaddr_in turn_srv; /**< TURN server address. */ 378 379 pj_timer_entry ka_timer; /**< STUN keep-alive timer. */ 380 }; 381 382 383 /** 384 * Create the ICE stream transport containing the specified number of 385 * components. After the ICE stream transport is created, application 386 * may initialize the STUN server settings, and after that it has to 387 * initialize each components by calling #pj_ice_strans_create_comp() 388 * function. 389 * 390 * @param stun_cfg The STUN settings. 136 * The default value is NULL. 137 */ 138 pj_dns_resolver *resolver; 139 140 /** 141 * STUN and local transport settings. This specifies the 142 * settings for local UDP socket, which will be resolved 143 * to get the STUN mapped address. 144 */ 145 struct { 146 /** 147 * Optional configuration for STUN transport. The default 148 * value will be initialized with #pj_stun_sock_cfg_default(). 149 */ 150 pj_stun_sock_cfg cfg; 151 152 /** 153 * Disable host candidates. When this option is set, no 154 * host candidates will be added. 155 * 156 * Default: PJ_FALSE 157 */ 158 pj_bool_t no_host_cands; 159 160 /** 161 * Include loopback addresses in the host candidates. 162 * 163 * Default: PJ_FALSE 164 */ 165 pj_bool_t loop_addr; 166 167 /** 168 * Specify the STUN server domain or hostname or IP address. 169 * If DNS SRV resolution is required, application must fill 170 * in this setting with the domain name of the STUN server 171 * and set the resolver instance in the \a resolver field. 172 * Otherwise if the \a resolver setting is not set, this 173 * field will be resolved with hostname resolution and in 174 * this case the \a port field must be set. 175 * 176 * The \a port field should also be set even when DNS SRV 177 * resolution is used, in case the DNS SRV resolution fails. 178 * 179 * When this field is empty, STUN mapped address resolution 180 * will not be performed. In this case only ICE host candidates 181 * will be added to the ICE transport, unless if \a no_host_cands 182 * field is set. In this case, both host and srflx candidates 183 * are disabled. 184 * 185 * The default value is empty. 186 */ 187 pj_str_t server; 188 189 /** 190 * The port number of the STUN server, when \a server 191 * field specifies a hostname rather than domain name. This 192 * field should also be set even when the \a server 193 * specifies a domain name, to allow DNS SRV resolution 194 * to fallback to DNS A/AAAA resolution when the DNS SRV 195 * resolution fails. 196 * 197 * The default value is PJ_STUN_PORT. 198 */ 199 pj_uint16_t port; 200 201 } stun; 202 203 /** 204 * TURN specific settings. 205 */ 206 struct { 207 /** 208 * Specify the TURN server domain or hostname or IP address. 209 * If DNS SRV resolution is required, application must fill 210 * in this setting with the domain name of the TURN server 211 * and set the resolver instance in the \a resolver field. 212 * Otherwise if the \a resolver setting is not set, this 213 * field will be resolved with hostname resolution and in 214 * this case the \a port field must be set. 215 * 216 * The \a port field should also be set even when DNS SRV 217 * resolution is used, in case the DNS SRV resolution fails. 218 * 219 * When this field is empty, relay candidate will not be 220 * created. 221 * 222 * The default value is empty. 223 */ 224 pj_str_t server; 225 226 /** 227 * The port number of the TURN server, when \a server 228 * field specifies a hostname rather than domain name. This 229 * field should also be set even when the \a server 230 * specifies a domain name, to allow DNS SRV resolution 231 * to fallback to DNS A/AAAA resolution when the DNS SRV 232 * resolution fails. 233 * 234 * Default is zero. 235 */ 236 pj_uint16_t port; 237 238 /** 239 * Type of connection to the TURN server. 240 * 241 * Default is PJ_TURN_TP_UDP. 242 */ 243 pj_turn_tp_type conn_type; 244 245 /** 246 * Credential to be used for the TURN session. This setting 247 * is mandatory. 248 * 249 * Default is to have no credential. 250 */ 251 pj_stun_auth_cred auth_cred; 252 253 /** 254 * Optional TURN Allocate parameter. The default value will be 255 * initialized by #pj_turn_alloc_param_default(). 256 */ 257 pj_turn_alloc_param alloc_param; 258 259 } turn; 260 261 } pj_ice_strans_cfg; 262 263 264 /** 265 * Initialize ICE transport configuration with default values. 266 * 267 * @param cfg The configuration to be initialized. 268 */ 269 PJ_DECL(void) pj_ice_strans_cfg_default(pj_ice_strans_cfg *cfg); 270 271 272 /** 273 * Copy configuration. 274 * 275 * @param pool Pool. 276 * @param dst Destination. 277 * @param src Source. 278 */ 279 PJ_DECL(void) pj_ice_strans_cfg_copy(pj_pool_t *pool, 280 pj_ice_strans_cfg *dst, 281 const pj_ice_strans_cfg *src); 282 283 284 /** 285 * Create and initialize the ICE stream transport with the specified 286 * parameters. 287 * 391 288 * @param name Optional name for logging identification. 289 * @param cfg Configuration. 392 290 * @param comp_cnt Number of components. 393 291 * @param user_data Arbitrary user data to be associated with this … … 400 298 * successfully. 401 299 */ 402 PJ_DECL(pj_status_t) pj_ice_strans_create( pj_stun_config *stun_cfg,403 const char *name,300 PJ_DECL(pj_status_t) pj_ice_strans_create(const char *name, 301 const pj_ice_strans_cfg *cfg, 404 302 unsigned comp_cnt, 405 303 void *user_data, … … 420 318 421 319 /** 422 * Set the domain to be used when resolving the STUN servers. If application 423 * wants to utillize STUN, then STUN server must be specified, either by 424 * calling this function or by calling #pj_ice_strans_set_stun_srv(). 425 * 426 * If application calls this function, then the STUN/TURN servers will 427 * be resolved by querying DNS SRV records for the specified domain. 428 * 429 * @param ice_st The ICE stream transport. 430 * @param resolver The resolver instance that will be used to 431 * resolve the STUN/TURN servers. 432 * @param domain The target domain. 433 * 434 * @return PJ_SUCCESS if DNS SRV resolution job can be 435 * started. The resolution process itself will 436 * complete asynchronously. 437 */ 438 PJ_DECL(pj_status_t) pj_ice_strans_set_stun_domain(pj_ice_strans *ice_st, 439 pj_dns_resolver *resolver, 440 const pj_str_t *domain); 441 442 /** 443 * Set the STUN and TURN server addresses. If application 444 * wants to utillize STUN, then STUN server must be specified, either by 445 * calling this function or by calling #pj_ice_strans_set_stun_domain(). 446 * 447 * With this function, the STUN and TURN server addresses will be 448 * assigned immediately, that is no DNS resolution will need to be 449 * performed. 450 * 451 * @param ice_st The ICE stream transport. 452 * @param stun_srv The STUN server address, or NULL if STUN 453 * reflexive candidate is not to be used. 454 * @param turn_srv The TURN server address, or NULL if STUN 455 * relay candidate is not to be used. 456 * 457 * @return PJ_SUCCESS, or the appropriate error code. 458 */ 459 PJ_DECL(pj_status_t) 460 pj_ice_strans_set_stun_srv( pj_ice_strans *ice_st, 461 const pj_sockaddr_in *stun_srv, 462 const pj_sockaddr_in *turn_srv); 463 464 /** 465 * Create and initialize the specified component. This function will 466 * instantiate the socket descriptor for this component, optionally 467 * bind the socket to the specified address (or bind to any address/port 468 * if the \a addr parameter is NULL), and start finding all alias 469 * addresses for this socket. For each alias addresses that if finds, 470 * it will add an ICE stream transport candidate for this component. 471 * 472 * After all components have been initialized, application should poll 473 * the #pj_ice_strans_get_comps_status() peridically to check if STUN 474 * server reflexive and relayed candidates have been obtained 475 * successfully. 476 * 477 * @param ice_st The ICE stream transport. 478 * @param comp_id The component ID, which value must be greater than 479 * zero and less than or equal to the number of 480 * components in this ICE stream transport. 481 * @param options Options, see #pj_ice_strans_option. 482 * @param addr Local address where socket will be bound to. This 483 * address will be used as follows: 484 * - if the value is NULL, then socket will be bound 485 * to any available port. 486 * - if the value is not NULL, then if the port number 487 * is not zero, it will used as the starting port 488 * where the socket will be bound to. If bind() to 489 * this port fails, this function will try to bind 490 * to port+2, repeatedly until it succeeded. 491 * If application doesn't want this function to 492 * retry binding the socket to other port, it can 493 * specify PJ_ICE_ST_OPT_NO_PORT_RETRY option. 494 * - if the value is not NULL, then if the address 495 * is not INADDR_ANY, this function will bind the 496 * socket to this particular interface only, and 497 * no other host candidates will be added for this 498 * socket. 499 * 500 * 501 * @return PJ_SUCCESS, or the appropriate error code. 502 */ 503 PJ_DECL(pj_status_t) pj_ice_strans_create_comp(pj_ice_strans *ice_st, 504 unsigned comp_id, 505 pj_uint32_t options, 506 const pj_sockaddr_in *addr); 507 508 /** 509 * Manually add a candidate (transport address alias) for the specified 510 * component. Normally application shouldn't need to use this function, 511 * as candidates will be added automatically when component is created 512 * with #pj_ice_strans_create_comp(). 513 * 514 * @param ice_st ICE stream transport. 515 * @param comp_id The component ID. 516 * @param type The candidate type. 517 * @param local_pref The local preference for this candidate 518 * (typically the value is 65535). 519 * @param addr The candidate address. 520 * @param set_default Set to non-zero to make this candidate the 521 * default candidate for this component. 522 * 523 * @return PJ_SUCCESS, or the appropriate error code. 524 */ 525 PJ_DECL(pj_status_t) pj_ice_strans_add_cand(pj_ice_strans *ice_st, 526 unsigned comp_id, 527 pj_ice_cand_type type, 528 pj_uint16_t local_pref, 529 const pj_sockaddr_in *addr, 530 pj_bool_t set_default); 531 532 /** 533 * Get the status of components in the ICE stream transports. Since 534 * some IP address candidates have to be obtained asynchronously (for 535 * example, the STUN reflexive or relay candidate), application can 536 * use this function to know whether the address resolution has 537 * completed. 538 * 539 * @param ice_st The ICE stream transport. 540 * 541 * @return PJ_SUCCESS if all candidates have been resolved 542 * successfully, PJ_EPENDING if transport resolution 543 * is still in progress, or other status on failure. 544 */ 545 PJ_DECL(pj_status_t) pj_ice_strans_get_comps_status(pj_ice_strans *ice_st); 320 * Get the user data associated with the ICE stream transport. 321 * 322 * @param ice_st The ICE stream transport. 323 * 324 * @return The user data. 325 */ 326 PJ_DECL(void*) pj_ice_strans_get_user_data(pj_ice_strans *ice_st); 327 546 328 547 329 /** 548 330 * Initialize the ICE session in the ICE stream transport. 331 * When application is about to send an offer containing ICE capability, 332 * or when it receives an offer containing ICE capability, it must 333 * call this function to initialize the internal ICE session. This would 334 * register all transport address aliases for each component to the ICE 335 * session as candidates. Then application can enumerate all local 336 * candidates by calling #pj_ice_strans_enum_cands(), and encode these 337 * candidates in the SDP to be sent to remote agent. 549 338 * 550 339 * @param ice_st The ICE stream transport. … … 561 350 562 351 /** 563 * Enumerate the local candidates . This function can only be called564 * after the ICE session has been created in the ICE stream transport.565 * 566 * @param ice_st The ICE stream transport.352 * Enumerate the local candidates for the specified component. 353 * 354 * @param ice_st The ICE stream transport. 355 * @param comp_id Component ID. 567 356 * @param count On input, it specifies the maximum number of 568 357 * elements. On output, it will be filled with … … 574 363 */ 575 364 PJ_DECL(pj_status_t) pj_ice_strans_enum_cands(pj_ice_strans *ice_st, 365 unsigned comp_id, 576 366 unsigned *count, 577 367 pj_ice_sess_cand cand[]); 578 368 579 369 /** 370 * Get the default candidate for the specified component. When this 371 * function is called before ICE negotiation completes, the default 372 * candidate is selected according to local preference criteria. When 373 * this function is called after ICE negotiation completes, the 374 * default candidate is the candidate that forms the valid pair. 375 * 376 * @param ice_st The ICE stream transport. 377 * @param comp_id Component ID. 378 * @param cand Pointer to receive the default candidate 379 * information. 380 */ 381 PJ_DECL(pj_status_t) pj_ice_strans_get_def_cand(pj_ice_strans *ice_st, 382 unsigned comp_id, 383 pj_ice_sess_cand *cand); 384 385 /** 386 * Get the current ICE role. ICE session must have been initialized 387 * before this function can be called. 388 * 389 * @param ice_st The ICE stream transport. 390 * 391 * @return Current ICE role. 392 */ 393 PJ_DECL(pj_ice_sess_role) pj_ice_strans_get_role(pj_ice_strans *ice_st); 394 395 396 /** 397 * Change session role. This happens for example when ICE session was 398 * created with controlled role when receiving an offer, but it turns out 399 * that the offer contains "a=ice-lite" attribute when the SDP gets 400 * inspected. ICE session must have been initialized before this function 401 * can be called. 402 * 403 * @param ice_st The ICE stream transport. 404 * @param new_role The new role to be set. 405 * 406 * @return PJ_SUCCESS on success, or the appropriate error. 407 */ 408 PJ_DECL(pj_status_t) pj_ice_strans_change_role(pj_ice_strans *ice_st, 409 pj_ice_sess_role new_role); 410 411 412 /** 580 413 * Start ICE connectivity checks. This function can only be called 581 * after the ICE session has been created in the ICE stream transport. 582 * 583 * This function will pair the local and remote candidates to create 584 * check list. Once the check list is created and sorted based on the 585 * priority, ICE periodic checks will be started. This function will 586 * return immediately, and application will be notified about the 587 * connectivity check status in the callback. 414 * after the ICE session has been created in the ICE stream transport 415 * with #pj_ice_strans_init_ice(). 416 * 417 * This function must be called once application has received remote 418 * candidate list (typically from the remote SDP). This function pairs 419 * local candidates with remote candidates, and starts ICE connectivity 420 * checks. The ICE session/transport will then notify the application 421 * via the callback when ICE connectivity checks completes, either 422 * successfully or with failure. 588 423 * 589 424 * @param ice_st The ICE stream transport. … … 592 427 * @param rem_passwd Remote password, as seen in the SDP received from 593 428 * the remote agent. 594 * @param r em_cand_cnt Number of remote candidates.595 * @param r em_cand Remote candidatearray.429 * @param rcand_cnt Number of remote candidates in the array. 430 * @param rcand Remote candidates array. 596 431 * 597 432 * @return PJ_SUCCESS, or the appropriate error code. 598 433 */ 599 PJ_DECL(pj_status_t) 600 pj_ice_strans_start_ice( pj_ice_strans *ice_st, 601 const pj_str_t *rem_ufrag, 602 const pj_str_t *rem_passwd, 603 unsigned rem_cand_cnt, 604 const pj_ice_sess_cand rem_cand[]); 605 606 /** 607 * Stop and destroy the ICE session inside this media transport. 434 PJ_DECL(pj_status_t) pj_ice_strans_start_ice(pj_ice_strans *ice_st, 435 const pj_str_t *rem_ufrag, 436 const pj_str_t *rem_passwd, 437 unsigned rcand_cnt, 438 const pj_ice_sess_cand rcand[]); 439 440 /** 441 * Retrieve the candidate pair that has been nominated and successfully 442 * checked for the specified component. If ICE negotiation is still in 443 * progress or it has failed, this function will return NULL. 444 * 445 * @param ice_st The ICE stream transport. 446 * @param comp_id Component ID. 447 * 448 * @return The valid pair as ICE checklist structure if the 449 * pair exist. 450 */ 451 PJ_DECL(const pj_ice_sess_check*) 452 pj_ice_strans_get_valid_pair(const pj_ice_strans *ice_st, 453 unsigned comp_id); 454 455 /** 456 * Stop and destroy the ICE session inside this media transport. Application 457 * needs to call this function once the media session is over (the call has 458 * been disconnected). 459 * 460 * Application MAY reuse this ICE stream transport for subsequent calls. 461 * In this case, it must call #pj_ice_strans_stop_ice() when the call is 462 * disconnected, and reinitialize the ICE stream transport for subsequent 463 * call with #pj_ice_strans_init_ice()/#pj_ice_strans_start_ice(). In this 464 * case, the ICE stream transport will maintain the internal sockets and 465 * continue to send STUN keep-alive packets and TURN Refresh request to 466 * keep the NAT binding/TURN allocation open and to detect change in STUN 467 * mapped address. 468 * 469 * If application does not want to reuse the ICE stream transport for 470 * subsequent calls, it must call #pj_ice_strans_destroy() to destroy the 471 * ICE stream transport altogether. 608 472 * 609 473 * @param ice_st The ICE stream transport. … … 615 479 616 480 /** 617 * Send outgoing packet using this transport. If ICE checks have not 618 * produced a valid check for the specified component ID, this function 619 * send to the destination address. Otherwise it will send the packet to 620 * remote destination using the nominated local candidate as have been checked 621 * previously. 481 * Send outgoing packet using this transport. 482 * Application can send data (normally RTP or RTCP packets) at any time 483 * by calling this function. This function takes a destination 484 * address as one of the arguments, and this destination address should 485 * be taken from the default transport address of the component (that is 486 * the address in SDP c= and m= lines, or in a=rtcp attribute). 487 * If ICE negotiation is in progress, this function will send the data 488 * to the destination address. Otherwise if ICE negotiation has completed 489 * successfully, this function will send the data to the nominated remote 490 * address, as negotiated by ICE. 622 491 * 623 492 * @param ice_st The ICE stream transport. -
pjproject/trunk/pjnath/include/pjnath/nat_detect.h
r1501 r1988 33 33 * @defgroup PJNATH_NAT_DETECT NAT Classification/Detection Tool 34 34 * @brief NAT Classification/Detection Tool 35 * @ingroup PJNATH_ICE36 35 * @{ 37 36 * -
pjproject/trunk/pjnath/include/pjnath/stun_config.h
r1374 r1988 26 26 27 27 #include <pjnath/stun_msg.h> 28 #include <pj/assert.h> 29 #include <pj/errno.h> 28 30 #include <pj/string.h> 29 31 … … 104 106 105 107 /** 108 * Check that STUN config is valid. 109 */ 110 PJ_INLINE(pj_status_t) pj_stun_config_check_valid(const pj_stun_config *cfg) 111 { 112 PJ_ASSERT_RETURN(cfg->ioqueue && cfg->pf && cfg->timer_heap && 113 cfg->rto_msec && cfg->res_cache_msec, PJ_EINVAL); 114 return PJ_SUCCESS; 115 } 116 117 118 /** 106 119 * @} 107 120 */ -
pjproject/trunk/pjnath/include/pjnath/stun_msg.h
r1924 r1988 35 35 /** 36 36 * @defgroup PJNATH_STUN_MSG STUN Message Representation and Parsing 37 * @ingroup PJNATH_STUN 37 38 * @brief Low-level representation and parsing of STUN messages. 38 * @ingroup PJNATH_STUN39 39 * @{ 40 40 */ … … 956 956 * This describes the TURN REQUESTED-PROPS attribute, encoded as 957 957 * STUN 32bit integer attribute. Few macros are provided to manipulate 958 * the values in this attribute: #PJ_STUN_GET_RPP_BITS(), 959 * #PJ_STUN_SET_RPP_BITS(), #PJ_STUN_GET_RPP_PORT(), and 960 * #PJ_STUN_SET_RPP_PORT(). 958 * the values in this attribute: #PJ_STUN_GET_PROP_TYPE(), and 959 * #PJ_STUN_SET_PROP_TYPE(). 961 960 * 962 961 * This attribute allows the client to request certain properties for … … 1165 1164 * #pj_stun_msg_check() and #pj_stun_msg_decode() to disable the 1166 1165 * verification of FINGERPRINT, for example when the STUN usage says when 1167 * FINGERPRINT mechanism shall not *be used.1166 * FINGERPRINT mechanism shall not be used. 1168 1167 */ 1169 1168 PJ_STUN_NO_FINGERPRINT_CHECK = 8 … … 1293 1292 * 1294 1293 * If application wants to apply credential to the message, it MUST 1295 * include a blank MESSAGE-INTEGRITY attribute in the message ,as the1294 * include a blank MESSAGE-INTEGRITY attribute in the message as the 1296 1295 * last attribute or the attribute before FINGERPRINT. This function will 1297 1296 * calculate the HMAC digest from the message using the supplied key in … … 1321 1320 PJ_DECL(pj_status_t) pj_stun_msg_encode(pj_stun_msg *msg, 1322 1321 pj_uint8_t *pkt_buf, 1323 unsignedbuf_size,1322 pj_size_t buf_size, 1324 1323 unsigned options, 1325 1324 const pj_str_t *key, 1326 unsigned*p_msg_len);1325 pj_size_t *p_msg_len); 1327 1326 1328 1327 /** … … 1346 1345 */ 1347 1346 PJ_DECL(pj_status_t) pj_stun_msg_check(const pj_uint8_t *pdu, 1348 unsignedpdu_len, unsigned options);1347 pj_size_t pdu_len, unsigned options); 1349 1348 1350 1349 … … 1372 1371 PJ_DECL(pj_status_t) pj_stun_msg_decode(pj_pool_t *pool, 1373 1372 const pj_uint8_t *pdu, 1374 unsignedpdu_len,1373 pj_size_t pdu_len, 1375 1374 unsigned options, 1376 1375 pj_stun_msg **p_msg, 1377 unsigned*p_parsed_len,1376 pj_size_t *p_parsed_len, 1378 1377 pj_stun_msg **p_response); 1379 1378 -
pjproject/trunk/pjnath/include/pjnath/stun_session.h
r1913 r1988 214 214 struct pj_stun_tx_data 215 215 { 216 /** PJLIB list interface */ 216 217 PJ_DECL_LIST_MEMBER(struct pj_stun_tx_data); 217 218 … … 238 239 pj_timer_entry res_timer; /**< Response cache timer. */ 239 240 }; 241 242 243 /** 244 * These are the flags to control the message logging in the STUN session. 245 */ 246 typedef enum pj_stun_sess_msg_log_flag 247 { 248 PJ_STUN_SESS_LOG_TX_REQ=1, /**< Log outgoing STUN requests. */ 249 PJ_STUN_SESS_LOG_TX_RES=2, /**< Log outgoing STUN responses. */ 250 PJ_STUN_SESS_LOG_TX_IND=4, /**< Log outgoing STUN indications. */ 251 252 PJ_STUN_SESS_LOG_RX_REQ=8, /**< Log incoming STUN requests. */ 253 PJ_STUN_SESS_LOG_RX_RES=16, /**< Log incoming STUN responses */ 254 PJ_STUN_SESS_LOG_RX_IND=32 /**< Log incoming STUN indications */ 255 } pj_stun_sess_msg_log_flag; 240 256 241 257 … … 259 275 260 276 /** 261 * Destroy the STUN session. 262 * 263 * @param sess The STUN session instance. 264 * 265 * @return PJ_SUCCESS on success, or the appropriate error code. 277 * Destroy the STUN session and all objects created in the context of 278 * this session. 279 * 280 * @param sess The STUN session instance. 281 * 282 * @return PJ_SUCCESS on success, or the appropriate error code. 283 * This function will return PJ_EPENDING if the operation 284 * cannot be performed immediately because callbacks are 285 * being called; in this case the session will be destroyed 286 * as soon as the last callback returns. 266 287 */ 267 288 PJ_DECL(pj_status_t) pj_stun_session_destroy(pj_stun_session *sess); … … 334 355 pj_stun_auth_type auth_type, 335 356 const pj_stun_auth_cred *cred); 357 /** 358 * Configure message logging. By default all flags are enabled. 359 * 360 * @param sess The STUN session instance. 361 * @param flags Bitmask combination of #pj_stun_sess_msg_log_flag 362 */ 363 PJ_DECL(void) pj_stun_session_set_log(pj_stun_session *sess, 364 unsigned flags); 336 365 337 366 /** … … 382 411 * 383 412 * @param sess The STUN session instance. 384 * @param r eqThe STUN request where the response is to be created.413 * @param rdata The STUN request where the response is to be created. 385 414 * @param err_code Error code to be set in the response, if error response 386 415 * is to be created, according to pj_stun_status enumeration. … … 433 462 * 434 463 * @return PJ_SUCCESS on success, or the appropriate error code. 464 * This function will return PJNATH_ESTUNDESTROYED if 465 * application has destroyed the session in 466 * \a on_send_msg() callback. 435 467 */ 436 468 PJ_DECL(pj_status_t) pj_stun_session_send_msg(pj_stun_session *sess, … … 450 482 * @param sess The STUN session instance. 451 483 * @param rdata The STUN request message to be responded. 452 * @param err_codeError code to be set in the response, if error response484 * @param code Error code to be set in the response, if error response 453 485 * is to be created, according to pj_stun_status enumeration. 454 486 * This argument MUST be zero if successful response is … … 473 505 * 474 506 * @return PJ_SUCCESS on success, or the appropriate error code. 507 * This function will return PJNATH_ESTUNDESTROYED if 508 * application has destroyed the session in 509 * \a on_send_msg() callback. 475 510 */ 476 511 PJ_DECL(pj_status_t) pj_stun_session_respond(pj_stun_session *sess, … … 497 532 * 498 533 * @return PJ_SUCCESS if transaction is successfully cancelled. 534 * This function will return PJNATH_ESTUNDESTROYED if 535 * application has destroyed the session in 536 * \a on_request_complete() callback. 499 537 */ 500 538 PJ_DECL(pj_status_t) pj_stun_session_cancel_req(pj_stun_session *sess, … … 512 550 * 513 551 * @return PJ_SUCCESS on success, or the appropriate error. 552 * This function will return PJNATH_ESTUNDESTROYED if 553 * application has destroyed the session in \a on_send_msg() 554 * callback. 514 555 */ 515 556 PJ_DECL(pj_status_t) pj_stun_session_retransmit_req(pj_stun_session *sess, … … 549 590 * 550 591 * @return PJ_SUCCESS on success, or the appropriate error code. 592 * This function will return PJNATH_ESTUNDESTROYED if 593 * application has destroyed the session in one of the 594 * callback. 551 595 */ 552 596 PJ_DECL(pj_status_t) pj_stun_session_on_rx_pkt(pj_stun_session *sess, -
pjproject/trunk/pjnath/include/pjnath/stun_transaction.h
r1374 r1988 90 90 * 91 91 * @return If return value of the callback is not PJ_SUCCESS, 92 * the transaction will fail. 92 * the transaction will fail. Application MUST return 93 * PJNATH_ESTUNDESTROYED if it has destroyed the 94 * transaction in this callback. 93 95 */ 94 96 pj_status_t (*on_send_msg)(pj_stun_client_tsx *tsx, … … 162 164 * @param tsx The STUN transaction. 163 165 * 164 * @return PJ_SUCCESS on success, or the appropriate error code. 166 * @return PJ_SUCCESS on success or PJ_EINVAL if the parameter 167 * is NULL. 165 168 */ 166 169 PJ_DECL(pj_status_t) pj_stun_client_tsx_destroy(pj_stun_client_tsx *tsx); … … 215 218 * @param pkt_len Length of STUN packet. 216 219 * 217 * @return PJ_SUCCESS on success or the appropriate error code. 220 * @return PJ_SUCCESS on success, or PJNATH_ESTUNDESTROYED 221 * when the user has destroyed the transaction in 222 * \a on_send_msg() callback, or any other error code 223 * as returned by \a on_send_msg() callback. 218 224 */ 219 225 PJ_DECL(pj_status_t) pj_stun_client_tsx_send_msg(pj_stun_client_tsx *tsx, … … 229 235 * @param tsx The STUN client transaction instance. 230 236 * 231 * @return PJ_SUCCESS on success or the appropriate error code. 237 * @return PJ_SUCCESS on success, or PJNATH_ESTUNDESTROYED 238 * when the user has destroyed the transaction in 239 * \a on_send_msg() callback, or any other error code 240 * as returned by \a on_send_msg() callback. 232 241 */ 233 242 PJ_DECL(pj_status_t) pj_stun_client_tsx_retransmit(pj_stun_client_tsx *tsx); -
pjproject/trunk/pjnath/include/pjnath/turn_session.h
r1914 r1988 30 30 PJ_BEGIN_DECL 31 31 32 /** 33 * @defgroup PJNATH_TURN TURN Client Library 34 */ 35 36 32 37 /* **************************************************************************/ 33 38 /** 34 * @defgroup PJNATH_TURN_SESSION T URN client session39 * @defgroup PJNATH_TURN_SESSION Transport independent TURN client session 35 40 * @brief Transport independent TURN client session 36 * @ingroup PJNATH_ STUN41 * @ingroup PJNATH_TURN 37 42 * @{ 43 * 44 * This module describes the transport independent TURN client session. This 45 * interface is provided for implementors of a TURN client transport, and 46 * application usually will want to use \ref PJNATH_TURN_SOCK instead. 47 * 48 * The transport independent TURN client session is created to facilitate 49 * the creation of different types of transports between the client and the 50 * TURN server. 38 51 */ 39 52 … … 42 55 */ 43 56 typedef struct pj_turn_session pj_turn_session; 44 45 46 #define PJ_TURN_INVALID_CHANNEL 0xFFFF47 #define PJ_TURN_CHANNEL_MIN 0x400048 #define PJ_TURN_CHANNEL_MAX 0xFFFE /* inclusive */49 #define PJ_TURN_NO_TIMEOUT ((long)0x7FFFFFFF)50 #define PJ_TURN_MAX_PKT_LEN 300051 #define PJ_TURN_PERM_TIMEOUT 300 /* Must be greater than REFRESH_SEC_BEFORE */52 #define PJ_TURN_CHANNEL_TIMEOUT 600 /* Must be greater than REFRESH_SEC_BEFORE */53 #define PJ_TURN_REFRESH_SEC_BEFORE 6054 #define PJ_TURN_KEEP_ALIVE_SEC 1555 #define PJ_TURN_PEER_HTABLE_SIZE 856 57 57 58 … … 134 135 135 136 136 /* ChannelData header */ 137 #pragma pack(1) 138 139 /** 140 * This structure ChannelData header. All the fields are in network byte 141 * order when it's on the wire. 142 */ 137 143 typedef struct pj_turn_channel_data 138 144 { 139 pj_uint16_t ch_number; 140 pj_uint16_t length; 145 pj_uint16_t ch_number; /**< Channel number. */ 146 pj_uint16_t length; /**< Payload length. */ 141 147 } pj_turn_channel_data; 142 148 149 150 #pragma pack() 143 151 144 152 … … 152 160 * needs to send outgoing message. Since the TURN session doesn't 153 161 * have a socket on its own, this callback must be implemented. 162 * 163 * @param sess The TURN session. 164 * @param pkt The packet/data to be sent. 165 * @param pkt_len Length of the packet/data. 166 * @param dst_addr Destination address of the packet. 167 * @param addr_len Length of the destination address. 168 * 169 * @return The callback should return the status of the 170 * send operation. 154 171 */ 155 172 pj_status_t (*on_send_pkt)(pj_turn_session *sess, … … 157 174 unsigned pkt_len, 158 175 const pj_sockaddr_t *dst_addr, 159 unsigned dst_addr_len);176 unsigned addr_len); 160 177 161 178 /** … … 163 180 * a channel number. 164 181 * 165 * This callback is optional. 182 * This callback is optional since the nature of this callback is 183 * for information only. 184 * 185 * @param sess The TURN session. 186 * @param peer_addr The peer address. 187 * @param addr_len Length of the peer address. 188 * @param ch_num The channel number associated with this peer address. 166 189 */ 167 190 void (*on_channel_bound)(pj_turn_session *sess, … … 174 197 * Data indication or ChannelData message from the TURN server. 175 198 * 176 * This callback is optional. 199 * @param sess The TURN session. 200 * @param pkt The data/payload of the Data Indication or ChannelData 201 * packet. 202 * @param pkt_len Length of the data/payload. 203 * @param peer_addr Peer address where this payload was received by 204 * the TURN server. 205 * @param addr_len Length of the peer address. 177 206 */ 178 207 void (*on_rx_data)(pj_turn_session *sess, 179 const pj_uint8_t*pkt,208 void *pkt, 180 209 unsigned pkt_len, 181 210 const pj_sockaddr_t *peer_addr, … … 186 215 * implement this callback at least to know that the TURN session is 187 216 * going to be destroyed. 188 */ 189 void (*on_state)(pj_turn_session *sess, pj_turn_state_t old_state, 217 * 218 * @param sess The TURN session. 219 * @param old_state The previous state of the session. 220 * @param new_state The current state of the session. 221 */ 222 void (*on_state)(pj_turn_session *sess, 223 pj_turn_state_t old_state, 190 224 pj_turn_state_t new_state); 191 225 … … 194 228 195 229 /** 196 * Allocate parameter. 230 * Allocation parameter, which can be given when application calls 231 * pj_turn_session_alloc() to allocate relay address in the TURN server. 232 * Application should call pj_turn_alloc_param_default() to initialize 233 * this structure with the default values. 197 234 */ 198 235 typedef struct pj_turn_alloc_param 199 236 { 237 /** 238 * The requested BANDWIDTH. Default is zero to not request any 239 * specific bandwidth. 240 */ 200 241 int bandwidth; 242 243 /** 244 * The requested LIFETIME. Default is zero to not request any 245 * explicit allocation lifetime. 246 */ 201 247 int lifetime; 248 249 /** 250 * If set to non-zero, the TURN session will periodically send blank 251 * Send Indication every PJ_TURN_KEEP_ALIVE_SEC to refresh local 252 * NAT bindings. Default is zero. 253 */ 202 254 int ka_interval; 255 203 256 } pj_turn_alloc_param; 204 257 205 258 206 259 /** 207 * T URN session info.260 * This structure describes TURN session info. 208 261 */ 209 262 typedef struct pj_turn_session_info … … 215 268 216 269 /** 270 * Last error (if session was terminated because of error) 271 */ 272 pj_status_t last_status; 273 274 /** 217 275 * Type of connection to the TURN server. 218 276 */ 219 pj_turn_tp_type tp_type; 277 pj_turn_tp_type conn_type; 278 279 /** 280 * The selected TURN server address. 281 */ 282 pj_sockaddr server; 283 284 /** 285 * Mapped address, as reported by the TURN server. 286 */ 287 pj_sockaddr mapped_addr; 220 288 221 289 /** … … 225 293 226 294 /** 227 * The selected TURN server address.228 */229 pj_sockaddr server;230 231 /**232 295 * Current seconds before allocation expires. 233 296 */ … … 238 301 239 302 /** 240 * Create default pj_turn_alloc_param. 303 * Initialize pj_turn_alloc_param with the default values. 304 * 305 * @param prm The TURN allocation parameter to be initialized. 241 306 */ 242 307 PJ_DECL(void) pj_turn_alloc_param_default(pj_turn_alloc_param *prm); 243 308 309 244 310 /** 245 311 * Duplicate pj_turn_alloc_param. 312 * 313 * @param pool Pool to allocate memory (currently not used) 314 * @param dst Destination parameter. 315 * @param src Source parameter. 246 316 */ 247 317 PJ_DECL(void) pj_turn_alloc_param_copy(pj_pool_t *pool, … … 250 320 251 321 /** 252 * Get TURN state name. 322 * Get string representation for the given TURN state. 323 * 324 * @param state The TURN session state. 325 * 326 * @return The state name as NULL terminated string. 253 327 */ 254 328 PJ_DECL(const char*) pj_turn_state_name(pj_turn_state_t state); … … 256 330 257 331 /** 258 * Create TURN client session. 259 */ 260 PJ_DECL(pj_status_t) pj_turn_session_create(pj_stun_config *cfg, 332 * Create a TURN session instance with the specified address family and 333 * connection type. Once TURN session instance is created, application 334 * must call pj_turn_session_alloc() to allocate a relay address in the TURN 335 * server. 336 * 337 * @param cfg The STUN configuration which contains among other 338 * things the ioqueue and timer heap instance for 339 * the operation of this session. 340 * @param name Optional name to identify this session in the log. 341 * @param af Address family of the client connection. Currently 342 * pj_AF_INET() and pj_AF_INET6() are supported. 343 * @param conn_type Connection type to the TURN server. 344 * @param cb Callback to receive events from the TURN session. 345 * @param options Option flags, currently this value must be zero. 346 * @param user_data Arbitrary application data to be associated with 347 * this transport. 348 * @param p_sess Pointer to receive the created instance of the 349 * TURN session. 350 * 351 * @return PJ_SUCCESS if the operation has been successful, 352 * or the appropriate error code on failure. 353 */ 354 PJ_DECL(pj_status_t) pj_turn_session_create(const pj_stun_config *cfg, 261 355 const char *name, 262 356 int af, 263 357 pj_turn_tp_type conn_type, 264 358 const pj_turn_session_cb *cb, 359 unsigned options, 265 360 void *user_data, 266 unsigned options,267 361 pj_turn_session **p_sess); 268 362 269 270 /** 271 * Shutdown TURN client session. 363 /** 364 * Shutdown TURN client session. This will gracefully deallocate and 365 * destroy the client session. 366 * 367 * @param sess The TURN client session. 368 * 369 * @return PJ_SUCCESS if the operation has been successful, 370 * or the appropriate error code on failure. 272 371 */ 273 372 PJ_DECL(pj_status_t) pj_turn_session_shutdown(pj_turn_session *sess); … … 275 374 276 375 /** 277 * Forcefully destroy the TURN session. 376 * Forcefully destroy the TURN session. This will destroy the session 377 * immediately. If there is an active allocation, the server will not 378 * be notified about the client destruction. 379 * 380 * @param sess The TURN client session. 381 * 382 * @return PJ_SUCCESS if the operation has been successful, 383 * or the appropriate error code on failure. 278 384 */ 279 385 PJ_DECL(pj_status_t) pj_turn_session_destroy(pj_turn_session *sess); … … 281 387 282 388 /** 283 * Get TURN session info. 389 * Get the information about this TURN session and the allocation, if 390 * any. 391 * 392 * @param sess The TURN client session. 393 * @param info The structure to be initialized with the TURN 394 * session info. 395 * 396 * @return PJ_SUCCESS if the operation has been successful, 397 * or the appropriate error code on failure. 284 398 */ 285 399 PJ_DECL(pj_status_t) pj_turn_session_get_info(pj_turn_session *sess, … … 287 401 288 402 /** 289 * Re-assign user data. 403 * Associate a user data with this TURN session. The user data may then 404 * be retrieved later with pj_turn_session_get_user_data(). 405 * 406 * @param sess The TURN client session. 407 * @param user_data Arbitrary data. 408 * 409 * @return PJ_SUCCESS if the operation has been successful, 410 * or the appropriate error code on failure. 290 411 */ 291 412 PJ_DECL(pj_status_t) pj_turn_session_set_user_data(pj_turn_session *sess, … … 293 414 294 415 /** 295 * Retrieve user data. 416 * Retrieve the previously assigned user data associated with this TURN 417 * session. 418 * 419 * @param sess The TURN client session. 420 * 421 * @return The user/application data. 296 422 */ 297 423 PJ_DECL(void*) pj_turn_session_get_user_data(pj_turn_session *sess); 298 424 299 /** 300 * Set the server or domain name of the server. 425 426 /** 427 * Configure message logging. By default all flags are enabled. 428 * 429 * @param sess The TURN client session. 430 * @param flags Bitmask combination of #pj_stun_sess_msg_log_flag 431 */ 432 PJ_DECL(void) pj_turn_session_set_log(pj_turn_session *sess, 433 unsigned flags); 434 435 436 /** 437 * Set the server or domain name of the server. Before the application 438 * can send Allocate request (with pj_turn_session_alloc()), it must first 439 * resolve the server address(es) using this function. This function will 440 * resolve the TURN server using DNS SRV resolution if the \a resolver 441 * is set. The server resolution process will complete asynchronously, 442 * and application will be notified in \a on_state() callback with the 443 * session state set to PJ_TURN_STATE_RESOLVED. 444 * 445 * Application may call with pj_turn_session_alloc() before the server 446 * resolution completes. In this case, the operation will be queued by 447 * the session, and it will be sent once the server resolution completes. 448 * 449 * @param sess The TURN client session. 450 * @param domain The domain, hostname, or IP address of the TURN 451 * server. When this parameter contains domain name, 452 * the \a resolver parameter must be set to activate 453 * DNS SRV resolution. 454 * @param default_port The default TURN port number to use when DNS SRV 455 * resolution is not used. If DNS SRV resolution is 456 * used, the server port number will be set from the 457 * DNS SRV records. 458 * @param resolver If this parameter is not NULL, then the \a domain 459 * parameter will be first resolved with DNS SRV and 460 * then fallback to using DNS A/AAAA resolution when 461 * DNS SRV resolution fails. If this parameter is 462 * NULL, the \a domain parameter will be resolved as 463 * hostname. 464 * 465 * @return PJ_SUCCESS if the operation has been successfully 466 * queued, or the appropriate error code on failure. 467 * When this function returns PJ_SUCCESS, the final 468 * result of the resolution process will be notified 469 * to application in \a on_state() callback. 301 470 */ 302 471 PJ_DECL(pj_status_t) pj_turn_session_set_server(pj_turn_session *sess, … … 307 476 308 477 /** 309 * Set credential to be used by the session. 478 * Set credential to be used to authenticate against TURN server. 479 * Application must call this function before sending Allocate request 480 * with pj_turn_session_alloc(). 481 * 482 * @param sess The TURN client session 483 * @param cred STUN credential to be used. 484 * 485 * @return PJ_SUCCESS if the operation has been successful, 486 * or the appropriate error code on failure. 310 487 */ 311 488 PJ_DECL(pj_status_t) pj_turn_session_set_credential(pj_turn_session *sess, … … 314 491 315 492 /** 316 * Create TURN allocation. 493 * Allocate a relay address/resource in the TURN server by sending TURN 494 * Allocate request. Application must first initiate the server resolution 495 * process with pj_turn_session_set_server() and set the credential to be 496 * used with pj_turn_session_set_credential() before calling this function. 497 * 498 * This function will complete asynchronously, and the application will be 499 * notified about the allocation result in \a on_state() callback. The 500 * TURN session state will move to PJ_TURN_STATE_READY if allocation is 501 * successful, and PJ_TURN_STATE_DEALLOCATING or greater state if allocation 502 * has failed. 503 * 504 * Once allocation has been successful, the TURN session will keep this 505 * allocation alive until the session is destroyed, by sending periodic 506 * allocation refresh to the TURN server. 507 * 508 * @param sess The TURN client session. 509 * @param param Optional TURN allocation parameter. 510 * 511 * @return PJ_SUCCESS if the operation has been successfully 512 * initiated or the appropriate error code on failure. 317 513 */ 318 514 PJ_DECL(pj_status_t) pj_turn_session_alloc(pj_turn_session *sess, … … 321 517 322 518 /** 323 * Relay data to the specified peer through the session. 519 * Send a data to the specified peer address via the TURN relay. This 520 * function will encapsulate the data as STUN Send Indication or TURN 521 * ChannelData packet and send the message to the TURN server. The TURN 522 * server then will send the data to the peer. 523 * 524 * The allocation (pj_turn_session_alloc()) must have been successfully 525 * created before application can relay any data. 526 * 527 * Since TURN session is transport independent, this function will 528 * ultimately call \a on_send_pkt() callback to request the application 529 * to actually send the packet containing the data to the TURN server. 530 * 531 * @param sess The TURN client session. 532 * @param pkt The data/packet to be sent to peer. 533 * @param pkt_len Length of the data. 534 * @param peer_addr The remote peer address (the ultimate destination 535 * of the data, and not the TURN server address). 536 * @param addr_len Length of the address. 537 * 538 * @return PJ_SUCCESS if the operation has been successful, 539 * or the appropriate error code on failure. 324 540 */ 325 541 PJ_DECL(pj_status_t) pj_turn_session_sendto(pj_turn_session *sess, 326 542 const pj_uint8_t *pkt, 327 543 unsigned pkt_len, 328 const pj_sockaddr_t * addr,544 const pj_sockaddr_t *peer_addr, 329 545 unsigned addr_len); 330 546 331 547 /** 332 * Bind a peer address to a channel number. 548 * Optionally establish channel binding for the specified a peer address. 549 * This function will assign a unique channel number for the peer address 550 * and request channel binding to the TURN server for this address. When 551 * a channel has been bound to a peer, the TURN client and TURN server 552 * will exchange data using ChannelData encapsulation format, which has 553 * lower bandwidth overhead than Send Indication (the default format used 554 * when peer address is not bound to a channel). 555 * 556 * This function will complete asynchronously, and application will be 557 * notified about the result in \a on_channel_bound() callback. 558 * 559 * @param sess The TURN client session. 560 * @param peer The remote peer address. 561 * @param addr_len Length of the address. 562 * 563 * @return PJ_SUCCESS if the operation has been successfully 564 * initiated, or the appropriate error code on failure. 333 565 */ 334 566 PJ_DECL(pj_status_t) pj_turn_session_bind_channel(pj_turn_session *sess, … … 337 569 338 570 /** 339 * Notify TURN client session upon receiving a packet from server. 340 * The packet maybe a STUN packet or ChannelData packet. 571 * Notify TURN client session upon receiving a packet from server. Since 572 * the TURN session is transport independent, it does not read packet from 573 * any sockets, and rather relies on application giving it packets that 574 * are received from the TURN server. The session then processes this packet 575 * and decides whether it is part of TURN protocol exchange or if it is a 576 * data to be reported back to user, which in this case it will call the 577 * \a on_rx_data() callback. 578 * 579 * @param sess The TURN client session. 580 * @param pkt The packet as received from the TURN server. This 581 * should contain either STUN encapsulated message or 582 * a ChannelData packet. 583 * @param pkt_len The length of the packet. 584 * 585 * @return The function may return non-PJ_SUCCESS if it receives 586 * non-STUN and non-ChannelData packet, or if the 587 * \a on_rx_data() returns non-PJ_SUCCESS; 341 588 */ 342 589 PJ_DECL(pj_status_t) pj_turn_session_on_rx_pkt(pj_turn_session *sess, 343 const pj_uint8_t *pkt, 344 unsigned pkt_len, 345 pj_bool_t is_datagram); 590 void *pkt, 591 unsigned pkt_len); 346 592 347 593 -
pjproject/trunk/pjnath/include/pjnath/turn_sock.h
r1913 r1988 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #ifndef __PJNATH_ turn_sock_H__20 #define __PJNATH_ turn_sock_H__19 #ifndef __PJNATH_TURN_SOCK_H__ 20 #define __PJNATH_TURN_SOCK_H__ 21 21 22 22 /** … … 32 32 /* **************************************************************************/ 33 33 /** 34 * @defgroup PJNATH_TURN_ UDP TURN TCP client35 * @brief TURN relay using TCP client as transport protocol36 * @ingroup PJNATH_ STUN34 * @defgroup PJNATH_TURN_SOCK TURN client transport 35 * @brief Client transport utilizing TURN relay 36 * @ingroup PJNATH_TURN 37 37 * @{ 38 * 39 * The TURN relay client transport can be used to relay data from the client 40 * to peer via a TURN relay. The application establishes TURN connection to 41 * the TURN server using UDP or TCP as the transport, then creates a relay 42 * address in the TURN server to be advertised to remote peer(s) as the 43 * transport address. When application sends data to a remote address via 44 * this transport, the data will be sent via the TURN relay, and vice versa. 38 45 */ 39 46 40 47 41 48 /** 42 * Opaque declaration for TURN TCPclient.49 * Opaque declaration for TURN client. 43 50 */ 44 51 typedef struct pj_turn_sock pj_turn_sock; 45 52 46 53 /** 54 * This structure contains callbacks that will be called by the TURN 55 * transport. 56 */ 47 57 typedef struct pj_turn_sock_cb 48 58 { 49 59 /** 50 * Notification when incoming data has been received, either through 51 * Data indication or ChannelData message from the TURN server. 60 * Notification when incoming data has been received from the remote 61 * peer via the TURN server. The data reported in this callback will 62 * be the exact data as sent by the peer (e.g. the TURN encapsulation 63 * such as Data Indication or ChannelData will be removed before this 64 * function is called). 52 65 * 53 * This callback is mandatory. 66 * @param turn_sock The TURN client transport. 67 * @param data The data as received from the peer. 68 * @param data_len Length of the data. 69 * @param peer_addr The peer address. 70 * @param addr_len The length of the peer address. 54 71 */ 55 72 void (*on_rx_data)(pj_turn_sock *turn_sock, 56 const pj_uint8_t*pkt,73 void *pkt, 57 74 unsigned pkt_len, 58 75 const pj_sockaddr_t *peer_addr, … … 61 78 /** 62 79 * Notification when TURN session state has changed. Application should 63 * implement this callback to know that the TURN session is no longer 64 * available. 80 * implement this callback to monitor the progress of the TURN session. 81 * 82 * @param turn_sock The TURN client transport. 83 * @param old_state Previous state. 84 * @param new_state Current state. 65 85 */ 66 void (*on_state)(pj_turn_sock *turn_sock, pj_turn_state_t old_state, 86 void (*on_state)(pj_turn_sock *turn_sock, 87 pj_turn_state_t old_state, 67 88 pj_turn_state_t new_state); 68 89 … … 71 92 72 93 /** 73 * Create. 94 * Create a TURN transport instance with the specified address family and 95 * connection type. Once TURN transport instance is created, application 96 * must call pj_turn_sock_alloc() to allocate a relay address in the TURN 97 * server. 98 * 99 * @param cfg The STUN configuration which contains among other 100 * things the ioqueue and timer heap instance for 101 * the operation of this transport. 102 * @param af Address family of the client connection. Currently 103 * pj_AF_INET() and pj_AF_INET6() are supported. 104 * @param conn_type Connection type to the TURN server. Both TCP and 105 * UDP are supported. 106 * @param cb Callback to receive events from the TURN transport. 107 * @param options Option flags, currently this value must be zero. 108 * @param user_data Arbitrary application data to be associated with 109 * this transport. 110 * @param p_turn_sock Pointer to receive the created instance of the 111 * TURN transport. 112 * 113 * @return PJ_SUCCESS if the operation has been successful, 114 * or the appropriate error code on failure. 74 115 */ 75 116 PJ_DECL(pj_status_t) pj_turn_sock_create(pj_stun_config *cfg, … … 82 123 83 124 /** 84 * Destroy. 125 * Destroy the TURN transport instance. This will gracefully close the 126 * connection between the client and the TURN server. Although this 127 * function will return immediately, the TURN socket deletion may continue 128 * in the background and the application may still get state changes 129 * notifications from this transport. 130 * 131 * @param turn_sock The TURN transport instance. 85 132 */ 86 133 PJ_DECL(void) pj_turn_sock_destroy(pj_turn_sock *turn_sock); 87 134 88 /** 89 * Set user data. 135 136 /** 137 * Associate a user data with this TURN transport. The user data may then 138 * be retrieved later with #pj_turn_sock_get_user_data(). 139 * 140 * @param turn_sock The TURN transport instance. 141 * @param user_data Arbitrary data. 142 * 143 * @return PJ_SUCCESS if the operation has been successful, 144 * or the appropriate error code on failure. 90 145 */ 91 146 PJ_DECL(pj_status_t) pj_turn_sock_set_user_data(pj_turn_sock *turn_sock, 92 void *user_data); 93 94 /** 95 * Get user data. 147 void *user_data); 148 149 /** 150 * Retrieve the previously assigned user data associated with this TURN 151 * transport. 152 * 153 * @param turn_sock The TURN transport instance. 154 * 155 * @return The user/application data. 96 156 */ 97 157 PJ_DECL(void*) pj_turn_sock_get_user_data(pj_turn_sock *turn_sock); … … 99 159 100 160 /** 101 * Get info. 161 * Get the TURN transport info. The transport info contains, among other 162 * things, the allocated relay address. 163 * 164 * @param turn_sock The TURN transport instance. 165 * @param info Pointer to be filled with TURN transport info. 166 * 167 * @return PJ_SUCCESS if the operation has been successful, 168 * or the appropriate error code on failure. 102 169 */ 103 170 PJ_DECL(pj_status_t) pj_turn_sock_get_info(pj_turn_sock *turn_sock, 104 pj_turn_session_info *info); 105 106 /** 107 * Initialize. 108 */ 109 PJ_DECL(pj_status_t) pj_turn_sock_init(pj_turn_sock *turn_sock, 110 const pj_str_t *domain, 111 int default_port, 112 pj_dns_resolver *resolver, 113 const pj_stun_auth_cred *cred, 114 const pj_turn_alloc_param *param); 115 116 /** 117 * Send packet. 171 pj_turn_session_info *info); 172 173 /** 174 * Acquire the internal mutex of the TURN transport. Application may need 175 * to call this function to synchronize access to other objects alongside 176 * the TURN transport, to avoid deadlock. 177 * 178 * @param turn_sock The TURN transport instance. 179 * 180 * @return PJ_SUCCESS if the operation has been successful, 181 * or the appropriate error code on failure. 182 */ 183 PJ_DECL(pj_status_t) pj_turn_sock_lock(pj_turn_sock *turn_sock); 184 185 186 /** 187 * Release the internal mutex previously held with pj_turn_sock_lock(). 188 * 189 * @param turn_sock The TURN transport instance. 190 * 191 * @return PJ_SUCCESS if the operation has been successful, 192 * or the appropriate error code on failure. 193 */ 194 PJ_DECL(pj_status_t) pj_turn_sock_unlock(pj_turn_sock *turn_sock); 195 196 197 /** 198 * Set STUN message logging for this TURN session. 199 * See #pj_stun_session_set_log(). 200 * 201 * @param turn_sock The TURN transport instance. 202 * @param flags Bitmask combination of #pj_stun_sess_msg_log_flag 203 */ 204 PJ_DECL(void) pj_turn_sock_set_log(pj_turn_sock *turn_sock, 205 unsigned flags); 206 207 /** 208 * Allocate a relay address/resource in the TURN server. This function 209 * will resolve the TURN server using DNS SRV (if desired) and send TURN 210 * \a Allocate request using the specified credential to allocate a relay 211 * address in the server. This function completes asynchronously, and 212 * application will be notified when the allocation process has been 213 * successful in the \a on_state() callback when the state is set to 214 * PJ_TURN_STATE_READY. If the allocation fails, the state will be set 215 * to PJ_TURN_STATE_DEALLOCATING or greater. 216 * 217 * @param turn_sock The TURN transport instance. 218 * @param domain The domain, hostname, or IP address of the TURN 219 * server. When this parameter contains domain name, 220 * the \a resolver parameter must be set to activate 221 * DNS SRV resolution. 222 * @param default_port The default TURN port number to use when DNS SRV 223 * resolution is not used. If DNS SRV resolution is 224 * used, the server port number will be set from the 225 * DNS SRV records. 226 * @param resolver If this parameter is not NULL, then the \a domain 227 * parameter will be first resolved with DNS SRV and 228 * then fallback to using DNS A/AAAA resolution when 229 * DNS SRV resolution fails. If this parameter is 230 * NULL, the \a domain parameter will be resolved as 231 * hostname. 232 * @param cred The STUN credential to be used for the TURN server. 233 * @param param Optional TURN allocation parameter. 234 * 235 * @return PJ_SUCCESS if the operation has been successfully 236 * queued, or the appropriate error code on failure. 237 * When this function returns PJ_SUCCESS, the final 238 * result of the allocation process will be notified 239 * to application in \a on_state() callback. 240 * 241 */ 242 PJ_DECL(pj_status_t) pj_turn_sock_alloc(pj_turn_sock *turn_sock, 243 const pj_str_t *domain, 244 int default_port, 245 pj_dns_resolver *resolver, 246 const pj_stun_auth_cred *cred, 247 const pj_turn_alloc_param *param); 248 249 /** 250 * Send a data to the specified peer address via the TURN relay. This 251 * function will encapsulate the data as STUN Send Indication or TURN 252 * ChannelData packet and send the message to the TURN server. The TURN 253 * server then will send the data to the peer. 254 * 255 * The allocation (pj_turn_sock_alloc()) must have been successfully 256 * created before application can relay any data. 257 * 258 * @param turn_sock The TURN transport instance. 259 * @param pkt The data/packet to be sent to peer. 260 * @param pkt_len Length of the data. 261 * @param peer_addr The remote peer address (the ultimate destination 262 * of the data, and not the TURN server address). 263 * @param addr_len Length of the address. 264 * 265 * @return PJ_SUCCESS if the operation has been successful, 266 * or the appropriate error code on failure. 118 267 */ 119 268 PJ_DECL(pj_status_t) pj_turn_sock_sendto(pj_turn_sock *turn_sock, 120 269 const pj_uint8_t *pkt, 121 270 unsigned pkt_len, 122 const pj_sockaddr_t * addr,271 const pj_sockaddr_t *peer_addr, 123 272 unsigned addr_len); 124 273 125 274 /** 126 * Bind a peer address to a channel number. 275 * Optionally establish channel binding for the specified a peer address. 276 * This function will assign a unique channel number for the peer address 277 * and request channel binding to the TURN server for this address. When 278 * a channel has been bound to a peer, the TURN transport and TURN server 279 * will exchange data using ChannelData encapsulation format, which has 280 * lower bandwidth overhead than Send Indication (the default format used 281 * when peer address is not bound to a channel). 282 * 283 * @param turn_sock The TURN transport instance. 284 * @param peer The remote peer address. 285 * @param addr_len Length of the address. 286 * 287 * @return PJ_SUCCESS if the operation has been successful, 288 * or the appropriate error code on failure. 127 289 */ 128 290 PJ_DECL(pj_status_t) pj_turn_sock_bind_channel(pj_turn_sock *turn_sock, 129 const pj_sockaddr_t *peer,130 unsigned addr_len);291 const pj_sockaddr_t *peer, 292 unsigned addr_len); 131 293 132 294 … … 139 301 140 302 141 #endif /* __PJNATH_ turn_sock_H__ */142 303 #endif /* __PJNATH_TURN_SOCK_H__ */ 304 -
pjproject/trunk/pjnath/include/pjnath/types.h
r1914 r1988 36 36 37 37 /** 38 * This constant describes a number to be used to identify an invalid TURN 39 * channel number. 40 */ 41 #define PJ_TURN_INVALID_CHANNEL 0xFFFF 42 43 44 /** 38 45 * Initialize pjnath library. 39 46 * … … 44 51 45 52 /** 46 * Display error to the log. 53 * Display error to the log. 47 54 * 48 55 * @param sender The sender name. … … 68 75 69 76 /** 70 * @mainpage PJNATH - Open Source ICE, STUN, and TURN Library 71 * 72 * \n 73 * This is the documentation of PJNATH, an Open Source library providing 74 * NAT traversal helper functionalities by using standard based protocols. 75 * 76 * \n 77 78 * \section PJNATH_STUN STUN Protocol Library 79 * 80 * Session Traversal Utilities (STUN, or previously known as Simple 81 * Traversal of User Datagram Protocol (UDP) Through Network Address 82 * Translators (NAT)s), is a lightweight protocol that serves as a tool for 83 * application protocols in dealing with NAT traversal. It allows a client 84 * to determine the IP address and port allocated to them by a NAT and to 85 * keep NAT bindings open. 86 * 87 * The PJNATH library provides facilities to support both the core 88 * <B>STUN-bis</B> specification and the <B>TURN</B> usage of STUN, 89 * as well as other STUN usages. Please see #pj_stun_attr_type for 90 * list of STUN attributes supported by this library. 91 * 92 * 93 * The following are some design principles that have been utilized 94 * when implementing the STUN library in PJNATH: 95 * 96 * - layered architecture, with \ref PJNATH_STUN_MSG as the lowest 97 * layer and \ref PJNATH_STUN_SESSION as the highest abstraction 98 * layer, to accommodate various usage scenario of the library. 99 * 100 * - no transport -- the STUN library is pretty much transport 101 * independent and all sending and receiving functionalities will 102 * have to be implemented by application or higher level 103 * abstraction (such as ICE). This helps facilitating an even 104 * more usage scenarios of the library. 105 * 106 * - common functionalities for both STUN client and server 107 * development. All STUN components can be used to develop both 108 * STUN client and STUN server application, and in fact, in ICE, 109 * both STUN client and server functionality exist in a single 110 * ICE session. 111 * 112 * \n 113 * 114 * \subsection PJNATH_STUN_ARCH STUN Library Organization 115 * 116 * \image html stun-arch.jpg "STUN Library Architecture" 117 * 118 * The STUN library is organized as follows: 119 * 120 * - for both client and server, the highest abstraction is 121 * \ref PJNATH_STUN_SESSION, which provides management of incoming 122 * and outgoing messages and association of STUN credential to 123 * a STUN session. 124 * 125 * - for client, the next layer below is \ref PJNATH_STUN_TRANSACTION, 126 * which manages retransmissions of STUN request. Server side STUN 127 * transaction is handled in \ref PJNATH_STUN_SESSION layer above. 128 * 129 * - \ref PJNATH_STUN_AUTH provides mechanism to verify STUN 130 * credential in incoming STUN messages. 131 * 132 * - the lowest layer of the library is \ref PJNATH_STUN_MSG. This layer 133 * provides STUN message representation, validation, parsing, 134 * encoding MESSAGE-INTEGRITY for outgoing messages, and 135 * debugging (dump to log) of STUN messages. 136 * 137 * All STUN library components are independent of any transports. 138 * Application gives incoming packet to the STUN components for processing, 139 * and it must supply the STUN components with callback to send outgoing 140 * messages. 141 * 142 * 143 * \n 144 * 145 * \subsection PJNATH_STUN_CLASSES PJNATH Class Diagram 146 * 147 * 148 * \image html UML-class-diagram.png "Class Diagram" 149 * 150 * TBD: write descriptions. 151 * 152 * \subsection PJNATH_STUN_USING Using STUN Library 153 * 154 * [The developers guide documentation can certainly be improved here] 155 * 156 * For a sample STUN and TURN client, please see <tt>pjstun-client</tt> 157 * project under <tt>pjnath/src</tt> directory. 158 * 159 * For a sample STUN and TURN server, please see <tt>pjstun-srv-test</tt> 160 * project under <tt>pjnath/src</tt> directory. 161 * 162 * 163 * \subsection PJNATH_STUN_REF STUN Reference 164 * 165 * References for STUN: 166 * 167 * - <A HREF="http://www.ietf.org/internet-drafts/draft-ietf-behave-rfc3489bis-15.txt"> 168 * <B>draft-ietf-behave-rfc3489bis-15</b></A>: Session Traversal 169 * Utilities for (NAT) (STUN), 170 * - <A HREF="http://www.ietf.org/internet-drafts/draft-ietf-behave-turn-07.txt"> 171 * <B>draft-ietf-behave-turn-07</B></A>: Obtaining Relay Addresses 172 * from Simple Traversal Underneath NAT (STUN) 173 * - Obsoleted: <A HREF="http://www.ietf.org/rfc/rfc3489.txt">RFC 3489</A>. 174 * 175 * \n 176 * 177 * \section PJNATH_ICE ICE Implementation 178 * 179 * Interactive Connectivity Establishment (ICE) is a standard based 180 * methodology for traversing Network Address Translator (NAT), and 181 * is described in 182 * <A HREF="http://www.ietf.org/internet-drafts/draft-ietf-mmusic-ice-19.txt"> 183 * <B>draft-ietf-mmusic-ice-19.txt</B></A> draft. The PJNATH ICE 184 * implementation is aimed to provide a usable and generic ICE transports 185 * for different types of application, including but not limited to 186 * the usage of ICE in SIP/SDP offer/answer. 187 * 188 * 189 * \subsection PJNATH_ICE_ARCH ICE Library Organization 190 * 191 * \image html ice-arch.jpg "ICE Architecture" 192 * 193 * The ICE library is organized as follows: 194 * 195 * - the highest abstraction is ICE media transport, which maintains 196 * ICE stream transport and provides SDP translations to be used 197 * for SIP offer/answer exchanges. ICE media transport is part 198 * of PJMEDIA library. 199 * 200 * - higher in the hierarchy is \ref PJNATH_ICE_STREAM_TRANSPORT, 201 * which binds ICE with UDP sockets, and provides STUN binding 202 * and relay/TURN allocation for the sockets. This component can 203 * be directly used by application, although normally application 204 * should use the next higher abstraction since it provides 205 * SDP translations and better integration with other PJ libraries 206 * such as PJSIP and PJMEDIA. 207 * 208 * - the lowest layer is \ref PJNATH_ICE_SESSION, which provides 209 * ICE management and negotiation in a transport-independent way. 210 * This layer contains the state machines to perform ICE 211 * negotiation, and provides the most flexibility to control all 212 * aspects of ICE session. This layer normally is only usable for 213 * ICE implementors. 214 * 215 * \subsection PJNATH_ICE_USING Using the ICE Library 216 * 217 * For ICE implementation that has been integrated with socket transport, 218 * please see \ref PJNATH_ICE_STREAM_TRANSPORT_USING. 219 * 220 * For ICE implementation that has not been integrated with socket 221 * transport, please see \ref pj_ice_sess_using_sec. 222 * 223 * \subsection PJNATH_ICE_REF Reference 224 * 225 * References for ICE: 226 * - <A HREF="http://www.ietf.org/internet-drafts/draft-ietf-mmusic-ice-19.txt"> 227 * <B>draft-ietf-mmusic-ice-19.txt</B></A>: Interactive Connectivity 228 * Establishment (ICE): A Methodology for Network Address Translator 229 * (NAT) Traversal for Offer/Answer Protocols 230 */ 77 78 @mainpage PJNATH - Open Source ICE, STUN, and TURN Library 79 80 \n 81 This is the documentation of PJNATH, an Open Source library providing 82 NAT traversal helper functionalities by using standard based protocols 83 such as STUN, TURN, and ICE. 84 85 \n 86 \n 87 88 \section lib_comps Library Components 89 90 \subsection comp_stun STUN 91 92 Session Traversal Utilities (STUN, or previously known as Simple 93 Traversal of User Datagram Protocol (UDP) Through Network Address 94 Translators (NAT)s), is a lightweight protocol that serves as a tool for 95 application protocols in dealing with NAT traversal. It allows a client 96 to determine the IP address and port allocated to them by a NAT and to 97 keep NAT bindings open. 98 99 This version of PJNATH implements the following STUN-bis draft: 100 - <A HREF="http://www.ietf.org/internet-drafts/draft-ietf-behave-rfc3489bis-15.txt"> 101 <B>draft-ietf-behave-rfc3489bis-15</b></A>: Session Traversal 102 Utilities for (NAT) (STUN), 103 104 105 \subsection comp_turn TURN 106 107 Traversal Using Relays around NAT (TURN) allows the host to control the 108 operation of the relay and to exchange packets with its peers using the relay. 109 110 This version of PJNATH implements both TCP and UDP client transport and it 111 complies with the following TURN draft: 112 - <A HREF="http://www.ietf.org/internet-drafts/draft-ietf-behave-turn-07.txt"> 113 <B>draft-ietf-behave-turn-07</B></A>: Obtaining Relay Addresses 114 from Simple Traversal Underneath NAT (STUN) 115 116 117 \subsection comp_ice ICE 118 119 Interactive Connectivity Establishment (ICE) is a standard based 120 methodology for traversing Network Address Translator (NAT). This 121 implementation is aimed to provide a usable and generic ICE transports 122 for different types of application, including but not limited to 123 the usage of ICE in SIP/SDP offer/answer. 124 125 126 This version of PJNATH implements the following ICE draft: 127 - <A HREF="http://www.ietf.org/internet-drafts/draft-ietf-mmusic-ice-19.txt"> 128 <B>draft-ietf-mmusic-ice-19.txt</B></A> draft. The PJNATH ICE 129 130 131 \subsection comp_natck NAT Classification Utility 132 133 The PJNATH library also provides NAT classification utility as 134 described in <A HREF="http://www.ietf.org/rfc/rfc3489.txt">RFC 3489</A>. 135 While the practice to detect the NAT type to assist NAT traversal 136 has been deprecated in favor of ICE, the information may still be 137 useful for troubleshooting purposes, hence the utility is provided. 138 139 140 \n 141 \n 142 143 \section lib_org Library Organization 144 145 The PJNATH library consists of many components with each providing 146 specific functionality that may or may not be of the interests of 147 applications (or application developers). This section attempts to 148 give brief overview on the components provided by PJNATH. 149 150 The PJNATH components from the highest layer to the lower layer are 151 as follows. 152 153 154 \n 155 156 \subsection user_comp High-level Transport Objects 157 158 PJNATH library provides some high-level objects that may be used 159 by applications: 160 161 162 \subsubsection stun_sock STUN Transport 163 164 The \ref PJNATH_STUN_SOCK provides asynchronous UDP like socket transport 165 with the additional capability to query the publicly mapped transport 166 address (using STUN resolution), to refresh the NAT binding, and to 167 demultiplex internal STUN messages from application data (the 168 application data may be a STUN message as well). 169 170 171 \subsubsection turn_sock TURN Client Transport 172 173 The \ref PJNATH_TURN_SOCK may be used by the application to send and 174 receive data via TURN server. For more information please see the 175 documentation of \ref PJNATH_TURN_SOCK. 176 177 178 \subsubsection ice_strans ICE Stream Transport 179 180 The \ref PJNATH_ICE_STREAM_TRANSPORT provides transport interface to 181 send and receive data through connection that is negotiated 182 with ICE protocol. The \ref PJNATH_ICE_STREAM_TRANSPORT naturally 183 contains both STUN Transport and \ref PJNATH_TURN_SOCK. 184 185 The \ref PJNATH_ICE_STREAM_TRANSPORT interface is suitable for both 186 SIP or non-SIP use. For SIP use, application may prefer to use the 187 ICE media transport in PJMEDIA instead where it has been integrated 188 with the SDP offer and answer mechanism. 189 190 191 \subsubsection natck NAT Classification Utility 192 193 PJNATH also provides \a PJNATH_NAT_DETECT to assist troubleshooting 194 of problems related to NAT traversal. 195 196 197 198 \n 199 200 201 \subsection sessions Transport Independent Sessions Layer 202 203 Right below the high level transports objects are the transport 204 independent sessions. These sessions don't have access to sockets, 205 so higher level objects (such as transports) must give incoming 206 packets to the sessions and provide callback to be called by 207 sessions to send outgoing packets. 208 209 210 \subsubsection ice_sess ICE Session 211 212 The \ref PJNATH_ICE_SESSION is used by the \ref PJNATH_ICE_STREAM_TRANSPORT 213 and contains the actual logic of the ICE negotiation. 214 215 216 \subsubsection turn_sess TURN Session 217 218 The \ref PJNATH_TURN_SESSION is used by the \ref PJNATH_TURN_SOCK 219 and it contains TURN protocol logic. Implementors may implement 220 other types of TURN client connection (such as TURN TLS client) 221 by utilizing this session. 222 223 224 \subsubsection stun_sess STUN Session 225 226 The \ref PJNATH_STUN_SESSION manages STUN message exchange between 227 a client and server (or vice versa). It manages \ref PJNATH_STUN_TRANSACTION 228 for sending or receiving requests and \ref PJNATH_STUN_AUTH for both 229 both incoming and outgoing STUN messages. 230 231 The \ref PJNATH_STUN_SESSION is naturally used by the \ref PJNATH_TURN_SESSION 232 and \ref PJNATH_ICE_SESSION 233 234 235 \n 236 237 \subsection stun_tsx STUN Transaction Layer 238 239 The \ref PJNATH_STUN_TRANSACTION is a thin layer to manage retransmission 240 of STUN requests. 241 242 243 \n 244 245 246 \subsection stun_msg STUN Messaging Layer 247 248 At the very bottom of the PJNATH components is the \ref PJNATH_STUN_MSG 249 layer. The API contains various representation of STUN messaging components 250 and it provides API to encode and decode STUN messages. 251 252 253 254 \n 255 \n 256 257 \section class_dia Class Diagram 258 259 260 The following class diagram shows the interactions between objects in 261 PJNATH: 262 263 \image html UML-class-diagram.png "Class Diagram" 264 \image latex UML-class-diagram.png "Class Diagram" 265 266 267 268 \n 269 \n 270 271 \section samples Sample Applications 272 273 274 Some sample applications have been provided with PJNATH, and it's available 275 under <tt>pjnath/src</tt> directory: 276 277 - <b>pjturn-client</b>: this is a stand-alone, console based TURN client 278 application to be used as a demonstration for PJNATH TURN client 279 transport API and for simple testing against TURN server implementations. 280 The client supports both UDP and TCP connection to the TURN server. 281 282 - <b>pjturn-srv</b>: this is a simple TURN server to be used for testing 283 purposes. It supports both UDP and TCP connections to the clients. 284 285 286 */ 231 287 232 288 /** -
pjproject/trunk/pjnath/src/pjnath-test/ice_test.c
r1288 r1988 18 18 */ 19 19 #include "test.h" 20 21 #define THIS_FILE "ice_test.c" 22 23 24 struct ice_data 25 { 26 const char *obj_name; 27 pj_bool_t complete; 28 pj_status_t err_code; 29 unsigned rx_rtp_cnt; 30 unsigned rx_rtcp_cnt; 31 32 unsigned rx_rtp_count; 33 char last_rx_rtp_data[32]; 34 unsigned rx_rtcp_count; 35 char last_rx_rtcp_data[32]; 20 #include "server.h" 21 22 enum 23 { 24 NO = 0, 25 YES = 1, 26 SRV = 3, 36 27 }; 37 28 38 static pj_stun_config stun_cfg; 39 40 static void on_ice_complete(pj_ice_strans *icest, 41 pj_status_t status) 42 { 43 struct ice_data *id = (struct ice_data*) icest->user_data; 44 id->complete = PJ_TRUE; 45 id->err_code = status; 46 PJ_LOG(3,(THIS_FILE, " ICE %s complete %s", id->obj_name, 47 (status==PJ_SUCCESS ? "successfully" : "with failure"))); 29 #define NODELAY 0xFFFFFFFF 30 #define SRV_DOMAIN "pjsip.lab.domain" 31 32 #define INDENT " " 33 34 /* Client flags */ 35 enum 36 { 37 WRONG_TURN = 1, 38 DEL_ON_ERR = 2, 39 }; 40 41 42 /* Test results */ 43 struct test_result 44 { 45 pj_status_t init_status; /* init successful? */ 46 pj_status_t nego_status; /* negotiation successful? */ 47 unsigned rx_cnt[4]; /* Number of data received */ 48 }; 49 50 51 /* Test session configuration */ 52 struct test_cfg 53 { 54 pj_ice_sess_role role; /* Role. */ 55 unsigned comp_cnt; /* Component count */ 56 unsigned enable_host; /* Enable host candidates */ 57 unsigned enable_stun; /* Enable srflx candidates */ 58 unsigned enable_turn; /* Enable turn candidates */ 59 unsigned client_flag; /* Client flags */ 60 61 unsigned answer_delay; /* Delay before sending SDP */ 62 unsigned send_delay; /* Delay before sending data */ 63 unsigned destroy_delay; /* Delay before destroy() */ 64 65 struct test_result expected;/* Expected result */ 66 }; 67 68 /* ICE endpoint state */ 69 struct ice_ept 70 { 71 struct test_cfg cfg; /* Configuratino. */ 72 pj_ice_strans *ice; /* ICE stream transport */ 73 struct test_result result;/* Test result. */ 74 75 pj_str_t ufrag; /* username fragment. */ 76 pj_str_t pass; /* password */ 77 }; 78 79 /* The test session */ 80 struct test_sess 81 { 82 pj_pool_t *pool; 83 pj_stun_config *stun_cfg; 84 pj_dns_resolver *resolver; 85 86 test_server *server; 87 88 unsigned server_flag; 89 struct ice_ept caller; 90 struct ice_ept callee; 91 }; 92 93 94 static void ice_on_rx_data(pj_ice_strans *ice_st, 95 unsigned comp_id, 96 void *pkt, pj_size_t size, 97 const pj_sockaddr_t *src_addr, 98 unsigned src_addr_len); 99 static void ice_on_ice_complete(pj_ice_strans *ice_st, 100 pj_ice_strans_op op, 101 pj_status_t status); 102 static void destroy_sess(struct test_sess *sess, unsigned wait_msec); 103 104 /* Create ICE stream transport */ 105 static int create_ice_strans(struct test_sess *test_sess, 106 struct ice_ept *ept, 107 pj_ice_strans **p_ice) 108 { 109 pj_ice_strans *ice; 110 pj_ice_strans_cb ice_cb; 111 pj_ice_strans_cfg ice_cfg; 112 pj_sockaddr hostip; 113 char serverip[PJ_INET6_ADDRSTRLEN]; 114 pj_status_t status; 115 116 status = pj_gethostip(pj_AF_INET(), &hostip); 117 if (status != PJ_SUCCESS) 118 return -1030; 119 120 pj_sockaddr_print(&hostip, serverip, sizeof(serverip), 0); 121 122 /* Init callback structure */ 123 pj_bzero(&ice_cb, sizeof(ice_cb)); 124 ice_cb.on_rx_data = &ice_on_rx_data; 125 ice_cb.on_ice_complete = &ice_on_ice_complete; 126 127 /* Init ICE stream transport configuration structure */ 128 pj_ice_strans_cfg_default(&ice_cfg); 129 pj_memcpy(&ice_cfg.stun_cfg, test_sess->stun_cfg, sizeof(pj_stun_config)); 130 if ((ept->cfg.enable_stun & SRV)==SRV || (ept->cfg.enable_turn & SRV)==SRV) 131 ice_cfg.resolver = test_sess->resolver; 132 133 if (ept->cfg.enable_stun & YES) { 134 if ((ept->cfg.enable_stun & SRV) == SRV) { 135 ice_cfg.stun.server = pj_str(SRV_DOMAIN); 136 } else { 137 ice_cfg.stun.server = pj_str(serverip); 138 } 139 ice_cfg.stun.port = STUN_SERVER_PORT; 140 } 141 142 if (ept->cfg.enable_host == 0) { 143 ice_cfg.stun.no_host_cands = PJ_TRUE; 144 } else { 145 ice_cfg.stun.no_host_cands = PJ_FALSE; 146 ice_cfg.stun.loop_addr = PJ_TRUE; 147 } 148 149 150 if (ept->cfg.enable_turn & YES) { 151 if ((ept->cfg.enable_turn & SRV) == SRV) { 152 ice_cfg.turn.server = pj_str(SRV_DOMAIN); 153 } else { 154 ice_cfg.turn.server = pj_str(serverip); 155 } 156 ice_cfg.turn.port = TURN_SERVER_PORT; 157 ice_cfg.turn.conn_type = PJ_TURN_TP_UDP; 158 ice_cfg.turn.auth_cred.type = PJ_STUN_AUTH_CRED_STATIC; 159 ice_cfg.turn.auth_cred.data.static_cred.realm = pj_str(SRV_DOMAIN); 160 if (ept->cfg.client_flag & WRONG_TURN) 161 ice_cfg.turn.auth_cred.data.static_cred.username = pj_str("xxx"); 162 else 163 ice_cfg.turn.auth_cred.data.static_cred.username = pj_str(TURN_USERNAME); 164 ice_cfg.turn.auth_cred.data.static_cred.data_type = PJ_STUN_PASSWD_PLAIN; 165 ice_cfg.turn.auth_cred.data.static_cred.data = pj_str(TURN_PASSWD); 166 } 167 168 /* Create ICE stream transport */ 169 status = pj_ice_strans_create(NULL, &ice_cfg, ept->cfg.comp_cnt, 170 (void*)ept, &ice_cb, 171 &ice); 172 if (status != PJ_SUCCESS) { 173 app_perror(INDENT "err: pj_ice_strans_create()", status); 174 return status; 175 } 176 177 pj_create_unique_string(test_sess->pool, &ept->ufrag); 178 pj_create_unique_string(test_sess->pool, &ept->pass); 179 180 /* Looks alright */ 181 *p_ice = ice; 182 return PJ_SUCCESS; 48 183 } 49 50 51 static void on_rx_data(pj_ice_strans *icest, unsigned comp_id, 52 void *pkt, pj_size_t size, 53 const pj_sockaddr_t *src_addr, 54 unsigned src_addr_len) 55 { 56 struct ice_data *id = (struct ice_data*) icest->user_data; 57 58 if (comp_id == 1) { 59 id->rx_rtp_cnt++; 60 pj_memcpy(id->last_rx_rtp_data, pkt, size); 61 id->last_rx_rtp_data[size] = '\0'; 62 } else if (comp_id == 2) { 63 id->rx_rtcp_cnt++; 64 pj_memcpy(id->last_rx_rtcp_data, pkt, size); 65 id->last_rx_rtcp_data[size] = '\0'; 66 } else { 67 pj_assert(!"Invalid component ID"); 68 } 69 184 185 /* Create test session */ 186 static int create_sess(pj_stun_config *stun_cfg, 187 unsigned server_flag, 188 struct test_cfg *caller_cfg, 189 struct test_cfg *callee_cfg, 190 struct test_sess **p_sess) 191 { 192 pj_pool_t *pool; 193 struct test_sess *sess; 194 pj_str_t ns_ip; 195 pj_uint16_t ns_port; 196 unsigned flags; 197 pj_status_t status; 198 199 /* Create session structure */ 200 pool = pj_pool_create(mem, "testsess", 512, 512, NULL); 201 sess = PJ_POOL_ZALLOC_T(pool, struct test_sess); 202 sess->pool = pool; 203 sess->stun_cfg = stun_cfg; 204 205 pj_memcpy(&sess->caller.cfg, caller_cfg, sizeof(*caller_cfg)); 206 sess->caller.result.init_status = sess->caller.result.nego_status = PJ_EPENDING; 207 208 pj_memcpy(&sess->callee.cfg, callee_cfg, sizeof(*callee_cfg)); 209 sess->callee.result.init_status = sess->callee.result.nego_status = PJ_EPENDING; 210 211 /* Create server */ 212 flags = server_flag; 213 status = create_test_server(stun_cfg, flags, SRV_DOMAIN, &sess->server); 214 if (status != PJ_SUCCESS) { 215 app_perror(INDENT "error: create_test_server()", status); 216 destroy_sess(sess, 500); 217 return -10; 218 } 219 sess->server->turn_respond_allocate = 220 sess->server->turn_respond_refresh = PJ_TRUE; 221 222 /* Create resolver */ 223 status = pj_dns_resolver_create(mem, NULL, 0, stun_cfg->timer_heap, 224 stun_cfg->ioqueue, &sess->resolver); 225 if (status != PJ_SUCCESS) { 226 app_perror(INDENT "error: pj_dns_resolver_create()", status); 227 destroy_sess(sess, 500); 228 return -20; 229 } 230 231 ns_ip = pj_str("127.0.0.1"); 232 ns_port = (pj_uint16_t)DNS_SERVER_PORT; 233 status = pj_dns_resolver_set_ns(sess->resolver, 1, &ns_ip, &ns_port); 234 if (status != PJ_SUCCESS) { 235 app_perror( INDENT "error: pj_dns_resolver_set_ns()", status); 236 destroy_sess(sess, 500); 237 return -21; 238 } 239 240 /* Create caller ICE stream transport */ 241 status = create_ice_strans(sess, &sess->caller, &sess->caller.ice); 242 if (status != PJ_SUCCESS) { 243 destroy_sess(sess, 500); 244 return -30; 245 } 246 247 /* Create callee ICE stream transport */ 248 status = create_ice_strans(sess, &sess->callee, &sess->callee.ice); 249 if (status != PJ_SUCCESS) { 250 destroy_sess(sess, 500); 251 return -40; 252 } 253 254 *p_sess = sess; 255 return 0; 256 } 257 258 /* Destroy test session */ 259 static void destroy_sess(struct test_sess *sess, unsigned wait_msec) 260 { 261 if (sess->caller.ice) { 262 pj_ice_strans_destroy(sess->caller.ice); 263 sess->caller.ice = NULL; 264 } 265 266 if (sess->callee.ice) { 267 pj_ice_strans_destroy(sess->callee.ice); 268 sess->callee.ice = NULL; 269 } 270 271 poll_events(sess->stun_cfg, wait_msec, PJ_FALSE); 272 273 if (sess->resolver) { 274 pj_dns_resolver_destroy(sess->resolver, PJ_FALSE); 275 sess->resolver = NULL; 276 } 277 278 if (sess->server) { 279 destroy_test_server(sess->server); 280 sess->server = NULL; 281 } 282 283 if (sess->pool) { 284 pj_pool_t *pool = sess->pool; 285 sess->pool = NULL; 286 pj_pool_release(pool); 287 } 288 } 289 290 static void ice_on_rx_data(pj_ice_strans *ice_st, 291 unsigned comp_id, 292 void *pkt, pj_size_t size, 293 const pj_sockaddr_t *src_addr, 294 unsigned src_addr_len) 295 { 296 struct ice_ept *ept; 297 298 PJ_UNUSED_ARG(pkt); 299 PJ_UNUSED_ARG(size); 70 300 PJ_UNUSED_ARG(src_addr); 71 301 PJ_UNUSED_ARG(src_addr_len); 302 303 ept = (struct ice_ept*) pj_ice_strans_get_user_data(ice_st); 304 ept->result.rx_cnt[comp_id]++; 72 305 } 73 306 74 307 75 static void handle_events(unsigned msec_timeout) 76 { 77 pj_time_val delay; 78 79 pj_timer_heap_poll(stun_cfg.timer_heap, NULL); 80 81 delay.sec = 0; 82 delay.msec = msec_timeout; 83 pj_time_val_normalize(&delay); 84 85 pj_ioqueue_poll(stun_cfg.ioqueue, &delay); 308 static void ice_on_ice_complete(pj_ice_strans *ice_st, 309 pj_ice_strans_op op, 310 pj_status_t status) 311 { 312 struct ice_ept *ept; 313 314 ept = (struct ice_ept*) pj_ice_strans_get_user_data(ice_st); 315 switch (op) { 316 case PJ_ICE_STRANS_OP_INIT: 317 ept->result.init_status = status; 318 if (status != PJ_SUCCESS && (ept->cfg.client_flag & DEL_ON_ERR)) { 319 pj_ice_strans_destroy(ice_st); 320 ept->ice = NULL; 321 } 322 break; 323 case PJ_ICE_STRANS_OP_NEGOTIATION: 324 ept->result.nego_status = status; 325 break; 326 default: 327 pj_assert(!"Unknown op"); 328 } 86 329 } 87 330 88 331 89 /* Basic create and destroy test */ 90 static int ice_basic_create_destroy_test() 91 { 92 pj_ice_strans *im; 93 pj_ice_strans_cb icest_cb; 332 /* Start ICE negotiation on the endpoint, based on parameter from 333 * the other endpoint. 334 */ 335 static pj_status_t start_ice(struct ice_ept *ept, const struct ice_ept *remote) 336 { 337 pj_ice_sess_cand rcand[32]; 338 unsigned i, rcand_cnt = 0; 94 339 pj_status_t status; 95 340 96 PJ_LOG(3,(THIS_FILE, "...basic create/destroy")); 97 98 pj_bzero(&icest_cb, sizeof(icest_cb)); 99 icest_cb.on_ice_complete = &on_ice_complete; 100 icest_cb.on_rx_data = &on_rx_data; 101 102 status = pj_ice_strans_create(&stun_cfg, "icetest", 2, NULL, &icest_cb, &im); 103 if (status != PJ_SUCCESS) 104 return -10; 105 106 pj_ice_strans_destroy(im); 341 /* Enum remote candidates */ 342 for (i=0; i<remote->cfg.comp_cnt; ++i) { 343 unsigned cnt = PJ_ARRAY_SIZE(rcand) - rcand_cnt; 344 status = pj_ice_strans_enum_cands(remote->ice, i+1, &cnt, rcand+rcand_cnt); 345 if (status != PJ_SUCCESS) { 346 app_perror(INDENT "err: pj_ice_strans_enum_cands()", status); 347 return status; 348 } 349 rcand_cnt += cnt; 350 } 351 352 status = pj_ice_strans_start_ice(ept->ice, &remote->ufrag, &remote->pass, 353 rcand_cnt, rcand); 354 if (status != PJ_SUCCESS) { 355 app_perror(INDENT "err: pj_ice_strans_start_ice()", status); 356 return status; 357 } 358 359 return PJ_SUCCESS; 360 } 361 362 363 /* Check that the pair in both agents are matched */ 364 static int check_pair(const struct ice_ept *ept1, const struct ice_ept *ept2, 365 int start_err) 366 { 367 unsigned i, min_cnt, max_cnt; 368 369 if (ept1->cfg.comp_cnt < ept2->cfg.comp_cnt) { 370 min_cnt = ept1->cfg.comp_cnt; 371 max_cnt = ept2->cfg.comp_cnt; 372 } else { 373 min_cnt = ept2->cfg.comp_cnt; 374 max_cnt = ept1->cfg.comp_cnt; 375 } 376 377 /* Must have valid pair for common components */ 378 for (i=0; i<min_cnt; ++i) { 379 const pj_ice_sess_check *c1; 380 const pj_ice_sess_check *c2; 381 382 c1 = pj_ice_strans_get_valid_pair(ept1->ice, i+1); 383 if (c1 == NULL) { 384 PJ_LOG(3,("", INDENT "err: unable to get valid pair for ice1 " 385 "component %d", i+1)); 386 return start_err - 2; 387 } 388 389 c2 = pj_ice_strans_get_valid_pair(ept2->ice, i+1); 390 if (c2 == NULL) { 391 PJ_LOG(3,("", INDENT "err: unable to get valid pair for ice2 " 392 "component %d", i+1)); 393 return start_err - 4; 394 } 395 396 if (pj_sockaddr_cmp(&c1->rcand->addr, &c2->lcand->addr) != 0) { 397 PJ_LOG(3,("", INDENT "err: candidate pair does not match " 398 "for component %d", i+1)); 399 return start_err - 6; 400 } 401 } 402 403 /* Extra components must not have valid pair */ 404 for (; i<max_cnt; ++i) { 405 if (ept1->cfg.comp_cnt>i && 406 pj_ice_strans_get_valid_pair(ept1->ice, i+1) != NULL) 407 { 408 PJ_LOG(3,("", INDENT "err: ice1 shouldn't have valid pair " 409 "for component %d", i+1)); 410 return start_err - 8; 411 } 412 if (ept2->cfg.comp_cnt>i && 413 pj_ice_strans_get_valid_pair(ept2->ice, i+1) != NULL) 414 { 415 PJ_LOG(3,("", INDENT "err: ice2 shouldn't have valid pair " 416 "for component %d", i+1)); 417 return start_err - 9; 418 } 419 } 107 420 108 421 return 0; … … 110 423 111 424 112 static pj_status_t start_ice(pj_ice_strans *ist, pj_ice_strans *remote) 113 { 114 unsigned count; 115 pj_ice_sess_cand cand[PJ_ICE_MAX_CAND]; 116 pj_status_t status; 117 118 count = PJ_ARRAY_SIZE(cand); 119 status = pj_ice_strans_enum_cands(remote, &count, cand); 120 if (status != PJ_SUCCESS) 121 return status; 122 123 return pj_ice_strans_start_ice(ist, &remote->ice->rx_ufrag, &remote->ice->rx_pass, 124 count, cand); 125 } 126 127 128 struct dummy_cand 129 { 130 unsigned comp_id; 131 pj_ice_cand_type type; 132 const char *addr; 133 unsigned port; 134 }; 135 136 static int init_ice_st(pj_ice_strans *ice_st, 137 pj_bool_t add_valid_comp, 138 unsigned dummy_cnt, 139 struct dummy_cand cand[]) 140 { 141 pj_str_t a; 142 pj_status_t status; 143 unsigned i; 144 145 /* Create components */ 146 for (i=0; i<ice_st->comp_cnt; ++i) { 147 status = pj_ice_strans_create_comp(ice_st, i+1, PJ_ICE_ST_OPT_DONT_ADD_CAND, NULL); 148 if (status != PJ_SUCCESS) 149 return -21; 150 } 151 152 /* Add dummy candidates */ 153 for (i=0; i<dummy_cnt; ++i) { 154 pj_sockaddr_in addr; 155 156 pj_sockaddr_in_init(&addr, pj_cstr(&a, cand[i].addr), (pj_uint16_t)cand[i].port); 157 status = pj_ice_strans_add_cand(ice_st, cand[i].comp_id, cand[i].type, 158 65535, &addr, PJ_FALSE); 159 if (status != PJ_SUCCESS) 160 return -22; 161 } 162 163 /* Add the real candidate */ 164 if (add_valid_comp) { 165 for (i=0; i<ice_st->comp_cnt; ++i) { 166 status = pj_ice_strans_add_cand(ice_st, i+1, PJ_ICE_CAND_TYPE_HOST, 65535, 167 &ice_st->comp[i]->local_addr.ipv4, PJ_TRUE); 168 if (status != PJ_SUCCESS) 169 return -23; 170 } 425 #define WAIT_UNTIL(timeout,expr, RC) { \ 426 pj_time_val t0, t; \ 427 pj_gettimeofday(&t0); \ 428 RC = -1; \ 429 for (;;) { \ 430 poll_events(stun_cfg, 10, PJ_FALSE); \ 431 pj_gettimeofday(&t); \ 432 if (expr) { \ 433 rc = PJ_SUCCESS; \ 434 break; \ 435 } \ 436 if (t.sec - t0.sec > (timeout)) break; \ 437 } \ 438 } 439 440 441 static int perform_test(const char *title, 442 pj_stun_config *stun_cfg, 443 unsigned server_flag, 444 struct test_cfg *caller_cfg, 445 struct test_cfg *callee_cfg) 446 { 447 pjlib_state pjlib_state; 448 struct test_sess *sess; 449 int rc; 450 451 PJ_LOG(3,("", INDENT "%s", title)); 452 453 capture_pjlib_state(stun_cfg, &pjlib_state); 454 455 rc = create_sess(stun_cfg, server_flag, caller_cfg, callee_cfg, &sess); 456 if (rc != 0) 457 return rc; 458 459 #define ALL_READY (sess->caller.result.init_status!=PJ_EPENDING && \ 460 sess->callee.result.init_status!=PJ_EPENDING) 461 462 /* Wait until both ICE transports are initialized */ 463 WAIT_UNTIL(30, ALL_READY, rc); 464 465 if (!ALL_READY) { 466 PJ_LOG(3,("", INDENT "err: init timed-out")); 467 destroy_sess(sess, 500); 468 return -100; 469 } 470 471 if (sess->caller.result.init_status != sess->caller.cfg.expected.init_status) { 472 app_perror(INDENT "err: caller init", sess->caller.result.init_status); 473 destroy_sess(sess, 500); 474 return -102; 475 } 476 if (sess->callee.result.init_status != sess->callee.cfg.expected.init_status) { 477 app_perror(INDENT "err: callee init", sess->callee.result.init_status); 478 destroy_sess(sess, 500); 479 return -104; 480 } 481 482 /* Failure condition */ 483 if (sess->caller.result.init_status != PJ_SUCCESS || 484 sess->callee.result.init_status != PJ_SUCCESS) 485 { 486 rc = 0; 487 goto on_return; 488 } 489 490 /* Init ICE on caller */ 491 rc = pj_ice_strans_init_ice(sess->caller.ice, sess->caller.cfg.role, 492 &sess->caller.ufrag, &sess->caller.pass); 493 if (rc != PJ_SUCCESS) { 494 app_perror(INDENT "err: caller pj_ice_strans_init_ice()", rc); 495 destroy_sess(sess, 500); 496 return -100; 497 } 498 499 /* Init ICE on callee */ 500 rc = pj_ice_strans_init_ice(sess->callee.ice, sess->callee.cfg.role, 501 &sess->callee.ufrag, &sess->callee.pass); 502 if (rc != PJ_SUCCESS) { 503 app_perror(INDENT "err: callee pj_ice_strans_init_ice()", rc); 504 destroy_sess(sess, 500); 505 return -110; 506 } 507 508 /* Start ICE on callee */ 509 rc = start_ice(&sess->callee, &sess->caller); 510 if (rc != PJ_SUCCESS) { 511 destroy_sess(sess, 500); 512 return -120; 513 } 514 515 /* Wait for callee's answer_delay */ 516 poll_events(stun_cfg, sess->callee.cfg.answer_delay, PJ_FALSE); 517 518 /* Start ICE on caller */ 519 rc = start_ice(&sess->caller, &sess->callee); 520 if (rc != PJ_SUCCESS) { 521 destroy_sess(sess, 500); 522 return -130; 523 } 524 525 /* Wait until negotiation is complete on both endpoints */ 526 #define ALL_DONE (sess->caller.result.nego_status!=PJ_EPENDING && \ 527 sess->callee.result.nego_status!=PJ_EPENDING) 528 WAIT_UNTIL(30, ALL_DONE, rc); 529 530 if (!ALL_DONE) { 531 PJ_LOG(3,("", INDENT "err: negotiation timed-out")); 532 destroy_sess(sess, 500); 533 return -140; 534 } 535 536 if (sess->caller.result.nego_status != sess->caller.cfg.expected.nego_status) { 537 app_perror(INDENT "err: caller negotiation failed", sess->caller.result.nego_status); 538 destroy_sess(sess, 500); 539 return -150; 540 } 541 542 if (sess->callee.result.nego_status != sess->callee.cfg.expected.nego_status) { 543 app_perror(INDENT "err: callee negotiation failed", sess->callee.result.nego_status); 544 destroy_sess(sess, 500); 545 return -160; 546 } 547 548 /* Verify that both agents have agreed on the same pair */ 549 rc = check_pair(&sess->caller, &sess->callee, -170); 550 if (rc != 0) { 551 destroy_sess(sess, 500); 552 return rc; 553 } 554 rc = check_pair(&sess->callee, &sess->caller, -180); 555 if (rc != 0) { 556 destroy_sess(sess, 500); 557 return rc; 558 } 559 560 /* Looks like everything is okay */ 561 562 /* Destroy ICE stream transports first to let it de-allocate 563 * TURN relay (otherwise there'll be timer/memory leak, unless 564 * we wait for long time in the last poll_events() below). 565 */ 566 if (sess->caller.ice) { 567 pj_ice_strans_destroy(sess->caller.ice); 568 sess->caller.ice = NULL; 569 } 570 571 if (sess->callee.ice) { 572 pj_ice_strans_destroy(sess->callee.ice); 573 sess->callee.ice = NULL; 574 } 575 576 on_return: 577 /* Wait.. */ 578 poll_events(stun_cfg, 500, PJ_FALSE); 579 580 /* Now destroy everything */ 581 destroy_sess(sess, 500); 582 583 /* Flush events */ 584 poll_events(stun_cfg, 100, PJ_FALSE); 585 586 rc = check_pjlib_state(stun_cfg, &pjlib_state); 587 if (rc != 0) { 588 return rc; 171 589 } 172 590 … … 174 592 } 175 593 176 177 /* When ICE completes, both agents should agree on the same candidate pair. 178 * Check that the remote address selected by agent1 is equal to the 179 * local address of selected by agent 2. 180 */ 181 static int verify_address(pj_ice_strans *agent1, pj_ice_strans *agent2, 182 unsigned comp_id) 183 { 184 pj_ice_sess_cand *rcand, *lcand; 185 int lcand_id; 186 187 if (agent1->ice->comp[comp_id-1].valid_check == NULL) { 188 PJ_LOG(3,(THIS_FILE, "....error: valid_check not set for comp_id %d", comp_id)); 189 return -60; 190 } 191 192 /* Get default remote candidate of agent 1 */ 193 rcand = agent1->ice->comp[comp_id-1].valid_check->rcand; 194 195 /* Get default local candidate of agent 2 */ 196 pj_ice_sess_find_default_cand(agent2->ice, comp_id, &lcand_id); 197 if (lcand_id < 0) 198 return -62; 199 200 lcand = &agent2->ice->lcand[lcand_id]; 201 202 if (pj_memcmp(&rcand->addr, &lcand->addr, sizeof(pj_sockaddr_in))!=0) { 203 PJ_LOG(3,(THIS_FILE, "....error: the selected addresses are incorrect for comp_id %d", comp_id)); 204 return -64; 205 } 206 207 return 0; 208 } 209 210 211 /* Perform ICE test with the following parameters: 212 * 213 * - title: The title of the test 214 * - ocand_cnt, 215 * ocand Additional candidates to be added to offerer 216 * - acand_cnt, 217 * acand Additional candidates to be added to answerer 218 * 219 * The additional candidates are normally invalid candidates, meaning 220 * they won't be reachable by the agents. They are used to "confuse" 221 * ICE processing. 222 */ 223 static int perform_ice_test(const char *title, 224 pj_bool_t expected_success, 225 unsigned comp_cnt, 226 pj_bool_t add_valid_comp, 227 unsigned wait_before_send, 228 unsigned max_total_time, 229 unsigned ocand_cnt, 230 struct dummy_cand ocand[], 231 unsigned acand_cnt, 232 struct dummy_cand acand[]) 233 { 234 pj_ice_strans *im1, *im2; 235 pj_ice_strans_cb icest_cb; 236 struct ice_data *id1, *id2; 237 pj_timestamp t_start, t_end; 594 #define ROLE1 PJ_ICE_SESS_ROLE_CONTROLLED 595 #define ROLE2 PJ_ICE_SESS_ROLE_CONTROLLING 596 597 int ice_test(void) 598 { 599 pj_pool_t *pool; 600 pj_stun_config stun_cfg; 238 601 unsigned i; 239 pj_str_t data_from_offerer, data_from_answerer; 240 pj_status_t status; 241 242 #define CHECK_COMPLETE() if (id1->complete && id2->complete) { \ 243 if (t_end.u32.lo==0) pj_get_timestamp(&t_end); \ 244 } else {} 245 246 PJ_LOG(3,(THIS_FILE, "...%s", title)); 247 248 pj_bzero(&t_end, sizeof(t_end)); 249 250 pj_bzero(&icest_cb, sizeof(icest_cb)); 251 icest_cb.on_ice_complete = &on_ice_complete; 252 icest_cb.on_rx_data = &on_rx_data; 253 254 /* Create first ICE */ 255 status = pj_ice_strans_create(&stun_cfg, "offerer", comp_cnt, NULL, &icest_cb, &im1); 256 if (status != PJ_SUCCESS) 257 return -20; 258 259 id1 = PJ_POOL_ZALLOC_T(im1->pool, struct ice_data); 260 id1->obj_name = "offerer"; 261 im1->user_data = id1; 262 263 /* Init components */ 264 status = init_ice_st(im1, add_valid_comp, ocand_cnt, ocand); 265 if (status != 0) 266 return status; 267 268 /* Create second ICE */ 269 status = pj_ice_strans_create(&stun_cfg, "answerer", comp_cnt, NULL, &icest_cb, &im2); 270 if (status != PJ_SUCCESS) 271 return -25; 272 273 id2 = PJ_POOL_ZALLOC_T(im2->pool, struct ice_data); 274 id2->obj_name = "answerer"; 275 im2->user_data = id2; 276 277 /* Init components */ 278 status = init_ice_st(im2, add_valid_comp, acand_cnt, acand); 279 if (status != 0) 280 return status; 281 282 283 /* Init ICE on im1 */ 284 status = pj_ice_strans_init_ice(im1, PJ_ICE_SESS_ROLE_CONTROLLING, NULL, NULL); 285 if (status != PJ_SUCCESS) 286 return -29; 287 288 /* Init ICE on im2 */ 289 status = pj_ice_strans_init_ice(im2, PJ_ICE_SESS_ROLE_CONTROLLED, NULL, NULL); 290 if (status != PJ_SUCCESS) 291 return -29; 292 293 /* Start ICE on im2 */ 294 status = start_ice(im2, im1); 295 if (status != PJ_SUCCESS) { 296 app_perror(" error starting ICE", status); 297 return -30; 298 } 299 300 /* Start ICE on im1 */ 301 status = start_ice(im1, im2); 302 if (status != PJ_SUCCESS) 303 return -35; 304 305 /* Apply delay to let other checks commence */ 306 pj_thread_sleep(40); 307 308 /* Mark start time */ 309 pj_get_timestamp(&t_start); 310 311 /* Poll for wait_before_send msecs before we send the first data */ 312 if (expected_success) { 313 for (;;) { 314 pj_timestamp t_now; 315 316 handle_events(1); 317 318 CHECK_COMPLETE(); 319 320 pj_get_timestamp(&t_now); 321 if (pj_elapsed_msec(&t_start, &t_now) >= wait_before_send) 322 break; 323 } 324 325 /* Send data. It must be successful! */ 326 data_from_offerer = pj_str("from offerer"); 327 status = pj_ice_sess_send_data(im1->ice, 1, data_from_offerer.ptr, data_from_offerer.slen); 328 if (status != PJ_SUCCESS) 329 return -47; 330 331 data_from_answerer = pj_str("from answerer"); 332 status = pj_ice_sess_send_data(im2->ice, 1, data_from_answerer.ptr, data_from_answerer.slen); 333 if (status != PJ_SUCCESS) { 334 app_perror(" error sending packet", status); 335 return -48; 336 } 337 338 /* Poll to allow data to be received */ 339 for (;;) { 340 pj_timestamp t_now; 341 handle_events(1); 342 CHECK_COMPLETE(); 343 pj_get_timestamp(&t_now); 344 if (pj_elapsed_msec(&t_start, &t_now) >= (wait_before_send + 200)) 345 break; 346 } 347 } 348 349 /* Just wait until both completes, or timed out */ 350 while (!id1->complete || !id2->complete) { 351 pj_timestamp t_now; 352 353 handle_events(1); 354 355 CHECK_COMPLETE(); 356 pj_get_timestamp(&t_now); 357 if (pj_elapsed_msec(&t_start, &t_now) >= max_total_time) { 358 PJ_LOG(3,(THIS_FILE, "....error: timed-out")); 359 return -50; 360 } 361 } 362 363 /* Mark end-time */ 364 CHECK_COMPLETE(); 365 366 /* If expected to fail, then just check that both fail */ 367 if (!expected_success) { 368 /* Check status */ 369 if (id1->err_code == PJ_SUCCESS) 370 return -51; 371 if (id2->err_code == PJ_SUCCESS) 372 return -52; 373 goto on_return; 374 } 375 376 /* Check status */ 377 if (id1->err_code != PJ_SUCCESS) 378 return -53; 379 if (id2->err_code != PJ_SUCCESS) 380 return -56; 381 382 /* Verify that offerer gets answerer's transport address */ 383 for (i=0; i<comp_cnt; ++i) { 384 status = verify_address(im1, im2, i+1); 385 if (status != 0) 386 return status; 387 } 388 389 /* And the other way around */ 390 for (i=0; i<comp_cnt; ++i) { 391 status = verify_address(im2, im1, i+1); 392 if (status != 0) 393 return status; 394 } 395 396 /* Check that data is received in offerer */ 397 if (id1->rx_rtp_cnt != 1) { 398 PJ_LOG(3,(THIS_FILE, "....error: data not received in offerer")); 399 return -80; 400 } 401 if (pj_strcmp2(&data_from_answerer, id1->last_rx_rtp_data) != 0) { 402 PJ_LOG(3,(THIS_FILE, "....error: data mismatch in offerer")); 403 return -82; 404 } 405 406 /* And the same in answerer */ 407 if (id2->rx_rtp_cnt != 1) { 408 PJ_LOG(3,(THIS_FILE, "....error: data not received in answerer")); 409 return -84; 410 } 411 if (pj_strcmp2(&data_from_offerer, id2->last_rx_rtp_data) != 0) { 412 PJ_LOG(3,(THIS_FILE, "....error: data mismatch in answerer")); 413 return -82; 414 } 415 602 int rc; 603 struct sess_cfg_t { 604 const char *title; 605 unsigned server_flag; 606 struct test_cfg ua1; 607 struct test_cfg ua2; 608 } sess_cfg[] = 609 { 610 /* Role comp# host? stun? turn? flag? ans_del snd_del des_del */ 611 { 612 "hosts candidates only", 613 0xFFFF, 614 {ROLE1, 1, YES, NO, NO, NO, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}}, 615 {ROLE2, 1, YES, NO, NO, NO, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}} 616 }, 617 { 618 "host and srflxes", 619 0xFFFF, 620 {ROLE1, 1, YES, YES, NO, NO, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}}, 621 {ROLE2, 1, YES, YES, NO, NO, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}} 622 }, 623 { 624 "host vs relay", 625 0xFFFF, 626 {ROLE1, 1, YES, NO, NO, NO, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}}, 627 {ROLE2, 1, NO, NO, YES, NO, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}} 628 }, 629 { 630 "relay vs host", 631 0xFFFF, 632 {ROLE1, 1, NO, NO, YES, NO, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}}, 633 {ROLE2, 1, YES, NO, NO, NO, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}} 634 }, 635 { 636 "relay vs relay", 637 0xFFFF, 638 {ROLE1, 1, NO, NO, YES, NO, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}}, 639 {ROLE2, 1, NO, NO, YES, NO, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}} 640 }, 641 { 642 "all candidates", 643 0xFFFF, 644 {ROLE1, 1, YES, YES, YES, NO, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}}, 645 {ROLE2, 1, YES, YES, YES, NO, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}} 646 }, 647 }; 648 649 pool = pj_pool_create(mem, NULL, 512, 512, NULL); 650 rc = create_stun_config(pool, &stun_cfg); 651 if (rc != PJ_SUCCESS) { 652 pj_pool_release(pool); 653 return -7; 654 } 655 656 /* Simple test first with host candidate */ 657 if (1) { 658 struct sess_cfg_t cfg = 659 { 660 "Basic with host candidates", 661 0x0, 662 /* Role comp# host? stun? turn? flag? ans_del snd_del des_del */ 663 {ROLE1, 1, YES, NO, NO, 0, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}}, 664 {ROLE2, 1, YES, NO, NO, 0, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}} 665 }; 666 667 rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag, 668 &cfg.ua1, &cfg.ua2); 669 if (rc != 0) 670 goto on_return; 671 672 cfg.ua1.comp_cnt = 4; 673 cfg.ua2.comp_cnt = 4; 674 rc = perform_test("Basic with host candidates, 4 components", 675 &stun_cfg, cfg.server_flag, 676 &cfg.ua1, &cfg.ua2); 677 if (rc != 0) 678 goto on_return; 679 } 680 681 /* Simple test first with srflx candidate */ 682 if (1) { 683 struct sess_cfg_t cfg = 684 { 685 "Basic with srflx candidates", 686 0xFFFF, 687 /* Role comp# host? stun? turn? flag? ans_del snd_del des_del */ 688 {ROLE1, 1, YES, YES, NO, 0, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}}, 689 {ROLE2, 1, YES, YES, NO, 0, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}} 690 }; 691 692 rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag, 693 &cfg.ua1, &cfg.ua2); 694 if (rc != 0) 695 goto on_return; 696 697 cfg.ua1.comp_cnt = 4; 698 cfg.ua2.comp_cnt = 4; 699 700 rc = perform_test("Basic with srflx candidates, 4 components", 701 &stun_cfg, cfg.server_flag, 702 &cfg.ua1, &cfg.ua2); 703 if (rc != 0) 704 goto on_return; 705 } 706 707 /* Simple test with relay candidate */ 708 if (1) { 709 struct sess_cfg_t cfg = 710 { 711 "Basic with relay candidates", 712 0xFFFF, 713 /* Role comp# host? stun? turn? flag? ans_del snd_del des_del */ 714 {ROLE1, 1, NO, NO, YES, 0, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}}, 715 {ROLE2, 1, NO, NO, YES, 0, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS}} 716 }; 717 718 rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag, 719 &cfg.ua1, &cfg.ua2); 720 if (rc != 0) 721 goto on_return; 722 723 cfg.ua1.comp_cnt = 4; 724 cfg.ua2.comp_cnt = 4; 725 726 rc = perform_test("Basic with relay candidates, 4 components", 727 &stun_cfg, cfg.server_flag, 728 &cfg.ua1, &cfg.ua2); 729 if (rc != 0) 730 goto on_return; 731 } 732 733 /* Failure test with STUN resolution */ 734 if (1) { 735 struct sess_cfg_t cfg = 736 { 737 "STUN resolution failure", 738 0x0, 739 /* Role comp# host? stun? turn? flag? ans_del snd_del des_del */ 740 {ROLE1, 2, NO, YES, NO, 0, 0, 0, 0, {PJNATH_ESTUNTIMEDOUT, -1}}, 741 {ROLE2, 2, NO, YES, NO, 0, 0, 0, 0, {PJNATH_ESTUNTIMEDOUT, -1}} 742 }; 743 744 rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag, 745 &cfg.ua1, &cfg.ua2); 746 if (rc != 0) 747 goto on_return; 748 749 cfg.ua1.client_flag |= DEL_ON_ERR; 750 cfg.ua2.client_flag |= DEL_ON_ERR; 751 752 rc = perform_test("STUN resolution failure with destroy on callback", 753 &stun_cfg, cfg.server_flag, 754 &cfg.ua1, &cfg.ua2); 755 if (rc != 0) 756 goto on_return; 757 } 758 759 /* Failure test with TURN resolution */ 760 if (1) { 761 struct sess_cfg_t cfg = 762 { 763 "TURN allocation failure", 764 0xFFFF, 765 /* Role comp# host? stun? turn? flag? ans_del snd_del des_del */ 766 {ROLE1, 4, NO, NO, YES, WRONG_TURN, 0, 0, 0, {PJ_STATUS_FROM_STUN_CODE(401), -1}}, 767 {ROLE2, 4, NO, NO, YES, WRONG_TURN, 0, 0, 0, {PJ_STATUS_FROM_STUN_CODE(401), -1}} 768 }; 769 770 rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag, 771 &cfg.ua1, &cfg.ua2); 772 if (rc != 0) 773 goto on_return; 774 775 cfg.ua1.client_flag |= DEL_ON_ERR; 776 cfg.ua2.client_flag |= DEL_ON_ERR; 777 778 rc = perform_test("TURN allocation failure with destroy on callback", 779 &stun_cfg, cfg.server_flag, 780 &cfg.ua1, &cfg.ua2); 781 if (rc != 0) 782 goto on_return; 783 } 784 785 /* STUN failure, testing TURN deallocation */ 786 if (1) { 787 struct sess_cfg_t cfg = 788 { 789 "STUN failure, testing TURN deallocation", 790 0xFFFF & (~(CREATE_STUN_SERVER)), 791 /* Role comp# host? stun? turn? flag? ans_del snd_del des_del */ 792 {ROLE1, 2, YES, YES, YES, 0, 0, 0, 0, {PJNATH_ESTUNTIMEDOUT, -1}}, 793 {ROLE2, 2, YES, YES, YES, 0, 0, 0, 0, {PJNATH_ESTUNTIMEDOUT, -1}} 794 }; 795 796 rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag, 797 &cfg.ua1, &cfg.ua2); 798 if (rc != 0) 799 goto on_return; 800 801 cfg.ua1.client_flag |= DEL_ON_ERR; 802 cfg.ua2.client_flag |= DEL_ON_ERR; 803 804 rc = perform_test("STUN failure, testing TURN deallocation (cb)", 805 &stun_cfg, cfg.server_flag, 806 &cfg.ua1, &cfg.ua2); 807 if (rc != 0) 808 goto on_return; 809 } 810 811 rc = 0; 812 /* Iterate each test item */ 813 for (i=0; i<PJ_ARRAY_SIZE(sess_cfg); ++i) { 814 struct sess_cfg_t *cfg = &sess_cfg[i]; 815 unsigned delay[] = { 50, 2000 }; 816 unsigned d; 817 818 PJ_LOG(3,("", " %s", cfg->title)); 819 820 /* For each test item, test with various answer delay */ 821 for (d=0; d<PJ_ARRAY_SIZE(delay); ++d) { 822 struct role_t { 823 pj_ice_sess_role ua1; 824 pj_ice_sess_role ua2; 825 } role[] = 826 { 827 { ROLE1, ROLE2}, 828 { ROLE2, ROLE1}, 829 { ROLE1, ROLE1}, 830 { ROLE2, ROLE2} 831 }; 832 unsigned j; 833 834 cfg->ua1.answer_delay = delay[d]; 835 cfg->ua2.answer_delay = delay[d]; 836 837 /* For each test item, test with role conflict scenarios */ 838 for (j=0; j<PJ_ARRAY_SIZE(role); ++j) { 839 unsigned k1; 840 841 cfg->ua1.role = role[j].ua1; 842 cfg->ua2.role = role[j].ua2; 843 844 /* For each test item, test with different number of components */ 845 for (k1=1; k1<=2; ++k1) { 846 unsigned k2; 847 848 cfg->ua1.comp_cnt = k1; 849 850 for (k2=1; k2<=2; ++k2) { 851 char title[120]; 852 853 sprintf(title, 854 "%s/%s, %dms answer delay, %d vs %d components", 855 pj_ice_sess_role_name(role[j].ua1), 856 pj_ice_sess_role_name(role[j].ua2), 857 delay[d], k1, k2); 858 859 cfg->ua2.comp_cnt = k2; 860 rc = perform_test(title, &stun_cfg, cfg->server_flag, 861 &cfg->ua1, &cfg->ua2); 862 if (rc != 0) 863 goto on_return; 864 } 865 } 866 } 867 } 868 } 416 869 417 870 on_return: 418 419 /* Done */ 420 PJ_LOG(3,(THIS_FILE, "....success: ICE completed in %d msec, waiting..", 421 pj_elapsed_msec(&t_start, &t_end))); 422 423 /* Wait for some more time */ 424 for (;;) { 425 pj_timestamp t_now; 426 427 pj_get_timestamp(&t_now); 428 if (pj_elapsed_msec(&t_start, &t_now) > max_total_time) 429 break; 430 431 handle_events(1); 432 } 433 434 435 pj_ice_strans_destroy(im1); 436 pj_ice_strans_destroy(im2); 437 handle_events(100); 438 return 0; 439 } 440 441 442 int ice_test(void) 443 { 444 int rc = 0; 445 pj_pool_t *pool; 446 pj_ioqueue_t *ioqueue; 447 pj_timer_heap_t *timer_heap; 448 enum { D1=500, D2=5000, D3=15000 }; 449 struct dummy_cand ocand[] = 450 { 451 {1, PJ_ICE_CAND_TYPE_SRFLX, "127.1.1.1", 65534 }, 452 {2, PJ_ICE_CAND_TYPE_SRFLX, "127.1.1.1", 65535 }, 453 }; 454 struct dummy_cand acand[] = 455 { 456 {1, PJ_ICE_CAND_TYPE_SRFLX, "127.2.2.2", 65534 }, 457 {2, PJ_ICE_CAND_TYPE_SRFLX, "127.2.2.2", 65535 }, 458 }; 459 460 pool = pj_pool_create(mem, NULL, 4000, 4000, NULL); 461 pj_ioqueue_create(pool, 12, &ioqueue); 462 pj_timer_heap_create(pool, 100, &timer_heap); 463 464 pj_stun_config_init(&stun_cfg, mem, 0, ioqueue, timer_heap); 465 466 #if 0 467 pj_log_set_level(5); 468 #endif 469 470 //goto test; 471 472 /* Basic create/destroy */ 473 rc = ice_basic_create_destroy_test(); 474 if (rc != 0) 475 goto on_return; 476 477 /* Direct communication */ 478 rc = perform_ice_test("Simple test (1 component)", PJ_TRUE, 1, PJ_TRUE, D1, D2, 0, NULL, 0, NULL); 479 if (rc != 0) 480 goto on_return; 481 482 /* Failure case (all checks fail) */ 483 #if 0 484 /* Cannot just add an SRFLX candidate; it needs a base */ 485 rc = perform_ice_test("Failure case (all checks fail)", PJ_FALSE, 1, PJ_FALSE, D3, D3, 1, ocand, 1, acand); 486 if (rc != 0) 487 goto on_return; 488 #endif 489 490 /* Direct communication with invalid address */ 491 rc = perform_ice_test("With 1 unreachable address", PJ_TRUE, 1, PJ_TRUE, D1, D2, 1, ocand, 0, NULL); 492 if (rc != 0) 493 goto on_return; 494 495 /* Direct communication with invalid address */ 496 rc = perform_ice_test("With 2 unreachable addresses (one each)", PJ_TRUE, 1, PJ_TRUE, D1, D2, 1, ocand, 1, acand); 497 if (rc != 0) 498 goto on_return; 499 500 /* Direct communication with two components */ 501 //test: 502 rc = perform_ice_test("With two components (RTP and RTCP)", PJ_TRUE, 2, PJ_TRUE, D1, D2, 0, NULL, 0, NULL); 503 if (rc != 0) 504 goto on_return; 505 506 goto on_return; 507 508 /* Direct communication with mismatch number of components */ 509 510 /* Direct communication with 2 components and 2 invalid address */ 511 rc = perform_ice_test("With 2 two components and 2 unreachable address", PJ_TRUE, 2, PJ_TRUE, D1, D2, 1, ocand, 1, acand); 512 if (rc != 0) 513 goto on_return; 514 515 516 517 on_return: 518 pj_log_set_level(3); 519 pj_ioqueue_destroy(stun_cfg.ioqueue); 871 destroy_stun_config(&stun_cfg); 520 872 pj_pool_release(pool); 521 873 return rc; -
pjproject/trunk/pjnath/src/pjnath-test/sess_auth.c
r1929 r1988 1099 1099 /* If REALM doesn't match, server must respond with 401 1100 1100 */ 1101 #if 0 1102 // STUN session now will just use the realm sent in the 1103 // response, so this test will fail because it will 1104 // authenticate successfully. 1105 1101 1106 rc = run_client_test("Invalid REALM (long term)", // title 1102 1107 PJ_TRUE, // server responding … … 1117 1122 goto done; 1118 1123 } 1124 #endif 1119 1125 1120 1126 /* Invalid HMAC */ -
pjproject/trunk/pjnath/src/pjnath-test/test.c
r1877 r1988 30 30 } 31 31 32 pj_status_t create_stun_config(pj_pool_t *pool, pj_stun_config *stun_cfg) 33 { 34 pj_ioqueue_t *ioqueue; 35 pj_timer_heap_t *timer_heap; 36 pj_status_t status; 37 38 status = pj_ioqueue_create(pool, 64, &ioqueue); 39 if (status != PJ_SUCCESS) { 40 app_perror(" pj_ioqueue_create()", status); 41 return status; 42 } 43 44 status = pj_timer_heap_create(pool, 256, &timer_heap); 45 if (status != PJ_SUCCESS) { 46 app_perror(" pj_timer_heap_create()", status); 47 pj_ioqueue_destroy(ioqueue); 48 return status; 49 } 50 51 pj_stun_config_init(stun_cfg, mem, 0, ioqueue, timer_heap); 52 53 return PJ_SUCCESS; 54 } 55 56 void destroy_stun_config(pj_stun_config *stun_cfg) 57 { 58 if (stun_cfg->timer_heap) { 59 pj_timer_heap_destroy(stun_cfg->timer_heap); 60 stun_cfg->timer_heap = NULL; 61 } 62 if (stun_cfg->ioqueue) { 63 pj_ioqueue_destroy(stun_cfg->ioqueue); 64 stun_cfg->ioqueue = NULL; 65 } 66 } 67 68 void poll_events(pj_stun_config *stun_cfg, unsigned msec, 69 pj_bool_t first_event_only) 70 { 71 pj_time_val stop_time; 72 int count = 0; 73 74 pj_gettimeofday(&stop_time); 75 stop_time.msec += msec; 76 pj_time_val_normalize(&stop_time); 77 78 /* Process all events for the specified duration. */ 79 for (;;) { 80 pj_time_val timeout = {0, 1}, now; 81 int c; 82 83 c = pj_timer_heap_poll( stun_cfg->timer_heap, NULL ); 84 if (c > 0) 85 count += c; 86 87 //timeout.sec = timeout.msec = 0; 88 c = pj_ioqueue_poll( stun_cfg->ioqueue, &timeout); 89 if (c > 0) 90 count += c; 91 92 pj_gettimeofday(&now); 93 if (PJ_TIME_VAL_GTE(now, stop_time)) 94 break; 95 96 if (first_event_only && count >= 0) 97 break; 98 } 99 } 100 101 void capture_pjlib_state(pj_stun_config *cfg, struct pjlib_state *st) 102 { 103 pj_caching_pool *cp; 104 105 st->timer_cnt = pj_timer_heap_count(cfg->timer_heap); 106 107 cp = (pj_caching_pool*)mem; 108 st->pool_used_cnt = cp->used_count; 109 } 110 111 int check_pjlib_state(pj_stun_config *cfg, 112 const struct pjlib_state *initial_st) 113 { 114 struct pjlib_state current_state; 115 int rc = 0; 116 117 capture_pjlib_state(cfg, ¤t_state); 118 119 if (current_state.timer_cnt > initial_st->timer_cnt) { 120 PJ_LOG(3,("", " error: possibly leaking timer")); 121 rc |= ERR_TIMER_LEAK; 122 } 123 124 if (current_state.pool_used_cnt > initial_st->pool_used_cnt) { 125 PJ_LOG(3,("", " error: possibly leaking memory")); 126 PJ_LOG(3,("", " dumping memory pool:")); 127 pj_pool_factory_dump(mem, PJ_TRUE); 128 rc |= ERR_MEMORY_LEAK; 129 } 130 131 return rc; 132 } 133 134 32 135 #define DO_TEST(test) do { \ 33 136 PJ_LOG(3, ("test", "Running %s...", #test)); \ … … 65 168 pj_caching_pool_init( &caching_pool, &pj_pool_factory_default_policy, 0 ); 66 169 170 pjlib_util_init(); 67 171 pjnath_init(); 68 172 … … 74 178 #if INCLUDE_ICE_TEST 75 179 DO_TEST(ice_test()); 180 #endif 181 182 #if INCLUDE_STUN_SOCK_TEST 183 DO_TEST(stun_sock_test()); 184 #endif 185 186 #if INCLUDE_TURN_SOCK_TEST 187 DO_TEST(turn_sock_test()); 76 188 #endif 77 189 -
pjproject/trunk/pjnath/src/pjnath-test/test.h
r1877 r1988 23 23 #define INCLUDE_STUN_TEST 1 24 24 #define INCLUDE_ICE_TEST 1 25 #define INCLUDE_STUN_SOCK_TEST 1 26 #define INCLUDE_TURN_SOCK_TEST 1 25 27 26 28 int stun_test(void); 27 29 int sess_auth_test(void); 30 int stun_sock_test(void); 31 int turn_sock_test(void); 28 32 int ice_test(void);