00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _LIBRSTP_INC_RSTPSERVERIF_H
00026 #define _LIBRSTP_INC_RSTPSERVERIF_H
00027
00028 #include <string>
00029
00030
00031 #if ( defined(WIN32) || defined(WIN_NATIVE) ) && !defined(LIBRADAR_STP_NO_SERVER)
00032 #ifdef LIBRADAR_STP_EXPORTS
00033 #define LIBRADAR_STP_INTERFACE __declspec(dllexport)
00034 #else
00035 #define LIBRADAR_STP_INTERFACE __declspec(dllimport)
00036 #endif
00037 #else
00038 #define LIBRADAR_STP_INTERFACE
00039 #endif
00040
00041
00042 namespace libradar_stp {
00051 class
00052 LIBRADAR_STP_INTERFACE
00053 RSTPServerIf {
00054 public:
00055
00056 RSTPServerIf();
00057 ~RSTPServerIf();
00058
00066 bool listen( const std::string& local_addr, unsigned short port, int backlog = 10 );
00067
00071 bool listen( unsigned short port );
00072
00079 bool notifyData( const char* data, unsigned int size );
00080
00084 void quit();
00085
00089 void setAuthRequired();
00090
00097 void setAuthCredential( const std::string& login, const std::string& pass );
00098
00105 void setAuthPermission( const std::string& login, const std::string& stream );
00106
00110 void clearAuthSettings();
00111
00117 void setMaxClients( unsigned int max_clients );
00118
00127 void setFilterStream( const std::string& stream, const std::string& file );
00128
00135 void setPassStream( const std::string& stream );
00136
00137 void setPipeThrough( const std::string& stream, const std::string& cmd );
00138
00139 void setStreamCache( const std::string& stream, int cache_size, const std::string& file );
00140
00141 typedef void (*STRCB)( void*, const std::string& );
00142 void setStreamAddCallback( STRCB func, void* arg = 0 );
00143 void setStreamDropCallback( STRCB func, void* arg = 0 );
00144
00145 void addBroadcastData( const std::string& data );
00146 void addBroadcastFile( const std::string& file );
00147 void setBroadcastInterval( unsigned int interval );
00148
00156 void setLogging( const std::string& file, int level = 1, std::string progid = "" );
00157
00164 void setStatusFile( const std::string& file );
00165
00172 bool loadFile( const std::string& filename );
00173
00174 private:
00175
00176 void* m_rstp_server;
00177
00178 };
00179
00180 };
00181
00182 #endif