From 682a426b16c8cc225ce952bf4aa1c7cc210dde71 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Mon, 28 Feb 2011 13:15:13 +0100 Subject: Rename relevant functions to reflect authn as opposed to authz. Also add a "bare" create request function. --- lib/request.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'lib/request.c') diff --git a/lib/request.c b/lib/request.c index 5d2ae43..cfd0ddb 100644 --- a/lib/request.c +++ b/lib/request.c @@ -13,16 +13,35 @@ #include int -rs_request_create (struct rs_connection *conn, struct rs_request **req_out, - const char *user_name, const char *user_pw) +rs_request_create (struct rs_connection *conn, struct rs_request **req_out) { struct rs_request *req = rs_malloc (conn->ctx, sizeof(*req)); if (!req) return rs_err_conn_push_fl (conn, RSE_NOMEM, __FILE__, __LINE__, NULL); memset (req, 0, sizeof(*req)); req->conn = conn; + *req_out = req; + return RSE_OK; +} + +void +rs_request_add_reqpkt (struct rs_request *req, struct rs_packet *reqpkt) +{ + req->req_msg = reqpkt; +} + +int +rs_request_create_authn (struct rs_connection *conn, + struct rs_request **req_out, + const char *user_name, + const char *user_pw) +{ + struct rs_request *req; + + if (rs_request_create (conn, &req)) + return -1; - if (rs_packet_create_auth_request (conn, &req->req_msg, user_name, user_pw)) + if (rs_packet_create_authn_request (conn, &req->req_msg, user_name, user_pw)) return -1; *req_out = req; -- cgit v1.1