Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

HAL, LWIP and fragmentation support

Dear all,

I'm taking a look to the LWIP source code, and in particular to the web server example for the Altera HAL distributed in the Forum .

In particular, I'm looking to the ip_reass_timer() function, called inside main().

here is the main loop:

    while(1)
    {
//0.6.4  lan91c111if_service(netif);
  lan91c111if_service(&netif);
  
  now = get_milliseconds();
  if (now - lasttime > TCP_TMR_INTERVAL) {
      lasttime = now;
      tcp_tmr();
      if (++i==50) {
    //etharp_tmr();
    i=0;
      }    
  }
# if IP_REASSEMBLY
      if (++j==1000) {
        ip_reass_timer();
        j=0;
      }    # endif
  
    }

The reassembly timer is here (see src/core/ipv4/ip_frag.c):

void 
ip_reass_timer(void *arg)
{
  (void)arg;
  if (ip_reasstmr > 1) {
    ip_reasstmr--;
    sys_timeout(IP_REASS_TMO, ip_reass_timer, NULL);
  } else if (ip_reasstmr == 1)
  ip_reasstmr = 0;
}

it seems to me that the reassembly timer should be called once a second (IP_REASS_TMO is 1000).

Is that right?

PJ
No RepliesBe the first to reply