00001 // Copyright (C) 1999-2001 Open Source Telecom Corporation. 00002 // 00003 // This program is free software; you can redistribute it and/or modify 00004 // it under the terms of the GNU General Public License as published by 00005 // the Free Software Foundation; either version 2 of the License, or 00006 // (at your option) any later version. 00007 // 00008 // This program is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 // GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License 00014 // along with this program; if not, write to the Free Software 00015 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00016 // 00017 // As a special exception to the GNU General Public License, permission is 00018 // granted for additional uses of the text contained in its release 00019 // of ccRTP. 00020 // 00021 // The exception is that, if you link the ccRTP library with other 00022 // files to produce an executable, this does not by itself cause the 00023 // resulting executable to be covered by the GNU General Public License. 00024 // Your use of that executable is in no way restricted on account of 00025 // linking the ccRTP library code into it. 00026 // 00027 // This exception does not however invalidate any other reasons why 00028 // the executable file might be covered by the GNU General Public License. 00029 // 00030 // This exception applies only to the code released under the 00031 // name ccRTP. If you copy code from other releases into a copy of 00032 // ccRTP, as the General Public License permits, the exception does 00033 // not apply to the code that you add in this way. To avoid misleading 00034 // anyone as to the status of such modified files, you must delete 00035 // this exception notice from them. 00036 // 00037 // If you write modifications of your own for ccRTP, it is your choice 00038 // whether to permit this exception to apply to your modifications. 00039 // If you do not wish that, delete this exception notice. 00040 00049 #include "config.h" 00050 #undef PACKAGE 00051 #undef VERSION 00052 #include "rtp.h" 00053 #include "rtpext.h" 00054 00055 // This is only of interest for developers, so it is included only if 00056 // --with-nana flag is given to configure 00057 #ifdef HAVE_LIBNANA 00058 # include "nana.h" 00059 # include "DL.h" 00060 #else 00061 # define I(e) /* empty */ 00062 # define DL(e) /* empty */ 00063 # define VDL(e) /* empty */ 00064 #endif 00065 00066 #ifdef HAVE_CSTDLIB 00067 #include <cstdlib> 00068 #else 00069 # ifdef HAVE_STDLIB_H 00070 # include <stdlib.h> 00071 # else 00072 # warning "Your system does not have cstdlib nor stdlib.h" 00073 #define getenv(w) ("unidentifiable_user") 00074 # endif //HAVE_STDLIB_H 00075 #endif //HAVE_CSTDLIB 00076 00077 #ifdef HAVE_SYS_UTSNAME_H 00078 # include <sys/utsname.h> 00079 #else 00080 # error "Portability problem: you do not have sys/utsname.h" 00081 #endif 00082 00083 00084 00085 00086 // This is for the main page in Doxygen documentation 00095 // This will make doxygen to generate example descriptions 00112 #pragma pack(1) 00113 struct ReceiverInfo 00114 { 00115 uint8 flost; 00116 uint8 lost_msb; 00117 uint16 lost_lsb; 00118 uint32 highest_seqnum; 00119 uint32 jitter; 00120 uint32 lsr; 00121 uint32 dlsr; 00122 }; 00123 00127 typedef struct 00128 { 00129 uint32 ssrc; 00130 ReceiverInfo rinfo; 00131 } RRBlock; 00132 00136 struct SenderInfo 00137 { 00138 uint32 NTP_msb; 00139 uint32 NTP_lsb; 00140 uint32 RTPtimestamp; 00141 uint32 packet_count; 00142 uint32 octet_count; 00143 }; 00144 00148 typedef struct 00149 { 00150 uint32 ssrc; 00151 SenderInfo sinfo; 00152 RRBlock blocks []; 00153 } SendReport; 00154 00161 typedef struct 00162 { 00163 uint32 ssrc; 00164 RRBlock blocks []; 00165 } RecvReport; 00166 00170 typedef struct 00171 { 00172 uint8 type; 00173 uint8 len; 00174 } SDESItem; 00175 00176 typedef struct 00177 { 00178 uint32 ssrc; 00179 SDESItem item; 00180 } SDESChunk; 00181 00182 typedef struct 00183 { 00184 uint32 ssrc; 00185 uint8 length; 00186 } BYEPacket; 00187 00188 typedef struct 00189 { 00190 char name [4]; 00191 char* data; 00192 } APPPacket; 00193 00197 struct RTCPPacket 00198 { 00199 RTCPFixedHeader fh; 00200 union 00201 { 00202 SendReport SR; 00203 RecvReport RR; 00204 SDESChunk SDES; 00205 BYEPacket BYE; 00206 APPPacket APP; 00207 } info; 00208 }; 00209 00213 typedef struct { 00214 RTCPFixedHeader fh; 00215 uint32 ssrc; 00216 uint8 length; 00217 char const reason[]; 00218 } BYEHeader; 00219 00220 typedef struct { 00221 RTCPFixedHeader fh; 00222 uint32 ssrc; 00223 char name[4]; 00224 } RTCPAPPHeader; 00225 #pragma pack() 00226