chiark / gitweb /
Fix trivial spelling errors in RELEASE-NOTES
[elogind.git] / udevd.h
1 /*
2  * udevd.h
3  *
4  * Copyright (C) 2004 Ling, Xiaofeng <xiaofeng.ling@intel.com>
5  * Copyright (C) 2004-2005 Kay Sievers <kay.sievers@vrfy.org>
6  *
7  *      This program is free software; you can redistribute it and/or modify it
8  *      under the terms of the GNU General Public License as published by the
9  *      Free Software Foundation version 2 of the License.
10  * 
11  *      This program is distributed in the hope that it will be useful, but
12  *      WITHOUT ANY WARRANTY; without even the implied warranty of
13  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  *      General Public License for more details.
15  * 
16  *      You should have received a copy of the GNU General Public License along
17  *      with this program; if not, write to the Free Software Foundation, Inc.,
18  *      675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  */
21
22 #include "list.h"
23
24 #define UDEV_MAGIC                      "udevd_" UDEV_VERSION
25 #define UDEVD_SOCK_PATH                 "/org/kernel/udev/udevd"
26 #define UDEVSEND_WAIT_MAX_SECONDS       3
27 #define UDEVSEND_WAIT_LOOP_PER_SECOND   10
28
29 #define UDEVD_PRIORITY                  -4
30 #define UDEV_PRIORITY                   -2
31
32 #define EVENT_QUEUE_DIR                 ".udev/queue"
33 #define EVENT_FAILED_DIR                ".udev/failed"
34
35 /* maximum limit of forked childs */
36 #define UDEVD_MAX_CHILDS                64
37 /* start to throttle forking if maximum number of running childs in our session is reached */
38 #define UDEVD_MAX_CHILDS_RUNNING        16
39
40 /* environment buffer, should match the kernel's size in lib/kobject_uevent.h */
41 #define UEVENT_BUFFER_SIZE              2048
42 #define UEVENT_NUM_ENVP                 64
43
44 enum udevd_msg_type {
45         UDEVD_UNKNOWN,
46         UDEVD_UEVENT_UDEVSEND,
47         UDEVD_UEVENT_NETLINK,
48         UDEVD_STOP_EXEC_QUEUE,
49         UDEVD_START_EXEC_QUEUE,
50         UDEVD_SET_LOG_LEVEL,
51         UDEVD_SET_MAX_CHILDS,
52         UDEVD_RELOAD_RULES,
53 };
54
55
56 struct udevd_msg {
57         char magic[32];
58         enum udevd_msg_type type;
59         char envbuf[UEVENT_BUFFER_SIZE+512];
60 };
61
62 struct uevent_msg {
63         enum udevd_msg_type type;
64         struct list_head node;
65         pid_t pid;
66         int exitstatus;
67         time_t queue_time;
68         char *action;
69         char *devpath;
70         char *subsystem;
71         dev_t devt;
72         unsigned long long seqnum;
73         char *physdevpath;
74         unsigned int timeout;
75         char *envp[UEVENT_NUM_ENVP+1];
76         char envbuf[];
77 };