Пример #1
0
all_sw_tx*
_insert_tx( size_t n_dpids, struct event_forward_operation_to_all_request_param *param ) {
  all_sw_tx *tx = xcalloc( 1, sizeof(all_sw_tx) );
  tx->txid = get_txid();
  tx->request_param = param;
  tx->tx_result = EFI_OPERATION_SUCCEEDED;
  tx->waiting_dpid = create_hash_with_size( compare_datapath_id,
                                            hash_datapath_id,
                                            ( unsigned ) n_dpids );
  void *dupe_tx = insert_hash_entry( efi_tx_table, &tx->txid, tx );
  assert( dupe_tx == NULL );
  return tx;
}
Пример #2
0
void
init_switch_port() {
  assert( switch_ports == NULL );

  switch_ports = create_hash_with_size( compare_switch_port, hash_switch_port, 64 );
}