C++ Native Functions: com.teracloud.streams.network.source

This page documents native functions that can be invoked from SPL, including the SPL interfaces that can be used to invoke each of the native functions.

Functions

public uint32 CAPTURE_MICROSECONDS()

This function returns the number of microseconds since the value of the CAPTURE_SECONDS() function until the current packet was captured, according to the system clock on the machine that captured it.

public uint32 CAPTURE_SECONDS()

This function returns the number of seconds since the beginning of the Unix epoch (midnight on January 1st, 1970 in Greenwich, England) until the current packet was captured, according to the system clock on the machine that captured it.

public uint64 CAPTURE_TSC_MICROSECONDS()

This function returns the value of the machine's timestamp counter when the packet was captured, that is, the number of microseconds since the machine was booted. Note that unlike the CAPTURE_SECONDS() and CAPTURE_MICROSECONDS() functions, this function's value is not relative to the Unix 'epoch'.

public boolean DNS_RESPONSE_FLAG_HINT()

This function speculatively returns the DNS response flag. Full packet parsing with validation is not performed. Instead, simple basic checks are made and then the response bit is returned. This means that all actual DNS packets that are responses are returned correctly, but some non-DNS packets might also be flagged as a DNS response.

public uint32 ERSPAN_DST_ADDRESS()

This function returns the value of the GRE ERSPAN destination address in the current packet, if it has one, or zero if otherwise.

public uint32 ERSPAN_SRC_ADDRESS()

This function returns the value of the GRE ERSPAN source address in the current packet, if it has one, or zero if otherwise.

public list<uint8>[6] ETHER_DST_ADDRESS()

This function returns the ethernet destination address of the current packet.

public uint64 ETHER_DST_ADDRESS_64()

This function returns the ethernet destination address of the current packet in the 48 low-order bits of a uint64.

public uint16 ETHER_PROTOCOL()

This function returns the ethernet protocol (that is, the EtherType) of the current packet, for example, '2048' for IP version 4, or '34,525' for IP version 6.

public list<uint8>[6] ETHER_SRC_ADDRESS()

This function returns the ethernet source address of the current packet.

public uint32 IPV4_DST_ADDRESS()

This function returns the IP version 4 destination address of the current packet, if it has one, or zero otherwise.

public uint32 IPV4_SRC_ADDRESS()

This function returns the IP version 4 source address of the current packet, if it has one, or zero otherwise.

public list<uint8>[16] IPV6_DST_ADDRESS()

This function returns the IP version 6 destination address of the current packet, if it has one, or an empty list otherwise.

public list<uint8>[16] IPV6_SRC_ADDRESS()

This function returns the IP version 6 source address of the current packet, if it has one, or an empty list otherwise.

public boolean IP_DONT_FRAGMENT()

This function returns the IP "don't fragment" flag of the current packet. When a sender sets this flag in a packet, it prohibits routers from fragmenting the packet in transit. If the packet's length exceeds the maximum size of a link, it will be discarded by the router instead of being fragmented.

public uint16 IP_DST_PORT()

This function returns the TCP or UDP destination port number of the current packet, if it has one, or zero otherwise.

public uint16 IP_FRAGMENT_OFFSET()

This function returns the IP "fragment offset" field of the current packet, multiplied by eight, When a router fragments a packet, it stores the offset from the front of the packet to the front of the fragment, measured in eight-byte steps, in each fragment. That is, the size of each fragment is always a multiple of eight bytes, and the value stored is the offset in bytes, divided by eight. This function returns that value, multiplied by eight, so that it gives the offset from the front of the packet to the front of the fragment in bytes.

public uint32 IP_IDENTIFIER()

This function returns the IP identifier of the current packet. When a packet is fragmented in transit, this identifer is copied into all of the fragments. The receiver combines this identifier with the packet's source and destination addresses to gather the fragments, and uses the fragment offset (see the IP_FRAGMENT_OFFSET() function) to reassemble them into original packet.

public boolean IP_MORE_FRAGMENTS()

This function returns the IP "more fragments" flag of the current packet. When a router fragments a packet, it sets this flag in all fragments except the last one.

public uint8 IP_PROTOCOL()

This function returns the IP protocol of the current packet, for example, '6' for TCP, or '17' for UDP, or zero if the ethernet packet does not contain an IP packet.

public uint16 IP_SRC_PORT()

This function returns the TCP or UDP source port number of the current packet, if it has one, or zero otherwise.

public uint8 IP_VERSION()

This function returns the IP version of the current packet ('4' for IP version 4, or '6' for IP version 6), if the ethernet packet contains an IP packet, or zero otherwise.

public uint32 JMIRROR_DST_ADDRESS()

This function returns the value of the 'jmirror' destination address in the current packet, if it has one, or zero if otherwise.

public uint16 JMIRROR_DST_PORT()

This function returns the value of the 'jmirror' dstination port in the current packet, if it has one, or zero if otherwise.

public uint32 JMIRROR_INTERCEPT_ID()

This function returns the value of the 'jmirror' intercept identifier in the current packet, if it has one, or zero if otherwise.

public uint32 JMIRROR_SESSION_ID()

This function returns the value of the 'jmirror' session identifier in the current packet, if it has one, or zero if otherwise.

public uint32 JMIRROR_SRC_ADDRESS()

This function returns the value of the 'jmirror' source address in the current packet, if it has one, or zero if otherwise.

public uint16 JMIRROR_SRC_PORT()

This function returns the value of the 'jmirror' source port in the current packet, if it has one, or zero if otherwise.

public blob PACKET_DATA()

This function returns the network data in the current packet, including all network headers. Note that the data may have been truncated when the packet was captured.

