summaryrefslogtreecommitdiff
path: root/lib/radsec.c
blob: f645ee1f3bf37bdd8564b6e1d13299c5aed2f06c (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <libgen.h>

#include <freeradius/libradius.h>
#include "libradsec.h"
#include "libradsec-impl.h"

int
rs_context_create(struct rs_handle **ctx, const char *dict)
{
  struct rs_handle *h;

  *ctx = NULL;
  h = (struct rs_handle *) malloc (sizeof (struct rs_handle));
  if (h)
    {
      char *buf;
      char *dir, *fn;

      buf = malloc (strlen (dict) + 1);
      if (!buf)
	{
	  free (h);
	  return RSE_NOMEM;
	}
      strcpy (buf, dict);
      dir = dirname (buf);
      free (buf);
      strcpy (buf, dict);
      fn = basename (buf);
      free (buf);
      if (dict_init (dir, fn) < 0)
	{
	  free (h);
	  return RSE_SOME_ERROR;
	}
#if defined (DEBUG)
      fr_log_fp = stderr;
      fr_debug_flag = 1;
#endif
      fr_randinit (&h->fr_randctx, 0);
      fr_rand_seed (NULL, 0);

      *ctx = h;
    }
  return (h ? RSE_OK : RSE_NOMEM);
}

void rs_context_destroy(struct rs_handle *ctx)
{
  free (ctx);
}

int rs_context_set_alloc_scheme(struct rs_handle *ctx, struct rs_alloc_scheme *scheme)
{
  return RSE_NOSYS;
}

int rs_context_config_read(struct rs_handle *ctx, const char *config_file)
{
  return RSE_NOSYS;
}

int rs_conn_create(const struct rs_handle *ctx, struct rs_connection **conn)
{
  return RSE_NOSYS;
}

int rs_conn_add_server(struct rs_connection  *conn, rs_conn_type_t type, const char *host, int port, int timeout, int tries, const char *secret)
{
  return RSE_NOSYS;
}

int rs_conn_add_listener(struct rs_connection  *conn, rs_conn_type_t type, const char *host, int port, const char *secret)
{
  return RSE_NOSYS;
}

int rs_conn_destroy(struct rs_connection  *conn)
{
  return RSE_NOSYS;
}

int rs_conn_set_eventbase(struct rs_connection *conn, struct event_base *eb)
{
  return RSE_NOSYS;
}

int rs_conn_set_callbacks(struct rs_connection *conn, struct rs_conn_callbacks *cb)
{
  return RSE_NOSYS;
}

int rs_conn_set_server(struct rs_connection *conn, const char *name)
{
  return RSE_NOSYS;
}

int rs_conn_get_server(const struct rs_connection *conn, const char *name, size_t buflen)
{
  return RSE_NOSYS;
}