home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / MSDOS / NCSA / TEL2307S.ZIP / INCLUDE / DECNET.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-07  |  2.4 KB  |  55 lines

  1. /*
  2.     Header information for Decnet driver
  3.  
  4.     Quincey Koziol, Sept. 6, 1990
  5. */
  6.  
  7. #ifndef DECNET_H
  8. #define DECNET_H
  9.  
  10. /* Declarations for DEC's Datalink Driver (from VAXmate Technical Manual) */
  11.  
  12. struct dcb {  /* DEC Datalink Communication Block */
  13.    int portal_id;                  /*  0 Portal id for this request */
  14.    unsigned char source_addr[6];   /*  2 Source ethernet address */
  15.    unsigned char dest_addr[6];     /*  8 Destination ethernet address */
  16.    unsigned char *bh;              /* 14 Pointer to buffer header */
  17.    int bl;                         /* 18 Buffer length */
  18.    int operation;                  /* 20 Used by each function differently */
  19.    unsigned char pad;              /* 22 Pad flag for open */
  20.    unsigned char mode;             /* 23 Mode flag for open */
  21.    void (*line_state)();           /* 24 Line state change routine */
  22.    void (*rcv_callback)();         /* 28 Received data routine */
  23.    void (*xmit_callback)();        /* 32 Transmitted data routine */
  24.    unsigned char max_outstanding;  /* 36 Nbr of outstanding xmits/receives */
  25.    unsigned char ptype[2];         /* 37 Protocol type */
  26.    int buffers_lost;               /* 39 Nbr of buffers lost */
  27.    };                              /* 40 */
  28.  
  29. struct ucb {  /* DEC User Callback Block */
  30.    int portal_id;                /*  0 Portal id from the request */
  31.    unsigned char dest[6];        /*  2 Dest ethernet addr from buffer header */
  32.    unsigned char source[6];      /*  8 Source ethernet addr from buffer header */
  33.    unsigned char *buffer;        /* 14 Pointer to client buffer being returned */
  34.    int bl;                       /* 18 Null  or  length of received message */
  35.    unsigned char buffer_status;  /* 20 COMPLETE  or  ERROR */
  36.    unsigned char buffer_reason;  /* 21 ERROR reason  or  LINE_STATE_CHANGE */
  37.    };                            /* 22 */
  38.  
  39. #define CBASIZE  8  /* Must be a power of 2 */
  40. #define CBAMASK  7  /* CBASIZE-1 */
  41.  
  42. struct cba {  /* Callback Address array */
  43.    int inx;                      /* Index to put next ucb into */
  44.    int outx;                     /* Index to take next ucb from */
  45.    struct ucb uc[CBASIZE];       /* Copy of ucbs */
  46.    };
  47.  
  48. struct userdcb {  /* dcb + user info about it */
  49.    unsigned int portal_id;       /* Portal id (from dll_open) */
  50.    unsigned int ptype;           /* Protocol (in memory byte order) */
  51.    struct dcb d;                 /* The actual dcb */
  52.    };
  53.  
  54. #endif
  55.