Lines Matching +refs:port +refs:id +refs:attrs

87 	return a->port == b->port;  in mptcp_addresses_equal()
93 addr->port = htons(skc->skc_num); in mptcp_local_address()
106 addr->port = skc->skc_dport; in remote_address()
126 if (mptcp_addresses_equal(&cur, saddr, saddr->port)) in lookup_subflow_by_saddr()
144 if (mptcp_addresses_equal(&cur, daddr, daddr->port)) in lookup_subflow_by_daddr()
164 if (!test_bit(entry->addr.id, msk->pm.id_avail_bitmap)) in select_local_address()
186 if (!test_bit(entry->addr.id, msk->pm.id_avail_bitmap)) in select_signal_address()
295 if (!entry->addr.id) in mptcp_pm_add_timer()
306 pr_debug("retransmit ADD_ADDR id=%d", entry->addr.id); in mptcp_pm_add_timer()
334 if (entry && (!check_id || entry->addr.id == addr->id)) in mptcp_pm_del_add_timer()
338 if (entry && (!check_id || entry->addr.id == addr->id)) in mptcp_pm_del_add_timer()
405 if (addrs[i].id == addr->id) in lookup_address_in_vec()
446 addrs[i].id = subflow->remote_id; in fill_remote_addresses_vec()
447 if (deny_id0 && !addrs[i].id) in fill_remote_addresses_vec()
493 __lookup_addr_by_id(struct pm_nl_pernet *pernet, unsigned int id) in __lookup_addr_by_id() argument
498 if (entry->addr.id == id) in __lookup_addr_by_id()
512 mptcp_addresses_equal(&entry->addr, info, entry->addr.port)) || in __lookup_addr()
513 (lookup_by_id && entry->addr.id == info->id)) in __lookup_addr()
545 __clear_bit(entry->addr.id, msk->pm.id_avail_bitmap); in mptcp_pm_create_subflow_or_signal_addr()
546 msk->mpc_endpoint_id = entry->addr.id; in mptcp_pm_create_subflow_or_signal_addr()
578 __clear_bit(local->addr.id, msk->pm.id_avail_bitmap); in mptcp_pm_create_subflow_or_signal_addr()
600 __clear_bit(local->addr.id, msk->pm.id_avail_bitmap); in mptcp_pm_create_subflow_or_signal_addr()
702 if (!remote.port) in mptcp_pm_nl_add_addr_received()
703 remote.port = sk->sk_dport; in mptcp_pm_nl_add_addr_received()
753 if (!mptcp_addresses_equal(&local, addr, addr->port)) in mptcp_pm_nl_mp_prio_send_ack()
758 if (!mptcp_addresses_equal(&remote, rem, rem->port)) in mptcp_pm_nl_mp_prio_send_ack()
769 static bool mptcp_local_id_match(const struct mptcp_sock *msk, u8 local_id, u8 id) in mptcp_local_id_match() argument
771 return local_id == id || (!local_id && msk->mpc_endpoint_id == id); in mptcp_local_id_match()
803 u8 id = subflow->local_id; in mptcp_pm_nl_rm_addr_or_subflow() local
807 if (rm_type == MPTCP_MIB_RMSUBFLOW && !mptcp_local_id_match(msk, id, rm_id)) in mptcp_pm_nl_rm_addr_or_subflow()
920 if (test_bit(entry->addr.id, pernet->id_bitmap)) { in mptcp_pm_nl_append_new_local_addr()
929 entry->addr.port = 0; in mptcp_pm_nl_append_new_local_addr()
932 cur->addr.port || entry->addr.port)) { in mptcp_pm_nl_append_new_local_addr()
941 if (entry->addr.id) in mptcp_pm_nl_append_new_local_addr()
945 entry->addr.id = cur->addr.id; in mptcp_pm_nl_append_new_local_addr()
952 if (!entry->addr.id) { in mptcp_pm_nl_append_new_local_addr()
954 entry->addr.id = find_next_zero_bit(pernet->id_bitmap, in mptcp_pm_nl_append_new_local_addr()
957 if (!entry->addr.id && pernet->next_id != 1) { in mptcp_pm_nl_append_new_local_addr()
963 if (!entry->addr.id) in mptcp_pm_nl_append_new_local_addr()
966 __set_bit(entry->addr.id, pernet->id_bitmap); in mptcp_pm_nl_append_new_local_addr()
967 if (entry->addr.id > pernet->next_id) in mptcp_pm_nl_append_new_local_addr()
968 pernet->next_id = entry->addr.id; in mptcp_pm_nl_append_new_local_addr()
980 if (!entry->addr.port) in mptcp_pm_nl_append_new_local_addr()
984 ret = entry->addr.id; in mptcp_pm_nl_append_new_local_addr()
1070 if (mptcp_addresses_equal(&entry->addr, skc, entry->addr.port)) { in mptcp_pm_nl_get_local_id()
1071 ret = entry->addr.id; in mptcp_pm_nl_get_local_id()
1085 entry->addr.id = 0; in mptcp_pm_nl_get_local_id()
1086 entry->addr.port = 0; in mptcp_pm_nl_get_local_id()
1196 addr->id = nla_get_u8(tb[MPTCP_PM_ADDR_ATTR_ID]); in mptcp_pm_parse_pm_addr_attr()
1232 addr->port = htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT])); in mptcp_pm_parse_pm_addr_attr()
1270 entry->addr.port = htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT])); in mptcp_pm_parse_entry()
1308 struct nlattr *attr = info->attrs[MPTCP_PM_ATTR_ADDR]; in mptcp_nl_cmd_add_addr()
1317 if (addr.addr.port && !(addr.flags & MPTCP_PM_ADDR_FLAG_SIGNAL)) { in mptcp_nl_cmd_add_addr()
1340 if (entry->addr.port) { in mptcp_nl_cmd_add_addr()
1361 int mptcp_pm_nl_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsigned int id, in mptcp_pm_nl_get_flags_and_ifindex_by_id() argument
1369 entry = __lookup_addr_by_id(pm_nl_get_pernet(net), id); in mptcp_pm_nl_get_flags_and_ifindex_by_id()
1401 list.ids[list.nr++] = addr->id; in mptcp_pm_remove_anno_addr()
1420 pr_debug("remove_id=%d", addr->id); in mptcp_nl_remove_subflow_and_signal_addr()
1422 list.ids[list.nr++] = addr->id; in mptcp_nl_remove_subflow_and_signal_addr()
1469 if (!mptcp_addresses_equal(&msk_local, addr, addr->port)) in mptcp_nl_remove_id_zero_address()
1489 struct nlattr *attr = info->attrs[MPTCP_PM_ATTR_ADDR]; in mptcp_nl_cmd_del_addr()
1504 if (addr.addr.id == 0) in mptcp_nl_cmd_del_addr()
1508 entry = __lookup_addr_by_id(pernet, addr.addr.id); in mptcp_nl_cmd_del_addr()
1525 __clear_bit(entry->addr.id, pernet->id_bitmap); in mptcp_nl_cmd_del_addr()
1543 alist.ids[alist.nr++] = entry->addr.id; in mptcp_pm_remove_addrs()
1562 slist.ids[slist.nr++] = entry->addr.id; in mptcp_pm_remove_addrs_and_subflows()
1566 alist.ids[alist.nr++] = entry->addr.id; in mptcp_pm_remove_addrs_and_subflows()
1651 if (nla_put_u16(skb, MPTCP_PM_ADDR_ATTR_PORT, ntohs(addr->port))) in mptcp_nl_fill_addr()
1653 if (nla_put_u8(skb, MPTCP_PM_ADDR_ATTR_ID, addr->id)) in mptcp_nl_fill_addr()
1680 struct nlattr *attr = info->attrs[MPTCP_PM_ATTR_ADDR]; in mptcp_nl_cmd_get_addr()
1704 entry = __lookup_addr_by_id(pernet, addr.addr.id); in mptcp_nl_cmd_get_addr()
1734 int id = cb->args[0]; in mptcp_nl_cmd_dump_addrs() local
1741 for (i = id; i < MPTCP_PM_MAX_ADDR_ID + 1; i++) { in mptcp_nl_cmd_dump_addrs()
1747 if (entry->addr.id <= id) in mptcp_nl_cmd_dump_addrs()
1761 id = entry->addr.id; in mptcp_nl_cmd_dump_addrs()
1767 cb->args[0] = id; in mptcp_nl_cmd_dump_addrs()
1771 static int parse_limit(struct genl_info *info, int id, unsigned int *limit) in parse_limit() argument
1773 struct nlattr *attr = info->attrs[id]; in parse_limit()
1850 list.ids[list.nr++] = addr->id; in mptcp_pm_nl_fullmesh()
1897 if (!addr->addr.id) in mptcp_pm_nl_set_flags()
1926 struct nlattr *attr_rem = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE]; in mptcp_nl_cmd_set_flags()
1927 struct nlattr *token = info->attrs[MPTCP_PM_ATTR_TOKEN]; in mptcp_nl_cmd_set_flags()
1928 struct nlattr *attr = info->attrs[MPTCP_PM_ATTR_ADDR]; in mptcp_nl_cmd_set_flags()
2088 void mptcp_event_addr_removed(const struct mptcp_sock *msk, uint8_t id) in mptcp_event_addr_removed() argument
2108 if (nla_put_u8(skb, MPTCP_ATTR_REM_ID, id)) in mptcp_event_addr_removed()
2143 if (nla_put_u8(skb, MPTCP_ATTR_REM_ID, info->id)) in mptcp_event_addr_announced()
2147 info->port == 0 ? in mptcp_event_addr_announced()
2149 info->port)) in mptcp_event_addr_announced()
2394 .id = &pm_nl_pernet_id,