#include <stdint.h>
#include "result.h"
Go to the source code of this file.
◆ EoSequencer
| typedef struct EoSequencer EoSequencer |
◆ eo_generate_sequence_start()
| int32_t eo_generate_sequence_start |
( |
void | | ) |
|
Generates a cryptographically random starting value for a sequencer.
- Returns
- A random starting value.
Definition at line 29 of file sequencer.c.
◆ eo_sequence_init_bytes()
| EoResult eo_sequence_init_bytes |
( |
int32_t | start, |
|
|
uint8_t * | out_bytes ) |
Initializes a sequence of bytes based on the starting value.
- Parameters
-
| start | The starting value for the sequence. |
| out_bytes | A pointer to the buffer where the initialized byte sequence will be stored. Must have space for at least 2 bytes. |
- Returns
- EO_SUCCESS on success, EO_NULL_PTR if out_bytes is NULL, EO_INVALID_SEQUENCE_RANGE if the derived range is empty, or EO_SEQUENCE_OUT_OF_RANGE if seq2 cannot be encoded as a single EO byte.
Definition at line 46 of file sequencer.c.
◆ eo_sequence_ping_bytes()
| EoResult eo_sequence_ping_bytes |
( |
int32_t | start, |
|
|
uint8_t * | out_bytes ) |
Generates a sequence of bytes for the ping packet based on the starting value.
- Parameters
-
| start | The starting value for the sequence. |
| out_bytes | A pointer to the buffer where the ping byte sequence will be stored. Must have space for at least 2 bytes. |
- Returns
- EO_SUCCESS on success, EO_NULL_PTR if out_bytes is NULL, EO_INVALID_SEQUENCE_RANGE if the derived range is empty, or EO_SEQUENCE_OUT_OF_RANGE if seq2 cannot be encoded as a single EO byte.
Definition at line 87 of file sequencer.c.
◆ eo_sequence_start_from_init()
| int32_t eo_sequence_start_from_init |
( |
int32_t | s1, |
|
|
int32_t | s2 ) |
Calculates the starting sequence value based on the initial server sequence values.
- Parameters
-
| s1 | The first sequence value from the server. |
| s2 | The second sequence value from the server. |
- Returns
- The calculated starting sequence value.
Definition at line 34 of file sequencer.c.
◆ eo_sequence_start_from_ping()
| int32_t eo_sequence_start_from_ping |
( |
int32_t | s1, |
|
|
int32_t | s2 ) |
Calculates the starting sequence value based on the ping sequence values.
- Parameters
-
| s1 | The first sequence value from the server ping response. |
| s2 | The second sequence value from the server ping response. |
- Returns
- The calculated starting sequence value.
Definition at line 41 of file sequencer.c.
◆ eo_sequencer_init()
Initializes a sequencer with the given starting value.
- Parameters
-
| start | The initial value for the sequencer. |
- Returns
- The initialized sequencer.
Definition at line 5 of file sequencer.c.
◆ eo_sequencer_next()
Gets the next value in the sequence, advances the counter, and writes it to out_value.
- Parameters
-
| sequencer | The sequencer to advance. |
| out_value | Output for the next sequence value. May be NULL to advance without capturing the value. |
- Returns
- EO_SUCCESS on success, or EO_NULL_PTR if sequencer is NULL.
Definition at line 13 of file sequencer.c.