xorp

xrl_pf_unix.hh

00001 // -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-
00002 // vim:set sts=4 ts=8:
00003 
00004 // Copyright (c) 2008-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 
00023 #ifndef __LIBXIPC_XRL_PF_UNIX_HH__
00024 #define __LIBXIPC_XRL_PF_UNIX_HH__
00025 
00026 #include "xrl_pf_stcp.hh"
00027 
00028 #ifndef HOST_OS_WINDOWS
00029 
00030 class XrlPFUNIXListener : public XrlPFSTCPListener {
00031 public:
00032     XrlPFUNIXListener(EventLoop& e, XrlDispatcher* xr = 0);
00033     ~XrlPFUNIXListener();
00034 
00035     const char* protocol() const;
00036     static void encode_address(string& address);
00037     static void decode_address(string& address);
00038 
00039     static const char*  _protocol;
00040 
00041 private:
00042     string get_sock_path();
00043 };
00044 
00045 class XrlPFUNIXSender : public XrlPFSTCPSender {
00046 public:
00047     XrlPFUNIXSender(const string& name,
00048             EventLoop& e, const char* address = 0);
00049 
00050     const char* protocol() const;
00051     static const char* protocol_name();
00052 };
00053 
00054 #endif
00055 
00056 #endif // __LIBXIPC_XRL_PF_UNIX_HH__
00057 
 All Classes Namespaces Functions Variables Typedefs Enumerations