GNUnet  0.20.0
gnunet-service-testbed_links.h File Reference

TESTBED service components that deals with starting slave controllers and establishing lateral links between controllers. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Slave
 Structure representing a connected(directly-linked) controller. More...
 

Typedefs

typedef void(* GST_NeighbourConnectNotifyCallback) (void *cls, struct GNUNET_TESTBED_Controller *controller)
 The notification callback to call when we are connect to neighbour. More...
 

Functions

void GST_neighbour_list_clean (void)
 Cleans up the neighbour list. More...
 
struct NeighbourGST_get_neighbour (uint32_t id)
 Get a neighbour from the neighbour list. More...
 
void GST_free_nccq (void)
 Function to cleanup the neighbour connect contexts. More...
 
struct NeighbourConnectNotificationGST_neighbour_get_connection (struct Neighbour *n, GST_NeighbourConnectNotifyCallback cb, void *cb_cls)
 Try to open a connection to the given neighbour. More...
 
void GST_neighbour_get_connection_cancel (struct NeighbourConnectNotification *h)
 Cancel the request for opening a connection to the neighbour. More...
 
void GST_neighbour_release_connection (struct Neighbour *n)
 Release the connection to the neighbour. More...
 
struct NeighbourGST_create_neighbour (struct GNUNET_TESTBED_Host *host)
 Function to create a neighbour and add it into the neighbour list. More...
 
void handle_link_controllers (void *cls, const struct GNUNET_TESTBED_ControllerLinkRequest *msg)
 Message handler for #GNUNET_MESSAGE_TYPE_TESTBED_LCONTROLLERS message. More...
 
void GST_link_notify_disconnect (struct GNUNET_SERVICE_Client *client)
 Clean up client handle if we stored any via handle_link_controllers(), the given client disconnected. More...
 
void GST_slave_list_clear (void)
 Cleans up the slave list. More...
 

Variables

struct Slave ** GST_slave_list
 A list of directly linked neighbours. More...
 
unsigned int GST_slave_list_size
 The size of directly linked neighbours list. More...
 

Detailed Description

TESTBED service components that deals with starting slave controllers and establishing lateral links between controllers.

Author
Sree Harsha Totakura

Definition in file gnunet-service-testbed_links.h.

Typedef Documentation

◆ GST_NeighbourConnectNotifyCallback

typedef void(* GST_NeighbourConnectNotifyCallback) (void *cls, struct GNUNET_TESTBED_Controller *controller)

The notification callback to call when we are connect to neighbour.

Parameters
clsthe closure given to GST_neighbour_get_connection()
controllerthe controller handle to the neighbour

Definition at line 131 of file gnunet-service-testbed_links.h.

Function Documentation

◆ GST_neighbour_list_clean()

void GST_neighbour_list_clean ( void  )

Cleans up the neighbour list.

Definition at line 1094 of file gnunet-service-testbed_links.c.

1095 {
1096  struct Neighbour *n;
1097  unsigned int id;
1098 
1099  for (id = 0; id < neighbour_list_size; id++)
1100  {
1101  if (NULL == (n = neighbour_list[id]))
1102  continue;
1103  if (NULL != n->conn_op)
1105  GNUNET_free (n);
1106  neighbour_list[id] = NULL;
1107  }
1109 }
static struct GNUNET_IDENTITY_Handle * id
Handle to identity service.
#define GNUNET_free(ptr)
Wrapper around free.
A connected controller which is not our child.
struct GNUNET_TESTBED_Operation * conn_op
Operation handle for opening a lateral connection to another controller.
void GNUNET_TESTBED_operation_release_(struct GNUNET_TESTBED_Operation *op)
An operation is 'done' (was cancelled or finished); remove it from the queues and release associated ...

References Neighbour::conn_op, GNUNET_free, GNUNET_TESTBED_operation_release_(), id, neighbour_list, and neighbour_list_size.

Referenced by shutdown_task().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GST_get_neighbour()

struct Neighbour* GST_get_neighbour ( uint32_t  id)

Get a neighbour from the neighbour list.

Parameters
idthe index of the neighbour in the neighbour list
Returns
the Neighbour; NULL if the given index in invalid (index greater than the list size or neighbour at that index is NULL)

