Add processing request & response vici message with socket
[platform/upstream/connman.git] / vpn / plugins / ipsec.h
1 #ifndef __CONNMAN_VPND_PLUGIN_IPSEC_H
2 #define __CONNMAN_VPND_PLUGIN_IPSEC_H
3
4 #define IPSEC_AUTH_PSK          "PSK"
5 #define IPSEC_AUTH_RSA          "RSA"
6 #define IPSEC_AUTH_XAUTH        "XAUTH"
7
8 #define VICI_SHARED_TYPE_PSK    "IKE"
9 #define VICI_SHARED_TYPE_XAUTH  "xauth"
10
11 #define IPSEC_ERROR_CHECK_GOTO(err, target, fmt, arg...) do { \
12         if (err < 0) { \
13                 connman_error(fmt, ## arg); \
14                 goto target; \
15         } \
16 } while (0)
17
18 #define IPSEC_ERROR_CHECK_RETURN(err, fmt, arg...) do { \
19         if (err < 0) { \
20                 connman_error(fmt, ## arg); \
21                 return; \
22         } \
23 } while (0)
24
25 #define IPSEC_ERROR_CHECK_RETURN_VAL(err, ret, fmt, arg...) do { \
26         if (err < 0) { \
27                 connman_error(fmt, ## arg); \
28                 return ret; \
29         } \
30 } while (0)
31
32 #endif /* __CONNMAN_VPND_PLUGIN_IPSEC_H */