00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <osipparser2/osip_port.h>
00022
00023 #ifndef _INTERNAL_H_
00024 #define _INTERNAL_H_
00025
00026 #ifdef __BORLANDC__
00027 #define _timeb timeb
00028 #define _ftime ftime
00029 #endif
00030
00031 #ifndef DOXYGEN
00032
00033 #if defined(WIN32) || defined(_WIN32_WCE)
00034
00035 struct timeval {
00036 long tv_sec;
00037 long tv_usec;
00038 };
00039 #endif
00040
00046 typedef struct __payload __payload_t;
00047
00048 struct __payload
00049 {
00050 char *payload;
00051
00052 char *number_of_port;
00053 char *proto;
00054 char *c_nettype;
00055 char *c_addrtype;
00056 char *c_addr;
00057 char *c_addr_multicast_ttl;
00058 char *c_addr_multicast_int;
00059
00060 char *a_rtpmap;
00061 };
00062
00063
00068 int __payload_init (__payload_t ** payload);
00073 void __payload_free (__payload_t * payload);
00074
00075
00076 #ifdef OSIP_MT
00077
00078
00079
00080
00081
00082 #if !defined(__VXWORKS_OS__) && !defined(__PSOS__) && \
00083 !defined(WIN32) && !defined(_WIN32_WCE) && !defined(HAVE_PTHREAD_WIN32) && \
00084 !defined(HAVE_PTHREAD) && !defined(HAVE_PTHREAD_H) && !defined(HAVE_PTH_PTHREAD_H)
00085 #error No thread implementation found!
00086 #endif
00087
00088
00089
00090
00091 #if defined(HAVE_PTHREAD) || defined(HAVE_PTHREAD_H) || defined(HAVE_PTH_PTHREAD_H) || \
00092 defined(HAVE_PTHREAD_WIN32)
00093 #include <pthread.h>
00094 typedef pthread_t osip_thread_t;
00095 #endif
00096
00097
00098 #if (defined(WIN32) || defined(_WIN32_WCE)) && !defined(HAVE_PTHREAD_WIN32)
00099
00100 #define _WINSOCKAPI_
00101 #include <windows.h>
00102 #undef _WINSOCKAPI_
00103 typedef struct
00104 {
00105 HANDLE h;
00106 unsigned id;
00107 }
00108 osip_thread_t;
00109 #endif
00110
00111 #ifdef __VXWORKS_OS__
00112 #include <taskLib.h>
00113 typedef struct
00114 {
00115 int id;
00116 }
00117 osip_thread_t;
00118 #endif
00119
00120 #ifdef __PSOS__
00121 #include <psos.h>
00122 typedef struct
00123 {
00124 unsigned long tid;
00125 }
00126 osip_thread_t;
00127 #endif
00128
00129
00130
00131
00132
00133 #if !defined(HAVE_SEMAPHORE_H) && !defined(HAVE_SYS_SEM_H) && \
00134 !defined(WIN32) && !defined(_WIN32_WCE) && !defined(HAVE_PTHREAD_WIN32) && \
00135 !defined(__PSOS__) && !defined(__VXWORKS_OS__)
00136 #error No semaphore implementation found
00137 #endif
00138
00139
00140 #if defined(HAVE_PTHREAD) || defined(HAVE_PTHREAD_H) || defined(HAVE_PTH_PTHREAD_H) || \
00141 defined(HAVE_PTHREAD_WIN32)
00142 typedef pthread_mutex_t osip_mutex_t;
00143 #endif
00144
00145 #ifdef __sun__
00146 #include <semaphore.h>
00147 #undef getdate
00148 #include <synch.h>
00149 #endif
00150
00151 #if (defined(HAVE_SEMAPHORE_H) && !defined(__APPLE_CC__)) || defined(HAVE_PTHREAD_WIN32)
00152 #include <semaphore.h>
00153 #ifdef __sun__
00154 #undef getdate
00155 #include <synch.h>
00156 #endif
00157
00161 typedef sem_t osip_sem_t;
00162
00163 #elif defined(HAVE_SYS_SEM_H)
00164 #include <sys/types.h>
00165 #include <sys/ipc.h>
00166 #include <sys/sem.h>
00167 typedef struct
00168 {
00169 int semid;
00170 }
00171 osip_sem_t;
00172 #endif
00173
00174
00175 #if (defined(WIN32) || defined(_WIN32_WCE)) && !defined(HAVE_PTHREAD_WIN32)
00176
00177 #define _WINSOCKAPI_
00178 #include <windows.h>
00179 #undef _WINSOCKAPI_
00180 typedef struct
00181 {
00182 HANDLE h;
00183 }
00184 osip_mutex_t;
00185 typedef struct
00186 {
00187 HANDLE h;
00188 }
00189 osip_sem_t;
00190 #endif
00191
00192 #ifdef __VXWORKS_OS__
00193 #include <semaphore.h>
00194 #include <semLib.h>
00195 typedef struct semaphore osip_mutex_t;
00196 typedef sem_t osip_sem_t;
00197 #endif
00198
00199 #ifdef __PSOS__
00200 #include <Types.h>
00201 #include <os.h>
00202 typedef struct
00203 {
00204 UInt32 id;
00205 }
00206 osip_mutex_t;
00207 typedef struct
00208 {
00209 UInt32 id;
00210 }
00211 osip_sem_t;
00212 #endif
00213
00214
00215
00216
00221 #if defined(HAVE_PTHREAD) || defined(HAVE_PTH_PTHREAD_H) || defined(HAVE_PTHREAD_WIN32)
00222 typedef struct osip_cond
00223 {
00224 pthread_cond_t cv;
00225 } osip_cond_t;
00226 #endif
00227
00228 #if (defined(WIN32) || defined(_WIN32_WCE)) && !defined(HAVE_PTHREAD_WIN32)
00229 typedef struct osip_cond
00230 {
00231 struct osip_mutex *mut;
00232 struct osip_sem *sem;
00233 } osip_cond_t;
00234 #endif
00235
00236 #if defined(__PSOS__) || defined(__VXWORKS_OS__)
00237 typedef struct osip_cond
00238 {
00239 struct osip_sem *sem;
00240 } osip_cond_t;
00241 #endif
00242
00243 #endif
00244
00245 #endif
00246
00247 #endif