2 This file is part of GNUnet.
3 Copyright (C) 2012 Christian Grothoff
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
23 * @brief IPC messages between VPN library and VPN service
24 * @author Christian Grothoff
29 #include "gnunet_util_lib.h"
31 GNUNET_NETWORK_STRUCT_BEGIN
34 * Message send by the VPN client to the VPN service requesting
35 * the setup of a redirection from some IP via an exit node to
36 * some global Internet address.
38 struct RedirectToIpRequestMessage {
40 * Type is #GNUNET_MESSAGE_TYPE_VPN_CLIENT_REDIRECT_TO_IP
42 struct GNUNET_MessageHeader header;
47 uint32_t reserved GNUNET_PACKED;
50 * How long should the redirection be maintained at most?
52 struct GNUNET_TIME_AbsoluteNBO expiration_time;
55 * Address family desired for the result (AF_INET or AF_INET6 or AF_UNSPEC, in nbo)
57 int32_t result_af GNUNET_PACKED;
60 * Address family used for the destination address (AF_INET or AF_INET6, in nbo)
62 int32_t addr_af GNUNET_PACKED;
65 * Unique ID to match a future response to this request.
66 * Picked by the client.
68 uint64_t request_id GNUNET_PACKED;
70 /* followed by destination address ('struct in_addr' or 'struct in6_addr') */
75 * Message send by the VPN client to the VPN service requesting
76 * the setup of a redirection from some IP to a service running
77 * at a particular peer.
79 struct RedirectToServiceRequestMessage {
81 * Type is #GNUNET_MESSAGE_TYPE_VPN_CLIENT_REDIRECT_TO_SERVICE
83 struct GNUNET_MessageHeader header;
88 uint32_t reserved GNUNET_PACKED;
91 * How long should the redirection be maintained at most?
93 struct GNUNET_TIME_AbsoluteNBO expiration_time;
96 * Desired protocol (IPPROTO_UDP or IPPROTO_TCP)
98 int32_t protocol GNUNET_PACKED;
101 * Address family desired for the result (AF_INET or AF_INET6 or AF_UNSPEC, in nbo)
103 int32_t result_af GNUNET_PACKED;
106 * Target peer offering the service.
108 struct GNUNET_PeerIdentity target;
111 * Service descriptor identifying the service.
113 struct GNUNET_HashCode service_descriptor;
116 * Unique ID to match a future response to this request.
117 * Picked by the client.
119 uint64_t request_id GNUNET_PACKED;
124 * Response from the VPN service to a VPN client informing about
125 * the IP that was assigned for the requested redirection.
127 struct RedirectToIpResponseMessage {
129 * Type is #GNUNET_MESSAGE_TYPE_VPN_CLIENT_USE_IP
131 struct GNUNET_MessageHeader header;
134 * Address family of the allocated address that follows; will match
135 * "result_af" from the request, of be "AF_UNSPEC" on errors.
137 int32_t result_af GNUNET_PACKED;
140 * Unique ID to match the response to a request.
142 uint64_t request_id GNUNET_PACKED;
144 /* followed by destination address ('struct in_addr' or 'struct in6_addr') */
147 GNUNET_NETWORK_STRUCT_END