int main( int argc, char *argv[] ) { // Check if this application runs with root privilege if ( geteuid() != 0 ) { printf( "Sliceable switch must be run with root privilege.\n" ); exit( EXIT_FAILURE ); } // Initialize Trema world init_trema( &argc, &argv ); // Init path management library (libpath) init_path(); switch_options options; init_switch_options( &options, &argc, &argv ); init_topology_service_interface_options( &argc, &argv ); // Initialize sliceable_switch sliceable_switch *sliceable_switch = create_sliceable_switch( get_topology_service_interface_name(), &options ); // Main loop start_trema(); // Finalize sliceable_switch delete_sliceable_switch( sliceable_switch ); // Finalize path management library (libpath) finalize_path(); return 0; }
int main( int argc, char *argv[] ) { // Check if this application runs with root privilege if ( geteuid() != 0 ) { printf( "Redirectable routing switch must be run with root privilege.\n" ); exit( EXIT_FAILURE ); } // Initialize Trema world init_trema( &argc, &argv ); routing_switch_options options; init_routing_switch_options( &options, &argc, &argv ); init_topology_service_interface_options( &argc, &argv ); // Initialize routing_switch routing_switch *routing_switch = create_routing_switch( get_topology_service_interface_name(), &options ); // Main loop start_trema(); // Finalize routing_switch delete_routing_switch( routing_switch ); return 0; }
int main( int argc, char *argv[] ) { init_trema( &argc, &argv ); init_topology_service_interface_options( &argc, &argv ); init_libtopology( get_topology_service_interface_name() ); get_all_port_status( print_all_port_status, NULL); start_trema(); finalize_libtopology(); finalize_topology_service_interface_options(); return 0; }
int main( int argc, char *argv[] ) { // Initialize Trema world init_trema( &argc, &argv ); init_topology_service_interface_options( &argc, &argv ); // Initialize broadcast_helper broadcast_helper *broadcast_helper = create_broadcast_helper( get_topology_service_interface_name() ); // Main loop start_trema(); // Finalize broadcast_helper delete_broadcast_helper( broadcast_helper ); return 0; }
int main( int argc, char *argv[] ) { // Initialize Trema world init_trema( &argc, &argv ); routing_switch_options options; init_routing_switch_options( &options, &argc, &argv ); init_topology_service_interface_options( &argc, &argv ); // Initialize routing_switch routing_switch *routing_switch = create_routing_switch( get_topology_service_interface_name(), &options ); // Main loop start_trema(); // Finalize routing_switch delete_routing_switch( routing_switch ); return 0; }