Exemple #1
0
static void
init_last_stage( void *user_data, size_t n_entries, const topology_link_status *status ) {
  assert( user_data != NULL );

  broadcast_helper *broadcast_helper = user_data;

  update_link_status( broadcast_helper, n_entries, status );
  add_callback_link_status_updated( link_status_updated, broadcast_helper );
}
static void
init_last_stage( void *user_data, size_t n_entries, const topology_link_status *status ) {
  assert( user_data != NULL );

  routing_switch *routing_switch = user_data;

  update_link_status( routing_switch, n_entries, status );
  add_callback_link_status_updated( link_status_updated, routing_switch );
}
Exemple #3
0
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 );
}