Collapse All
Parallels Virtualization SDK
ContentsIndex
PreviousUpNext
PHT_PORT_FORWARDING
Functions  Functions by Handle  Legend

The PHT_PORT_FORWARDING handle provides access to the Port Forwarding functionality. Using this functionality, you can redirect all incoming data from a specific TCP or UDP port in the host machine to the specified port in a virtual machine.

Description

Port forwarding is used when you have a virtual machine communicating with the outside world using shared networking and would like other computers to be able to access certain services running in it (e.g. HTTP server, FTP server, or any other service listening for client requests on a particular port). In order to do so, you have to tell the host machine to forward all data that it receives on a certain port to the appropriate port in the virtual machine. This is accomplished by creating a port forwarding entry using the PHT_PORT_FORWARDING handle. A port forwarding entry has the following properties: 

 

  • The source port number in the host computer. All data that the host computer receives on this port will be forwarded to the virtual machine.
  • The destination virtual machine identified by its IP address. The address can be determined using the standard tools of the guest operating system.
  • The destination port number in the virtual machine. All data will be forwarded from the source port on the host machine to this port.

To obtain a list of the handles containing information about existing port forwarding entries, use the PrlVirtNet_GetPortForwardList function. To create a new port forwarding entry, use PrlPortFwd_Create to create a new handle. Use the functions describes in this section to define or modify the port forwarding entry properties and then use the PrlVirtNet_SetPortForwardList function to save it.

Functions
 
Name 
Description 
 
Creates a new handle of type PHT_PORT_FORWARDING. 
 
Returns the incoming port. 
 
Returns the redirect IP address of the specified port forward entry. 
 
Returns the redirect port. 
 
Returns the redirect virtual machine identifier of the specified port forward entry. 
 
Returns the rule name of the specified port forward entry. 
 
Sets the specified incoming port. 
 
Sets the specified port forwardi entry redirect IP address. 
 
Sets the specified redirect port. 
 
Sets the specified port forward entry virtual machine identifier. 
 
Sets the specified port forward entry rule name. 
Links
© 2021 Parallels International GmbH. All rights reserved.