Skip to main content

Name

cidrrange_val_ipv4_query — Retrieves the value associated with an IP address in a list of CIDR blocks

Synopsis

#include "cidrtree/cidrrange.h"

| ec_blobject * **cidrrange_val_ipv4_query** ( | root, |   | |   | ip); |   |

const cidrrange_val_ipv4 * <var class="pdparam">root</var>; struct in_addr <var class="pdparam">ip</var>;

Description

Retrieves the value associated with an IP address in a list of CIDR blocks. Given an IPv4 address, this function determines the most specific range that encompasses it, and returns the value associated with that range. If no range matches, the default_value that was passed to cidrrange_val_ipv4_new will be returned.

Parameters

root

The root of the CIDR block list.

ip

The IP address to query in the CIDR block list.

Return Values

The orientation for the supplied IP. The caller is responsible for calling ec_blobject_delref on the returned value when it is no longer required.

Threading

It is legal to call this function in any thread.

See Also

Was this page helpful?