Definition at line 1120 of file gnunet-service-testbed_links.c.

1121 {
1122  if (neighbour_list_size <= id)
1123  return NULL;
1124  return neighbour_list[id];
1125 }

References id, neighbour_list, and neighbour_list_size.

Referenced by handle_overlay_connect().

Here is the caller graph for this function:

◆ GST_free_nccq()

void GST_free_nccq ( void  )

Function to cleanup the neighbour connect contexts.

Definition at line 1132 of file gnunet-service-testbed_links.c.

1133 {
1134  while (NULL != ncc_head)
1136 }

References cleanup_ncc(), and ncc_head.

Referenced by shutdown_task().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GST_neighbour_get_connection()

struct NeighbourConnectNotification* GST_neighbour_get_connection ( struct Neighbour n,
GST_NeighbourConnectNotifyCallback  cb,
void *  cb_cls 
)

Try to open a connection to the given neighbour.

If the connection is open already, then it is re-used. If not, the request is queued in the operation queues responsible for bounding the total number of file descriptors. The actual connection will happen when the operation queue marks the corresponding operation as active.

Parameters
nthe neighbour to open a connection to
cbthe notification callback to call when the connection is opened
cb_clsthe closure for the above callback

Definition at line 986 of file gnunet-service-testbed_links.c.

989 {
991 
992  GNUNET_assert (NULL != cb);
993  LOG_DEBUG ("Attempting to get connection to controller on host %u\n",
994  n->host_id);
996  h->n = n;
997  h->cb = cb;
998  h->cb_cls = cb_cls;
1000  if (NULL == n->conn_op)
1001  {
1002  GNUNET_assert (NULL == n->controller);
1007  return h;
1008  }
1010  return h;
1011 }
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
#define LOG_DEBUG(...)
Debug logging shorthand.
struct OperationQueue * GST_opq_openfds
Operation queue for open file descriptors.
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Notification context to be used to notify when connection to the neighbour's controller is opened.
GST_NeighbourConnectNotifyCallback cb
The notification callback to call when we are connect to neighbour.
struct Neighbour * n
The neighbour.
void * cb_cls
The closure for the above callback.
struct NeighbourConnectNotification * nl_tail
DLL tail for the list of notification requests.
struct GNUNET_TESTBED_Controller * controller
The controller handle.
struct NeighbourConnectNotification * nl_head
DLL head for the list of notification requests.
uint32_t host_id
The id of the host this controller is running on.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_operation_create_(void *cls, OperationStart start, OperationRelease release)
Create an 'operation' to be performed.
void GNUNET_TESTBED_operation_queue_insert_(struct OperationQueue *queue, struct GNUNET_TESTBED_Operation *op)
Add an operation to a queue.
void GNUNET_TESTBED_operation_begin_wait_(struct GNUNET_TESTBED_Operation *op)
Marks the given operation as waiting on the queues.

References NeighbourConnectNotification::cb, NeighbourConnectNotification::cb_cls, Neighbour::conn_op, Neighbour::controller, GNUNET_assert, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_new, GNUNET_TESTBED_operation_begin_wait_(), GNUNET_TESTBED_operation_create_(), GNUNET_TESTBED_operation_queue_insert_(), GST_opq_openfds, h, Neighbour::host_id, LOG_DEBUG, NeighbourConnectNotification::n, Neighbour::nl_head, Neighbour::nl_tail, oprelease_neighbour_conn(), opstart_neighbour_conn(), and trigger_notifications().

Referenced by handle_link_controllers(), and handle_overlay_connect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GST_neighbour_get_connection_cancel()

void GST_neighbour_get_connection_cancel ( struct NeighbourConnectNotification h)

Cancel the request for opening a connection to the neighbour.

Parameters
hthe notification handle

Definition at line 1020 of file gnunet-service-testbed_links.c.

