summaryrefslogtreecommitdiff
path: root/lib/request.c
blob: f0b15e00a879f565b32baae4beab37ca3aa0994d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* See the file COPYING for licensing information.  */

#include <time.h>
#include <assert.h>
#include <event2/event.h>
#include <radsec/radsec.h>
#include <radsec/radsec-impl.h>
#include <radsec/request.h>
#include <radsec/request-impl.h>

static int
_rs_decrypt_mppe(struct rs_request *request, VALUE_PAIR *vp);

int
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_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;
}