A configuration will be something else.
}
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)
}
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)
{
}
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;
/* ------------------------------------------------------- */
int
-rs_connect(const struct rs_config *conf,
+rs_connect(const struct rs_handle *conf,
const struct sockaddr *addr,
socklen_t addrlen)
{
}
int
-rs_disconnect( const struct rs_config *conf, int fd)
+rs_disconnect( const struct rs_handle *conf, int fd)
{
switch (conf->conn_type)
{
}
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)
{
}
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)
}
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);
#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;
}
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. */
#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);
@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);
@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
@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);
@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);
@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.
#include "libradsec.h"
struct rs_connection {
- struct rs_config *conf;
+ struct rs_handle *conf;
struct sockaddr_storage addr;
char open_flag;
};
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;
{
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;