From d464ebb9235fe78e6588e95d4d3333d5ee95ca48 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Tue, 8 Mar 2011 13:37:46 +0100 Subject: Timeout implemented in request objects, supported by TCP. TODO: UDP. --- lib/include/radsec/radsec.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/include/radsec/radsec.h') diff --git a/lib/include/radsec/radsec.h b/lib/include/radsec/radsec.h index fcd391d..5f8f4db 100644 --- a/lib/include/radsec/radsec.h +++ b/lib/include/radsec/radsec.h @@ -3,6 +3,7 @@ /* See the file COPYING for licensing information. */ #include +#include enum rs_err_code { RSE_OK = 0, @@ -21,9 +22,10 @@ enum rs_err_code { RSE_INTERNAL = 13, RSE_SSLERR = 14, /* OpenSSL error. */ RSE_INVALID_PKT = 15, - RSE_TIMEOUT_CONN = 16, - RSE_INVAL = 17, - RSE_TIMEOUT_IO = 18, + RSE_TIMEOUT_CONN = 16, /* Connection timeout. */ + RSE_INVAL = 17, /* Invalid argument. */ + RSE_TIMEOUT_IO = 18, /* I/O timeout. */ + RSE_TIMEOUT = 19, /* High level timeout. */ }; enum rs_conn_type { @@ -111,6 +113,7 @@ int rs_conn_receive_packet(struct rs_connection *conn, struct rs_packet *request, struct rs_packet **pkt_out); int rs_conn_fd(struct rs_connection *conn); +void rs_conn_set_timeout(struct rs_connection *conn, struct timeval *tv); /* Peer -- client and server. */ int rs_peer_create(struct rs_connection *conn, struct rs_peer **peer_out); -- cgit v1.1 From 6f3ae93eb1a5c4e352b42a9fae9b6f544a2e341a Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Tue, 8 Mar 2011 14:27:59 +0100 Subject: Update rs_err_msg() prototype. Also, rename enum rs_err_code to not collide with the function named the same. --- lib/include/radsec/radsec.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/include/radsec/radsec.h') diff --git a/lib/include/radsec/radsec.h b/lib/include/radsec/radsec.h index 5f8f4db..f620fed 100644 --- a/lib/include/radsec/radsec.h +++ b/lib/include/radsec/radsec.h @@ -5,7 +5,7 @@ #include #include -enum rs_err_code { +enum rs_error_code { RSE_OK = 0, RSE_NOMEM = 1, RSE_NOSYS = 2, @@ -167,7 +167,7 @@ int rs_err_conn_push_fl(struct rs_connection *conn, struct rs_error *rs_err_conn_pop(struct rs_connection *conn); int rs_err_conn_peek_code (struct rs_connection *conn); void rs_err_free(struct rs_error *err); -char *rs_err_msg(struct rs_error *err, int dofree_flag); +char *rs_err_msg(struct rs_error *err); int rs_err_code(struct rs_error *err, int dofree_flag); #if defined (__cplusplus) -- cgit v1.1 From c4e2bd206bb9248843a8a4d9a945c5e49a188474 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Wed, 9 Mar 2011 10:16:27 +0100 Subject: Add RSE_DISCO. --- lib/include/radsec/radsec.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/include/radsec/radsec.h') diff --git a/lib/include/radsec/radsec.h b/lib/include/radsec/radsec.h index f620fed..971fc17 100644 --- a/lib/include/radsec/radsec.h +++ b/lib/include/radsec/radsec.h @@ -26,6 +26,7 @@ enum rs_error_code { RSE_INVAL = 17, /* Invalid argument. */ RSE_TIMEOUT_IO = 18, /* I/O timeout. */ RSE_TIMEOUT = 19, /* High level timeout. */ + RSE_DISCO = 20, }; enum rs_conn_type { -- cgit v1.1