summaryrefslogtreecommitdiff
path: root/src/libcharon/plugins/whitelist/whitelist_msg.h
blob: 65b922996b6f60c775b490bcc4733cd64b397968 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * Copyright (C) 2011 Martin Willi
 * Copyright (C) 2011 revosec AG
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 */

/**
 * @defgroup whitelist_msg whitelist_msg
 * @{ @ingroup whitelist
 */

#ifndef WHITELIST_MSG_H_
#define WHITELIST_MSG_H_

#define WHITELIST_SOCKET IPSEC_PIDDIR "/charon.wlst"

typedef struct whitelist_msg_t whitelist_msg_t;

/**
 * Message type.
 */
enum {
	/* add whitelist entry */
	WHITELIST_ADD = 1,
	/* remove whitelist entry */
	WHITELIST_REMOVE = 2,
	/* list identities matching id, gets responded with LIST messages */
	WHITELIST_LIST = 3,
	/* indicates end of list in a series of LIST messages */
	WHITELIST_END = 4,
	/* flush identities matching id */
	WHITELIST_FLUSH = 5,
	/* enable whitelist checking */
	WHITELIST_ENABLE = 6,
	/* disable whitelist checking */
	WHITELIST_DISABLE = 7,
};

/**
 * Message to exchange over whitelist
 */
struct whitelist_msg_t {
	/** message type */
	int type;
	/** null terminated identity */
	char id[128];
};

#endif /** WHITELIST_MSG_H_ @}*/