Exemplo n.º 1
0
/*
 ***************************************************************************
 * Find number of interfaces (network devices) that are in /proc/net/dev
 * file.
 *
 * IN:
 * @a	Activity structure.
 *
 * RETURNS:
 * Number of network interfaces + a pre-allocation constant.
 ***************************************************************************
 */
__nr_t wrap_get_iface_nr(struct activity *a)
{
	__nr_t n = 0;

	if ((n = get_iface_nr()) > 0)
		return n + NR_IFACE_PREALLOC;

	return 0;
}
Exemplo n.º 2
0
/*
 ***************************************************************************
 * Find number of interfaces (network devices) that are in /proc/net/dev
 * file.
 *
 * IN:
 * @a	Activity structure.
 *
 * RETURNS:
 * Number of network interfaces + a pre-allocation constant. Number cannot
 * exceed MAX_NR_IFACES.
 ***************************************************************************
 */
__nr_t wrap_get_iface_nr(struct activity *a)
{
	__nr_t n = 0;

	if ((n = get_iface_nr()) > 0) {
		if ((n + NR_IFACE_PREALLOC) > MAX_NR_IFACES)
			return MAX_NR_IFACES;
		else
			return n + NR_IFACE_PREALLOC;
	}

	return 0;
}