ccRTP
|
00001 // Copyright (C) 2001-2005 Federico Montesino Pouzols <fedemp@altern.org>. 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, you may use this file as part of a free software 00018 // library without restriction. Specifically, if other files instantiate 00019 // templates or use macros or inline functions from this file, or you compile 00020 // this file and link it with other files to produce an executable, this 00021 // file does not by itself cause the resulting executable to be covered by 00022 // the GNU General Public License. This exception does not however 00023 // invalidate any other reasons why the executable file might be covered by 00024 // the GNU General Public License. 00025 // 00026 // This exception applies only to the code released under the name GNU 00027 // ccRTP. If you copy code from other releases into a copy of GNU 00028 // ccRTP, as the General Public License permits, the exception does 00029 // not apply to the code that you add in this way. To avoid misleading 00030 // anyone as to the status of such modified files, you must delete 00031 // this exception notice from them. 00032 // 00033 // If you write modifications of your own for GNU ccRTP, it is your choice 00034 // whether to permit this exception to apply to your modifications. 00035 // If you do not wish that, delete this exception notice. 00036 // 00037 00038 #ifndef CCXX_RTP_BASE_H_ 00039 #define CCXX_RTP_BASE_H_ 00040 00041 #ifndef CCXX_SOCKET_H_ 00042 #include <commoncpp/config.h> 00043 #include <commoncpp/socket.h> 00044 #include <commoncpp/udp.h> 00045 #endif 00046 00047 #ifndef CCXX_PACKING 00048 #if defined(__GNUC__) 00049 #define CCXX_PACKED 00050 #elif !defined(__hpux) && !defined(_AIX) 00051 #define CCXX_PACKED 00052 #endif 00053 #endif 00054 00055 NAMESPACE_COMMONCPP 00056 00064 00065 const uint8 CCRTP_VERSION = 2; 00066 00068 typedef uint32 microtimeout_t; 00069 00071 typedef uint32 nanotimeout_t; 00072 00080 __EXPORT timeval 00081 microtimeout2Timeval(microtimeout_t to); 00082 00090 inline microtimeout_t 00091 timeval2microtimeout(const timeval& t) 00092 { return ((t.tv_sec * 1000000ul) + t.tv_usec); } 00093 00102 inline microtimeout_t 00103 timevalDiff2microtimeout(const timeval& t1, const timeval& t2) 00104 { 00105 return ((t1.tv_sec - t2.tv_sec) * 1000000ul) + 00106 (t1.tv_usec - t2.tv_usec); 00107 } 00108 00110 const tpport_t DefaultRTPDataPort = 5004; 00111 00113 const tpport_t DefaultRTCPPort = 5005; 00114 00115 END_NAMESPACE 00116 00117 const int SrtpAuthenticationNull = 0; 00118 const int SrtpAuthenticationSha1Hmac = 1; 00119 const int SrtpAuthenticationSkeinHmac = 2; 00120 00121 const int SrtpEncryptionNull = 0; 00122 const int SrtpEncryptionAESCM = 1; 00123 const int SrtpEncryptionAESF8 = 2; 00124 const int SrtpEncryptionTWOCM = 3; 00125 const int SrtpEncryptionTWOF8 = 4; 00126 00127 #endif // ndef CCXX_RTP_BASE_H_ 00128