Lines Matching refs:ctl_unit
253 flow_divert_group_lookup(uint32_t ctl_unit, struct flow_divert_pcb *fd_cb) in flow_divert_group_lookup() argument
261 …} else if (ctl_unit == 0 || (ctl_unit >= GROUP_COUNT_MAX && ctl_unit < FLOW_DIVERT_IN_PROCESS_UNIT… in flow_divert_group_lookup()
262 FDLOG(LOG_ERR, fd_cb, "Cannot lookup group with invalid control unit (%u)", ctl_unit); in flow_divert_group_lookup()
263 } else if (ctl_unit < FLOW_DIVERT_IN_PROCESS_UNIT_MIN) { in flow_divert_group_lookup()
269 group = g_flow_divert_groups[ctl_unit]; in flow_divert_group_lookup()
272 … fd_cb, "Group for control unit %u is NULL, flow divert cannot be used for this socket", ctl_unit); in flow_divert_group_lookup()
286 if (group_cursor->ctl_unit == ctl_unit) { in flow_divert_group_lookup()
293 …d_cb, "Group for control unit %u not found, flow divert cannot be used for this socket", ctl_unit); in flow_divert_group_lookup()
299 ctl_unit, group_cursor->in_process_pid, fd_cb->so ? fd_cb->so->last_pid : 0); in flow_divert_group_lookup()
318 fd_cb->control_group_unit = group->ctl_unit; in flow_divert_pcb_insert()
321 …FDLOG(LOG_ERR, fd_cb, "Group %u already contains a PCB with hash %u", group->ctl_unit, fd_cb->hash… in flow_divert_pcb_insert()
325 FDLOG(LOG_ERR, fd_cb, "Group %u is defunct, cannot insert", group->ctl_unit); in flow_divert_pcb_insert()
333 flow_divert_add_to_group(struct flow_divert_pcb *fd_cb, uint32_t ctl_unit) in flow_divert_add_to_group() argument
341 group = flow_divert_group_lookup(ctl_unit, fd_cb); in flow_divert_add_to_group()
361 if (idx == ctl_unit) { in flow_divert_add_to_group()
431 …FDLOG(LOG_INFO, fd_cb, "Removing from group %d, ref count = %d", group->ctl_unit, fd_cb->ref_count… in flow_divert_pcb_remove()
595 flow_divert_packet_verify_hmac(mbuf_ref_t packet, uint32_t ctl_unit) in flow_divert_packet_verify_hmac() argument
604 group = flow_divert_group_lookup(ctl_unit, NULL); in flow_divert_packet_verify_hmac()
606 FDLOG(LOG_ERR, &nil_pcb, "Failed to lookup group for control unit %u", ctl_unit); in flow_divert_packet_verify_hmac()
1227 error = ctl_enqueuembuf(g_flow_divert_kctl_ref, fd_cb->group->ctl_unit, packet, CTL_DATA_EOR); in flow_divert_send_packet()
2083 flow_divert_derive_kernel_control_unit(pid_t pid, uint32_t *ctl_unit, uint32_t *aggregate_unit, boo… in flow_divert_derive_kernel_control_unit() argument
2085 uint32_t result = *ctl_unit; in flow_divert_derive_kernel_control_unit()
2097 if (*ctl_unit == FLOW_DIVERT_IN_PROCESS_UNIT) { in flow_divert_derive_kernel_control_unit()
2106 result = group->ctl_unit; in flow_divert_derive_kernel_control_unit()
2123 *ctl_unit = 0; in flow_divert_derive_kernel_control_unit()
2129 *ctl_unit = 0; in flow_divert_derive_kernel_control_unit()
2152 *aggregate_unit &= ~(1 << (lower_order_group->ctl_unit - 1)); in flow_divert_derive_kernel_control_unit()
2154 return lower_order_group->ctl_unit; in flow_divert_derive_kernel_control_unit()
2156 *ctl_unit = 0; in flow_divert_derive_kernel_control_unit()
2160 *ctl_unit = 0; in flow_divert_derive_kernel_control_unit()
2495 uint32_t ctl_unit = 0; in flow_divert_handle_connect_result() local
2524 …divert_packet_get_tlv(packet, offset, FLOW_DIVERT_TLV_CTL_UNIT, sizeof(ctl_unit), &ctl_unit, NULL); in flow_divert_handle_connect_result()
2631 ctl_unit = ntohl(ctl_unit); in flow_divert_handle_connect_result()
2632 if (ctl_unit > 0) { in flow_divert_handle_connect_result()
2636 if (ctl_unit >= GROUP_COUNT_MAX) { in flow_divert_handle_connect_result()
2637 FDLOG(LOG_ERR, fd_cb, "Connect result contains an invalid control unit: %u", ctl_unit); in flow_divert_handle_connect_result()
2642 grp = flow_divert_group_lookup(ctl_unit, fd_cb); in flow_divert_handle_connect_result()
2947 FDLOG(LOG_ERR, &nil_pcb, "Skipping (re)initialization of defunct group %u", group->ctl_unit); in flow_divert_handle_group_init()
2973 FDLOG(LOG_INFO, &nil_pcb, "group %u order is %u", group->ctl_unit, order); in flow_divert_handle_group_init()
3208 uint32_t ctl_unit = 0; in flow_divert_handle_flow_states_request() local
3224 ctl_unit = group->ctl_unit; in flow_divert_handle_flow_states_request()
3258 error = ctl_enqueuembuf(g_flow_divert_kctl_ref, ctl_unit, packet, CTL_DATA_EOR); in flow_divert_handle_flow_states_request()
3308 …r an unknown pcb: %u", flow_divert_packet_type2str(hdr.packet_type), group->ctl_unit, hdr.conn_id); in flow_divert_input()
4144 flow_divert_pcb_init_internal(struct socket *so, uint32_t ctl_unit, uint32_t aggregate_unit) in flow_divert_pcb_init_internal() argument
4149 uint32_t policy_control_unit = ctl_unit; in flow_divert_pcb_init_internal()
4174 fd_cb->policy_control_unit = ctl_unit; in flow_divert_pcb_init_internal()
4206 uint32_t ctl_unit = necp_socket_get_flow_divert_control_unit(inp, &aggregate_units); in flow_divert_pcb_init() local
4207 return flow_divert_pcb_init_internal(so, ctl_unit, aggregate_units); in flow_divert_pcb_init()
4213 uint32_t ctl_unit = 0; in flow_divert_token_set() local
4271 …vert_packet_get_tlv(token, 0, FLOW_DIVERT_TLV_CTL_UNIT, sizeof(ctl_unit), (void *)&ctl_unit, NULL); in flow_divert_token_set()
4284 ctl_unit = ntohl(ctl_unit); in flow_divert_token_set()
4287 if (ctl_unit > 0 && ctl_unit < GROUP_COUNT_MAX) { in flow_divert_token_set()
4288 hmac_error = flow_divert_packet_verify_hmac(token, (key_unit != 0 ? key_unit : ctl_unit)); in flow_divert_token_set()
4296 error = flow_divert_pcb_init_internal(so, ctl_unit, aggregate_unit); in flow_divert_token_set()
4331 uint32_t ctl_unit; in flow_divert_token_get() local
4354 ctl_unit = htonl(fd_cb->group->ctl_unit); in flow_divert_token_get()
4356 …error = flow_divert_packet_append_tlv(token, FLOW_DIVERT_TLV_CTL_UNIT, sizeof(ctl_unit), &ctl_unit… in flow_divert_token_get()
4376 ctl_unit = htonl(control_group->ctl_unit); in flow_divert_token_get()
4377 …rror = flow_divert_packet_append_tlv(token, FLOW_DIVERT_TLV_KEY_UNIT, sizeof(ctl_unit), &ctl_unit); in flow_divert_token_get()
4421 FDLOG(LOG_NOTICE, &nil_pcb, "Destroying group %u", group->ctl_unit); in flow_divert_group_destroy()
4447 new_group->ctl_unit = unit; in flow_divert_allocate_group()
4471 if (group_next->ctl_unit > unit_cursor) { in flow_divert_kctl_setup()
4475 unit_cursor = group_next->ctl_unit + 1; in flow_divert_kctl_setup()
4537 if (group == NULL || sac->sc_unit != group->ctl_unit) { in flow_divert_kctl_connect()
4539 sac->sc_unit, group ? group->ctl_unit : 0); in flow_divert_kctl_connect()
4643 int error = ctl_enqueuembuf(g_flow_divert_kctl_ref, group->ctl_unit, next_packet, CTL_DATA_EOR); in flow_divert_kctl_rcvd()