isis_receive:패키지 수거 프로세스

2223 단어
코드는 다음과 같다.
int
isis_receive (struct thread *thread)
{
  struct isis_circuit *circuit;
  u_char ssnpa[ETH_ALEN];
  int retval;

  /*
   * Get the circuit 
   */
  circuit = THREAD_ARG (thread);
  assert (circuit);

  if (!circuit->area)
    return ISIS_OK;

  if (circuit->rcv_stream == NULL)
    circuit->rcv_stream = stream_new (ISO_MTU (circuit));
  else
    stream_reset (circuit->rcv_stream);

  retval = circuit->rx (circuit, ssnpa);
  circuit->t_read = NULL;

  if (retval == ISIS_OK)
    retval = isis_handle_pdu (circuit, ssnpa);

  /* 
   * prepare for next packet. 
   */
  THREAD_READ_ON (master, circuit->t_read, isis_receive, circuit,
		  circuit->fd);

  return retval;
}

주요 프로세스:
1 패키지 rx, 등록된 처리 함수 호출, 예를 들어 isis*receive_*_bcast/p2p
2 메시지 처리handle
3 다음 READ 처리ON
메시지를 처리하는 논리는 다음과 같다.
static int
isis_handle_pdu (struct isis_circuit *circuit, u_char * ssnpa)
{
  switch (hdr->pdu_type)
    {
    case L1_LAN_HELLO:
      retval = process_lan_hello (ISIS_LEVEL1, circuit, ssnpa);
      break;
    case L2_LAN_HELLO:
      retval = process_lan_hello (ISIS_LEVEL2, circuit, ssnpa);
      break;
    case P2P_HELLO:
      retval = process_p2p_hello (circuit);
      break;
}

호출 관계
(gdb) bt
#0  isis_handle_pdu (circuit=0x7ffff427c8c8, ssnpa=0x7ffff4582b60 "") at isis_pdu.c:1654
#1  0x00007ffff42ce5a2 in isis_receive (thread=0x7ffff4582cc0) at isis_pdu.c:1796
#2  0x00007ffff42f24ef in thread_call (thread=0x7ffff4582cc0) at thread.c:1177
#3  0x00007ffff42bda3d in main (argc=5, argv=0x662700, envp=0x6460b0) at isis_main.c:353
#4  0x00007ffff7a0708f in ns3::DceManager::DoStartProcess (context=0x677f40) at ../model/dce-manager.cc:283
#5  0x00007ffff7a907fc in ns3::TaskManager::Trampoline (context=0x662900) at ../model/task-manager.cc:274
#6  0x00007ffff7a8c7d7 in ns3::PthreadFiberManager::Run (arg=0x678230) at ../model/pthread-fiber-manager.cc:402
#7  0x000000318b2079d1 in start_thread () from /lib64/libpthread.so.0
#8  0x000000318a6e88fd in clone () from /lib64/libc.so.6
(gdb) 


주요 결론:
PPP 네트워크의 경우 SNPA 값을 따지지 않습니다.

좋은 웹페이지 즐겨찾기