xorp

permits.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 // $XORP: xorp/libxipc/permits.hh,v 1.9 2008/10/02 21:57:21 bms Exp $
00023 
00024 #ifndef __LIBXIPC_PERMITS_HH__
00025 #define __LIBXIPC_PERMITS_HH__
00026 
00027 
00028 
00029 #include "libxorp/ipv4.hh"
00030 #include "libxorp/ipv4net.hh"
00031 #include "libxorp/ipv6.hh"
00032 #include "libxorp/ipv6net.hh"
00033 
00034 typedef list<IPv4>  IPv4Hosts;
00035 typedef list<IPv4Net>   IPv4Nets;
00036 typedef list<IPv6>  IPv6Hosts;
00037 typedef list<IPv6Net>   IPv6Nets;
00038 
00043 bool add_permitted_host(const IPv4& host);
00044 
00049 bool add_permitted_net(const IPv4Net& net);
00050 
00055 bool add_permitted_host(const IPv6Net& host);
00056 
00061 bool add_permitted_net(const IPv6Net& net);
00062 
00068 bool host_is_permitted(const IPv4& host);
00069 
00075 bool host_is_permitted(const IPv6& host);
00076 
00080 const IPv4Hosts& permitted_ipv4_hosts();
00081 
00085 const IPv4Nets& permitted_ipv4_nets();
00086 
00090 const IPv6Hosts& permitted_ipv6_hosts();
00091 
00095 const IPv6Nets& permitted_ipv6_nets();
00096 
00100 void clear_permitted_ipv4_hosts();
00101 
00105 void clear_permitted_ipv6_hosts();
00106 
00110 void clear_permitted_ipv4_nets();
00111 
00115 void clear_permitted_ipv6_nets();
00116 
00117 
00118 #endif // __LIBXIPC_PERMITS_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations