From 683e3e1bbbdfe2f08dc12f1e840e71ed6088a0e3 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Thu, 24 Jan 2013 08:32:23 +0100 Subject: Rename rs_packet_flags members. Uppercase to make them appear as the constants they are, as opposed to variables. Remove 'flag' suffix, typically used for variables. Spell out HEADER. --- lib/include/radsec/radsec-impl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/include') diff --git a/lib/include/radsec/radsec-impl.h b/lib/include/radsec/radsec-impl.h index a4d97f0..6c02dcf 100644 --- a/lib/include/radsec/radsec-impl.h +++ b/lib/include/radsec/radsec-impl.h @@ -116,9 +116,9 @@ struct rs_connection { }; enum rs_packet_flags { - rs_packet_hdr_read_flag, - rs_packet_received_flag, - rs_packet_sent_flag, + RS_PACKET_HEADER_READ, + RS_PACKET_RECEIVED, + RS_PACKET_SENT, }; struct radius_packet; -- cgit v1.1 From 7b40db442c2fccaa484c6162b238b4e707e8733e Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Tue, 29 Jan 2013 15:27:26 +0100 Subject: Improve documentation. --- lib/include/radsec/radsec.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'lib/include') diff --git a/lib/include/radsec/radsec.h b/lib/include/radsec/radsec.h index 7bd7f10..fb2aea9 100644 --- a/lib/include/radsec/radsec.h +++ b/lib/include/radsec/radsec.h @@ -296,16 +296,21 @@ int rs_packet_create(struct rs_connection *conn, struct rs_packet **pkt_out); /** Free all memory allocated for packet \a pkt. */ void rs_packet_destroy(struct rs_packet *pkt); -/** Send packet \a pkt on the connection associated with \a pkt. \a - user_data is sent to the \a rs_conn_packet_received_cb callback - registered with the connection. If no callback is registered with +/** Send packet \a pkt on the connection associated with \a pkt. + \a user_data is passed to the \a rs_conn_packet_received_cb callback + registered with the connection. If no callback is registered with the connection, the event loop is run by \a rs_packet_send and it - blocks until the packet has been succesfully sent. - - \return On success, RSE_OK (0) is returned. On error, !0 is + blocks until the full packet has been sent. Note that sending can + fail in several ways, f.ex. if the transmission protocol in use + is connection oriented (\a RS_CONN_TYPE_TCP and \a RS_CONN_TYPE_TLS) + and the connection can not be established. Also note that no + retransmission is done, something that is required for connectionless + transport protocols (\a RS_CONN_TYPE_UDP and \a RS_CONN_TYPE_DTLS). + The "request" API with \a rs_request_send can help with this. + + \return On success, RSE_OK (0) is returned. On error, !0 is returned and a struct \a rs_error is pushed on the error stack for - the connection. The error can be accessed using \a - rs_err_conn_pop. */ + the connection. The error can be accessed using \a rs_err_conn_pop. */ int rs_packet_send(struct rs_packet *pkt, void *user_data); /** Create a RADIUS authentication request packet associated with -- cgit v1.1 From c682577a243902164de1d80f38425a66a4853d82 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Mon, 6 May 2013 12:00:00 +0200 Subject: Revert "Add formal argument 'secret' to two public functions." This reverts commit 09d1cff2418a900b587b2113f508984f2417cc11. Conflicts: lib/include/radsec/request.h --- lib/include/radsec/radsec.h | 8 +++----- lib/include/radsec/request.h | 11 ++++------- 2 files changed, 7 insertions(+), 12 deletions(-) (limited to 'lib/include') diff --git a/lib/include/radsec/radsec.h b/lib/include/radsec/radsec.h index fb2aea9..2d20b6e 100644 --- a/lib/include/radsec/radsec.h +++ b/lib/include/radsec/radsec.h @@ -315,14 +315,12 @@ int rs_packet_send(struct rs_packet *pkt, void *user_data); /** Create a RADIUS authentication request packet associated with connection \a conn. Optionally, User-Name and User-Password - attributes are added to the packet using the data in \a user_name, - \a user_pw and \a secret where \secret is the RADIUS shared - secret. */ + attributes are added to the packet using the data in \a user_name + and \a user_pw. */ int rs_packet_create_authn_request(struct rs_connection *conn, struct rs_packet **pkt, const char *user_name, - const char *user_pw, - const char *secret); + const char *user_pw); /*** Append \a tail to packet \a pkt. */ int diff --git a/lib/include/radsec/request.h b/lib/include/radsec/request.h index f0151f8..7e58008 100644 --- a/lib/include/radsec/request.h +++ b/lib/include/radsec/request.h @@ -20,16 +20,13 @@ int rs_request_create(struct rs_connection *conn, struct rs_request **req_out); void rs_request_add_reqpkt(struct rs_request *req, struct rs_packet *req_msg); /** Create a request associated with connection \a conn containing a - newly created RADIUS authentication message, possibly with - \a user_name and \a user_pw attributes. \a user_name and \a user_pw - are optional and can be NULL. If \a user_name and \a user_pw are provided, - \a secret must also be provided. \a secret is used for "hiding" the - password. */ + newly created RADIUS authentication message, possibly with \a + user_name and \a user_pw attributes. \a user_name and _user_pw + are optional and can be NULL. */ int rs_request_create_authn(struct rs_connection *conn, struct rs_request **req_out, const char *user_name, - const char *user_pw, - const char *secret); + const char *user_pw); /** Send request \a req and wait for a matching response. The response is put in \a resp_msg (if not NULL). NOTE: At present, -- cgit v1.1 From 25261df09d801d070df4c31e11e1702614546090 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Wed, 8 May 2013 12:00:00 +0200 Subject: Remove an unused error code and unusued RSE_MAX. Also, remove unused file attr.c. --- lib/include/radsec/radsec.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib/include') diff --git a/lib/include/radsec/radsec.h b/lib/include/radsec/radsec.h index 2d20b6e..00c8d7b 100644 --- a/lib/include/radsec/radsec.h +++ b/lib/include/radsec/radsec.h @@ -29,7 +29,6 @@ enum rs_error_code { RSE_INVALID_CTX = 3, RSE_INVALID_CONN = 4, RSE_CONN_TYPE_MISMATCH = 5, - RSE_FR = 6, RSE_BADADDR = 7, RSE_NOPEER = 8, RSE_EVENT = 9, /* libevent error. */ @@ -68,7 +67,6 @@ enum rs_error_code { RSE_VENDOR_UNKNOWN = 42, RSE_CRED = 43, RSE_CERT = 44, - RSE_MAX = RSE_CERT }; enum rs_conn_type { -- cgit v1.1 From f71f1bdd87e58fb6fb5abc90a1b2119a4f35f1b3 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Wed, 8 May 2013 17:05:57 +0200 Subject: Revive RSE_MAX. It's being used after all. --- lib/include/radsec/radsec.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/include') diff --git a/lib/include/radsec/radsec.h b/lib/include/radsec/radsec.h index 00c8d7b..230f671 100644 --- a/lib/include/radsec/radsec.h +++ b/lib/include/radsec/radsec.h @@ -67,6 +67,7 @@ enum rs_error_code { RSE_VENDOR_UNKNOWN = 42, RSE_CRED = 43, RSE_CERT = 44, + RSE_MAX = RSE_CERT }; enum rs_conn_type { -- cgit v1.1 From f0df8b47b0c7639ab3842c2b92c80f70b8ed66d3 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Thu, 9 May 2013 09:49:37 +0200 Subject: Update copyright years. --- lib/include/radsec/radsec-impl.h | 3 ++- lib/include/radsec/radsec.h | 3 ++- lib/include/radsec/request-impl.h | 3 ++- lib/include/radsec/request.h | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/include') diff --git a/lib/include/radsec/radsec-impl.h b/lib/include/radsec/radsec-impl.h index 6c02dcf..e472703 100644 --- a/lib/include/radsec/radsec-impl.h +++ b/lib/include/radsec/radsec-impl.h @@ -1,7 +1,8 @@ /** @file libradsec-impl.h @brief Libraray internal header file for libradsec. */ -/* See LICENSE for licensing information. */ +/* Copyright 2010-2013 NORDUnet A/S. All rights reserved. + See LICENSE for licensing information. */ #ifndef _RADSEC_RADSEC_IMPL_H_ #define _RADSEC_RADSEC_IMPL_H_ 1 diff --git a/lib/include/radsec/radsec.h b/lib/include/radsec/radsec.h index 230f671..d6150bf 100644 --- a/lib/include/radsec/radsec.h +++ b/lib/include/radsec/radsec.h @@ -1,7 +1,8 @@ /** \file radsec.h \brief Public interface for libradsec. */ -/* See LICENSE for licensing information. */ +/* Copyright 2010-2013 NORDUnet A/S. All rights reserved. + See LICENSE for licensing information. */ #ifndef _RADSEC_RADSEC_H_ #define _RADSEC_RADSEC_H_ 1 diff --git a/lib/include/radsec/request-impl.h b/lib/include/radsec/request-impl.h index bb61dd6..97335e5 100644 --- a/lib/include/radsec/request-impl.h +++ b/lib/include/radsec/request-impl.h @@ -1,4 +1,5 @@ -/* See LICENSE for licensing information. */ +/* Copyright 2010-2011 NORDUnet A/S. All rights reserved. + See LICENSE for licensing information. */ #ifndef _RADSEC_REQUEST_IMPL_H_ #define _RADSEC_REQUEST_IMPL_H_ 1 diff --git a/lib/include/radsec/request.h b/lib/include/radsec/request.h index 7e58008..d4c72b3 100644 --- a/lib/include/radsec/request.h +++ b/lib/include/radsec/request.h @@ -1,7 +1,8 @@ /** \file request.h \brief Public interface for libradsec request's. */ -/* See LICENSE for licensing information. */ +/* Copyright 2010-2013 NORDUnet A/S. All rights reserved. + See LICENSE for licensing information. */ #ifndef _RADSEC_REQUEST_H_ #define _RADSEC_REQUEST_H_ 1 -- cgit v1.1