Lines Matching full:service
52 * struct service_range - container for all bindings of a service range
53 * @lower: service range lower bound
54 * @upper: service range upper bound
55 * @tree_node: member of service range RB tree
72 * struct tipc_service - container for all published instances of a service type
73 * @type: 32 bit 'type' value for service
74 * @publ_cnt: increasing counter for publications in this service
75 * @ranges: rb tree containing all service ranges for this service
77 * @subscriptions: list of subscriptions for this service type
78 * @lock: spinlock controlling access to pertaining service ranges/publications
87 spinlock_t lock; /* Covers service range list */
103 * service_range_foreach_match - iterate over tipc service rbtree for each in RB_DECLARE_CALLBACKS_MAX()
105 * @sr: the service range pointer as a loop cursor in RB_DECLARE_CALLBACKS_MAX()
106 * @sc: the pointer to tipc service which holds the service range rbtree in RB_DECLARE_CALLBACKS_MAX()
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
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
225 * @ua: the service range the user is binding to
251 * tipc_service_create - create a service structure for the specified 'type'
253 * @ua: address representing the service to be bound
261 struct tipc_service *service; in tipc_service_create() local
264 service = kzalloc(sizeof(*service), GFP_ATOMIC); in tipc_service_create()
265 if (!service) { in tipc_service_create()
266 pr_warn("Service creation failed, no memory\n"); in tipc_service_create()
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()
276 hlist_add_head_rcu(&service->service_list, hd); in tipc_service_create()
277 return service; in tipc_service_create()
280 /* tipc_service_find_range - find service range matching publication parameters
378 * tipc_service_remove_publ - remove a publication from a service
416 * issue the prescribed number of events if there is any service
418 * @service: the tipc_service to attach the @sub to
421 static void tipc_service_subscribe(struct tipc_service *service, in tipc_service_subscribe() argument
434 list_add(&sub->service_list, &service->subscriptions); in tipc_service_subscribe()
440 service_range_foreach_match(sr, service, lower, upper) { in tipc_service_subscribe()
466 struct tipc_service *service; in tipc_service_find() local
469 hlist_for_each_entry_rcu(service, service_head, service_list) { in tipc_service_find()
470 if (service->type == ua->sr.type) in tipc_service_find()
471 return service; in tipc_service_find()
526 /* Remove service range item if this was its last publication */ in tipc_nametbl_remove_publ()
532 /* Delete service item if no more publications and subscriptions */ in tipc_nametbl_remove_publ()
549 * tipc_nametbl_lookup_anycast - perform service instance to socket translation
551 * @ua: service address to look up
758 /* tipc_nametbl_publish - add service binding to name table
792 * tipc_nametbl_withdraw - withdraw a service binding
794 * @ua: service address/range being unbound
875 /* Delete service item if no more publications and subscriptions */ in tipc_nametbl_unsubscribe()
907 * tipc_service_delete - purge all publications for a service and delete it
935 struct tipc_service *service; in tipc_nametbl_stop() local
946 hlist_for_each_entry_rcu(service, service_head, service_list) { in tipc_nametbl_stop()
947 tipc_service_delete(net, service); in tipc_nametbl_stop()
957 struct tipc_service *service, in __tipc_nl_add_nametable_publ() argument
995 if (nla_put_u32(msg->skb, TIPC_NLA_PUBL_TYPE, service->type)) in __tipc_nl_add_nametable_publ()
1054 struct tipc_service *service = NULL; in tipc_nl_service_list() local
1072 service = tipc_service_find(net, &ua); in tipc_nl_service_list()
1073 if (!service) in tipc_nl_service_list()
1076 hlist_for_each_entry_rcu(service, head, service_list) in tipc_nl_service_list()
1078 if (!service) in tipc_nl_service_list()
1082 hlist_for_each_entry_from_rcu(service, service_list) { in tipc_nl_service_list()
1083 spin_lock_bh(&service->lock); in tipc_nl_service_list()
1084 err = __tipc_nl_service_range_list(msg, service, in tipc_nl_service_list()
1089 *last_type = service->type; in tipc_nl_service_list()
1090 spin_unlock_bh(&service->lock); in tipc_nl_service_list()
1093 spin_unlock_bh(&service->lock); in tipc_nl_service_list()