MOS Source Code
Loading...
Searching...
No Matches
random_data.c File Reference
#include "random_data.h"
#include <string.h>
#include <malloc_wrappers.h>
#include <pb_encode.h>
+ Include dependency graph for random_data.c:

Go to the source code of this file.

Functions

void random_set_seed (uint32_t seed)
 
uint32_t random_get_seed ()
 
uint32_t rand_word ()
 
int rand_int (int min, int max)
 
bool rand_bool ()
 
uint8_t rand_byte ()
 
size_t rand_len (size_t max)
 
void rand_fill (uint8_t *buf, size_t count)
 
size_t rand_fill_protobuf (uint8_t *buf, size_t min_bytes, size_t max_bytes, int min_tag)
 
void rand_mess (uint8_t *buf, size_t count)
 
void rand_protobuf_noise (uint8_t *buffer, size_t bufsize, size_t *msglen)
 

Variables

static uint32_t g_random_seed = 1234
 

Function Documentation

◆ random_set_seed()

void random_set_seed ( uint32_t seed)

Definition at line 10 of file random_data.c.

Referenced by main().

◆ random_get_seed()

uint32_t random_get_seed ( )

Definition at line 15 of file random_data.c.

Referenced by main().

◆ rand_word()

uint32_t rand_word ( )

Definition at line 22 of file random_data.c.

Referenced by limit_sizes(), rand_bool(), rand_byte(), rand_int(), and rand_len().

◆ rand_int()

int rand_int ( int min,
int max )

Definition at line 31 of file random_data.c.

Referenced by generate_base_message(), rand_fill_protobuf(), rand_mess(), rand_protobuf_noise(), and run_iteration().

+ Here is the call graph for this function:

◆ rand_bool()

bool rand_bool ( )

Definition at line 36 of file random_data.c.

Referenced by run_iteration().

+ Here is the call graph for this function:

◆ rand_byte()

uint8_t rand_byte ( )

Definition at line 44 of file random_data.c.

Referenced by rand_fill().

+ Here is the call graph for this function:

◆ rand_len()

size_t rand_len ( size_t max)

Definition at line 59 of file random_data.c.

Referenced by rand_fill_protobuf(), rand_mess(), and rand_protobuf_noise().

+ Here is the call graph for this function:

◆ rand_fill()

void rand_fill ( uint8_t * buf,
size_t count )

Definition at line 78 of file random_data.c.

Referenced by generate_message(), rand_fill_protobuf(), rand_mess(), and run_iteration().

+ Here is the call graph for this function:

◆ rand_fill_protobuf()

size_t rand_fill_protobuf ( uint8_t * buf,
size_t min_bytes,
size_t max_bytes,
int min_tag )

Definition at line 87 of file random_data.c.

Referenced by rand_mess(), and rand_protobuf_noise().

+ Here is the call graph for this function:

◆ rand_mess()

void rand_mess ( uint8_t * buf,
size_t count )

Definition at line 139 of file random_data.c.

Referenced by generate_base_message(), and run_iteration().

+ Here is the call graph for this function:

◆ rand_protobuf_noise()

void rand_protobuf_noise ( uint8_t * buffer,
size_t bufsize,
size_t * msglen )

Definition at line 176 of file random_data.c.

Referenced by run_iteration().

+ Here is the call graph for this function:

Variable Documentation

◆ g_random_seed

uint32_t g_random_seed = 1234
static

Definition at line 8 of file random_data.c.

Referenced by rand_word(), random_get_seed(), and random_set_seed().