zeroconf_howl.hpp

Go to the documentation of this file.
00001 /* libobby - Network text editing library
00002  * Copyright (C) 2005-2006 0x539 dev group
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public
00015  * License along with this program; if not, write to the Free
00016  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017  */
00018 
00019 #include <howl.h>
00020 #include "zeroconf.hpp"
00021 
00022 namespace obby
00023 {
00024 
00025 /* Concrete Zeroconf implementation using the Howl library */
00026 class zeroconf_howl : public zeroconf_base
00027 {
00028 public:
00029         zeroconf_howl();
00030         virtual ~zeroconf_howl();
00031 
00032         virtual void publish(const std::string& name, unsigned int port);
00033         virtual void unpublish(const std::string& name);
00034         virtual void unpublish_all();
00035         virtual void discover();
00036         virtual void select();
00037         virtual void select(unsigned int msecs);
00038 
00039 private:
00040         std::map<std::string, sw_discovery_oid> m_published;
00041 
00042         sw_discovery m_session;
00043         sw_salt m_salt;
00044 
00045         static sw_result HOWL_API handle_publish_reply(sw_discovery discovery,
00046                         sw_discovery_oid oid,
00047                         sw_discovery_publish_status status,
00048                         sw_opaque extra);
00049         static sw_result HOWL_API handle_browse_reply(sw_discovery discovery,
00050                         sw_discovery_oid id,
00051                         sw_discovery_browse_status status,
00052                         sw_uint32 interface_index,
00053                         sw_const_string name,
00054                         sw_const_string type,
00055                         sw_const_string domain,
00056                         sw_opaque extra);
00057         static sw_result HOWL_API handle_resolve_reply(sw_discovery discovery,
00058                         sw_discovery_oid oid,
00059                         sw_uint32 interface_index,
00060                         sw_const_string name,
00061                         sw_const_string type,
00062                         sw_const_string domain,
00063                         sw_ipv4_address address,
00064                         sw_port port,
00065                         sw_octets text_record,
00066                         sw_ulong text_record_len,
00067                         sw_opaque extra);
00068 };
00069 
00070 }
00071 

Generated on Fri Jan 11 10:01:32 2008 for obby by  doxygen 1.5.1