1021 {
1022  struct Neighbour *n;
1023  int cleanup_task;
1024 
1025  n = h->n;
1026  cleanup_task = (h == n->nl_head) ? GNUNET_YES : GNUNET_NO;
1028  GNUNET_free (h);
1029  if (GNUNET_NO == cleanup_task)
1030  return;
1031  if (NULL == n->notify_task)
1032  return;
1033  GNUNET_assert (0 < n->reference_cnt);
1034  n->reference_cnt--;
1036  n->notify_task = NULL;
1037  if (NULL == n->nl_head)
1038  {
1039  if ((0 == n->reference_cnt) && (0 == n->inactive))
1040  {
1041  n->inactive = 1;
1043  }
1044  return;
1045  }
1047 }
static struct GNUNET_SCHEDULER_Task * cleanup_task
Cleanup task.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
@ GNUNET_YES
@ GNUNET_NO
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:975
unsigned int reference_cnt
How many references are present currently to this neighbour's connection.
unsigned int inactive
Is the conn_op inactivated?
struct GNUNET_SCHEDULER_Task * notify_task
Task id for the task to call notifications from the notification list.
void GNUNET_TESTBED_operation_inactivate_(struct GNUNET_TESTBED_Operation *op)
Marks an active operation as inactive - the operation will be kept in a ready-to-be-released state an...

References cleanup_task, Neighbour::conn_op, GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_NO, GNUNET_SCHEDULER_cancel(), GNUNET_TESTBED_operation_inactivate_(), GNUNET_YES, h, Neighbour::inactive, Neighbour::nl_head, Neighbour::nl_tail, Neighbour::notify_task, Neighbour::reference_cnt, and trigger_notifications().

Referenced by cleanup_ncc(), and cleanup_occ_rp2c().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GST_neighbour_release_connection()

void GST_neighbour_release_connection ( struct Neighbour n)

Release the connection to the neighbour.

The actual connection will be closed if connections to other neighbour are waiting (to maintain a bound on the total number of connections that are open).

Parameters
nthe neighbour whose connection can be closed

Definition at line 1058 of file gnunet-service-testbed_links.c.

1059 {
1060  GNUNET_assert (0 == n->inactive);
1061  GNUNET_assert (0 < n->reference_cnt);
1062  n->reference_cnt--;
1063  if (0 == n->reference_cnt)
1064  {
1065  n->inactive = 1;
1067  }
1068 }

References Neighbour::conn_op, GNUNET_assert, GNUNET_TESTBED_operation_inactivate_(), Neighbour::inactive, and Neighbour::reference_cnt.

Referenced by cleanup_occ_rp2c(), and neighbour_connect_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GST_create_neighbour()

struct Neighbour* GST_create_neighbour ( struct GNUNET_TESTBED_Host host)

Function to create a neighbour and add it into the neighbour list.

Parameters
hostthe host of the neighbour

Definition at line 1188 of file gnunet-service-testbed_links.c.

1189 {
1190  struct Neighbour *n;
1191 
1192  n = GNUNET_new (struct Neighbour);
1194  neighbour_list_add (n); /* just add; connect on-demand */
1195  return n;
1196 }
uint32_t GNUNET_TESTBED_host_get_id_(const struct GNUNET_TESTBED_Host *host)
Obtain a host's unique global ID.

References GNUNET_new, GNUNET_TESTBED_host_get_id_(), Neighbour::host_id, and neighbour_list_add().

Referenced by handle_link_controllers(), and handle_overlay_connect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_link_controllers()

void handle_link_controllers ( void *  cls,
const struct GNUNET_TESTBED_ControllerLinkRequest msg 
)

Message handler for #GNUNET_MESSAGE_TYPE_TESTBED_LCONTROLLERS message.

Parameters
clsidentification of the client
msgthe actual message

Definition at line 1206 of file gnunet-service-testbed_links.c.

