*/
struct GNUNET_NAMESTORE_QueueEntry *prev;
+ /**
+ * Main handle to access the namestore.
+ */
struct GNUNET_NAMESTORE_Handle *nsh;
- uint32_t op_id;
-
+ /**
+ *
+ */
GNUNET_NAMESTORE_ContinuationWithStatus cont;
+
+ /**
+ * Closure for 'cont'.
+ */
void *cont_cls;
+ /**
+ * Function to call with the records we get back; or NULL.
+ */
GNUNET_NAMESTORE_RecordProcessor proc;
+
+ /**
+ * Closure for 'proc'.
+ */
void *proc_cls;
- char *data; /*stub data pointer*/
+ /**
+ * stub data pointer (???)
+ */
+ char *data;
+
+ /**
+ *
+ */
+ uint32_t op_id;
+
};
*/
struct GNUNET_NAMESTORE_ZoneIterator *prev;
- uint32_t op_id;
-
+ /**
+ * Main handle to access the namestore.
+ */
struct GNUNET_NAMESTORE_Handle *h;
+
+ /**
+ *
+ */
GNUNET_NAMESTORE_RecordProcessor proc;
+
+ /**
+ * Closure for 'proc'.
+ */
void* proc_cls;
+
+ /**
+ *
+ */
struct GNUNET_CRYPTO_ShortHashCode zone;
+
+ /**
+ *
+ */
uint32_t no_flags;
+
+ /**
+ *
+ */
uint32_t flags;
+
+ /**
+ *
+ */
+ uint32_t op_id;
+
+ /**
+ *
+ */
int has_zone;
+
};
struct GNUNET_CLIENT_TransmitHandle *th;
/**
- * Reconnect task
+ * Head of linked list of pending messages to send to the service
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct PendingMessage * pending_head;
/**
- * Pending messages to send to the service
+ * Tail of linked list of pending messages to send to the service
*/
-
- struct PendingMessage * pending_head;
struct PendingMessage * pending_tail;
/**
- * Should we reconnect to service due to some serious error?
+ * Head of pending namestore queue entries
*/
- int reconnect;
-
+ struct GNUNET_NAMESTORE_QueueEntry * op_head;
/**
- * Pending namestore queue entries
+ * Tail of pending namestore queue entries
*/
- struct GNUNET_NAMESTORE_QueueEntry * op_head;
struct GNUNET_NAMESTORE_QueueEntry * op_tail;
- uint32_t op_id;
-
/**
- * Pending namestore zone iterator entries
+ * Head of pending namestore zone iterator entries
*/
struct GNUNET_NAMESTORE_ZoneIterator * z_head;
+
+ /**
+ * Tail of pending namestore zone iterator entries
+ */
struct GNUNET_NAMESTORE_ZoneIterator * z_tail;
+
+ /**
+ * Reconnect task
+ */
+ GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+
+ /**
+ * Should we reconnect to service due to some serious error?
+ */
+ int reconnect;
+
+ /**
+ * ???
+ */
+ uint32_t op_id;
+
};
+
+/**
+ * ???
+ */
struct GNUNET_NAMESTORE_SimpleRecord
{
/**
*/
struct GNUNET_NAMESTORE_SimpleRecord *prev;
+ /**
+ * ???
+ */
const char *name;
+
+ /**
+ * ???
+ */
const struct GNUNET_CRYPTO_ShortHashCode *zone;
- uint32_t record_type;
+
+ /**
+ * ???
+ */
+ const void *data;
+
+ /**
+ * ???
+ */
struct GNUNET_TIME_Absolute expiration;
- enum GNUNET_NAMESTORE_RecordFlags flags;
+
+ /**
+ * ???
+ */
size_t data_size;
- const void *data;
+
+ /**
+ * ???
+ */
+ enum GNUNET_NAMESTORE_RecordFlags flags;
+
+ /**
+ * ???
+ */
+ uint32_t record_type;
+
};
static void
force_reconnect (struct GNUNET_NAMESTORE_Handle *h);
+
static void
handle_lookup_name_response (struct GNUNET_NAMESTORE_QueueEntry *qe,
struct LookupNameResponseMessage * msg,
size_t size)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' \n",
- "LOOKUP_NAME_RESPONSE");
-
struct GNUNET_NAMESTORE_Handle *h = qe->nsh;
-
- /* Operation done, remove */
- GNUNET_CONTAINER_DLL_remove(h->op_head, h->op_tail, qe);
-
-
char *name;
char * rd_tmp;
-
struct GNUNET_CRYPTO_RsaSignature *signature = NULL;
struct GNUNET_TIME_Absolute expire;
struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key_tmp;
int contains_sig = GNUNET_NO;
int rd_count = 0;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' \n",
+ "LOOKUP_NAME_RESPONSE");
+ /* Operation done, remove */
+ GNUNET_CONTAINER_DLL_remove(h->op_head, h->op_tail, qe);
rd_len = ntohs (msg->rd_len);
rd_count = ntohs (msg->rd_count);
msg_len = ntohs (msg->gns_header.header.size);
GNUNET_free (qe);
}
+
static void
handle_zone_to_name_response (struct GNUNET_NAMESTORE_QueueEntry *qe,
struct ZoneToNameResponseMessage* msg,
}
}
+
static void
handle_zone_iteration_response (struct GNUNET_NAMESTORE_ZoneIterator *ze,
struct ZoneIterationResponseMessage *msg,
}
}
+
/**
* Type of a function to call when we receive a message
* from the service.
h);
}
+
static uint32_t
get_op_id (struct GNUNET_NAMESTORE_Handle *h)
{
return op_id;
}
+
/**
* Initialize the connection with the NAMESTORE service.
*
return h;
}
+
static void
clean_up_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
uint32_t rid = 0;
GNUNET_assert (NULL != h);
-
-
rid = get_op_id(h);
it = GNUNET_malloc (sizeof (struct GNUNET_NAMESTORE_ZoneIterator));
it->h = h;
msg->must_have_flags = ntohs (must_have_flags);
msg->must_not_have_flags = ntohs (must_not_have_flags);
-
-
/* transmit message */
GNUNET_CONTAINER_DLL_insert_tail (h->pending_head, h->pending_tail, pe);
do_transmit(h);
struct GNUNET_NAMESTORE_Handle *h = qe->nsh;
GNUNET_assert (qe != NULL);
-
GNUNET_CONTAINER_DLL_remove(h->op_head, h->op_tail, qe);
GNUNET_free(qe);
-
}
/* end of namestore_api.c */