lr_get_vuser_ip

Returns the IP address of a Vuser.

char *lr_get_vuser_ip( ); 
Alphabetical Listing - C Language Utility Functions

The lr_get_vuser_ip function returns the IPv4 address of a Vuser. When performing IP spoofing, each Vuser can use a different address. This function allows you to determine the current Vuser's IP address.

If the IP was set with the web_set_sockets_option function using the IP_ADDRESS_BY_INDEX option, lr_get_vuser_ip returns that IP.

To get an IPv6 address, use lr_get_attrib_string("ipv6") .

Return Values

If this function succeeds, it returns a pointer to a string holding the IP address of the Vuser. If it fails, or if working with multiple IP addresses is disabled, it returns NULL.

Parameterization

Parameterization is not applicable to this function.

Example

In the following example, the lr_get_vuser_ip function checks the IP address of the current Vuser and sends it to the Output window.

char *ip;
ip = lr_get_vuser_ip();
if (ip)
     lr_output_message("The IP address is %s", ip);
else
     lr_output_message("IP spoofing disabled");