The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions | Variables
radius_schedule_test.c File Reference
#include <freeradius-devel/io/listen.h>
#include <freeradius-devel/io/schedule.h>
#include <freeradius-devel/radius/defs.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/inet.h>
#include <freeradius-devel/util/md5.h>
#include <freeradius-devel/util/syserror.h>
#include <sys/event.h>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
+ Include dependency graph for radius_schedule_test.c:

Go to the source code of this file.

Data Structures

struct  fr_listen_test_t
 
struct  fr_test_packet_ctx_t
 

Macros

#define MPRINT1   if (debug_lvl) printf
 

Functions

static void entry_point_set (UNUSED void const *ctx, request_t *request)
 
int main (int argc, char *argv[])
 
static int test_decode (void const *instance, request_t *request, uint8_t *const data, size_t data_len)
 
static ssize_t test_encode (void const *instance, request_t *request, uint8_t *buffer, size_t buffer_len)
 
static int test_fd (void const *ctx)
 
static size_t test_nak (void const *ctx, UNUSED void *packet_ctx, uint8_t *const packet, size_t packet_len, UNUSED uint8_t *reply, UNUSED size_t reply_len)
 
static int test_open (void *ctx, UNUSED void const *master_ctx)
 
static rlm_rcode_t test_process (UNUSED void const *instance, request_t *request, fr_io_action_t action)
 
static ssize_t test_read (void *ctx, UNUSED void **packet_ctx, fr_time_t **recv_time, uint8_t *buffer, size_t buffer_len, size_t *leftover, uint32_t *priority, bool *is_dup)
 
static ssize_t test_write (void *ctx, UNUSED void *packet_ctx, UNUSED fr_time_t request_time, uint8_t *buffer, size_t buffer_len, UNUSED size_t written)
 
static NEVER_RETURNS void usage (void)
 

Variables

static fr_app_io_t app_io
 
static int debug_lvl = 0
 
static fr_ipaddr_t my_ipaddr
 
static int my_port
 
static char const * secret = "testing123"
 
static fr_time_t start_time
 
static fr_app_t test_app
 
static fr_test_packet_ctx_t tpc
 

Data Structure Documentation

◆ fr_listen_test_t

struct fr_listen_test_t

Definition at line 51 of file radius_schedule_test.c.

+ Collaboration diagram for fr_listen_test_t:
Data Fields
fr_ipaddr_t ipaddr
uint16_t port
int sockfd

◆ fr_test_packet_ctx_t

struct fr_test_packet_ctx_t

Definition at line 44 of file radius_schedule_test.c.

Data Fields
uint8_t id
socklen_t salen
struct sockaddr_storage src
uint8_t vector[16]

Macro Definition Documentation

◆ MPRINT1

#define MPRINT1   if (debug_lvl) printf

Definition at line 42 of file radius_schedule_test.c.

Function Documentation

◆ entry_point_set()

static void entry_point_set ( UNUSED void const *  ctx,
request_t request 
)
static

Definition at line 195 of file radius_schedule_test.c.

+ Here is the call graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 215 of file radius_schedule_test.c.

+ Here is the call graph for this function:

◆ test_decode()

static int test_decode ( void const *  instance,
request_t request,
uint8_t *const  data,
size_t  data_len 
)
static

Definition at line 69 of file radius_schedule_test.c.

+ Here is the call graph for this function:

◆ test_encode()

static ssize_t test_encode ( void const *  instance,
request_t request,
uint8_t buffer,
size_t  buffer_len 
)
static

Definition at line 82 of file radius_schedule_test.c.

+ Here is the call graph for this function:

◆ test_fd()

static int test_fd ( void const *  ctx)
static

Definition at line 176 of file radius_schedule_test.c.

◆ test_nak()

static size_t test_nak ( void const *  ctx,
UNUSED void *  packet_ctx,
uint8_t *const  packet,
size_t  packet_len,
UNUSED uint8_t reply,
UNUSED size_t  reply_len 
)
static

Definition at line 105 of file radius_schedule_test.c.

◆ test_open()

static int test_open ( void *  ctx,
UNUSED void const *  master_ctx 
)
static

Definition at line 112 of file radius_schedule_test.c.

+ Here is the call graph for this function:

◆ test_process()

static rlm_rcode_t test_process ( UNUSED void const *  instance,
request_t request,
fr_io_action_t  action 
)
static

Definition at line 63 of file radius_schedule_test.c.

+ Here is the caller graph for this function:

◆ test_read()

static ssize_t test_read ( void *  ctx,
UNUSED void **  packet_ctx,
fr_time_t **  recv_time,
uint8_t buffer,
size_t  buffer_len,
size_t leftover,
uint32_t priority,
bool is_dup 
)
static

Definition at line 132 of file radius_schedule_test.c.

◆ test_write()

static ssize_t test_write ( void *  ctx,
UNUSED void *  packet_ctx,
UNUSED fr_time_t  request_time,
uint8_t buffer,
size_t  buffer_len,
UNUSED size_t  written 
)
static

Definition at line 158 of file radius_schedule_test.c.

◆ usage()

static NEVER_RETURNS void usage ( void  )
static

Definition at line 204 of file radius_schedule_test.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ app_io

fr_app_io_t app_io
static
Initial value:
= {
.name = "schedule-test",
.default_message_size = 4096,
.open = test_open,
.read = test_read,
.write = test_write,
.fd = test_fd,
.nak = test_nak,
.encode = test_encode,
.decode = test_decode
}
static ssize_t test_encode(void const *instance, request_t *request, uint8_t *buffer, size_t buffer_len)
static ssize_t test_read(void *ctx, UNUSED void **packet_ctx, fr_time_t **recv_time, uint8_t *buffer, size_t buffer_len, size_t *leftover, uint32_t *priority, bool *is_dup)
static int test_open(void *ctx, UNUSED void const *master_ctx)
static size_t test_nak(void const *ctx, UNUSED void *packet_ctx, uint8_t *const packet, size_t packet_len, UNUSED uint8_t *reply, UNUSED size_t reply_len)
static int test_fd(void const *ctx)
static ssize_t test_write(void *ctx, UNUSED void *packet_ctx, UNUSED fr_time_t request_time, uint8_t *buffer, size_t buffer_len, UNUSED size_t written)
static int test_decode(void const *instance, request_t *request, uint8_t *const data, size_t data_len)

Definition at line 183 of file radius_schedule_test.c.

◆ debug_lvl

int debug_lvl = 0
static

Definition at line 57 of file radius_schedule_test.c.

◆ my_ipaddr

fr_ipaddr_t my_ipaddr
static

Definition at line 58 of file radius_schedule_test.c.

◆ my_port

int my_port
static

Definition at line 59 of file radius_schedule_test.c.

◆ secret

char const* secret = "testing123"
static

Definition at line 60 of file radius_schedule_test.c.

◆ start_time

fr_time_t start_time
static

Definition at line 130 of file radius_schedule_test.c.

◆ test_app

fr_app_t test_app
static
Initial value:
= {
.entry_point_set = entry_point_set,
}
static void entry_point_set(UNUSED void const *ctx, request_t *request)

Definition at line 200 of file radius_schedule_test.c.

◆ tpc

Definition at line 61 of file radius_schedule_test.c.