rstpserverif.h

00001 /* libradar_stp
00002  * <http://www.k9nl.net/radar/> <radar@k9nl.net>
00003  * 
00004  * rstpserverif.h - RSTP server class high level interface (to hide threading)
00005  *
00006  * Copyright (C) 2007 Nicholas J. Luther
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License,
00010  * version 2, as published by the Free Software Foundation.
00011  * 
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020  * You may contact the author by writing to Nick Luther, 1655 South
00021  * Westhaven Drive, Oshkosh, Wisconsin 54904, USA.
00022  * 
00023  */
00024 
00025 #ifndef _LIBRSTP_INC_RSTPSERVERIF_H
00026 #define _LIBRSTP_INC_RSTPSERVERIF_H
00027 
00028 #include <string>
00029 
00030 // Windows DLL stuff
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 }; // class
00179 
00180 }; // namespace
00181 
00182 #endif

Generated on Tue Jul 1 20:25:26 2008 for libradar_stp by  doxygen 1.4.7