remove rs_packet_frpkt
[libradsec.git] / lib / include / radsec / radsec-impl.h
index a924fc9..da4e99c 100644 (file)
@@ -3,7 +3,9 @@
 
 /* See the file COPYING for licensing information.  */
 
-#include <freeradius/libradius.h>
+#ifndef _RADSEC_RADSEC_IMPL_H_
+#define _RADSEC_RADSEC_IMPL_H_ 1
+
 #include <event2/util.h>
 #include <confuse.h>
 #if defined(RS_ENABLE_TLS)
@@ -35,7 +37,8 @@ struct rs_error {
     char buf[1024];
 };
 
-struct rs_peer {               /* Config object for a connection.  */
+/** Configuration object for a connection.  */
+struct rs_peer {
     struct rs_connection *conn;
     struct rs_realm *realm;
     struct evutil_addrinfo *addr;
@@ -43,7 +46,8 @@ struct rs_peer {              /* Config object for a connection.  */
     struct rs_peer *next;
 };
 
-struct rs_realm {            /* Config object for a RADIUS realm.  */
+/** Configuration object for a RADIUS realm.  */
+struct rs_realm {
     char *name;
     enum rs_conn_type type;
     int timeout;
@@ -56,12 +60,17 @@ struct rs_realm {         /* Config object for a RADIUS realm.  */
     struct rs_realm *next;
 };
 
-struct rs_context {
+/** Top configuration object.  */
+struct rs_config {
+    char *dictionary;
     struct rs_realm *realms;
+    cfg_t *cfg;
+};
+
+struct rs_context {
+    struct rs_config *config;
     struct rs_alloc_scheme alloc_scheme;
     struct rs_error *err;
-    fr_randctx fr_randctx;
-    cfg_t *cfg;
 };
 
 struct rs_connection {
@@ -75,6 +84,7 @@ struct rs_connection {
     struct rs_peer *peers;
     struct rs_peer *active_peer;
     struct rs_error *err;
+    struct timeval timeout;
     char is_connecting;                /* FIXME: replace with a single state member */
     char is_connected;         /* FIXME: replace with a single state member */
     int fd;                    /* Socket.  */
@@ -99,30 +109,21 @@ enum rs_packet_flags {
     rs_packet_sent_flag,
 };
 
+struct radius_packet;
+
 struct rs_packet {
     struct rs_connection *conn;
     unsigned int flags;
     uint8_t hdr[RS_HEADER_LEN];
-    RADIUS_PACKET *rpkt;
+    struct radius_packet *rpkt;        /* FreeRADIUS object.  */
     struct rs_packet *next;    /* Used for UDP output queue.  */
 };
 
-struct rs_attr {
-    struct rs_packet *pkt;
-    VALUE_PAIR *vp;
-};
-
-/* Nonpublic functions.  */
-struct rs_error *_rs_resolv(struct evutil_addrinfo **addr,
-                           rs_conn_type_t type, const char *hostname,
+/* Nonpublic functions (in radsec.c -- FIXME: move?).  */
+struct rs_error *rs_resolv (struct evutil_addrinfo **addr,
+                           rs_conn_type_t type,
+                           const char *hostname,
                            const char *service);
-struct rs_peer *_rs_peer_create(struct rs_context *ctx,
-                               struct rs_peer **rootp);
-struct rs_error *_rs_err_create(unsigned int code, const char *file,
-                               int line, const char *fmt, ...);
-int _rs_err_conn_push_err(struct rs_connection *conn,
-                         struct rs_error *err);
-
 
 #if defined (__cplusplus)
 }
@@ -140,6 +141,8 @@ int _rs_err_conn_push_err(struct rs_connection *conn,
 #define min(a, b) ((a) < (b) ? (a) : (b))
 #define max(a, b) ((a) > (b) ? (a) : (b))
 
+#endif /* _RADSEC_RADSEC_IMPL_H_ */
+
 /* Local Variables: */
 /* c-file-style: "stroustrup" */
 /* End: */