source: mainline/uspace/srv/locsrv/locsrv.h@ 6d5e378

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 6d5e378 was 50ad3f3, checked in by Martin Decky <martin@…>, 13 years ago

trivial changes (error code reporting, messages)

  • Property mode set to 100644
File size: 3.1 KB
Line 
1/*
2 * Copyright (c) 2011 Jiri Svoboda
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @addtogroup loc
30 * @{
31 */
32/** @file HelenOS location service.
33 */
34
35#ifndef LOCSRV_H_
36#define LOCSRV_H_
37
38#include <ipc/loc.h>
39#include <async.h>
40#include <fibril_synch.h>
41#include <sys/types.h>
42
43/** Representation of server (supplier).
44 *
45 * Each server supplies a set of services.
46 *
47 */
48typedef struct {
49 /** Link to servers_list */
50 link_t servers;
51
52 /** List of services supplied by this server */
53 list_t services;
54
55 /** Session asociated with this server */
56 async_sess_t *sess;
57
58 /** Server name */
59 char *name;
60
61 /** Fibril mutex for list of services owned by this server */
62 fibril_mutex_t services_mutex;
63} loc_server_t;
64
65/** Info about registered namespaces
66 *
67 */
68typedef struct {
69 /** Link to namespaces_list */
70 link_t namespaces;
71
72 /** Unique namespace identifier */
73 service_id_t id;
74
75 /** Namespace name */
76 char *name;
77
78 /** Reference count */
79 size_t refcnt;
80} loc_namespace_t;
81
82/** Info about registered service
83 *
84 */
85typedef struct {
86 /** Link to global list of services (services_list) */
87 link_t services;
88
89 /** Link to server list of services (loc_server_t.services) */
90 link_t server_services;
91
92 /** Link to list of services in category (category_t.services) */
93 link_t cat_services;
94
95 /** List of category memberships (svc_categ_t) */
96 list_t cat_memb;
97
98 /** Unique service identifier */
99 service_id_t id;
100
101 /** Service namespace */
102 loc_namespace_t *namespace;
103
104 /** Service name */
105 char *name;
106
107 /** Supplier of this service */
108 loc_server_t *server;
109
110 /** Use this interface when forwarding to server. */
111 sysarg_t forward_interface;
112} loc_service_t;
113
114extern fibril_mutex_t services_list_mutex;
115
116extern service_id_t loc_create_id(void);
117extern void loc_category_change_event(void);
118
119#endif
120
121/** @}
122 */
Note: See TracBrowser for help on using the repository browser.