| 3497 | } |
| 3498 | |
| 3499 | void |
| 3500 | tcp_log_end_status(struct tcpcb *tp, uint8_t status) |
| 3501 | { |
| 3502 | uint32_t bit, i; |
| 3503 | |
| 3504 | if ((tp == NULL) || |
| 3505 | (status > TCP_EI_STATUS_MAX_VALUE) || |
| 3506 | (status == 0)) { |
| 3507 | /* Invalid */ |
| 3508 | return; |
| 3509 | } |
| 3510 | if (status > (sizeof(uint32_t) * 8)) { |
| 3511 | /* Should this be a KASSERT? */ |
| 3512 | return; |
| 3513 | } |
| 3514 | bit = 1U << (status - 1); |
| 3515 | if (bit & tp->t_end_info_status) { |
| 3516 | /* already logged */ |
| 3517 | return; |
| 3518 | } |
| 3519 | for (i = 0; i < TCP_END_BYTE_INFO; i++) { |
| 3520 | if (tp->t_end_info_bytes[i] == TCP_EI_EMPTY_SLOT) { |
| 3521 | tp->t_end_info_bytes[i] = status; |
| 3522 | tp->t_end_info_status |= bit; |
| 3523 | break; |
| 3524 | } |
| 3525 | } |
| 3526 | } |
no outgoing calls
no test coverage detected