source: mainline/uspace/srv/loc/loc.h@ f98bec0f

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since f98bec0f was 42a619b, checked in by Jakub Jermar <jakub@…>, 14 years ago

Merge from lp:~jakub/helenos/camp2011.

  • 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 LOC_H_
36#define LOC_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 /** Link to server list of services (loc_server_t.services) */
89 link_t server_services;
90 /** Link to list of services in category (category_t.services) */
91 link_t cat_services;
92 /** List of category memberships (svc_categ_t) */
93 list_t cat_memb;
94 /** Unique service identifier */
95 service_id_t id;
96 /** Service namespace */
97 loc_namespace_t *namespace;
98 /** Service name */
99 char *name;
100 /** Supplier of this service */
101 loc_server_t *server;
102 /** Use this interface when forwarding to server. */
103 sysarg_t forward_interface;
104} loc_service_t;
105
106extern fibril_mutex_t services_list_mutex;
107
108extern service_id_t loc_create_id(void);
109extern void loc_category_change_event(void);
110
111#endif
112
113/** @}
114 */
Note: See TracBrowser for help on using the repository browser.