Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

201 lines
4.3 KiB

  1. /*++
  2. Copyright (c) 1992-1999 Microsoft Corporation
  3. Module Name:
  4. wshatalk.h
  5. Abstract:
  6. This is the header file for application using Windows Sockets for
  7. Appletalk.
  8. Revision History:
  9. 10 Jul 1992 Initial Version
  10. --*/
  11. #ifndef _ATALKWSH_
  12. #define _ATALKWSH_
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif
  16. //
  17. // All protocol types should be specified in the Decimal base
  18. //
  19. #define DECIMAL_BASE 10
  20. //
  21. // Protocol number 0 is invalid in the Appletalk case
  22. //
  23. #define ATPROTO_BASE (1000 * AF_APPLETALK)
  24. #define SOL_APPLETALK (ATPROTO_BASE)
  25. #define DDPPROTO_RTMP (ATPROTO_BASE + 1)
  26. #define DDPPROTO_NBP (ATPROTO_BASE + 2)
  27. #define DDPPROTO_ATP (ATPROTO_BASE + 3)
  28. #define DDPPROTO_AEP (ATPROTO_BASE + 4)
  29. #define DDPPROTO_RTMPRQ (ATPROTO_BASE + 5)
  30. #define DDPPROTO_ZIP (ATPROTO_BASE + 6)
  31. #define DDPPROTO_ADSP (ATPROTO_BASE + 7)
  32. #define DDPPROTO_MAX (ATPROTO_BASE + 255)
  33. //
  34. // Define the higher layer appletalk protocol types
  35. //
  36. #define ATPROTO_ADSP (DDPPROTO_MAX + 1)
  37. #define ATPROTO_ATP (DDPPROTO_MAX + 2)
  38. #define ATPROTO_ASP (DDPPROTO_MAX + 3)
  39. #define ATPROTO_PAP (DDPPROTO_MAX + 4)
  40. #define SO_REGISTER_NAME 0xA000
  41. #define SO_DEREGISTER_NAME 0xA001
  42. #define SO_REMOVE_NAME SO_DEREGISTER_NAME
  43. #define SO_LOOKUP_NAME 0xA002
  44. #define SO_CONFIRM_NAME 0xA003
  45. #define SO_LOOKUP_MYZONE 0xA004
  46. #define SO_GETMYZONE SO_LOOKUP_MYZONE
  47. #define SO_LOOKUP_ZONES 0xA005
  48. #define SO_GETZONELIST SO_LOOKUP_ZONES
  49. #define SO_LOOKUP_ZONES_ON_ADAPTER 0xA006
  50. #define SO_GETLOCALZONES SO_LOOKUP_ZONES_ON_ADAPTER
  51. #define SO_LOOKUP_NETDEF_ON_ADAPTER 0xA007
  52. #define SO_GETNETINFO SO_LOOKUP_NETDEF_ON_ADAPTER
  53. //
  54. // PAP-specific options
  55. //
  56. #define SO_PAP_SET_SERVER_STATUS 0xA007
  57. #define SO_PAP_GET_SERVER_STATUS 0xA008
  58. #define SO_PAP_PRIME_READ 0xA009
  59. #define ATADDR_ANY 0 // Dynamic socket (=0)
  60. #define ATADDR_BROADCAST 0xFF // Broadcast node id (=ff)
  61. //
  62. // Define flags/error codes peculiar to Appletalk
  63. //
  64. #define WSAEMSGPARTIAL (WSABASEERR+100)
  65. // Maximum pap status size
  66. #define MAX_PAP_STATUS_SIZE 255
  67. #define MIN_PAP_READ_BUF_SIZE 4096
  68. // These are the unused 4 bytes returned in the PAP status packet. If ever
  69. // they are to be interpreted, they will be available.
  70. #define PAP_UNUSED_STATUS_BYTES 4
  71. //
  72. // SOCKADDR_AT structure
  73. //
  74. typedef struct sockaddr_at
  75. {
  76. USHORT sat_family;
  77. USHORT sat_net;
  78. UCHAR sat_node;
  79. UCHAR sat_socket;
  80. } SOCKADDR_AT, *PSOCKADDR_AT;
  81. //
  82. // ***WARNING***
  83. // This is defined to be the same as the ATALK ADDRESS defined in atalktdi.h
  84. // Change this if the other changes.
  85. //
  86. typedef union
  87. {
  88. struct
  89. {
  90. USHORT Network;
  91. UCHAR Node;
  92. UCHAR Socket;
  93. };
  94. ULONG Address;
  95. } WSH_ATALK_ADDRESS, *PWSH_ATALK_ADDRESS;
  96. //
  97. // Typedefs for the various options
  98. //
  99. //
  100. // ***WARNING***:
  101. // This should be exactly the same as NBP_NAME defined in atalktdi.h
  102. //
  103. #define MAX_ENTITY 32
  104. typedef struct
  105. {
  106. CHAR ObjectNameLen;
  107. CHAR ObjectName[MAX_ENTITY];
  108. CHAR TypeNameLen;
  109. CHAR TypeName[MAX_ENTITY];
  110. CHAR ZoneNameLen;
  111. CHAR ZoneName[MAX_ENTITY];
  112. } WSH_NBP_NAME, *PWSH_NBP_NAME;
  113. typedef struct
  114. {
  115. WSH_ATALK_ADDRESS Address;
  116. USHORT Enumerator;
  117. WSH_NBP_NAME NbpName;
  118. } WSH_NBP_TUPLE, *PWSH_NBP_TUPLE;
  119. typedef WSH_NBP_NAME WSH_REGISTER_NAME, *PWSH_REGISTER_NAME;
  120. typedef WSH_NBP_NAME WSH_DEREGISTER_NAME, *PWSH_DEREGISTER_NAME;
  121. typedef WSH_NBP_NAME WSH_REMOVE_NAME, *PWSH_REMOVE_NAME;
  122. typedef struct _WSH_LOOKUP_ZONES
  123. {
  124. ULONG NoZones;
  125. //
  126. // CHAR Zones[] - null separated zones
  127. //
  128. } WSH_LOOKUP_ZONES, *PWSH_LOOKUP_ZONES;
  129. typedef struct _WSH_LOOKUP_NETDEF_ON_ADAPTER
  130. {
  131. USHORT NetworkRangeLowerEnd;
  132. USHORT NetworkRangeUpperEnd;
  133. // This will be followed by a null terminated ansi default zone.
  134. // PUCHAR DefaultZone[]
  135. } WSH_LOOKUP_NETDEF_ON_ADAPTER , *PWSH_LOOKUP_NETDEF_ON_ADAPTER;
  136. typedef struct _WSH_LOOKUP_NAME
  137. {
  138. WSH_NBP_TUPLE LookupTuple;
  139. ULONG NoTuples;
  140. //
  141. // Array of NoTuple WSH_NBP_TUPLEs
  142. //
  143. } WSH_LOOKUP_NAME, *PWSH_LOOKUP_NAME;
  144. typedef struct _WSH_PAP_GET_SERVER_STATUS
  145. {
  146. SOCKADDR_AT ServerAddr;
  147. UCHAR Reserved[PAP_UNUSED_STATUS_BYTES];
  148. UCHAR ServerStatus[MAX_PAP_STATUS_SIZE+1];
  149. } WSH_PAP_GET_SERVER_STATUS, *PWSH_PAP_GET_SERVER_STATUS;
  150. #endif // _ATALKWSH_