xorp

xrl_std_router.hh

00001 // -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-
00002 // vim:set sts=4 ts=8:
00003 
00004 // Copyright (c) 2001-2011 XORP, Inc and Others
00005 //
00006 // This program is free software; you can redistribute it and/or modify
00007 // it under the terms of the GNU Lesser General Public License, Version
00008 // 2.1, June 1999 as published by the Free Software Foundation.
00009 // Redistribution and/or modification of this program under the terms of
00010 // any other version of the GNU Lesser General Public License is not
00011 // permitted.
00012 // 
00013 // This program is distributed in the hope that it will be useful, but
00014 // WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details,
00016 // see the GNU Lesser General Public License, Version 2.1, a copy of
00017 // which can be found in the XORP LICENSE.lgpl file.
00018 // 
00019 // XORP, Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
00020 // http://xorp.net
00021 
00022 #ifndef __LIBXIPC_XRL_STD_ROUTER_HH__
00023 #define __LIBXIPC_XRL_STD_ROUTER_HH__
00024 
00025 #include "xrl_router.hh"
00026 #include "xrl_pf.hh"
00027 
00028 #if !defined(XRL_PF) || (XRL_PF == 'x')
00029 #define UNIX_SOCKET_DEFAULT true
00030 #else
00031 #define UNIX_SOCKET_DEFAULT false
00032 #endif
00033 
00042 class XrlStdRouter : public XrlRouter {
00043 public:
00044     XrlStdRouter(EventLoop& eventloop, const char* class_name,
00045          bool unix_socket = UNIX_SOCKET_DEFAULT);
00046 
00047     XrlStdRouter(EventLoop& eventloop,
00048          const char*    class_name,
00049          IPv4       finder_address,
00050          bool       unix_socket = UNIX_SOCKET_DEFAULT);
00051 
00052     XrlStdRouter(EventLoop& eventloop,
00053          const char*    class_name,
00054          IPv4       finder_address,
00055          uint16_t   finder_port,
00056          bool       unix_socket = UNIX_SOCKET_DEFAULT);
00057 
00058     XrlStdRouter(EventLoop& eventloop,
00059          const char*    class_name,
00060          const char*    finder_address,
00061          bool       unix_socket = UNIX_SOCKET_DEFAULT);
00062 
00063     XrlStdRouter(EventLoop& eventloop,
00064          const char*    class_name,
00065          const char*    finder_address,
00066          uint16_t   finder_port,
00067          bool       unix_socket = UNIX_SOCKET_DEFAULT);
00068 
00069     virtual ~XrlStdRouter();
00070 
00071     virtual string toString() const;
00072 
00073 private:
00074     void       construct(bool unix_socket);
00075     void       create_unix_listener();
00076     XrlPFListener* create_listener();
00077 
00078     XrlPFListener* _unix;
00079     XrlPFListener* _l;
00080 };
00081 
00082 #endif // __LIBXIPC_XRL_STD_ROUTER_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations