• View Communities
    • Citrix Developer Network
      The place for unfiltered straight talk on Citrix products. Blogs, code downloads, best practices, APIs, and more can all be found here.
    • Citrix Ready Community Verified
      Does it work with Citrix? Application compatibility questions are a thing of the past with the new Citrix Community Verified site.
    • Blogs
      Learn the latest from the Citrix employees who are building application delivery infrastructure technologies.
    • Blogosphere
      The Citrix Blogosphere is a window into the thousands of conversations taking place about Citrix and Application Delivery.
  •  Sign In
NetScaler Developer Network

Configuring PI expression using Hex(or Octal) encoded Arguments.

Summary

 





In PI, there are basically three kinds of arguments for any PI operator, they are:-

1) Numerical Argument

2) String Based Argument

3) Single Character based Argument


 

For ex:-, take the case of the following PI expression,

HTTP.RES.BODY(10).BEFORE_STR("abcd").SKIP('c',10)


 

Here, the argument of BODY is a Numerical argument.

the argument of BEFORE_STR is a String Argument.

the first argument of SKIP is a Single Character.

the second argument of SKIP is a Numerical argument.


 

The String Based arguments are ASCII characters, and so are Character Based Arguments. Now, suppose you want to provide a string Based argument(or Character based), but the character is hard to type from the keyboard (like \r, \n, \t or any other special character), although you are aware of the ASCII value of it. PI provides the user to configure expressions, using the ASCII Values of the characters. You can provide a character(or group of characters) as an argument to the PI-Operators in their HEX or OCTAL Equivalents.

The Format is much similar to the popular C Language Syntax :-

==============================================

\dd   -----> For Octal numbers (ex. \77) and 0<d<7; for base 8 

 \xdd  -----> For Hex Numbers (ex. \x3f) and 0<d<15; for base 16

==============================================


Hence the following Rewrite action,

add rewrite action Extract-Header-SERVER insert_http_header Name 'HTTP.RES.HEADER("Server")'

 Can be written as,

 add rewrite action Extract-Header-SERVER insert_http_header Name 'HTTP.RES.HEADER("\x53erver")'





The format with Numerical operators is fairly straight (and is again similar to the popular C Language Syntax),

==================================================== 

  0xdd  -------> For Hex Numbers (ex. 0x3f) and 0<d<15; as base is 16 

====================================================


 

i.e.  0xfff is 4095 in decimal Number system.



Hence the following rewrite action,

add rewrite action act1 insert_http_header Name '1 + 17'


Can be written as,

add rewrite action act1 insert_http_header Name '1 + 0x11'


 

  




More Information

Tags

appexpert appexpert Delete
responder responder Delete
rewrite rewrite Delete
pi pi Delete
how to how to Delete
Enter tags to add to this page:
Please wait 
Looking for a tag? Just start typing.
Related Links