summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-07-15 21:37:50 +0200
committerMarcel Holtmann <marcel@holtmann.org>2009-07-15 21:37:50 +0200
commit016c1490e180fa737815bf65f96cc60b1761ed89 (patch)
tree09f9c5e22903bd85b66b4b545d74acb9473844ce
parent3e16ebf1750bdef54975919ec6bf087b01e1351e (diff)
downloadconnman-016c1490e180fa737815bf65f96cc60b1761ed89.tar.gz
connman-016c1490e180fa737815bf65f96cc60b1761ed89.tar.bz2
connman-016c1490e180fa737815bf65f96cc60b1761ed89.zip
Add error codes for failing connection attempts
-rw-r--r--include/element.h7
-rw-r--r--include/service.h7
-rw-r--r--src/element.c2
-rw-r--r--src/service.c6
4 files changed, 14 insertions, 8 deletions
diff --git a/include/element.h b/include/element.h
index cca87f59..70adb87d 100644
--- a/include/element.h
+++ b/include/element.h
@@ -64,9 +64,10 @@ enum connman_element_state {
};
enum connman_element_error {
- CONNMAN_ELEMENT_ERROR_UNKNOWN = 0,
- CONNMAN_ELEMENT_ERROR_FAILED = 1,
- CONNMAN_ELEMENT_ERROR_DHCP_FAILED = 2,
+ CONNMAN_ELEMENT_ERROR_UNKNOWN = 0,
+ CONNMAN_ELEMENT_ERROR_FAILED = 1,
+ CONNMAN_ELEMENT_ERROR_DHCP_FAILED = 2,
+ CONNMAN_ELEMENT_ERROR_CONNECT_FAILED = 3,
};
struct connman_driver;
diff --git a/include/service.h b/include/service.h
index 75df75fc..5d31e94b 100644
--- a/include/service.h
+++ b/include/service.h
@@ -67,9 +67,10 @@ enum connman_service_state {
};
enum connman_service_error {
- CONNMAN_SERVICE_ERROR_UNKNOWN = 0,
- CONNMAN_SERVICE_ERROR_DHCP_FAILED = 1,
- CONNMAN_SERVICE_ERROR_PIN_MISSING = 2,
+ CONNMAN_SERVICE_ERROR_UNKNOWN = 0,
+ CONNMAN_SERVICE_ERROR_PIN_MISSING = 1,
+ CONNMAN_SERVICE_ERROR_DHCP_FAILED = 2,
+ CONNMAN_SERVICE_ERROR_CONNECT_FAILED = 3,
};
struct connman_service;
diff --git a/src/element.c b/src/element.c
index 6ecd595a..433f64b5 100644
--- a/src/element.c
+++ b/src/element.c
@@ -1336,6 +1336,8 @@ static enum connman_service_error convert_error(enum connman_element_error error
break;
case CONNMAN_ELEMENT_ERROR_DHCP_FAILED:
return CONNMAN_SERVICE_ERROR_DHCP_FAILED;
+ case CONNMAN_ELEMENT_ERROR_CONNECT_FAILED:
+ return CONNMAN_SERVICE_ERROR_CONNECT_FAILED;
}
return CONNMAN_SERVICE_ERROR_UNKNOWN;
diff --git a/src/service.c b/src/service.c
index 79e4cb0f..14f14c50 100644
--- a/src/service.c
+++ b/src/service.c
@@ -187,10 +187,12 @@ static const char *error2string(enum connman_service_error error)
switch (error) {
case CONNMAN_SERVICE_ERROR_UNKNOWN:
break;
- case CONNMAN_SERVICE_ERROR_DHCP_FAILED:
- return "dhcp-failed";
case CONNMAN_SERVICE_ERROR_PIN_MISSING:
return "pin-missing";
+ case CONNMAN_SERVICE_ERROR_DHCP_FAILED:
+ return "dhcp-failed";
+ case CONNMAN_SERVICE_ERROR_CONNECT_FAILED:
+ return "connect-failed";
}
return NULL;