2 \brief Public interface for libradsec request's. */
4 /* See the file COPYING for licensing information. */
6 #ifndef _RADSEC_REQUEST_H_
7 #define _RADSEC_REQUEST_H_ 1
11 #if defined (__cplusplus)
15 /** Create a request associated with connection \a conn. */
16 int rs_request_create(struct rs_connection *conn, struct rs_request **req_out);
18 /** Add RADIUS request message \a req_msg to request \a req.
19 FIXME: Rename to rs_request_add_reqmsg? */
20 void rs_request_add_reqpkt(struct rs_request *req, struct rs_packet *req_msg);
22 /** Create a request associated with connection \a conn containing a
23 newly created RADIUS authentication message, possibly with \a
24 user_name and \a user_pw attributes. \a user_name and _user_pw
25 are optional and can be NULL. If they are present, \a secret must
26 also be given and is used for "hiding" the password. */
27 int rs_request_create_authn(struct rs_connection *conn,
28 struct rs_request **req_out,
29 const char *user_name,
33 /** Send request \a req and wait for a matching response. The
34 response is put in \a resp_msg (if not NULL). NOTE: At present,
35 no more than one outstanding request to a given realm is
36 supported. This will change in a future version. */
37 int rs_request_send(struct rs_request *req, struct rs_packet **resp_msg);
39 /** Free all memory allocated by request \a req including any request
40 packet associated with the request. Note that a request must be
41 freed before its associated connection can be freed. */
42 void rs_request_destroy(struct rs_request *req);
44 /** Return request message in request \a req. */
45 struct rs_packet *rs_request_get_reqmsg(const struct rs_request *req);
47 #if defined (__cplusplus)
51 #endif /* _RADSEC_REQUEST_H_ */