Beispiel #1
0
static void
init_second_stage( void *user_data, size_t n_entries, const topology_port_status *s ) {
  assert( user_data != NULL );

  broadcast_helper *broadcast_helper = user_data;

  // Initialize ports
  init_ports( &broadcast_helper->switches, n_entries, s );

  // Set asynchronous event handlers

  // (1) Set port status update callback
  add_callback_port_status_updated( port_status_updated, broadcast_helper );

  // (2) Set packet-in handler
  set_packet_in_handler( handle_packet_in, broadcast_helper );

  // (3) Get all link status
  get_all_link_status( init_last_stage, broadcast_helper );
}
Beispiel #2
0
Datei: switch.c Projekt: iqm/apps
static void
init_second_stage( void *user_data, size_t n_entries, const topology_port_status *s ) {
  assert( user_data != NULL );

  routing_switch *routing_switch = user_data;
  routing_switch->second_stage_down = true;

  // Initialize ports
  init_ports( &routing_switch->switches, n_entries, s );

  // Initialize aging FDB
  init_age_fdb( routing_switch->fdb );

  // Set packet-in handler
  set_packet_in_handler( handle_packet_in, routing_switch );

  // Get all link status
  add_callback_link_status_updated( link_status_updated, routing_switch );
  get_all_link_status( init_last_stage, routing_switch );
}
static void
init_second_stage( void *user_data, size_t n_entries, const topology_port_status *s ) {
  assert( user_data != NULL );

  sliceable_switch *sliceable_switch = user_data;
  sliceable_switch->second_stage_down = true;

  // Initialize ports
  init_ports( &sliceable_switch->switches, n_entries, s );

  // Initialize aging FDB
  init_age_fdb( sliceable_switch->fdb );

  // Set asynchronous event handlers

  // (1) Set packet-in handler
  set_packet_in_handler( handle_packet_in, sliceable_switch );

  // (2) Get all link status
  add_callback_link_status_updated( link_status_updated, sliceable_switch );
  get_all_link_status( init_last_stage, sliceable_switch );
}
static void
init_second_stage( void *user_data, size_t n_entries, const topology_port_status *s ) {
  assert( user_data != NULL );

  routing_switch *routing_switch = user_data;

  // Initialize ports
  init_ports( &routing_switch->switches, n_entries, s );

  // Initialize aging FDB
  init_age_fdb( routing_switch->fdb );

  // Set asynchronous event handlers

  // (1) Set port status update callback
  add_callback_port_status_updated( port_status_updated, routing_switch );

  // (2) Set packet-in handler
  set_packet_in_handler( handle_packet_in, routing_switch );

  // (3) Get all link status
  get_all_link_status( init_last_stage, routing_switch );
}