example/ipsec_crypto/odp_ipsec_misc.h
static inline
char *ipv4_subnet_str(char *b, ip_addr_range_t *range)
{
	int idx;
	int len;

	for (idx = 0; idx < 32; idx++)
		if (range->mask & (1 << idx))
			break;
	len = 32 - idx;

	sprintf(b, "%03d.%03d.%03d.%03d/%d",
		0xFF & ((range->addr) >> 24),
		0xFF & ((range->addr) >> 16),
		0xFF & ((range->addr) >>  8),
		0xFF & ((range->addr) >>  0),
		len);
	return b;
}
/**
 * Generate text string representing IPv4 range/subnet, output
 * in "XXX.XXX.XXX.XXX/W" format
 *
 * @param b     Pointer to buffer to store string
 * @param range Pointer to IPv4 address range
 *
 * @return Pointer to supplied buffer
 */
Generate text string representing IPv4 range/subnet, output
in "XXX.XXX.XXX.XXX/W" format

@param b     Pointer to buffer to store string
@param range Pointer to IPv4 address range

@return Pointer to supplied buffer
Generate text string representing IPv4 range / subnet output in " XXX . XXX . XXX . XXX / W " format @param b Pointer to buffer to store string @param range Pointer to IPv4 address range @return Pointer to supplied buffer
static inline
char *ipv4_subnet_str(char *b, ip_addr_range_t *range)
{
	int idx;
	int len;
	for (idx = 0; idx < 32; idx++)
		if (range->mask & (1 << idx))
			break;
	len = 32 - idx;
	sprintf(b, "%03d.%03d.%03d.%03d/%d",
		0xFF & ((range->addr) >> 24),
		0xFF & ((range->addr) >> 16),
		0xFF & ((range->addr) >>  8),
		0xFF & ((range->addr) >>  0),
		len);
	return b;
}
static inline char * ipv4_subnet_str ( char * b , ip_addr_range_t * range ) { int idx ; int len ; for ( idx = 0 ; idx < 32 ; idx ++ ) if ( range -> mask & ( 1 << idx ) ) break ; len = 32 - idx ; sprintf ( b , " " , 0xFF & ( ( range -> addr ) >> 24 ) , 0xFF & ( ( range -> addr ) >> 16 ) , 0xFF & ( ( range -> addr ) >> 8 ) , 0xFF & ( ( range -> addr ) >> 0 ) , len ) ; return b ; }
Generate text string representing IPv4 range/subnet, output
 in "XXX.XXX.XXX.XXX/W" format
Generate text string representing IPv4 range / subnet output in " XXX . XXX . XXX . XXX / W " format