home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / wshisotp.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  3KB  |  92 lines

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