|
xorp
|
00001 // -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*- 00002 00003 // Copyright (c) 2007-2012 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 00021 #ifndef __FEA_DATA_PLANE_MANAGERS_FEA_DATA_PLANE_MANAGER_CLICK_HH__ 00022 #define __FEA_DATA_PLANE_MANAGERS_FEA_DATA_PLANE_MANAGER_CLICK_HH__ 00023 00024 #include <xorp_config.h> 00025 #ifdef XORP_USE_CLICK 00026 00027 #include "fea/fea_data_plane_manager.hh" 00028 00029 class FibConfigEntryGetClick; 00030 class FibConfigEntrySetClick; 00031 class FibConfigForwardingDummy; 00032 class FibConfigTableGetClick; 00033 class FibConfigTableSetClick; 00034 class FirewallGetDummy; 00035 class FirewallSetDummy; 00036 class IfConfigGetClick; 00037 class IfConfigPropertyDummy; 00038 class IfConfigSetClick; 00039 class IPv4; 00040 00041 00045 class FeaDataPlaneManagerClick : public FeaDataPlaneManager { 00046 public: 00052 FeaDataPlaneManagerClick(FeaNode& fea_node); 00053 00057 virtual ~FeaDataPlaneManagerClick(); 00058 00065 int load_plugins(string& error_msg); 00066 00073 int unload_plugins(string& error_msg); 00074 00081 int register_plugins(string& error_msg); 00082 00095 IoLink* allocate_io_link(const IfTree& iftree, 00096 const string& if_name, 00097 const string& vif_name, 00098 uint16_t ether_type, 00099 const string& filter_program); 00100 00110 IoIp* allocate_io_ip(const IfTree& iftree, int family, 00111 uint8_t ip_protocol); 00112 00123 IoTcpUdp* allocate_io_tcpudp(const IfTree& iftree, int family, 00124 bool is_tcp); 00125 00126 // 00127 // Click-specific methods 00128 // 00129 00137 int enable_click(bool enable, string& error_msg); 00138 00147 int enable_kernel_click(bool enable, string& error_msg); 00148 00158 int set_kernel_click_config_generator_file(const string& v, 00159 string& error_msg); 00160 00169 int enable_duplicate_routes_to_kernel(bool enable, string& error_msg); 00170 00178 int enable_kernel_click_install_on_startup(bool enable, string& error_msg); 00179 00188 int set_kernel_click_modules(const list<string>& modules, 00189 string& error_msg); 00190 00198 int set_kernel_click_mount_directory(const string& directory, 00199 string& error_msg); 00200 00209 int enable_user_click(bool enable, string& error_msg); 00210 00218 int set_user_click_command_file(const string& v, string& error_msg); 00219 00227 int set_user_click_command_extra_arguments(const string& v, 00228 string& error_msg); 00229 00237 int set_user_click_command_execute_on_startup(bool v, string& error_msg); 00238 00247 int set_user_click_control_address(const IPv4& v, string& error_msg); 00248 00258 int set_user_click_control_socket_port(uint32_t v, string& error_msg); 00259 00269 int set_user_click_startup_config_file(const string& v, string& error_msg); 00270 00280 int set_user_click_config_generator_file(const string& v, 00281 string& error_msg); 00282 00283 private: 00284 // 00285 // The plugins 00286 // 00287 // 00288 // TODO: XXX: For the time being some of the plugins 00289 // used by Click are dummy. 00290 // 00291 IfConfigPropertyDummy* _ifconfig_property_dummy; 00292 IfConfigGetClick* _ifconfig_get_click; 00293 IfConfigSetClick* _ifconfig_set_click; 00294 FirewallGetDummy* _firewall_get_dummy; 00295 FirewallSetDummy* _firewall_set_dummy; 00296 FibConfigForwardingDummy* _fibconfig_forwarding_dummy; 00297 FibConfigEntryGetClick* _fibconfig_entry_get_click; 00298 FibConfigEntrySetClick* _fibconfig_entry_set_click; 00299 FibConfigTableGetClick* _fibconfig_table_get_click; 00300 FibConfigTableSetClick* _fibconfig_table_set_click; 00301 }; 00302 00303 #endif // click 00304 #endif // _FEA_DATA_PLANE_MANAGERS_FEA_DATA_PLANE_MANAGER_CLICK_HH__