38#if ! defined(GNUNET_CULL_LOGGING)
39#define CADET_TIMING_START \
40 struct GNUNET_TIME_Absolute __timestamp; \
41 __timestamp = GNUNET_TIME_absolute_get ()
43#define CADET_TIMING_END \
44 struct GNUNET_TIME_Relative __duration; \
45 __duration = GNUNET_TIME_absolute_get_duration (__timestamp); \
46 LOG (GNUNET_ERROR_TYPE_INFO, \
47 " %s duration %s\n", \
49 GNUNET_STRINGS_relative_time_to_string (__duration, GNUNET_YES));
51#define CADET_TIMING_START
52#define CADET_TIMING_END
70#define GNUNET_CADET_LOCAL_CHANNEL_ID_CLI 0x80000000U
75#define HIGH_PID 0xFF000000
80#define LOW_PID 0x00FFFFFF
89#define PID_OVERFLOW(pid, max) (((pid) > HIGH_PID) && ((max) < LOW_PID))
555GC_bin2s (
void *bin,
unsigned int len,
char **output);
size_t GC_bin2s(void *bin, unsigned int len, char **output)
Allocate a string with a hexdump of any binary data.
uint32_t GC_min_pid(uint32_t a, uint32_t b)
Get the lower ACK value out of two values, taking in account overflow.
uint32_t GC_max_pid(uint32_t a, uint32_t b)
Get the higher ACK value out of two values, taking in account overflow.
GNUNET_NETWORK_STRUCT_END char * GC_f2s(int fwd)
Translate a fwd variable into a string representation, for logging.
const char * GC_m2s(uint16_t m)
Convert a message type into a string to help debug Generated with: FIND: "#define ([^ ]+)[ ]*([0-9]+)...
int GC_is_pid_bigger(uint32_t bigger, uint32_t smaller)
Check if one pid is bigger than other, accounting for overflow.
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
CADET service; establish channels to distant peers.
Core service; the main API for encrypted P2P communications.
Constants for network protocols.
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...
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.
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
#define GNUNET_PACKED
gcc-ism to get packed structs.
Message to inform the client about channels in the service.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CHANNEL.
struct GNUNET_PeerIdentity dest
Destination of the channel.
struct GNUNET_PeerIdentity root
Root of the channel.
Opaque handle to a channel.
void * ctx
Any data the caller wants to put in here, used for the various callbacks (disconnects,...
struct GNUNET_CADET_Handle * cadet
Handle to the cadet this channel belongs to.
unsigned int allow_send
How many messages are we allowed to send to the service right now?
struct GNUNET_SCHEDULER_Task * mq_cont
Task to allow mq to send more traffic.
struct GNUNET_PeerIdentity peer
Other end of the channel.
GNUNET_CADET_WindowSizeEventHandler window_changes
Window change handler.
struct GNUNET_CADET_ClientChannelNumber ccn
Local ID of the channel, GNUNET_CADET_LOCAL_CHANNEL_ID_CLI bit is set if outbound.
GNUNET_CADET_DisconnectEventHandler disconnects
Disconnect handler.
struct GNUNET_MQ_Handle * mq
Message Queue for the channel (which we are implementing).
struct GNUNET_MQ_Envelope * pending_env
Pending envelope with a message to be transmitted to the service as soon as we are allowed to.
struct GNUNET_CADET_Port * incoming_port
Channel's port, if incoming.
Number uniquely identifying a channel of a client.
uint32_t channel_of_client
Values for channel numbering.
Opaque handle to the service.
Message to allow the client send more data to the service (always service -> client).
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK.
struct GNUNET_CADET_ClientChannelNumber ccn
ID of the channel allowed to send more data.
Message for a client to create channels.
struct GNUNET_PeerIdentity peer
Channel's peer.
struct GNUNET_CADET_ClientChannelNumber ccn
ID of a channel controlled by this client.
struct GNUNET_HashCode port
Port of the channel.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE.
Message for or to a client to destroy tunnel.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY.
struct GNUNET_CADET_ClientChannelNumber ccn
ID of a channel controlled by this client.
Message for cadet data traffic.
struct GNUNET_CADET_ClientChannelNumber ccn
ID of the channel.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA.
uint32_t pp
Priority and preferences (an enum GNUNET_MQ_PriorityPreferences) of the message in NBO.
Message to inform the client about one of the paths known to the service.
uint32_t off
Offset of the peer that was requested.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PATH.
Message to inform the client about one of the peers in the service.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS.
struct GNUNET_PeerIdentity destination
ID of the peer (can be local peer).
uint32_t best_path_length
Shortest known path.
int16_t tunnel
Do we have a tunnel toward this peer?
uint16_t paths
Number of paths.
Message to inform the client about one of the tunnels in the service.
struct GNUNET_MessageHeader header
Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNEL or GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNELS.
uint16_t cstate
Connection state.
uint16_t estate
Encryption state.
struct GNUNET_PeerIdentity destination
ID of the destination of the tunnel (can be local peer).
uint32_t connections
Number of connections.
uint32_t channels
Number of channels.
Message to inform the client about channels in the service.
struct GNUNET_PeerIdentity peer
ID of the destination of the channel (can be local peer).
struct GNUNET_CADET_ClientChannelNumber ccn
ID of the channel allowed to send more data.
struct GNUNET_MessageHeader header
Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNEL or #GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEER.
Message for a client to create and destroy channels.
struct GNUNET_HashCode port
Port to open/close.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_OPEN or GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE.
Message to as the service about information on a channel.
struct GNUNET_PeerIdentity target
Target of the channel.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_CHANNEL.
Message to drop another message of specific type.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE.
struct GNUNET_CADET_ClientChannelNumber ccn
ID of the channel we want to drop a message for.
uint16_t type
Type of the message this handler covers, in host byte order.
Message to inform the client about channels in the service.
uint32_t resered
Always zero.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PATH.
struct GNUNET_PeerIdentity peer
ID of the destination of the channel (can be local peer).
Handle to a message queue.
The identity of the host (wraps the signing key of the peer).
Entry in list of pending tasks.