Lines Matching +full:sub +full:- +full:node

4  * Copyright (c) 2000-2006, 2014-2018, Ericsson AB
5 * Copyright (c) 2004-2008, 2010-2014, Wind River Systems
6 * Copyright (c) 2020-2021, Red Hat Inc
48 #include "node.h"
52 * struct service_range - container for all bindings of a service range
56 * @max: largest 'upper' in this node subtree
57 * @local_publ: list of identical publications made from this node
59 * @all_publ: all publications identical to this one, whatever node and scope
60 * Used by round-robin lookup algorithm
72 * struct tipc_service - container for all published instances of a service type
91 #define service_range_upper(sr) ((sr)->upper)
100 ((sr)->lower <= (end) && (sr)->upper >= (start)) in RB_DECLARE_CALLBACKS_MAX()
103 * service_range_foreach_match - iterate over tipc service rbtree for each in RB_DECLARE_CALLBACKS_MAX()
111 for (sr = service_range_match_first((sc)->ranges.rb_node, \ in RB_DECLARE_CALLBACKS_MAX()
115 sr = service_range_match_next(&(sr)->tree_node, \
120 * service_range_match_first - find first service range matching a range
121 * @n: the root node of service range rbtree for searching
125 * Return: the leftmost service range node in the rbtree that overlaps the
135 if (!n || service_range_entry(n)->max < start)
139 l = n->rb_left;
140 if (l && service_range_entry(l)->max >= start) {
141 /* A leftmost overlap range node must be one in the left
149 /* No one in the left subtree can match, return if this node is
157 r = n->rb_right;
158 if (sr->lower <= end &&
159 r && service_range_entry(r)->max >= start) {
170 * service_range_match_next - find next service range matching a range
171 * @n: a node in service range rbtree from which the searching starts
175 * Return: the next service range node to the given node in the rbtree that
185 r = n->rb_right; in service_range_match_next()
186 if (r && service_range_entry(r)->max >= start) in service_range_match_next()
187 /* A next overlap range node must be one in the right in service_range_match_next()
189 * successor (- an ancestor) of this node cannot in service_range_match_next()
195 * ancestor of this node which is parent of a left-hand child. in service_range_match_next()
197 while ((p = rb_parent(n)) && n == p->rb_right) in service_range_match_next()
208 if (sr->lower <= end) { in service_range_match_next()
220 return x & (TIPC_NAMETBL_SIZE - 1); in hash()
224 * tipc_publ_create - create a publication structure
238 p->sr = ua->sr; in tipc_publ_create()
239 p->sk = *sk; in tipc_publ_create()
240 p->scope = ua->scope; in tipc_publ_create()
241 p->key = key; in tipc_publ_create()
242 INIT_LIST_HEAD(&p->binding_sock); in tipc_publ_create()
243 INIT_LIST_HEAD(&p->binding_node); in tipc_publ_create()
244 INIT_LIST_HEAD(&p->local_publ); in tipc_publ_create()
245 INIT_LIST_HEAD(&p->all_publ); in tipc_publ_create()
246 INIT_LIST_HEAD(&p->list); in tipc_publ_create()
251 * tipc_service_create - create a service structure for the specified 'type'
270 spin_lock_init(&service->lock); in tipc_service_create()
271 service->type = ua->sr.type; in tipc_service_create()
272 service->ranges = RB_ROOT; in tipc_service_create()
273 INIT_HLIST_NODE(&service->service_list); in tipc_service_create()
274 INIT_LIST_HEAD(&service->subscriptions); in tipc_service_create()
275 hd = &nt->services[hash(ua->sr.type)]; in tipc_service_create()
276 hlist_add_head_rcu(&service->service_list, hd); in tipc_service_create()
280 /* tipc_service_find_range - find service range matching publication parameters
287 service_range_foreach_match(sr, sc, ua->sr.lower, ua->sr.upper) { in tipc_service_find_range()
289 if (sr->lower == ua->sr.lower && sr->upper == ua->sr.upper) in tipc_service_find_range()
301 u32 lower = p->sr.lower; in tipc_service_create_range()
302 u32 upper = p->sr.upper; in tipc_service_create_range()
304 n = &sc->ranges.rb_node; in tipc_service_create_range()
308 if (lower == sr->lower && upper == sr->upper) in tipc_service_create_range()
310 if (sr->max < upper) in tipc_service_create_range()
311 sr->max = upper; in tipc_service_create_range()
312 if (lower <= sr->lower) in tipc_service_create_range()
313 n = &parent->rb_left; in tipc_service_create_range()
315 n = &parent->rb_right; in tipc_service_create_range()
320 sr->lower = lower; in tipc_service_create_range()
321 sr->upper = upper; in tipc_service_create_range()
322 sr->max = upper; in tipc_service_create_range()
323 INIT_LIST_HEAD(&sr->local_publ); in tipc_service_create_range()
324 INIT_LIST_HEAD(&sr->all_publ); in tipc_service_create_range()
325 rb_link_node(&sr->tree_node, parent, n); in tipc_service_create_range()
326 rb_insert_augmented(&sr->tree_node, &sc->ranges, &sr_callbacks); in tipc_service_create_range()
334 struct tipc_subscription *sub, *tmp; in tipc_service_insert_publ() local
337 u32 node = p->sk.node; in tipc_service_insert_publ() local
340 u32 key = p->key; in tipc_service_insert_publ()
342 spin_lock_bh(&sc->lock); in tipc_service_insert_publ()
347 first = list_empty(&sr->all_publ); in tipc_service_insert_publ()
350 list_for_each_entry(_p, &sr->all_publ, all_publ) { in tipc_service_insert_publ()
351 if (_p->key == key && _p->sk.ref == p->sk.ref && in tipc_service_insert_publ()
352 (!_p->sk.node || _p->sk.node == node)) { in tipc_service_insert_publ()
354 p->sr.type, p->sr.lower, p->sr.upper, in tipc_service_insert_publ()
355 node, p->sk.ref, key); in tipc_service_insert_publ()
360 if (in_own_node(net, p->sk.node)) in tipc_service_insert_publ()
361 list_add(&p->local_publ, &sr->local_publ); in tipc_service_insert_publ()
362 list_add(&p->all_publ, &sr->all_publ); in tipc_service_insert_publ()
363 p->id = sc->publ_cnt++; in tipc_service_insert_publ()
366 list_for_each_entry_safe(sub, tmp, &sc->subscriptions, service_list) { in tipc_service_insert_publ()
367 tipc_sub_report_overlap(sub, p, TIPC_PUBLISHED, first); in tipc_service_insert_publ()
373 p->sr.type, p->sr.lower, p->sr.upper); in tipc_service_insert_publ()
374 spin_unlock_bh(&sc->lock); in tipc_service_insert_publ()
379 * tipc_service_remove_publ - remove a publication from a service
389 u32 node = sk->node; in tipc_service_remove_publ() local
391 list_for_each_entry(p, &r->all_publ, all_publ) { in tipc_service_remove_publ()
392 if (p->key != key || p->sk.ref != sk->ref || in tipc_service_remove_publ()
393 (node && node != p->sk.node)) in tipc_service_remove_publ()
395 list_del(&p->all_publ); in tipc_service_remove_publ()
396 list_del(&p->local_publ); in tipc_service_remove_publ()
405 #define publication_after(pa, pb) time_after32((pa)->id, (pb)->id)
417 * tipc_service_subscribe - attach a subscription, and optionally
420 * @service: the tipc_service to attach the @sub to
421 * @sub: the subscription to attach
424 struct tipc_subscription *sub) in tipc_service_subscribe() argument
431 filter = sub->s.filter; in tipc_service_subscribe()
432 lower = sub->s.seq.lower; in tipc_service_subscribe()
433 upper = sub->s.seq.upper; in tipc_service_subscribe()
435 tipc_sub_get(sub); in tipc_service_subscribe()
436 list_add(&sub->service_list, &service->subscriptions); in tipc_service_subscribe()
444 list_for_each_entry(p, &sr->all_publ, all_publ) { in tipc_service_subscribe()
446 list_add_tail(&p->list, &publ_list); in tipc_service_subscribe()
452 list_add_tail(&first->list, &publ_list); in tipc_service_subscribe()
458 tipc_sub_report_overlap(sub, p, TIPC_PUBLISHED, true); in tipc_service_subscribe()
459 list_del_init(&p->list); in tipc_service_subscribe()
470 service_head = &nt->services[hash(ua->sr.type)]; in tipc_service_find()
472 if (service->type == ua->sr.type) in tipc_service_find()
504 struct tipc_subscription *sub, *tmp; in tipc_nametbl_remove_publ() local
514 spin_lock_bh(&sc->lock); in tipc_nametbl_remove_publ()
523 last = list_empty(&sr->all_publ); in tipc_nametbl_remove_publ()
524 list_for_each_entry_safe(sub, tmp, &sc->subscriptions, service_list) { in tipc_nametbl_remove_publ()
525 tipc_sub_report_overlap(sub, p, TIPC_WITHDRAWN, last); in tipc_nametbl_remove_publ()
529 if (list_empty(&sr->all_publ)) { in tipc_nametbl_remove_publ()
530 rb_erase_augmented(&sr->tree_node, &sc->ranges, &sr_callbacks); in tipc_nametbl_remove_publ()
535 if (RB_EMPTY_ROOT(&sc->ranges) && list_empty(&sc->subscriptions)) { in tipc_nametbl_remove_publ()
536 hlist_del_init_rcu(&sc->service_list); in tipc_nametbl_remove_publ()
540 spin_unlock_bh(&sc->lock); in tipc_nametbl_remove_publ()
544 ua->sr.type, ua->sr.lower, ua->sr.upper, in tipc_nametbl_remove_publ()
545 sk->node, sk->ref, key); in tipc_nametbl_remove_publ()
551 * tipc_nametbl_lookup_anycast - perform service instance to socket translation
556 * On entry, a non-zero 'sk->node' indicates the node where we want lookup to be
561 * - If lookup is deferred to another node, leave 'sk->node' unchanged and
563 * - If lookup is successful, set the 'sk->node' and 'sk->ref' (== portid) which
565 * - If lookup fails, return 'false'
567 * Note that for legacy users (node configured with Z.C.N address format) the
568 * 'closest-first' lookup algorithm must be maintained, i.e., if sk.node is 0
576 bool legacy = tn->legacy_addr_format; in tipc_nametbl_lookup_anycast()
578 u32 inst = ua->sa.instance; in tipc_nametbl_lookup_anycast()
585 if (!tipc_in_scope(legacy, sk->node, self)) in tipc_nametbl_lookup_anycast()
593 spin_lock_bh(&sc->lock); in tipc_nametbl_lookup_anycast()
595 /* Select lookup algo: local, closest-first or round-robin */ in tipc_nametbl_lookup_anycast()
596 if (sk->node == self) { in tipc_nametbl_lookup_anycast()
597 l = &r->local_publ; in tipc_nametbl_lookup_anycast()
601 list_move_tail(&p->local_publ, &r->local_publ); in tipc_nametbl_lookup_anycast()
602 } else if (legacy && !sk->node && !list_empty(&r->local_publ)) { in tipc_nametbl_lookup_anycast()
603 l = &r->local_publ; in tipc_nametbl_lookup_anycast()
605 list_move_tail(&p->local_publ, &r->local_publ); in tipc_nametbl_lookup_anycast()
607 l = &r->all_publ; in tipc_nametbl_lookup_anycast()
609 list_move_tail(&p->all_publ, &r->all_publ); in tipc_nametbl_lookup_anycast()
611 *sk = p->sk; in tipc_nametbl_lookup_anycast()
614 * "true" round-robin will be performed as needed. in tipc_nametbl_lookup_anycast()
618 spin_unlock_bh(&sc->lock); in tipc_nametbl_lookup_anycast()
627 * destination socket/node pairs matching the given address.
635 u32 inst = ua->sa.instance; in tipc_nametbl_lookup_group()
646 spin_lock_bh(&sc->lock); in tipc_nametbl_lookup_group()
649 sr = service_range_match_first(sc->ranges.rb_node, inst, inst); in tipc_nametbl_lookup_group()
653 list_for_each_entry(p, &sr->all_publ, all_publ) { in tipc_nametbl_lookup_group()
654 if (p->scope != ua->scope) in tipc_nametbl_lookup_group()
656 if (p->sk.ref == exclude && p->sk.node == self) in tipc_nametbl_lookup_group()
658 tipc_dest_push(dsts, p->sk.node, p->sk.ref); in tipc_nametbl_lookup_group()
662 list_move_tail(&p->all_publ, &sr->all_publ); in tipc_nametbl_lookup_group()
666 spin_unlock_bh(&sc->lock); in tipc_nametbl_lookup_group()
672 /* tipc_nametbl_lookup_mcast_sockets(): look up node local destinaton sockets
683 u8 scope = ua->scope; in tipc_nametbl_lookup_mcast_sockets()
690 spin_lock_bh(&sc->lock); in tipc_nametbl_lookup_mcast_sockets()
691 service_range_foreach_match(sr, sc, ua->sr.lower, ua->sr.upper) { in tipc_nametbl_lookup_mcast_sockets()
692 list_for_each_entry(p, &sr->local_publ, local_publ) { in tipc_nametbl_lookup_mcast_sockets()
693 if (scope == p->scope || scope == TIPC_ANY_SCOPE) in tipc_nametbl_lookup_mcast_sockets()
694 tipc_dest_push(dports, 0, p->sk.ref); in tipc_nametbl_lookup_mcast_sockets()
697 spin_unlock_bh(&sc->lock); in tipc_nametbl_lookup_mcast_sockets()
703 * the given address. Used in sending node.
705 * Returns a list of nodes, including own node if applicable
719 spin_lock_bh(&sc->lock); in tipc_nametbl_lookup_mcast_nodes()
720 service_range_foreach_match(sr, sc, ua->sr.lower, ua->sr.upper) { in tipc_nametbl_lookup_mcast_nodes()
721 list_for_each_entry(p, &sr->all_publ, all_publ) { in tipc_nametbl_lookup_mcast_nodes()
722 tipc_nlist_add(nodes, p->sk.node); in tipc_nametbl_lookup_mcast_nodes()
725 spin_unlock_bh(&sc->lock); in tipc_nametbl_lookup_mcast_nodes()
730 /* tipc_nametbl_build_group - build list of communication group members
745 spin_lock_bh(&sc->lock); in tipc_nametbl_build_group()
746 for (n = rb_first(&sc->ranges); n; n = rb_next(n)) { in tipc_nametbl_build_group()
748 list_for_each_entry(p, &sr->all_publ, all_publ) { in tipc_nametbl_build_group()
749 if (p->scope != ua->scope) in tipc_nametbl_build_group()
751 tipc_group_add_member(grp, p->sk.node, p->sk.ref, in tipc_nametbl_build_group()
752 p->sr.lower); in tipc_nametbl_build_group()
755 spin_unlock_bh(&sc->lock); in tipc_nametbl_build_group()
760 /* tipc_nametbl_publish - add service binding to name table
771 spin_lock_bh(&tn->nametbl_lock); in tipc_nametbl_publish()
773 if (nt->local_publ_count >= TIPC_MAX_PUBL) { in tipc_nametbl_publish()
780 nt->local_publ_count++; in tipc_nametbl_publish()
783 rc_dests = nt->rc_dests; in tipc_nametbl_publish()
785 spin_unlock_bh(&tn->nametbl_lock); in tipc_nametbl_publish()
794 * tipc_nametbl_withdraw - withdraw a service binding
809 spin_lock_bh(&tn->nametbl_lock); in tipc_nametbl_withdraw()
813 nt->local_publ_count--; in tipc_nametbl_withdraw()
815 list_del_init(&p->binding_sock); in tipc_nametbl_withdraw()
818 rc_dests = nt->rc_dests; in tipc_nametbl_withdraw()
819 spin_unlock_bh(&tn->nametbl_lock); in tipc_nametbl_withdraw()
826 * tipc_nametbl_subscribe - add a subscription object to the name table
827 * @sub: subscription to add
829 bool tipc_nametbl_subscribe(struct tipc_subscription *sub) in tipc_nametbl_subscribe() argument
831 struct tipc_net *tn = tipc_net(sub->net); in tipc_nametbl_subscribe()
832 u32 type = sub->s.seq.type; in tipc_nametbl_subscribe()
838 sub->s.seq.lower, sub->s.seq.upper); in tipc_nametbl_subscribe()
839 spin_lock_bh(&tn->nametbl_lock); in tipc_nametbl_subscribe()
840 sc = tipc_service_find(sub->net, &ua); in tipc_nametbl_subscribe()
842 sc = tipc_service_create(sub->net, &ua); in tipc_nametbl_subscribe()
844 spin_lock_bh(&sc->lock); in tipc_nametbl_subscribe()
845 tipc_service_subscribe(sc, sub); in tipc_nametbl_subscribe()
846 spin_unlock_bh(&sc->lock); in tipc_nametbl_subscribe()
849 type, sub->s.seq.lower, sub->s.seq.upper); in tipc_nametbl_subscribe()
852 spin_unlock_bh(&tn->nametbl_lock); in tipc_nametbl_subscribe()
857 * tipc_nametbl_unsubscribe - remove a subscription object from name table
858 * @sub: subscription to remove
860 void tipc_nametbl_unsubscribe(struct tipc_subscription *sub) in tipc_nametbl_unsubscribe() argument
862 struct tipc_net *tn = tipc_net(sub->net); in tipc_nametbl_unsubscribe()
867 sub->s.seq.type, sub->s.seq.lower, sub->s.seq.upper); in tipc_nametbl_unsubscribe()
868 spin_lock_bh(&tn->nametbl_lock); in tipc_nametbl_unsubscribe()
869 sc = tipc_service_find(sub->net, &ua); in tipc_nametbl_unsubscribe()
873 spin_lock_bh(&sc->lock); in tipc_nametbl_unsubscribe()
874 list_del_init(&sub->service_list); in tipc_nametbl_unsubscribe()
875 tipc_sub_put(sub); in tipc_nametbl_unsubscribe()
878 if (RB_EMPTY_ROOT(&sc->ranges) && list_empty(&sc->subscriptions)) { in tipc_nametbl_unsubscribe()
879 hlist_del_init_rcu(&sc->service_list); in tipc_nametbl_unsubscribe()
882 spin_unlock_bh(&sc->lock); in tipc_nametbl_unsubscribe()
884 spin_unlock_bh(&tn->nametbl_lock); in tipc_nametbl_unsubscribe()
895 return -ENOMEM; in tipc_nametbl_init()
898 INIT_HLIST_HEAD(&nt->services[i]); in tipc_nametbl_init()
900 INIT_LIST_HEAD(&nt->node_scope); in tipc_nametbl_init()
901 INIT_LIST_HEAD(&nt->cluster_scope); in tipc_nametbl_init()
902 rwlock_init(&nt->cluster_scope_lock); in tipc_nametbl_init()
903 tn->nametbl = nt; in tipc_nametbl_init()
904 spin_lock_init(&tn->nametbl_lock); in tipc_nametbl_init()
909 * tipc_service_delete - purge all publications for a service and delete it
918 spin_lock_bh(&sc->lock); in tipc_service_delete()
919 rbtree_postorder_for_each_entry_safe(sr, tmpr, &sc->ranges, tree_node) { in tipc_service_delete()
920 list_for_each_entry_safe(p, tmp, &sr->all_publ, all_publ) { in tipc_service_delete()
921 tipc_service_remove_publ(sr, &p->sk, p->key); in tipc_service_delete()
924 rb_erase_augmented(&sr->tree_node, &sc->ranges, &sr_callbacks); in tipc_service_delete()
927 hlist_del_init_rcu(&sc->service_list); in tipc_service_delete()
928 spin_unlock_bh(&sc->lock); in tipc_service_delete()
943 spin_lock_bh(&tn->nametbl_lock); in tipc_nametbl_stop()
945 if (hlist_empty(&nt->services[i])) in tipc_nametbl_stop()
947 service_head = &nt->services[i]; in tipc_nametbl_stop()
952 spin_unlock_bh(&tn->nametbl_lock); in tipc_nametbl_stop()
954 /* TODO: clear tn->nametbl, implement proper RCU rules ? */ in tipc_nametbl_stop()
969 list_for_each_entry(p, &sr->all_publ, all_publ) in __tipc_nl_add_nametable_publ()
970 if (p->key == *last_key) in __tipc_nl_add_nametable_publ()
972 if (list_entry_is_head(p, &sr->all_publ, all_publ)) in __tipc_nl_add_nametable_publ()
973 return -EPIPE; in __tipc_nl_add_nametable_publ()
975 p = list_first_entry(&sr->all_publ, in __tipc_nl_add_nametable_publ()
980 list_for_each_entry_from(p, &sr->all_publ, all_publ) { in __tipc_nl_add_nametable_publ()
981 *last_key = p->key; in __tipc_nl_add_nametable_publ()
983 hdr = genlmsg_put(msg->skb, msg->portid, msg->seq, in __tipc_nl_add_nametable_publ()
987 return -EMSGSIZE; in __tipc_nl_add_nametable_publ()
989 attrs = nla_nest_start_noflag(msg->skb, TIPC_NLA_NAME_TABLE); in __tipc_nl_add_nametable_publ()
993 b = nla_nest_start_noflag(msg->skb, TIPC_NLA_NAME_TABLE_PUBL); in __tipc_nl_add_nametable_publ()
997 if (nla_put_u32(msg->skb, TIPC_NLA_PUBL_TYPE, service->type)) in __tipc_nl_add_nametable_publ()
999 if (nla_put_u32(msg->skb, TIPC_NLA_PUBL_LOWER, sr->lower)) in __tipc_nl_add_nametable_publ()
1001 if (nla_put_u32(msg->skb, TIPC_NLA_PUBL_UPPER, sr->upper)) in __tipc_nl_add_nametable_publ()
1003 if (nla_put_u32(msg->skb, TIPC_NLA_PUBL_SCOPE, p->scope)) in __tipc_nl_add_nametable_publ()
1005 if (nla_put_u32(msg->skb, TIPC_NLA_PUBL_NODE, p->sk.node)) in __tipc_nl_add_nametable_publ()
1007 if (nla_put_u32(msg->skb, TIPC_NLA_PUBL_REF, p->sk.ref)) in __tipc_nl_add_nametable_publ()
1009 if (nla_put_u32(msg->skb, TIPC_NLA_PUBL_KEY, p->key)) in __tipc_nl_add_nametable_publ()
1012 nla_nest_end(msg->skb, b); in __tipc_nl_add_nametable_publ()
1013 nla_nest_end(msg->skb, attrs); in __tipc_nl_add_nametable_publ()
1014 genlmsg_end(msg->skb, hdr); in __tipc_nl_add_nametable_publ()
1021 nla_nest_cancel(msg->skb, b); in __tipc_nl_add_nametable_publ()
1023 nla_nest_cancel(msg->skb, attrs); in __tipc_nl_add_nametable_publ()
1025 genlmsg_cancel(msg->skb, hdr); in __tipc_nl_add_nametable_publ()
1027 return -EMSGSIZE; in __tipc_nl_add_nametable_publ()
1038 for (n = rb_first(&sc->ranges); n; n = rb_next(n)) { in __tipc_nl_service_range_list()
1040 if (sr->lower < *last_lower) in __tipc_nl_service_range_list()
1044 *last_lower = sr->lower; in __tipc_nl_service_range_list()
1068 head = &tn->nametbl->services[i]; in tipc_nl_service_list()
1076 return -EPIPE; in tipc_nl_service_list()
1085 spin_lock_bh(&service->lock); in tipc_nl_service_list()
1091 *last_type = service->type; in tipc_nl_service_list()
1092 spin_unlock_bh(&service->lock); in tipc_nl_service_list()
1095 spin_unlock_bh(&service->lock); in tipc_nl_service_list()
1104 struct net *net = sock_net(skb->sk); in tipc_nl_name_table_dump()
1105 u32 last_type = cb->args[0]; in tipc_nl_name_table_dump()
1106 u32 last_lower = cb->args[1]; in tipc_nl_name_table_dump()
1107 u32 last_key = cb->args[2]; in tipc_nl_name_table_dump()
1108 int done = cb->args[3]; in tipc_nl_name_table_dump()
1116 msg.portid = NETLINK_CB(cb->skb).portid; in tipc_nl_name_table_dump()
1117 msg.seq = cb->nlh->nlmsg_seq; in tipc_nl_name_table_dump()
1124 } else if (err != -EMSGSIZE) { in tipc_nl_name_table_dump()
1131 cb->prev_seq = 1; in tipc_nl_name_table_dump()
1135 cb->args[0] = last_type; in tipc_nl_name_table_dump()
1136 cb->args[1] = last_lower; in tipc_nl_name_table_dump()
1137 cb->args[2] = last_key; in tipc_nl_name_table_dump()
1138 cb->args[3] = done; in tipc_nl_name_table_dump()
1140 return skb->len; in tipc_nl_name_table_dump()
1143 struct tipc_dest *tipc_dest_find(struct list_head *l, u32 node, u32 port) in tipc_dest_find() argument
1148 if (dst->node == node && dst->port == port) in tipc_dest_find()
1154 bool tipc_dest_push(struct list_head *l, u32 node, u32 port) in tipc_dest_push() argument
1158 if (tipc_dest_find(l, node, port)) in tipc_dest_push()
1164 dst->node = node; in tipc_dest_push()
1165 dst->port = port; in tipc_dest_push()
1166 list_add(&dst->list, l); in tipc_dest_push()
1170 bool tipc_dest_pop(struct list_head *l, u32 *node, u32 *port) in tipc_dest_pop() argument
1178 *port = dst->port; in tipc_dest_pop()
1179 if (node) in tipc_dest_pop()
1180 *node = dst->node; in tipc_dest_pop()
1181 list_del(&dst->list); in tipc_dest_pop()
1186 bool tipc_dest_del(struct list_head *l, u32 node, u32 port) in tipc_dest_del() argument
1190 dst = tipc_dest_find(l, node, port); in tipc_dest_del()
1193 list_del(&dst->list); in tipc_dest_del()
1203 list_del(&dst->list); in tipc_dest_list_purge()