Changeset 2300
- Timestamp:
- 11/09/06 10:10:28 (7 years ago)
- Location:
- natfw-nslp/trunk
- Files:
-
- 5 modified
-
eval/nf.cpp (modified) (6 diffs)
-
eval/nr.cpp (modified) (3 diffs)
-
eval/utils.cpp (modified) (2 diffs)
-
eval/utils.h (modified) (1 diff)
-
testbed/rsync-filter (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
natfw-nslp/trunk/eval/nf.cpp
r2297 r2300 20 20 class nf : public benchmark { 21 21 public: 22 nf( );22 nf(const std::string &config_filename); 23 23 ~nf(); 24 24 virtual void perform_task(); … … 31 31 nop_dispatcher *d; 32 32 gistka_mapper mapper; 33 34 appladdress nr_addr; 33 35 }; 34 36 35 37 36 nf::nf( ) {38 nf::nf(const std::string &config_filename) { 37 39 tsdb::init(); 38 40 NATFW_IEManager::clear(); … … 40 42 41 43 conf = new natfw_config(); 44 45 try { 46 conf->load(config_filename); 47 } 48 catch ( config_error &e ) { 49 std::cerr << "Config error: " << e << std::endl; 50 exit(1); 51 } 52 42 53 mgr = new session_manager(conf); 43 54 nat_mgr = new nat_manager(conf); … … 45 56 d = new nop_dispatcher(mgr, nat_mgr, installer, conf); 46 57 47 48 try { 49 conf->load("../testbed/setup_1a_tb20.conf"); 50 } 51 catch ( config_error &e ) { 52 std::cerr << "Config error: " << e << std::endl; 53 exit(1); 58 if ( conf->is_nf_nat() ) { 59 appladdress nr_priv_addr("10.38.2.212", "tcp", 12345); 60 nr_addr = nat_mgr->reserve_external_address(nr_priv_addr); 61 std::cout << "reserved " << nr_addr << std::endl; 54 62 } 55 63 } … … 72 80 */ 73 81 ntlp::APIMsg *msg; 74 msg = build_api_create_msg( false);82 msg = build_api_create_msg(nr_addr, false); 75 83 76 84 event *evt = mapper.map_to_event(msg); … … 83 91 84 92 85 int main() { 86 nf n; 93 int main(int argc, char *argv[]) { 94 if ( argc != 2 ) { 95 std::cerr << "Usage: nf config_filename" << std::endl; 96 exit(1); 97 } 98 99 nf n(argv[1]); 87 100 88 101 n.run("nf: processing incoming CREATE messages", 100000); -
natfw-nslp/trunk/eval/nr.cpp
r2297 r2300 31 31 nop_dispatcher *d; 32 32 gistka_mapper mapper; 33 34 appladdress nr_addr; 33 35 }; 34 36 … … 53 55 exit(1); 54 56 } 57 58 nr_addr = appladdress("10.38.2.212", "tcp", 1234); 55 59 } 56 60 … … 72 76 */ 73 77 ntlp::APIMsg *msg; 74 msg = build_api_create_msg( true);78 msg = build_api_create_msg(nr_addr, true); 75 79 76 80 event *evt = mapper.map_to_event(msg); -
natfw-nslp/trunk/eval/utils.cpp
r2297 r2300 46 46 * Build an NTLP message containing a NATFW CREATE message. 47 47 */ 48 ntlp::APIMsg *build_api_create_msg( bool final_hop) {48 ntlp::APIMsg *build_api_create_msg(const appladdress &nr, bool final_hop) { 49 49 using namespace ntlp; 50 50 … … 61 61 hostaddress source("10.38.1.191"); 62 62 hostaddress dest("10.38.2.212"); 63 mri *mr = new mri_pathcoupled(source, 32, dest, 32, true); 63 mri_pathcoupled *mr = new mri_pathcoupled(source, 32, nr, 32, true); 64 mr->set_protocol(nr.get_protocol()); 65 mr->set_sourceport(nr.get_port()-1); 66 mr->set_destport(nr.get_port()); 67 64 68 65 69 bool adjacency_check = false; -
natfw-nslp/trunk/eval/utils.h
r2297 r2300 18 18 19 19 protlib::NetMsg *build_create_msg(); 20 ntlp::APIMsg *build_api_create_msg( bool final_hop);20 ntlp::APIMsg *build_api_create_msg(const appladdress &nr, bool final_hop); 21 21 22 22 -
natfw-nslp/trunk/testbed/rsync-filter
r2263 r2300 11 11 - /src/test_stress 12 12 - /test/test_runner 13 - /eval/ni 14 - /eval/nf 15 - /eval/nr 13 16 - /ntlp/src/ntlp