GNUnet  0.10.x
gnunet-service-cadet_channel.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2001-2017 GNUnet e.V.
4 
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.
9 
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.
14 
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/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
27 #ifndef GNUNET_SERVICE_CADET_CHANNEL_H
28 #define GNUNET_SERVICE_CADET_CHANNEL_H
29 
30 #include "gnunet-service-cadet.h"
32 #include "cadet_protocol.h"
33 
34 
43 struct CadetChannel;
44 
45 
55 void
57  const struct GNUNET_HashCode *port,
58  const struct GNUNET_PeerIdentity *listener);
59 
60 
68 const char *
69 GCCH_2s(const struct CadetChannel *ch);
70 
71 
78 void
79 GCCH_debug(struct CadetChannel *ch,
80  enum GNUNET_ErrorType level);
81 
82 
91 GCCH_get_id(const struct CadetChannel *ch);
92 
93 
104 struct CadetChannel *
106  struct GNUNET_CADET_ClientChannelNumber owner_id,
107  struct CadetPeer *destination,
108  const struct GNUNET_HashCode *port,
109  uint32_t options);
110 
111 
121 void
122 GCCH_bind(struct CadetChannel *ch,
123  struct CadetClient *c,
124  const struct GNUNET_HashCode *port);
125 
126 
135 void
137  struct CadetClient *c,
139 
140 
151 void
153 
154 
165 struct CadetChannel *
168  const struct GNUNET_HashCode *h_port,
169  uint32_t options);
170 
171 
180 void
182  const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti);
183 
184 
185 
193 void
195  const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti,
197 
198 
207 void
209  const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti,
210  const struct GNUNET_CADET_ChannelDataAckMessage *ack);
211 
212 
222 void
224  const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti,
225  const struct GNUNET_HashCode *port);
226 
227 
244 void
246  const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti);
247 
248 
263 int
265  struct GNUNET_CADET_ClientChannelNumber sender_ccn,
266  const char *buf,
267  size_t buf_len);
268 
269 
276 void
278  struct GNUNET_CADET_ClientChannelNumber client_ccn);
279 
280 #endif
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
Peer description.
void GCCH_hash_port(struct GNUNET_HashCode *h_port, const struct GNUNET_HashCode *port, const struct GNUNET_PeerIdentity *listener)
Hash the port and initiator and listener to calculate the "challenge" h_port we send to the other pee...
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
void GCCH_handle_channel_plaintext_data_ack(struct CadetChannel *ch, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti, const struct GNUNET_CADET_ChannelDataAckMessage *ack)
We got an acknowledgement for payload data for a channel.
struct GNUNET_CADET_ChannelTunnelNumber GCCH_get_id(const struct CadetChannel *ch)
Get the channel&#39;s public ID.
int GCCH_handle_local_data(struct CadetChannel *ch, struct GNUNET_CADET_ClientChannelNumber sender_ccn, const char *buf, size_t buf_len)
Handle data given by a client.
struct CadetChannelClient * owner
Client owner of the tunnel, if any.
void GCCH_handle_channel_plaintext_data(struct CadetChannel *ch, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti, const struct GNUNET_CADET_ChannelAppDataMessage *msg)
We got payload data for a channel.
void GCCH_channel_local_destroy(struct CadetChannel *ch, struct CadetClient *c, struct GNUNET_CADET_ClientChannelNumber ccn)
Destroy locally created channel.
GNUNET_ErrorType
Types of errors.
const char * GCCH_2s(const struct CadetChannel *ch)
Get the static string for identification of the channel.
static struct GNUNET_SCHEDULER_Task * t
Main task.
void GCCH_bind(struct CadetChannel *ch, struct CadetClient *c, const struct GNUNET_HashCode *port)
A client is bound to the port that we have a channel open to.
Information we track per peer.
void GCCH_handle_duplicate_open(struct CadetChannel *ch, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti)
We got a GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN message again for this channel.
void GCCH_handle_remote_destroy(struct CadetChannel *ch, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti)
Destroy channel, based on the other peer closing the connection.
struct CadetChannel * GCCH_channel_incoming_new(struct CadetTunnel *t, struct GNUNET_CADET_ChannelTunnelNumber chid, const struct GNUNET_HashCode *h_port, uint32_t options)
Create a new channel based on a request coming in over the network.
Struct containing all information regarding a channel to a remote client.
static char buf[2048]
Message for cadet data traffic.
Number uniquely identifying a channel of a client.
Definition: cadet.h:102
void GCCH_tunnel_up(struct CadetChannel *ch)
Function called once and only once after a channel was bound to its tunnel via GCT_add_channel() is r...
A 512-bit hashcode.
void GCCH_handle_local_ack(struct CadetChannel *ch, struct GNUNET_CADET_ClientChannelNumber client_ccn)
Handle ACK from client on local channel.
Struct containing all information regarding a tunnel to a peer.
Message to acknowledge end-to-end data.
Struct containing information about a client of the service.
P2P messages used by CADET.
struct GNUNET_HashCode h_port
Hash&#39;ed port of the channel with initiator and destination PID.
The identity of the host (wraps the signing key of the peer).
static uint16_t port
Port number.
Definition: gnunet-bcd.c:81
Hash uniquely identifying a connection below a tunnel.
Number identifying a CADET channel within a tunnel.
void GCCH_handle_channel_open_ack(struct CadetChannel *ch, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cti, const struct GNUNET_HashCode *port)
We got an acknowledgement for the creation of the channel (the port is open on the other side)...
struct CadetChannel * GCCH_channel_local_new(struct CadetClient *owner, struct GNUNET_CADET_ClientChannelNumber owner_id, struct CadetPeer *destination, const struct GNUNET_HashCode *port, uint32_t options)
Create a new channel.
void GCCH_debug(struct CadetChannel *ch, enum GNUNET_ErrorType level)
Log channel info.
Information we track per peer.