summaryrefslogtreecommitdiff
path: root/lib/request.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2010-10-03 16:24:57 +0200
committerLinus Nordberg <linus@nordu.net>2010-10-03 16:24:57 +0200
commit21300197afcabc90366454eaa34e67187c53d974 (patch)
treeaa2b92a3e041335130994a0d3f6652f14983f634 /lib/request.c
parent81aa93c41def5b73bc5523de852c429355926e93 (diff)
WIP -- prepare for request objects.
Diffstat (limited to 'lib/request.c')
-rw-r--r--lib/request.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/request.c b/lib/request.c
new file mode 100644
index 0000000..da38015
--- /dev/null
+++ b/lib/request.c
@@ -0,0 +1,46 @@
+/* See the file COPYING for licensing information. */
+
+#include <time.h>
+#include <event2/event.h>
+#include <radsec/radsec.h>
+#include <radsec/radsec-impl.h>
+#include <radsec/request.h>
+#include <radsec/request-impl.h>
+
+int
+rs_req_create (struct rs_connection *conn, struct rs_request **req_out)
+{
+ struct rs_request *req = rs_malloc (conn->ctx, sizeof(*req));
+ if (!req)
+ return rs_conn_err_push_fl (conn, RSE_NOMEM, __FILE__, __LINE__, NULL);
+ memset (req, 0, sizeof(*req));
+ req->conn = conn;
+ *req_out = req;
+ return RSE_OK;
+}
+
+void
+rs_req_destroy(struct rs_request *request)
+{
+ rs_packet_destroy (request->req);
+ rs_packet_destroy (request->resp);
+ rs_free (request->conn->ctx, request);
+}
+
+#if 0
+static void
+_timer_cb(evutil_socket_t fd, short what, void *arg)
+
+{
+}
+#endif
+
+int
+rs_req_send(struct rs_request *request, struct rs_packet *req,
+ struct rs_packet **resp)
+{
+ /* install our own callback, backing up any user provided one in
+ req->saved_cb*/
+
+ return -1;
+}