Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MNRTPSsrcCollisionList.h

Go to the documentation of this file.
00001 /* Copyright (C) 2000 KOM/Darmstadt University of Technology 00002 * 00003 * You are allowed to use all other parts of the code under the following terms: 00004 * 00005 * For non-commercial use, code may be used in unmodified form provided 00006 * that this copyright notice and this permission notice appear in 00007 * supporting documentation. 00008 * 00009 * This software is provided "as is" and without any express or implied 00010 * warranties, including, without limitation, the implied warranty of 00011 * fitness for a particular purpose. 00012 * 00013 * The code may be subjected to the GNU General Public License, Version 2, 00014 * and re-distributed under the terms of this license. 00015 * As a special exception, permission is granted to link this code 00016 * with the Qt library and distribute executables, as long as you 00017 * follow the requirements of the GNU GPL in regard to all of the 00018 * software in the executable aside from Qt. 00019 * 00020 * Commercial use other than under the terms of the GNU General Public 00021 * License is allowed only after express negotiation of conditions 00022 * with the authors. 00023 */ 00024 00025 #ifndef MN_RTP_SSRC_COLLISION_LIST_H 00026 #define MN_RTP_SSRC_COLLISION_LIST_H 00027 00028 #include <sys/types.h> 00029 #include <sys/socket.h> 00030 #include <netinet/in.h> 00031 00032 #include "MNMutex.h" 00033 #include "MNRTPdefs.h" 00034 #include "MNArrayList.h" 00035 #include "MNRTPtime.h" 00036 #include "var_type.h" 00037 00038 /*********************************************************************** 00039 * SsrcCollisionList 00040 ***********************************************************************/ 00041 00042 class SsrcCollisionList 00043 { 00044 struct addr_list_item 00045 { 00046 struct sockaddr_in addresse; 00047 ntp64 time; 00048 u_int32 ssrc; 00049 00050 addr_list_item( const struct sockaddr_in& addr, 00051 ntp64 t, 00052 u_int32 s ) 00053 : addresse(addr) 00054 , time(t) 00055 , ssrc(s) 00056 { } 00057 }; 00058 00059 MNArrayList<addr_list_item*> _list; 00060 MNMutex _lock; 00061 00062 public: 00063 ~SsrcCollisionList(); 00064 00065 void lock(); 00066 void unlock(); 00067 00080 bool update_if( const struct sockaddr_in& addr, 00081 ntp64 now, 00082 u_int32 ssrc ); 00083 00090 size_t update_expire( ntp64 now ); 00091 00098 size_t remove_ssrc( u_int32 ssrc ); 00099 }; 00100 00101 #endif /* MN_RTP_SSRC_COLLISION_LIST_H */ 00102

Generated on Sun Mar 6 13:35:49 2005 for Komssys by doxygen 1.3.8