38#ifndef GNUNET_CADET_SERVICE_H
39#define GNUNET_CADET_SERVICE_H
54#define GNUNET_CADET_VERSION 0x00000005
111typedef void *(*GNUNET_CADET_ConnectEventHandler) (
struct GNUNET_MQ_MessageHandlers handlers[]
void * connects(void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_MQ_Handle *mq)
void disconnects(void *cls, const struct GNUNET_PeerIdentity *peer)
static struct GNUNET_ARM_Handle * h
Connection with ARM.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static uint16_t port
Port number.
static GstElement * source
Appsrc instance into which we write data for the pipeline.
static struct GNUNET_OS_Process * p
Helper process we started.
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
struct GNUNET_CADET_Handle * GNUNET_CADET_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the MQ-based cadet service.
void GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel)
Indicate readiness to receive the next message on a channel.
void(* GNUNET_CADET_PeersCB)(void *cls, const struct GNUNET_CADET_PeerListEntry *ple)
Method called to retrieve information about all peers in CADET, called once per peer.
struct GNUNET_CADET_PeersLister * GNUNET_CADET_list_peers(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CADET_PeersCB callback, void *callback_cls)
Request information about peers known to the running cadet service.
void GNUNET_CADET_channel_destroy(struct GNUNET_CADET_Channel *channel)
Destroy an existing channel.
struct GNUNET_CADET_ListTunnels * GNUNET_CADET_list_tunnels(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CADET_TunnelsCB callback, void *callback_cls)
Request information about tunnels of the running cadet peer.
const struct GNUNET_HashCode * GC_u2h(uint32_t port)
Transitional function to convert an unsigned int port to a hash value.
struct GNUNET_MQ_Handle * GNUNET_CADET_get_mq(const struct GNUNET_CADET_Channel *channel)
Obtain the message queue for a connected channel.
void(* GNUNET_CADET_DisconnectEventHandler)(void *cls, const struct GNUNET_CADET_Channel *channel)
Function called whenever an MQ-channel is destroyed, unless the destruction was requested by GNUNET_C...
GNUNET_CADET_ChannelInfoOption
void * GNUNET_CADET_get_channel_cancel(struct GNUNET_CADET_ChannelMonitor *cm)
Cancel a channel monitor request.
struct GNUNET_CADET_Port * GNUNET_CADET_open_port(struct GNUNET_CADET_Handle *h, const struct GNUNET_HashCode *port, GNUNET_CADET_ConnectEventHandler connects, void *connects_cls, GNUNET_CADET_WindowSizeEventHandler window_changes, GNUNET_CADET_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers)
Open a port to receive incoming MQ-based channels.
void * GNUNET_CADET_list_tunnels_cancel(struct GNUNET_CADET_ListTunnels *lt)
Cancel a monitor request.
void GNUNET_CADET_disconnect(struct GNUNET_CADET_Handle *handle)
Disconnect from the cadet service.
void GNUNET_CADET_close_port(struct GNUNET_CADET_Port *p)
Close a port opened with GNUNET_CADET_open_port.
struct GNUNET_CADET_ChannelMonitor * GNUNET_CADET_get_channel(const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_PeerIdentity *peer, GNUNET_CADET_ChannelCB callback, void *callback_cls)
Request information about channels to peer from the local peer.
void(* GNUNET_CADET_PathCB)(void *cls, const struct GNUNET_CADET_PeerPathDetail *ppd)
Method called to retrieve information about a specific path known to the service.
struct GNUNET_CADET_Channel * GNUNET_CADET_channel_create(struct GNUNET_CADET_Handle *h, void *channel_cls, const struct GNUNET_PeerIdentity *destination, const struct GNUNET_HashCode *port, GNUNET_CADET_WindowSizeEventHandler window_changes, GNUNET_CADET_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers)
Create a new channel towards a remote peer.
void * GNUNET_CADET_get_path_cancel(struct GNUNET_CADET_GetPath *gp)
Cancel gp operation.
void(* GNUNET_CADET_ChannelCB)(void *cls, const struct GNUNET_CADET_ChannelInternals *info)
Method called to retrieve information about a specific channel the cadet peer is aware of,...
const union GNUNET_CADET_ChannelInfo * GNUNET_CADET_channel_get_info(struct GNUNET_CADET_Channel *channel, enum GNUNET_CADET_ChannelInfoOption option,...)
Get information about a channel.
void *(* GNUNET_CADET_ConnectEventHandler)(void *cls, struct GNUNET_CADET_Channel *channel, const struct GNUNET_PeerIdentity *source)
Method called whenever a peer connects to a port in MQ-based CADET.
void * GNUNET_CADET_list_peers_cancel(struct GNUNET_CADET_PeersLister *pl)
Cancel a peer info request.
void(* GNUNET_CADET_TunnelsCB)(void *cls, const struct GNUNET_CADET_TunnelDetails *td)
Method called to retrieve information about all tunnels in CADET, called once per tunnel.
void(* GNUNET_CADET_WindowSizeEventHandler)(void *cls, const struct GNUNET_CADET_Channel *channel, int window_size)
Function called whenever an MQ-channel's transmission window size changes.
struct GNUNET_CADET_GetPath * GNUNET_CADET_get_path(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_PeerIdentity *id, GNUNET_CADET_PathCB callback, void *callback_cls)
Request information about a peer known to the running cadet peer.
@ GNUNET_CADET_OPTION_PEER
Who is the peer at the other end of the channel.
#define GNUNET_PACKED
gcc-ism to get packed structs.
Internal details about a channel.
struct GNUNET_PeerIdentity dest
Destination of the channel.
struct GNUNET_PeerIdentity root
Root of the channel.
struct GNUNET_PeerIdentity peer
Peer we want information about.
Number identifying a CADET channel within a tunnel.
uint32_t cn
Which number does this channel have that uniquely identifies it within its tunnel,...
Opaque handle to a channel.
GNUNET_CADET_WindowSizeEventHandler window_changes
Window change handler.
Hash uniquely identifying a connection below a tunnel.
struct GNUNET_ShortHashCode connection_of_tunnel
Opaque handle to the service.
Information we return per peer.
unsigned int best_path_length
Length of the shortest path (0 = unknown, 1 = ourselves, 2 = direct neighbour).
unsigned int n_paths
Number of disjoint known paths to peer.
struct GNUNET_PeerIdentity peer
Which peer is the information about?
int have_tunnel
Do we have a tunnel to this peer?
Detailed information we return per peer.
unsigned int path_length
Number of entries on the path.
const struct GNUNET_PeerIdentity * path
Array of PEER_IDs representing all paths to reach the peer.
unsigned int target_offset
Offset of the target peer on the path.
struct GNUNET_PeerIdentity peer
Peer this is about.
GNUNET_CADET_WindowSizeEventHandler window_changes
Window size change handler.
void * connects_cls
Closure for connects.
Details about a tunnel managed by CADET.
uint16_t cstate
What is our connectivity state?
uint32_t channels
How many channels use the tunnel.
uint16_t estate
What is our encryption state?
struct GNUNET_PeerIdentity peer
Target of the tunnel.
uint32_t connections
How many connections support the tunnel.
Handle to a message queue.
Message handler for a specific message type.
The identity of the host (wraps the signing key of the peer).
Union to retrieve info about a channel.
const struct GNUNET_PeerIdentity peer
Peer on the other side of the channel.
int yes_no
GNUNET_YES / GNUNET_NO, for binary flags.