L4 SSL Datascripts
Datapath DS APIs
The following are the data path APIs:
buffered = avi.l4.collect("x")
This data-script will collect “x” amount of bytes in 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). 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.
a. Pauses Tx after sending xBytes in natural proxy direction.
b. Currently, multiple pause apis cannot be used in the same event.
c. Currently, any API that could cause yield cannot be used after pause.
a. Sends out-of-bound data to the client/ server.
b. 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.
c. If invoked in L4 request, it sends OOB data to client.
d. If invoked in L4 response, it sends OOB data to server.
a. Resume peer sockbuf to release “xBytes” amount of data. (xBytes is equal to zero means release all the data)
b. If invoked in L4 request, response side data will be released.
c. If invoked in L4 response, request side data will be released.
d. Currently, multiple resume API cannot be used in same event.
e. Currently, any API that could cause yield cannot be used after resume.
Stops invocation of current datascript for the connection.
Load Balancing API
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.fix.parse— Use FIX parser C library to parse the provided payload.
avi.fix.getTagValue— Get the TAG value in the current message context.
- 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)