2 * Copyright (C) 2016 Tobias Brunner
4 * Copyright (C) secunet Security Networks AG
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * sender_t implementation that does not pass the sent packet to a socket but
19 * instead provides it for immediate delivery to an ike_sa_t object.
21 * @defgroup mock_sender mock_sender
22 * @{ @ingroup test_utils_c
25 #ifndef MOCK_SENDER_H_
26 #define MOCK_SENDER_H_
28 #include <encoding/message.h>
29 #include <network/sender.h>
31 typedef struct mock_sender_t mock_sender_t
;
33 struct mock_sender_t
{
36 * Implemented interface
41 * Remove the next packet in the send queue as message_t object. The IKE
42 * header is already parsed (which is assumed does not fail) so it can
43 * directly be passed to ike_sa_t::process_message().
45 * @return message or NULL if none is queued
47 message_t
*(*dequeue
)(mock_sender_t
*this);
51 * Creates a mock_sender_t instance.
53 * @return created object
55 mock_sender_t
*mock_sender_create();
57 #endif /** MOCK_SENDER_H_ @} */