X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=lib%2Finclude%2Fradsec%2Frequest.h;h=f0151f8243ec919d2353de859456426e14aba95c;hb=8f6155f3fa89f0b8c16bdc3b73db2d479105aab4;hp=939345e79b3e495de3aafe24e61050121b3dadff;hpb=e06796fe52596f417d74b3c3758ff0a321f67274;p=libradsec.git diff --git a/lib/include/radsec/request.h b/lib/include/radsec/request.h index 939345e..f0151f8 100644 --- a/lib/include/radsec/request.h +++ b/lib/include/radsec/request.h @@ -1,7 +1,52 @@ -/* See the file COPYING for licensing information. */ +/** \file request.h + \brief Public interface for libradsec request's. */ + +/* See LICENSE for licensing information. */ + +#ifndef _RADSEC_REQUEST_H_ +#define _RADSEC_REQUEST_H_ 1 struct rs_request; +#if defined (__cplusplus) +extern "C" { +#endif + +/** Create a request associated with connection \a conn. */ int rs_request_create(struct rs_connection *conn, struct rs_request **req_out); -void rs_request_destroy(struct rs_request *request); -int rs_request_send(struct rs_request *request, struct rs_packet *req, struct rs_packet **resp); + +/** Add RADIUS request message \a req_msg to request \a req. + FIXME: Rename to rs_request_add_reqmsg? */ +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. */ +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); + +/** Send request \a req and wait for a matching response. The + response is put in \a resp_msg (if not NULL). NOTE: At present, + no more than one outstanding request to a given realm is + supported. This will change in a future version. */ +int rs_request_send(struct rs_request *req, struct rs_packet **resp_msg); + +/** Free all memory allocated by request \a req including any request + packet associated with the request. Note that a request must be + freed before its associated connection can be freed. */ +void rs_request_destroy(struct rs_request *req); + +/** Return request message in request \a req. */ +struct rs_packet *rs_request_get_reqmsg(const struct rs_request *req); + +#if defined (__cplusplus) +} +#endif + +#endif /* _RADSEC_REQUEST_H_ */