IRTCPortManager::GetMapping (Windows CE 5.0)

Send Feedback

This method retrieves internal and external (on the NAT) IP addresses and port mappings when given a remote address and port type for the port. If a mapping is not available, the application should return a failure code. The operation requiring the mapping will fail.

HRESULT GetMapping(  BSTR bstrRemoteAddress,  RTC_PORT_TYPE enPortType,  BSTR* pbstrInternalLocalAddress,  long* plInternalLocalPort,  BSTR* pbstrExternalLocalAddress,  long* plExternalLocalPort);

Parameters

  • bstrRemoteAddress
    [in] The IP address of the remote endpoint for which the NAT mapping is required. Currently, this parameter will contain an IPv4 dotted address. However, in the future an IPv6 address may also be entered in this parameter. The application must not assume this will be an IPv4 address.
  • enPortType
    [in] An RTC_PORT_TYPE enumeration value used to inform the application of which type of UDP port is required. Initially this will only be audio RTP and RTCP. When PC-to-PC calls are allowed, this will also include video RTP and RTCP.
  • pbstrInternalLocalAddress
    [in, out] Pointer to the client's internal IP address. On output, this parameter is a BSTR that will be filled with the client's internal IP address, or an empty string if there is no entry. The application is responsible for allocating the buffer. The RTC Client API is responsible for releasing this memory with SysFreeString.
  • plInternalLocalPort
    [in, out] Pointer to the client's internal port.
  • pbstrExternalLocalAddress
    [in, out] Pointer to the external IP address of the NAT. On output, this parameter is a BSTR that will be filled with the external IP address of the NAT, or an empty string if there is no entry. The application is responsible for allocating the buffer. The RTC Client API is responsible for releasing this memory with SysFreeString.
  • plExternalLocalPort
    [in, out] Pointer to the external port of the NAT.

Return Values

This method can return an RTC_E_ constant, as well as any of the standard COM and ADSI return values. The following table shows additional possible return values.

Value Description
S_OK NAT mapping was retrieved.
E_FAIL NAT mapping was not retrieved.

Remarks

Security Note   This method can send data over the network in unencrypted form. Therefore, someone eavesdropping on the network might be able to read the data. Before using this method in an unencrypted session, consider the security risk of sending the data in clear text. The application can encrypt an RTC session by specifying TLS in the profile used for the session.

Requirements

OS Versions: Windows CE .NET 4.2 and later.
Header: Rtccore.h, Rtccore.idl.
Link Library: Uuid.lib.

See Also

IRTCPortManager | IRTCPortManager::ReleaseMapping | RTC_PORT_TYPE | SysFreeString

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.