2 This file is part of GNUnet.
3 Copyright (C) 2013 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
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 * Unique ID for this message, for confirm callback, must never be zero.
131 uint32_t uid GNUNET_PACKED;
134 * The (actual) target of the message
136 struct GNUNET_PeerIdentity target;
142 * Message from service to DV plugin, saying that a
143 * SEND request was handled.
145 struct GNUNET_DV_AckMessage
148 * Type: #GNUNET_MESSAGE_TYPE_DV_SEND_ACK or
149 * #GNUNET_MESSAGE_TYPE_DV_SEND_NACK.
151 struct GNUNET_MessageHeader header;
154 * Which message is being acknowledged?
156 uint32_t uid GNUNET_PACKED;
159 * The (actual) target of the message
161 struct GNUNET_PeerIdentity target;
167 * Message from service to DV plugin, saying that our
168 * distance to another peer changed.
170 struct GNUNET_DV_DistanceUpdateMessage
173 * Type: #GNUNET_MESSAGE_TYPE_DV_DISTANCE_CHANGED.
175 struct GNUNET_MessageHeader header;
178 * What is the new distance?
180 uint32_t distance GNUNET_PACKED;
183 * The peer for which the distance changed.
185 struct GNUNET_PeerIdentity peer;
188 * The network the peer is in
190 uint32_t network GNUNET_PACKED;
195 GNUNET_NETWORK_STRUCT_END