Lines Matching refs:srv
96 static int server_match(const struct qrtr_server *srv, in server_match() argument
101 if (f->service != 0 && srv->service != f->service) in server_match()
106 return (srv->instance & ifilter) == f->instance; in server_match()
110 struct qrtr_server *srv) in service_announce_new() argument
116 trace_qrtr_ns_service_announce_new(srv->service, srv->instance, in service_announce_new()
117 srv->node, srv->port); in service_announce_new()
124 pkt.server.service = cpu_to_le32(srv->service); in service_announce_new()
125 pkt.server.instance = cpu_to_le32(srv->instance); in service_announce_new()
126 pkt.server.node = cpu_to_le32(srv->node); in service_announce_new()
127 pkt.server.port = cpu_to_le32(srv->port); in service_announce_new()
136 struct qrtr_server *srv) in service_announce_del() argument
143 trace_qrtr_ns_service_announce_del(srv->service, srv->instance, in service_announce_del()
144 srv->node, srv->port); in service_announce_del()
151 pkt.server.service = cpu_to_le32(srv->service); in service_announce_del()
152 pkt.server.instance = cpu_to_le32(srv->instance); in service_announce_del()
153 pkt.server.node = cpu_to_le32(srv->node); in service_announce_del()
154 pkt.server.port = cpu_to_le32(srv->port); in service_announce_del()
166 static void lookup_notify(struct sockaddr_qrtr *to, struct qrtr_server *srv, in lookup_notify() argument
180 if (srv) { in lookup_notify()
181 pkt.server.service = cpu_to_le32(srv->service); in lookup_notify()
182 pkt.server.instance = cpu_to_le32(srv->instance); in lookup_notify()
183 pkt.server.node = cpu_to_le32(srv->node); in lookup_notify()
184 pkt.server.port = cpu_to_le32(srv->port); in lookup_notify()
197 struct qrtr_server *srv; in announce_servers() local
207 xa_for_each(&node->servers, index, srv) { in announce_servers()
208 ret = service_announce_new(sq, srv); in announce_servers()
222 struct qrtr_server *srv; in server_add() local
229 srv = kzalloc(sizeof(*srv), GFP_KERNEL); in server_add()
230 if (!srv) in server_add()
233 srv->service = service; in server_add()
234 srv->instance = instance; in server_add()
235 srv->node = node_id; in server_add()
236 srv->port = port; in server_add()
243 old = xa_store(&node->servers, port, srv, GFP_KERNEL); in server_add()
247 srv->service, srv->instance, xa_err(old)); in server_add()
254 trace_qrtr_ns_server_add(srv->service, srv->instance, in server_add()
255 srv->node, srv->port); in server_add()
257 return srv; in server_add()
260 kfree(srv); in server_add()
267 struct qrtr_server *srv; in server_del() local
270 srv = xa_load(&node->servers, port); in server_del()
271 if (!srv) in server_del()
277 if (srv->node == qrtr_ns.local_node && bcast) in server_del()
278 service_announce_del(&qrtr_ns.bcast_sq, srv); in server_del()
283 if (lookup->service && lookup->service != srv->service) in server_del()
285 if (lookup->instance && lookup->instance != srv->instance) in server_del()
288 lookup_notify(&lookup->sq, srv, false); in server_del()
291 kfree(srv); in server_del()
335 struct qrtr_server *srv; in ctrl_cmd_bye() local
351 xa_for_each(&node->servers, index, srv) in ctrl_cmd_bye()
352 server_del(node, srv->port, true); in ctrl_cmd_bye()
363 xa_for_each(&local_node->servers, index, srv) { in ctrl_cmd_bye()
365 sq.sq_node = srv->node; in ctrl_cmd_bye()
366 sq.sq_port = srv->port; in ctrl_cmd_bye()
387 struct qrtr_server *srv; in ctrl_cmd_del_client() local
437 xa_for_each(&local_node->servers, index, srv) { in ctrl_cmd_del_client()
439 sq.sq_node = srv->node; in ctrl_cmd_del_client()
440 sq.sq_port = srv->port; in ctrl_cmd_del_client()
459 struct qrtr_server *srv; in ctrl_cmd_new_server() local
469 srv = server_add(service, instance, node_id, port); in ctrl_cmd_new_server()
470 if (!srv) in ctrl_cmd_new_server()
473 if (srv->node == qrtr_ns.local_node) { in ctrl_cmd_new_server()
474 ret = service_announce_new(&qrtr_ns.bcast_sq, srv); in ctrl_cmd_new_server()
489 lookup_notify(&lookup->sq, srv, true); in ctrl_cmd_new_server()
525 struct qrtr_server *srv; in ctrl_cmd_new_lookup() local
548 xa_for_each(&node->servers, srv_idx, srv) { in ctrl_cmd_new_lookup()
549 if (!server_match(srv, &filter)) in ctrl_cmd_new_lookup()
552 lookup_notify(from, srv, true); in ctrl_cmd_new_lookup()