uint32_t lifetime; //!< How long before the client is removed.
uint32_t outstanding; //!< number of requests outstanding
time_t created; //!< When the client was created.
+ fr_ipaddr_t network; //!< encapsulating network
#endif
} RADCLIENT;
RADCLIENT *client_findbynumber(RADCLIENT_LIST const *clients, int number);
-RADCLIENT *client_find_old(fr_ipaddr_t const *ipaddr);
-
-bool client_add_dynamic(RADCLIENT_LIST *clients, RADCLIENT *master, RADCLIENT *c);
-
RADCLIENT *client_read(char const *filename, CONF_SECTION *server_cs, bool check_dns);
#ifdef __cplusplus
}
return NULL;
}
-/*
- * Old wrapper for client_find
- */
-RADCLIENT *client_find_old(fr_ipaddr_t const *ipaddr)
-{
- return client_find(root_clients, ipaddr, IPPROTO_UDP);
-}
-
static fr_ipaddr_t cl_ipaddr;
static char const *cl_srcipaddr = NULL;
#ifdef WITH_TCP
/** Add a dynamic client
*
*/
-bool client_add_dynamic(RADCLIENT_LIST *clients, RADCLIENT *master, RADCLIENT *c)
+static bool client_add_dynamic(RADCLIENT_LIST *clients, RADCLIENT *master, RADCLIENT *c)
{
char buffer[128];
static ssize_t dynamic_client_alloc(proto_radius_udp_t *inst, uint8_t *packet, size_t packet_len,
- proto_radius_udp_address_t *address, fr_tracking_entry_t **track, UNUSED fr_ipaddr_t *network)
+ proto_radius_udp_address_t *address, fr_tracking_entry_t **track, fr_ipaddr_t *network)
{
RADCLIENT *client;
client->ipaddr = address->src_ipaddr;
client->src_ipaddr = address->dst_ipaddr;
+ client->network = *network;
address->client = client;
}
client_delete(inst->dynamic_clients.clients, client);
- client_free(client); /* @todo - fix this to NOT have a FIFO */
+ client_free(client);
return buffer_len;
}
inst->dynamic_clients.num_pending_clients--;
- // @todo - update the client definition, etc...
+ // @todo - create / pack the client definition...
/*
* This particular packet had a later one
}
}
- // @todo - sanity check parameters
-
parent_inst = cf_data_value(cf_data_find(cf_parent(cs), dl_instance_t, "proto_radius"));
rad_assert(parent_inst != NULL);
* Allow static clients for this virtual server.
*/
inst->dynamic_clients.clients = client_list_init(NULL); // client_list_parse_section(inst->parent->server_cs, false);
+
+ FR_INTEGER_BOUND_CHECK("max_clients", inst->dynamic_clients.max_clients, >=, 1);
+ FR_INTEGER_BOUND_CHECK("max_clients", inst->dynamic_clients.max_clients, <=, (1 << 20));
+
+ FR_INTEGER_BOUND_CHECK("max_pending_clients", inst->dynamic_clients.max_pending_clients, >=, 4);
+ FR_INTEGER_BOUND_CHECK("max_pending_clients", inst->dynamic_clients.max_pending_clients, <=, 2048);
+
+ FR_INTEGER_BOUND_CHECK("max_pending_packets", inst->dynamic_clients.max_pending_clients, >=, 256);
+ FR_INTEGER_BOUND_CHECK("max_pending_packets", inst->dynamic_clients.max_pending_clients, <=, 65536);
}
return 0;