forked from trema/trema
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
353 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
enable_discovery | ||
show_topology | ||
show_topology.conf | ||
show_switch_status | ||
show_switch_status.conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright (C) 2012 NEC Corporation | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License, version 2, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program; if not, write to the Free Software Foundation, Inc., | ||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
*/ | ||
|
||
|
||
#include <assert.h> | ||
#include <getopt.h> | ||
#include <stdio.h> | ||
#include <unistd.h> | ||
#include "trema.h" | ||
|
||
|
||
void | ||
usage() { | ||
topology_service_interface_usage( get_executable_name(), "Show switch status", NULL ); | ||
} | ||
|
||
|
||
static void | ||
timed_out( void *user_data ) { | ||
UNUSED( user_data ); | ||
|
||
error( "timed out." ); | ||
|
||
stop_trema(); | ||
} | ||
|
||
|
||
static void | ||
result_response( void *user_data, const topology_response *res ) { | ||
UNUSED( user_data ); | ||
if ( res->status != TD_RESPONSE_OK ) { | ||
error( "Enable topology discovery failed" ); | ||
} else { | ||
info( "Enabled topology discovery" ); | ||
} | ||
stop_trema(); | ||
} | ||
|
||
int | ||
main( int argc, char *argv[] ) { | ||
init_trema( &argc, &argv ); | ||
init_topology_service_interface_options( &argc, &argv ); | ||
init_libtopology( get_topology_service_interface_name() ); | ||
|
||
enable_topology_discovery( result_response, NULL ); | ||
|
||
add_periodic_event_callback( 15, timed_out, NULL ); | ||
|
||
start_trema(); | ||
|
||
finalize_libtopology(); | ||
finalize_topology_service_interface_options(); | ||
|
||
return 0; | ||
} | ||
|
||
|
||
/* | ||
* Local variables: | ||
* c-basic-offset: 2 | ||
* indent-tabs-mode: nil | ||
* End: | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.