* Calculate index to the table based on the number and position * of the bytes being inspected in this step. */
| 568 | * of the bytes being inspected in this step. |
| 569 | */ |
| 570 | static uint32_t |
| 571 | get_bitshift(const uint8_t *ip, uint8_t first_byte, uint8_t bytes) |
| 572 | { |
| 573 | uint32_t entry_ind, i; |
| 574 | int8_t bitshift; |
| 575 | |
| 576 | entry_ind = 0; |
| 577 | for (i = first_byte; i < (uint32_t)(first_byte + bytes); i++) { |
| 578 | bitshift = (int8_t)((bytes - i)*BYTE_SIZE); |
| 579 | |
| 580 | if (bitshift < 0) |
| 581 | bitshift = 0; |
| 582 | entry_ind = entry_ind | ip[i-1] << bitshift; |
| 583 | } |
| 584 | |
| 585 | return entry_ind; |
| 586 | } |
| 587 | |
| 588 | /* |
| 589 | * Simulate adding a new route to the LPM counting number |
no outgoing calls
no test coverage detected