home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / NETWORK / TEL23SRC.ZIP / NET / GENERIC / NET.C
Encoding:
C/C++ Source or Header  |  1990-05-25  |  2.1 KB  |  144 lines

  1. /*
  2. *
  3. *    net.c
  4. *    Network interface(between IP and the hardware routines)
  5. */
  6.  
  7. #include    <stdio.h>
  8.  
  9. /*
  10. *    Global Variables
  11. */
  12.  
  13. /*
  14. *    Netparms(irq, address, ioaddr)
  15. *
  16. *    Set network parameters(good for all cards)
  17. *
  18. */
  19. static int nnirq=3,nnaddr=0xd000,nnioaddr=0x300;
  20. netparms(irq,address,ioaddr)
  21.  
  22. int    irq;                                            /* interrupt level */
  23. int    address;                                        /* shared memory address */
  24. int    ioaddr;                                            /* io address */
  25. {
  26.     printf("netparms : irq = %d, address = %8x, ioaddr = %8x\n",irq,address,ioaddr);
  27.     return(0);
  28. }
  29.  
  30. /*
  31. *    netconfig(s)
  32. *    configure the network based on the hardware type(s)
  33. */
  34. void netconfig(s)
  35. char *s;
  36. {
  37.     printf("netconfig : s = %s\n",s);
  38. }
  39.  
  40. /*
  41. *    demux(all)
  42. *
  43. *    Generic routine for people to call to process the network
  44. *(if *all* then keep processing until all packets are gone)
  45. */
  46. void demux(all)
  47.  
  48. int    all;
  49. {
  50. #ifdef    UNDEF
  51.     DLAYER *firstlook;
  52.     int    getcode;
  53.     if(0){
  54.         firstlook=(DLAYER *)rxBuf[xRxOut].data;
  55.         getcode=firstlook->type;            /* where does it belong? */
  56.         switch(getcode){                    /* what to do with it? */
  57.             case EARP:
  58.             case ERARP:
  59.                 printf("Got an ARP\n");
  60.                 break;
  61.  
  62.             case EIP:
  63.                 printf("Got an IP\n");
  64.                 ipinterpret(firstlook);
  65.                 break;
  66.  
  67.             default:
  68.                 printf("Got something BOGUS\n");
  69.                 break;
  70.             }
  71.         xRxOut=(xRxOut+1)&RXMASK;
  72.       }
  73. #endif
  74. }
  75.  
  76. /*
  77. *    dlayersend(ptr, size)
  78. *
  79. *    Send the packet *ptr* of size *size* out the appropriate hardware
  80. *
  81. */
  82. dlayersend(ptr, size)
  83.  
  84. char    *ptr;
  85. int    size;
  86. {
  87.     printf("dlayersend : size=%d\n",size);
  88.     return    0;
  89. }
  90.  
  91. /*
  92. *    dlayerinit()
  93. *
  94. *    Initialize the hardware
  95. *
  96. */
  97.  
  98. dlayerinit()
  99. {
  100.     printf("dlayerinit : \n");
  101.     return    0;
  102. }
  103.  
  104. /*
  105. *    dlayershut()
  106. *
  107. *    shut down the hardware 
  108. *
  109. */
  110. void dlayershut()
  111. {
  112.     printf("dlayershut : \n");
  113. }
  114.  
  115. /*
  116. *    pcgetaddr(s, ioaddr, memloc)
  117. *
  118. *    get the pc address of the ethernet card and return in s
  119. *
  120. */
  121. void pcgetaddr(s, x, y)
  122. char s[];
  123. int    x,y;
  124. {
  125.     int    i;
  126.  
  127.     for(i=0; i<6; i++)
  128.         s[i]=0x55;
  129. }
  130.  
  131. /*
  132. *    netarpme(s)
  133. *
  134. *    send myself an arp
  135. *
  136. */
  137. netarpme(s)
  138.  
  139. char *s;
  140. {
  141.     printf("netarpme : \n");
  142.     return 0;
  143. }
  144.