1/*	$NetBSD$	*/
2
3/*
4 * Copyright (C) 2005-2007 Red Hat, Inc. All rights reserved.
5 *
6 * This file is part of the device-mapper userspace tools.
7 *
8 * This copyrighted material is made available to anyone wishing to use,
9 * modify, copy, or redistribute it subject to the terms and conditions
10 * of the GNU Lesser General Public License v.2.1.
11 *
12 * You should have received a copy of the GNU Lesser General Public License
13 * along with this program; if not, write to the Free Software Foundation,
14 * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
15 */
16
17#ifndef __DMEVENTD_DOT_H__
18#define __DMEVENTD_DOT_H__
19
20/* FIXME This stuff must be configurable. */
21
22#define	DM_EVENT_DAEMON		"/sbin/dmeventd"
23#define DM_EVENT_LOCKFILE	"/var/lock/dmeventd"
24#define	DM_EVENT_FIFO_CLIENT	"/var/run/dmeventd-client"
25#define	DM_EVENT_FIFO_SERVER	"/var/run/dmeventd-server"
26#define DM_EVENT_PIDFILE	"/var/run/dmeventd.pid"
27
28#define DM_EVENT_DEFAULT_TIMEOUT 10
29
30/* Commands for the daemon passed in the message below. */
31enum dm_event_command {
32	DM_EVENT_CMD_ACTIVE = 1,
33	DM_EVENT_CMD_REGISTER_FOR_EVENT,
34	DM_EVENT_CMD_UNREGISTER_FOR_EVENT,
35	DM_EVENT_CMD_GET_REGISTERED_DEVICE,
36	DM_EVENT_CMD_GET_NEXT_REGISTERED_DEVICE,
37	DM_EVENT_CMD_SET_TIMEOUT,
38	DM_EVENT_CMD_GET_TIMEOUT,
39	DM_EVENT_CMD_HELLO,
40};
41
42/* Message passed between client and daemon. */
43struct dm_event_daemon_message {
44	uint32_t cmd;
45	uint32_t size;
46	char *data;
47};
48
49/* FIXME Is this meant to be exported?  I can't see where the
50   interface uses it. */
51/* Fifos for client/daemon communication. */
52struct dm_event_fifos {
53	int client;
54	int server;
55	const char *client_path;
56	const char *server_path;
57};
58
59/*      EXIT_SUCCESS             0 -- stdlib.h */
60/*      EXIT_FAILURE             1 -- stdlib.h */
61#define EXIT_LOCKFILE_INUSE      2
62#define EXIT_DESC_CLOSE_FAILURE  3
63#define EXIT_DESC_OPEN_FAILURE   4
64#define EXIT_OPEN_PID_FAILURE    5
65#define EXIT_FIFO_FAILURE        6
66#define EXIT_CHDIR_FAILURE       7
67
68#endif /* __DMEVENTD_DOT_H__ */
69