コード例 #1
0
ファイル: torus.c プロジェクト: wilseypa/ROSS
void
event_handler(nodes_state * s, tw_bf * bf, nodes_message * msg, tw_lp * lp)
{
 *(int *) bf = (int) 0;
 switch(msg->type)
 {
  case GENERATE:
    packet_generate(s,bf,msg,lp);
  break;
  case ARRIVAL:
    packet_arrive(s,bf,msg,lp);
  break;
  case SEND:
   packet_send(s,bf,msg,lp);
  break;
  case CREDIT:
    packet_buffer_process(s,bf,msg,lp);
   break;
  case WAIT:
    update_waiting_list(s, bf, msg, lp);
   break;
  DEFAULT:
	printf("\n Being sent to wrong LP");
  break;
 }
}
コード例 #2
0
ファイル: AllToAll.c プロジェクト: chleemobile/rossnet
void
event_handler(nodes_state * s, tw_bf * bf, nodes_message * msg, tw_lp * lp)
{

  switch(msg->type)
    {
    case GENERATE:
      packet_generate(s,bf,msg,lp);
      break;
    case ARRIVAL:
      packet_arrive(s,bf,msg,lp);
      break;
    case SEND:
      packet_send(s,bf,msg,lp);
      break;
    case PROCESS:
      packet_process(s,bf,msg,lp);
      break;
    }
}