Ejemplo n.º 1
0
static void
delete_sliceable_switch( sliceable_switch *sliceable_switch ) {
  assert( sliceable_switch != NULL );

  // Delete pathresolver table
  delete_pathresolver( sliceable_switch->pathresolver );

  // Finalize libraries
  finalize_libtopology();

  // Delete ports
  delete_all_ports( &sliceable_switch->switches );

  // Delete forwarding database
  delete_fdb( sliceable_switch->fdb );

  // Finalize packet filter
  finalize_filter();

  // Finalize multiple slices support
  finalize_slice();

  // Finalize redirector
  finalize_redirector();

  // Delete sliceable_switch object
  xfree( sliceable_switch );
}
Ejemplo n.º 2
0
static void
delete_routing_switch( routing_switch *routing_switch ) {
  assert( routing_switch != NULL );

  // Finalize libraries
  finalize_libtopology();

  // Delete outbound ports
  delete_outbound_all_ports( &routing_switch->switches );

  // Delete forwarding database
  delete_fdb( routing_switch->fdb );

  // Delete routing_switch object
  xfree( routing_switch );
}
Ejemplo n.º 3
0
Archivo: switch.c Proyecto: iqm/apps
static void
delete_routing_switch( routing_switch *routing_switch ) {
  assert( routing_switch != NULL );

  // Delete pathresolver table
  delete_path_resolver( routing_switch->path_resolver );

  // Finalize libraries
  finalize_libtopology();

  // Delete ports
  delete_all_ports( &routing_switch->switches );

  // Delete forwarding database
  delete_fdb( routing_switch->fdb );

  // Delete routing_switch object
  xfree( routing_switch );
}
Ejemplo n.º 4
0
int
main( int argc, char *argv[] ) {
  init_trema( &argc, &argv );

  traffic db;
  db.counter = create_counter();
  db.fdb = create_fdb();

  add_periodic_event_callback( 10, show_counter, &db );

  set_packet_in_handler( handle_packet_in, &db );
  set_flow_removed_handler( handle_flow_removed, &db );

  start_trema();

  delete_fdb( db.fdb );
  delete_counter( db.counter );

  return 0;
}