Microsoft Internet Security and Acceleration Server 2004 SDK

IFWXSession::RedirectConnections

The RedirectConnections method enables connections by using a local, internal Microsoft Firewall service address.

HRESULT RedirectConnections(
  LPSOCKADDR ConnectAddresses[],
  DWORD ConnectAddressLength,
  DWORD dwNumberOfAddresses,
  LPSOCKADDR InternalAddress,
  LPDWORD InternalAddressLength,
  LPSOCKADDR ProxyExternalAddress,
  DWORD ProxyExternalAddressLength,
  INT Protocol,
  DWORD dwFlags,
  REFGUID ProtocolGuid,
  IFWXSessionFilter* pSessionFilter,
  IUnknown* punkContext,
  IFWXFirewallAction* FirewallActionArray[]
);

Parameters

ConnectAddresses
[in] Pointer to an array of pointers to sockaddr structures that contain the addresses to which the client connections will be redirected.
ConnectAddressLength
[in] Length, in bytes, of the addresses pointed to by the ConnectAddresses parameter.
dwNumberOfAddresses
[in] Number of addresses in the ConnectAddresses array.
InternalAddress
[out] The socket address on the ISA Server internal interface where the client should connect. This value is updated by the Firewall service.
InternalAddressLength
[in, out] Length, in bytes, of the InternalAddress parameter.
ProxyExternalAddress
[in] Pointer to a sockaddr structure that contains the ISA Server computer's external address used for the connection. This is useful in the case of multihomed ISA Server computers. Requesting a specific address ensures that a secondary connection uses the same IP address as the primary connection. This parameter can be NULL, defaulting to INADDR_ANY and 0 (any port).
ProxyExternalAddressLength
[in] Length, in bytes, of the ProxyExternalAddress structure.
Protocol
[in] Protocol flags. This parameter can have the following flag values:
Value Meaning
FWX_PROTOCOL_TCP The connection will use a TCP socket.
FWX_PROTOCOL_UDP The connection will use a UDP socket.
dwFlags
[in] Connection flags. This parameter can be a combination of the following values:
Value Meaning
FWX_FLAG_ALLOW_MULTIPLE By default, a single outbound connection is expected. If this flag is specified, multiple connections to the same address will be possible.
FWX_FLAG_TIMEOUT The client is expected to use the permission shortly after the call. If the client does not make the connection, the permission automatically expires.
FWX_FLAG_NO_KERNEL_MODE Each connection goes through user-mode code, regardless of whether kernel mode could be used for the connection.
FWX_INCREASE_RECEIVE_BUFFER The receive buffer will be increased to 64 kilobytes. This flag should be set to prevent packet loss if high-bandwidth packet bursts occur in a secondary UDP connection.
ProtocolGuid
[in] GUID that identifies the protocol that the connection is part of.
pSessionFilter
[in, optional] Pointer to the IFWXSessionFilter interface. Use with the UserContext parameter to receive an event of type fwx_EstablishedConnection (as defined in the FxwFirewallEventType enumerated type) from the proxy.
punkContext
[in, optional] Provides user context information regarding the connection. Use with the pSessionFilter parameter to receive an event of type fwx_EstablishedConnection from the Firewall service. This parameter can be NULL. Specify NULL if notification of fwx_EstablishedConnection events is not required, or if you do not need to pass any context information.
FirewallActionArray
[out] Pointer to an array of IFWXFirewallAction interface pointers. The array is filled with pointers to IFWXFirewallAction interfaces to the firewall action objects created by this call. The array contains dwNumberOfAddresses pointers.

Return Values

This method returns S_OK if the call is successful; otherwise, it returns an error code.

Remarks

This method is intended for use by filters that act as an application proxy that has to establish secondary connections and give the same address as the primary connection for the secondary connection.

Filters for Firewall clients and for SecureNAT clients usually use AllowFutureConnect instead.

Calling this method causes all filters that are registered for connect events on the appropriate port to be notified. If no data filters are installed, a kernel-mode NAT redirection may result.

Requirements

Server: Requires Windows Server 2003 or Windows 2000.
Version: Requires Internet Security and Acceleration Server 2004.
Header: Declared in Wspfwext.idl.

See Also

IFWXSession, IFWXFirewallAction, IFWXSession::AllowFutureConnect