This section lists the APIs available for the L4 SSL DataScripts.

Datapath DS APIs

The following are the datapath APIs:

Datapath API

Description

buffered = avi.l4.collect("x")

This data-script will collect “x” amount of bytes in the socket buffer. This API can yield and resume. Socket buffer is decided based on which DS event invokes this API (Client sockbuf for L4 request and server sockbuf for L4 response). The return value of the API is the amount of data present in the sockbuf.

payload = avi.l4.read("xBytes", offset, "client"/"server")

Reads xBytes from socket buffer and presents it as hex-stream to the data-script. The direction decides which sockbuf data to be read from.

avi.l4.discard("xBytes", offset, "client"/"server")

Discard xBytes from sockbuf using specified offset.

avi.l4.modify(payload2, offset, "client"/"server")

Inserts payload2 at offset of the sockbuf.

avi.l4.pause("xBytes”)

  • Pauses Tx after sending xBytes in natural proxy direction.

  • Currently, multiple pause apis cannot be used in the same event.

  • Currently, any API that could cause yield cannot be used after pause.

avi.l4.send(payload2)

  • Sends out-of-bound data to the client/ server.

  • Send-API will always have higher priority than Resume-API, which means if you use send and resume at the same time, the data released by Resume-API will always go after the data in the Send-API.

  • If invoked in L4 request, it sends OOB data to client.

  • If invoked in L4 response, it sends OOB data to server.

avi.l4.resume("xBytes")

  • Resume peer sockbuf to release “xBytes” amount of data. (xBytes is equal to zero means release all the data) If invoked in L4 request, response side data will be released.

  • If invoked in L4 response, request side data will be released.

  • Currently, multiple resume API cannot be used in same event.

  • Currently, any API that could cause yield cannot be used after resume.

avi.vs.ds_done()

Stops invocation of current datascript for the connection.

Load Balancing API

avi.pool.select or avi.vs.persist will be a No-op if load balancing is already done.

All of the manipulation API are on the current snapshot of underlying socket buffer.

Every API is relative to the previous API, for instance, avi.l4.discard will discard some part of payload. The succeeding API, for instance, avi.l4.modify, will work on the new payload set obtained as result of avi.l4.discard.

FIX APIs

  • avi.fix.parse — Use FIX parser C library to parse the provided payload.

  • avi.fix.getTagValue — Get the TAG value in the current message context.

SSL APIs

  • avi.ssl.protocol

  • avi.ssl.disable_ssl()

  • avi.ssl.enable_ssl()

  • avi.ssl.server_name

  • avi.ssl.client_cert

  • avi.ssl.cipher

  • avi.ssl.clear_error - Clears the error bitmap set by OpenSSL in SSL context to ignore certain errors while SSL handshake (for instance, allow expired certificate, and so on).

VS APIs

  • avi.vs.log

  • avi.vs.debug

  • avi.vs.client_ip

  • avi.vs.client_port

  • avi.vs.vip_ip

  • avi.vs.vip_port

  • avi.vs.name

  • avi.vs.table_insert

  • avi.vs.table_lookup

  • avi.vs.table_remove

  • avi.vs.close_conn

  • avi.vs.done

POOL APIs

  • avi.pool.select

GROUP APIs

  • avi.ipgroup.contains

  • avi.stringgroup.contains{_CASE}

  • avi.stringgroup.equals{_CASE}

  • avi.stringgroup.beginswith{_CASE}

  • avi.stringgroup.endswith{_CASE}