xorp

ifconfig_set_iphelper.hh

00001 // -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-
00002 
00003 // Copyright (c) 2001-2011 XORP, Inc and Others
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License, Version 2, June
00007 // 1991 as published by the Free Software Foundation. Redistribution
00008 // and/or modification of this program under the terms of any other
00009 // version of the GNU General Public License is not permitted.
00010 // 
00011 // This program is distributed in the hope that it will be useful, but
00012 // WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details,
00014 // see the GNU General Public License, Version 2, a copy of which can be
00015 // found in the XORP LICENSE.gpl file.
00016 // 
00017 // XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
00018 // http://xorp.net
00019 
00020 // $XORP: xorp/fea/data_plane/ifconfig/ifconfig_set_iphelper.hh,v 1.13 2008/10/02 21:57:08 bms Exp $
00021 
00022 #ifndef __FEA_DATA_PLANE_IFCONFIG_IFCONFIG_SET_IPHELPER_HH__
00023 #define __FEA_DATA_PLANE_IFCONFIG_IFCONFIG_SET_IPHELPER_HH__
00024 
00025 #include <map>
00026 
00027 #include "fea/ifconfig_set.hh"
00028 
00029 
00030 class IfConfigSetIPHelper : public IfConfigSet {
00031 public:
00038     IfConfigSetIPHelper(FeaDataPlaneManager& fea_data_plane_manager);
00039 
00043     virtual ~IfConfigSetIPHelper();
00044 
00051     virtual int start(string& error_msg);
00052 
00059     virtual int stop(string& error_msg);
00060 
00061 private:
00069     virtual bool is_discard_emulated(const IfTreeInterface& i) const;
00070 
00078     virtual bool is_unreachable_emulated(const IfTreeInterface& i) const;
00079 
00086     virtual int config_begin(string& error_msg);
00087 
00094     virtual int config_end(string& error_msg);
00095 
00106     virtual int config_interface_begin(const IfTreeInterface* pulled_ifp,
00107                        IfTreeInterface& config_iface,
00108                        string& error_msg);
00109 
00120     virtual int config_interface_end(const IfTreeInterface* pulled_ifp,
00121                      const IfTreeInterface& config_iface,
00122                      string& error_msg);
00123 
00138     virtual int config_vif_begin(const IfTreeInterface* pulled_ifp,
00139                  const IfTreeVif* pulled_vifp,
00140                  const IfTreeInterface& config_iface,
00141                  const IfTreeVif& config_vif,
00142                  string& error_msg);
00143 
00158     virtual int config_vif_end(const IfTreeInterface* pulled_ifp,
00159                    const IfTreeVif* pulled_vifp,
00160                    const IfTreeInterface& config_iface,
00161                    const IfTreeVif& config_vif,
00162                    string& error_msg);
00163 
00185     virtual int config_add_address(const IfTreeInterface* pulled_ifp,
00186                    const IfTreeVif* pulled_vifp,
00187                    const IfTreeAddr4* pulled_addrp,
00188                    const IfTreeInterface& config_iface,
00189                    const IfTreeVif& config_vif,
00190                    const IfTreeAddr4& config_addr,
00191                    string& error_msg);
00192 
00211     virtual int config_delete_address(const IfTreeInterface* pulled_ifp,
00212                       const IfTreeVif* pulled_vifp,
00213                       const IfTreeAddr4* pulled_addrp,
00214                       const IfTreeInterface& config_iface,
00215                       const IfTreeVif& config_vif,
00216                       const IfTreeAddr4& config_addr,
00217                       string& error_msg);
00218 
00240     virtual int config_add_address(const IfTreeInterface* pulled_ifp,
00241                    const IfTreeVif* pulled_vifp,
00242                    const IfTreeAddr6* pulled_addrp,
00243                    const IfTreeInterface& config_iface,
00244                    const IfTreeVif& config_vif,
00245                    const IfTreeAddr6& config_addr,
00246                    string& error_msg);
00247 
00266     virtual int config_delete_address(const IfTreeInterface* pulled_ifp,
00267                       const IfTreeVif* pulled_vifp,
00268                       const IfTreeAddr6* pulled_addrp,
00269                       const IfTreeInterface& config_iface,
00270                       const IfTreeVif& config_vif,
00271                       const IfTreeAddr6& config_addr,
00272                       string& error_msg);
00273 
00285     int set_interface_status(const string& ifname, uint32_t if_index,
00286                  uint32_t interface_flags, bool is_enabled,
00287                  string& error_msg);
00288 
00306     int add_addr(const string& ifname, const string& vifname,
00307          uint32_t if_index, const IPv4& addr, uint32_t prefix_len,
00308          bool is_broadcast, const IPv4& broadcast_addr,
00309          bool is_point_to_point, const IPv4& endpoint_addr,
00310          string& error_msg);
00311 
00323     int delete_addr(const string& ifname, const string& vifname,
00324             uint32_t if_index, const IPv4& addr, uint32_t prefix_len,
00325             string& error_msg);
00326 
00341     int add_addr(const string& ifname, const string& vifname,
00342          uint32_t if_index, const IPv6& addr, uint32_t prefix_len,
00343          bool is_point_to_point, const IPv6& endpoint_addr,
00344          string& error_msg);
00345 
00357     int delete_addr(const string& ifname, const string& vifname,
00358             uint32_t if_index, const IPv6& addr, uint32_t prefix_len,
00359             string& error_msg);
00360 
00361 #ifdef HOST_OS_WINDOWS
00362     map<pair<uint32_t, IPAddr>, ULONG>  _nte_map;
00363 #endif
00364 };
00365 
00366 #endif // __FEA_DATA_PLANE_IFCONFIG_IFCONFIG_SET_IPHELPER_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations