Add rs_request_get_reqmsg() and update documentation.
[radsecproxy.git] / lib / include / radsec / request.h
1 /** \file request.h
2     \brief Public interface for libradsec request's.  */
3
4 /* See the file COPYING for licensing information.  */
5
6 struct rs_request;
7
8 #if defined (__cplusplus)
9 extern "C" {
10 #endif
11
12 /** Create a request associated with connection \a conn.  */
13 int rs_request_create(struct rs_connection *conn, struct rs_request **req_out);
14
15 /** Add RADIUS request message \a req_msg to request \a req.
16     FIXME: Rename to rs_request_add_reqmsg?  */
17 void rs_request_add_reqpkt(struct rs_request *req, struct rs_packet *req_msg);
18
19 /** Create a request associated with connection \a conn containing a
20     newly created RADIUS authentication message, possibly with \a
21     user_name and \a user_pw attributes.  \a user_name and _user_pw
22     are optional and can be NULL.  */
23 int rs_request_create_authn(struct rs_connection *conn,
24                             struct rs_request **req_out,
25                             const char *user_name,
26                             const char *user_pw);
27
28 /** Send request \a req and wait for a matching response.  The
29     response is put in \a resp_msg (if not NULL).  NOTE: At present,
30     no more than one outstanding request to a given realm is
31     supported.  This will change in a future version.  */
32 int rs_request_send(struct rs_request *req, struct rs_packet **resp_msg);
33
34 /** Free all memory allocated by request \a req including any request
35     packet associated with the request.  Note that a request must be
36     freed before its associated connection can be freed.  */
37 void rs_request_destroy(struct rs_request *req);
38
39 /** Return request message in request \a req.  */
40 struct rs_packet *rs_request_get_reqmsg(const struct rs_request *req);
41
42 #if defined (__cplusplus)
43 }
44 #endif