ltm rule command PCP request
iRule(1) BIG-IP TMSH Manual iRule(1)
PCP::request
Provides access to the data sent in a PCP request.
SYNOPSIS
PCP::request (opcode |
lifetime |
version |
protocol |
client-addr |
internal-port |
suggested-ext-port |
suggested-ext-address |
third-party |
third-party-int-addr |
prefer-failure)
DESCRIPTION
This command provides access to the data sent in a PCP (Port Control
Protocol) request. Access to this data is read-only, and the data in
the PCP request cannot be modified via the PCP::request command.
Syntax
PCP::request version
* Returns the PCP version of the request
PCP::request opcode
* Returns the opcode in the PCP request as a string, either
"announce", "peer" or "map". If the opcode is invalid the field is
returned as an integer.
PCP::request lifetime
* Returns the lifetime specified in the PCP request.
PCP::request protocol
* Returns the protocol specified in the PCP request as a string,
either "tcp" or "udp". If the protocol is invalid the field is
returned as an integer. This sub-command is only valid for a PCP
map request. "NA" is returned if called on a peer or announce
request.
PCP::request internal-port
* Returns the internal port specified in the PCP request. This
subcommand is only valid for a PCP map request. "NA" is returned if
called on a peer or announce request.
PCP::request prefer-failure
* Returns 2 if prefer-failure is set in the PCP request, returns 0 if
it is not. This subcommand is only valid for a PCP map request.
"NA" is returned if called on a peer or announce request.
PCP::request client-addr
* Returns the client address of the PCP request.
PCP::request third-party
* Returns 1 if third-party is set in the PCP request, returns 0 if it
is not. This subcommand is only valid for a PCP map request. "NA"
is returned if called on a peer or announce request.
PCP::request third-party-int-addr
* Returns the third-party IP address specified in the PCP request. If
a third-party address is not specified in the PCP request, "NA" is
returned. This subcommand is only valid for a PCP map request. "NA"
is returned if called on a peer or announce request.
PCP::request suggested-ext-port
* Returns the suggested external port specified in the PCP request.
If a suggested external port was not specified, 0 is returned. This
subcommand is only valid for a PCP map request. "NA" is returned if
called on a peer or announce request.
PCP::request suggested-ext-addr
* Returns the suggested external address specified in the PCP
request. If a suggested external address was not specified, an
address string containing all zeroaXXs is returned. This subcommand
is only valid for a PCP map request. "NA" is returned if called on
a peer or announce request.
RETURN VALUE
VALID DURING
PCP_REQUEST
EXAMPLES
Logs a message each time a PCP map request is received from client
192.168.1.1:
when PCP_REQUEST {
if {[PCP::request opcode] == "map" && [PCP::request client-addr] == "192.168.1.1" } {
log "Received PCP map request for port [PCP::request internal-port] from 192.168.1.1"
}
}
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-11.5.0 --First introduced the command.
BIG-IP 2017-01-31 iRule(1)