2 \brief Public interface for libradsec request's. */
4 /* Copyright 2010-2013 NORDUnet A/S. All rights reserved.
5 See LICENSE for licensing information. */
7 #ifndef _RADSEC_REQUEST_H_
8 #define _RADSEC_REQUEST_H_ 1
12 #if defined (__cplusplus)
16 /** Create a request associated with connection \a conn. */
17 int rs_request_create(struct rs_connection *conn, struct rs_request **req_out);
19 /** Add RADIUS request message \a req_msg to request \a req.
20 FIXME: Rename to rs_request_add_reqmsg? */
21 void rs_request_add_reqpkt(struct rs_request *req, struct rs_packet *req_msg);
23 /** Create a request associated with connection \a conn containing a
24 newly created RADIUS authentication message, possibly with \a
25 user_name and \a user_pw attributes. \a user_name and _user_pw
26 are optional and can be NULL. */
27 int rs_request_create_authn(struct rs_connection *conn,
28 struct rs_request **req_out,
29 const char *user_name,
32 /** Send request \a req and wait for a matching response. The
33 response is put in \a resp_msg (if not NULL). NOTE: At present,
34 no more than one outstanding request to a given realm is
35 supported. This will change in a future version. */
36 int rs_request_send(struct rs_request *req, struct rs_packet **resp_msg);
38 /** Free all memory allocated by request \a req including any request
39 packet associated with the request. Note that a request must be
40 freed before its associated connection can be freed. */
41 void rs_request_destroy(struct rs_request *req);
43 /** Return request message in request \a req. */
44 struct rs_packet *rs_request_get_reqmsg(const struct rs_request *req);
46 #if defined (__cplusplus)
50 #endif /* _RADSEC_REQUEST_H_ */