prg_ip_address_mask_prefix_length_compute()
Abstract
Returns the number of consecutive left-most ones in the mask value.
Syntax
prg_ip_address_mask_prefix_length_compute (mask_value)
| Argument | Type | Description |
|---|---|---|
mask_value |
unsigned int |
the integral bit mask to be examined |
Return Type
int
The number of consecutive bits that are set to “1”, starting at the left-most bit (the 32nd bit).
Header
prg_ip_address.h
Details
Returns the number of consecutive left-most ones in the mask value. If there are any non-consecutive ones in the mask, this function will return -1.