1208 {
1209  struct GNUNET_SERVICE_Client *client = cls;
1210  struct LCFContext *lcf;
1211  struct Route *route;
1212  struct Route *new_route;
1213  uint64_t op_id;
1214  uint32_t delegated_host_id;
1215  uint32_t slave_host_id;
1216 
1217  if (NULL == GST_context)
1218  {
1219  GNUNET_break (0);
1220  GNUNET_SERVICE_client_drop (client);
1221  return;
1222  }
1223  delegated_host_id = ntohl (msg->delegated_host_id);
1224  if (delegated_host_id == GST_context->host_id)
1225  {
1226  GNUNET_break (0);
1228  "Trying to link ourselves\n");
1229  GNUNET_SERVICE_client_drop (client);
1230  return;
1231  }
1232  if ((delegated_host_id >= GST_host_list_size) ||
1233  (NULL == GST_host_list[delegated_host_id]))
1234  {
1236  "Delegated host %u not registered with us\n",
1237  delegated_host_id);
1238  GNUNET_SERVICE_client_drop (client);
1239  return;
1240  }
1241  slave_host_id = ntohl (msg->slave_host_id);
1242  if ((slave_host_id >= GST_host_list_size) ||
1243  (NULL == GST_host_list[slave_host_id]))
1244  {
1246  "Slave host %u not registered with us\n",
1247  slave_host_id);
1248  GNUNET_SERVICE_client_drop (client);
1249  return;
1250  }
1251  if (slave_host_id == delegated_host_id)
1252  {
1254  "Slave and delegated host are same\n");
1255  GNUNET_SERVICE_client_drop (client);
1256  return;
1257  }
1258  op_id = GNUNET_ntohll (msg->operation_id);
1259  if (slave_host_id == GST_context->host_id) /* Link from us */
1260  {
1261  struct Slave *slave;
1262  struct LinkControllersContext *lcc;
1263 
1264  if (1 != msg->is_subordinate)
1265  {
1266  struct Neighbour *n;
1267  struct NeighbourConnectCtxt *ncc;
1268 
1269  if ((delegated_host_id < neighbour_list_size) &&
1270  (NULL != neighbour_list[delegated_host_id]))
1271  {
1272  GNUNET_break (0);
1274  return;
1275  }
1276  LOG_DEBUG ("Received request to establish a link to host %u\n",
1277  delegated_host_id);
1278  n = GST_create_neighbour (GST_host_list[delegated_host_id]);
1279  ncc = GNUNET_new (struct NeighbourConnectCtxt);
1280  ncc->n = n;
1281  ncc->op_id = op_id;
1282  ncc->client = client;
1285  ncc);
1286  ncc->timeout_task
1289  ncc);
1291  ncc_tail,
1292  ncc);
1294  return;
1295  }
1296  if ((delegated_host_id < GST_slave_list_size) &&
1297  (NULL != GST_slave_list[delegated_host_id]))
1298  {
1299  GNUNET_break (0);
1301  return;
1302  }
1303  LOG_DEBUG ("Received request to start and establish a link to host %u\n",
1304  delegated_host_id);
1305  slave = GNUNET_new (struct Slave);
1306  slave->host_id = delegated_host_id;
1308  GNUNET_NO);
1309  slave_list_add (slave);
1310  lcc = GNUNET_new (struct LinkControllersContext);
1311  lcc->operation_id = op_id;
1312  lcc->client = client;
1313  slave->lcc = lcc;
1314  slave->controller_proc
1316  GST_host_list[slave->host_id],
1317  &slave_status_cb,
1318  slave);
1319  new_route = GNUNET_new (struct Route);
1320  new_route->dest = delegated_host_id;
1321  new_route->thru = GST_context->host_id;
1322  route_list_add (new_route);
1323  return;
1324  }
1325 
1326  /* Route the request */
1327  if (slave_host_id >= route_list_size)
1328  {
1330  "No route towards slave host");
1332  return;
1333  }
1334  lcf = GNUNET_new (struct LCFContext);
1335  lcf->delegated_host_id = delegated_host_id;
1336  lcf->slave_host_id = slave_host_id;
1337  route = GST_find_dest_route (slave_host_id);
1338  GNUNET_assert (NULL != route); /* because we add routes carefully */
1340  GNUNET_assert (NULL != GST_slave_list[route->dest]);
1341  lcf->is_subordinate = msg->is_subordinate;
1342  lcf->state = INIT;
1343  lcf->operation_id = op_id;
1344  lcf->gateway = GST_slave_list[route->dest];
1345  lcf->client = client;
1346  if (NULL == lcf_head)
1347  {
1348  GNUNET_assert (NULL == lcf_proc_task_id);
1350  lcf_tail,
1351  lcf);
1353  lcf);
1354  }
1355  else
1356  {
1358  lcf_tail,
1359  lcf);
1360  }
1361  /* FIXME: Adding a new route should happen after the controllers are linked
1362  * successfully */
1363  if (1 != msg->is_subordinate)
1364  {
1366  return;
1367  }
1368  if ((delegated_host_id < route_list_size) &&
1369  (NULL != route_list[delegated_host_id]))
1370  {
1371  GNUNET_break_op (0); /* Are you trying to link delegated host twice
1372  * with is subordinate flag set to GNUNET_YES? */
1374  return;
1375  }
1376  new_route = GNUNET_new (struct Route);
1377  new_route->dest = delegated_host_id;
1378  new_route->thru = route->dest;
1379  route_list_add (new_route);
1381 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_TESTBED_Host ** GST_host_list
Array of hosts.
struct Context * GST_context
The master context; generated with the first INIT message.
struct GNUNET_TIME_Relative GST_timeout
Timeout for operations which may take some time.
unsigned int GST_host_list_size
The size of the host list.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
Definition: common_endian.c:54
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
@ GNUNET_ERROR_TYPE_WARNING
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.
Definition: scheduler.c:1299
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.
Definition: scheduler.c:1272
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
Definition: service.c:2330
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2249
struct GNUNET_TESTBED_ControllerProc * GNUNET_TESTBED_controller_start(const char *trusted_ip, struct GNUNET_TESTBED_Host *host, GNUNET_TESTBED_ControllerStatusCallback cb, void *cls)
Starts a controller process at the given host.
char * master_ip
The network address of the master controller.
uint32_t host_id
Our host id according to this context.
Handle to a client that is connected to a service.
Definition: service.c:252
Link controllers request forwarding context.
enum LCFContextState state
The state of this context.
uint32_t delegated_host_id
The delegated host.
struct GNUNET_SERVICE_Client * client
The client which has asked to perform this operation.
uint32_t slave_host_id
The slave host.
uint64_t operation_id
The id of the operation which created this context.
struct Slave * gateway
The gateway which will pass the link message to delegated host.
int is_subordinate
should the slave controller start the delegated controller?
Context information used while linking controllers.
uint64_t operation_id
The ID of the operation.
struct GNUNET_SERVICE_Client * client
The client which initiated the link controller operation.
Context information for establishing a link to neighbour (Used is GST_handle_link_controllers()
struct NeighbourConnectNotification * nh
The notification handle associated with the neighbour's connection request.
uint64_t op_id
The id of the link-controllers operation responsible for creating this context.
struct GNUNET_SCHEDULER_Task * timeout_task
Task to be run upon timeout.
struct Neighbour * n
The neighbour to whom connection should be made.
struct GNUNET_SERVICE_Client * client
The client requesting the connection.
A routing entry.
uint32_t thru
The destination host is reachable thru.
uint32_t dest
destination host
Structure representing a connected(directly-linked) controller.
uint32_t host_id
The id of the host this controller is running on.
struct GNUNET_TESTBED_ControllerProc * controller_proc
The controller process handle if we had started the controller.
struct GNUNET_CONTAINER_MultiHashMap * reghost_map
Hashmap to hold Registered host contexts.
struct LinkControllersContext * lcc
handle to lcc which is associated with this slave startup.

References LinkControllersContext::client, LCFContext::client, NeighbourConnectCtxt::client, Slave::controller_proc, LCFContext::delegated_host_id, Route::dest, LCFContext::gateway, GNUNET_assert, GNUNET_break, GNUNET_break_op, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CONTAINER_multihashmap_create(), GNUNET_ERROR_TYPE_WARNING, GNUNET_new, GNUNET_NO, GNUNET_ntohll(), GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_add_now(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_TESTBED_controller_start(), GST_context, GST_create_neighbour(), GST_find_dest_route(), GST_host_list, GST_host_list_size, GST_neighbour_get_connection(), GST_slave_list, GST_slave_list_size, GST_timeout, Context::host_id, Slave::host_id, INIT, LCFContext::is_subordinate, Slave::lcc, lcf_head, lcf_proc_task(), lcf_proc_task_id, lcf_tail, LOG, LOG_DEBUG, Context::master_ip, msg, NeighbourConnectCtxt::n, ncc_head, ncc_tail, neighbour_connect_cb(), neighbour_list, neighbour_list_size, NeighbourConnectCtxt::nh, NeighbourConnectCtxt::op_id, LinkControllersContext::operation_id, LCFContext::operation_id, Slave::reghost_map, route_list, route_list_add(), route_list_size, LCFContext::slave_host_id, slave_list_add(), slave_status_cb(), LCFContext::state, Route::thru, timeout_neighbour_connect(), and NeighbourConnectCtxt::timeout_task.

Here is the call graph for this function:

◆ GST_link_notify_disconnect()

void GST_link_notify_disconnect ( struct GNUNET_SERVICE_Client client)

Clean up client handle if we stored any via handle_link_controllers(), the given client disconnected.

Parameters
clientthe client that is history

Definition at line 1391 of file gnunet-service-testbed_links.c.

1392 {
1393  struct NeighbourConnectCtxt *ncc;
1394  struct NeighbourConnectCtxt *nccn;
1395  struct LCFContext *lcf;
1396  struct LCFContext *lcfn;
1397 
1398  for (ncc = ncc_head; NULL != ncc; ncc = nccn)
1399  {
1400  nccn = ncc->next;
1401  if (ncc->client == client)
1402  cleanup_ncc (ncc);
1403  }
1404  for (unsigned int i = 0; i < GST_slave_list_size; i++)
1405  {
1406  struct Slave *slave = GST_slave_list[i];
1407  struct LinkControllersContext *lcc;
1408 
1409  if (NULL == slave)
1410  continue;
1413  client);
1414  lcc = slave->lcc;
1415  if (NULL == lcc)
1416  continue;
1417  if (lcc->client == client)
1418  {
1419  slave->lcc = NULL;
1420  GNUNET_free (lcc);
1421  }
1422  }
1423  for (lcf = lcf_head; NULL != lcf; lcf = lcfn)
1424  {
1425  lcfn = lcf->next;
1426  if ((NULL != lcf) &&
1427  (client == lcf->client))
1428  {
1429  if (NULL != lcf->op)
1432  lcf_tail,
1433  lcf);
1434  GNUNET_free (lcf);
1435  }
1436  }
1437 }
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
void GNUNET_TESTBED_operation_done(struct GNUNET_TESTBED_Operation *operation)
This function is used to signal that the event information (struct GNUNET_TESTBED_EventInformation) f...
Definition: testbed_api.c:2021
struct GNUNET_TESTBED_Operation * op
Handle for operations which are forwarded while linking controllers.
struct LCFContext * next
The LCFContext.
struct NeighbourConnectCtxt * next
DLL next for inclusion in the corresponding context list.

