chiark / gitweb /
udevinfo: allow -a -n <node>
[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 UDEVD_PRIORITY                  -4
25 #define UDEV_PRIORITY                   -2
26
27 #define EVENT_QUEUE_DIR                 ".udev/queue"
28 #define EVENT_FAILED_DIR                ".udev/failed"
29 #define EVENT_SEQNUM                    ".udev/uevent_seqnum"
30
31 /* maximum limit of forked childs */
32 #define UDEVD_MAX_CHILDS                256
33 /* start to throttle forking if maximum number of running childs in our session is reached */
34 #define UDEVD_MAX_CHILDS_RUNNING        16
35
36 /* linux/include/linux/kobject.h */
37 #define UEVENT_BUFFER_SIZE              2048
38 #define UEVENT_NUM_ENVP                 32
39
40 #define UDEVD_CTRL_SOCK_PATH            "/org/kernel/udev/udevd"
41 #define UDEVD_CTRL_MAGIC                "udevd_" UDEV_VERSION
42
43 enum udevd_ctrl_msg_type {
44         UDEVD_CTRL_UNKNOWN,
45         UDEVD_CTRL_STOP_EXEC_QUEUE,
46         UDEVD_CTRL_START_EXEC_QUEUE,
47         UDEVD_CTRL_SET_LOG_LEVEL,
48         UDEVD_CTRL_SET_MAX_CHILDS,
49         UDEVD_CTRL_SET_MAX_CHILDS_RUNNING,
50         UDEVD_CTRL_RELOAD_RULES,
51 };
52
53 struct udevd_ctrl_msg {
54         char magic[32];
55         enum udevd_ctrl_msg_type type;
56         char buf[256];
57 };
58
59 struct udevd_uevent_msg {
60         struct list_head node;
61         pid_t pid;
62         int exitstatus;
63         time_t queue_time;
64         char *action;
65         char *devpath;
66         char *subsystem;
67         char *driver;
68         dev_t devt;
69         unsigned long long seqnum;
70         char *physdevpath;
71         unsigned int timeout;
72         char *envp[UEVENT_NUM_ENVP+1];
73         char envbuf[];
74 };