libcoap
4.3.5
Toggle main menu visibility
Loading...
Searching...
No Matches
coap_prng.h
Go to the documentation of this file.
1
/*
2
* coap_prng.h -- Pseudo Random Numbers
3
*
4
* Copyright (C) 2010-2024 Olaf Bergmann <bergmann@tzi.org>
5
*
6
* SPDX-License-Identifier: BSD-2-Clause
7
*
8
* This file is part of the CoAP library libcoap. Please see README for terms
9
* of use.
10
*/
11
16
17
#ifndef COAP_PRNG_H_
18
#define COAP_PRNG_H_
19
26
32
typedef
int (*
coap_rand_func_t
)(
void
*out,
size_t
len);
33
40
void
coap_set_prng
(
coap_rand_func_t
rng);
41
49
COAP_API
void
coap_prng_init
(
unsigned
int
seed);
50
62
COAP_API
int
coap_prng
(
void
*buf,
size_t
len);
63
65
66
#endif
/* COAP_PRNG_H_ */
COAP_API
#define COAP_API
Definition
coap_libcoap_build.h:41
coap_rand_func_t
int(* coap_rand_func_t)(void *out, size_t len)
Data type for random number generator function.
Definition
coap_prng.h:32
coap_set_prng
void coap_set_prng(coap_rand_func_t rng)
Replaces the current random number generation function with the default function rng.
Definition
coap_prng.c:161
coap_prng
COAP_API int coap_prng(void *buf, size_t len)
Fills buf with len random bytes using the default pseudo random number generator.
Definition
coap_prng.c:66
coap_prng_init
COAP_API void coap_prng_init(unsigned int seed)
Seeds the default random number generation function with the given seed.
Definition
coap_prng.c:59
include
coap3
coap_prng.h
Generated on
for libcoap by
1.17.0