Os_payload_inspect::disable (), Example, Context – Brocade Virtual ADX OpenScript API Guide (Supporting ADX v03.1.00) User Manual

Page 128: Usage

Advertising
background image

116

Brocade Virtual ADX OpenScript API Guide

53-1003243-01

Methods

9

Example

In the following example, the script changes the maximum match size during payload matching
from the default value of 1024 to 512.

OS_PAYLOAD_INSPECT::disable ()

Disables payload inspection for the current transaction.

Context

This function can be called from any event.

Usage

This API is used for disabling payload inspection within a transaction. For example, a payload
inspection for an HTTP transaction can be disabled in a matched event handler.

Example

use OS_HTTP_RESPONSE;

use OS_PAYLOAD_INSPECT;

sub HTTP_RESPONSE {

if (OS_HTTP_RESPONSE::content_type =~ /text/) {

OS_PAYLOAD_INSPECT::match_size(512);

OS_PAYLOAD_INSPECT::substitute(

‘credit*card=[0-9]{32}’,‘#### ####’,

‘SSN=[0-9]{9}’,‘###-##-####’);

}

}

use OS_HTTP_RESPONSE;

use OS_PAYLOAD_INSPECT;

sub HTTP_RESPONSE {

if (OS_HTTP_RESPONSE::content_type =~ /text/) {

OS_PAYLOAD_INSPECT::substitute(

‘credit*card=[0-9]{32}’,‘#### ####’,

‘SSN=[0-9]{9}’,‘###-##-####’

);

}else {

OS_PAYLOAD_INSPECT::disable();

}

}

Advertising