MprConfigInterfaceTransportAdd

The MprConfigInterfaceTransportAdd function adds the specified transport to the specified interface configuration on the router.

DWORD MprConfigInterfaceTransportAdd(
  HANDLE hMprConfig,           // handle to the router configuration
  HANDLE hRouterInterface,     // handle to the interface configuration
  DWORD dwTransportId,         // identifier of the transport/router
                               // manager
  LPWSTR lpwsTransportName,    // transport name
  LPBYTE pInterfaceInfo,       // interface information
  DWORD dwInterfaceInfoSize,   // size of interface information
  HANDLE *phRouterIfTransport  // handle to transport configuration
);

Parameters

hMprConfig
[in] Handle to the router configuration. Obtain this handle by calling MprConfigServerConnect.
hRouterInterface
[in] Handle to the interface configuration to which to add the specified transport. Obtain this handle by calling MprConfigInterfaceCreate, MprConfigInterfaceGetHandle, or MprConfigInterfaceEnum.
dwTransportId
Specifies the value that identifies the transport. This parameter also identifies the router manager for the transport.
lpwsTransportName
[in] Pointer to a Unicode string that specifies the name for the transport being added. If this parameter is not specified and the transport is IP or IPX, MprConfigInterfaceTransportAdd uses "IP" or "IPX". If this parameter is not specified and the transport is other than IP or IPX, MprConfigInterfaceTransportAdd converts the dwTransportId parameter into a string and uses that as the transport name.
pInterfaceInfo
[in] Pointer to an information header that contains information for the specified interface and transport. The router manager for the specified transport interprets this information. Use the Information Header Functions to manipulate information headers.
dwInterfaceInfoSize
[in] Specifies the size, in bytes, of the data pointed to by pInterfaceInfo.
phRouterIfTransport
[out] Pointer to a handle variable. This variable receives a handle to the transport configuration for this interface.

Return Values

If the function succeeds, the return value is NO_ERROR.

If the function fails, the return value is one of the following error codes.

Value Meaning
ERROR_INVALID_PARAMETER One of the following is true:
  • hMprConfig is NULL.
  • hRouterInterface is NULL.
  • phRouterIfTransport is NULL.
ERROR_NOT_ENOUGH_MEMORY Insufficient resources to complete the operation.
Other Use FormatMessage to retrieve the system error message that corresponds to the error code returned.

Remarks

In addition to specifying a transport, the dwTransportId parameter also specifies a router manager, because a Windows 2000 router maintains a unique router manager for each transport.

If the specified transport already exists, MprConfigInterfaceTransportAdd does the equivalent of an MprConfigInterfaceTransportSetInfo call using the specified parameter values.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Mprapi.h.
  Library: Use Mprapi.lib.

See Also

Router Management Reference, Router Configuration Functions, FormatMessage, MPR_IFTRANSPORT_0, MprConfigInterfaceCreate, MprConfigInterfaceEnum, MprConfigInterfaceGetHandle, MprConfigServerConnect