ADCEntry class

Syntax

ADCEntry(<type>)

Description

Python class that represents an entry in an Analytics Data Collections (ADC) list. Creates the ADC entry.

Returns the ADC entry object.

Parameters

<type>

Specifies the action to be taken by the ADC entry.

Valid values are the following:

ADCEntry.Type.MATCH

Update statistics for packets that match this ADC entry.

ADCEntry.Type.IGNORE

Take no action for packets that match this ADC entry.

Methods

src_ip("<IP-ADDR>[/<MASK>]")

Adds the source IP address information to the entry.

Returns the ADC entry object.

<IP-ADDR>

Specifies the IP address.

/<MASK>

Specifies the subnet mask.

Example:

src_ip("10.0.0.1/255.255.255.255")
dst_ip("<IP-ADDR>[/<MASK>]")

Adds the destination IP address information to the entry.

Returns the ADC entry object.

<IP-ADDR>

Specifies the IP address.

/<MASK>

Specifies the subnet mask.

Example:

dst_ip("10.0.0.2/255.255.255.255")
src_port("<PORT>")

Adds the source port information to the entry.

Default: If no source port is specified, traffic ingressing any source port is matched.

Returns the ADC entry object.

<PORT>

Specifies the port number.

Example:

src_port("1/1/2")
src_l4_port(<L4-PORT>)

Adds the layer 4 source port information to the entry.

Returns the ADC entry object.

<L4-PORT>

Specifies the layer 4 port number.

Example:

src_l4_port(6640)
dst_l4_port(<L4-PORT>)

Adds the layer 4 destination port information to the entry.

Returns the ADC entry object.

<L4-PORT>

Specifies the layer 4 port number.

Example:

dst_l4_port(8080)
protocol(<protocol>[, flags={<flags>}])

Adds the network protocol information to the entry, which enables you to match or ignore packets based on the network protocol used or based on specific protocol flags.

Returns the ADC entry object.

<protocol>

Specifies the network protocol.

Use the following value to specify the TCP protocol:

ADCEntry.Protocol.TCP

flags={<flags>}

Sets protocol flags for this ADC entry. Contains a comma-separated list of flag names and values in the following format:

"<flag-name>": True

If an entry sets multiple flags, the packet matches the entry if all the flag conditions match.

The following flag names are supported for the TCP protocol:

tcp_urg

Urgent.

tcp_ack

Acknowledgment.

tcp_psh

Push buffered data to receiving application.

tcp_rst

Reset the connection.

tcp_syn

Synchronize sequence numbers.

tcp_fin

Finish connection.

tcp_established

Established connection.

Default: No flags are set.

Example:

protocol(ADCEntry.Protocol.TCP, flags={“tcp_ack”: True, “tcp_psh”:
    True, “tcp_rst”: True, “tcp_syn”: True, “tcp_fin”: True})

Example

entry1 = ADCEntry(ADCEntry.Type.MATCH).src_ip(
    "10.0.0.1/255.255.255.255").dst_ip("10.0.0.2/255.255.255.255")
    .protocol(ADCEntry.Protocol.TCP)