OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [bootloaders/] [orpmon/] [services/] [net.c] - Diff between revs 246 and 405

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 246 Rev 405
Line 120... Line 120...
 *      Main network processing loop.
 *      Main network processing loop.
 */
 */
int
int
NetLoop(proto_t protocol)
NetLoop(proto_t protocol)
{
{
#if 1
 
  if (!NetTxPacket) {
  if (!NetTxPacket) {
    int i;
    int i;
    printf("NetTxPacket begin setup\n");
    printf("NetTxPacket begin setup\n");
    /*
    /*
     *  Setup packet buffers, aligned correctly.
     *  Setup packet buffers, aligned correctly.
Line 262... Line 262...
 
 
    case NETLOOP_FAIL:
    case NETLOOP_FAIL:
      return 0;
      return 0;
    }
    }
  }
  }
#endif
 
}
}
 
 
/**********************************************************************/
/**********************************************************************/
 
 
 
 
Line 458... Line 458...
  case PROT_IP:
  case PROT_IP:
#ifdef ET_DEBUG
#ifdef ET_DEBUG
    printf("Got IP\n");
    printf("Got IP\n");
#endif
#endif
    if (len < IP_HDR_SIZE) {
    if (len < IP_HDR_SIZE) {
      debug ("len bad %d < %d\n", len, IP_HDR_SIZE);
      debug ("ip header len bad %d < %d\n", len, IP_HDR_SIZE);
      return;
      return;
    }
    }
    if (len < SWAP16(ip->ip_len)) {
    if (len < SWAP16(ip->ip_len)) {
      printf("len bad %d < %d\n", len, SWAP16(ip->ip_len));
      printf("ip header (swap) len bad %d < %d\n", len, SWAP16(ip->ip_len));
      return;
      return;
    }
    }
    len = SWAP16(ip->ip_len);
    len = SWAP16(ip->ip_len);
#ifdef ET_DEBUG
#ifdef ET_DEBUG
    printf("len=%d, v=%02x\n", len, ip->ip_hl_v & 0xff);
    printf("len=%d, v=%02x\n", len, ip->ip_hl_v & 0xff);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.