Leaked source code of windows server 2003
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.

135 lines
2.6 KiB

  1. /*++
  2. Copyright (c) 1994-1998 Microsoft Corporation
  3. Module Name:
  4. ipcfginc.h
  5. Abstract:
  6. Contains all includes, definitions, types, prototypes for ipconfig
  7. Author:
  8. Richard L Firth (rfirth) 20-May-1994
  9. Revision History:
  10. 20-May-1994 rfirth Created
  11. 20-May-97 MohsinA NT50 PNP.
  12. 31-Jul-97 MohsinA Patterns.
  13. 10-Mar-98 chunye Renamed as ipcfginc.h for ipcfgdll support.
  14. --*/
  15. #ifndef _IPCFGINC_
  16. #define _IPCFGINC_ 1
  17. #include "common.h"
  18. #include "iptypes.h"
  19. #include "ipconfig.h"
  20. //
  21. // IS_INTERESTING_ADAPTER - TRUE if the type of this adapter (IFEntry) is NOT
  22. // loopback. Loopback (corresponding to local host) is the only one we filter
  23. // out right now
  24. //
  25. #define IS_INTERESTING_ADAPTER(p) (!((p)->if_type == IF_TYPE_SOFTWARE_LOOPBACK))
  26. //
  27. // Alloc and Free used in adaptlst.c
  28. //
  29. #define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x))
  30. #define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
  31. //
  32. // Maxumum uni directional adapter that is supported
  33. // by default
  34. //
  35. #define MAX_UNI_ADAPTERS 10
  36. //
  37. // iphlppai.dll roiutine to get unidirectional adapter info
  38. //
  39. extern
  40. DWORD
  41. GetUniDirectionalAdapterInfo(PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS pIPIfInfo,
  42. PULONG dwOutBufLen);
  43. //
  44. // types
  45. //
  46. #ifndef _AVOID_IP_ADDRESS
  47. //
  48. // IP_ADDRESS - access an IP address as a single DWORD or 4 BYTEs
  49. //
  50. typedef union {
  51. DWORD d;
  52. BYTE b[4];
  53. } IP_ADDRESS, *PIP_ADDRESS, IP_MASK, *PIP_MASK;
  54. #endif // _AVOID_IP_ADDRESS
  55. //
  56. // prototypes
  57. //
  58. //
  59. // From ipconfig.c
  60. //
  61. BOOL Initialize(PDWORD);
  62. BOOL LoadAndLinkDhcpFunctions(VOID);
  63. VOID Terminate(VOID);
  64. //
  65. // From entity.c
  66. //
  67. TDIEntityID* GetEntityList(UINT*);
  68. //
  69. // From adaptlst.c
  70. //
  71. PIP_ADAPTER_INFO GetAdapterList(VOID);
  72. INT AddIpAddress(PIP_ADDR_STRING, DWORD, DWORD, DWORD);
  73. INT AddIpAddressString(PIP_ADDR_STRING, LPSTR, LPSTR);
  74. INT PrependIpAddress(PIP_ADDR_STRING, DWORD, DWORD, DWORD);
  75. VOID ConvertIpAddressToString(DWORD, LPSTR);
  76. VOID CopyString(LPSTR, DWORD, LPSTR);
  77. VOID KillAdapterInfo(PIP_ADAPTER_INFO);
  78. //
  79. // From wins.c
  80. //
  81. BOOL GetWinsServers(PIP_ADAPTER_INFO);
  82. //
  83. // In debug.c
  84. //
  85. #ifdef DBG
  86. void print_IP_ADDRESS_STRING(char *message, IP_ADDRESS_STRING *s);
  87. void print_IP_ADDR_STRING(char *message, PIP_ADDR_STRING s);
  88. void print_IP_ADAPTER_INFO(char *message, IP_ADAPTER_INFO *s);
  89. void print_FIXED_INFO(char *message, FIXED_INFO *s);
  90. void print_IFEntry(char *message, struct IFEntry *s);
  91. #endif
  92. #endif