home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C++ / Applications / Nuntius 1.2 / src / Nuntius / MiscIPPB.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-20  |  3.2 KB  |  125 lines  |  [TEXT/MPS ]

  1. /* 
  2.     IPPB.h    
  3.     C definitions of parameter block entries needed for IP calls
  4.  
  5.     Copyright Apple Computer, Inc. 1988-91 
  6.     All rights reserved
  7.     Modifications by Steve Falkenburg, Apple MacDTS 8/91
  8.     
  9. */
  10.  
  11. /* conditional #include -->SJF<-- */
  12.  
  13. #ifndef __MISCIPPB__
  14. #define __MISCIPPB__
  15.  
  16. /* added for misc. definitions -->SJF<-- */
  17. #ifndef __MACTCPCOMMONTYPES__
  18. #include <MacTCPCommonTypes.h>
  19. #endif
  20.  
  21. /* added for AddrBlock definition -->SJF<-- */
  22. #ifndef __APPLETALK__
  23. #include <AppleTalk.h>
  24. #endif
  25.  
  26. /* control codes */
  27. #define ipctlEchoICMP        17            /* send icmp echo */
  28. #define ipctlLAPStats        19            /* get lap stats */
  29.  
  30. /* this is already #defined in MacTCPCommonTypes -->SJF<--
  31. /*#define icmpEchoTimeoutErr        -23035      */  /* ICMP echo timed-out */
  32.  
  33.  
  34. /* Changed from ParamBlockHeader -->SJF<-- */
  35.  
  36. #define IPParamBlockHeader  \
  37.     struct QElem *qLink;     \
  38.     short qType;             \
  39.     short ioTrap;             \
  40.     Ptr ioCmdAddr;             \
  41.     ProcPtr ioCompletion;     \
  42.     OSErr ioResult;         \
  43.     StringPtr ioNamePtr;     \
  44.     short ioVRefNum;        \
  45.     short ioCRefNum;        \
  46.     short csCode
  47.     
  48. typedef void (*ICMPEchoNotifyProc) (struct ICMPParamBlock *iopb);
  49.  
  50.  
  51. struct IPParamBlock {   
  52.     IPParamBlockHeader;                 /* standard I/O header */ /* Changed from ParamBlockHeader -->SJF<-- */
  53.     union {
  54.         struct {
  55.             ip_addr    dest;                /* echo to IP address */
  56.             wdsEntry data;
  57.             short timeout;
  58.             Ptr options;
  59.             unsigned short optLength;
  60.             ICMPEchoNotifyProc icmpCompletion;
  61.             unsigned long userDataPtr;
  62.             } IPEchoPB;
  63.         struct {
  64.             struct LAPStats *lapStatsPtr;
  65.             } LAPStatsPB;
  66.         } csParam;
  67.     };
  68.  
  69. struct ICMPParamBlock {
  70.     IPParamBlockHeader;                 /* standard I/O header */ /* Changed from ParamBlockHeader -->SJF<-- */
  71.     short params[11];
  72.     struct {
  73.         unsigned long echoRequestOut;    /* time in ticks of when the echo request went out */
  74.         unsigned long echoReplyIn;        /* time in ticks of when the reply was received */
  75.         struct rdsEntry echoedData;        /* data received in responce */
  76.         Ptr options;
  77.         unsigned long userDataPtr;
  78.         } icmpEchoInfo;
  79.     };
  80.  
  81.     
  82. typedef struct LAPStats {
  83.     short    ifType;
  84.     char    *ifString;
  85.     short    ifMaxMTU;
  86.     long    ifSpeed;
  87.     short    ifPhyAddrLength;
  88.     char    *ifPhysicalAddress;
  89.     union {
  90.         struct arp_entry *arp_table;    
  91.         struct nbp_entry *nbp_table;
  92.         } AddrXlation;
  93.     short    slotNumber;
  94.     };
  95.     
  96. #define NBP_TABLE_SIZE    20                /* number of NBP table entries */
  97. #define NBP_MAX_NAME_SIZE    16+10+2
  98.  
  99. struct nbp_entry {
  100.     ip_addr     ip_address;                /* IP address */
  101.     AddrBlock    at_address;                /* matching AppleTalk address */
  102.     Boolean        gateway;                /* TRUE if entry for a gateway */
  103.     Boolean        valid;                    /* TRUE if LAP address is valid */
  104.     Boolean        probing;                /* TRUE if NBP lookup pending */
  105.     long        age;                    /* ticks since cache entry verified */  /* int->long -->SJF<-- */
  106.     long        access;                 /* ticks since last access */   /* int->long -->SJF<-- */
  107.     char        filler[116];            /* for internal use only !!! */
  108.     };
  109.  
  110. #define ARP_TABLE_SIZE    20                /* number of ARP table entries */
  111.  
  112. typedef struct Enet_addr {
  113.     b_16 en_hi;
  114.     b_32 en_lo;
  115.     } Enet_addr;
  116.  
  117. typedef struct arp_entry {
  118.     short        age;            /* cache aging field */
  119.     b_16        protocol;        /* Protocol type */
  120.     ip_addr     ip_address;        /* IP address */
  121.     Enet_addr    en_address;        /* matching Ethernet address */
  122.     };
  123.  
  124. #endif      /* conditional include -->SJF<-- */
  125.