2 This file is part of GNUnet.
3 Copyright (C) 2013 GNUnet e.V.
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 SPDX-License-Identifier: AGPL3.0-or-later
22 * @author Christian Grothoff
24 * @brief IPC messages between DV service and DV plugin
29 #include "gnunet_common.h"
31 GNUNET_NETWORK_STRUCT_BEGIN
34 * DV service tells plugin about a DV-connection being
37 struct GNUNET_DV_ConnectMessage
40 * Type: #GNUNET_MESSAGE_TYPE_DV_CONNECT
42 struct GNUNET_MessageHeader header;
45 * The distance to the peer that we are now connected to
47 uint32_t distance GNUNET_PACKED;
50 * The other peer (at the given distance).
52 struct GNUNET_PeerIdentity peer;
55 * The network the peer is in
57 uint32_t network GNUNET_PACKED;
63 * DV service tells plugin about a DV-connection being
64 * no longer available.
66 * Sender address is copied to the end of this struct,
67 * followed by the actual message received.
69 struct GNUNET_DV_DisconnectMessage
72 * Type: #GNUNET_MESSAGE_TYPE_DV_DISCONNECT
74 struct GNUNET_MessageHeader header;
79 uint32_t reserved GNUNET_PACKED;
82 * The peer that is no longer available.
84 struct GNUNET_PeerIdentity peer;
90 * DV Message, contains a message that was received via DV for this
91 * peer. Send from the DV service to the DV plugin.
93 * Sender address is copied to the end of this struct,
94 * followed by the actual message received.
96 struct GNUNET_DV_ReceivedMessage
99 * Type: #GNUNET_MESSAGE_TYPE_DV_RECV
101 struct GNUNET_MessageHeader header;
104 * The distance to the peer that we received the message from
106 uint32_t distance GNUNET_PACKED;
109 * The (actual) sender of the message
111 struct GNUNET_PeerIdentity sender;
113 /* payload follows */
118 * Message from plugin to DV service, requesting a
119 * message to be routed.
121 struct GNUNET_DV_SendMessage
124 * Type: #GNUNET_MESSAGE_TYPE_DV_SEND
126 struct GNUNET_MessageHeader header;
129 * Reserved for alignment. 0.
131 uint32_t reserved GNUNET_PACKED;
134 * The (actual) target of the message
136 struct GNUNET_PeerIdentity target;
142 * Message from service to DV plugin, saying that our
143 * distance to another peer changed.
145 struct GNUNET_DV_DistanceUpdateMessage
148 * Type: #GNUNET_MESSAGE_TYPE_DV_DISTANCE_CHANGED.
150 struct GNUNET_MessageHeader header;
153 * What is the new distance?
155 uint32_t distance GNUNET_PACKED;
158 * The peer for which the distance changed.
160 struct GNUNET_PeerIdentity peer;
163 * The network the peer is in
165 uint32_t network GNUNET_PACKED;
170 GNUNET_NETWORK_STRUCT_END