chiark / gitweb /
udevadm: control - use getopt_long()
[elogind.git] / udev / udevd.h
1 /*
2  * Copyright (C) 2004 Ling, Xiaofeng <xiaofeng.ling@intel.com>
3  * Copyright (C) 2004-2006 Kay Sievers <kay.sievers@vrfy.org>
4  *
5  *      This program is free software; you can redistribute it and/or modify it
6  *      under the terms of the GNU General Public License as published by the
7  *      Free Software Foundation version 2 of the License.
8  * 
9  *      This program is distributed in the hope that it will be useful, but
10  *      WITHOUT ANY WARRANTY; without even the implied warranty of
11  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  *      General Public License for more details.
13  * 
14  *      You should have received a copy of the GNU General Public License along
15  *      with this program; if not, write to the Free Software Foundation, Inc.,
16  *      51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  *
18  */
19
20 #include "list.h"
21
22 #define UDEVD_PRIORITY                  -4
23 #define UDEV_PRIORITY                   -2
24
25 /* maximum limit of forked childs */
26 #define UDEVD_MAX_CHILDS                256
27 /* start to throttle forking if maximum number of running childs in our session is reached */
28 #define UDEVD_MAX_CHILDS_RUNNING        16
29
30 /* linux/include/linux/kobject.h */
31 #define UEVENT_BUFFER_SIZE              2048
32 #define UEVENT_NUM_ENVP                 32
33
34 #define UDEVD_CTRL_SOCK_PATH            "@" UDEV_PREFIX "/org/kernel/udev/udevd"
35 #define UDEVD_CTRL_MAGIC                "udevd_" VERSION
36
37 enum udevd_ctrl_msg_type {
38         UDEVD_CTRL_UNKNOWN,
39         UDEVD_CTRL_SET_LOG_LEVEL,
40         UDEVD_CTRL_STOP_EXEC_QUEUE,
41         UDEVD_CTRL_START_EXEC_QUEUE,
42         UDEVD_CTRL_RELOAD_RULES,
43         UDEVD_CTRL_ENV,
44         UDEVD_CTRL_SET_MAX_CHILDS,
45         UDEVD_CTRL_SET_MAX_CHILDS_RUNNING,
46 };
47
48 struct udevd_ctrl_msg {
49         char magic[32];
50         enum udevd_ctrl_msg_type type;
51         union {
52                 int intval;
53                 char buf[256];
54         };
55 };
56
57 struct udevd_uevent_msg {
58         struct list_head node;
59         pid_t pid;
60         int exitstatus;
61         time_t queue_time;
62         char *action;
63         char *devpath;
64         char *subsystem;
65         char *driver;
66         dev_t devt;
67         unsigned long long seqnum;
68         char *devpath_old;
69         char *physdevpath;
70         unsigned int timeout;
71         char *envp[UEVENT_NUM_ENVP+1];
72         char envbuf[];
73 };