beautypg.com

Os_ip::dst, Return values, Example – Brocade Virtual ADX OpenScript API Guide (Supporting ADX v03.1.00) User Manual

Page 18: Description, Context, Usage, Input parameters

background image

6

Brocade Virtual ADX OpenScript API Guide

53-1003243-01

Methods

2

Return Values

The following table contains the return values.

Example

OS_IP::dst

Description

Returns the destination IP address of an incoming packet.

Context

Called in context of TCP, UDP and HTTP.

Usage

Used in performing load-balancing based on the destination address. This API supports both IPv4
and IPv6.

Input Parameters

None.

Return Values

The following table contains the return values.

TABLE 1

Return Values

Name

Type

Description

string

String representing Source IP
address

TABLE 2

Return Values

Name

Type

Description

string

A string representing a
destination IP address.

use OS_IP;

use OS_SLB;

use OS_HTTP_REQUEST;

sub HTTP_REQUEST{

my $client_ip = OS_IP::src;

print "Client IP Address - $client_ip\n";

OS_HTTP_REQUEST::header("X-Forwarded-For", "$client_ip");

OS_SLB::forward("30");

}