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/idiag/idiag_msg_obj.c
int idiagnl_msg_alloc_cache(struct nl_sock* sk, int family, int states,
                            struct nl_cache** result)
{
    struct nl_cache* cache = NULL;
    int err;

    if (!(cache = nl_cache_alloc(&idiagnl_msg_ops)))
        return -NLE_NOMEM;

    cache->c_iarg1 = family;
    cache->c_iarg2 = states;

    if (sk && (err = nl_cache_refill(sk, cache)) < 0)
    {
        free(cache);
        return err;
    }

    *result = cache;
    return 0;
}
/**
 * Build an inetdiag cache to hold socket state information.
 * @arg	sk      Netlink socket
 * @arg family  The address family to query
 * @arg states  Socket states to query
 * @arg result  Result pointer
 *
 * @note The caller is responsible for destroying and free the cache after using
 *  it.
 * @return 0 on success of a negative error code.
 */
Build an inetdiag cache to hold socket state information.
@arg sk      Netlink socket
@arg family  The address family to query
@arg states  Socket states to query
@arg result  Result pointer

@note The caller is responsible for destroying and free the cache after using
it.
@return 0 on success of a negative error code.
Build an inetdiag cache to hold socket state information . @arg sk Netlink socket @arg family The address family to query @arg states Socket states to query @arg result Result pointer @note The caller is responsible for destroying and free the cache after using it . @return 0 on success of a negative error code .
int idiagnl_msg_alloc_cache(struct nl_sock* sk, int family, int states,
                            struct nl_cache** result)
{
    struct nl_cache* cache = NULL;
    int err;
    if (!(cache = nl_cache_alloc(&idiagnl_msg_ops)))
        return -NLE_NOMEM;
    cache->c_iarg1 = family;
    cache->c_iarg2 = states;
    if (sk && (err = nl_cache_refill(sk, cache)) < 0)
    {
        free(cache);
        return err;
    }
    *result = cache;
    return 0;
}
int idiagnl_msg_alloc_cache ( struct nl_sock * sk , int family , int states , struct nl_cache * * result ) { struct nl_cache * cache = NULL ; int err ; if ( ! ( cache = nl_cache_alloc ( & idiagnl_msg_ops ) ) ) return - NLE_NOMEM ; cache -> c_iarg1 = family ; cache -> c_iarg2 = states ; if ( sk && ( err = nl_cache_refill ( sk , cache ) ) < 0 ) { free ( cache ) ; return err ; } * result = cache ; return 0 ; }
Build an inetdiag cache to hold socket state information.
Build an inetdiag cache to hold socket state information .