* @param[in,out] buffer the buffer where the raw packet will be written to (or read from)
* @param[in] buffer_len the length of the buffer
* @param[out] leftover bytes left in the buffer after reading a full packet.
- * @param[out] priority priority of this packet (0 = low, 65535 = high)
* @return
* - <0 on error
* - >=0 length of the data read or written.
*/
-typedef ssize_t (*fr_io_data_read_t)(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time, uint8_t *buffer, size_t buffer_len, size_t *leftover, uint32_t *priority);
+typedef ssize_t (*fr_io_data_read_t)(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time, uint8_t *buffer, size_t buffer_len, size_t *leftover);
/** Write a socket.
*
* The app_io->read does the transport-specific data read.
*/
static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p,
- uint8_t *buffer, size_t buffer_len, size_t *leftover, uint32_t *priority)
+ uint8_t *buffer, size_t buffer_len, size_t *leftover)
{
fr_io_instance_t const *inst;
fr_io_thread_t *thread;
fr_io_track_t *track, *new_track;
fr_listen_t *child;
int value, accept_fd = -1;
+ uint32_t priority = PRIORITY_NORMAL;
get_inst(li, &inst, &thread, &connection, &child);
*/
*packet_ctx = track;
*leftover = 0;
- *priority = pending->priority;
recv_time = *recv_time_p = pending->recv_time;
client = track->client;
* functions which do all of the TLS work.
*/
packet_len = inst->app_io->read(child, (void **) &local_address, &recv_time,
- buffer, buffer_len, leftover, priority);
+ buffer, buffer_len, leftover);
if (packet_len <= 0) {
return packet_len;
}
inst->app_io->common.name, fr_box_ipaddr(address.socket.inet.src_ipaddr));
return 0;
}
- *priority = value;
- } else {
- *priority = PRIORITY_NORMAL;
+ priority = value;
}
/*
* Allocate the pending packet structure.
*/
pending = fr_io_pending_alloc(client, buffer, packet_len,
- track, *priority);
+ track, priority);
if (!pending) {
DEBUG("Failed tracking packet from client %pV - discarding packet", fr_box_ipaddr(client->src_ipaddr));
goto done;
* connection.
*/
data_size = s->listen->app_io->read(s->listen, &cd->packet_ctx, &cd->request.recv_time,
- cd->m.data, cd->m.rb_size, &s->leftover, &cd->priority);
+ cd->m.data, cd->m.rb_size, &s->leftover);
if (data_size == 0) {
/*
* Cache the message for later. This is
CONF_PARSER_TERMINATOR
};
-static ssize_t mod_read(fr_listen_t *li, UNUSED void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover, UNUSED uint32_t *priority)
+static ssize_t mod_read(fr_listen_t *li, UNUSED void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover)
{
proto_arp_ethernet_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_arp_ethernet_thread_t);
int ret;
static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len,
- size_t *leftover, UNUSED uint32_t *priority)
+ size_t *leftover)
{
proto_bfd_udp_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_bfd_udp_t);
proto_bfd_udp_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_bfd_udp_thread_t);
/*
* Run a command.
*/
-static ssize_t mod_read_command(fr_listen_t *li, UNUSED void **packet_ctx, UNUSED fr_time_t *recv_time_p, uint8_t *buffer, UNUSED size_t buffer_len, UNUSED size_t *leftover, UNUSED uint32_t *priority)
+static ssize_t mod_read_command(fr_listen_t *li, UNUSED void **packet_ctx, UNUSED fr_time_t *recv_time_p, uint8_t *buffer, UNUSED size_t buffer_len, UNUSED size_t *leftover)
{
proto_control_unix_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_control_unix_t);
proto_control_unix_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_control_unix_thread_t);
/*
* Process an initial connection request.
*/
-static ssize_t mod_read_init(fr_listen_t *li, UNUSED void **packet_ctx, UNUSED fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, UNUSED size_t *leftover, UNUSED uint32_t *priority)
+static ssize_t mod_read_init(fr_listen_t *li, UNUSED void **packet_ctx, UNUSED fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, UNUSED size_t *leftover)
{
proto_control_unix_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_control_unix_thread_t);
fr_conduit_hdr_t *hdr = (fr_conduit_hdr_t *) buffer;
return 0;
}
-static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover, uint32_t *priority)
+static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover)
{
proto_control_unix_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_control_unix_thread_t);
ssize_t data_size;
*recv_time_p = fr_time();
*leftover = 0;
- /*
- * proto_control sets the priority
- */
-
/*
* Print out what we received.
*/
/*
* Run the state machine to process the rest of the packet.
*/
- return thread->read(li, packet_ctx, recv_time_p, buffer, (size_t) data_size, leftover, priority);
+ return thread->read(li, packet_ctx, recv_time_p, buffer, (size_t) data_size, leftover);
}
return 0;
}
-static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover, UNUSED uint32_t *priority)
+static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover)
{
proto_cron_crontab_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_cron_crontab_t);
proto_cron_crontab_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_cron_crontab_thread_t);
{ 0 }
};
-static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover, uint32_t *priority)
+static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover)
{
proto_detail_work_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_detail_work_t);
proto_detail_work_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_detail_work_thread_t);
DEBUG("Retrying packet %d (retransmission %u)", track->id, track->retry.count);
*packet_ctx = track;
*recv_time_p = track->timestamp;
- *priority = inst->parent->priority;
return track->packet_len;
}
*packet_ctx = track;
*recv_time_p = track->timestamp;
- *priority = inst->parent->priority;
done:
/*
};
static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len,
- size_t *leftover, UNUSED uint32_t *priority)
+ size_t *leftover)
{
proto_dhcpv4_udp_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_dhcpv4_udp_thread_t);
fr_io_address_t *address, **address_p;
};
static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len,
- size_t *leftover, UNUSED uint32_t *priority)
+ size_t *leftover)
{
proto_dhcpv6_udp_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_dhcpv6_udp_t);
proto_dhcpv6_udp_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_dhcpv6_udp_thread_t);
};
static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len,
- size_t *leftover, UNUSED uint32_t *priority)
+ size_t *leftover)
{
// proto_dns_udp_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_dns_udp_t);
proto_dns_udp_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_dns_udp_thread_t);
* addition to their other data.
*/
static ssize_t proto_ldap_child_mod_read(fr_listen_t *li, UNUSED void **packet_ctx, UNUSED fr_time_t *recv_time_p, UNUSED uint8_t *buffer,
- UNUSED size_t buffer_len, UNUSED size_t *leftover, UNUSED uint32_t *priority)
+ UNUSED size_t buffer_len, UNUSED size_t *leftover)
{
proto_ldap_sync_ldap_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_ldap_sync_ldap_thread_t);
fr_ldap_connection_t *conn = talloc_get_type_abort(thread->conn->h, fr_ldap_connection_t);
};
-static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover, UNUSED uint32_t *priority)
+static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover)
{
proto_load_step_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_load_step_t);
proto_load_step_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_load_step_thread_t);
};
-static ssize_t mod_read(fr_listen_t *li, UNUSED void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover, UNUSED uint32_t *priority)
+static ssize_t mod_read(fr_listen_t *li, UNUSED void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover)
{
proto_radius_tcp_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_radius_tcp_t);
proto_radius_tcp_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_radius_tcp_thread_t);
};
-static ssize_t mod_read(fr_listen_t *li, UNUSED void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover, UNUSED uint32_t *priority)
+static ssize_t mod_read(fr_listen_t *li, UNUSED void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover)
{
proto_radius_tcp_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_radius_tcp_t);
proto_radius_tcp_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_radius_tcp_thread_t);
static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len,
- size_t *leftover, UNUSED uint32_t *priority)
+ size_t *leftover)
{
proto_radius_udp_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_radius_udp_t);
proto_radius_udp_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_radius_udp_thread_t);
* writing into the buffer.
* *leftover must be subtracted from buffer_len when
* calculating free space in the buffer.
- * @param[out] priority unused.
* @return
* - >0 when a packet was read successfully.
* - 0 when we read a partial packet.
* - <0 on error (socket should be closed).
*/
static ssize_t mod_read(fr_listen_t *li, UNUSED void **packet_ctx, fr_time_t *recv_time_p,
- uint8_t *buffer, size_t buffer_len, size_t *leftover,
- UNUSED uint32_t *priority)
+ uint8_t *buffer, size_t buffer_len, size_t *leftover)
{
proto_tacacs_tcp_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_tacacs_tcp_thread_t);
ssize_t data_size, packet_len;
};
-static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover, UNUSED uint32_t *priority)
+static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover)
{
proto_vmps_udp_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_vmps_udp_t);
proto_vmps_udp_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_vmps_udp_thread_t);