vpn: Export vpn_ipconfig_foreach as linker symbol
[platform/upstream/connman.git] / vpn / plugins / ipsec.h
1 /*
2  *
3  *  ConnMan VPN daemon
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License version 2 as
7  *  published by the Free Software Foundation.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  *
18  */
19
20 #ifndef __CONNMAN_VPND_PLUGIN_IPSEC_H
21 #define __CONNMAN_VPND_PLUGIN_IPSEC_H
22
23 #define IPSEC_AUTH_PSK          "PSK"
24 #define IPSEC_AUTH_RSA          "RSA"
25 #define IPSEC_AUTH_XAUTH        "XAUTH"
26
27 #define VICI_SHARED_TYPE_PSK    "IKE"
28 #define VICI_SHARED_TYPE_XAUTH  "xauth"
29
30 #define IPSEC_ERROR_CHECK_GOTO(err, target, fmt, arg...) do { \
31         if (err < 0) { \
32                 connman_error(fmt, ## arg); \
33                 goto target; \
34         } \
35 } while (0)
36
37 #define IPSEC_ERROR_CHECK_RETURN(err, fmt, arg...) do { \
38         if (err < 0) { \
39                 connman_error(fmt, ## arg); \
40                 return; \
41         } \
42 } while (0)
43
44 #define IPSEC_ERROR_CHECK_RETURN_VAL(err, ret, fmt, arg...) do { \
45         if (err < 0) { \
46                 connman_error(fmt, ## arg); \
47                 return ret; \
48         } \
49 } while (0)
50
51 #endif /* __CONNMAN_VPND_PLUGIN_IPSEC_H */