MprConfigInterfaceTransportAdd function (mprapi.h)

The MprConfigInterfaceTransportAdd function adds a transport protocol to an interface configuration on the router.

Syntax

DWORD MprConfigInterfaceTransportAdd(
  [in]           HANDLE hMprConfig,
  [in]           HANDLE hRouterInterface,
  [in]           DWORD  dwTransportId,
  [in, optional] LPWSTR lpwsTransportName,
  [in]           LPBYTE pInterfaceInfo,
  [in]           DWORD  dwInterfaceInfoSize,
  [out]          HANDLE *phRouterIfTransport
);

Parameters

[in] hMprConfig

Handle to the router configuration. Obtain this handle by calling MprConfigServerConnect.

[in] hRouterInterface

Handle to the interface configuration to which the specified transport is added. Obtain this handle by calling MprConfigInterfaceCreate, MprConfigInterfaceGetHandle, or MprConfigInterfaceEnum.

[in] dwTransportId

A DWORD value that describes the transport to add to the configuration. This parameter also identifies the router manager for the transport. Acceptable values for dwTransportId are listed in the following table.

Value Transport (Protocol Family)
PID_ATALK AppleTalk
PID_IP Internet Protocol version 4
PID_IPX Internet Packet Exchange
PID_NBF NetBIOS Frames Protocol
PID_IPV6 Windows Server 2008 or later: Internet Protocol version 6

[in, optional] lpwsTransportName

Pointer to a null-terminated 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.

[in] pInterfaceInfo

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.

[in] dwInterfaceInfoSize

Specifies the size, in bytes, of the data pointed to by pInterfaceInfo.

[out] phRouterIfTransport

A pointer to a
HANDLE variable that receives the transport configuration handle type for this interface indicated in the dwTransportId parameter.

Return value

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 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

Requirement Value
Minimum supported client None supported
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header mprapi.h
Library Mprapi.lib
DLL Mprapi.dll

See also

FormatMessage

Information Header Functions

MPR_IFTRANSPORT_0

MprConfigInterfaceCreate

MprConfigInterfaceEnum

MprConfigInterfaceGetHandle

MprConfigServerConnect

Router Configuration Functions

Router Management Reference