home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / DataScope 2.0.3 / DataScope2l / TCPIncludes / data.h next >
Encoding:
C/C++ Source or Header  |  1994-05-04  |  3.1 KB  |  112 lines  |  [TEXT/MPS ]

  1. /*
  2. *    data.h
  3. *   Declarations of global variables for TCP/IP libraries
  4. *
  5. */
  6.  
  7. /*
  8. *  Start with declarations that tell the difference between PC and other
  9. *  computers
  10. */
  11. #ifdef PC
  12. #include "pcdefs.h"
  13. #else
  14. #include "macdefs.h"
  15. #endif
  16.  
  17. #ifdef MASTERDEF
  18. unsigned char
  19.     us[] = 
  20. {"National Center for Supercomputing Applications"},
  21.     nnmyaddr[DADDLEN],        /*  my ethernet hardware address */
  22.     broadaddr[DADDLEN],        /*  the broadcast address */    
  23.     nnipnum[4],                /*  my ip number */
  24.     nnredir = 0,            /*  flag indicating need for redirect */
  25.     nnicmpsave[4],            /*  address for icmp redirect */
  26.     nnicmpnew[4],            /*  new gateway from icmp redirect */
  27.     nnmask[4] = {0,0,0,0},    /*  the default subnet mask */
  28.     nnamask[4] = {255,0,0,0},        /* class A mask */
  29.     nnbmask[4] = {255,255,0,0},     /* class B mask */
  30.     nncmask[4] = {255,255,255,0},    /* class C mask */
  31.     broadip[4] = {0xff,0xff,0xff,0xff};
  32.  
  33. int
  34.     nnipident                    /*  ident field of outgoing ip packets */
  35.             =1,    
  36.     nnefirst                    /* first entry in event q */
  37.             =0,
  38.     nnelast                        /* last entry in event q */
  39.             =0,
  40.     nnefree                        /* free list for event q */
  41.             =0,
  42.     nnemac                        /* Macintosh is using direct EtherTalk */
  43.             =0,
  44.     nndto                        /* dlayertimeout */
  45.             =DLAYTIMEOUT,
  46.     nnfromport                    /* can force a port number selection */
  47.             = 0,
  48.     nncredit = CREDIT,            /* limited window in some cases */
  49.     nnsegsize = MAXSEG;            /* maximum segment size  (intswapped) */
  50.  
  51. struct port *portlist[NPORTS];        /* allocate like iobuffers in UNIX */
  52. struct uport ulist;                    /* buffer for UDP */
  53. struct pseudotcp tcps;                /* for checksums */
  54. struct acache arpc[CACHELEN];        /* cache for hardware addresses */
  55. struct eq nnq[NEVENTS];                /* event queue */
  56.  
  57. ARPKT arp;
  58. DLAYER blankd;
  59. IPKT blankip;
  60. /*ICMPKT blankicmp;*/
  61.  
  62. #else
  63. extern unsigned char
  64.     nnmyaddr[DADDLEN],    /*  my ethernet hardware address */
  65.     broadaddr[DADDLEN]        /*  the broadcast address */,
  66.     broadip[4],
  67.     nnipnum[4],
  68.     nnredir,            /*  flag indicating need for redirect */
  69.     nnicmpsave[4],            /*  address for icmp redirect */
  70.     nnicmpnew[4],            /*  new gateway from icmp redirect */
  71.     nnmask[4],
  72.     nnamask[4],
  73.     nnbmask[4],
  74.     nncmask[4];
  75.  
  76. extern int
  77.     nnipident                /*  ident field of ip */,
  78.     nnefirst                    /* first entry in event q */,
  79.     nnelast                        /* last entry in event q */,
  80.     nndto                        /* dlayertimeout */,
  81.     nnefree,
  82.     nnemac,                        /* Macintosh is using direct EtherTalk */
  83.     nnfromport,                    /* can force a port number selection */
  84.     nncredit,
  85.     nnsegsize;            /* maximum segment size */
  86.  
  87. extern struct port *portlist[NPORTS];        /* allocate like iobuffers in UNIX */
  88. extern struct uport ulist;                    /* buffer for UDP */
  89. extern struct pseudotcp tcps;                /* for checksums */
  90. extern struct acache arpc[CACHELEN];        /* cache for hardware addresses */
  91. extern struct eq nnq[NEVENTS];                /* event queue */
  92.  
  93. extern ARPKT arp;
  94. extern DLAYER blankd;
  95. extern IPKT blankip;
  96. /*extern ICMPKT blankicmp;*/
  97.  
  98. #endif
  99.  
  100. /*
  101. *   defines for types for functions, global to everyone 
  102. */
  103. char *nbgets();
  104. uint8 *getdlayer(),*netdlayer();
  105. char *neterrstring();            /* some more static data for driver */
  106.  
  107. /*
  108. *   defines of constants and macros that everyone needs to know
  109. */
  110.  
  111. #define nnerror(A)  netposterr(A)
  112.