public uint32 PACKET_LENGTH()

This function returns the number of bytes of network data in the current packet, including all network headers. Note that this value may be larger than the length of the binary data returned by the PACKET_DATA() function if the packet was truncated when it was captured.

public blob PAYLOAD_DATA()

This function returns the payload data in the current packet, excluding all network headers. Note that the data may have been truncated when the packet was captured.

public uint32 PAYLOAD_LENGTH()

This function returns the number of bytes of payload data in the current packet, excluding all network headers. Note that this value may be larger than the length of the binary data returned by the PAYLOAD_DATA() function if the packet was truncated when it was captured.

public boolean RATE_LIMITED()

This function returns false when an amount of time between packets has passed such that the rate is limited to the value given in the rateLimit paramater.

public uint32 TCP_ACKNOWLEDGEMENT()

This function returns the value of the TCP acknowledgement number in the current packet, if it has one, or zero if otherwise.

public uint16 TCP_DST_PORT()

This function returns the TCP destination port number of the current packet, if it has one, or zero otherwise.

public boolean TCP_FLAGS_ACK()

This function returns true if the current packet has a TCP 'ack' flag and its set, or false otherwise.

public boolean TCP_FLAGS_FIN()

This function returns true if the current packet has a TCP 'fin' flag and its set, or false otherwise.

public boolean TCP_FLAGS_PUSH()

This function returns true if the current packet has a TCP 'push' flag and its set, or false otherwise.

public boolean TCP_FLAGS_RESET()

This function returns true if the current packet has a TCP 'reset' flag and its set, or false otherwise.

public boolean TCP_FLAGS_SYN()

This function returns true if the current packet has a TCP 'syn' flag and its set, or false otherwise.

public boolean TCP_FLAGS_URGENT()

This function returns true if the current packet has a TCP 'urgent' flag and its set, or false otherwise.

public boolean TCP_PORT(uint16)

This function returns true if the current packet has a TCP source or destination port, or false if not.

public uint32 TCP_SEQUENCE()

This function returns the value of the TCP sequence number in the current packet, if it has one, or zero if otherwise.

public uint16 TCP_SRC_PORT()

This function returns the TCP source port number of the current packet, if it has one, or zero otherwise.

public uint16 TCP_WINDOW()

This function returns the value of the TCP window size in the current packet, if it has one, or zero if otherwise.

public uint16 UDP_DST_PORT()

This function returns the UDP destination port number of the current packet, if it has one, or zero otherwise.

public boolean UDP_PORT(uint16)

This function returns true if the current packet is a UDP packet and the argument matches its source or destination port, or false otherwise.

public uint16 UDP_SRC_PORT()

This function returns the UDP source port number of the current packet, if it has one, or zero otherwise.

public list<uint16> VLAN_TAGS()

This function returns a list of 0 to N VLAN tags found in the current packet.

public uint64 bytesProcessed()

This function returns the number of bytes of network data processed by the operator since it started, including the current packet, excluding any packets that were ignored by the input filter, if the inputFilter parameter was specified.

public uint64 bytesReceived()

This function returns the number of bytes received from the network interface since the operator started, as of the most recent metrics interval, if there is one, or zero if not. This function always returns zero for the PacketLiveSource and PacketFileSource operators.

public uint64 metricsIntervalBytesProcessed()

This function returns the number of bytes of network data processed by the operator during the most recent metrics interval, excluding any packets that were ignored by the input filter, if the inputFilter parameter was specified.

public uint64 metricsIntervalBytesReceived()

This function returns the number of bytes received from the network interface during the most recent metrics interval, if there is one, or zero if not. This function always returns zero for the PacketLiveSource and PacketFileSource operators.

public float64 metricsIntervalElapsed()

This function returns the duration of the most recent metrics interval, in seconds with a resolution of at least microseconds, if there is one, or zero if not.

public uint64 metricsIntervalMaxQueueDepthSW()

This function returns the software receive queue (if implemented) high water mark from the most recent metrics interval. Otherwise, returns 0.

public uint64 metricsIntervalPacketsDropped()

This function returns the number of packets dropped by the network interface during the most recent metrics interval, if there is one, or zero if not. This function always returns zero for the PacketFileSource operator.

public uint64 metricsIntervalPacketsDroppedSW()

This function returns the number of packets dropped by the software packet receive queue (if implemented) in the most recent metrics interval. Otherwise, returns 0.

public uint64 metricsIntervalPacketsProcessed()

This function returns the number of network packets processed by the operator during the most recent metrics interval, excluding any packets that were ignored by the input filter, if the inputFilter parameter was specified.

public uint64 metricsIntervalPacketsReceived()

This function returns the number of packets received from the network interface during the most recent metrics interval, if there is one, or zero if not. This function always returns zero for the PacketFileSource operator.

public boolean metricsUpdated()

This function returns true for the first tuple produced after a new metrics interval begins, and returns false for all subsequent tuples produced in the same metrics interval.

public uint64 packetsDropped()

This function returns the number of packets dropped by the network interface since the operator started, as of the most recent metrics interval, if there is one, or zero if not. This function always returns zero for the PacketFileSource operator.

public uint64 packetsDroppedSW()

This function returns the total number of packets dropped by the software packet receive queue (if implemented). Otherwise, returns 0.

public uint64 packetsProcessed()

This function returns the number of network packets processed by the operator since it started, including the current packet, but excluding any packets that were ignored by the input filter, if the inputFilter parameter was specified.

public uint64 packetsReceived()

This function returns the number of packets received from the network interface since the operator started, as of the most recent metrics interval, if there is one, or zero if not. This function always returns zero for the PacketFileSource operator.