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. */
26 int rs_request_create_authn(struct rs_connection *conn,
27 struct rs_request **req_out,
28 const char *user_name,
31 /** Send request \a req and wait for a matching response. The
32 response is put in \a resp_msg (if not NULL). NOTE: At present,
33 no more than one outstanding request to a given realm is
34 supported. This will change in a future version. */
35 int rs_request_send(struct rs_request *req, struct rs_packet **resp_msg);
37 /** Free all memory allocated by request \a req including any request
38 packet associated with the request. Note that a request must be
39 freed before its associated connection can be freed. */
40 void rs_request_destroy(struct rs_request *req);
42 /** Return request message in request \a req. */
43 struct rs_packet *rs_request_get_reqmsg(const struct rs_request *req);
45 #if defined (__cplusplus)
49 #endif /* _RADSEC_REQUEST_H_ */