home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / comm / amitcp-3.0ß2.lha / AmiTCP / src / amitcp / net / sana2arp.h < prev    next >
C/C++ Source or Header  |  1993-11-07  |  3KB  |  89 lines

  1. /* $Id: sana2arp.h,v 1.8 1993/06/04 11:16:15 jraja Exp $
  2.  * 
  3.  * Copyright (c) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>,
  4.  *                    Helsinki University of Technology, Finland.
  5.  *                    All rights reserved.
  6.  *
  7.  * sana2arp.h - Internal Interfaces to the ARP Protocol
  8.  *
  9.  * Last modified: Fri Jun  4 00:40:05 1993 jraja
  10.  *
  11.  * $Log: sana2arp.h,v $
  12.  * Revision 1.8  1993/06/04  11:16:15  jraja
  13.  * Fixes for first public release.
  14.  *
  15.  * Revision 1.8  1993/06/04  11:16:15  jraja
  16.  * Fixes for first public release.
  17.  *
  18.  * Revision 1.7  1993/05/16  21:09:43  ppessi
  19.  * RCS version changed.
  20.  *
  21.  * Revision 1.5  93/04/21  00:24:23  00:24:23  ppessi (Pekka Pessi)
  22.  * Minor modifications. Hardware address size is now a macro.
  23.  * 
  24.  * Revision 1.4  93/04/19  02:40:42  02:40:42  ppessi (Pekka Pessi)
  25.  * Test version. In principle this is not ethernet dependet...
  26.  * 
  27.  * Revision 1.3  93/03/10  21:58:53  21:58:53  jraja (Jarno Tapio Rajahalme)
  28.  * Added some intelligence in including needed files.
  29.  * 
  30.  * Revision 1.2  93/03/03  20:49:08  20:49:08  jraja (Jarno Tapio Rajahalme)
  31.  * Cleanup.
  32.  */
  33.  
  34. #ifndef IF_ARPSANA_H
  35. #define IF_ARPSANA_H
  36.  
  37. #ifndef IF_H
  38. #include <net/if.h>
  39. #endif
  40.  
  41. #ifndef IF_ARP_H
  42. #include <net/if_arp.h>
  43. #endif
  44.  
  45. /*
  46.  * Address Resolution Protocol.
  47.  *
  48.  * See RFC 826 for protocol description.  Structure below is adapted
  49.  * to resolving  addresses.  Field names used correspond to 
  50.  * RFC 826.
  51.  */
  52. struct s2_arppkt {
  53.   struct    arphdr s2a_hdr;      /* fixed-size header */
  54.   struct {
  55.       u_char sha_dum[MAXADDRARP]; /* space for sender hardware address */
  56.       u_char spa_dum[MAXADDRARP]; /* space for sender protocol address */
  57.       u_char tha_dum[MAXADDRARP]; /* space for target hardware address */
  58.       u_char tpa_dum[MAXADDRARP]; /* space for target protocol address */
  59.   } arpdata;
  60. };
  61. #define    arp_hrd    s2a_hdr.ar_hrd
  62. #define    arp_pro    s2a_hdr.ar_pro
  63. #define    arp_hln    s2a_hdr.ar_hln
  64. #define    arp_pln    s2a_hdr.ar_pln
  65. #define    arp_op    s2a_hdr.ar_op
  66.  
  67. #define    ARPTAB_HSIZE    11    /* hash table size */
  68. #define ARPENTRIES      11*15    /* normal amount of ARP entries to allocate */
  69. #define ARPENTRIES_MIN  11    /* minimum # of ARP entries to allocate */
  70.  
  71. /*
  72.  * timer values
  73.  */
  74. #define    ARPT_AGE    (60*1)    /* aging timer, 1 min. */
  75. #define    ARPT_KILLC    20    /* kill completed entry in 20 mins. */
  76. #define    ARPT_KILLI    3    /* kill incomplete entry in 3 minutes */
  77.  
  78. #ifdef    KERNEL
  79. void alloc_arptable(struct sana_softc* ssc, int to_allocate);
  80. void arptimer(void);
  81. int arpresolve(register struct sana_softc *ssc, struct mbuf * m,
  82.                register struct in_addr *destip, register u_char * desten,
  83.                int * error);
  84. void arpinput(struct sana_softc *ssc, struct mbuf *m, caddr_t srcaddr);
  85. int arpioctl(int cmd, caddr_t data);
  86. #endif
  87.  
  88. #endif /* !IF_ARPSANA_H */
  89.