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

  1. /*++ BUILD Version: 0001    // Increment this if a change has global effects
  2.  
  3. Copyright 1992 - 1998 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     svcguid.h
  8.  
  9. Abstract:
  10.  
  11.     Defines GUIDs for well-known services including:
  12.  
  13.         HOSTNAME
  14.         RFC 1060 (Assigned Numbers) from IANA (All TCP/IP Services)
  15.         NetWare services
  16.  
  17. Created:
  18.  
  19.     May 8, 1994
  20.  
  21. Revision History:
  22.  
  23. --*/
  24.  
  25. #ifndef _SVCGUID_
  26. #define _SVCGUID_
  27.  
  28. #include  <basetyps.h>
  29.  
  30. //
  31. // HOSTNAME--special GUID which refers to the name of a host as opposed
  32. // to any particular service on that host.
  33. //
  34.  
  35. #define SVCID_HOSTNAME { 0x0002a800, 0, 0, { 0xC0,0,0,0,0,0,0,0x46 } }
  36.  
  37. //
  38. // GUIDs for dealing with AF_INET address spaces alone. These are
  39. // intended to be used when fetching hostent or servent information
  40. // from such a provider. These are not general-purpose types and
  41. // should be used only when the intent is getting at down-level
  42. // information.
  43. //
  44.  
  45. #define SVCID_INET_HOSTADDRBYINETSTRING \
  46.               { 0x0002a801, 0, 0, { 0xC0,0,0,0,0,0,0,0x46 } }
  47. #define SVCID_INET_SERVICEBYNAME \
  48.                   { 0x0002a802, 0, 0, { 0xC0,0,0,0,0,0,0,0x46 } }
  49. #define SVCID_INET_HOSTADDRBYNAME \
  50.                   { 0x0002a803, 0, 0, { 0xC0,0,0,0,0,0,0,0x46 } }
  51.  
  52. //
  53. // Macros for defining and testing TCP and UDP GUIDs from a well-known
  54. // port.
  55. //
  56.  
  57. #define SVCID_TCP_RR(_Port, _RR) \
  58.              { (0x0009 << 16) | (_Port), 0, _RR, { 0xC0,0,0,0,0,0,0,0x46 } }
  59.  
  60. #define SVCID_TCP(_Port) SVCID_TCP_RR(_Port, 0)
  61.  
  62. #define IS_SVCID_TCP(_g) \
  63.              ( ((((_g)->Data1) & 0xFFFF0000) == 0x00090000) && \
  64.                (((_g)->Data2) == 0) &&                       \
  65.                (((_g)->Data4[0]) == 0xC0) &&                 \
  66.                (((_g)->Data4[1]) == 0) &&                    \
  67.                (((_g)->Data4[2]) == 0) &&                    \
  68.                (((_g)->Data4[3]) == 0) &&                    \
  69.                (((_g)->Data4[4]) == 0) &&                    \
  70.                (((_g)->Data4[5]) == 0) &&                    \
  71.                (((_g)->Data4[6]) == 0) &&                    \
  72.                (((_g)->Data4[7]) == 0x46) )
  73.  
  74. #define PORT_FROM_SVCID_TCP(_g) \
  75.                ((WORD)(_g->Data1 & 0xFFFF))
  76.  
  77. #define RR_FROM_SVCID(_RR) (_RR->Data3)
  78.  
  79.  
  80. #define SET_TCP_SVCID_RR(_g,_Port, _RR) {                    \
  81.                (_g)->Data1 = (0x0009 << 16 ) | (_Port);      \
  82.                (_g)->Data2 = 0;                              \
  83.                (_g)->Data3 = _RR;                            \
  84.                (_g)->Data4[0] = 0xC0;                        \
  85.                (_g)->Data4[1] = 0x0;                         \
  86.                (_g)->Data4[2] = 0x0;                         \
  87.                (_g)->Data4[3] = 0x0;                         \
  88.                (_g)->Data4[4] = 0x0;                         \
  89.                (_g)->Data4[5] = 0x0;                         \
  90.                (_g)->Data4[6] = 0x0;                         \
  91.                (_g)->Data4[7] = 0x46; }
  92.  
  93. #define SET_TCP_SVCID(_g,_Port) SET_TCP_SVCID_RR(_g, _Port, 0)
  94.  
  95. #define SVCID_UDP_RR(_Port, _RR) \
  96.              { (0x000A << 16) | (_Port), 0, _RR, { 0xC0,0,0,0,0,0,0,0x46 } }
  97.  
  98. #define SVCID_UDP(_Port) SVCID_UDP_RR(_Port, 0)
  99.  
  100. #define IS_SVCID_UDP(_g) \
  101.              ( ((((_g)->Data1) & 0xFFFF0000) == 0x000A0000) && \
  102.                (((_g)->Data2) == 0) &&                       \
  103.                (((_g)->Data4[0]) == 0xC0) &&                 \
  104.                (((_g)->Data4[1]) == 0) &&                    \
  105.                (((_g)->Data4[2]) == 0) &&                    \
  106.                (((_g)->Data4[3]) == 0) &&                    \
  107.                (((_g)->Data4[4]) == 0) &&                    \
  108.                (((_g)->Data4[5]) == 0) &&                    \
  109.                (((_g)->Data4[6]) == 0) &&                    \
  110.                (((_g)->Data4[7]) == 0x46) )
  111.  
  112. #define PORT_FROM_SVCID_UDP(_g) \
  113.                ((WORD)(_g->Data1 & 0xFFFF))
  114.  
  115. #define SET_UDP_SVCID_RR(_g,_Port, _RR) {                    \
  116.                (_g)->Data1 = (0x000A << 16 ) | (_Port);      \
  117.                (_g)->Data2 = 0;                              \
  118.                (_g)->Data3 = _RR;                            \
  119.                (_g)->Data4[0] = 0xC0;                        \
  120.                (_g)->Data4[1] = 0x0;                         \
  121.                (_g)->Data4[2] = 0x0;                         \
  122.                (_g)->Data4[3] = 0x0;                         \
  123.                (_g)->Data4[4] = 0x0;                         \
  124.                (_g)->Data4[5] = 0x0;                         \
  125.                (_g)->Data4[6] = 0x0;                         \
  126.                (_g)->Data4[7] = 0x46; }
  127.  
  128. #define SET_UDP_SVCID(_g, _Port) SET_UDP_SVCID_RR(_g, _Port, 0)
  129.  
  130. //
  131. // Macros for defining and testing Netware (SAP) services based on the
  132. // SAP ID.
  133. //
  134.  
  135. #define SVCID_NETWARE(_SapId) \
  136.              { (0x000B << 16) | (_SapId), 0, 0, { 0xC0,0,0,0,0,0,0,0x46 } }
  137.  
  138. #define IS_SVCID_NETWARE(_g) \
  139.              ( ((((_g)->Data1) & 0xFFFF0000) == 0x000B0000) && \
  140.                (((_g)->Data2) == 0) &&                       \
  141.                (((_g)->Data3) == 0) &&                       \
  142.                (((_g)->Data4[0]) == 0xC0) &&                 \
  143.                (((_g)->Data4[1]) == 0) &&                    \
  144.                (((_g)->Data4[2]) == 0) &&                    \
  145.                (((_g)->Data4[3]) == 0) &&                    \
  146.                (((_g)->Data4[4]) == 0) &&                    \
  147.                (((_g)->Data4[5]) == 0) &&                    \
  148.                (((_g)->Data4[6]) == 0) &&                    \
  149.                (((_g)->Data4[7]) == 0x46) )
  150.  
  151. #define SAPID_FROM_SVCID_NETWARE(_g) \
  152.                ((WORD)(_g->Data1 & 0xFFFF))
  153.  
  154. #define SET_NETWARE_SVCID(_g,_SapId) {                       \
  155.                (_g)->Data1 = (0x000B << 16 ) | (_SapId);     \
  156.                (_g)->Data2 = 0;                              \
  157.                (_g)->Data3 = 0;                              \
  158.                (_g)->Data4[0] = 0xC0;                        \
  159.                (_g)->Data4[1] = 0x0;                         \
  160.                (_g)->Data4[2] = 0x0;                         \
  161.                (_g)->Data4[3] = 0x0;                         \
  162.                (_g)->Data4[4] = 0x0;                         \
  163.                (_g)->Data4[5] = 0x0;                         \
  164.                (_g)->Data4[6] = 0x0;                         \
  165.                (_g)->Data4[7] = 0x46; }
  166.  
  167. //
  168. // RFC 1060 services as defined by the IANA
  169. // GUID block = 0009xxxx-0000-0000-C0000-000000000046
  170. //
  171.  
  172. #define SVCID_ECHO_TCP                SVCID_TCP( 7 )
  173. #define SVCID_DISCARD_TCP             SVCID_TCP( 9 )
  174. #define SVCID_SYSTAT_TCP              SVCID_TCP( 11 )
  175. #define SVCID_SYSTAT_TCP              SVCID_TCP( 11 )
  176. #define SVCID_DAYTIME_TCP             SVCID_TCP( 13 )
  177. #define SVCID_NETSTAT_TCP             SVCID_TCP( 15 )
  178. #define SVCID_QOTD_TCP                SVCID_TCP( 17 )
  179. #define SVCID_CHARGEN_TCP             SVCID_TCP( 19 )
  180. #define SVCID_FTP_DATA_TCP            SVCID_TCP( 20 )
  181. #define SVCID_FTP_TCP                 SVCID_TCP( 21 )
  182. #define SVCID_TELNET_TCP              SVCID_TCP( 23 )
  183. #define SVCID_SMTP_TCP                SVCID_TCP( 25 )
  184. #define SVCID_TIME_TCP                SVCID_TCP( 37 )
  185. #define SVCID_NAME_TCP                SVCID_TCP( 42 )
  186. #define SVCID_WHOIS_TCP               SVCID_TCP( 43 )
  187. #define SVCID_DOMAIN_TCP              SVCID_TCP( 53 )
  188. #define SVCID_NAMESERVER_TCP          SVCID_TCP( 53 )
  189. #define SVCID_MTP_TCP                 SVCID_TCP( 57 )
  190. #define SVCID_RJE_TCP                 SVCID_TCP( 77 )
  191. #define SVCID_FINGER_TCP              SVCID_TCP( 79 )
  192. #define SVCID_LINK_TCP                SVCID_TCP( 87 )
  193. #define SVCID_SUPDUP_TCP              SVCID_TCP( 95 )
  194. #define SVCID_HOSTNAMES_TCP           SVCID_TCP( 101 )
  195. #define SVCID_ISO_TSAP_TCP            SVCID_TCP( 102 )
  196. #define SVCID_DICTIONARY_TCP          SVCID_TCP( 103 )
  197. #define SVCID_X400_TCP                SVCID_TCP( 103 )
  198. #define SVCID_X400_SND_TCP            SVCID_TCP( 104 )
  199. #define SVCID_CSNET_NS_TCP            SVCID_TCP( 105 )
  200. #define SVCID_POP_TCP                 SVCID_TCP( 109 )
  201. #define SVCID_POP2_TCP                SVCID_TCP( 109 )
  202. #define SVCID_POP3_TCP                SVCID_TCP( 110 )
  203. #define SVCID_PORTMAP_TCP             SVCID_TCP( 111 )
  204. #define SVCID_SUNRPC_TCP              SVCID_TCP( 111 )
  205. #define SVCID_AUTH_TCP                SVCID_TCP( 113 )
  206. #define SVCID_SFTP_TCP                SVCID_TCP( 115 )
  207. #define SVCID_PATH_TCP                SVCID_TCP( 117 )
  208. #define SVCID_UUCP_PATH_TCP           SVCID_TCP( 117 )
  209. #define SVCID_NNTP_TCP                SVCID_TCP( 119 )
  210. #define SVCID_NBSESSION_TCP           SVCID_TCP( 139 )
  211. #define SVCID_NEWS_TCP                SVCID_TCP( 144 )
  212. #define SVCID_TCPREPO_TCP             SVCID_TCP( 158 )
  213. #define SVCID_PRINT_SRV_TCP           SVCID_TCP( 170 )
  214. #define SVCID_VMNET_TCP               SVCID_TCP( 175 )
  215. #define SVCID_VMNET0_TCP              SVCID_TCP( 400 )
  216. #define SVCID_EXEC_TCP                SVCID_TCP( 512 )
  217. #define SVCID_LOGIN_TCP               SVCID_TCP( 513 )
  218. #define SVCID_SHELL_TCP               SVCID_TCP( 514 )
  219. #define SVCID_PRINTER_TCP             SVCID_TCP( 515 )
  220. #define SVCID_EFS_TCP                 SVCID_TCP( 520 )
  221. #define SVCID_TEMPO_TCP               SVCID_TCP( 526 )
  222. #define SVCID_COURIER_TCP             SVCID_TCP( 530 )
  223. #define SVCID_CONFERENCE_TCP          SVCID_TCP( 531 )
  224. #define SVCID_NETNEWS_TCP             SVCID_TCP( 532 )
  225. #define SVCID_UUCP_TCP                SVCID_TCP( 540 )
  226. #define SVCID_KLOGIN_TCP              SVCID_TCP( 543 )
  227. #define SVCID_KSHELL_TCP              SVCID_TCP( 544 )
  228. #define SVCID_REMOTEFS_TCP            SVCID_TCP( 556 )
  229. #define SVCID_GARCON_TCP              SVCID_TCP( 600 )
  230. #define SVCID_MAITRD_TCP              SVCID_TCP( 601 )
  231. #define SVCID_BUSBOY_TCP              SVCID_TCP( 602 )
  232. #define SVCID_KERBEROS_TCP            SVCID_TCP( 750 )
  233. #define SVCID_KERBEROS_MASTER_TCP     SVCID_TCP( 751 )
  234. #define SVCID_KRB_PROP_TCP            SVCID_TCP( 754 )
  235. #define SVCID_ERLOGIN_TCP             SVCID_TCP( 888 )
  236. #define SVCID_KPOP_TCP                SVCID_TCP( 1109 )
  237. #define SVCID_INGRESLOCK_TCP          SVCID_TCP( 1524 )
  238. #define SVCID_KNETD_TCP               SVCID_TCP( 2053 )
  239. #define SVCID_EKLOGIN_TCP             SVCID_TCP( 2105 )
  240. #define SVCID_RMT_TCP                 SVCID_TCP( 5555 )
  241. #define SVCID_MTB_TCP                 SVCID_TCP( 5556 )
  242. #define SVCID_MAN_TCP                 SVCID_TCP( 9535 )
  243. #define SVCID_W_TCP                   SVCID_TCP( 9536 )
  244. #define SVCID_MANTST_TCP              SVCID_TCP( 9537 )
  245. #define SVCID_BNEWS_TCP               SVCID_TCP( 10000 )
  246. #define SVCID_QUEUE_TCP               SVCID_TCP( 10001 )
  247. #define SVCID_POKER_TCP               SVCID_TCP( 10002 )
  248. #define SVCID_GATEWAY_TCP             SVCID_TCP( 10003 )
  249. #define SVCID_REMP_TCP                SVCID_TCP( 10004 )
  250. #define SVCID_QMASTER_TCP             SVCID_TCP( 10012 )
  251.  
  252. #define SVCID_ECHO_UDP                SVCID_UDP( 7 )
  253. #define SVCID_DISCARD_UDP             SVCID_UDP( 9 )
  254. #define SVCID_DAYTIME_UDP             SVCID_UDP( 13 )
  255. #define SVCID_QOTD_UDP                SVCID_UDP( 17 )
  256. #define SVCID_CHARGEN_UDP             SVCID_UDP( 19 )
  257. #define SVCID_TIME_UDP                SVCID_UDP( 37 )
  258. #define SVCID_RLP_UDP                 SVCID_UDP( 39 )
  259. #define SVCID_NAME_UDP                SVCID_UDP( 42 )
  260. #define SVCID_DOMAIN_UDP              SVCID_UDP( 53 )
  261. #define SVCID_NAMESERVER_UDP          SVCID_UDP( 53 )
  262. #define SVCID_BOOTP_UDP               SVCID_UDP( 67 )
  263. #define SVCID_TFTP_UDP                SVCID_UDP( 69 )
  264. #define SVCID_PORTMAP_UDP             SVCID_UDP( 111 )
  265. #define SVCID_SUNRPC_UDP              SVCID_UDP( 111 )
  266. #define SVCID_NTP_UDP                 SVCID_UDP( 123 )
  267. #define SVCID_NBNAME_UDP              SVCID_UDP( 137 )
  268. #define SVCID_NBDATAGRAM_UDP          SVCID_UDP( 138 )
  269. #define SVCID_SGMP_UDP                SVCID_UDP( 153 )
  270. #define SVCID_SNMP_UDP                SVCID_UDP( 161 )
  271. #define SVCID_SNMP_TRAP_UDP           SVCID_UDP( 162 )
  272. #define SVCID_LOAD_UDP                SVCID_UDP( 315 )
  273. #define SVCID_SYTEK_UDP               SVCID_UDP( 500 )
  274. #define SVCID_BIFF_UDP                SVCID_UDP( 512 )
  275. #define SVCID_WHO_UDP                 SVCID_UDP( 513 )
  276. #define SVCID_SYSLOG_UDP              SVCID_UDP( 514 )
  277. #define SVCID_TALK_UDP                SVCID_UDP( 517 )
  278. #define SVCID_NTALK_UDP               SVCID_UDP( 518 )
  279. #define SVCID_ROUTE_UDP               SVCID_UDP( 520 )
  280. #define SVCID_TIMED_UDP               SVCID_UDP( 525 )
  281. #define SVCID_RVD_CONTROL_UDP         SVCID_UDP( 531 )
  282. #define SVCID_NETWALL_UDP             SVCID_UDP( 533 )
  283. #define SVCID_NEW_RWHO_UDP            SVCID_UDP( 550 )
  284. #define SVCID_RMONITOR_UDP            SVCID_UDP( 560 )
  285. #define SVCID_MONITOR_UDP             SVCID_UDP( 561 )
  286. #define SVCID_ACCTMASTER_UDP          SVCID_UDP( 700 )
  287. #define SVCID_ACCTSLAVE_UDP           SVCID_UDP( 701 )
  288. #define SVCID_ACCT_UDP                SVCID_UDP( 702 )
  289. #define SVCID_ACCTLOGIN_UDP           SVCID_UDP( 703 )
  290. #define SVCID_ACCTPRINTER_UDP         SVCID_UDP( 704 )
  291. #define SVCID_ELCSD_UDP               SVCID_UDP( 704 )
  292. #define SVCID_ACCTINFO_UDP            SVCID_UDP( 705 )
  293. #define SVCID_ACCTSLAVE2_UDP          SVCID_UDP( 706 )
  294. #define SVCID_ACCTDISK_UDP            SVCID_UDP( 707 )
  295. #define SVCID_KERBEROS_UDP            SVCID_UDP( 750 )
  296. #define SVCID_KERBEROS_MASTER_UDP     SVCID_UDP( 751 )
  297. #define SVCID_PASSWD_SERVER_UDP       SVCID_UDP( 752 )
  298. #define SVCID_USERREG_SERVER_UDP      SVCID_UDP( 753 )
  299. #define SVCID_PHONE_UDP               SVCID_UDP( 1167 )
  300. #define SVCID_MAZE_UDP                SVCID_UDP( 1666 )
  301. #define SVCID_NFS_UDP                 SVCID_UDP( 2049 )
  302. #define SVCID_RSCS0_UDP               SVCID_UDP( 10000 )
  303. #define SVCID_RSCS1_UDP               SVCID_UDP( 10001 )
  304. #define SVCID_RSCS2_UDP               SVCID_UDP( 10002 )
  305. #define SVCID_RSCS3_UDP               SVCID_UDP( 10003 )
  306. #define SVCID_RSCS4_UDP               SVCID_UDP( 10004 )
  307. #define SVCID_RSCS5_UDP               SVCID_UDP( 10005 )
  308. #define SVCID_RSCS6_UDP               SVCID_UDP( 10006 )
  309. #define SVCID_RSCS7_UDP               SVCID_UDP( 10007 )
  310. #define SVCID_RSCS8_UDP               SVCID_UDP( 10008 )
  311. #define SVCID_RSCS9_UDP               SVCID_UDP( 10009 )
  312. #define SVCID_RSCSA_UDP               SVCID_UDP( 10010 )
  313. #define SVCID_RSCSB_UDP               SVCID_UDP( 10011 )
  314. #define SVCID_QMASTER_UDP             SVCID_UDP( 10012 )
  315.  
  316. //
  317. // NetWare services
  318. // GUID block = 000axxxx-0000-0000-C0000-000000000046
  319. //
  320.  
  321. #define SVCID_PRINT_QUEUE                 SVCID_NETWARE( 0x3 )
  322. #define SVCID_FILE_SERVER                 SVCID_NETWARE( 0x4 )
  323. #define SVCID_JOB_SERVER                  SVCID_NETWARE( 0x5 )
  324. #define SVCID_GATEWAY                     SVCID_NETWARE( 0x6 )
  325. #define SVCID_PRINT_SERVER                SVCID_NETWARE( 0x7 )
  326. #define SVCID_ARCHIVE_QUEUE               SVCID_NETWARE( 0x8 )
  327. #define SVCID_ARCHIVE_SERVER              SVCID_NETWARE( 0x9 )
  328. #define SVCID_JOB_QUEUE                   SVCID_NETWARE( 0xA )
  329. #define SVCID_ADMINISTRATION              SVCID_NETWARE( 0xB )
  330. #define SVCID_NAS_SNA_GATEWAY             SVCID_NETWARE( 0x21 )
  331. #define SVCID_REMOTE_BRIDGE_SERVER        SVCID_NETWARE( 0x24 )
  332. #define SVCID_TIME_SYNCHRONIZATION_SERVER SVCID_NETWARE( 0x2D )
  333. #define SVCID_ARCHIVE_SERVER_DYNAMIC_SAP  SVCID_NETWARE( 0x2E )
  334. #define SVCID_ADVERTISING_PRINT_SERVER    SVCID_NETWARE( 0x47 )
  335. #define SVCID_BTRIEVE_VAP                 SVCID_NETWARE( 0x4B )
  336. #define SVCID_DIRECTORY_SERVER            SVCID_NETWARE( 0x278 )
  337. #define SVCID_NETWARE_386                 SVCID_NETWARE( 0x107 )
  338. #define SVCID_HP_PRINT_SERVER             SVCID_NETWARE( 0x30C )
  339. #define SVCID_SNA_SERVER                  SVCID_NETWARE( 0x444 )
  340. #define SVCID_SAA_SERVER                  SVCID_NETWARE( 0x130 )
  341.  
  342. #endif // _SVCGUID_
  343.