openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/libnl/1_3.4.0-r0/libnl-3.4.0/lib/route/addr.c
struct rtnl_addr* rtnl_addr_get(struct nl_cache* cache, int ifindex,
                                struct nl_addr* addr)
{
    struct rtnl_addr* a;

    if (cache->c_ops != &rtnl_addr_ops)
        return NULL;

    nl_list_for_each_entry(a, &cache->c_items, ce_list)
    {
        if (ifindex && a->a_ifindex != ifindex)
            continue;

        if (a->ce_mask & ADDR_ATTR_LOCAL && !nl_addr_cmp(a->a_local, addr))
        {
            nl_object_get((struct nl_object*)a);
            return a;
        }
    }

    return NULL;
}
/**
 * Search address in cache
 * @arg cache		Address cache
 * @arg ifindex		Interface index of address
 * @arg addr		Local address part
 *
 * Searches address cache previously allocated with rtnl_addr_alloc_cache()
 * for an address with a matching local address.
 *
 * The reference counter is incremented before returning the address, therefore
 * the reference must be given back with rtnl_addr_put() after usage.
 *
 * @return Address object or NULL if no match was found.
 */
Search address in cache
@arg cache           Address cache
@arg ifindex         Interface index of address
@arg addr            Local address part

Searches address cache previously allocated with rtnl_addr_alloc_cache()
for an address with a matching local address.

The reference counter is incremented before returning the address, therefore
the reference must be given back with rtnl_addr_put() after usage.

@return Address object or NULL if no match was found.
Search address in cache @arg cache Address cache @arg ifindex Interface index of address @arg addr Local address part Searches address cache previously allocated with rtnl_addr_alloc_cache () for an address with a matching local address . The reference counter is incremented before returning the address therefore the reference must be given back with rtnl_addr_put () after usage . @return Address object or NULL if no match was found .
struct rtnl_addr* rtnl_addr_get(struct nl_cache* cache, int ifindex,
                                struct nl_addr* addr)
{
    struct rtnl_addr* a;
    if (cache->c_ops != &rtnl_addr_ops)
        return NULL;
    nl_list_for_each_entry(a, &cache->c_items, ce_list)
    {
        if (ifindex && a->a_ifindex != ifindex)
            continue;
        if (a->ce_mask & ADDR_ATTR_LOCAL && !nl_addr_cmp(a->a_local, addr))
        {
            nl_object_get((struct nl_object*)a);
            return a;
        }
    }
    return NULL;
}
struct rtnl_addr * rtnl_addr_get ( struct nl_cache * cache , int ifindex , struct nl_addr * addr ) { struct rtnl_addr * a ; if ( cache -> c_ops != & rtnl_addr_ops ) return NULL ; nl_list_for_each_entry ( a , & cache -> c_items , ce_list ) { if ( ifindex && a -> a_ifindex != ifindex ) continue ; if ( a -> ce_mask & ADDR_ATTR_LOCAL && ! nl_addr_cmp ( a -> a_local , addr ) ) { nl_object_get ( ( struct nl_object * ) a ) ; return a ; } } return NULL ; }
Search address in cache
 @arg cache           Address cache
 @arg ifindex         Interface index of address
 @arg addr            Local address part
Search address in cache @arg cache Address cache @arg ifindex Interface index of address @arg addr Local address part