References cleanup_ncc(), LinkControllersContext::client, LCFContext::client, NeighbourConnectCtxt::client, drop_client_entries(), GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_free, GNUNET_TESTBED_operation_done(), GST_slave_list, GST_slave_list_size, Slave::lcc, lcf_head, lcf_tail, ncc_head, LCFContext::next, NeighbourConnectCtxt::next, LCFContext::op, and Slave::reghost_map.

Referenced by client_disconnect_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GST_slave_list_clear()

void GST_slave_list_clear ( void  )

Cleans up the slave list.

Definition at line 493 of file gnunet-service-testbed_links.c.

494 {
495  struct Slave *slave;
496  unsigned int id;
497 
498  for (id = 0; id < GST_slave_list_size; id++)
499  {
500  slave = GST_slave_list[id];
501  if (NULL == slave)
502  continue;
503  kill_slave (slave);
504  }
505  for (id = 0; id < GST_slave_list_size; id++)
506  {
507  slave = GST_slave_list[id];
508  if (NULL == slave)
509  continue;
510  destroy_slave (slave);
511  }
513  GST_slave_list = NULL;
514 }

References destroy_slave(), GNUNET_free, GST_slave_list, GST_slave_list_size, id, and kill_slave().

Referenced by shutdown_task().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ GST_slave_list

◆ GST_slave_list_size

unsigned int GST_slave_list_size
extern