libwebsockets
Lightweight C library for HTML5 websockets
|
Go to the source code of this file.
Data Structures | |
struct | lws_xos |
Macros | |
#define | lws_fi(_fi_name, _fic) (0) |
#define | lws_fi_destroy(_x) |
#define | lws_fi_inherit_copy(_a, _b, _c, _d) |
#define | lws_fi_deserialize(_x, _y) |
#define | lws_fi_user_wsi_fi(_wsi, _name) (0) |
#define | lws_fi_user_context_fi(_wsi, _name) (0) |
#define | lws_fi_user_ss_fi(_h, _name) (0) |
#define | lws_fi_user_sspc_fi(_h, _name) (0) |
Typedefs | |
typedef struct lws_xos | lws_xos_t |
Functions | |
LWS_VISIBLE LWS_EXTERN void | lws_xos_init (struct lws_xos *xos, uint64_t seed) |
LWS_VISIBLE LWS_EXTERN uint64_t LWS_WARN_UNUSED_RESULT | lws_xos (struct lws_xos *xos) |
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT | lws_xos_percent (struct lws_xos *xos, int percent) |
struct lws_xos |
Definition at line 27 of file lws-fault-injection.h.
Data Fields | ||
---|---|---|
uint64_t | s[4] |
#define lws_fi | ( | _fi_name, | |
_fic | |||
) | (0) |
Definition at line 242 of file lws-fault-injection.h.
#define lws_fi_destroy | ( | _x | ) |
Definition at line 243 of file lws-fault-injection.h.
#define lws_fi_inherit_copy | ( | _a, | |
_b, | |||
_c, | |||
_d | |||
) |
Definition at line 244 of file lws-fault-injection.h.
#define lws_fi_deserialize | ( | _x, | |
_y | |||
) |
Definition at line 245 of file lws-fault-injection.h.
#define lws_fi_user_wsi_fi | ( | _wsi, | |
_name | |||
) | (0) |
Definition at line 246 of file lws-fault-injection.h.
#define lws_fi_user_context_fi | ( | _wsi, | |
_name | |||
) | (0) |
Definition at line 247 of file lws-fault-injection.h.
#define lws_fi_user_ss_fi | ( | _h, | |
_name | |||
) | (0) |
Definition at line 248 of file lws-fault-injection.h.
#define lws_fi_user_sspc_fi | ( | _h, | |
_name | |||
) | (0) |
Definition at line 249 of file lws-fault-injection.h.
LWS_VISIBLE LWS_EXTERN void lws_xos_init | ( | struct lws_xos * | xos, |
uint64_t | seed | ||
) |
lws_xos_init() - seed xoshiro256 PRNG
xos | the prng state object to initialize |
seed | the 64-bit seed |
Initialize PRNG \xos with the starting state represented by seed
LWS_VISIBLE LWS_EXTERN uint64_t LWS_WARN_UNUSED_RESULT lws_xos | ( | struct lws_xos * | xos | ) |
lws_xos() - get next xoshiro256 PRNG result and update state
xos | the PRNG state to use |
Returns next 64-bit PRNG result. These are cheap to get, quite a white noise sequence, and completely deterministic according to the seed it was initialized with.
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_xos_percent | ( | struct lws_xos * | xos, |
int | percent | ||
) |
lws_xos_percent() - return 1 a given percent of the time on average
xos | the PRNG state to use |
percent | chance in 100 of returning 1 |
Returns 1 if next random % 100 is < percent
, such that 100 always returns 1, 0 never returns 1, and the chance linearly scales inbetween