diff options
author | Linus Nordberg <linus@nordu.net> | 2010-10-02 21:31:50 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2010-10-02 21:31:50 +0200 |
commit | be4b786700ad03de5226951c043fefb345c0df4c (patch) | |
tree | e048b100e34ddcfebadabb459f9af7c55d01b3ce /lib/libradsec-impl.h | |
parent | 7ec20f4101e5a1ef0b5f2537f25a4f8d74ad1104 (diff) |
WIP
Diffstat (limited to 'lib/libradsec-impl.h')
-rw-r--r-- | lib/libradsec-impl.h | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/lib/libradsec-impl.h b/lib/libradsec-impl.h deleted file mode 100644 index 3abb71e..0000000 --- a/lib/libradsec-impl.h +++ /dev/null @@ -1,88 +0,0 @@ -/** @file libradsec-impl.h - @brief Libraray internal header file for libradsec. */ - -/* See the file COPYING for licensing information. */ - -#include <freeradius/libradius.h> -#include <event2/util.h> - -/* Constants. */ -#define RS_HEADER_LEN 4 - -/* Data types. */ -enum rs_cred_type { - RS_CRED_NONE = 0, - RS_CRED_TLS_PSK_RSA, /* RFC 4279. */ -}; -typedef unsigned int rs_cred_type_t; - -struct rs_packet; - -struct rs_credentials { - enum rs_cred_type type; - char *identity; - char *secret; -}; - -struct rs_error { - int code; - char *msg; - char buf[1024]; -}; - -struct rs_handle { - struct rs_alloc_scheme alloc_scheme; - struct rs_error *err; - fr_randctx fr_randctx; - /* TODO: dictionary? */ -}; - -struct rs_peer { - struct rs_connection *conn; - struct evutil_addrinfo *addr; - int s; /* Socket. */ - char is_connecting; - char is_connected; - char *secret; - int timeout; /* client only */ - int tries; /* client only */ - struct rs_peer *next; -}; - -struct rs_connection { - struct rs_handle *ctx; - struct event_base *evb; - struct bufferevent *bev; - enum rs_conn_type type; - struct rs_credentials transport_credentials; - struct rs_conn_callbacks callbacks; - struct rs_peer *peers; - struct rs_peer *active_peer; - struct rs_error *err; -}; - -struct rs_packet { - struct rs_connection *conn; - char hdr_read_flag; - uint8_t hdr[4]; - RADIUS_PACKET *rpkt; -}; - -struct rs_attr { - struct rs_packet *pkt; - VALUE_PAIR *vp; -}; - -/* Convenience macros. */ -#define rs_calloc(h, nmemb, size) \ - (h->alloc_scheme.calloc ? h->alloc_scheme.calloc : calloc)(nmemb, size) -#define rs_malloc(h, size) \ - (h->alloc_scheme.malloc ? h->alloc_scheme.malloc : malloc)(size) -#define rs_free(h, ptr) \ - (h->alloc_scheme.free ? h->alloc_scheme.free : free)(ptr) -#define rs_realloc(h, realloc, ptr, size) \ - (h->alloc_scheme.realloc ? h->alloc_scheme.realloc : realloc)(ptr, size) - -/* Local Variables: */ -/* c-file-style: "stroustrup" */ -/* End: */ |