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