Loading...
Searching...
No Matches
mock.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021 Freie Universität Berlin
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
19#ifndef CONGURE_MOCK_H
20#define CONGURE_MOCK_H
21
22#include <stdint.h>
23
24#include "congure.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
35typedef struct {
45 uint8_t init_calls;
85 struct {
87 void *ctx;
88 } init_args;
93 struct {
94 congure_snd_t *c;
95 unsigned msg_size;
96 } inter_msg_interval_args;
101 struct {
102 congure_snd_t *c;
103 unsigned msg_size;
104 } report_msg_sent_args;
109 struct {
110 congure_snd_t *c;
111 unsigned msg_size;
112 } report_msg_discarded_args;
117 struct {
118 congure_snd_t *c;
123 } report_msgs_timeout_args;
128 struct {
129 congure_snd_t *c;
133 congure_snd_msg_t *msgs;
134 } report_msgs_lost_args;
139 struct {
140 congure_snd_t *c;
143 } report_msg_acked_args;
148 struct {
149 congure_snd_t *c;
154 } report_ecn_ce_args;
156
165 const congure_snd_driver_t *methods);
166
167#ifdef __cplusplus
168}
169#endif
170
171#endif /* CONGURE_MOCK_H */
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:323
A mock CongURE state object.
Definition mock.h:35
congure_snd_t * c
The CongURE object to initialize.
Definition mock.h:86
congure_snd_t super
see congure_snd_t
Definition mock.h:36
congure_snd_ack_t * ack
The received ACK.
Definition mock.h:142
uint8_t report_msgs_lost_calls
How often was the congure_snd_driver_t::report_msgs_lost() method called?
Definition mock.h:70
void * ctx
Context for callbacks specific to CC.
Definition mock.h:87
uint8_t report_msg_acked_calls
How often was the congure_snd_driver_t::report_msg_acked() method called?
Definition mock.h:75
congure_snd_msg_t * msg
The ACK'd message.
Definition mock.h:141
uint8_t init_calls
How often was the congure_snd_driver_t::init() method called?
Definition mock.h:45
const congure_snd_driver_t * methods
Optional methods called in addition to the tracking functions of the mock driver.
Definition mock.h:41
ztimer_now_t time
Timestamp of the message the CE event occurred for was sent.
Definition mock.h:153
unsigned msg_size
The size of the next message to send.
Definition mock.h:95
uint8_t report_msg_discarded_calls
How often was the congure_snd_driver_t::report_msg_discarded() method called?
Definition mock.h:60
uint8_t inter_msg_interval_calls
How often was the congure_snd_driver_t::inter_msg_interval() method called?
Definition mock.h:50
congure_snd_msg_t * msgs
A collection of messages for which the ACK timed out.
Definition mock.h:122
uint8_t report_msgs_timeout_calls
How often was the congure_snd_driver_t::report_msgs_timeout() method called?
Definition mock.h:65
uint8_t report_ecn_ce_calls
How often was the congure_snd_driver_t::report_ecn_ce() method called?
Definition mock.h:80
uint8_t report_msg_sent_calls
How often was the congure_snd_driver_t::report_msg_sent() method called?
Definition mock.h:55
Object to represent an ACK to a message.
Definition congure.h:86
Driver for CongURE objects.
Definition congure.h:119
Object to represent a collection of sent messages.
Definition congure.h:68
Base state object for CongURE implementations.
Definition congure.h:51