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.

99 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name :
  4. dnsrec.h
  5. Abstract:
  6. This file contains type definitions for async DNS
  7. Author:
  8. Rohan Phillips (Rohanp) June-19-1998
  9. Revision History:
  10. --*/
  11. # ifndef _ADNS_STRUCT_HXX_
  12. # define _ADNS_STRUCT_HXX_
  13. #include <rwnew.h>
  14. #include <dnsapi.h>
  15. #define TCP_REG_LIST_SIGNATURE 'TgeR'
  16. #define DNS_FLAGS_NONE 0x0
  17. #define DNS_FLAGS_TCP_ONLY 0x1
  18. #define DNS_FLAGS_UDP_ONLY 0x2
  19. #define SMTP_MAX_DNS_ENTRIES 100
  20. typedef void (WINAPI * USERDELETEFUNC) (PVOID);
  21. //-----------------------------------------------------------------------------
  22. //
  23. // Description:
  24. // Encapsulates a list of IP addresses (for DNS servers) and maintains
  25. // state information on them... whether the servers are up or down, and
  26. // provides retry logic for down servers.
  27. //
  28. //-----------------------------------------------------------------------------
  29. class CTcpRegIpList
  30. {
  31. private:
  32. DWORD m_dwSig;
  33. int m_cUpServers;
  34. PIP_ARRAY m_IpListPtr;
  35. DWORD *m_prgdwFailureTick;
  36. BOOL *m_prgfServerUp;
  37. CShareLockNH m_sl;
  38. public:
  39. static USERDELETEFUNC m_DeleteFunc;
  40. CTcpRegIpList();
  41. ~CTcpRegIpList();
  42. void Update(PIP_ARRAY IpPtr);
  43. DWORD GetIp(DWORD *dwIp);
  44. void MarkDown(DWORD dwIp);
  45. void ResetServersIfNeeded();
  46. DWORD GetCount()
  47. {
  48. DWORD dwCount;
  49. m_sl.ShareLock();
  50. dwCount = m_IpListPtr ? m_IpListPtr->cAddrCount : 0;
  51. m_sl.ShareUnlock();
  52. return dwCount;
  53. }
  54. };
  55. typedef struct _MXIPLISTENTRY_
  56. {
  57. DWORD IpAddress;
  58. LIST_ENTRY ListEntry;
  59. }MXIPLIST_ENTRY, *PMXIPLIST_ENTRY;
  60. typedef struct _MX_NAMES_
  61. {
  62. char DnsName[MAX_INTERNET_NAME];
  63. DWORD NumEntries;
  64. LIST_ENTRY IpListHead;
  65. }MX_NAMES, *PMX_NAMES;
  66. typedef struct _SMTPDNS_REC_
  67. {
  68. DWORD NumRecords; //number of record in DnsArray
  69. DWORD StartRecord; //the starting index
  70. PVOID pMailMsgObj; //pointer to a mailmsg obj
  71. PVOID pAdvQContext;
  72. PVOID pRcptIdxList;
  73. DWORD dwNumRcpts;
  74. MX_NAMES *DnsArray[SMTP_MAX_DNS_ENTRIES];
  75. } SMTPDNS_RECS, *PSMTPDNS_RECS;
  76. #endif