54 Citrix NetScaler Policy Configuration and Reference Guide

Arithmetic Operations for Compound Advanced Expressions

Operator

Description

 

 

number.BITXOR

Returns a number after applying a bitwise XOR to the integer

(integer)

argument and the current number value. If the values in the bitwise

 

comparison are the same, the returned value is a 0. The following

 

example assumes that numeric.expression returns 12 (binary 1100):

 

numeric.expression.bitxor(10)

 

The binary value of 10 is 1010, and the result of applying the

 

BITXOR operator to the entire expression is 6 (binary 0110).

 

The following is another example of an expression that uses a

 

BITXOR. Assume that the expression prior to the BITXOR returns a

 

value of 8:

 

http.req.header(\"test\").contains_index(\"pat1\"

 

).bitxor(8)

 

The result of this expression is 0.

 

A caret (^) performs a similar function to BITXOR, but takes

 

another expression as an argument rather than an integer.

 

Note that all returned values of less than 32 bits before applying the

 

operator implicitly have zeros to the left to make them 32 bits wide.

number.LSHIFT

Returns a number after a bitwise left shift of the number value by the

(integer)

integer argument number of bits.

 

Note that the number of bits shifted is integer modulo 32. The

 

following example assumes that numeric.expression returns 12

 

(binary 1100):

 

numeric.expression.lshift(3)

 

The result of applying the LSHIFT operator is 96 (a binary

 

1100000).

 

The following is another example of an expression that uses an

 

LSHIFT. Assume that the expression prior to the LSHIFT returns a

 

value of 8:

 

http.req.header(\"test\").contains_index(\"pat1\"

 

).lshift(2)

 

The result of this expression is 32.

 

A double less-than (<<) performs a similar function to LSHIFT, but

 

takes another expression as an argument rather than an integer.

 

Note that all returned values of less than 32 bits before applying the

 

operator implicitly have zeros to the left to make them 32 bits wide.

 

 

Page 68
Image 68
Citrix Systems 9.2 manual Bitxor operator to the entire expression is 6 binary, Number.LSHIFT