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.

196 lines
4.1 KiB

  1. /*++
  2. Copyright (c) 1998, Microsoft Corporation
  3. Module Name:
  4. h323if.h
  5. Abstract:
  6. This module contains declarations for the H.323 transparent proxy's
  7. interface management.
  8. Author:
  9. Abolade Gbadegesin (aboladeg) 18-Jun-1999
  10. Revision History:
  11. --*/
  12. #ifndef _NATHLP_H323IF_H_
  13. #define _NATHLP_H323IF_H_
  14. //
  15. // Structure: H323_INTERFACE
  16. //
  17. // This structure holds operational information for an interface.
  18. //
  19. // Each interface is inserted into the list of H.323 transparent proxy
  20. // interfaces, sorted by 'Index'.
  21. //
  22. // Synchronization on an interface makes use of an interface-list lock
  23. // ('H323InterfaceLock'), a per-interface reference count, and a per-interface
  24. // critical-section:
  25. //
  26. // Acquiring a reference to an interface guarantees the interface's existence;
  27. // acquiring the interface's lock guarantees the interface's consistency.
  28. //
  29. // To acquire a reference, first acquire the interface-list lock;
  30. // to traverse the interface-list, first acquire the interface-list lock.
  31. //
  32. // An interface's lock can only be acquired if
  33. // (a) a reference to the interface has been acquired, or
  34. // (b) the interface-list lock is currently held.
  35. // Note that holding the list lock alone does not guarantee consistency.
  36. //
  37. // Fields marked read-only can be read so long as the interface is referenced.
  38. //
  39. typedef struct _H323_INTERFACE {
  40. LIST_ENTRY Link;
  41. CRITICAL_SECTION Lock;
  42. ULONG ReferenceCount;
  43. ULONG Index; // read-only
  44. NET_INTERFACE_TYPE Type; // read-only
  45. IP_H323_INTERFACE_INFO Info;
  46. ULONG Flags;
  47. PIP_ADAPTER_BINDING_INFO BindingInfo;
  48. } H323_INTERFACE, *PH323_INTERFACE;
  49. //
  50. // Flags
  51. //
  52. #define H323_INTERFACE_FLAG_DELETED 0x80000000
  53. #define H323_INTERFACE_DELETED(i) \
  54. ((i)->Flags & H323_INTERFACE_FLAG_DELETED)
  55. #define H323_INTERFACE_FLAG_BOUND 0x40000000
  56. #define H323_INTERFACE_BOUND(i) \
  57. ((i)->Flags & H323_INTERFACE_FLAG_BOUND)
  58. #define H323_INTERFACE_FLAG_ENABLED 0x20000000
  59. #define H323_INTERFACE_ENABLED(i) \
  60. ((i)->Flags & H323_INTERFACE_FLAG_ENABLED)
  61. #define H323_INTERFACE_FLAG_CONFIGURED 0x10000000
  62. #define H323_INTERFACE_CONFIGURED(i) \
  63. ((i)->Flags & H323_INTERFACE_FLAG_CONFIGURED)
  64. #define H323_INTERFACE_ACTIVE(i) \
  65. (((i)->Flags & (H323_INTERFACE_FLAG_BOUND|H323_INTERFACE_FLAG_ENABLED)) \
  66. == (H323_INTERFACE_FLAG_BOUND|H323_INTERFACE_FLAG_ENABLED))
  67. #define H323_INTERFACE_ADMIN_DISABLED(i) \
  68. ((i)->Flags & IP_H323_INTERFACE_FLAG_DISABLED)
  69. //
  70. // Synchronization
  71. //
  72. #define H323_REFERENCE_INTERFACE(i) \
  73. REFERENCE_OBJECT(i, H323_INTERFACE_DELETED)
  74. #define H323_DEREFERENCE_INTERFACE(i) \
  75. DEREFERENCE_OBJECT(i, H323CleanupInterface)
  76. //
  77. // GLOBAL DATA DECLARATIONS
  78. //
  79. extern LIST_ENTRY H323InterfaceList;
  80. extern CRITICAL_SECTION H323InterfaceLock;
  81. //
  82. // FUNCTION DECLARATIONS
  83. //
  84. ULONG
  85. H323ActivateInterface(
  86. PH323_INTERFACE Interfacep
  87. );
  88. ULONG
  89. H323BindInterface(
  90. ULONG Index,
  91. PIP_ADAPTER_BINDING_INFO BindingInfo
  92. );
  93. VOID
  94. H323CleanupInterface(
  95. PH323_INTERFACE Interfacep
  96. );
  97. ULONG
  98. H323ConfigureInterface(
  99. ULONG Index,
  100. PIP_H323_INTERFACE_INFO InterfaceInfo
  101. );
  102. ULONG
  103. H323CreateInterface(
  104. ULONG Index,
  105. NET_INTERFACE_TYPE Type,
  106. PIP_H323_INTERFACE_INFO InterfaceInfo,
  107. PH323_INTERFACE* InterfaceCreated
  108. );
  109. VOID
  110. H323DeactivateInterface(
  111. PH323_INTERFACE Interfacep
  112. );
  113. ULONG
  114. H323DeleteInterface(
  115. ULONG Index
  116. );
  117. ULONG
  118. H323DisableInterface(
  119. ULONG Index
  120. );
  121. ULONG
  122. H323EnableInterface(
  123. ULONG Index
  124. );
  125. ULONG
  126. H323InitializeInterfaceManagement(
  127. VOID
  128. );
  129. PH323_INTERFACE
  130. H323LookupInterface(
  131. ULONG Index,
  132. OUT PLIST_ENTRY* InsertionPoint OPTIONAL
  133. );
  134. ULONG
  135. H323QueryInterface(
  136. ULONG Index,
  137. PVOID InterfaceInfo,
  138. PULONG InterfaceInfoSize
  139. );
  140. VOID
  141. H323ShutdownInterfaceManagement(
  142. VOID
  143. );
  144. VOID
  145. H323SignalNatInterface(
  146. ULONG Index,
  147. BOOLEAN Boundary
  148. );
  149. ULONG
  150. H323UnbindInterface(
  151. ULONG Index
  152. );
  153. #endif // _NATHLP_H323IF_H_