@@ -544,24 +544,26 @@ struct publication *tipc_nametbl_remove_publ(struct net *net,
544544}
545545
546546/**
547- * tipc_nametbl_translate - perform service instance to socket translation
547+ * tipc_nametbl_lookup_anycast - perform service instance to socket translation
548548 * @net: network namespace
549549 * @type: message type
550550 * @instance: message instance
551551 * @dnode: the search domain used during translation
552552 *
553+ * On entry, 'dnode' is the search domain used during the lookup
554+ *
553555 * On exit:
554- * - if translation is deferred to another node, leave 'dnode' unchanged and
555- * return 0
556- * - if translation is attempted and succeeds, set 'dnode' to the publishing
557- * node and return the published (non-zero) port number
558- * - if translation is attempted and fails, set 'dnode' to 0 and return 0
556+ * - if lookup is deferred to another node, leave 'dnode' unchanged and return 0
557+ * - if lookup is attempted and succeeds, set 'dnode' to the publishing node and
558+ * return the published (non-zero) port number
559+ * - if lookup is attempted and fails, set 'dnode' to 0 and return 0
559560 *
560561 * Note that for legacy users (node configured with Z.C.N address format) the
561562 * 'closest-first' lookup algorithm must be maintained, i.e., if dnode is 0
562563 * we must look in the local binding list first
563564 */
564- u32 tipc_nametbl_translate (struct net * net , u32 type , u32 instance , u32 * dnode )
565+ u32 tipc_nametbl_lookup_anycast (struct net * net , u32 type ,
566+ u32 instance , u32 * dnode )
565567{
566568 struct tipc_net * tn = tipc_net (net );
567569 bool legacy = tn -> legacy_addr_format ;
@@ -617,9 +619,15 @@ u32 tipc_nametbl_translate(struct net *net, u32 type, u32 instance, u32 *dnode)
617619 return port ;
618620}
619621
620- bool tipc_nametbl_lookup (struct net * net , u32 type , u32 instance , u32 scope ,
621- struct list_head * dsts , int * dstcnt , u32 exclude ,
622- bool all )
622+ /* tipc_nametbl_lookup_group(): lookup destinaton(s) in a communication group
623+ * Returns a list of one (== group anycast) or more (== group multicast)
624+ * destination socket/node pairs matching the given address.
625+ * The requester may or may not want to exclude himself from the list.
626+ */
627+ bool tipc_nametbl_lookup_group (struct net * net , u32 type , u32 instance ,
628+ u32 scope , struct list_head * dsts ,
629+ int * dstcnt , u32 exclude ,
630+ bool mcast )
623631{
624632 u32 self = tipc_own_addr (net );
625633 struct service_range * sr ;
@@ -646,7 +654,7 @@ bool tipc_nametbl_lookup(struct net *net, u32 type, u32 instance, u32 scope,
646654 continue ;
647655 tipc_dest_push (dsts , p -> sk .node , p -> sk .ref );
648656 (* dstcnt )++ ;
649- if (all )
657+ if (mcast )
650658 continue ;
651659 list_move_tail (& p -> all_publ , & sr -> all_publ );
652660 break ;
@@ -658,8 +666,14 @@ bool tipc_nametbl_lookup(struct net *net, u32 type, u32 instance, u32 scope,
658666 return !list_empty (dsts );
659667}
660668
661- void tipc_nametbl_mc_lookup (struct net * net , u32 type , u32 lower , u32 upper ,
662- u32 scope , bool exact , struct list_head * dports )
669+ /* tipc_nametbl_lookup_mcast_sockets(): look up node local destinaton sockets
670+ * matching the given address
671+ * Used on nodes which have received a multicast/broadcast message
672+ * Returns a list of local sockets
673+ */
674+ void tipc_nametbl_lookup_mcast_sockets (struct net * net , u32 type , u32 lower ,
675+ u32 upper , u32 scope , bool exact ,
676+ struct list_head * dports )
663677{
664678 struct service_range * sr ;
665679 struct tipc_service * sc ;
@@ -682,12 +696,13 @@ void tipc_nametbl_mc_lookup(struct net *net, u32 type, u32 lower, u32 upper,
682696 rcu_read_unlock ();
683697}
684698
685- /* tipc_nametbl_lookup_dst_nodes - find broadcast destination nodes
686- * - Creates list of nodes that overlap the given multicast address
687- * - Determines if any node local destinations overlap
699+ /* tipc_nametbl_lookup_mcast_nodes(): look up all destination nodes matching
700+ * the given address. Used in sending node.
701+ * Used on nodes which are sending out a multicast/broadcast message
702+ * Returns a list of nodes, including own node if applicable
688703 */
689- void tipc_nametbl_lookup_dst_nodes (struct net * net , u32 type , u32 lower ,
690- u32 upper , struct tipc_nlist * nodes )
704+ void tipc_nametbl_lookup_mcast_nodes (struct net * net , u32 type , u32 lower ,
705+ u32 upper , struct tipc_nlist * nodes )
691706{
692707 struct service_range * sr ;
693708 struct tipc_service * sc ;
0 commit comments