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.

842 lines
17 KiB

  1. #ifndef _COMM_
  2. #define _COMM_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /*++
  7. Copyright (c) 1989 Microsoft Corporation
  8. Module Name:
  9. comm.h
  10. Abstract:
  11. header file for interfacing with comm.c
  12. Functions:
  13. Portability:
  14. This header is portable.
  15. Author:
  16. Pradeep Bahl (PradeepB) Jan-1993
  17. Revision History:
  18. Modification Date Person Description of Modification
  19. ------------------ ------- ---------------------------
  20. --*/
  21. /*
  22. includes
  23. */
  24. #include "wins.h"
  25. #include <winsock2.h>
  26. #if SPX > 0
  27. #include <wsipx.h>
  28. #endif
  29. #include <nb30.h>
  30. #include <nbtioctl.h>
  31. //Don't include winsque.h here since winsque.h includes comm.h
  32. #if 0
  33. #include "winsque.h"
  34. #endif
  35. /*
  36. simple defines (simple macros)
  37. */
  38. #define COMM_DATAGRAM_SIZE 576 /*rfc 1002*/
  39. #define COMM_NETBT_REM_ADD_SIZE sizeof(tREM_ADDRESS)
  40. /*
  41. The following two defines are for the TCP and UDP port numbers used
  42. by the WINS server.
  43. Normally the same port number is used for both TCP and UDP.
  44. */
  45. FUTURES("Use a port registered with IANA - 1512. IPPORT_NAMESERVER is used by")
  46. FUTURES("BIND and NAMED -- Unix internet name servers")
  47. #define WINS_TCP_PORT IPPORT_NAMESERVER
  48. #define WINS_UDP_PORT IPPORT_NAMESERVER
  49. #define WINS_NBT_PORT 137 //NBT nameserver port
  50. //#define WINS_NBT_PORT 5000 //for testing
  51. //
  52. // Hardcoded Server port for RPC calls.
  53. //
  54. // Note: This is not used since we let RPC pick a port. Check out
  55. // InitializeRpc() in nms.c We will use this define olnly if AUTO_BIND is
  56. // not defined
  57. //
  58. #define WINS_SERVER_PORT 5001
  59. #define COMM_DEFAULT_IP_PORT IPPROTO_IP //used to init CommPortNo
  60. /*
  61. COMM_HEADER_SIZE -- size of the comm header on every message sent on a TCP
  62. connection. This is used in RPL code
  63. */
  64. #define COMM_HEADER_SIZE (sizeof(COMM_HEADER_T))
  65. //
  66. // Total header size of header used by COMSYS
  67. //
  68. #define COMM_N_TCP_HDR_SZ sizeof(COMM_TCP_HDR_T)
  69. /*
  70. Values returned by CommCompAdd function
  71. */
  72. #define COMM_SAME_ADD 0x0 // addresses are same
  73. #define COMM_DIFF_ADD 0x1 //addresses are different
  74. #define COMM_START_REQ_ASSOC_MSG 0
  75. #define COMM_START_RSP_ASSOC_MSG 1
  76. #define COMM_STOP_REQ_ASSOC_MSG 2
  77. #define COMM_RPL_MSG 3
  78. #define COMM_IP_ADD_SIZE sizeof(COMM_IP_ADD_T)
  79. //
  80. // Size of the header on top of a buffer
  81. //
  82. #define COMM_BUFF_HEADER_SIZE (sizeof(COMM_BUFF_HEADER_T))
  83. /*
  84. macros
  85. */
  86. //
  87. // This macro gets the network address from an IP Address in binary form
  88. // Used by AppendNetAdd in nmsnmh.c. It assumes a CLASS B network address
  89. //
  90. //
  91. FUTURES("Use the subnet mask specified via registry")
  92. #define COMM_NET_ADDRESS_M(Add) (Add >> 16)
  93. #define COMM_SET_HEADER_M(pLong, Opc, uAssocCtx, MsgTyp) \
  94. { \
  95. LPBYTE _pTmpB = (LPBYTE)pLong++; \
  96. *(_pTmpB + 2) = Opc << 3; \
  97. *pLong++ = htonl(uAssocCtx); \
  98. *pLong++ = htonl(MsgTyp); \
  99. }
  100. #define COMM_GET_HEADER_M(pMsg, Opc, uAssocCtx, MsgTyp) \
  101. { \
  102. LPLONG _pLong = (LPLONG)pMsg; \
  103. Opc = ((*(pMsg + 2) & NMS_OPCODE_MASK) >> 3);\
  104. uAssocCtx = ntohl(*++_pLong); \
  105. MsgTyp = ntohl(*++_pLong); \
  106. }
  107. //
  108. // Is this my address
  109. //
  110. #define COMM_MY_IP_ADD_M(IpAddress) ((IpAddress) == NmsLocalAdd.Add.IPAdd)
  111. //
  112. // Gets the address of the remote client
  113. //
  114. #define COMM_GET_IPADD_M(pDlgHdl, pIPAdd) { \
  115. PCOMMASSOC_DLG_CTX_T _pEnt = (pDlgHdl)->pEnt; \
  116. *(pIPAdd) = _pEnt->FromAdd.sin_addr.s_addr; \
  117. }
  118. #define COMM_GET_FAMILY_M(pDlgHdl, Family) { \
  119. PCOMMASSOC_DLG_CTX_T _pEnt = (pDlgHdl)->pEnt; \
  120. Family = _pEnt->FromAdd.sin_family; \
  121. }
  122. #define COMM_IS_PNR_BETA1_WINS_M(pDlgHdl, fBeta1) {(fBeta1) = FALSE;}
  123. #if 0
  124. #define COMM_IS_PNR_BETA1_WINS_M(pDlgHdl, fBeta1) { \
  125. PCOMMASSOC_DLG_CTX_T _pEnt = (pDlgHdl)->pEnt; \
  126. PCOMMASSOC_ASSOC_CTX_T _pAssocEnt = _pEnt->AssocHdl.pEnt; \
  127. fBeta1 = (_pAssocEnt->MajVersNo == WINS_BETA1_MAJOR_VERS_NO) ? TRUE : \
  128. FALSE; \
  129. }
  130. #endif
  131. #if PRSCONN
  132. #define COMM_GET_WINS_VERS_NO_M(pDlgHdl, MajVers, MinVers) { \
  133. PCOMMASSOC_DLG_CTX_T _pEnt = (pDlgHdl)->pEnt; \
  134. PCOMMASSOC_ASSOC_CTX_T _pAssocEnt = _pEnt->AssocHdl.pEnt; \
  135. MajVers = _pAssocEnt->MajVersNo; \
  136. MinVers = _pAssocEnt->MinVersNo; \
  137. }
  138. #define ECOMM_INIT_DLG_HDL_M(pDlgHdl) {(pDlgHdl)->pEnt = NULL; (pDlgHdl)->SeqNo=0;}
  139. #define ECOMM_IS_PNR_POSTNT4_WINS_M(pDlgHdl, fNT5) { \
  140. DWORD _MajVers, _MinVers; \
  141. COMM_GET_WINS_VERS_NO_M((pDlgHdl), _MajVers, _MinVers); \
  142. fNT5 = (_MinVers >= WINS_MINOR_VERS_NT5) ? TRUE : FALSE; \
  143. }
  144. #endif
  145. //
  146. // This macro checks if the name is local or not. Used in NmsNmhNamRegInd
  147. // and NmsNmhNamRegGrp functions
  148. //
  149. #define COMM_IS_IT_LOCAL_M(pDlgHdl) \
  150. (((PCOMMASSOC_DLG_CTX_T)(pDlgHdl->pEnt))->FromAdd.sin_family == NBT_UNIX)
  151. //
  152. // On querying a name, if WINS finds it to be a local name, it sets the
  153. // the family in the DlgHdl to NBT_UNIX so that NETBT can respond to the
  154. // query
  155. //
  156. #if USENETBT > 0
  157. #define COMM_SET_LOCAL_M(pDlgHdl) \
  158. (((PCOMMASSOC_DLG_CTX_T)(pDlgHdl->pEnt))->FromAdd.sin_family = NBT_UNIX)
  159. #else
  160. #define COMM_SET_LOCAL_M(pDlgHdl)
  161. #endif
  162. //
  163. // Initialize a COMM_ADD_T structure given an IP address
  164. //
  165. #define COMM_INIT_ADD_M(pWinsAdd, IPAddress) { \
  166. (pWinsAdd)->AddLen = sizeof(PCOMM_IP_ADD_T); \
  167. (pWinsAdd)->AddTyp_e = COMM_ADD_E_TCPUDPIP; \
  168. (pWinsAdd)->Add.IPAdd = (IPAddress); \
  169. }
  170. //
  171. // Initialize a COMM_ADD_T structure given a dlg handle.
  172. //
  173. #define COMM_INIT_ADD_FR_DLG_HDL_M(pWinsAdd, pDlgHdl) { \
  174. COMM_IP_ADD_T IPAdd; \
  175. COMM_GET_IPADD_M((pDlgHdl), &IPAdd); \
  176. COMM_INIT_ADD_M((pWinsAdd), IPAdd); \
  177. }
  178. //
  179. // COMM_ADDRESS_SAME_M -- checks if the addresses are the same. Expects
  180. // pointers to COMM_ADD_T structues for its parameters
  181. //
  182. #define COMM_ADDRESS_SAME_M(pAdd1,pAdd2) ((pAdd1)->Add.IPAdd == (pAdd2)->Add.IPAdd)
  183. /*
  184. COMM_IS_TCP_MSG_M
  185. This macro is called by FrmNamQueryRsp to determine if the request
  186. message came over a TCP connection.
  187. FrmNamQueryRsp checks this in order to determine whether to allocate a
  188. buffer or use the request buffer for the response.
  189. */
  190. #define COMM_IS_TCP_MSG_M(pDlgHdl) (((PCOMASSOC_DLG_CTX_T)pDlgHdl->pEnt)->Typ_e != COMM_E_UDP)
  191. NONPORT("Port to different address families")
  192. #define COMM_NETFORM_TO_ASCII_M(pAdd) inet_ntoa(*(pAdd))
  193. /*
  194. The macros below are used to host to network and network to host byte
  195. order coversion. The macros are used by message formatting functions
  196. in the name space manager and replicator components of the WINS server
  197. */
  198. #define COMM_HOST_TO_NET_L_M(HostLongVal_m, NetLongVal_m) \
  199. { \
  200. NetLongVal_m = htonl((HostLongVal_m)); \
  201. }
  202. #define COMM_HOST_TO_NET_S_M(HostShortVal_m, NetShortVal_m) \
  203. { \
  204. NetShortVal_m = htons((HostShortVal_m)); \
  205. }
  206. #define COMM_NET_TO_HOST_L_M(NetLongVal_m, HostLongVal_m) \
  207. { \
  208. HostLongVal_m = ntohl((NetLongVal_m)); \
  209. }
  210. #define COMM_NET_TO_HOST_S_M(NetShortVal_m, HostShortVal_m) \
  211. { \
  212. HostShortVal_m = ntohs((NetShortVal_m)); \
  213. }
  214. //
  215. // Size of the message sent to the TCP listener thread by the PULL/PUSH
  216. // thread
  217. //
  218. #define COMM_NTF_MSG_SZ sizeof(COMM_NTF_MSG_T)
  219. #if MCAST > 0
  220. #define COMM_MCAST_WINS_UP 0
  221. #define COMM_MCAST_WINS_DOWN 1
  222. #define COMM_MCAST_SIGN_START 0xABCD
  223. #define COMM_MCAST_SIGN_END 0xABCF
  224. #define COMM_MCAST_MSG_SZ sizeof(COMM_MCAST_MSG_T)
  225. #endif
  226. //
  227. // No of critical sections for assocs/dlgs that can be there at any one time.
  228. // Want to save on non-paged pool
  229. //
  230. #define COMM_FREE_COMM_HDL_THRESHOLD 100
  231. /*
  232. externs
  233. */
  234. struct _COMM_HDL_T; //forward reference
  235. #if MCAST > 0
  236. extern SOCKET CommMcastPortHandle;
  237. #endif
  238. extern HANDLE CommUdpBuffHeapHdl;
  239. extern HANDLE CommUdpDlgHeapHdl;
  240. extern SOCKET CommTcpPortHandle;
  241. extern SOCKET CommUdpPortHandle;
  242. extern SOCKET CommNtfSockHandle;
  243. extern struct sockaddr_in CommNtfSockAdd;
  244. extern struct _COMM_HDL_T CommExNbtDlgHdl;
  245. extern DWORD CommConnCount; //total # of tcp connections from/to local WINS
  246. extern DWORD CommWinsTcpPortNo;
  247. extern DWORD WinsClusterIpAddress;
  248. #if SPX > 0
  249. extern DWORD CommWinsSpxPortNo
  250. #endif
  251. //
  252. // Set to TRUE by the tcp listener thread when it discovers that the assoc.
  253. // it was asked to stop monitoring is no longer in its list.
  254. //
  255. extern BOOL fCommDlgError;
  256. #ifdef WINSDBG
  257. extern DWORD CommNoOfDgrms;
  258. extern DWORD CommNoOfRepeatDgrms;
  259. #endif
  260. FUTURES("Remove this when WinsGetNameAndAdd is removed")
  261. #if USENETBT == 0
  262. extern BYTE HostName[];
  263. #endif
  264. /*
  265. typedef definitions
  266. */
  267. #if USENETBT > 0
  268. //
  269. // The format of Adapter Status responses
  270. //
  271. typedef struct
  272. {
  273. ADAPTER_STATUS AdapterInfo;
  274. NAME_BUFFER Names[32];
  275. } tADAPTERSTATUS;
  276. #endif
  277. /*
  278. COMM_IP_ADD_T
  279. typedef for IP address
  280. */
  281. typedef ULONG COMM_IP_ADD_T, *PCOMM_IP_ADD_T;
  282. /*
  283. COMM_TYP_E - Enumerator for the different types of dlgs and associations
  284. */
  285. typedef enum _COMM_TYP_E {
  286. COMM_E_RPL = 0, /* Used for pull replication*/
  287. COMM_E_NOT, /* Used for notification */
  288. COMM_E_QUERY, /*used for querying an RQ server */
  289. COMM_E_UPD, /*used for sending name query responses and
  290. * updates to a Q server */
  291. COMM_E_NBT, /* set up by an NBT node*/
  292. COMM_E_UDP, /*set up for UDP communication */
  293. COMM_E_TCP /*until we know which TCP msg this is */
  294. } COMM_TYP_E, *PCOMM_TYP_E;
  295. /*
  296. This is the comm header prefixed on every message sent by a WINS to another
  297. WINS (on a TCP connection)
  298. */
  299. typedef struct _COMM_HEADER_T {
  300. LONG Opcode; //NBT or RPL connection opcode
  301. DWORD uAssocCtx; //tag to assoc context block sent by remote WINS
  302. //legacy (32bit) WINS send here pointer to memory.
  303. //new (64bit) WINS send here 32bit tag value
  304. DWORD MsgTyp; //Type of message (START_ASSOC, STOP_ASSOC, etc)
  305. } COMM_HEADER_T, *PCOMM_HEADER_T;
  306. /*
  307. This is the Tcp header prefixed on every message sent by a WINS to another
  308. WINS (on a TCP connection)
  309. */
  310. typedef struct _COMM_TCP_HDR_T {
  311. LONG LenOfMsg; //NBT or RPL connection opcode
  312. COMM_HEADER_T CommHdr;
  313. } COMM_TCP_HDR_T, *PCOMM_TCP_HDR_T;
  314. /*
  315. * COMM_ADD_TYP_E -- enumerator for the different address families.
  316. */
  317. typedef enum _COMM_ADD_TYP_E {
  318. COMM_ADD_E_TCPUDPIP = 0,
  319. COMM_ADD_E_SPXIPX
  320. } COMM_ADD_TYP_E, *PCOMM_ADD_TYP_E;
  321. /*
  322. COMM_ADD_T --
  323. address of a node. This is in TLV form. Currently, the union has
  324. an entry just for IP address. In the future, it will have
  325. entries for addresses pertaining to other address families.
  326. such as XNS, OSI, etc
  327. NOTE NOTE NOTE
  328. Put the enumerator at the end so that the alignment of
  329. the various fields in COMM_ADD_T is on their natural
  330. boundaries.
  331. This structure is written as is into the address field of
  332. the database record (in both the name - address table and the
  333. owner id - address table). Therefore it is important
  334. that we have the alignment set right (in order to save
  335. on database storage) and also to read the stuff from the
  336. database record back into the correct fields of an in-memory
  337. COMM_ADD_T structure
  338. */
  339. ALIGN("Alignment very important here")
  340. FUTURES("Use a union of SOCKADDR_IP and SOCXADDR_IPX")
  341. typedef struct _COMM_ADD_T {
  342. DWORD AddLen;
  343. union _Add{
  344. DWORD IPAdd;
  345. //
  346. // we may add other fields later on
  347. //
  348. #if SPX > 0
  349. char netnum[4];
  350. char nodenum[6];
  351. #endif
  352. } Add;
  353. COMM_ADD_TYP_E AddTyp_e; /*this should be the last field for
  354. *alignment puposes
  355. */
  356. } COMM_ADD_T, *PCOMM_ADD_T;
  357. /*
  358. COMM_HDL_T -- this is the handle to a comm sys. entity such as a dialogue
  359. or an association. The handle to a dialogue is passed to COMSYS clients
  360. for future use by them
  361. */
  362. typedef struct _COMM_HDL_T {
  363. DWORD SeqNo; //sequence no. of ctx block created for entity
  364. LPVOID pEnt; //pointer to ctx block
  365. } COMM_HDL_T, *PCOMM_HDL_T;
  366. /*
  367. COMM_TOP_T -- This is the structure which is at the top of the assoc and
  368. dlg ctx structures. It must have LIST_ENTRY at its top.
  369. */
  370. typedef struct _COMM_TOP_T {
  371. LIST_ENTRY Head; //for linking free blocks
  372. DWORD SeqNo; //seq. no of block
  373. CRITICAL_SECTION CrtSec;
  374. BOOLEAN fCrtSecInited;
  375. #if 0
  376. HANDLE MutexHdl; //mutex for locking block
  377. #endif
  378. } COMM_TOP_T, *PCOMM_TOP_T;
  379. /*
  380. COMM_BUFF_HEADER_T --
  381. This is the header for all buffers allocated for requests/responses.
  382. received over the wire
  383. Note: This buffer is added on top of COMM_HEADER_T buffer allocated
  384. for requests/responses sent by a WINS to another WINS
  385. */
  386. typedef struct _COMM_BUFF_HEADER_T {
  387. COMM_TYP_E Typ_e;
  388. } COMM_BUFF_HEADER_T, *PCOMM_BUFF_HEADER_T;
  389. //
  390. // Command sent to the TCP listener thread by the PUSH thread or the PULL
  391. // thread. The PULL thread sends the START_MON command when it sends
  392. // a Push trigger to another WINS. The PUSH thread sends the STOP_MON
  393. // command when it receives a PUSH notification (trigger) from a remote WINS
  394. //
  395. typedef enum _COMM_NTF_CMD_E {
  396. COMM_E_NTF_START_MON = 0, //sent by PULL thread
  397. COMM_E_NTF_STOP_MON //sent by PUSH thread
  398. } COMM_NTF_CMD_E, *PCOMM_NTF_CMD_E;
  399. //
  400. // structure of the message sent to the TCP listener thread
  401. //
  402. // There is no need to send the pointer to the Dlg ctx in the message since
  403. // ChkNtfSock() in comm.c can get it from pAssocCtx. We however send it
  404. // anyway.
  405. //
  406. typedef struct _COMM_NTF_MSG_T {
  407. COMM_NTF_CMD_E Cmd_e;
  408. SOCKET SockNo; //socket no to stop/start monitoring
  409. COMM_HDL_T AssocHdl;
  410. COMM_HDL_T DlgHdl;
  411. } COMM_NTF_MSG_T, *PCOMM_NTF_MSG_T;
  412. #if MCAST > 0
  413. typedef struct _COMM_MCAST_MSG_T {
  414. DWORD Sign; //always 0xABCD
  415. DWORD Code;
  416. BYTE Body[1];
  417. } COMM_MCAST_MSG_T, *PCOMM_MCAST_MSG_T;
  418. #endif
  419. /*
  420. Externals
  421. */
  422. extern RTL_GENERIC_TABLE CommAssocTable; //assoc table
  423. extern RTL_GENERIC_TABLE CommUdpNbtDlgTable; //tbl for nbt requests (UDP)
  424. extern HANDLE CommUdpBuffHeapHdl;
  425. /*
  426. function declarations
  427. */
  428. #if USENETBT > 0
  429. extern
  430. VOID
  431. CommOpenNbt(
  432. DWORD FirstBindingIpAddress
  433. );
  434. extern
  435. STATUS
  436. CommGetNetworkAdd(
  437. );
  438. #endif
  439. VOID
  440. ECommRegisterAddrChange();
  441. VOID
  442. InitOwnAddTbl(
  443. VOID
  444. );
  445. VOID
  446. ECommInit(
  447. VOID
  448. );
  449. extern
  450. STATUS
  451. ECommStartDlg(
  452. PCOMM_ADD_T pAdd, // Address
  453. COMM_TYP_E CommTyp_e,
  454. PCOMM_HDL_T pDlgHdl
  455. );
  456. extern
  457. VOID
  458. ECommSndCmd(
  459. PCOMM_HDL_T pDlgHdl,
  460. MSG_T pMsg,
  461. MSG_LEN_T MsgLen,
  462. PMSG_T ppRspMsg,
  463. PMSG_LEN_T pRspMsgLen
  464. );
  465. extern
  466. STATUS
  467. ECommSndRsp(
  468. PCOMM_HDL_T pDlgHdl,
  469. MSG_T pMsg,
  470. MSG_LEN_T MsgLen
  471. );
  472. extern
  473. STATUS
  474. ECommSendMsg(
  475. PCOMM_HDL_T pDlgHdl,
  476. PCOMM_ADD_T pAdd,
  477. MSG_T pMsg,
  478. MSG_LEN_T MsgLen
  479. );
  480. extern
  481. STATUS
  482. ECommEndDlg(
  483. PCOMM_HDL_T pDlgHdl
  484. );
  485. extern
  486. VOID
  487. CommEndAssoc(
  488. PCOMM_HDL_T pAssocHdl
  489. );
  490. extern
  491. LPVOID
  492. CommAlloc(
  493. PRTL_GENERIC_TABLE pTable,
  494. DWORD BuffSize
  495. );
  496. extern
  497. STATUS
  498. ECommAlloc(
  499. LPVOID *ppBuff,
  500. DWORD BuffSize
  501. );
  502. extern
  503. VOID
  504. ECommDealloc(
  505. LPVOID pBuff
  506. );
  507. extern
  508. VOID
  509. CommCreatePorts(
  510. VOID
  511. );
  512. extern
  513. VOID
  514. CommInit(
  515. VOID
  516. );
  517. extern
  518. STATUS
  519. CommReadStream(
  520. IN SOCKET SockNo,
  521. IN BOOL fDoTimedRecv,
  522. OUT PMSG_T ppMsg,
  523. OUT LPLONG pBytesRead
  524. );
  525. extern
  526. VOID
  527. CommCreateTcpThd(VOID);
  528. extern
  529. VOID
  530. CommCreateUdpThd(VOID);
  531. extern
  532. DWORD
  533. ECommCompAdd(PCOMM_ADD_T, PCOMM_ADD_T);
  534. extern
  535. int
  536. __cdecl
  537. ECommCompareAdd(const void *pKey1, const void *pKey2);
  538. extern
  539. STATUS
  540. CommConnect(
  541. IN PCOMM_ADD_T pHostAdd,
  542. IN SOCKET Port,
  543. OUT SOCKET *pSockNo
  544. );
  545. #if 0
  546. extern
  547. VOID
  548. CommDeallocUdpBuff(
  549. MSG_T pMsg
  550. );
  551. #endif
  552. extern
  553. STATUS
  554. CommReadStream(
  555. IN SOCKET SockNo,
  556. IN BOOL fDoTimedRecv,
  557. OUT PMSG_T ppMsg,
  558. OUT LPLONG pBytesRead
  559. );
  560. extern
  561. VOID
  562. CommDealloc(
  563. IN PRTL_GENERIC_TABLE pTable,
  564. IN PVOID pBuff
  565. );
  566. #if PRSCONN
  567. extern
  568. __inline
  569. BOOL
  570. CommIsDlgActive(
  571. PCOMM_HDL_T pEntHdl
  572. );
  573. extern
  574. BOOL
  575. CommIsBlockValid(
  576. PCOMM_HDL_T pEntHdl
  577. );
  578. #endif
  579. extern
  580. __inline
  581. STATUS
  582. CommUnlockBlock(
  583. PCOMM_HDL_T pEntHdl
  584. );
  585. extern
  586. BOOL
  587. CommLockBlock(
  588. PCOMM_HDL_T pEntHdl
  589. );
  590. extern
  591. VOID
  592. CommDisc(
  593. SOCKET SockNo,
  594. BOOL fDecCnt
  595. );
  596. extern
  597. VOID
  598. CommSendUdp (
  599. SOCKET SockNo,
  600. struct sockaddr_in *pDest,
  601. MSG_T pMsg,
  602. MSG_LEN_T MsgLen
  603. );
  604. extern
  605. STATUS
  606. CommNbtTcpSnd(
  607. PCOMM_HDL_T pAssocHdl,
  608. MSG_T pMsg,
  609. MSG_LEN_T MsgLen
  610. );
  611. extern
  612. VOID
  613. CommSend(
  614. COMM_TYP_E CommTyp_e,
  615. PCOMM_HDL_T pAssocHdl,
  616. MSG_T pMsg,
  617. MSG_LEN_T MsgLen
  618. );
  619. extern
  620. VOID
  621. CommSendAssoc(
  622. SOCKET SockNo,
  623. MSG_T pMsg,
  624. MSG_LEN_T MsgLen
  625. );
  626. #if PRSCONN
  627. extern
  628. __inline
  629. BOOL
  630. ECommIsDlgActive(
  631. PCOMM_HDL_T pEntHdl
  632. );
  633. extern
  634. __inline
  635. BOOL
  636. ECommIsBlockValid(
  637. PCOMM_HDL_T pEntHdl
  638. );
  639. #endif
  640. extern
  641. VOID
  642. ECommFreeBuff(
  643. MSG_T pBuff
  644. );
  645. extern
  646. BOOL
  647. //VOID
  648. ECommProcessDlg(
  649. PCOMM_HDL_T pDlgHdl,
  650. COMM_NTF_CMD_E Cmd_e
  651. );
  652. extern
  653. RTL_GENERIC_COMPARE_RESULTS
  654. CommCompareNbtReq(
  655. PRTL_GENERIC_TABLE pTbl,
  656. PVOID pUdpDlg1,
  657. PVOID pUdpDlg2
  658. );
  659. extern
  660. STATUS
  661. ECommGetMyAdd(
  662. IN OUT PCOMM_ADD_T pAdd
  663. );
  664. extern
  665. VOID
  666. CommDecConnCount(
  667. VOID
  668. );
  669. #if MCAST > 0
  670. extern
  671. VOID
  672. CommSendMcastMsg(
  673. DWORD Code
  674. );
  675. extern
  676. VOID
  677. CommLeaveMcastGrp(
  678. VOID
  679. );
  680. #endif
  681. #ifdef __cplusplus
  682. }
  683. #endif
  684. #endif //_COMM_