00001 /* 00002 * (c) Copyright 2008 Philipp Skadorov (philipp_s@users.sourceforge.net) 00003 * 00004 * This file is part of FREESECS. 00005 * 00006 * FREESECS is free software: you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation, either version 3 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * FREESECS is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with FREESECS, see COPYING. 00018 * If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 #ifndef _REGISTRAR_H 00021 #define _REGISTRAR_H 00022 00023 #include <vector> 00024 #include "shared_ptr.h" 00025 #include "hsmsd_interface.h" 00026 #include "async_reception.h" 00027 #include "shared_ptr.h" 00028 00029 namespace freesecs 00030 { 00040 class user_agent_t; 00041 00042 class hsmsd_client_registrar_t 00043 { 00044 public: 00045 hsmsd_client_registrar_t(); 00046 ~hsmsd_client_registrar_t(); 00047 00048 void process(); 00049 00050 public: 00051 int data_rcvd_handler(const size_t&); 00052 int rcv_error_handler(const int&); 00053 00054 private: 00055 void process_user_request(); 00056 00057 private: 00058 int _fd_in; 00059 int _fd_out; 00060 shared_ptr_t<async_reception_t> _ar; 00061 00062 hsmsd_register_req_t register_req; 00063 00064 private: 00065 typedef shared_ptr_t<user_agent_t> pclient_t; 00066 std::vector<pclient_t> _clients; 00067 }; 00068 }//namespace 00069 #endif /*_REGISTRAR_H*/