2 \brief Public interface for libradsec request's. */
4 /* See LICENSE 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
24 \a user_name and \a user_pw attributes. \a user_name and \a user_pw
25 are optional and can be NULL. If \a user_name and \a user_pw are provided,
26 \a secret must also be provided. \a secret is used for "hiding" the
28 int rs_request_create_authn(struct rs_connection *conn,
29 struct rs_request **req_out,
30 const char *user_name,
34 /** Send request \a req and wait for a matching response. The
35 response is put in \a resp_msg (if not NULL). NOTE: At present,
36 no more than one outstanding request to a given realm is
37 supported. This will change in a future version. */
38 int rs_request_send(struct rs_request *req, struct rs_packet **resp_msg);
40 /** Free all memory allocated by request \a req including any request
41 packet associated with the request. Note that a request must be
42 freed before its associated connection can be freed. */
43 void rs_request_destroy(struct rs_request *req);
45 /** Return request message in request \a req. */
46 struct rs_packet *rs_request_get_reqmsg(const struct rs_request *req);
48 #if defined (__cplusplus)
52 #endif /* _RADSEC_REQUEST_H_ */