home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 May / VPR9705A.ISO / VPR_DATA / PROGRAM / CBTRIAL / SETUP / DATA.Z / WSHISOTP.H < prev    next >
C/C++ Source or Header  |  1997-02-14  |  4KB  |  102 lines

  1. /* File: .streams.include.src/mod  wshisotp.h            Version: Initial */
  2. /*
  3.  *   wshisotp.h
  4.  *
  5.  *   Windows Sockets include file for ISO TP4.  This file contains all
  6.  *   standardized ISO TP4 information.  Include this header file after
  7.  *   winsock.h.
  8.  *
  9.  *   The information contained in this header file was originally
  10.  *   created by Alcatel TITN Inc.
  11.  */
  12.  
  13. /*
  14.  *      C/C++ Run Time Library - Version 8.0
  15.  *
  16.  *      Copyright (c) 1994, 1997 by Borland International
  17.  *      All Rights Reserved.
  18.  *
  19.  */
  20.  
  21. #ifndef _WSHISOTP_
  22. #define _WSHISOTP_
  23. #define __WSHISOTP_H
  24. #pragma option -b
  25.  
  26. /*
  27.  * Protocol values for ISO transport protocols.
  28.  */
  29.  
  30. #define ISOPROTO_TP0       25      /* connection orientated transport protocol */
  31. #define ISOPROTO_TP1       26      /* not implemented */
  32. #define ISOPROTO_TP2       27      /* not implemented */
  33. #define ISOPROTO_TP3       28      /* not implemented */
  34. #define ISOPROTO_TP4       29      /* connection orientated transport protocol */
  35. #define ISOPROTO_TP        ISOPROTO_TP4
  36. #define ISOPROTO_CLTP      30      /* connectionless transport */
  37. #define ISOPROTO_CLNP      31      /* connectionless internetworking protocol */
  38. #define ISOPROTO_X25       32      /* cons */
  39. #define ISOPROTO_INACT_NL  33      /* inactive network layer */
  40. #define ISOPROTO_ESIS      34      /* ES-IS protocol */
  41. #define ISOPROTO_INTRAISIS 35      /* IS-IS protocol */
  42.  
  43. #define IPPROTO_RAW        255     /* raw clnp */
  44. #define IPPROTO_MAX        256
  45.  
  46. /*
  47.  *   The maximum size of the tranport address (tp_addr field of a
  48.  *   sockaddr_tp structure) is 64.
  49.  */
  50.  
  51. #define ISO_MAX_ADDR_LENGTH 64
  52.  
  53. /*
  54.  *   There are two types of ISO addresses, hierarchical and
  55.  *   non-hierarchical.  For hierarchical addresses, the tp_addr
  56.  *   field contains both the transport selector and the network
  57.  *   address.  For non-hierarchical addresses, tp_addr contains only
  58.  *   the transport address, which must be translated by the ISO TP4
  59.  *   transport provider into the transport selector and network address.
  60.  */
  61.  
  62. #define ISO_HIERARCHICAL            0
  63. #define ISO_NON_HIERARCHICAL        1
  64.  
  65. /*
  66.  *   The format of the address structure (sockaddr) to pass to Windows
  67.  *   Sockets APIs.
  68.  *
  69.  */
  70.  
  71. typedef struct sockaddr_tp {
  72.    u_short tp_family;          /* Always AF_ISO */
  73.    u_short tp_addr_type;       /* ISO_HIERARCHICAL or ISO_NON_HIERARCHICAL 
  74. */
  75.    u_short tp_taddr_len;       /* Length of transport address, <= 52 */
  76.    u_short tp_tsel_len;        /* Length of transport selector, <= 32 */
  77.                                /* 0 if ISO_NON_HIERARCHICAL */
  78.    u_char tp_addr[ISO_MAX_ADDR_LENGTH];
  79. } SOCKADDR_TP, *PSOCKADDR_TP, *LPSOCKADDR_TP;
  80.  
  81. #define ISO_SET_TP_ADDR(sa_tp, port, portlen, node, nodelen)              \
  82.             (sa_tp)->tp_family = AF_ISO;                         \
  83.             (sa_tp)->tp_addr_type = ISO_HIERARCHICAL;            \
  84.             (sa_tp)->tp_tsel_len = (portlen);              \
  85.             (sa_tp)->tp_taddr_len = (portlen) + (nodelen); \
  86.             memcpy(&(sa_tp)->tp_addr, (port), (portlen)); \
  87.             memcpy(&(sa_tp)->tp_addr[portlen], (node), (nodelen));
  88.  
  89.  
  90. /*
  91.  *   Expedited Data Usage Negotiation option.
  92.  *   Default when the option is not present is be EXP_DATA_USE
  93.  *   as per ISO 8073
  94.  */
  95.  
  96. #define ISO_EXP_DATA_USE  00    /* Use of Expedited Data */
  97. #define ISO_EXP_DATA_NUSE 01    /* Non-use of Expedited Data */
  98.  
  99. #pragma option -b.
  100. #endif
  101.  
  102.