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/>.
20 * @author Christian Grothoff
22 * @brief IPC messages between DV service and DV plugin
27 #include "gnunet_common.h"
29 GNUNET_NETWORK_STRUCT_BEGIN
32 * DV service tells plugin about a DV-connection being
35 struct GNUNET_DV_ConnectMessage
38 * Type: #GNUNET_MESSAGE_TYPE_DV_CONNECT
40 struct GNUNET_MessageHeader header;
43 * The distance to the peer that we are now connected to
45 uint32_t distance GNUNET_PACKED;
48 * The other peer (at the given distance).
50 struct GNUNET_PeerIdentity peer;
53 * The network the peer is in
55 uint32_t network GNUNET_PACKED;
61 * DV service tells plugin about a DV-connection being
62 * no longer available.
64 * Sender address is copied to the end of this struct,
65 * followed by the actual message received.
67 struct GNUNET_DV_DisconnectMessage
70 * Type: #GNUNET_MESSAGE_TYPE_DV_DISCONNECT
72 struct GNUNET_MessageHeader header;
77 uint32_t reserved GNUNET_PACKED;
80 * The peer that is no longer available.
82 struct GNUNET_PeerIdentity peer;
88 * DV Message, contains a message that was received via DV for this
89 * peer. Send from the DV service to the DV plugin.
91 * Sender address is copied to the end of this struct,
92 * followed by the actual message received.
94 struct GNUNET_DV_ReceivedMessage
97 * Type: #GNUNET_MESSAGE_TYPE_DV_RECV
99 struct GNUNET_MessageHeader header;
102 * The distance to the peer that we received the message from
104 uint32_t distance GNUNET_PACKED;
107 * The (actual) sender of the message
109 struct GNUNET_PeerIdentity sender;
111 /* payload follows */
116 * Message from plugin to DV service, requesting a
117 * message to be routed.
119 struct GNUNET_DV_SendMessage
122 * Type: #GNUNET_MESSAGE_TYPE_DV_SEND
124 struct GNUNET_MessageHeader header;
127 * Reserved for alignment. 0.
129 uint32_t reserved GNUNET_PACKED;
132 * The (actual) target of the message
134 struct GNUNET_PeerIdentity target;
140 * Message from service to DV plugin, saying that our
141 * distance to another peer changed.
143 struct GNUNET_DV_DistanceUpdateMessage
146 * Type: #GNUNET_MESSAGE_TYPE_DV_DISTANCE_CHANGED.
148 struct GNUNET_MessageHeader header;
151 * What is the new distance?
153 uint32_t distance GNUNET_PACKED;
156 * The peer for which the distance changed.
158 struct GNUNET_PeerIdentity peer;
161 * The network the peer is in
163 uint32_t network GNUNET_PACKED;
168 GNUNET_NETWORK_STRUCT_END