aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/android/android_service.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2010-06-24 13:41:07 +0200
committerTobias Brunner <tobias@strongswan.org>2010-06-24 14:30:05 +0200
commit5eb9eeb1308661c4527103b930bdf63b73b3aeef (patch)
tree023828b54fdff48acdc63b3163b6a88f02f3a13e /src/libcharon/plugins/android/android_service.c
parent359063caf76a1f892801349f21159f290f42d683 (diff)
downloadstrongswan-5eb9eeb1308661c4527103b930bdf63b73b3aeef.tar.bz2
strongswan-5eb9eeb1308661c4527103b930bdf63b73b3aeef.tar.xz
Use the same error code constants as in the Java frontend.
Diffstat (limited to 'src/libcharon/plugins/android/android_service.c')
-rw-r--r--src/libcharon/plugins/android/android_service.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/libcharon/plugins/android/android_service.c b/src/libcharon/plugins/android/android_service.c
index 8eeb3b877..e5ff7588c 100644
--- a/src/libcharon/plugins/android/android_service.c
+++ b/src/libcharon/plugins/android/android_service.c
@@ -58,6 +58,20 @@ struct private_android_service_t {
};
/**
+ * Some of the error codes defined in VpnManager.java
+ */
+typedef enum {
+ /** Error code to indicate an error from authentication. */
+ VPN_ERROR_AUTH = 51,
+ /** Error code to indicate the connection attempt failed. */
+ VPN_ERROR_CONNECTION_FAILED = 101,
+ /** Error code to indicate an error of remote server hanging up. */
+ VPN_ERROR_REMOTE_HUNG_UP = 7,
+ /** Error code to indicate an error of losing connectivity. */
+ VPN_ERROR_CONNECTION_LOST = 103,
+} android_vpn_errors_t;
+
+/**
* Read a string argument from the Android control socket
*/
static char *read_argument(int fd, u_char length)
@@ -209,7 +223,7 @@ static job_requeue_t initiate(private_android_service_t *this)
controller_cb_empty, NULL) != SUCCESS)
{
DBG1(DBG_CFG, "failed to initiate tunnel");
- code = 0x33; /* FIXME: this indicates an AUTH error, which might not be the case */
+ code = VPN_ERROR_CONNECTION_FAILED;
send(fd, &code, 1, 0);
return JOB_REQUEUE_NONE;
}