mock.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2021 Freie Universität Berlin
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
19 #include <stdint.h>
20 
21 #include "congure.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
32 typedef struct {
42  uint8_t init_calls;
82  struct {
84  void *ctx;
85  } init_args;
90  struct {
91  congure_snd_t *c;
92  unsigned msg_size;
93  } inter_msg_interval_args;
98  struct {
99  congure_snd_t *c;
100  unsigned msg_size;
101  } report_msg_sent_args;
106  struct {
107  congure_snd_t *c;
108  unsigned msg_size;
109  } report_msg_discarded_args;
114  struct {
115  congure_snd_t *c;
120  } report_msgs_timeout_args;
125  struct {
126  congure_snd_t *c;
130  congure_snd_msg_t *msgs;
131  } report_msgs_lost_args;
136  struct {
137  congure_snd_t *c;
140  } report_msg_acked_args;
145  struct {
146  congure_snd_t *c;
151  } report_ecn_ce_args;
153 
162  const congure_snd_driver_t *methods);
163 
164 #ifdef __cplusplus
165 }
166 #endif
167 
void congure_mock_snd_setup(congure_mock_snd_t *c, const congure_snd_driver_t *methods)
Sets up the driver for CongURE mock object.
uint32_t ztimer_now_t
type for ztimer_now() result
Definition: ztimer.h:308
A mock CongURE state object.
Definition: mock.h:32
congure_snd_t * c
The CongURE object to initialize.
Definition: mock.h:83
congure_snd_t super
see congure_snd_t
Definition: mock.h:33
congure_snd_ack_t * ack
The received ACK.
Definition: mock.h:139
uint8_t report_msgs_lost_calls
How often was the congure_snd_driver_t::report_msgs_lost() method called?
Definition: mock.h:67
void * ctx
Context for callbacks specific to CC.
Definition: mock.h:84
uint8_t report_msg_acked_calls
How often was the congure_snd_driver_t::report_msg_acked() method called?
Definition: mock.h:72
congure_snd_msg_t * msg
The ACK'd message.
Definition: mock.h:138
uint8_t init_calls
How often was the congure_snd_driver_t::init() method called?
Definition: mock.h:42
const congure_snd_driver_t * methods
Optional methods called in addition to the tracking functions of the mock driver.
Definition: mock.h:38
ztimer_now_t time
Timestamp of the message the CE event occurred for was sent.
Definition: mock.h:150
unsigned msg_size
The size of the next message to send.
Definition: mock.h:92
uint8_t report_msg_discarded_calls
How often was the congure_snd_driver_t::report_msg_discarded() method called?
Definition: mock.h:57
uint8_t inter_msg_interval_calls
How often was the congure_snd_driver_t::inter_msg_interval() method called?
Definition: mock.h:47
congure_snd_msg_t * msgs
A collection of messages for which the ACK timed out.
Definition: mock.h:119
uint8_t report_msgs_timeout_calls
How often was the congure_snd_driver_t::report_msgs_timeout() method called?
Definition: mock.h:62
uint8_t report_ecn_ce_calls
How often was the congure_snd_driver_t::report_ecn_ce() method called?
Definition: mock.h:77
uint8_t report_msg_sent_calls
How often was the congure_snd_driver_t::report_msg_sent() method called?
Definition: mock.h:52
Object to represent an ACK to a message.
Definition: congure.h:83
Driver for CongURE objects.
Definition: congure.h:116
Object to represent a collection of sent messages.
Definition: congure.h:65
Base state object for CongURE implementations.
Definition: congure.h:48