lib/vlan-bitmap.c
/* Allocates and returns a new 4096-bit bitmap that has 1-bit in positions in
 * the 'n_vlans' bits indicated in 'vlans' and 0-bits everywhere else.  Returns
 * a null pointer if there are no (valid) VLANs in 'vlans'. */
Allocates and returns a new 4096-bit bitmap that has 1-bit in positions in
the 'n_vlans' bits indicated in 'vlans' and 0-bits everywhere else.  Returns
a null pointer if there are no (valid) VLANs in 'vlans'.
Allocates and returns a new 4096 - bit bitmap that has 1 - bit in positions in the ' n_vlans ' bits indicated in ' vlans ' and 0 - bits everywhere else . Returns a null pointer if there are no ( valid ) VLANs in ' vlans ' .
unsigned long *
vlan_bitmap_from_array(const int64_t *vlans, size_t n_vlans)
{
    unsigned long *b;
    if (!n_vlans) {
        return NULL;
    }
    b = bitmap_allocate(4096);
    if (!vlan_bitmap_from_array__(vlans, n_vlans, b)) {
        free(b);
        return NULL;
    }
    return b;
}
unsigned long * vlan_bitmap_from_array ( const int64_t * vlans , size_t n_vlans ) { unsigned long * b ; if ( ! n_vlans ) { return NULL ; } b = bitmap_allocate ( 4096 ) ; if ( ! vlan_bitmap_from_array__ ( vlans , n_vlans , b ) ) { free ( b ) ; return NULL ; } return b ; }
Allocates and returns a new 4096-bit bitmap that has 1-bit in positions in
 the 'n_vlans' bits indicated in 'vlans' and 0-bits everywhere else.
Allocates and returns a new 4096 - bit bitmap that has 1 - bit in positions in the ' n_vlans ' bits indicated in ' vlans ' and 0 - bits everywhere else .