Rename rs_config to rs_handle.
authorLinus Nordberg <linus@nordu.net>
Tue, 14 Sep 2010 22:49:54 +0000 (00:49 +0200)
committerLinus Nordberg <linus@nordu.net>
Tue, 14 Sep 2010 22:49:54 +0000 (00:49 +0200)
A configuration will be something else.

lib/base.c
lib/examples/blocking.c
lib/examples/blocking.h
lib/libradsec-base.h
lib/libradsec-levent.h
lib/libradsec.h
lib/tests/test-blocking.c

index 2427bae..77de4e2 100644 (file)
@@ -24,7 +24,7 @@ _do_connect(int type,
 }
 
 static struct list *
-_list_new(const struct rs_config *ctx)
+_list_new(const struct rs_handle *ctx)
 {
     struct list *list = rs_malloc(ctx, sizeof(struct list));
     if (list)
@@ -33,7 +33,7 @@ _list_new(const struct rs_config *ctx)
 }
 
 static int
-_list_push(const struct rs_config *ctx, /* FIXME: code duplicate, list.c */
+_list_push(const struct rs_handle *ctx, /* FIXME: code duplicate, list.c */
           struct list *list,
           void *data)
 {
@@ -57,7 +57,7 @@ _list_push(const struct rs_config *ctx, /* FIXME: code duplicate, list.c */
 }
 
 static void
-_list_destroy(const struct rs_config *ctx, /* FIXME: code dup */
+_list_destroy(const struct rs_handle *ctx, /* FIXME: code dup */
              struct list *list)
 {
     struct list_node *node, *next;
@@ -74,7 +74,7 @@ _list_destroy(const struct rs_config *ctx, /* FIXME: code dup */
 
 /* ------------------------------------------------------- */
 int
-rs_connect(const struct rs_config *conf,
+rs_connect(const struct rs_handle *conf,
           const struct sockaddr *addr,
           socklen_t addrlen)
 {
@@ -96,7 +96,7 @@ rs_connect(const struct rs_config *conf,
 }
 
 int
-rs_disconnect( const struct rs_config *conf, int fd)
+rs_disconnect( const struct rs_handle *conf, int fd)
 {
     switch (conf->conn_type)
     {
@@ -116,7 +116,7 @@ rs_disconnect( const struct rs_config *conf, int fd)
 }
 
 struct rs_packet *
-rs_packet_new(const struct rs_config *ctx,
+rs_packet_new(const struct rs_handle *ctx,
              const uint8_t buf[RS_HEADER_LEN],
              size_t *count)
 {
@@ -136,7 +136,7 @@ rs_packet_new(const struct rs_config *ctx,
 }
 
 struct rs_packet *
-rs_packet_parse(const struct rs_config *ctx,
+rs_packet_parse(const struct rs_handle *ctx,
                struct rs_packet **packet,
                const uint8_t *buf,
                size_t buflen)
@@ -191,7 +191,7 @@ rs_packet_parse(const struct rs_config *ctx,
 }
 
 void
-rs_packet_free(const struct rs_config *ctx,
+rs_packet_free(const struct rs_handle *ctx,
               struct rs_packet **packet)
 {
     _list_destroy(ctx, (*packet)->attrs);
index 35650ea..b66eb64 100644 (file)
@@ -7,7 +7,7 @@
 #include "blocking.h"
 
 struct rs_packet *
-next_packet (const struct rs_config *ctx, int fd)
+next_packet (const struct rs_handle *ctx, int fd)
 {
   uint8_t hdr[RS_HEADER_LEN];
   uint8_t *buf;
@@ -44,7 +44,7 @@ next_packet (const struct rs_config *ctx, int fd)
 }
 
 int
-send_packet(const struct rs_config *ctx, int fd, struct rs_packet *p)
+send_packet(const struct rs_handle *ctx, int fd, struct rs_packet *p)
 {
   uint8_t *buf = NULL;
   ssize_t n = -20;           /* Arbitrary packet size -- a guess.  */
index 04a07a8..f91e6be 100644 (file)
@@ -1,4 +1,4 @@
 #include "libradsec-base.h"
 
-struct rs_packet *next_packet (const struct rs_config *ctx, int fd);
-int send_packet (const struct rs_config *ctx, int fd, struct rs_packet *p);
+struct rs_packet *next_packet (const struct rs_handle *ctx, int fd);
+int send_packet (const struct rs_handle *ctx, int fd, struct rs_packet *p);
index 1c5fab7..e9714fe 100644 (file)
@@ -18,7 +18,7 @@
 
     @return A file descriptor or -1 if an error occurred, in which
     case errno is set appropriately.  */
-int rs_connect(const struct rs_config *conf,
+int rs_connect(const struct rs_handle *conf,
               const struct sockaddr *addr,
               socklen_t addrlen);
 
@@ -28,7 +28,7 @@ int rs_connect(const struct rs_config *conf,
 
     @return 0 on success or -1 if an error occurred, in which case
     errno is set appropriately.  */
-int rs_disconnect(const struct rs_config *conf,
+int rs_disconnect(const struct rs_handle *conf,
                  int fd);
 
 /** Allocate and initialize a packet from a buffer containing a RADIUS
@@ -44,7 +44,7 @@ int rs_disconnect(const struct rs_config *conf,
 
     @return A pointer to a newly allocated packet or NULL on error.
 */
-struct rs_packet *rs_packet_new(const struct rs_config *ctx,
+struct rs_packet *rs_packet_new(const struct rs_handle *ctx,
                                const uint8_t buf[RS_HEADER_LEN],
                                size_t *count);
 
@@ -61,7 +61,7 @@ struct rs_packet *rs_packet_new(const struct rs_config *ctx,
     @return *packet or NULL on error.  If NULL, the packet has been
     freed and *packet is no longer valid.
 */
-struct rs_packet *rs_packet_parse(const struct rs_config *ctx,
+struct rs_packet *rs_packet_parse(const struct rs_handle *ctx,
                                  struct rs_packet **packet,
                                  const uint8_t *buf,
                                  size_t buflen);
@@ -71,7 +71,7 @@ struct rs_packet *rs_packet_parse(const struct rs_config *ctx,
     @param ctx Context.
     @param packet Packet to free.
 */
-void rs_packet_free(const struct rs_config *ctx,
+void rs_packet_free(const struct rs_handle *ctx,
                    struct rs_packet **packet);
 
 /** Serialize a packet.
index f79816c..4189dfc 100644 (file)
@@ -7,7 +7,7 @@
 #include "libradsec.h"
 
 struct rs_connection {
-    struct rs_config *conf;
+    struct rs_handle *conf;
     struct sockaddr_storage addr;
     char open_flag;
 };
index 81c8f4c..61cb9e6 100644 (file)
@@ -43,7 +43,7 @@ struct rs_alloc_scheme {
     rs_realloc_fp realloc;
 };
 
-struct rs_config {
+struct rs_handle {
     enum rs_conn_type conn_type;
     struct rs_credentials transport_credentials;
     struct rs_alloc_scheme alloc_scheme;
index aab76e3..e1f657b 100644 (file)
@@ -13,7 +13,7 @@ f (const struct sockaddr *addr,
 {
   int fd = -1;
   //struct rs_alloc_scheme as = { calloc, malloc, free, realloc };
-  struct rs_config ctx = { RS_CONN_TYPE_TCP,
+  struct rs_handle ctx = { RS_CONN_TYPE_TCP,
                           { RS_CRED_NONE, NULL, NULL },
                           { NULL, NULL, NULL, NULL } };
   struct rs_packet *p = NULL;