aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/error_notify/error_notify_msg.h
blob: 74b5908003dd4f52e44353e5c3c7bb4bb473f478 (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
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * Copyright (C) 2012 Martin Willi
 * Copyright (C) 2012 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 error_notify_msg error_notify_msg
 * @{ @ingroup error_notify
 */

#ifndef ERROR_NOTIFY_MSG_H_
#define ERROR_NOTIFY_MSG_H_

#define ERROR_NOTIFY_SOCKET IPSEC_PIDDIR "/charon.enfy"

typedef struct error_notify_msg_t error_notify_msg_t;

/**
 * Message type, these are mapped to ALERT_* types.
 */
enum {
	ERROR_NOTIFY_RADIUS_NOT_RESPONDING = 1,
	ERROR_NOTIFY_LOCAL_AUTH_FAILED = 2,
	ERROR_NOTIFY_PEER_AUTH_FAILED = 3,
	ERROR_NOTIFY_PARSE_ERROR_HEADER = 4,
	ERROR_NOTIFY_PARSE_ERROR_BODY = 5,
	ERROR_NOTIFY_RETRANSMIT_SEND_TIMEOUT = 6,
	ERROR_NOTIFY_HALF_OPEN_TIMEOUT = 7,
	ERROR_NOTIFY_PROPOSAL_MISMATCH_IKE = 8,
	ERROR_NOTIFY_PROPOSAL_MISMATCH_CHILD = 9,
	ERROR_NOTIFY_TS_MISMATCH = 10,
	ERROR_NOTIFY_INSTALL_CHILD_SA_FAILED = 11,
	ERROR_NOTIFY_INSTALL_CHILD_POLICY_FAILED = 12,
	ERROR_NOTIFY_UNIQUE_REPLACE = 13,
	ERROR_NOTIFY_UNIQUE_KEEP = 14,
	ERROR_NOTIFY_VIP_FAILURE = 15,
	ERROR_NOTIFY_AUTHORIZATION_FAILED = 16,
	ERROR_NOTIFY_CERT_EXPIRED = 17,
	ERROR_NOTIFY_CERT_REVOKED = 18,
	ERROR_NOTIFY_NO_ISSUER_CERT = 19,
	ERROR_NOTIFY_RETRANSMIT_SEND = 20,
};

/**
 * Message to exchange over notify socket, strings are null-terminated.
 */
struct error_notify_msg_t {
	/** message type */
	int type;
	/** string with an error description */
	char str[384];
	/** connection name, if known */
	char name[64];
	/** peer identity, if known */
	char id[256];
	/** peer address and port, if known */
	char ip[60];
} __attribute__((packed));

#endif /** ERROR_NOTIFY_MSG_H_ @}*/