]>
Commit | Line | Data |
---|---|---|
20263082 LP |
1 | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ |
2 | ||
3 | #ifndef foologindhfoo | |
4 | #define foologindhfoo | |
5 | ||
6 | /*** | |
7 | This file is part of systemd. | |
8 | ||
9 | Copyright 2011 Lennart Poettering | |
10 | ||
11 | systemd is free software; you can redistribute it and/or modify it | |
12 | under the terms of the GNU General Public License as published by | |
13 | the Free Software Foundation; either version 2 of the License, or | |
14 | (at your option) any later version. | |
15 | ||
16 | systemd is distributed in the hope that it will be useful, but | |
17 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
19 | General Public License for more details. | |
20 | ||
21 | You should have received a copy of the GNU General Public License | |
22 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
23 | ***/ | |
24 | ||
25 | #include <stdbool.h> | |
26 | #include <inttypes.h> | |
27 | #include <dbus/dbus.h> | |
28 | #include <libudev.h> | |
29 | ||
30 | #include "util.h" | |
31 | #include "list.h" | |
32 | #include "hashmap.h" | |
33 | #include "cgroup-util.h" | |
34 | ||
35 | /* TODO: | |
36 | * | |
37 | * recreate VTs when disallocated | |
5eda94dd | 38 | * PAM rewrite |
20263082 | 39 | * spawn user systemd |
5eda94dd LP |
40 | * dbus API |
41 | * | |
20263082 | 42 | * non-local X11 server |
20263082 | 43 | * reboot/shutdown halt management |
20263082 LP |
44 | */ |
45 | ||
46 | typedef struct Manager Manager; | |
20263082 | 47 | |
90821c93 LP |
48 | #include "logind-device.h" |
49 | #include "logind-seat.h" | |
50 | #include "logind-session.h" | |
51 | #include "logind-user.h" | |
20263082 LP |
52 | |
53 | struct Manager { | |
54 | DBusConnection *bus; | |
55 | ||
56 | Hashmap *devices; | |
57 | Hashmap *seats; | |
58 | Hashmap *sessions; | |
59 | Hashmap *users; | |
60 | ||
14c3baca LP |
61 | LIST_HEAD(Seat, seat_gc_queue); |
62 | LIST_HEAD(Session, session_gc_queue); | |
63 | LIST_HEAD(User, user_gc_queue); | |
64 | ||
20263082 LP |
65 | struct udev *udev; |
66 | struct udev_monitor *udev_monitor; | |
67 | ||
68 | int udev_fd; | |
69 | int console_active_fd; | |
70 | int bus_fd; | |
71 | int epoll_fd; | |
72 | ||
3f49d45a | 73 | unsigned n_autovts; |
20263082 LP |
74 | |
75 | Seat *vtconsole; | |
76 | ||
77 | char *cgroup_path; | |
78 | char **controllers, **reset_controllers; | |
79 | ||
3f49d45a | 80 | char **kill_only_users, **kill_exclude_users; |
20263082 LP |
81 | |
82 | bool kill_user_processes; | |
83 | }; | |
84 | ||
20263082 LP |
85 | Manager *manager_new(void); |
86 | void manager_free(Manager *m); | |
14c3baca | 87 | |
20263082 LP |
88 | int manager_add_device(Manager *m, const char *sysfs, Device **_device); |
89 | int manager_add_seat(Manager *m, const char *id, Seat **_seat); | |
90 | int manager_add_session(Manager *m, User *u, const char *id, Session **_session); | |
91 | int manager_add_user(Manager *m, uid_t uid, gid_t gid, const char *name, User **_user); | |
92 | int manager_add_user_by_name(Manager *m, const char *name, User **_user); | |
93 | int manager_add_user_by_uid(Manager *m, uid_t uid, User **_user); | |
14c3baca | 94 | |
20263082 LP |
95 | int manager_process_device(Manager *m, struct udev_device *d); |
96 | int manager_dispatch_udev(Manager *m); | |
97 | int manager_dispatch_console(Manager *m); | |
14c3baca | 98 | |
20263082 LP |
99 | int manager_enumerate_devices(Manager *m); |
100 | int manager_enumerate_seats(Manager *m); | |
101 | int manager_enumerate_sessions(Manager *m); | |
102 | int manager_enumerate_users(Manager *m); | |
14c3baca | 103 | |
20263082 LP |
104 | int manager_startup(Manager *m); |
105 | int manager_run(Manager *m); | |
106 | int manager_spawn_autovt(Manager *m, int vtnr); | |
107 | ||
14c3baca LP |
108 | void manager_gc(Manager *m); |
109 | ||
20263082 LP |
110 | bool x11_display_is_local(const char *display); |
111 | ||
3f49d45a LP |
112 | extern const DBusObjectPathVTable bus_manager_vtable; |
113 | ||
20263082 | 114 | #endif |