37 #define LOG(kind, ...) \ 38 GNUNET_log_from (kind, "testbed-OC", __VA_ARGS__) 383 LOG_DEBUG (
"Overlay linking between peers %u and %u failed\n",
469 if (NULL != lp2c->
ohh)
484 if (NULL != lp2c->
tcc.
csh)
501 if (NULL != rp2c->
opc)
506 if (NULL != rp2c->
ncn)
511 if ((NULL != rp2c->
p2c) && (NULL != rp2c->
p2n))
524 #define PEER_EXPIRED(peer) \ 525 ((GNUNET_YES == peer->destroy_flag) && (0 == peer->reference_cnt)) 538 (
unsigned long long) occ->
op_id);
549 if (NULL != occ->
ghh)
630 for (fopc =
fopcq_head; NULL != fopc; fopc = fopcn)
633 if (fopc->
client == client)
639 for (occ = occq_head; NULL != occ; occ = occn)
642 if (occ->
client == client)
658 LOG_DEBUG (
"0x%llx: Peers connected - Sending overlay connect success\n",
659 (
unsigned long long) occ->
op_id);
684 char *other_peer_str;
698 LOG_DEBUG (
"Unexpected peer %s connected when expecting peer %s\n",
706 LOG_DEBUG (
"0x%llx: Peer %s connected to peer %s\n",
707 (
unsigned long long) occ->
op_id,
765 "0x%llx: Failed to connect to ATS of peer with id: %u",
766 (
unsigned long long) occ->
op_id,
777 "0x%llx: Timeout during GNUNET_ATS_connectivity_suggest() at peer %s",
778 (
unsigned long long) occ->
op_id,
848 "0x%llx: Timeout while acquiring ATS of %s from cache",
849 (
unsigned long long) occ->
op_id,
857 occ, NULL, NULL, NULL);
872 char *other_peer_str;
880 "0x%llx: Offering HELLO of %s (size: %u) to %s via Remote Overlay Request\n",
881 (
unsigned long long) occ->
op_id,
892 msg->header.size = htons (msize);
916 char *other_peer_str;
928 LOG_DEBUG (
"0x%llx: Offering HELLO of %s to %s\n",
929 (
unsigned long long) occ->
op_id,
938 if (NULL == lp2c->
ohh)
977 "0x%llx: Cannot connect to TRANSPORT of %s",
978 (
unsigned long long) occ->
op_id,
988 "0x%llx: Timeout while offering HELLO to %s",
989 (
unsigned long long) occ->
op_id,
1009 "Connecting to transport of peer %s to obtain HELLO\n",
1024 occ, NULL, NULL, NULL);
1028 "0x%llx: Timeout while offering HELLO to %s",
1029 (
unsigned long long) occ->
op_id,
1071 msize = ntohs (hello->
size);
1079 LOG_DEBUG (
"0x%llx: HELLO of %s is empty\n",
1080 (
unsigned long long) occ->
op_id,
1084 LOG_DEBUG (
"0x%llx: Received HELLO of %s\n",
1085 (
unsigned long long) occ->
op_id,
1126 "0x%llx: Cannot connect to TRANSPORT of %s",
1127 (
unsigned long long) occ->
op_id,
1138 "0x%llx: Timeout while acquiring HELLO of peer %s",
1139 (
unsigned long long) occ->
op_id,
1170 if ((NULL == ch) || (NULL == my_identity))
1173 "0x%llx: Failed to connect to CORE of peer with " 1175 (
unsigned long long) occ->
op_id,
1187 LOG_DEBUG (
"0x%llx: Target peer already connected\n",
1188 (
unsigned long long) occ->
op_id);
1196 LOG_DEBUG (
"0x%llx: Acquiring HELLO of peer %s\n",
1197 (
unsigned long long) occ->
op_id,
1202 LOG_DEBUG (
"0x%llx: HELLO of peer %s found in cache\n",
1203 (
unsigned long long) occ->
op_id,
1210 "0x%llx: Timeout while acquiring TRANSPORT of %s from cache",
1211 (
unsigned long long) occ->
op_id,
1254 "0x%llx: Timeout while connecting to CORE of peer with " 1256 (
unsigned long long) occ->
op_id,
1305 if ((rh_val->
host == (*rh)->host) && (rh_val->
reg_host == (*rh)->reg_host))
1327 uint32_t host_ids[2];
1410 struct Route *route_to_peer2_host;
1411 struct Route *route_to_peer1_host;
1420 p1 = ntohl (msg->
peer1);
1421 p2 = ntohl (msg->
peer2);
1428 LOG_DEBUG (
"0x%llx: Forwarding overlay connect\n",
1429 (
unsigned long long) op_id);
1434 if ((NULL != route_to_peer2_host) &&
1435 (route_to_peer1_host->
dest == route_to_peer2_host->
dest))
1442 LOG_DEBUG (
"Queueing forwarding FOCC for connecting peers %u and %u\n", p1,
1459 LOG_DEBUG (
"Forwarding without FOCC for connecting peers %u and %u\n", p1,
1467 slave->controller, op_id,
1514 "0x%llx: Timeout while getting peer identity of peer " 1516 (
unsigned long long) occ->
op_id,
1536 uint64_t operation_id;
1539 uint32_t peer2_host_id;
1541 p1 = ntohl (msg->
peer1);
1542 p2 = ntohl (msg->
peer2);
1552 (
"Received overlay connect for peers %u and %u with op id: 0x%llx\n",
1555 (
unsigned long long) operation_id);
1580 "0x%llx: Peer %u's host not in our neighbours list\n",
1581 (
unsigned long long) operation_id, p2);
1603 occ->
op_id = operation_id;
1613 "0x%llx: Timeout while acquiring connection to peer %u's " 1615 (
unsigned long long) occ->
op_id,
1635 "0x%llx: Timeout while connecting to CORE of peer with " 1637 (
unsigned long long) occ->
op_id,
1661 LOG_DEBUG (
"0x%llx: Cleaning up rocc\n",
1662 (
unsigned long long) rocc->
op_id);
1667 if (NULL != rocc->
ohh)
1669 if (NULL != rocc->
tcc.
csh)
1699 (
unsigned long long) rocc->
op_id);
1717 LOG_DEBUG (
"0x%llx: Request Overlay connect notify\n",
1718 (
unsigned long long) rocc->
op_id);
1720 memcmp (new_peer, &rocc->
a_id,
1722 LOG_DEBUG (
"0x%llx: Peer %s connected\n",
1723 (
unsigned long long) rocc->
op_id,
1753 LOG_DEBUG (
"0x%llx: HELLO of peer %s delivered to local peer with id: %u\n",
1754 (
unsigned long long) rocc->
op_id,
1762 rocc, NULL, NULL, NULL);
1779 LOG_DEBUG (
"0x%llx: Offering HELLO of peer %s to remote peer with id: %u\n",
1780 (
unsigned long long) rocc->
op_id,
1788 if (NULL == rocc->
ohh)
1831 LOG_DEBUG (
"0x%llx: Target peer %s already connected to local peer: %u\n",
1832 (
unsigned long long) rocc->
op_id,
1872 peer_id = ntohl (msg->
peer);
1898 static char pid_str[16];
1903 peer_id = ntohl (msg->
peer);
1927 "0x%llx: Remote overlay connect %s to peer %s with hello size: %u\n",
1928 (
unsigned long long) rocc->
op_id,
1963 while (NULL != (occ = occq_head))
1976 while (NULL != (rocc = roccq_head))
struct GNUNET_SCHEDULER_Task * timeout_task
Task ID for the timeout task.
struct ForwardedOverlayConnectContext * focc_dll_head
Head of the ForwardedOverlayConnectContext DLL.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
struct GNUNET_CONTAINER_MultiHashMap * reghost_map
Hashmap to hold Registered host contexts.
A connected controller which is not our child.
static void forwarded_overlay_connect_listener(void *cls, const struct GNUNET_MessageHeader *msg)
Callback to be called when forwarded overlay connection operation has a reply from the sub-controller...
static void occ_cache_get_handle_core_cb(void *cls, struct GNUNET_CORE_Handle *ch, struct GNUNET_TRANSPORT_CoreHandle *th, struct GNUNET_ATS_ConnectivityHandle *ac, const struct GNUNET_PeerIdentity *my_identity, const struct GNUNET_CONFIGURATION_Handle *cfg)
Callback from cache with needed CORE handle set.
This context information will be created for each host that is registered at slave controllers during...
static struct GNUNET_CADET_Channel * ch
Channel handle.
static struct RemoteOverlayConnectCtx * roccq_head
DLL head for RequectOverlayConnectContext DLL - to be used to clean up during shutdown.
int is_remote
Is this peer locally created?
uint64_t op_id
The id of the operation responsible for creating this context.
struct NeighbourConnectNotification * ncn
Notification handle acquire to connect to a remote controller.
void GST_send_operation_fail_msg(struct GNUNET_SERVICE_Client *client, uint64_t operation_id, const char *emsg)
Send operation failure message to client.
struct GNUNET_MessageHeader * orig_msg
A copy of the original overlay connect message.
Event notification from a controller to a client.
A HELLO message is used to exchange information about transports with other peers.
struct GNUNET_PeerIdentity a_id
The peer identity of peer A.
Message sent from host controller of a peer(A) to the host controller of another peer(B) to request B...
static void send_hello_thru_rocc(struct OverlayConnectContext *occ)
Sends the HELLO of peer1 to peer2's controller through remote overlay connect request.
Entry in linked list for all offer-HELLO requests.
struct GNUNET_MessageHeader * msg
union OverlayConnectContext::@58 p2ctx
Context information for operations on the second peer.
static void forwarded_overlay_connect_timeout(void *cls)
Timeout task for cancelling a forwarded overlay connect connect.
Type to be used when the first peer is local and the other peer is on a controller which is not start...
Context data for operations on second peer in local overlay connection contexts.
static void p2_transport_connect(struct OverlayConnectContext *occ)
Connects to the transport of the other peer if it is a local peer and schedules the send hello task...
#define GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONNECT_EVENT
Message for peer connect events.
Handle to interact with a GNUnet testbed controller.
struct GST_ConnectionPool_GetHandle * cgh_ch
The GST_ConnectionPool_GetHandle for registering callback to notify CORE level peer connects and to g...
struct NeighbourConnectNotification * GST_neighbour_get_connection(struct Neighbour *n, GST_NeigbourConnectNotifyCallback cb, void *cb_cls)
Try to open a connection to the given neigbour.
Context for the core service connection.
static struct GNUNET_HashCode hash_hosts(struct GNUNET_TESTBED_Host *reg_host, struct GNUNET_TESTBED_Host *host)
Function to generate the hashcode corresponding to a RegisteredHostContext.
struct GNUNET_SCHEDULER_Task * timeout_task
The id of the overlay connect timeout task.
struct GNUNET_TRANSPORT_OfferHelloHandle * ohh
The handle for offering the HELLO of the first peer to the second peer.
data structures shared amongst components of TESTBED service
static void occ_cache_get_handle_ats_occ_cb(void *cls, struct GNUNET_CORE_Handle *ch, struct GNUNET_TRANSPORT_CoreHandle *th, struct GNUNET_ATS_ConnectivityHandle *ac, const struct GNUNET_PeerIdentity *my_identity, const struct GNUNET_CONFIGURATION_Handle *cfg)
Callback from cache with needed ATS handle set.
struct GNUNET_MQ_Handle * GNUNET_SERVICE_client_get_mq(struct GNUNET_SERVICE_Client *c)
Obtain the message queue of c.
uint32_t destroy_flag
While destroying a peer, due to the fact that there could be references to this peer, we delay the peer destroy to a further time.
Message sent from client to testing service to obtain the configuration of a peer.
Context information for connecting 2 peers in overlay.
struct GNUNET_SERVICE_Client * client
The client handle.
The request handle for obtaining a pooled connection.
static void attempt_connect_task(void *cls)
Task to offer the HELLO message to the peer and ask it to connect to the peer whose identity is in Re...
uint32_t GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i)
Produce a random value.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
Notification context to be used to notify when connection to the neighbour's controller is opened...
uint32_t id
Our local reference id for this peer.
struct ConnectivitySuggestContext tcc
The transport try connect context.
struct OverlayConnectContext * next
The next pointer for maintaining a DLL of all OverlayConnectContexts.
#define VALID_PEER_ID(id)
Condition to check if peer id is valid.
struct OperationContext * opc
The generated operation context.
void GST_queue_host_registration(struct Slave *slave, GNUNET_TESTBED_HostRegistrationCompletion cb, void *cb_cls, struct GNUNET_TESTBED_Host *host)
Adds a host registration's request to a slave's registration queue.
struct ForwardedOverlayConnectContext * focc_dll_tail
Tail of the ForwardedOverlayConnectContext DLL.
static void cleanup_rocc(struct RemoteOverlayConnectCtx *rocc)
Function to cleanup RemoteOverlayConnectCtx and any associated tasks with it.
struct RemoteOverlayConnectCtx * prev
the prev pointer for DLL
struct Peer ** GST_peer_list
A list of peers we know about.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
unsigned int GST_peer_list_size
The size of the peer list.
static char * peer_id
Option –peer.
uint64_t operation_id
Operation ID that is used to identify this operation.
struct GNUNET_MessageHeader hello[0]
To be followed by the HELLO message of A.
#define LOG(kind,...)
Redefine LOG with a changed log component string.
void GST_cleanup_focc(struct ForwardedOverlayConnectContext *focc)
Cleans up ForwardedOverlayConnectContext.
uint32_t peer_id
Unique ID for the peer.
static void hello_update_cb(void *cls, const struct GNUNET_MessageHeader *hello)
Function called whenever there is an update to the HELLO of peers in the OverlayConnectClosure.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Context data for operations on second peer in remote overlay connection contexts. ...
void GNUNET_ATS_connectivity_suggest_cancel(struct GNUNET_ATS_ConnectivitySuggestHandle *sh)
We no longer care about being connected to a peer.
Structure representing a connected(directly-linked) controller.
struct GNUNET_PeerIdentity peer_identity
Identity of A.
static struct GNUNET_PeerIdentity my_identity
Identity of this peer.
struct RemotePeer2Context remote
Context information to be used if the second peer is remote.
struct GST_ConnectionPool_GetHandle * cgh_p1th
The GST_ConnectionPool_GetHandle for the peer1's transport handle.
int GNUNET_CONTAINER_multihashmap_contains(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Check if the map contains any value under the given key (including values that are NULL)...
Opaque handle to a host running experiments managed by the testing framework.
struct GNUNET_TESTBED_Host * host
The host of the controller which has to connect to the above rhost.
char * emsg
The error message we send if this overlay connect operation has timed out.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
void GST_forwarded_operation_reply_relay(void *cls, const struct GNUNET_MessageHeader *msg)
Callback to relay the reply msg of a forwarded operation back to the client.
void GST_forwarded_operation_timeout(void *cls)
Task to free resources when forwarded operation has been timed out.
static void timeout_overlay_connect(void *cls)
Task which will be run when overlay connect request has been timed out.
struct GNUNET_ATS_ConnectivitySuggestHandle * GNUNET_ATS_connectivity_suggest(struct GNUNET_ATS_ConnectivityHandle *ch, const struct GNUNET_PeerIdentity *peer, uint32_t strength)
We would like to receive address suggestions for a peer.
struct GNUNET_SERVICE_Client * client
The client which has requested for overlay connection.
Handle to a client that is connected to a service.
uint32_t peer2
The id of peer 2.
static void overlay_connect_notify(void *cls, const struct GNUNET_PeerIdentity *new_peer)
Function called to notify transport users that another peer connected to us.
struct GNUNET_TESTBED_Controller * p2c
Controller of peer 2; If OCC_TYPE_REMOTE_LATERAL is the type of overlay connection then this can be N...
static struct OverlayConnectContext * occq_tail
DLL tail for OverlayConnectContext DLL.
uint32_t peer2
Unique ID for the second peer.
struct GNUNET_TRANSPORT_OfferHelloHandle * ohh
The handle for offering HELLO.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
uint32_t peer
The Unique ID of B.
struct GNUNET_TRANSPORT_CoreHandle * p1th_
Transport handle of the first peer obtained from cache to get its HELLO.
struct Peer * peer
the first peer which is to expect an overlay connection from the second peer.
struct ForwardedOperationContext * fopcq_head
DLL head for forwarded operation contexts.
static char * value
Value of the record to add/remove.
uint64_t operation_id
The id of the operation which created this context information.
#define GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT
Message to request a controller to make one of its peer to connect to another peer using the containe...
struct GNUNET_SCHEDULER_Task * timeout_rocc_task_id
Task to timeout RequestOverlayConnect.
uint32_t peer1
Unique ID for the first peer.
void GST_free_occq()
Clears all pending overlay connect contexts in queue.
uint64_t operation_id
Operation ID that is used to identify this operation.
struct GNUNET_HELLO_Message * GNUNET_HELLO_iterate_addresses(const struct GNUNET_HELLO_Message *msg, int return_modified, GNUNET_HELLO_AddressIterator it, void *it_cls)
Iterate over all of the addresses in the HELLO.
static struct RemoteOverlayConnectCtx * roccq_tail
DLL tail for RequectOverlayConnectContext DLL.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
void GNUNET_TESTBED_forward_operation_msg_cancel_(struct OperationContext *opc)
Function to cancel an operation created by simply forwarding an operation message.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_GET_PEER_INFORMATION.
struct GNUNET_TRANSPORT_HelloGetHandle * ghh
Get GetHelloHandle to acquire a HELLO of the first peer.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
uint32_t peer2
Second peer.
void GST_free_roccq()
Clears all pending remote overlay connect contexts in queue.
struct GNUNET_TESTBED_Host ** GST_host_list
Array of hosts.
enum OperationType type
The type of the operation which is forwarded.
Context information to used during operations which forward the overlay connect message.
uint32_t peer2_host_id
The ID of the host which runs peer2.
enum OverlayConnectContextType type
The type of this context information.
void GST_neighbour_release_connection(struct Neighbour *n)
Release the connection to the neighbour.
struct LocalPeer2Context local
Context information to be used if the second peer is local.
uint64_t operation_id
The Operation ID that is used to identify this operation.
struct Neighbour * p2n
The neighbour handle.
static void send_hello(void *cls)
Task to offer HELLO of peer 1 to peer 2 and try to make peer 2 to connect to peer 1...
Handle for ATS address suggestion requests.
struct GNUNET_MessageHeader * hello
HELLO of the first peer.
uint64_t operation_id
Operation ID that is used to identify this operation.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
uint32_t GNUNET_TESTBED_host_get_id_(const struct GNUNET_TESTBED_Host *host)
Obtain the host's unique global ID.
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration of the peer from cache.
struct OverlayConnectContext * prev
The prev pointer for maintaining a DLL of all OverlayConnectContexts.
uint64_t op_id
The id of the operation responsible for creating this context.
struct Neighbour * GST_create_neighbour(struct GNUNET_TESTBED_Host *host)
Function to create a neigbour and add it into the neighbour list.
#define GNUNET_MESSAGE_TYPE_TESTBED_PEER_INFORMATION
Message containing the peer's information.
static int forward
Search direction: forward.
struct GNUNET_PeerIdentity other_peer_identity
The peer identity of the other peer.
const struct GNUNET_MessageHeader * GST_cache_lookup_hello(const unsigned int peer_id)
Looks up in the hello cache and returns the HELLO of the given peer.
struct Route * GST_find_dest_route(uint32_t host_id)
Finds the route with directly connected host as destination through which the destination host can be...
void GST_notify_client_disconnect_oc(struct GNUNET_SERVICE_Client *client)
Notify OC subsystem that client disconnected.
Bitmask for "any" address.
OverlayConnectContextType
Types for context information we create for overlay connect requests.
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
uint32_t reference_cnt
References to peers are using in forwarded overlay contexts and remote overlay connect contexts...
static char * expiration
Credential TTL.
enum RegisteredHostContext::RHCState state
#define GNUNET_TIME_UNIT_MILLISECONDS
One millisecond.
void GNUNET_TRANSPORT_offer_hello_cancel(struct GNUNET_TRANSPORT_OfferHelloHandle *ohh)
Cancel the request to transport to offer the HELLO message.
static struct RegisteredHostContext * register_host(struct Slave *slave, struct GNUNET_TESTBED_Host *host)
Checks if the given host is registered at the given slave.
static void overlay_connect_get_config(void *cls, const struct GNUNET_MessageHeader *msg)
Callback to be called when forwarded get peer config operation as part of overlay connect is successf...
void * cls
Closure pointer.
static void rocc_cache_get_handle_transport_cb(void *cls, struct GNUNET_CORE_Handle *ch, struct GNUNET_TRANSPORT_CoreHandle *th, struct GNUNET_ATS_ConnectivityHandle *ac, const struct GNUNET_PeerIdentity *ignore_, const struct GNUNET_CONFIGURATION_Handle *cfg)
Callback from cache with needed handles set.
This type is used if the overlay connection is local i.e.
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
static void cleanup_occ(struct OverlayConnectContext *occ)
Cleanup overlay connect context structure.
static void p2_transport_connect_cache_callback(void *cls, struct GNUNET_CORE_Handle *ch, struct GNUNET_TRANSPORT_CoreHandle *th, struct GNUNET_ATS_ConnectivityHandle *ac, const struct GNUNET_PeerIdentity *ignore_, const struct GNUNET_CONFIGURATION_Handle *cfg)
Callback from cache with needed handles set.
uint32_t peer2_host_id
Id of the host where peer2 is running.
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
Interface for connection pooling subroutines.
static void p1_transport_connect_cache_callback(void *cls, struct GNUNET_CORE_Handle *ch, struct GNUNET_TRANSPORT_CoreHandle *th, struct GNUNET_ATS_ConnectivityHandle *ac, const struct GNUNET_PeerIdentity *ignore_, const struct GNUNET_CONFIGURATION_Handle *cfg)
Callback from cache with needed handles set.
uint32_t peer1
the id of peer 1
static struct OverlayConnectContext * occq_head
DLL head for OverlayConnectContext DLL - to be used to clean up during shutdown.
void GST_process_next_focc(struct RegisteredHostContext *rhc)
Processes a forwarded overlay connect context in the queue of the given RegisteredHostContext.
Context information for remote overlay connect operations.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
struct GNUNET_HashCode key
The key used in the DHT.
uint32_t peer1
First peer.
void GNUNET_TESTBED_queue_message_(struct GNUNET_TESTBED_Controller *controller, struct GNUNET_MessageHeader *msg)
Queues a message in send queue for sending to the service.
Overlay connection operation.
static void occ_cache_get_handle_ats_rocc_cb(void *cls, struct GNUNET_CORE_Handle *ch, struct GNUNET_TRANSPORT_CoreHandle *th, struct GNUNET_ATS_ConnectivityHandle *ac, const struct GNUNET_PeerIdentity *my_identity, const struct GNUNET_CONFIGURATION_Handle *cfg)
Callback from cache with needed ATS handle set.
static void rocc_hello_sent_cb(void *cls)
Task that is run when hello has been sent If tc->reason = GNUNET_SCHEDULER_REASON_TIMEOUT then sendin...
static struct GNUNET_MQ_Envelope * ac
Handle to current GNUNET_PEERINFO_add_peer() operation.
struct GNUNET_MQ_Envelope * env
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
struct GNUNET_SCHEDULER_Task * send_hello_task
The id of the task for sending HELLO of peer 2 to peer 1 and ask peer 1 to connect to peer 2...
#define GNUNET_MESSAGE_TYPE_TESTBED_GET_PEER_INFORMATION
Message to get a peer's information.
struct OperationContext * GNUNET_TESTBED_forward_operation_msg_(struct GNUNET_TESTBED_Controller *controller, uint64_t operation_id, const struct GNUNET_MessageHeader *msg, GNUNET_MQ_MessageCallback cc, void *cc_cls)
Sends the given message as an operation.
struct GNUNET_ATS_ConnectivitySuggestHandle * csh
The ATS handle for the connectivity suggestion.
Type to be used when the first peer is local and the other peer is on a slave controller started by u...
#define VALID_HOST_ID(id)
Condition to check if host id is valid.
struct GNUNET_TESTBED_Host * reg_host
The host which is being registered.
int GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
static int reghost_match_iterator(void *cls, const struct GNUNET_HashCode *key, void *value)
Iterator to match a registered host context.
int32_t event_type
'enum GNUNET_TESTBED_EventType' (in NBO); either GNUNET_TESTBED_ET_CONNECT or GNUNET_TESTBED_ET_DISCO...
A connection between two peers was established.
static void send_overlay_connect_success_msg(struct OverlayConnectContext *occ)
FIXME.
uint32_t other_peer_id
The id of the second peer which has to connect to the first peer.
struct GNUNET_MQ_Handle * GNUNET_CORE_get_mq(const struct GNUNET_CORE_Handle *h, const struct GNUNET_PeerIdentity *pid)
Obtain the message queue for a connected peer.
Allow multiple values with the same key.
Message sent from client to testing service to connect two peers.
struct ForwardedOperationContext * fopcq_tail
DLL tail for forwarded operation contexts.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_OVERLAY_CONNECT.
struct GNUNET_PeerIdentity peer_identity
The peer identity of the first peer.
static void forward_overlay_connect(const struct GNUNET_TESTBED_OverlayConnectMessage *msg, struct GNUNET_SERVICE_Client *client)
Forwards the overlay connect request to a slave controller.
struct GNUNET_TIME_Relative GST_timeout
Timeout for operations which may take some time.
int GNUNET_CONTAINER_multihashmap_get_multiple(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, GNUNET_CONTAINER_MulitHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map that match a particular key.
uint32_t host_id
The id of the host this controller is running on.
void GST_destroy_peer(struct Peer *peer)
Function to destroy a peer.
struct GNUNET_SERVICE_Client * client
The client to which we have to reply.
struct GST_ConnectionPool_GetHandle * GST_connection_pool_get_handle(unsigned int peer_id, const struct GNUNET_CONFIGURATION_Handle *cfg, enum GST_ConnectionPool_Service service, GST_connection_pool_connection_ready_cb cb, void *cb_cls, const struct GNUNET_PeerIdentity *target, GST_connection_pool_peer_connect_notify connect_notify_cb, void *connect_notify_cb_cls)
Get a connection handle to service.
An address for communicating with a peer.
#define PEER_EXPIRED(peer)
Condition for checking if given peer is ready to be destroyed.
Context information for requesting ATS to connect to a peer.
struct GNUNET_TRANSPORT_HelloGetHandle * GNUNET_TRANSPORT_hello_get(const struct GNUNET_CONFIGURATION_Handle *cfg, enum GNUNET_TRANSPORT_AddressClass ac, GNUNET_TRANSPORT_HelloUpdateCallback rec, void *rec_cls)
Obtain updates on changes to the HELLO message for this peer.
void handle_remote_overlay_connect(void *cls, const struct GNUNET_TESTBED_RemoteOverlayConnectMessage *msg)
Handler for GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT messages.
#define GNUNET_log(kind,...)
Entry in list of pending tasks.
struct ForwardedOperationContext * next
The next pointer for DLL.
static void occ_hello_sent_cb(void *cls)
Task that is run when hello has been sent If tc->reason = GNUNET_SCHEDULER_REASON_TIMEOUT then sendin...
struct GNUNET_TRANSPORT_OfferHelloHandle * GNUNET_TRANSPORT_offer_hello(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_MessageHeader *hello, GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls)
Offer the transport service the HELLO of another peer.
static int test_address(void *cls, const struct GNUNET_HELLO_Address *address, struct GNUNET_TIME_Absolute expiration)
Test for checking whether HELLO message is empty.
struct GNUNET_TESTBED_Controller * controller
The controller handle.
struct GNUNET_HELLO_Message * hello
Pointer to the HELLO message of this peer; can be NULL.
void GNUNET_TESTING_peer_get_identity(struct GNUNET_TESTING_Peer *peer, struct GNUNET_PeerIdentity *id)
Obtain the peer identity from a peer handle.
struct GNUNET_SCHEDULER_Task * cleanup_task
The id of the cleanup task.
struct RegisteredHostContext * rhc
Which host does this FOCC belong to?
struct GNUNET_MessageHeader * hello
Peer A's HELLO.
uint64_t operation_id
The id of the operation that has been forwarded.
static void cleanup_occ_lp2c(struct LocalPeer2Context *lp2c)
Cleans up any used handles in local peer2 context.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
Functions to call with this peer's HELLO.
struct GST_ConnectionPool_GetHandle * cgh_p2_th
The GetCacheHandle for the peer2's transport handle (used to offer the HELLO to the peer)...
Time for absolute times used by GNUnet, in microseconds.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
static void cache_transport_peer_connect_notify(void *cls, const struct GNUNET_PeerIdentity *new_peer)
Function called to notify transport users that another peer connected to us.
struct GNUNET_MQ_Handle * GNUNET_TRANSPORT_core_get_mq(struct GNUNET_TRANSPORT_CoreHandle *handle, const struct GNUNET_PeerIdentity *peer)
Checks if a given peer is connected to us and get the message queue.
void GST_connection_pool_get_handle_done(struct GST_ConnectionPool_GetHandle *gh)
Relinquish a GST_ConnectionPool_GetHandle object.
#define GNUNET_MESSAGE_TYPE_HELLO
HELLO message with friend only flag used for communicating peer addresses.
static void timeout_rocc_task(void *cls)
Task to timeout rocc and cleanit up.
static void cleanup_occ_rp2c(struct RemotePeer2Context *rp2c)
Cleans up any used handles in remote peer2 context.
void GST_neighbour_get_connection_cancel(struct NeighbourConnectNotification *h)
Cancel the request for opening a connection to the neighbour.
Handle for the transport service (includes all of the state for the transport service).
struct GNUNET_TRANSPORT_CoreHandle * th_
The transport handle obtained from cache.
Handle to the ATS subsystem for connectivity management.
struct Peer::@55::@57 remote
State where we attempt to do the overlay connection again.
static void p2_controller_connect_cb(void *cls, struct GNUNET_TESTBED_Controller *c)
Callback called when a connection to the controller of peer2 has been established.
Context information for operations forwarded to subcontrollers.
static char * address
GNS address for this phone.
size_t GNUNET_strlcpy(char *dst, const char *src, size_t n)
Like strlcpy but portable.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
static void do_cleanup_occ(void *cls)
Task for cleaing up overlay connect context structure.
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
uint32_t dest
destination host
struct Peer * peer
The peer handle of peer B.
void GNUNET_TRANSPORT_hello_get_cancel(struct GNUNET_TRANSPORT_HelloGetHandle *ghh)
Stop receiving updates about changes to our HELLO message.
#define LOG_DEBUG(...)
Debug logging shorthand.
static void host_registration_comp(void *cls, const char *emsg)
Callback which will be called after a host registration succeeded or failed.
int check_remote_overlay_connect(void *cls, const struct GNUNET_TESTBED_RemoteOverlayConnectMessage *msg)
Check GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT messages.
No good quality of the operation is needed (i.e., random numbers can be pseudo-random).
#define GNUNET_malloc(size)
Wrapper around malloc.
struct RemoteOverlayConnectCtx * next
the next pointer for DLL
struct Neighbour * GST_get_neighbour(uint32_t id)
Get a neighbour from the neighbour list.
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
Context information for GNUNET_TESTBED_Operation.
#define GNUNET_free(ptr)
Wrapper around free.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT.
void handle_overlay_connect(void *cls, const struct GNUNET_TESTBED_OverlayConnectMessage *msg)
Handler for GNUNET_MESSAGE_TYPE_TESTBED_OVERLAY_CONNECT messages.
struct GNUNET_MessageHeader * GNUNET_copy_message(const struct GNUNET_MessageHeader *msg)
Create a copy of the given message.
struct OperationContext * opc
Operation context for the suboperation we start to get the identity of the second peer...
struct GST_ConnectionPool_GetHandle * cgh_p2_ats
The GetCacheHandle for the peer2's ATS handle.
struct GNUNET_SCHEDULER_Task * attempt_connect_task_id
Task for offering HELLO of A to B and doing try_connect.
void GST_cache_add_hello(const unsigned int peer_id, const struct GNUNET_MessageHeader *hello)
Caches the HELLO of the given peer.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
struct Peer::@55::@56 local
struct ConnectivitySuggestContext tcc
The transport ConnectivitySuggestContext.