# No extra newlines that cause noisy diffs
nl_start_of_file=remove
+nl_after_func_proto = 2
+nl_after_func_body = 3
# If there's no new line, it's not a text file!
nl_end_of_file=add
+nl_max_blank_in_func = 3
+nl_max = 3
sp_inside_paren = remove
sp_before_sparen = add
sp_inside_fparen = remove
+sp_inside_sparen = remove
# add space before function call and decl: "foo (x)"
sp_func_call_paren = add
sp_func_proto_paren_empty = add
sp_func_def_paren = add
sp_func_def_paren_empty = add
+
+# We'd want it for "if ( (foo) || (bar) )", but not for "if (m())",
+# so as uncrustify doesn't give exactly what we want => ignore
+sp_paren_paren = ignore
+sp_inside_paren = remove
+sp_bool = force
+
+nl_func_type_name = force
+#nl_branch_else = add
+nl_else_brace = add
+nl_elseif_brace = add
+nl_for_brace = add
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
force_reconnect (handle);
}
+
/**
* Check validity of message received from the ABD service
*
static int
check_result (void *cls, const struct DelegationChainResultMessage *vr_msg)
{
- //TODO
+ // TODO
return GNUNET_OK;
}
GNUNET_assert (
GNUNET_OK ==
GNUNET_ABD_delegation_chain_deserialize (mlen,
- (const char *) &vr_msg[1],
- d_count,
- d_chain,
- c_count,
- dels));
+ (const char *) &vr_msg[1],
+ d_count,
+ d_chain,
+ c_count,
+ dels));
if (GNUNET_NO == ntohl (vr_msg->del_found))
{
proc (proc_cls, 0, NULL, 0,
}
}
+
static int
-check_intermediate (void *cls, const struct DelegationChainIntermediateMessage *vr_msg)
+check_intermediate (void *cls, const struct
+ DelegationChainIntermediateMessage *vr_msg)
{
- //TODO
+ // TODO
return GNUNET_OK;
}
+
static void
-handle_intermediate (void *cls, const struct DelegationChainIntermediateMessage *vr_msg)
+handle_intermediate (void *cls, const struct
+ DelegationChainIntermediateMessage *vr_msg)
{
struct GNUNET_ABD_Handle *handle = cls;
uint32_t r_id = ntohl (vr_msg->id);
uint32_t size = ntohl (vr_msg->size);
- bool is_bw = ntohs(vr_msg->is_bw);
+ bool is_bw = ntohs (vr_msg->is_bw);
struct GNUNET_ABD_Request *vr;
GNUNET_ABD_IntermediateResultProcessor proc;
void *proc_cls;
struct GNUNET_ABD_Delegation *dd;
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Received intermediate reply from ABD service\n");
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Received intermediate reply from ABD service\n");
for (vr = handle->request_head; NULL != vr; vr = vr->next)
if (vr->r_id == r_id)
break;
if (NULL == vr)
return;
-
+
proc = vr->int_proc;
proc_cls = vr->proc2_cls;
-
+
dd = GNUNET_new (struct GNUNET_ABD_Delegation);
GNUNET_assert (
GNUNET_OK ==
GNUNET_ABD_delegation_chain_deserialize (size,
- (const char *) &vr_msg[1],
- 1,
- dd,
- 0,
- NULL));
+ (const char *) &vr_msg[1],
+ 1,
+ dd,
+ 0,
+ NULL));
proc (proc_cls, dd, is_bw);
}
-
/**
* Reconnect to ABD service.
*
reconnect (struct GNUNET_ABD_Handle *handle)
{
struct GNUNET_MQ_MessageHandler handlers[] =
- {GNUNET_MQ_hd_var_size (result,
- GNUNET_MESSAGE_TYPE_ABD_VERIFY_RESULT,
- struct DelegationChainResultMessage,
- handle),
- GNUNET_MQ_hd_var_size (result,
- GNUNET_MESSAGE_TYPE_ABD_COLLECT_RESULT,
- struct DelegationChainResultMessage,
- handle),
- GNUNET_MQ_hd_var_size (intermediate,
- GNUNET_MESSAGE_TYPE_ABD_INTERMEDIATE_RESULT,
- struct DelegationChainIntermediateMessage,
- handle),
- GNUNET_MQ_handler_end ()};
+ {GNUNET_MQ_hd_var_size (result,
+ GNUNET_MESSAGE_TYPE_ABD_VERIFY_RESULT,
+ struct DelegationChainResultMessage,
+ handle),
+ GNUNET_MQ_hd_var_size (result,
+ GNUNET_MESSAGE_TYPE_ABD_COLLECT_RESULT,
+ struct DelegationChainResultMessage,
+ handle),
+ GNUNET_MQ_hd_var_size (intermediate,
+ GNUNET_MESSAGE_TYPE_ABD_INTERMEDIATE_RESULT,
+ struct DelegationChainIntermediateMessage,
+ handle),
+ GNUNET_MQ_handler_end ()};
struct GNUNET_ABD_Request *vr;
GNUNET_assert (NULL == handle->mq);
/**
* Performs attribute collection.
- * Collects all abds of subject to fulfill the
+ * Collects all abds of subject to fulfill the
* attribute, if possible
*
* @param handle handle to the Credential service
return NULL;
}
- //DEBUG LOG
+ // DEBUG LOG
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Trying to collect `%s' in ABD\n",
issuer_attribute);
GNUNET_MQ_send_copy (handle->mq, vr->env);
return vr;
}
+
+
/**
* Performs attribute verification.
* Checks if there is a delegation chain from
size_t nlen;
size_t clen;
- if (NULL == issuer_attribute || NULL == delegates)
+ if ((NULL == issuer_attribute) || (NULL == delegates))
{
GNUNET_break (0);
return NULL;
clen = GNUNET_ABD_delegates_get_size (delegate_count, delegates);
- //DEBUG LOG
+ // DEBUG LOG
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Trying to verify `%s' in ABD\n",
issuer_attribute);
GNUNET_memcpy (&v_msg[1], issuer_attribute, strlen (issuer_attribute));
GNUNET_ABD_delegates_serialize (delegate_count,
- delegates,
- clen,
- ((char *) &v_msg[1]) +
- strlen (issuer_attribute) + 1);
+ delegates,
+ clen,
+ ((char *) &v_msg[1])
+ + strlen (issuer_attribute) + 1);
GNUNET_CONTAINER_DLL_insert (handle->request_head, handle->request_tail, vr);
if (NULL != handle->mq)
GNUNET_MQ_send_copy (handle->mq, vr->env);
return vr;
}
+
/* end of abd_api.c */
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
/**
* @file abd/abd_serialization.c
- * @brief API to serialize and deserialize delegation chains
+ * @brief API to serialize and deserialize delegation chains
* and abds
* @author Martin Schanzenbach
*/
return ret;
}
+
/**
* Serizalize the given delegation chain entries and abd
*
for (i = 0; i < c_count; i++)
{
- GNUNET_assert ((ret + cd[i].issuer_attribute_len + cd[i].subject_attribute_len) >= ret);
+ GNUNET_assert ((ret + cd[i].issuer_attribute_len
+ + cd[i].subject_attribute_len) >= ret);
// subject_attribute_len should be 0
ret += cd[i].issuer_attribute_len + cd[i].subject_attribute_len;
}
return ret;
}
+
+
/**
* Serizalize the given abds
*
off = 0;
for (i = 0; i < c_count; i++)
{
- //c_rec.subject_attribute_len = htonl ((uint32_t) cd[i].subject_attribute_len);
+ // c_rec.subject_attribute_len = htonl ((uint32_t) cd[i].subject_attribute_len);
c_rec.issuer_attribute_len = htonl ((uint32_t) cd[i].issuer_attribute_len);
c_rec.issuer_key = cd[i].issuer_key;
c_rec.subject_key = cd[i].subject_key;
c_rec.signature = cd[i].signature;
c_rec.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_DELEGATE);
c_rec.purpose.size =
- htonl ((sizeof (struct DelegateEntry) + cd[i].issuer_attribute_len) -
- sizeof (struct GNUNET_CRYPTO_EcdsaSignature));
+ htonl ((sizeof (struct DelegateEntry) + cd[i].issuer_attribute_len)
+ - sizeof (struct GNUNET_CRYPTO_EcdsaSignature));
c_rec.expiration = GNUNET_htonll (cd[i].expiration.abs_value_us);
if (off + sizeof (c_rec) > dest_size)
return -1;
*/
int
GNUNET_ABD_delegates_deserialize (size_t len,
- const char *src,
- unsigned int c_count,
- struct GNUNET_ABD_Delegate *cd)
+ const char *src,
+ unsigned int c_count,
+ struct GNUNET_ABD_Delegate *cd)
{
struct DelegateEntry c_rec;
unsigned int i;
return ret + GNUNET_ABD_delegates_get_size (c_count, cd);
}
+
/**
* Serizalize the given delegation chain entries and abd
*
off += dd[i].subject_attribute_len;
}
return off + GNUNET_ABD_delegates_serialize (c_count,
- cd,
- dest_size - off,
- &dest[off]);
+ cd,
+ dest_size - off,
+ &dest[off]);
}
off += dd[i].subject_attribute_len;
}
return GNUNET_ABD_delegates_deserialize (len - off,
- &src[off],
- c_count,
- cd);
+ &src[off],
+ c_count,
+ cd);
}
+
int
GNUNET_ABD_delegate_serialize (struct GNUNET_ABD_Delegate *dele,
- char **data)
+ char **data)
{
size_t size;
struct DelegateEntry *cdata;
return size;
}
+
struct GNUNET_ABD_Delegate *
GNUNET_ABD_delegate_deserialize (const char *data, size_t data_size)
{
return dele;
}
+
/* end of abd_serialization.c */
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
/**
* @file abd/abd_serialization.h
- * @brief API to serialize and deserialize delegation chains
+ * @brief API to serialize and deserialize delegation chains
* and abds
* @author Martin Schanzenbach
*/
struct GNUNET_ABD_Delegation *dd,
unsigned int c_count,
struct GNUNET_ABD_Delegate *cd);
+
size_t
GNUNET_ABD_delegates_get_size (
unsigned int c_count,
int
GNUNET_ABD_delegates_deserialize (size_t len,
- const char *src,
- unsigned int c_count,
- struct GNUNET_ABD_Delegate *cd);
+ const char *src,
+ unsigned int c_count,
+ struct GNUNET_ABD_Delegate *cd);
int
GNUNET_ABD_delegate_serialize (struct GNUNET_ABD_Delegate *cred,
- char **data);
+ char **data);
struct GNUNET_ABD_Delegate *
GNUNET_ABD_delegate_deserialize (const char *data, size_t data_size);
+
#endif
/* end of abd_serialization.h */
return cred_str;
}
+
struct GNUNET_ABD_Delegate *
GNUNET_ABD_delegate_from_string (const char *s)
{
return dele;
}
+
/**
* Issue an attribute to a subject
*
char *
GNUNET_ABD_delegate_to_string (
- const struct GNUNET_ABD_Delegate *cred);
+ const struct GNUNET_ABD_Delegate *cred);
struct GNUNET_ABD_Delegate *
GNUNET_ABD_delegate_from_string (const char *str);
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
GNUNET_SCHEDULER_shutdown ();
}
+
static void
-handle_intermediate_result(void *cls,
- struct GNUNET_ABD_Delegation *dd,
- bool is_bw)
+handle_intermediate_result (void *cls,
+ struct GNUNET_ABD_Delegation *dd,
+ bool is_bw)
{
char *prefix = "";
- if(is_bw)
+ if (is_bw)
prefix = "Backward -";
else
prefix = "Forward -";
printf ("%s Intermediate result: %s.%s <- %s.%s\n",
- prefix,
- GNUNET_CRYPTO_ecdsa_public_key_to_string (&dd->issuer_key),
- dd->issuer_attribute,
- GNUNET_CRYPTO_ecdsa_public_key_to_string (&dd->subject_key),
- dd->subject_attribute);
+ prefix,
+ GNUNET_CRYPTO_ecdsa_public_key_to_string (&dd->issuer_key),
+ dd->issuer_attribute,
+ GNUNET_CRYPTO_ecdsa_public_key_to_string (&dd->subject_key),
+ dd->subject_attribute);
}
+
static void
handle_collect_result (void *cls,
unsigned int d_count,
GNUNET_SCHEDULER_shutdown ();
}
+
/**
* Callback invoked from identity service with ego information.
* An @a ego of NULL means the ego was not found.
privkey = GNUNET_IDENTITY_ego_get_private_key (ego);
collect_request = GNUNET_ABD_collect (abd,
- &issuer_pkey,
- issuer_attr,
- privkey,
- direction,
- &handle_collect_result,
- NULL,
- &handle_intermediate_result,
- NULL);
+ &issuer_pkey,
+ issuer_attr,
+ privkey,
+ direction,
+ &handle_collect_result,
+ NULL,
+ &handle_intermediate_result,
+ NULL);
return;
}
GNUNET_SCHEDULER_shutdown ();
}
+
/**
* Parse expiration time.
*
return GNUNET_SYSERR;
}
+
/**
* Function called if lookup fails.
*/
GNUNET_SCHEDULER_shutdown ();
return;
}
+
+
static void
add_continuation (void *cls, int32_t success, const char *emsg)
{
struct GNUNET_NAMESTORE_QueueEntry **qe = cls;
*qe = NULL;
- if(GNUNET_OK == success)
+ if (GNUNET_OK == success)
printf ("Adding successful.\n");
else
fprintf (stderr, "Error occured during adding, shutting down.\n");
GNUNET_SCHEDULER_shutdown ();
}
+
static void
get_existing_record (void *cls,
const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
return;
}
+
static void
store_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
{
return;
}
+
static void
sign_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
{
// Sign delegate
dele = GNUNET_ABD_delegate_issue (privkey,
- &subject_pkey,
- issuer_attr,
- subject_attr,
- &etime_abs);
+ &subject_pkey,
+ issuer_attr,
+ subject_attr,
+ &etime_abs);
res = GNUNET_ABD_delegate_to_string (dele);
GNUNET_free (dele);
printf ("%s\n", res);
GNUNET_SCHEDULER_shutdown ();
}
+
/**
* Main function that will be run.
*
return;
}
- if (GNUNET_NO == forward && GNUNET_NO == backward)
+ if ((GNUNET_NO == forward) && (GNUNET_NO == backward))
{
// set default: bidirectional
forward = GNUNET_YES;
GNUNET_SCHEDULER_shutdown ();
return;
}
- if (NULL == issuer_attr || NULL == subject_delegate)
+ if ((NULL == issuer_attr) || (NULL == subject_delegate))
{
fprintf (stderr, _ ("You must provide issuer and subject attributes\n"));
GNUNET_SCHEDULER_shutdown ();
return;
}
- //Subject credentials are comma separated
+ // Subject credentials are comma separated
char *tmp = GNUNET_strdup (subject_delegate);
char *tok = strtok (tmp, ",");
if (NULL == tok)
}
verify_request = GNUNET_ABD_verify (abd,
- &issuer_pkey,
- issuer_attr,
- &subject_pkey,
- count,
- delegates,
- direction,
- &handle_verify_result,
- NULL,
- &handle_intermediate_result,
- NULL);
+ &issuer_pkey,
+ issuer_attr,
+ &subject_pkey,
+ count,
+ delegates,
+ direction,
+ &handle_verify_result,
+ NULL,
+ &handle_intermediate_result,
+ NULL);
for (i = 0; i < count; i++)
{
GNUNET_free ((char *) delegates[i].issuer_attribute);
main (int argc, char *const *argv)
{
struct GNUNET_GETOPT_CommandLineOption options[] =
- {GNUNET_GETOPT_option_flag ('V',
- "verify",
+ {GNUNET_GETOPT_option_flag ('V',
+ "verify",
+ gettext_noop (
+ "verify credential against attribute"),
+ &verify),
+ GNUNET_GETOPT_option_string (
+ 's',
+ "subject",
+ "PKEY",
+ gettext_noop (
+ "The public key of the subject to lookup the"
+ "credential for, or for issuer side storage: subject and its attributes"),
+ &subject),
+ GNUNET_GETOPT_option_string (
+ 'd',
+ "delegate",
+ "DELE",
+ gettext_noop ("The private, signed delegate presented by the subject"),
+ &subject_delegate),
+ GNUNET_GETOPT_option_string (
+ 'i',
+ "issuer",
+ "PKEY",
+ gettext_noop (
+ "The public key of the authority to verify the credential against"),
+ &issuer_key),
+ GNUNET_GETOPT_option_string ('e',
+ "ego",
+ "EGO",
+ gettext_noop ("The ego/zone name to use"),
+ &ego_name),
+ GNUNET_GETOPT_option_string (
+ 'a',
+ "attribute",
+ "ATTR",
+ gettext_noop ("The issuer attribute to verify against or to issue"),
+ &issuer_attr),
+ GNUNET_GETOPT_option_string ('T',
+ "ttl",
+ "EXP",
gettext_noop (
- "verify credential against attribute"),
- &verify),
- GNUNET_GETOPT_option_string (
- 's',
- "subject",
- "PKEY",
- gettext_noop (
- "The public key of the subject to lookup the"
- "credential for, or for issuer side storage: subject and its attributes"),
- &subject),
- GNUNET_GETOPT_option_string (
- 'd',
- "delegate",
- "DELE",
- gettext_noop ("The private, signed delegate presented by the subject"),
- &subject_delegate),
- GNUNET_GETOPT_option_string (
- 'i',
- "issuer",
- "PKEY",
- gettext_noop (
- "The public key of the authority to verify the credential against"),
- &issuer_key),
- GNUNET_GETOPT_option_string ('e',
- "ego",
- "EGO",
- gettext_noop ("The ego/zone name to use"),
- &ego_name),
- GNUNET_GETOPT_option_string (
- 'a',
- "attribute",
- "ATTR",
- gettext_noop ("The issuer attribute to verify against or to issue"),
- &issuer_attr),
- GNUNET_GETOPT_option_string ('T',
- "ttl",
- "EXP",
- gettext_noop (
- "The time to live for the credential."
- "e.g. 5m, 6h, \"1990-12-30 12:00:00\""),
- &expiration),
- GNUNET_GETOPT_option_flag ('g',
- "collect",
- gettext_noop ("collect credentials"),
- &collect),
- GNUNET_GETOPT_option_flag ('U',
- "createIssuerSide",
- gettext_noop (
- "Create and issue a credential issuer side."),
- &create_is),
- GNUNET_GETOPT_option_flag ('C',
- "createSubjectSide",
- gettext_noop (
- "Issue a credential subject side."),
- &create_ss),
- GNUNET_GETOPT_option_flag (
- 'S',
- "signSubjectSide",
- gettext_noop ("Create, sign and return a credential subject side."),
- &sign_ss),
- GNUNET_GETOPT_option_string (
- 'x',
- "import",
- "IMP",
- gettext_noop (
- "Import signed credentials that should be issued to a zone/ego"),
- &import),
- GNUNET_GETOPT_option_flag ('P',
- "private",
- gettext_noop ("Create private record entry."),
- &is_private),
- GNUNET_GETOPT_option_flag (
- 'F',
- "forward",
- gettext_noop (
- "Indicates that the collect/verify process is done via forward search."),
- &forward),
- GNUNET_GETOPT_option_flag (
- 'B',
- "backward",
- gettext_noop (
- "Indicates that the collect/verify process is done via forward search."),
- &backward),
- GNUNET_GETOPT_OPTION_END};
+ "The time to live for the credential."
+ "e.g. 5m, 6h, \"1990-12-30 12:00:00\""),
+ &expiration),
+ GNUNET_GETOPT_option_flag ('g',
+ "collect",
+ gettext_noop ("collect credentials"),
+ &collect),
+ GNUNET_GETOPT_option_flag ('U',
+ "createIssuerSide",
+ gettext_noop (
+ "Create and issue a credential issuer side."),
+ &create_is),
+ GNUNET_GETOPT_option_flag ('C',
+ "createSubjectSide",
+ gettext_noop (
+ "Issue a credential subject side."),
+ &create_ss),
+ GNUNET_GETOPT_option_flag (
+ 'S',
+ "signSubjectSide",
+ gettext_noop ("Create, sign and return a credential subject side."),
+ &sign_ss),
+ GNUNET_GETOPT_option_string (
+ 'x',
+ "import",
+ "IMP",
+ gettext_noop (
+ "Import signed credentials that should be issued to a zone/ego"),
+ &import),
+ GNUNET_GETOPT_option_flag ('P',
+ "private",
+ gettext_noop ("Create private record entry."),
+ &is_private),
+ GNUNET_GETOPT_option_flag (
+ 'F',
+ "forward",
+ gettext_noop (
+ "Indicates that the collect/verify process is done via forward search."),
+ &forward),
+ GNUNET_GETOPT_option_flag (
+ 'B',
+ "backward",
+ gettext_noop (
+ "Indicates that the collect/verify process is done via forward search."),
+ &backward),
+ GNUNET_GETOPT_OPTION_END};
timeout = GNUNET_TIME_UNIT_FOREVER_REL;
GNUNET_log_setup ("gnunet-abd", "WARNING", NULL);
if (GNUNET_OK != GNUNET_PROGRAM_run (argc,
- argv,
- "gnunet-abd",
- _ ("GNUnet abd resolver tool"),
- options,
- &run,
- NULL))
+ argv,
+ "gnunet-abd",
+ _ ("GNUnet abd resolver tool"),
+ options,
+ &run,
+ NULL))
ret = 1;
GNUNET_free ((void *) argv);
return ret;
}
+
/* end of gnunet-abd.c */
dsentry->delegation_chain_entry->subject_attribute);
}
+
static void
cleanup_dsq_entry (struct DelegationSetQueueEntry *ds_entry)
{
GNUNET_free (ds_entry->delegation_chain_entry);
}
// Free DQ entries
- for(struct DelegationQueueEntry *dq_entry = ds_entry->queue_entries_head;
- NULL != ds_entry->queue_entries_head;
- dq_entry = ds_entry->queue_entries_head)
+ for (struct DelegationQueueEntry *dq_entry = ds_entry->queue_entries_head;
+ NULL != ds_entry->queue_entries_head;
+ dq_entry = ds_entry->queue_entries_head)
{
GNUNET_CONTAINER_DLL_remove (ds_entry->queue_entries_head,
- ds_entry->queue_entries_tail,
- dq_entry);
+ ds_entry->queue_entries_tail,
+ dq_entry);
GNUNET_free (dq_entry);
}
GNUNET_free (ds_entry);
}
+
static void
cleanup_handle (struct VerifyRequestHandle *vrh)
{
if (NULL != vrh->dsq_head)
{
- for (struct DelegationSetQueueEntry *ds_entry = vrh->dsq_head; NULL != vrh->dsq_head;
- ds_entry = vrh->dsq_head)
+ for (struct DelegationSetQueueEntry *ds_entry = vrh->dsq_head; NULL !=
+ vrh->dsq_head;
+ ds_entry = vrh->dsq_head)
{
GNUNET_CONTAINER_DLL_remove (vrh->dsq_head, vrh->dsq_tail, ds_entry);
- cleanup_dsq_entry(ds_entry);
+ cleanup_dsq_entry (ds_entry);
}
}
if (NULL != vrh->del_chain_head)
{
for (del_entry = vrh->del_chain_head; NULL != vrh->del_chain_head;
- del_entry = vrh->del_chain_head)
+ del_entry = vrh->del_chain_head)
{
GNUNET_CONTAINER_DLL_remove (vrh->del_chain_head,
- vrh->del_chain_tail,
- del_entry);
+ vrh->del_chain_tail,
+ del_entry);
GNUNET_free_non_null (del_entry->delegate);
GNUNET_free (del_entry);
}
GNUNET_free (vrh);
}
+
static void
shutdown_task (void *cls)
{
}
}
+
static void
-send_intermediate_response(struct VerifyRequestHandle *vrh, struct DelegationChainEntry *ch_entry, bool is_bw){
+send_intermediate_response (struct VerifyRequestHandle *vrh, struct
+ DelegationChainEntry *ch_entry, bool is_bw)
+{
struct DelegationChainIntermediateMessage *rmsg;
struct GNUNET_MQ_Envelope *env;
struct GNUNET_ABD_Delegation *dd;
size_t size;
// Don't report immediate results during collect
- if(vrh->is_collect)
+ if (vrh->is_collect)
return;
dd = GNUNET_new (struct GNUNET_ABD_Delegation);
dd->subject_attribute = ch_entry->subject_attribute;
dd->subject_attribute_len = strlen (ch_entry->subject_attribute) + 1;
}
-
+
size = GNUNET_ABD_delegation_chain_get_size (1,
- dd,
- 0,
- NULL);
+ dd,
+ 0,
+ NULL);
env = GNUNET_MQ_msg_extra (rmsg,
size,
GNUNET_MESSAGE_TYPE_ABD_INTERMEDIATE_RESULT);
// Assign id so that client can find associated request
rmsg->id = vrh->request_id;
- rmsg->is_bw = htons(is_bw);
- rmsg->size = htonl(size);
+ rmsg->is_bw = htons (is_bw);
+ rmsg->size = htonl (size);
GNUNET_assert (
-1 != GNUNET_ABD_delegation_chain_serialize (1,
- dd,
- 0,
- NULL,
- size,
- (char *) &rmsg[1]));
+ dd,
+ 0,
+ NULL,
+ size,
+ (char *) &rmsg[1]));
GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (vrh->client), env);
}
+
static void
send_lookup_response (struct VerifyRequestHandle *vrh)
{
}
size =
GNUNET_ABD_delegation_chain_get_size (vrh->delegation_chain_size,
- dd,
- vrh->del_chain_size,
- dele);
+ dd,
+ vrh->del_chain_size,
+ dele);
env = GNUNET_MQ_msg_extra (rmsg,
size,
GNUNET_MESSAGE_TYPE_ABD_VERIFY_RESULT);
GNUNET_assert (
-1 !=
GNUNET_ABD_delegation_chain_serialize (vrh->delegation_chain_size,
- dd,
- vrh->del_chain_size,
- dele,
- size,
- (char *) &rmsg[1]));
+ dd,
+ vrh->del_chain_size,
+ dele,
+ size,
+ (char *) &rmsg[1]));
GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (vrh->client), env);
GNUNET_CONTAINER_DLL_remove (vrh_head, vrh_tail, vrh);
GNUNET_NO);
}
+
static char *
partial_match (char *tmp_trail,
char *tmp_subattr,
return attr_trailer;
}
+
static int
handle_bidirectional_match (struct DelegationSetQueueEntry *actual_entry,
struct DelegationSetQueueEntry *match_entry,
fw_entry = old_fw_parent;
}
// set last entry of chain as actual_entry
- //actual_entry = last_entry;
+ // actual_entry = last_entry;
// set refcount, loop all delegations
for (struct DelegateRecordEntry *del_entry = vrh->del_chain_head;
del_entry != NULL;
return GNUNET_YES;
}
+
static void
forward_resolution (void *cls,
uint32_t rd_count,
ds_entry->delegation_chain_entry->issuer_key = del->issuer_key;
ds_entry->delegation_chain_entry->issuer_attribute =
GNUNET_strdup (del->issuer_attribute);
-
+
// Found new entry, repoting intermediate result
- send_intermediate_response(vrh, ds_entry->delegation_chain_entry, false);
+ send_intermediate_response (vrh, ds_entry->delegation_chain_entry, false);
// current delegation as parent
ds_entry->parent_queue_entry = dq_entry;
if (GNUNET_NO ==
handle_bidirectional_match (ds_entry, del_entry, vrh))
return;
-
+
send_lookup_response (vrh);
return;
}
ds_entry->lookup_request =
GNUNET_GNS_lookup (gns,
- GNUNET_GNS_EMPTY_LABEL_AT,
- &del->issuer_key,
- GNUNET_GNSRECORD_TYPE_DELEGATE,
- GNUNET_GNS_LO_DEFAULT,
- &forward_resolution,
- ds_entry);
+ GNUNET_GNS_EMPTY_LABEL_AT,
+ &del->issuer_key,
+ GNUNET_GNSRECORD_TYPE_DELEGATE,
+ GNUNET_GNS_LO_DEFAULT,
+ &forward_resolution,
+ ds_entry);
}
if (0 == vrh->pending_lookups)
}
}
+
static void
backward_resolution (void *cls,
uint32_t rd_count,
if (GNUNET_OK !=
GNUNET_ABD_delegation_set_deserialize (GNUNET_ntohll (
- sets->data_size),
- (const char *) &sets[1],
- ntohl (sets->set_count),
- set))
+ sets->data_size),
+ (const char *) &sets[1],
+ ntohl (sets->set_count),
+ set))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to deserialize!\n");
continue;
GNUNET_strdup (current_set->lookup_attribute);
// Found new entry, repoting intermediate result
- send_intermediate_response(vrh, ds_entry->delegation_chain_entry, true);
+ send_intermediate_response (vrh, ds_entry->delegation_chain_entry, true);
ds_entry->parent_queue_entry = dq_entry; // current_delegation;
ds_entry->unresolved_attribute_delegation);
// Continue with next/new backward resolution
char issuer_attribute_name[strlen (
- ds_entry->unresolved_attribute_delegation) +
- 1];
+ ds_entry->unresolved_attribute_delegation)
+ + 1];
strcpy (issuer_attribute_name, ds_entry->unresolved_attribute_delegation);
char *next_attr = strtok (issuer_attribute_name, ".");
if (NULL == next_attr)
del_entry = del_entry->next)
{
// only check entries added by forward algorithm
- if (!del_entry->from_bw)
+ if (! del_entry->from_bw)
{
// key of list entry matches actual key
if (0 == memcmp (&del_entry->delegation_chain_entry->issuer_key,
// if one node on the path still needs solutions: return
if (GNUNET_NO ==
handle_bidirectional_match (del_entry, ds_entry, vrh))
- break;
-
+ break;
+
// Send lookup response
send_lookup_response (vrh);
return;
ds_entry->handle = vrh;
ds_entry->lookup_request =
GNUNET_GNS_lookup (gns,
- lookup_attribute,
- ds_entry->issuer_key, // issuer_key,
- GNUNET_GNSRECORD_TYPE_ATTRIBUTE,
- GNUNET_GNS_LO_DEFAULT,
- &backward_resolution,
- ds_entry);
+ lookup_attribute,
+ ds_entry->issuer_key, // issuer_key,
+ GNUNET_GNSRECORD_TYPE_ATTRIBUTE,
+ GNUNET_GNS_LO_DEFAULT,
+ &backward_resolution,
+ ds_entry);
GNUNET_free (lookup_attribute);
}
}
- //Check for attributes from the issuer and follow the chain
- //till you get the required subject's attributes
+ // Check for attributes from the issuer and follow the chain
+ // till you get the required subject's attributes
char issuer_attribute_name[strlen (vrh->issuer_attribute) + 1];
strcpy (issuer_attribute_name, vrh->issuer_attribute);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
return 0;
}
+
static int
delegation_chain_fw_resolution_start (void *cls)
{
GNUNET_memcpy (ds_entry->issuer_key,
&del_entry->delegate->subject_key,
sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
-
+
ds_entry->delegation_chain_entry = GNUNET_new (struct DelegationChainEntry);
- ds_entry->delegation_chain_entry->subject_key = del_entry->delegate->subject_key;
+ ds_entry->delegation_chain_entry->subject_key =
+ del_entry->delegate->subject_key;
ds_entry->delegation_chain_entry->subject_attribute = NULL;
- ds_entry->delegation_chain_entry->issuer_key = del_entry->delegate->issuer_key;
+ ds_entry->delegation_chain_entry->issuer_key =
+ del_entry->delegate->issuer_key;
ds_entry->delegation_chain_entry->issuer_attribute =
GNUNET_strdup (del_entry->delegate->issuer_attribute);
return 0;
}
+
static int
check_verify (void *cls, const struct VerifyMessage *v_msg)
{
return GNUNET_OK;
}
+
static void
handle_verify (void *cls, const struct VerifyMessage *v_msg)
{
// Parse delegates from verifaction message
delegate_count = ntohl (v_msg->d_count);
- delegate_data_size = ntohs (v_msg->header.size) -
- sizeof (struct VerifyMessage) -
- ntohs (v_msg->issuer_attribute_len) - 1;
+ delegate_data_size = ntohs (v_msg->header.size)
+ - sizeof (struct VerifyMessage)
+ - ntohs (v_msg->issuer_attribute_len) - 1;
struct GNUNET_ABD_Delegate delegates[delegate_count];
memset (delegates,
0,
sizeof (struct GNUNET_ABD_Delegate) * delegate_count);
delegate_data = (char *) &v_msg[1] + ntohs (v_msg->issuer_attribute_len) + 1;
if (GNUNET_OK != GNUNET_ABD_delegates_deserialize (delegate_data_size,
- delegate_data,
- delegate_count,
- delegates))
+ delegate_data,
+ delegate_count,
+ delegates))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot deserialize delegates!\n");
send_lookup_response (vrh);
{
del_entry = GNUNET_new (struct DelegateRecordEntry);
del_entry->delegate =
- GNUNET_malloc (sizeof (struct GNUNET_ABD_Delegate) +
- delegates[i].issuer_attribute_len + 1);
+ GNUNET_malloc (sizeof (struct GNUNET_ABD_Delegate)
+ + delegates[i].issuer_attribute_len + 1);
GNUNET_memcpy (del_entry->delegate,
&delegates[i],
sizeof (struct GNUNET_ABD_Delegate));
if (GNUNET_ABD_FLAG_BACKWARD & vrh->resolution_algo &&
GNUNET_ABD_FLAG_FORWARD & vrh->resolution_algo)
{
- if(1 == delegation_chain_fw_resolution_start (vrh))
+ if (1 == delegation_chain_fw_resolution_start (vrh))
return;
delegation_chain_bw_resolution_start (vrh);
}
}
}
+
static void
handle_delegate_collection_error_cb (void *cls)
{
send_lookup_response (vrh);
}
+
static void
delegate_collection_finished (void *cls)
{
GNUNET_ABD_FLAG_FORWARD & vrh->resolution_algo)
{
// if premature match found don't start bw resultion
- if(1 == delegation_chain_fw_resolution_start (vrh))
+ if (1 == delegation_chain_fw_resolution_start (vrh))
return;
delegation_chain_bw_resolution_start (vrh);
}
}
}
+
static void
handle_delegate_collection_cb (void *cls,
const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
delegate_collection_finished (vrh);
}
+
static void
handle_collect (void *cls, const struct CollectMessage *c_msg)
{
return GNUNET_OK;
}
+
static void
client_disconnect_cb (void *cls,
struct GNUNET_SERVICE_Client *client,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Client %p disconnected\n", client);
}
+
static void *
client_connect_cb (void *cls,
struct GNUNET_SERVICE_Client *client,
return client;
}
+
/**
* Process Credential requests.
*
return NULL;
}
+
/* end of plugin_gnsrecord_abd.c */
return rc;
}
+
static int
aes_128_cbc_encrypt (char*pt,
int size,
return buf_size;
}
+
static int
aes_128_cbc_decrypt (char*ct,
int size,
return len;
}
+
/**
* @ingroup abe
* Create a new CP-ABE master key. Caller must free return value.
return key;
}
+
/**
* @ingroup abe
* Delete a CP-ABE master key.
GNUNET_free (key);
}
+
/**
* @ingroup abe
* Create a new CP-ABE key. Caller must free return value.
return prv_key;
}
+
/**
* @ingroup abe
* Delete a CP-ABE key.
GNUNET_free (key);
}
+
static ssize_t
write_cpabe (void **result,
uint32_t file_len,
return 12 + cph_buf_len + aes_buf_len;
}
+
static ssize_t
read_cpabe (const void *data,
char**cph_buf,
return buf_len;
}
+
/**
* @ingroup abe
* Encrypt a block using sessionkey.
return result_len;
}
+
/**
* @ingroup abe
* Decrypt a block using the ABE key.
return plt_len;
}
+
/**
* @ingroup abe
* Serialize an ABE key.
return len;
}
+
/**
* @ingroup abe
* Deserialize a serialized ABE key.
return key;
}
+
/**
* @ingroup abe
* Serialize an ABE master key.
return len;
}
+
/**
* @ingroup abe
* Deserialize an ABE master key.
return 0;
}
+
/* end of test_crypto_aes.c */
wait for the result message, but also wait for the service to close
the connection (and then we have to close our client handle as well);
this is done by installing a different receive handler, waiting for
- the connection to go down */
- if (NULL != h->thm)
+ the connection to go down */if (NULL != h->thm)
{
GNUNET_break (0);
op->result_cont (h->thm->cont_cls,
* 2) We're not connected to ARM.
* Cancel any reconnection attempts temporarily, then perform
* a service test.
- */
- if (GNUNET_YES == h->currently_up)
+ */if (GNUNET_YES == h->currently_up)
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
"ARM is already running\n");
yet complete the MQ handshake. However, given that users
are unlikely to hammer 'gnunet-arm -s' on a busy system,
the above check should catch 99.99% of the cases where ARM
- is already running. */
- LOG (GNUNET_ERROR_TYPE_DEBUG,
+ is already running. */LOG (GNUNET_ERROR_TYPE_DEBUG,
"Starting ARM service\n");
if (NULL == (sig = GNUNET_DISK_pipe (GNUNET_NO,
GNUNET_NO,
return lret;
}
+
/* end of gnunet-arm.c */
return GNUNET_OK;
}
+
/**
* Handle LIST-message.
*
/**
* MINIMIZE heap size (way below 128k) since this process doesn't need much.
*/
-void __attribute__ ((constructor)) GNUNET_ARM_memory_init ()
+void __attribute__ ((constructor))
+GNUNET_ARM_memory_init ()
{
mallopt (M_TRIM_THRESHOLD, 4 * 1024);
mallopt (M_TOP_PAD, 1 * 1024);
malloc_trim (0);
}
+
+
#endif
/**
* MINIMIZE heap size (way below 128k) since this process doesn't need much.
*/
-void __attribute__ ((destructor)) GNUNET_mockup_done ()
+void __attribute__ ((destructor))
+GNUNET_mockup_done ()
{
_exit (special_ret);
}
* ("sent", because it isn't going anywhere, ARM API starts ARM service
* by itself).
* ARM API should report that ARM service is starting.
- */
- GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK);
+ */GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK);
GNUNET_break (phase == 0);
LOG ("Sent 'START' request for arm to ARM %s\n",
(status == GNUNET_ARM_REQUEST_SENT_OK) ? "successfully" :
return ok;
}
+
/* end of test_arm_api.c */
return ret;
}
+
/* end of test_exponential_backoff.c */
return ret;
}
+
/* end of test_gnunet_service_arm.c */
return e;
}
+
static void
free_experiment (struct Experiment *e)
{
GNUNET_TIME_UNIT_FOREVER_REL);
}
+
static void
enforce_stop_send (struct GNUNET_ATS_TEST_Operation *op)
{
op->pref_type);
}
+
static void
enforce_stop_preference (struct GNUNET_ATS_TEST_Operation *op)
{
}
}
-static void enforce_episode (struct Episode *ep)
+
+static void
+enforce_episode (struct Episode *ep)
{
struct GNUNET_ATS_TEST_Operation *cur;
return e;
}
+
void
GNUNET_ATS_TEST_experimentation_stop (struct Experiment *e)
{
free_experiment (e);
}
+
/* end of file ats-testing-experiment.c*/
};
-
static void
write_throughput_gnuplot_script (char *fn, struct LoggingPeer *lp, char **fs,
int slaves)
GNUNET_free (gfn);
}
+
static void
write_bw_gnuplot_script (char *fn, struct LoggingPeer *lp, char **fs, int
slaves)
GNUNET_free (filename_master);
}
+
/**
* Log all data now
*
_ ("Stop logging\n"));
}
+
/**
* Clean up logging data
*
return l;
}
+
+
/* end of file ats-testing-log.c */
}
}
+
/* end of file ats-testing-preferences.c */
}
}
+
/* end of file ats-testing-traffic.c */
}
-
static void
peerinformation_cb (void *cb_cls,
struct GNUNET_TESTBED_Operation *op,
GNUNET_ATS_TEST_TG_CONSTANT, 1, 1, GNUNET_TIME_UNIT_SECONDS,
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 250),
GNUNET_ATS_PREFERENCE_BANDWIDTH);
- */
-/*
+ *//*
GNUNET_ATS_TEST_generate_preferences_start(&masters[0],&masters[0].partners[0],
GNUNET_ATS_TEST_TG_LINEAR, 1, 50,
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 2),
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 250),
GNUNET_ATS_PREFERENCE_BANDWIDTH);
- */
-/*
+ *//*
GNUNET_ATS_TEST_generate_preferences_start(&masters[0],&masters[0].partners[0],
GNUNET_ATS_TEST_TG_RANDOM, 1, 50,
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 2),
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 250),
GNUNET_ATS_PREFERENCE_BANDWIDTH);
- */
-/*
+ *//*
GNUNET_ATS_TEST_generate_preferences_start(&masters[0],&masters[0].partners[0],
GNUNET_ATS_TEST_TG_SINUS, 10, 5,
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 5),
GNUNET_free (opt_exp_file);
return 0;
}
+
+
/* end of file gnunet-ats-sim.c */
return GNUNET_OK;
}
+
static int
load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg)
{
partner->tg = GNUNET_ATS_TEST_generate_traffic_start(peer, partner,
op->tg_type, op->base_rate, op->max_rate, op->period,
GNUNET_TIME_UNIT_FOREVER_REL);
- */
-}
+ */}
+
static void
enforce_stop_send (struct GNUNET_ATS_TEST_Operation *op)
GNUNET_ATS_TEST_generate_traffic_stop(p->tg);
p->tg = NULL;
}
- */
-}
+ */}
static void
partner->pg = GNUNET_ATS_TEST_generate_preferences_start(peer, partner,
op->tg_type, op->base_rate, op->max_rate, op->period, op->frequency,
op->pref_type);
- */
-}
+ */}
+
static void
enforce_stop_preference (struct GNUNET_ATS_TEST_Operation *op)
GNUNET_ATS_TEST_generate_preferences_stop (p->pg);
p->pg = NULL;
}
- */
-}
+ */}
+
-static void enforce_episode (struct Episode *ep)
+static void
+enforce_episode (struct Episode *ep)
{
struct GNUNET_ATS_TEST_Operation *cur;
return e;
}
+
void
GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e)
{
free_experiment (e);
}
+
/**
* Solver
*/
GNUNET_free (sh);
}
+
struct GNUNET_ATS_TESTING_SolverHandle *
GNUNET_ATS_solvers_solver_start (enum GNUNET_ATS_Solvers type)
{
return sh;
}
+
static struct Experiment *e;
static struct GNUNET_ATS_TESTING_SolverHandle *sh;
return 0;
}
+
+
/* end of file gnunet-solver-eval.c*/
/* Determine solver name */
solver = GNUNET_strdup (tmp);
/* Remove .exe prefix */
- if ((NULL != (dotexe = strstr (solver, ".exe")))&&(dotexe[4] == '\0'))
+ if ((NULL != (dotexe = strstr (solver, ".exe"))) && (dotexe[4] == '\0'))
dotexe[0] = '\0';
/* Determine first '_' after solver */
return result;
}
+
/* end of file perf_ats.c */
GNUNET_free (gfn);
}
+
static void
write_bw_gnuplot_script (char *fn, struct LoggingPeer *lp)
{
/* Assembling master string */
-
GNUNET_asprintf (&data, "%llu;%llu;%u;%u;%u;%u;%u;%u;;;;;;;;;;;%s\n",
cur_lt->timestamp,
GNUNET_TIME_absolute_get_difference (lp[c_m].start,
}
}
+
static void
collect_log_task (void *cls)
{
log_task = GNUNET_SCHEDULER_add_now (&collect_log_task, NULL);
running = GNUNET_YES;
}
+
+
/* end of file perf_ats_logging.c */
return 1;
}
+
/* end of gnunet-ats.c */
};
-
/**
* ATS Service suggests to the transport service to use the address
* identified by the given @e session_id for the given @e peer with
GNUNET_NETWORK_STRUCT_END
-
#endif
env);
}
+
/* end of ats_api_performance.c */
return NULL;
}
+
static struct TestPeer *
find_peer_by_pid (const struct GNUNET_PeerIdentity *pid)
{
return NULL;
}
+
static struct TestAddress *
find_address_by_id (struct TestPeer *peer, int aid)
{
l);
}
+
struct LoggingHandle *
GNUNET_ATS_solver_logging_start (struct GNUNET_TIME_Relative freq)
{
return l;
}
+
void
GNUNET_ATS_solver_logging_stop (struct LoggingHandle *l)
{
l->logging_task = NULL;
}
+
static struct LoggingFileHandle *
find_logging_file_handle (struct LoggingFileHandle *lf_head,
struct LoggingFileHandle *lf_tail,
return NULL;
}
+
void
GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l, int
add_time_stamp,
fprintf(stderr,"\t %s = %.2f %.2f [abs/rel]\n",
GNUNET_ATS_print_preference_type(c),
log_p->pref_abs[c], log_p->pref_norm[c]);
- */
- GNUNET_asprintf (&prefstring_tmp, "%s;%.3f;%.3f",
+ */GNUNET_asprintf (&prefstring_tmp, "%s;%.3f;%.3f",
prefstring, log_p->pref_abs[c], log_p->pref_norm[c]);
}
}
+
void
GNUNET_ATS_solver_logging_eval (struct LoggingHandle *l)
{
}
}
+
void
GNUNET_ATS_solver_logging_free (struct LoggingHandle *l)
{
GNUNET_free (l);
}
+
/**
* Property Generators
*/
return NULL;
}
+
void
GNUNET_ATS_solver_generate_property_stop (struct PropertyGenerator *pg)
{
return NULL;
}
+
void
GNUNET_ATS_solver_generate_preferences_stop (struct PreferenceGenerator *pg)
{
}
-
/**
* Stop all preferences generators
*/
}
-
/**
* Experiments
*/
return GNUNET_OK;
}
+
static int
load_op_stop_set_property (struct GNUNET_ATS_TEST_Operation *o,
struct Episode *e,
return GNUNET_OK;
}
+
static int
load_op_stop_request (struct GNUNET_ATS_TEST_Operation *o,
struct Episode *e,
return GNUNET_OK;
}
+
static int
load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg)
{
GNUNET_SYSERR);
}
+
struct ATS_Address *
create_ats_address (const struct GNUNET_PeerIdentity *peer,
const char *plugin_name,
}
-
static void
enforce_add_address (struct GNUNET_ATS_TEST_Operation *op)
{
GNUNET_free (a);
}
+
static void
enforce_start_property (struct GNUNET_ATS_TEST_Operation *op)
{
op->prop_type);
}
+
static void
enforce_stop_property (struct GNUNET_ATS_TEST_Operation *op)
{
}
}
+
static void
enforce_start_preference (struct GNUNET_ATS_TEST_Operation *op)
{
op->frequency);
}
+
static void
enforce_stop_preference (struct GNUNET_ATS_TEST_Operation *op)
{
}
}
-static void enforce_episode (struct Episode *ep)
+
+static void
+enforce_episode (struct Episode *ep)
{
struct GNUNET_ATS_TEST_Operation *cur;
enforce_episode (e->cur);
}
+
void
GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e)
{
}
-
/**
* Solver
*/
return GNUNET_OK;
}
+
void
GNUNET_ATS_solvers_solver_stop (struct SolverHandle *sh)
{
}
}
+
static void
solver_bandwidth_changed_cb (void *cls, struct ATS_Address *address)
{
return;
}
+
const double *
get_preferences_cb (void *cls, const struct GNUNET_PeerIdentity *id)
{
end_now ();
}
+
static void
experiment_done_cb (struct Experiment *e, struct GNUNET_TIME_Relative duration,
int success)
GNUNET_SCHEDULER_add_now (&done, NULL);
}
+
static void
episode_done_cb (struct Episode *ep)
{
}
-
/**
* Do shutdown
*/
}
}
+
static void
run (void *cls, char *const *args, const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
return res;
}
+
+
/* end of file ats-testing-experiment.c*/
}
-
/**
* Handle 'reservation request' messages from clients.
*
}
-
/* end of gnunet-service-ats_addresses.c */
nc_pic = NULL;
}
+
/* end of gnunet-service-ats_performance.c */
GNUNET_CONTAINER_multipeermap_destroy (trackers);
}
+
/* end of gnunet-service-ats_reservations.c */
}
}
+
/**
* Create an address for a peer
*
}
}
+
/**
* Evaluate results for a specific iteration
*
struct Result *cur_upd_res;
-
// fprintf (stderr, "P: %u I: %u == %p \n", c_peer, c_iteration, cur_res);
cur_full_res = ph.iterations_results[c_iteration].results_array[c_peer];
if (c_peer == 0)
return ret;
}
+
/* end of file perf_ats_solver.c */
* suggest one. Therefore we have to disconnect the peer.
* The above call to "distribute_bandwidth_in_network()
* does not see 'current_address' so we need to trigger
- * the update here. */
- LOG (GNUNET_ERROR_TYPE_DEBUG,
+ * the update here. */LOG (GNUNET_ERROR_TYPE_DEBUG,
"Disconnecting peer `%s'.\n",
GNUNET_i2s (peer));
s->env->bandwidth_changed_cb (s->env->cls,
.properties = {
.scope = GNUNET_NT_LAN
}
+
+
}
+
+
},
/* 1: adding same address again should fail */
{
},
.expect_fail = 1
}
+
+
},
/* 2: some solver still require explicit start */
{
.details.request_connection_start = {
.pid = 0
}
+
+
},
/* 3: check we got an address */
{
.details.await_address_suggestion = {
.add_label = "add-address-0-0"
}
+
+
},
/* 4: check monitor also got the address */
{
.details.await_address_information = {
.add_label = "add-address-0-0"
}
+
+
},
/* 5: test session API */
{
.add_label = "add-address-0-0",
.session = 1
}
+
+
},
{
.code = CMD_DEL_SESSION,
.details.del_session = {
.add_session_label = "add-session-0-0-1",
}
+
+
},
/* 7: test preference API */
{
.pid = 0
/* FIXME: preference details */
}
+
+
},
{
.code = CMD_PROVIDE_FEEDBACK,
.scope = { 50LL }
/* FIXME: preference details */
}
+
+
},
/* 9: test sanity check address listing */
{
.min_active_calls = 1,
.max_active_calls = 1
}
+
+
},
/* 10: remove address testing */
{
.details.del_address = {
.add_label = "add-address-0-0"
}
+
+
},
/* 11: check we got disconnected */
{
.details.await_disconnect_suggestion = {
.pid = 0
}
+
+
},
/* 12: just for symmetry, also stop asking for the connection */
{
.details.request_connection_stop = {
.connect_label = "request-0",
}
+
+
},
/* 13: add address again */
{
.properties = {
.scope = GNUNET_NT_LAN
}
+
+
}
+
+
},
/* 14: some solver still require explicit start */
{
.details.request_connection_start = {
.pid = 0
}
+
+
},
/* 15: check we got an address */
{
.details.await_address_suggestion = {
.add_label = "add-address-0-0:1"
}
+
+
},
/* 16: add alternative address */
{
.properties = {
.scope = GNUNET_NT_LAN
}
+
+
}
+
+
},
/* 17: remove original address */
{
.details.del_address = {
.add_label = "add-address-0-0:1"
}
+
+
},
/* 18: check we switched to alternative address */
{
.details.await_address_suggestion = {
.add_label = "add-address-0-1"
}
+
+
},
/* 19: remove alternative address */
{
.details.del_address = {
.add_label = "add-address-0-1"
}
+
+
},
/* 20: check we got disconnected */
{
.details.await_disconnect_suggestion = {
.pid = 0
}
+
+
},
/* 21: just for symmetry, also stop asking for the connection */
{
.details.request_connection_stop = {
.connect_label = "request-0",
}
+
+
},
/* Test ends successfully */
{
static struct Command *test_commands;
-
/**
* Free `struct AddressSuggestData` entry.
*
return ret;
}
+
/* end of test_ats_lib.c */
/* use network with 65k quota! */
.scope = GNUNET_NT_WAN
}
+
+
}
+
+
},
/* 1: some solver still require explicit start */
{
.details.request_connection_start = {
.pid = 0
}
+
+
},
/* 2: check we got an address */
{
.details.await_address_suggestion = {
.add_label = "add-address-0-0"
}
+
+
},
/* 3: sleep 7s, should give us 5s * 64k/s = 320k buffer;
Note that this depends on MAX_BANDWIDTH_CARRY_S. We
.amount = 128 * 1024,
.expected_result = GNUNET_YES
}
+
+
},
/* 5: reserve another 192k -- should just work (now exactly pushing the limit) */
{
.amount = 192 * 1024,
.expected_result = GNUNET_YES
}
+
+
},
/* 6: reserve another 32k -- should now fail (if MAX_BANDWIDTH_CARRY_S
is precisely observed) */
.amount = 32 * 1024,
.expected_result = GNUNET_SYSERR
}
+
+
},
/* 7: sleep 3s, should give us 3s * 64k/s - 32k = 160k buffer */
{
.amount = 160 * 1024,
.expected_result = GNUNET_YES
}
+
+
},
/* 9: remove address */
{
.details.del_address = {
.add_label = "add-address-0-0"
}
+
+
},
/* 10: check we got disconnected */
{
.details.await_disconnect_suggestion = {
.pid = 0
}
+
+
},
/* 11: just for symmetry, also stop asking for the connection */
{
.details.request_connection_stop = {
.connect_label = "request-0",
}
+
+
},
/* Test ends successfully */
{
return ret;
}
+
/* end of gnunet-auction.c */
return ret;
}
+
/* end of gnunet-auction.c */
return 0;
}
+
int
main (int argc, char *argv[])
{
return ret;
}
+
/* end of test_auction_api.c */
}
-
/**
* Create a block context. Loads the block plugins.
*
return NULL;
}
+
/* end of plugin_block_template.c */
return NULL;
}
+
/* end of plugin_block_test.c */
return channel->mq;
}
+
/* end of cadet_api.c */
return ret;
}
+
/* end of cadet_api_get_channel.c */
return ret;
}
+
/* end of cadet_api_list_peers.c */
ctx);
}
+
/* end of cadet_test_lib.c */
}
}
+
/**
* Stats callback. Finish the stats testbed operation and when all stats have
* been iterated, shutdown the test.
struct CadetPingMessage *ping = cls;
struct CadetPingMessage *pong;
- if ((0 == size)||(NULL == buf))
+ if ((0 == size) || (NULL == buf))
{
GNUNET_free (ping);
return 0;
&tmt_rdy_ping, peer);
}
+
/**
* @brief Reply with a pong to origin.
*
peer->ping_ntr = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"tmt_rdy called, filling buffer\n");
- if ((size < sizeof(struct CadetPingMessage))||(NULL == buf))
+ if ((size < sizeof(struct CadetPingMessage)) || (NULL == buf))
{
GNUNET_break (GNUNET_YES == test_finished);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
return NULL;
}
+
/**
* Function called whenever an inbound channel is destroyed. Should clean up
* any associated state.
return &peers[r];
}
+
/**
* START THE TEST ITSELF, AS WE ARE CONNECTED TO THE CADET SERVICES.
*
{
long n = (long) cls;
- if ((NULL == pinfo)||(NULL != emsg))
+ if ((NULL == pinfo) || (NULL != emsg))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "pi_cb: %s\n", emsg);
abort_test (__LINE__);
return 0;
}
+
/* end of gnunet-cadet-profiler.c */
}
}
+
void
mq_cb (void *cls)
{
if (target_id && args[1])
target_port = args[1];
- if (((0 != (request_peers | request_tunnels))||(NULL != conn_id)||
+ if (((0 != (request_peers | request_tunnels)) || (NULL != conn_id) ||
(NULL != channel_id) ) &&
(target_id != NULL) )
{
return 1;
}
+
/* end of gnunet-cadet.c */
ONE payload item or multiple? Seems current cadet_api
at least in theory allows more than one. Next-gen
cadet_api will likely no more, so we could then
- simplify this mess again. */
- /* Sanity check for message size */
- payload_size = ntohs (msg->header.size) - sizeof(*msg);
+ simplify this mess again. *//* Sanity check for message size */payload_size = ntohs (msg->header.size) - sizeof(*msg);
buf = (const char *) &msg[1];
while (payload_size >= sizeof(struct GNUNET_MessageHeader))
{
* - The channel is out-of-order
* - The channel is reliable and MID matches next expected MID
* - The channel is unreliable and MID is before lowest seen MID
- */
- if ((GNUNET_YES == ch->out_of_order) ||
+ */if ((GNUNET_YES == ch->out_of_order) ||
((msg->mid.mid == ch->mid_recv.mid) && (GNUNET_YES == ch->reliable)) ||
((GNUNET_NO == ch->reliable) &&
(ntohl (msg->mid.mid) >= ntohl (ch->mid_recv.mid)) &&
the case above if "delta" >= 64, which could be the case if
max_pending_messages is also >= 64 or if our client is unready
and we are seeing retransmissions of the message our client is
- blocked on. */
- LOG (GNUNET_ERROR_TYPE_DEBUG,
+ blocked on. */LOG (GNUNET_ERROR_TYPE_DEBUG,
"Duplicate payload of %u bytes on %s (mid %u) dropped\n",
(unsigned int) payload_size,
GCCH_2s (ch),
GNUNET_CADET_ConnectionTunnelIdentifier *cti);
-
/**
* We got payload data for a channel. Pass it on to the client.
*
#endif
}
+
/* end of gnunet-service-cadet_connection.c */
}
}
+
/* end of gnunet-cadet-service_core.c */
GNUNET_free (h);
}
+
/* end of gnunet-service-cadet_dht.c */
return mine;
}
+
/* end of gnunet-service-cadet-new_hello.c */
}
-
/**
* Notify @a path that it is no longer used for connection @a cc which
* ended at the path's offset @a off.
return ret;
}
+
/**
* Iterate over the paths to a peer without direct link.
*
}
-
-
/* end of gnunet-service-cadet-new_peer.c */
check_ed (e2, d1);
}
+
#endif
}
-
/* ************************************** end core crypto ***************************** */
restarted after that happens).
Furthermore, if the paths we do know are in a reasonably narrow
quality band and are plentyful, we might also consider us stabilized
- and then reduce the frequency accordingly. */
- delay = GNUNET_TIME_UNIT_MINUTES;
+ and then reduce the frequency accordingly. */delay = GNUNET_TIME_UNIT_MINUTES;
t->maintain_connections_task
= GNUNET_SCHEDULER_add_delayed (delay,
&maintain_connections_cb,
this increment if we successfully decrypted with the old KX
material and thus didn't even both with the new one. This is
the ideal case, as a malicious injection of bogus KX data
- basically only causes us to increment a counter a few times. */
- t->unverified_attempts++;
+ basically only causes us to increment a counter a few times. */t->unverified_attempts++;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Failed to decrypt message with unverified KX data %u times\n",
t->unverified_attempts);
static struct GNUNET_CADET_Channel *
get_target_channel ()
{
- if ((SPEED == test)&&(GNUNET_YES == test_backwards))
+ if ((SPEED == test) && (GNUNET_YES == test_backwards))
return outgoing_ch;
else
return incoming_ch;
"KA sent: %u, KA received: %u\n",
ka_sent,
ka_received);
- if (((KEEPALIVE == test)||(REOPEN == test)) &&
+ if (((KEEPALIVE == test) || (REOPEN == test)) &&
((ka_sent < 2) || (ka_sent > ka_received + 1)))
{
GNUNET_break (0);
i = GNUNET_TESTBED_get_index (peer);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "STATS PEER %u - %s [%s]: %llu\n", i,
subsystem, name, (unsigned long long) value);
- if ((0 == strncmp (s_sent, name, strlen (s_sent)))&&(0 == i))
+ if ((0 == strncmp (s_sent, name, strlen (s_sent))) && (0 == i))
ka_sent = value;
- if ((0 == strncmp (s_recv, name, strlen (s_recv)))&&(peers_requested - 1 ==
- i) )
+ if ((0 == strncmp (s_recv, name, strlen (s_recv))) && (peers_requested - 1 ==
+ i) )
ka_received = value;
if (0 == strncmp (rdrops, name, strlen (rdrops)))
msg_dropped += value;
send_test_message (outgoing_ch);
}
+
/**
* Function called whenever an MQ-channel is destroyed, unless the destruction
* was requested by #GNUNET_CADET_channel_destroy.
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Unknown channel! %p\n",
channel);
- if ((NULL != disconnect_task)&&(REOPEN != test))
+ if ((NULL != disconnect_task) && (REOPEN != test))
{
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task =
GNUNET_SCHEDULER_add_now (&gather_stats_and_exit,
(void *) __LINE__);
}
- else if ((NULL != reconnect_task)&&(REOPEN == test))
+ else if ((NULL != reconnect_task) && (REOPEN == test))
{
GNUNET_SCHEDULER_cancel (reconnect_task);
reconnect_task =
if (SPEED_ACK == test) // FIXME unify SPEED_ACK with an initializer
data_sent++;
}
- else if ((SPEED == test)||(SPEED_ACK == test))
+ else if ((SPEED == test) || (SPEED_ACK == test))
{
if (get_target_channel () == channel)
{
if (get_target_channel () == channel) /* Got "data" */
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received data %u\n", data_received);
- if ((SPEED != test) ||( (ok_goal - 2) == ok) )
+ if ((SPEED != test) || ( (ok_goal - 2) == ok) )
{
/* Send ACK */
send_test_message (channel);
}
else /* Got "ack" */
{
- if ((SPEED_ACK == test) ||(SPEED == test) )
+ if ((SPEED_ACK == test) || (SPEED == test) )
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received ack %u\n", ack_received);
/* Send more data */
send_test_message (channel);
- if ((ack_received < total_packets) &&(SPEED != test) )
+ if ((ack_received < total_packets) && (SPEED != test) )
return;
- if ((ok == 2) &&(SPEED == test) )
+ if ((ok == 2) && (SPEED == test) )
return;
show_end_data ();
}
(long) cls);
GNUNET_assert (0);
}
- if ((NULL != disconnect_task)&&(REOPEN != test))
+ if ((NULL != disconnect_task) && (REOPEN != test))
{
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task = GNUNET_SCHEDULER_add_delayed (short_time,
* total_packets received data packet (@dest)
* total_packets received data packet (@orig)
* 1 received channel destroy (@dest) FIXME #5818
- */
- ok_goal = total_packets * 2 + 2;
+ */ok_goal = total_packets * 2 + 2;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED_ACK\n");
test = SPEED_ACK;
test_name = "speed ack";
* total_packets received data packet (@dest)
* 1 received data packet (@orig)
* 1 received channel destroy (@dest) FIXME #5818
- */
- ok_goal = total_packets + 4;
+ */ok_goal = total_packets + 4;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED\n");
if (strstr (argv[0], "_reliable") != NULL)
{
* 1 incoming channel (@dest)
* [wait]
* 1 received channel destroy (@dest) FIXME #5818
- */
- ok_goal = 1;
+ */ok_goal = 1;
}
else if (strstr (argv[0], "_reopen") != NULL)
{
return 0;
}
+
/* end of test_cadet.c */
i = GNUNET_TESTBED_get_index (peer);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "STATS PEER %u - %s [%s]: %llu\n", i,
subsystem, name, (unsigned long long) value);
- if ((0 == strncmp (s_sent, name, strlen (s_sent)))&&(0 == i))
+ if ((0 == strncmp (s_sent, name, strlen (s_sent))) && (0 == i))
ka_sent = value;
- if ((0 == strncmp (s_recv, name, strlen (s_recv)))&&(peers_requested - 1 ==
- i) )
+ if ((0 == strncmp (s_recv, name, strlen (s_recv))) && (peers_requested - 1 ==
+ i) )
ka_received = value;
if (0 == strncmp (rdrops, name, strlen (rdrops)))
msg_dropped += value;
if (SPEED_ACK == test) // FIXME unify SPEED_ACK with an initializer
data_sent++;
}
- else if ((SPEED == test)||(SPEED_ACK == test))
+ else if ((SPEED == test) || (SPEED_ACK == test))
{
if (get_target_channel () == channel)
{
}
else /* Got "ack" */
{
- if ((SPEED_ACK == test) ||(SPEED == test) )
+ if ((SPEED_ACK == test) || (SPEED == test) )
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received ack %u\n", ack_received);
/* Send more data */
send_test_message (channel);
- if ((ack_received < total_packets) &&(SPEED != test) )
+ if ((ack_received < total_packets) && (SPEED != test) )
return;
- if ((ok == 2) &&(SPEED == test) )
+ if ((ok == 2) && (SPEED == test) )
return;
show_end_data ();
}
return 0;
}
+
/* end of test_cadet_flow.c */
GNUNET_SCHEDULER_shutdown ();
}
+
/**
* Method called whenever a peer connects to a port in MQ-based CADET.
*
return channel;
}
+
/**
* Function called whenever an MQ-channel is destroyed, even if the destruction
* was requested by #GNUNET_CADET_channel_destroy.
return (result == GNUNET_OK) ? 0 : 1;
}
+
/* end of test_cadet_local_1.c */
GNUNET_free (i);
}
+
/**
* Insert an element in the set being reconsiled. Must not be called after
* "GNUNET_CONSENSUS_conclude".
GNUNET_free (consensus);
}
+
/* end of consensus_api.c */
};
-
struct SetKey
{
int set_kind GNUNET_PACKED;
};
-
/**
* A consensus session consists of one local client and the remote authorities.
*/
}
}
+
static const char *
rfnname (uint16_t kind)
{
}
}
+
static const char *
diffname (uint16_t kind)
{
}
}
+
#ifdef GNUNET_EXTRA_LOGGING
return GNUNET_h2s (&hash);
}
+
static const char *
debug_str_task_key (struct TaskKey *tk)
{
return buf;
}
+
static const char *
debug_str_diff_key (struct DiffKey *dk)
{
return buf;
}
+
static const char *
debug_str_set_key (const struct SetKey *sk)
{
return buf;
}
+
#endif /* GNUNET_EXTRA_LOGGING */
}
}
+
#ifdef EVIL
enum EvilnessType
free (evil_subtype_str);
}
+
#endif
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
}
+
static void
put_set (struct ConsensusSession *session,
struct SetEntry *set)
}
-
static void
task_cancel_reconcile (struct TaskEntry *task)
{
GNUNET_CONTAINER_multihashmap_destroy (diff->changes);
GNUNET_free (diff);
}
+
+
#endif
}
-
/**
* Apply the result from one round of gradecasts (i.e. every peer
* should have gradecasted) to the peer's current set.
can't simply send "nothing" for the value. Thus we mark our 'confirm'
reconciliation as contested. Other peers might not know that the
leader is faulty, thus we still re-distribute in the confirmation
- round. */
- output_set->is_contested = GNUNET_YES;
+ round. */output_set->is_contested = GNUNET_YES;
}
switch (majority_vote)
task);
}
+
static void
start_task (struct ConsensusSession *session, struct TaskEntry *task)
{
}
-
-
/*
* Run all steps of the session that don't any
* more dependencies.
}
-
static void
finish_task (struct TaskEntry *task)
{
}
-
static void
put_task (struct GNUNET_CONTAINER_MultiHashMap *taskmap,
struct TaskEntry *t)
}
-
/*
* Arrange two peers in some canonical order.
*/
step = NULL;
-
/* Byzantine union */
/* sequential repetitions of the gradecasts */
}
-
/**
* Check join message.
*
return NULL;
}
+
/* end of plugin_block_consensus.c */
GNUNET_SCHEDULER_shutdown ();
}
+
static void
on_new_element (void *cls,
const struct GNUNET_SET_Element *element)
elements_received++;
}
+
static void
insert_done (void *cls, int success)
{
};
-
/**
* A caller is the handle we have for an incoming call.
*/
}
}
+
/* end of conversation_api.c */
return ret;
}
+
/* end of gnunet-conversation-test.c */
ring_my_bell();
*
* see https://gstreamer.freedesktop.org/documentation/application-development/highlevel/playback-components.html on how to play a wav using the gst framework being used here
- */
- fprintf (
+ */fprintf (
stdout,
_ (
"Incoming call from `%s'. Please /accept %u or /cancel %u the call.\n"),
return (GNUNET_OK == ret) ? 0 : 1;
}
+
/* end of gnunet-conversation.c */
return ! ret ? -1 : 16;
}
+
#endif
{
/*OggOpus streams are identified by a magic string in the initial
stream header.*/
- if (op.b_o_s &&(op.bytes >= 8) && ! memcmp (op.packet, "OpusHead", 8))
+ if (op.b_o_s && (op.bytes >= 8) && ! memcmp (op.packet, "OpusHead", 8))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Got Opus Header\n");
}
if (! has_opus_stream)
{
- if ((packet_count > 0) &&(opus_serialno == os.serialno) )
+ if ((packet_count > 0) && (opus_serialno == os.serialno) )
{
fprintf (stderr,
"\nError: Apparent chaining without changing serial number (%"
(int64_t) os.serialno);
}
}
- if (! has_opus_stream ||(os.serialno != opus_serialno) )
+ if (! has_opus_stream || (os.serialno != opus_serialno) )
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"breaking out\n");
if (! dec)
quit (1);
- if ((0 != ogg_stream_packetout (&os, &op)) ||(255 ==
- og.header[og.header_len
- - 1]) )
+ if ((0 != ogg_stream_packetout (&os, &op)) || (255 ==
+ og.header[og.header_len
+ - 1]) )
{
/*The format specifies that the initial header and tags packets are on their
own pages. To aid implementors in discovering that their files are wrong
else if (1 == packet_count)
{
has_tags_packet = 1;
- if ((0 != ogg_stream_packetout (&os, &op)) ||(255 ==
- og.header[og.header_len
- - 1]) )
+ if ((0 != ogg_stream_packetout (&os, &op)) || (255 ==
+ og.header[og.header_len
+ - 1]) )
{
fprintf (stderr,
"Extra packets on initial tags page. Invalid stream.\n");
int64_t outsamp;
/*End of stream condition*/
- if (op.e_o_s &&(os.serialno == opus_serialno) )
+ if (op.e_o_s && (os.serialno == opus_serialno) )
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Got EOS\n");
gst_element_set_state (pipeline, GST_STATE_NULL);
}
+
static gboolean
bus_call (GstBus *bus, GstMessage *msg, gpointer data)
{
return TRUE;
}
+
void
source_child_added (GstChildProxy *child_proxy, GObject *object, gchar *name,
gpointer user_data)
(gint64) LATENCY_TIME, NULL);
}
+
static void
signalhandler (int s)
{
}
}
+
/**
* The main function for the record helper.
*
return;
}
+
/***
* load gnunet configuration
*/
// GNUNET_CONFIGURATION_write(cfg, "mediahelper.conf");
}
+
static void
write_data (const char *ptr, size_t msg_size)
{
}
-
extern GstFlowReturn
on_appsink_new_sample (GstElement *element, GNUNET_gstData *d)
{
char *si_str;
GstCaps *s_caps;
char *caps_str;
- */
-
- if (gst_app_sink_is_eos (GST_APP_SINK (element)))
+ */if (gst_app_sink_is_eos (GST_APP_SINK (element)))
return GST_FLOW_OK;
// pull sample from appsink
GST_WARNING ("caps are %" GST_PTR_FORMAT, gst_sample_get_caps (s));
-
gst_buffer_map (b, &map, GST_MAP_READ);
size_t len;
return GST_FLOW_OK;
}
+
/***
* Dump a pipeline graph
*/
}
-
extern gboolean
gnunet_gst_bus_call (GstBus *bus, GstMessage *msg, gpointer data)
{
return TRUE;
}
+
/* called when pipeline changes state */
extern void
state_changed_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *d)
}
}
+
static void
application_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data)
{
return;
}
+
static void
error_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data)
{
return;
}
+
static void
eos_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data)
{
return;
}
+
extern void
gg_setup_gst_bus (GNUNET_gstData *d)
{
gst_object_unref (bus);
}
+
/*
* take buffer from gstreamer and feed it to gnunet
*/
}
-
/**
* debug making elements
*/
}
}
+
/*
static gboolean
gst_element_link_many_debug(...)
exit (10);
}
+
/***
* used to set properties on autoaudiosink's chosen sink
*/
NULL);
}
+
/***
* used to set properties on autoaudiosource's chosen sink
*/
return GST_ELEMENT (p);
}
+
static void
decoder_ogg_pad_added (GstElement *element,
GstPad *pad,
return 0;
}
+
/**
* Message callback
*
return bin;
}
+
extern GstBin *
get_coder (GNUNET_gstData *d, int type)
{
"sprop-stereo", G_TYPE_STRING, "0",
"encoding-params", G_TYPE_STRING, "2",
NULL);
- */
- rtpcaps = gst_caps_new_simple ("application/x-rtp",
+ */ rtpcaps = gst_caps_new_simple ("application/x-rtp",
"media", G_TYPE_STRING, "audio",
"clock-rate", G_TYPE_INT, SAMPLING_RATE,
"encoding-name", G_TYPE_STRING, "OPUS",
"enough-data",
G_CALLBACK(appsrc_enough_data),
NULL);
- */
-/*
+ *//*
g_signal_connect (queue,
"notify::current-level-bytes",
G_CALLBACK(queue_current_level),
"pushing",
G_CALLBACK(queue_pushing),
NULL);
- */
- }
-
-
-
+ */ }
gst_bin_add_many (bin, conv, resampler, sink, NULL);
// static struct AudioMessage *audio_message;
-
typedef struct GNUNET_gstData GNUNET_gstData;
struct GNUNET_gstData
{
};
-
-
#define DEBUG_READ_PURE_OGG 1
#define DEBUG_RECORD_PURE_OGG 1
GstElement *gnunetsrc, *gnunetsink, *source, *sink, *encoder, *decoder;
-
// audio_message = GNUNET_malloc (UINT16_MAX);
// audio_message->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO);
gst->audiobackend = JACK;
gst->dropsilence = TRUE;
gst->usertp = FALSE;
- */
- /* Initialize GStreamer */
- gst_init (&argc, &argv);
+ *//* Initialize GStreamer */gst_init (&argc, &argv);
gst->pipeline = GST_PIPELINE (gst_pipeline_new ("gnunet-media-helper"));
GstFlowReturn flow;
flow = on_appsink_new_sample (gst->appsink, gst);
}
- */
- }
+ */}
if (type == SPEAKER)
{
while (1)
GNUNET_free (microphone);
}
+
/* end of microphone.c */
return NULL;
}
+
/* end of plugin_gnsrecord_conversation.c */
GNUNET_free (speaker);
}
+
/* end of speaker.c */
return ok;
}
+
/* end of test_conversation_api.c */
return ok;
}
+
/* end of test_conversation_api_reject.c */
return 1;
}
+
/* end of test_conversation_api_twocalls.c */
return 1;
}
+
/* end of gnunet-core.c */
* (which triggered removal of the 'car') and now the client gives us a message
* just *before* the client learns about the disconnect. Theoretically, we
* might also now be *again* connected. So this can happen (but should be
- * rare). If it does happen, the message is discarded. */
- GNUNET_STATISTICS_update (GSC_stats,
+ * rare). If it does happen, the message is discarded. */GNUNET_STATISTICS_update (GSC_stats,
gettext_noop (
"# messages discarded (session disconnected)"),
1,
and a 99% chance of being kept if we are at the soft max.
The reason is to make it more likely to drop control traffic
(ACK, queries) which may be cummulative or highly redundant,
- and cheap to drop than data traffic. */
- qlen = GNUNET_MQ_get_length (c->mq);
+ and cheap to drop than data traffic. */qlen = GNUNET_MQ_get_length (c->mq);
if ((qlen >= HARD_MAX_QUEUE) ||
((qlen > SOFT_MAX_QUEUE) &&
((GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
}
}
+
/* end of gnunet-service-core_sessions.c */
/* nothing to do */
}
+
/* end of gnunet-service-core_typemap.c */
return ok;
}
+
/* end of test_core_api.c */
return ok;
}
+
/* end of test_core_api_reliability.c */
return ret;
}
+
/* end of test_core_api_send_to_self.c */
return ret;
}
+
/* end of test_core_api_start_only.c */
}
-
static void
handle_test (void *cls,
const struct TestMessage *hdr)
curl -w "foo%{size_request} -XPOST --data "ABC" $URL
the CURLINFO_REQUEST_SIZE should be the whole size of the request
including headers and body.
- */
- GNUNET_break (size_curl <= size_long);
+ */GNUNET_break (size_curl <= size_long);
urd = get_url_benchmark_data (url, (unsigned int) response_code);
urd->count++;
curl_global_cleanup ();
}
+
/* end of curl.c */
rc->task = GNUNET_SCHEDULER_add_now (&context_task, rc);
}
+
/* end of curl_reschedule.c */
return ok;
}
+
/* end of perf_datacache.c */
};
-
/**
* Function called during GET to find matching blocks.
* Only matches by type.
}
-
/* end of plugin_datacache_heap.c */
}
-
/* end of plugin_datacache_postgres.c */
}
-
/**
* Iterate over the results that are "close" to a particular key in
* the datacache. "close" is defined as numerically larger than @a
return ok;
}
+
/* end of test_datacache.c */
return ok;
}
+
/* end of test_datacache_quota.c */
GNUNET_NETWORK_STRUCT_END
-
#endif
}
-
/**
* Get a random value from the datastore for content replication.
* Returns a single, random value among those with the highest
ssize_t len;
len = GNUNET_DISK_file_read (file_handle, buf, MAGIC_LEN);
- if ((len != MAGIC_LEN)||(0 != memcmp (buf, MAGIC_BYTES, MAGIC_LEN)))
+ if ((len != MAGIC_LEN) || (0 != memcmp (buf, MAGIC_BYTES, MAGIC_LEN)))
{
fprintf (stderr, _ ("Input file is not of a supported format\n"));
return;
return ret;
}
+
/* end of gnunet-datastore.c */
* message happens, the insertion request could be blocked
* by less-important content from migration because it is
* larger than 1/8th of the overall available space, and
- * we only reserve 1/8th for "fresh" insertions */
- GNUNET_log (
+ * we only reserve 1/8th for "fresh" insertions */GNUNET_log (
GNUNET_ERROR_TYPE_WARNING,
_ (
"The requested amount (%llu bytes) is larger than the cache size (%llu bytes)\n"),
return ok;
}
+
/* end of perf_datastore_api.c */
}
-
/**
* Last task run during shutdown. Disconnects us from
* the transport and core.
return ok;
}
+
/* end of perf_plugin_datastore.c */
return GNUNET_NO;
}
+
/**
* Store an item in the datastore.
*
return NULL;
}
+
/* end of plugin_datastore_heap.c */
};
-
/**
* Wrapper for the processor for #mysql_plugin_get_expiration().
* If no expired value was found, we do a second query for
return NULL;
}
+
/* end of plugin_datastore_mysql.c */
* we do math or inequality tests, so we can't handle the entire range of uint32_t.
* This will also cause problems for expiration times after 294247-01-10-04:00:54 UTC.
* PostgreSQL also recommends against using WITH OIDS.
- */
- GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS gn090 ("
+ */GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS gn090 ("
" repl INTEGER NOT NULL DEFAULT 0,"
" type INTEGER NOT NULL DEFAULT 0,"
" prio INTEGER NOT NULL DEFAULT 0,"
return NULL;
}
+
/* end of plugin_datastore_postgres.c */
* we only test equality on it and can cast it to/from uint32_t. For repl, prio, and anonLevel
* we do math or inequality tests, so we can't handle the entire range of uint32_t.
* This will also cause problems for expiration times after 294247-01-10-04:00:54 UTC.
- */
- if ((SQLITE_DONE == sqlite3_step (stmt)) &&
+ */if ((SQLITE_DONE == sqlite3_step (stmt)) &&
(SQLITE_OK != sqlite3_exec (plugin->dbh,
"CREATE TABLE gn091 ("
" repl INT4 NOT NULL DEFAULT 0,"
return NULL;
}
+
/* end of plugin_datastore_sqlite.c */
}
-
/**
* Get a random item for replication. Returns a single, not expired,
* random item from those with the highest replication counters. The
return NULL;
}
+
/* end of plugin_datastore_template.c */
return ok;
}
+
/* end of test_datastore_api.c */
return ok;
}
+
/* end of test_datastore_api_management.c */
/* most content is 32k */
size = 32 * 1024;
- if ((0 != i)&&(GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16) ==
- 0) ) /* but some of it is less! */
+ if ((0 != i) && (GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16) ==
+ 0) ) /* but some of it is less! */
size = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 32 * 1024);
size = size - (size & 7); /* always multiple of 8 */
}
-
/**
* Last task run during shutdown. Disconnects us from
* the transport and core.
return ok;
}
+
/* end of test_plugin_datastore.c */
};
-
/**
* Reply to a GET send from the service to a client.
*/
&dht_test_run, ctx);
}
+
/* end of dht_test_lib.c */
: 1;
}
+
/* end of gnunet-dht-get.c */
NULL);
}
+
/**
* Entry point for gnunet-dht-monitor
*
: 1;
}
+
/* end of gnunet-dht-monitor.c */
NULL);
}
+
/**
* Entry point for gnunet-dht-put
*
: 1;
}
+
/* end of gnunet-dht-put.c */
GDS_DHT_SERVICE_INIT ("dht", &run);
-
-
/* end of gnunet-service-dht.c */
extern struct GNUNET_MessageHeader *GDS_my_hello;
-
/**
* Handle a reply we've received from another peer. If the reply
* matches any of our pending queries, forward it to the respective
cl_size = 0;
for (m = monitor_head; NULL != m; m = m->next)
{
- if (((GNUNET_BLOCK_TYPE_ANY == m->type) ||(m->type == type) ) &&
+ if (((GNUNET_BLOCK_TYPE_ANY == m->type) || (m->type == type) ) &&
((NULL == m->key) ||
(memcmp (key, m->key, sizeof(struct GNUNET_HashCode)) == 0) ))
{
cl_size = 0;
for (m = monitor_head; NULL != m; m = m->next)
{
- if (((GNUNET_BLOCK_TYPE_ANY == m->type) ||(m->type == type) ) &&
+ if (((GNUNET_BLOCK_TYPE_ANY == m->type) || (m->type == type) ) &&
((NULL == m->key) ||
(memcmp (key, m->key, sizeof(struct GNUNET_HashCode)) == 0) ))
{
}
}
+
/* end of gnunet-service-dht_clients.c */
}
}
+
/* end of gnunet-service-dht_hello.c */
* use the highest 2^9 bits of the result to signify the
* number of (mis)matching LSB bits; if we have 0 matching
* and hence 512 mismatching LSB bits we return -1 (since
- * 512 itself cannot be represented with 9 bits) */
-
- /* first, calculate the most significant 9 bits of our
- * result, aka the number of LSBs */
- bucket = GNUNET_CRYPTO_hash_matching_bits (target,
+ * 512 itself cannot be represented with 9 bits) *//* first, calculate the most significant 9 bits of our
+ * result, aka the number of LSBs */bucket = GNUNET_CRYPTO_hash_matching_bits (target,
have);
/* bucket is now a value between 0 and 512 */
if (bucket == 512)
const struct GNUNET_CONTAINER_BloomFilter *bloom);
-
/**
* Initialize neighbours subsystem.
*
}
}
+
/* end of gnunet-service-dht_nse.c */
recent_map = NULL;
}
+
/* end of gnunet-service-dht_routing.c */
return NULL;
}
+
/* end of plugin_block_dht.c */
return ok;
}
+
/* end of test_dht_api.c */
return ok;
}
+
/* end of test_dht_topo.c */
}
-
/**
* This receives packets from the DNS service and calls the application to
* check that the request is well-formed
GNUNET_free (dh);
}
+
/* end of dns_api.c */
return r;
}
+
/* end of gnunet-helper-dns.c */
strerror (errno));
}
}
+
+
#endif
return NULL;
}
+
/* end of plugin_block_dns.c */
}
-
/**
* Check a request via cadet to send a request to a TCP service
* offered by this system.
GNUNET_CONFIGURATION_get_value_string (cfg,
"exit",
"IPV6ADDR",
- &ipv6addr))||
+ &ipv6addr)) ||
(1 != inet_pton (AF_INET6,
ipv6addr,
&exit_ipv6addr))))
GNUNET_CONFIGURATION_get_value_string (cfg,
"exit",
"IPV4ADDR",
- &ipv4addr))||
+ &ipv4addr)) ||
(1 != inet_pton (AF_INET,
ipv4addr,
&exit_ipv4addr))))
GNUNET_CONFIGURATION_get_value_string (cfg,
"exit",
"IPV4MASK",
- &ipv4mask))||
+ &ipv4mask)) ||
(1 != inet_pton (AF_INET,
ipv4mask,
&exit_ipv4mask))))
return global_ret;
}
+
/* end of gnunet-helper-exit.c */
return GNUNET_YES;
}
+
/* end of defragmentation.c */
GNUNET_FS_make_file_reader_context_ (const char *filename);
-
/**
* Function that provides data by copying from a buffer.
*
GNUNET_FS_download_start_task_ (void *cls);
-
/**
* Fill in all of the generic fields for
* an unindex event and call the callback.
struct TopLevelActivity *top);
-
/**
* Master context for most FS operations.
*/
return GNUNET_OK;
}
+
/**
* Entries in the directory (builder).
*/
thus, reconstruction of (some) inner blocks will fail.
FIXME: we might eventually want to write a tighter test to
maximize the circumstances under which we do succeed with
- IBlock reconstruction. (need good tests though). */
- return;
+ IBlock reconstruction. (need good tests though). */return;
}
complete = GNUNET_YES;
for (i = 0; i < dr->num_children; i++)
dc->job_queue);
}
+
/**
* Suspend a download.
*
GNUNET_free (dc);
}
+
/* end of fs_download.c */
return s->serialization;
}
+
/**
* Obtain the filename from the file information structure.
*
return GNUNET_OK;
}
+
/**
* Allow user to specify metadata.
*
}
-
-
/* end of fs_getopt.c */
GNUNET_free (uc);
}
+
/* end of fs_publish_ublock.c */
GNUNET_free (sc);
}
+
/* end of fs_search.c */
GNUNET_free (toplevel);
}
+
/* end fs_sharetree.c */
void *cont_cls);
-
#endif
GNUNET_free (te);
}
+
/* end of fs_tree.c */
GNUNET_free (uc);
}
+
/* end of fs_unindex.c */
return ret;
}
+
#define GNUNET_FS_URI_KSK_PREFIX GNUNET_FS_URI_PREFIX GNUNET_FS_URI_KSK_INFIX
/**
return ret;
}
+
#define GNUNET_FS_URI_CHK_PREFIX GNUNET_FS_URI_PREFIX GNUNET_FS_URI_CHK_INFIX
GNUNET_free (ss);
return seps;
}
+
+
#undef TOKENS
* If given non-utf8 string it will, most likely, find it to be invalid,
* and will return the length of its valid part, skipping the keyword.
* If it does - fix the extractor, not this check!
- */
- if (u8_strcount ((const uint8_t *) data) <= 2)
+ */if (u8_strcount ((const uint8_t *) data) <= 2)
return 0;
if ((EXTRACTOR_METATYPE_MIMETYPE == type) &&
(NULL != (sep = memchr (data, '/', data_len))) && (sep != data))
}
}
+
/* end of fs_uri.c */
return ok;
}
+
/* end of gnunet-auto-share.c */
options, &run, NULL)) ? global_ret : 1;
}
+
/* end of gnunet-daemon-fsprofiler.c */
}
}
+
/**
* The main function to inspect GNUnet directories.
*
return ret;
}
+
/* end of gnunet-directory.c */
return ret;
}
+
/* end of gnunet-download.c */
return ret;
}
+
/* end of gnunet-fs-profiler.c */
}
}
+
/**
* The main function to access special file-sharing functions.
*
return ret;
}
+
/* end of gnunet-fs.c */
}
return 0;
}
+
+
#endif
return 0;
}
+
/* end of gnunet-helper-fs-publish.c */
return ret;
}
+
/* end of gnunet-publish.c */
return ret;
}
+
/* end of gnunet-search.c */
#define INSANE_STATISTICS GNUNET_NO
-
/**
* Doubly-linked list of requests we are performing
* on behalf of the same client.
}
-
-
-
/**
* Task that periodically ages our cover traffic statistics.
*
static unsigned long long sc_count_max;
-
/**
* Task run to asynchronously terminate the cadet due to timeout.
*
answers should be queried; OTOH, this is not a
hard error as we might have had the answer in the
past and the user might have unindexed it. Hence
- we log at level "INFO" for now. */
- if (NULL == key)
+ we log at level "INFO" for now. */if (NULL == key)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Have no answer and the query was NULL\n");
GNUNET_assert (0 == sc_count);
}
+
/* end of gnunet-service-fs_cadet.c */
GSF_connected_peer_get_identity2_ (const struct GSF_ConnectedPeer *cp);
-
/**
* Iterate over all connected peers.
*
return GNUNET_OK;
}
+
/* end of gnunet-service-fs_indexing.c */
* which satisfies all of the rules above.
*
* Note: M_PI_4 = PI/4 = arctan(1)
- */
- rp->priority =
+ */rp->priority =
round ((GSF_current_priorities
+ 1.0) * atan (delay.rel_value_us / avg_delay)) / M_PI_4;
/* Note: usage of 'round' and 'atan' requires -lm */
}
-
/* end of gnunet-service-fs_pe.h */
return pr;
}
+
/**
* Obtain the public data associated with a pending request
*
const struct GNUNET_PeerIdentity *target);
-
/**
* Setup the subsystem.
*/
GNUNET_assert (0 == mig_size);
}
+
/* end of gnunet-service-fs_push.c */
}
}
+
/* end of gnunet-service-fs_put.c */
}
}
+
/**
* Called by FS client to give information about the progress of an
* operation.
return ret;
}
+
/* end of gnunet-unindex.c */
return ok;
}
+
/* end of perf_gnunet_service_fs_p2p.c */
}
-
/**
* Adapter function called to establish a connection to
* statistics service.
return ok;
}
+
/* end of perf_gnunet_service_fs_p2p_respect.c */
return NULL;
}
+
/* end of plugin_block_fs.c */
return fn;
}
+
static enum GNUNET_FSUI_EventType lastEvent;
static struct GNUNET_MetaData *search_meta;
return NULL;
}
+
#define START_DAEMON 1
int
return (ok == GNUNET_YES) ? 0 : 1;
}
+
/* end of test_fs.c */
fprintf (stderr, "Error at %s:%d\n", __FILE__, __LINE__);
}
+
static int
testDirectory (unsigned int i)
{
return 0;
}
+
/* end of test_fs_directory.c */
return err;
}
+
/* end of test_fs_download.c */
return err;
}
+
/* end of test_fs_download_persistence.c */
return 0;
}
+
/* end of test_fs_file_information.c */
return 0;
}
+
/* end of test_fs_list_indexed.c */
return err;
}
+
/* end of test_fs_publish.c */
return err;
}
+
/* end of test_fs_publish_persistence.c */
return err;
}
+
/* end of test_fs_search.c */
return err;
}
+
/* end of test_fs_search_persistence.c */
return err;
}
+
/* end of test_fs_search_probes.c */
return err;
}
+
/* end of test_fs_search.c */
return 0;
}
+
/* end of test_fs_start_stop.c */
return ret;
}
+
/* end of test_fs_test_lib.c */
return 0;
}
+
/* end of test_fs_unindex.c */
return 0;
}
+
/* end of test_fs_unindex_persistence.c */
return 0;
}
+
/* end of test_fs_uri.c */
return ok;
}
+
/* end of test_gnunet_service_fs_migration.c */
return ok;
}
+
/* end of test_gnunet_service_fs_p2p.c */
return ret;
}
+
/* end of test_plugin_block_fs.c */
return ret;
}
+
/* end of gns_tld_api.c */
static struct in6_addr address6;
-
/**
* Handle to GNS resolver.
*/
return ret;
}
+
/* end of gnunet-dns2gns.c */
return ret;
}
+
/* end of gnunet-gns-benchmark.c */
return 0;
}
+
static void
check_pkey (unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd,
char *pk, int *found_rec)
}
}
+
/**
* Process a record that was stored in the namestore.
*
GNUNET_NAMESTORE_zone_iterator_next (list_it);
}
+
static void
zone_iteration_error (void *cls)
{
GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
if (NULL != identifier)
{
- if ((NULL == master_zone_pkey) &&(0 == strcmp ("master-zone", identifier)) )
+ if ((NULL == master_zone_pkey) && (0 == strcmp ("master-zone",
+ identifier)) )
{
master_zone_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk);
master_pk = *GNUNET_IDENTITY_ego_get_private_key (ego);
}
- else if ((NULL == private_zone_pkey) &&(0 == strcmp ("private-zone",
- identifier)) )
+ else if ((NULL == private_zone_pkey) && (0 == strcmp ("private-zone",
+ identifier)) )
private_zone_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk);
}
}
+
/**
* Task run on shutdown.
*
}
}
+
/**
* Main function that will be run.
*
return GNUNET_OK == r ? ret : 1;
}
+
/* end of gnunet-gns-import.c */
#include "gns.h"
-
/**
* Default Socks5 listen port.
*/
};
-
/* *********************** Datastructures for HTTP handling ****************** */
/**
};
-
/**
* A structure for all running Httpds
*/
};
-
/* *********************** Globals **************************** */
/**
* Pre-populate cache to resolve Hostname.
* This is necessary as the DNS name in the CURLOPT_URL is used
* for SNI http://de.wikipedia.org/wiki/Server_Name_Indication
- */
- if (NULL != s5r->leho)
+ */if (NULL != s5r->leho)
{
char *curl_hosts;
}
}
+
/**
* Function called when MHD first processes an incoming connection.
* Gives us the respective URI information.
return ret;
}
+
/* end of gnunet-gns-proxy.c */
}
}
+
/**
* Task to run on timeout
*
GNUNET_SCHEDULER_shutdown ();
}
+
/**
* Function called with the result of a GNS lookup.
*
return global_ret;
}
+
/* end of gnunet-gns.c */
}
}
+
/* end of gnunet-service-gns_interceptor.c */
return GNUNET_YES;
}
+
/* ************************** Resolution **************************** */
/**
return 0;
}
+
/* end of nss_gns_query.c */
return NULL;
}
+
/* end of plugin_block_gns.c */
return NULL;
}
+
/* end of plugin_gnsrecord_gns.c */
return NULL;
}
+
/* end of plugin_rest_gns.c */
return buffer;
}
+
/**
* Load PEM key from file
*
return (GNUTLS_E_SUCCESS != ret) ? GNUNET_SYSERR : GNUNET_OK;
}
+
/**
* Load cert from file
*
return (GNUTLS_E_SUCCESS != ret) ? GNUNET_SYSERR : GNUNET_OK;
}
+
static size_t
copy_buffer (void *ptr, size_t size, size_t nmemb, void *ctx)
{
NULL);
}
+
int
main (int argc, char *const *argv)
{
return global_ret;
}
+
/* end of test_gns_proxy.c */
return NULL;
}
+
/* end of gnsrecord.c */
}
-
/**
* Check if a signature is valid. This API is used by the GNS Block
* to validate signatures received from the network.
* Efficiently round up to the next
* power of 2 for padding
* https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
- */
- ret--;
+ */ret--;
ret |= ret >> 1;
ret |= ret >> 2;
ret |= ret >> 4;
return 0;
}
+
/* end of test_gnsrecord_crypto.c */
return NULL;
}
+
/* end of plugin_gnsrecord_dns.c */
static int res;
-
static void
run (void *cls, char *const *args, const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
return res;
}
+
/* end of test_gnsrecord_crypto.c */
res = 0;
}
+
static void
run (void *cls,
char *const *args,
return res;
}
+
/* end of test_gnsrecord_crypto.c */
return res;
}
+
/* end of test_gnsrecord_serialization.c */
return 0;
}
+
/* end of gnunet-hello.c */
*/
-
/**
* Function that is called on each address of this peer.
* Expands the corresponding URI string.
return 0; /* testcase passed */
}
+
/* end of test_hello.c */
return ret;
}
+
/* end of gnunet-daemon-hostlist.c */
cfg = NULL;
}
+
/* end of gnunet-daemon-hostlist_client.c */
core = NULL;
}
+
/* end of gnunet-daemon-hostlist_server.c */
return ret;
}
+
/* end of test_gnunet_daemon_hostlist.c */
return ret;
}
+
/* end of test_gnunet_daemon_hostlist_learning.c */
return ok;
}
+
/* end of test_gnunet_daemon_hostlist_reconnect.c */
return global_ret;
}
+
/* end of gnunet-identity.c */
return filename;
}
+
/**
* Called whenever a client is disconnected.
*
return client;
}
+
/**
* Task run during shutdown.
*
return GNUNET_memcmp (pk1, pk2);
}
+
/**
* Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT message
*
return GNUNET_OK;
}
+
/**
* Handler for SET_DEFAULT message from client, updates
* default identity for some service.
GNUNET_free (um);
}
+
/**
* Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_CREATE message
*
return GNUNET_OK;
}
+
/**
* Handler for CREATE message from client, creates
* new identity.
GNUNET_free (id);
}
+
/**
* Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_RENAME message
*
GNUNET_free (id);
}
+
/**
* Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_DELETE message
*
GNUNET_free (h);
}
+
/* end of identity_api.c */
GNUNET_free (handle);
}
+
/**
* Task run on errors. Reports an error and cleans up everything.
*
GNUNET_SCHEDULER_add_now (&cleanup_handle, handle);
}
+
/**
* Handle identity GET request for subsystem
*
ego_get_response (handle, ego_entry);
}
+
/**
* Handle identity GET request with a name
*
ego_edit (handle, ego_entry);
}
+
/**
* Handle identity PUT request with name
*
ego_edit (handle, ego_entry);
}
+
/**
* Handle identity subsystem PUT request with name
*
return;
}
+
/**
* Handle identity POST request
*
handle);
}
+
/**
* Handle identity DELETE request with public key
*
return;
}
+
/**
* Handle rest request
*
}
}
+
/**
* If listing is enabled, prints information about the egos.
*
GNUNET_free (tmp->identifier);
GNUNET_free (tmp);
}
- else {
+ else
+ {
// Renamed
GNUNET_free (tmp->identifier);
tmp->identifier = GNUNET_strdup (identifier);
}
+
/**
* Function processing the REST call
*
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected\n");
}
+
/**
* Entry point for the plugin.
*
return api;
}
+
/**
* Exit point from the plugin.
*
return NULL;
}
+
/* end of plugin_rest_identity.c */
#define MAX_UBLOCK_SIZE (60 * 1024)
-
GNUNET_NETWORK_STRUCT_BEGIN
/**
GN_memrchr_ (const void *s,
int c,
size_t n);
+
#ifndef HAVE_MEMRCHR
#define memrchr(s, c, n) GN_memrchr_ (s, c, n)
#endif
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
/*
* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
*/
-enum GNUNET_ABD_CredentialFlags {
+enum GNUNET_ABD_CredentialFlags
+{
- //Subject had credentials before, but have been revoked now
+ // Subject had credentials before, but have been revoked now
GNUNET_ABD_FLAG_REVOKED=0,
- //Subject flag indicates that the subject is a holder of this credential and may present it as such
+ // Subject flag indicates that the subject is a holder of this credential and may present it as such
GNUNET_ABD_FLAG_SUBJECT=1,
- //Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance
+ // Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance
GNUNET_ABD_FLAG_ISSUER=2
};
/**
* The attribute delegation record
*/
-struct GNUNET_ABD_DelegationRecord {
+struct GNUNET_ABD_DelegationRecord
+{
/**
* Number of delegation sets in this record
/**
* The attribute delegation record
*/
-struct GNUNET_ABD_DelegationRecordSet {
+struct GNUNET_ABD_DelegationRecordSet
+{
/**
* Public key of the subject this attribute was delegated to
/**
* The attribute delegation record
*/
-struct GNUNET_ABD_DelegationSet {
+struct GNUNET_ABD_DelegationSet
+{
/**
* Public key of the subject this attribute was delegated to
/**
* A delegation
*/
-struct GNUNET_ABD_Delegation {
+struct GNUNET_ABD_Delegation
+{
/**
* The issuer of the delegation
/**
* A delegate
*/
-struct GNUNET_ABD_Delegate {
+struct GNUNET_ABD_Delegate
+{
/**
* The issuer of the credential
/*
* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
*/
-enum GNUNET_ABD_AlgoDirectionFlags {
+enum GNUNET_ABD_AlgoDirectionFlags
+{
- //Subject had credentials before, but have been revoked now
+ // Subject had credentials before, but have been revoked now
GNUNET_ABD_FLAG_FORWARD=1 << 0,
- //Subject flag indicates that the subject is a holder of this credential and may present it as such
+ // Subject flag indicates that the subject is a holder of this credential and may present it as such
GNUNET_ABD_FLAG_BACKWARD=1 << 1
};
* @param delegate the delegates
*/
typedef void (*GNUNET_ABD_CredentialResultProcessor) (void *cls,
- unsigned int d_count,
- struct GNUNET_ABD_Delegation *delegation_chain,
- unsigned int c_count,
- struct GNUNET_ABD_Delegate *delegte);
-
+ unsigned int d_count,
+ struct
+ GNUNET_ABD_Delegation *
+ delegation_chain,
+ unsigned int c_count,
+ struct GNUNET_ABD_Delegate
+ *delegte);
+
typedef void (*GNUNET_ABD_IntermediateResultProcessor) (void *cls,
- struct GNUNET_ABD_Delegation *delegation,
- bool is_bw);
+ struct
+ GNUNET_ABD_Delegation *
+ delegation,
+ bool is_bw);
/**
* Iterator called on obtained result for an attribute delegation.
* @param result the record data that can be handed to the subject
*/
typedef void (*GNUNET_ABD_DelegateResultProcessor) (void *cls,
- uint32_t success);
+ uint32_t success);
/**
* Iterator called on obtained result for an attribute delegation removal.
* @param result the record data that can be handed to the subject
*/
typedef void (*GNUNET_ABD_RemoveDelegateResultProcessor) (void *cls,
- uint32_t success);
+ uint32_t success);
/**
* @return handle to the queued request
*/
struct GNUNET_ABD_Request*
-GNUNET_ABD_verify (struct GNUNET_ABD_Handle *handle,
- const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
- const char *issuer_attribute,
- const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
- uint32_t delegate_count,
- const struct GNUNET_ABD_Delegate *delegates,
- enum GNUNET_ABD_AlgoDirectionFlags direction,
- GNUNET_ABD_CredentialResultProcessor proc,
- void *proc_cls,
- GNUNET_ABD_IntermediateResultProcessor,
- void *proc2_cls);
+ GNUNET_ABD_verify (struct GNUNET_ABD_Handle *handle,
+ const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
+ const char *issuer_attribute,
+ const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
+ uint32_t delegate_count,
+ const struct GNUNET_ABD_Delegate *delegates,
+ enum GNUNET_ABD_AlgoDirectionFlags direction,
+ GNUNET_ABD_CredentialResultProcessor proc,
+ void *proc_cls,
+ GNUNET_ABD_IntermediateResultProcessor,
+ void *proc2_cls);
struct GNUNET_ABD_Request*
-GNUNET_ABD_collect (struct GNUNET_ABD_Handle *handle,
- const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
- const char *issuer_attribute,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key,
- enum GNUNET_ABD_AlgoDirectionFlags direction,
- GNUNET_ABD_CredentialResultProcessor proc,
- void *proc_cls,
- GNUNET_ABD_IntermediateResultProcessor,
- void *proc2_cls);
+ GNUNET_ABD_collect (struct GNUNET_ABD_Handle *handle,
+ const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
+ const char *issuer_attribute,
+ const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key,
+ enum GNUNET_ABD_AlgoDirectionFlags direction,
+ GNUNET_ABD_CredentialResultProcessor proc,
+ void *proc_cls,
+ GNUNET_ABD_IntermediateResultProcessor,
+ void *proc2_cls);
/**
* Delegate an attribute
*/
struct GNUNET_ABD_Request *
GNUNET_ABD_add_delegation (struct GNUNET_ABD_Handle *handle,
- struct GNUNET_IDENTITY_Ego *issuer,
- const char *attribute,
- struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
- const char *delegated_attribute,
- GNUNET_ABD_DelegateResultProcessor proc,
- void *proc_cls);
+ struct GNUNET_IDENTITY_Ego *issuer,
+ const char *attribute,
+ struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
+ const char *delegated_attribute,
+ GNUNET_ABD_DelegateResultProcessor proc,
+ void *proc_cls);
/**
* Remove a delegation
*/
struct GNUNET_ABD_Request *
GNUNET_ABD_remove_delegation (struct GNUNET_ABD_Handle *handle,
- struct GNUNET_IDENTITY_Ego *issuer,
- const char *attribute,
- GNUNET_ABD_RemoveDelegateResultProcessor proc,
- void *proc_cls);
-
+ struct GNUNET_IDENTITY_Ego *issuer,
+ const char *attribute,
+ GNUNET_ABD_RemoveDelegateResultProcessor proc,
+ void *proc_cls);
/**
*/
struct GNUNET_ABD_Delegate*
GNUNET_ABD_delegate_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
- struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
- const char *iss_attr,
- const char *sub_attr,
- struct GNUNET_TIME_Absolute *expiration);
+ struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
+ const char *iss_attr,
+ const char *sub_attr,
+ struct GNUNET_TIME_Absolute *expiration);
/**
struct GNUNET_CRYPTO_AbeKey;
-
/**
* @ingroup abe
* Create a new CP-ABE master key. Caller must free return value.
};
-
/* ********************* LAN Characterization library ************************ */
/* Note: these functions do not really communicate with the ATS service */
const struct GNUNET_ATS_PropertiesNBO *nbo);
-
/* ********************Connection Suggestion API ***************************** */
/**
GNUNET_ATS_address_destroy (struct GNUNET_ATS_AddressRecord *ar);
-
/* ******************************** Performance API ***************************** */
/**
f, sizeof(float)))
-
/**
* Read a double.
*
const struct GNUNET_CONTAINER_MetaData *m);
-
/**
* Write a float.
*
#define GNUNET_BIO_write_float(h, f) GNUNET_BIO_write (h, &f, sizeof(float))
-
/**
* Write a double.
*
struct GNUNET_HashCode *key);
-
/**
* Each plugin is required to return a pointer to a struct of this
* type as the return value from its entry point.
const char *file,
const char *function,
int line);
+
#endif
struct GNUNET_TIME_Relative *time);
-
/**
* Get a configuration value that should be a size in bytes.
*
GNUNET_SET_Element *element);
-
/**
* Opaque handle for the consensus service.
*/
void *idc_cls);
-
/**
* Called when a conclusion was successful.
*
#endif
-
/**
* Bandwidth (in/out) to assume initially (before either peer has
* communicated any particular preference). Should be rather low; set
#define GNUNET_CONSTANTS_BLOOMFILTER_K 16
-
-
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
void *proc_cls);
-
/**
* Cancel a datastore operation. The final callback from the
* operation must not have been done yet.
GNUNET_TIME_UNIT_MINUTES, 60)
-
/**
* Connection to the DHT service.
*/
size_t size);
-
/**
* Start monitoring the local DHT service.
*
};
-
/**
* Signature of a function that is called whenever the DNS service
* encounters a DNS request and needs to do something with it. The
};
-
/**
* Binary record information (unparsed).
*/
const struct GNUNET_MessageHeader *msg);
-
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
int is_mandatory);
-
/**
* Get a unique key from a URI. This is for putting URIs
* into HashMaps. The key may change between FS implementations.
const char *value);
-
/* ************************* sharing API ***************** */
};
-
/**
* Download parts of a file. Note that this will store
* the blocks at the respective offset in the given file. Also, the
GNUNET_FS_download_resume (struct GNUNET_FS_DownloadContext *dc);
-
/* ******************** Directory API *********************** */
#endif
-
/**
* Information we pass to #GNUNET_MY_exec_prepared() to
* initialize the arguments of the prepared statement.
#define GNUNET_MY_result_spec_end { NULL, NULL, NULL, 0, NULL, 0, 0 }
-
/**
* Obtain fixed size result of @a ptr_size bytes from
* MySQL, store in already allocated buffer at @a ptr.
const char *emsg);
-
/**
* Store an item in the namecache. If the item is already present,
* it is replaced with the new record.
};
-
/**
* What the situation of the NAT connectivity
*/
};
-
/**
* Signature of the callback passed to #GNUNET_NAT_register() for
* a function to call whenever our set of 'valid' addresses changes.
GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc);
-
/**
* Retrieve the status of a process, waiting on it if dead.
* Blocking version.
uint32_t num_peers,
const struct GNUNET_PeerIdentity *ids,
const struct GNUNET_PeerIdentity *target_peer);
+
#endif /* ENABLE_MALICIOUS */
/* Get internals for debugging/profiling purposes */
};
-
-
/**
* Function used by event-loop implementations to signal the scheduler
* that a particular @a task is ready due to an event specified in the
void *new_select_cls);
-
/**
* Change the async scope for the currently executing task and (transitively)
* for all tasks scheduled by the current task after calling this function.
GNUNET_SCHEDULER_begin_async_scope (struct GNUNET_AsyncScopeId *aid);
-
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
"1d7024c3650f60d0da"
-
/**
* Session that will eventually establish a shared secred between
* the involved peers and allow encryption and cooperative decryption.
};
-
/* **************** NEW SERVICE API ********************** */
/**
};
-
/**
* The way results are given to the client.
*/
struct GNUNET_SET_Request *request);
-
typedef void
(*GNUNET_SET_CopyReadyCallback) (void *cls,
struct GNUNET_SET_Handle *copy);
size_t ptr_size);
-
/**
* Generate query parameter for a string.
*
GNUNET_SQ_cleanup_result (struct GNUNET_SQ_ResultSpec *rs);
-
/* ******************** sq_prepare.c functions ************** */
sqlite3_stmt **pstmt);
-
/**
* Prepare all statements given in the (NULL,NULL)-terminated
* array at @a ps
const struct GNUNET_SQ_ExecuteStatement *es);
-
#endif /* GNUNET_SQ_LIB_H_ */
/* end of include/gnunet_sq_lib.h */
int make_persistent);
-
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
unsigned int count, ...);
-
/**
* @ingroup time
* Like `asctime`, except for GNUnet time. Converts a GNUnet internal
uint16_t port);
-
/**
* Create a host to run peers and controllers on. This function is used
* if a peer learns about a host via IPC between controllers (and thus
void *cb_cls);
-
/**
* Options for peer connections.
*/
...);
-
/**
* Topologies and topology options supported for testbeds. Options should always
* end with #GNUNET_TESTBED_TOPOLOGY_OPTION_END
int
GNUNET_TESTING_configuration_create (struct GNUNET_TESTING_System *system,
struct GNUNET_CONFIGURATION_Handle *cfg);
+
// FIXME: add dual to 'release' ports again...
#define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever_ ()
-
/**
* Threshold after which exponential backoff should not increase (15 m).
*/
struct GNUNET_TIME_Relative t2);
-
/**
* Return the maximum of two relative time values.
*
#if ! HAVE_ATOLL
long long
atoll (const char *nptr);
+
#endif
#if ENABLE_NLS
return ret;
}
+
/**
* Convert GNS record to JSON.
*
}
}
+
/* end of mhd_json.c */
return 0;
}
+
/* end of test_json.c */
return global_ret;
}
+
/* end of test_json_mhd.c */
return ret;
}
+
/* end of gnunet-namecache.c */
return GNUNET_OK;
}
+
/**
* Store values in hashmap in file and free data
*
return GNUNET_YES;
}
+
/**
* Shutdown database connection and associate data
* structures.
GNUNET_DISK_file_close (fh);
}
+
static int
expire_blocks (void *cls,
const struct GNUNET_HashCode *key,
}
-
/**
* Removes any expired block.
*
return NULL;
}
+
/* end of plugin_namecache_sqlite.c */
return NULL;
}
+
/* end of plugin_namecache_postgres.c */
return NULL;
}
+
/* end of plugin_namecache_sqlite.c */
(void *) name));
}
+
static void
cache_cont (void *cls, int32_t success, const char *emsg)
{
return ok;
}
+
/* end of test_plugin_namecache.c */
GNUNET_NAMESTORE_zone_iterator_next (request->lookup_it, 1);
}
+
static void
lookup_it_finished (void *cls)
{
request);
}
+
/**
* Main MHD callback for handling requests.
*
return ret;
}
+
/* end of gnunet-namestore-fcfsd.c */
return ret;
}
+
/* end of gnunet-namestore.c */
return 0;
}
+
/* end of gnunet-zoneimport.c */
};
-
/**
* Lookup a name for a zone hash
*/
};
-
/**
* Start a zone iteration for the given zone
*/
GNUNET_free (zm);
}
+
/* end of namestore_api_monitor.c */
return NULL;
}
+
/* end of plugin_namestore_flat.c */
return NULL;
}
+
/* end of plugin_namestore_postgres.c */
return NULL;
}
+
/* end of plugin_namestore_sqlite.c */
return NULL;
}
+
/* end of plugin_rest_namestore.c */
}
}
+
#include "test_common.c"
#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
-
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100)
return res;
}
+
/* end of test_namestore_api_remove.c */
return res;
}
+
/* end of test_namestore_api_remove_not_existing_record.c */
return res;
}
+
/* end of test_namestore_api_zone_iteration_specific_zone.c */
return res;
}
+
/* end of test_namestore_api_zone_iteration_stop.c */
return res;
}
+
/* end of test_namestore_api_zone_to_name.c */
return ok;
}
+
/* end of test_plugin_namestore.c */
GNUNET_free (tst);
}
+
/* end of nat_test.c */
}
-
/**
* Callback called when a client connects to the service.
*
mallopt (M_TOP_PAD, 1 * 1024);
malloc_trim (0);
}
-#endif
+#endif
/* end of gnunet-nat-server.c */
mallopt (M_TOP_PAD, 1 * 1024);
malloc_trim (0);
}
+
+
#endif
/* end of gnunet-service-nat.c */
#include "gnunet_util_lib.h"
-
GNUNET_NETWORK_STRUCT_BEGIN
/**
#include "nat-auto.h"
-
/**
* Handle to auto-configuration in progress.
*/
GNUNET_free (ah);
}
+
/* end of nat_api_auto.c */
GNUNET_free (tst);
}
+
/* end of nat_auto_api_test.c */
return global_ret;
}
+
/* end of gnunet-helper-nat-client.c */
removed again. The timeout frequency should be configurable
(with a sane default), so that the UDP plugin can tell how
often to re-request STUN.
- */
- struct StunExternalIP *se;
+ */struct StunExternalIP *se;
/* Check if we had a prior response from this STUN server */
for (se = se_head; NULL != se; se = se->next)
mallopt (M_TOP_PAD, 1 * 1024);
malloc_trim (0);
}
+
+
#endif
/* end of gnunet-service-nat.c */
GNUNET_free (mon);
}
+
/* end of gnunet-service-nat_externalip.c */
*
* "%s TCP PORT->STRING:OURPORT *" or
* "%s UDP PORT->STRING:OURPORT *"
- */
- GNUNET_snprintf (pstr, sizeof(pstr), ":%u ", mini->port);
+ */GNUNET_snprintf (pstr, sizeof(pstr), ":%u ", mini->port);
if (NULL == (s = strstr (line, "->")))
return; /* skip */
if (NULL == strstr (s, pstr))
* The upnpc output we're after looks like this:
*
* "external 87.123.42.204:3000 TCP is redirected to internal 192.168.2.150:3000"
- */
- if ((NULL == (ipaddr = strstr (line, " "))) ||
+ */if ((NULL == (ipaddr = strstr (line, " "))) ||
(NULL == (pstr = strstr (ipaddr, ":"))) ||
(1 != sscanf (pstr + 1, "%u", &port)))
{
return ret;
}
+
/* end of gnunet-service-nat_stun.c */
#include "gnunet_util_lib.h"
-
GNUNET_NETWORK_STRUCT_BEGIN
/**
return 0;
}
+
/* end of test_nat.c */
GNUNET_NAT_mini_map_stop (mini);
}
+
#define PORT 10000
/**
return 0;
}
+
/* end of test_nat_mini.c */
return ret;
}
+
/* end of test_nat_test.c */
#include "gnunet_nat_lib.h"
-
#define LOG(kind, ...) GNUNET_log_from (kind, "test-stun", __VA_ARGS__)
/**
return ret;
}
+
/* end of test_stun.c */
return ok;
}
+
/* end of nse-profiler.c */
#if ENABLE_NSE_HISTOGRAM
peer_entry->received_messages++;
- if ((peer_entry->transmitted_messages > 0)&&
+ if ((peer_entry->transmitted_messages > 0) &&
(peer_entry->last_transmitted_size >= matching_bits) )
GNUNET_STATISTICS_update (stats, "# cross messages", 1, GNUNET_NO);
#endif
GNUNET_TESTBED_LOGGER_disconnect (lh);
lh = NULL;
}
+
+
#endif
GNUNET_SCHEDULER_shutdown ();
}
}
+
+
#endif
/**
* MINIMIZE heap size (way below 128k) since this process doesn't need much.
*/
-void __attribute__ ((constructor)) GNUNET_ARM_memory_init ()
+void __attribute__ ((constructor))
+GNUNET_ARM_memory_init ()
{
mallopt (M_TRIM_THRESHOLD, 4 * 1024);
mallopt (M_TOP_PAD, 1 * 1024);
malloc_trim (0);
}
+
+
#endif
GNUNET_free (h);
}
+
/* end of nse_api.c */
#include <gauger.h>
-
/**
* Calculate the 'proof-of-work' hash (an expensive hash).
*
return 0;
}
+
/* end of perf_kdf.c */
}
}
+
/**
* Callback to call when network size estimate is updated.
*
return ok;
}
+
/* end of test_nse_api.c */
return ok;
}
+
/* end of test_nse_multipeer.c */
GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &print_address, pc);
}
+
/* ************************* DUMP Hello ************************** */
/**
return ret;
}
+
/* end of gnunet-peerinfo.c */
static struct TransportPlugin *plugins_tail;
-
/**
* Load and initialize all plugins. The respective functions will be
* invoked by the plugins when the respective events happen. The
pc);
}
+
/**
* Handle peerinfo GET request
*
}
-
/**
* Respond to OPTIONS request
*
return NULL;
}
+
/* end of plugin_rest_peerinfo.c */
#include "gnunet_peerinfo_service.h"
-
GNUNET_NETWORK_STRUCT_BEGIN
/**
}
-
/**
* Function called when we receive an info message. Check it is
* well-formed.
GNUNET_free (nc);
}
+
/* end of peerinfo_api_notify.c */
return 0;
}
+
/* end of perf_peerinfo_api.c */
return ret;
}
+
struct GNUNET_PeerIdentity pid;
static void
return global_ret;
}
+
/* end of test_peerinfo_api.c */
return global_ret;
}
+
/* end of test_peerinfo_api_friend_only */
GNUNET_break (0);
}
+
static ssize_t
address_generator (void *cls, size_t max, void *buf)
{
}
}
+
static void
process_wo_fo (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_HELLO_Message *hello, const char *err_msg)
return global_ret;
}
+
/* end of test_peerinfo_api_notify_friend_only.c */
return global_ret;
}
+
/* end of test_peerinfo_shipped_hellos.c */
NULL)) ? ret : 1;
}
+
/* end of gnunet-peerstore.c */
return wc;
}
+
/* end of peerstore_api.c */
return ok;
}
+
/* end of perf_peerstore_store.c */
return plugin->deleted_entries;
}
+
static int
expire_entries (void *cls,
const struct GNUNET_HashCode *key,
}
-
/**
* Delete expired records (expiry < now)
*
return GNUNET_YES;
}
+
/**
* Iterate over the records given an optional peer id
* and/or key.
return GNUNET_OK;
}
+
static int
store_and_free_entries (void *cls,
const struct GNUNET_HashCode *key,
return GNUNET_YES;
}
+
/**
* Shutdown database connection and associate data
* structures.
return NULL;
}
+
/* end of plugin_peerstore_sqlite.c */
return NULL;
}
+
/* end of plugin_peerstore_sqlite.c */
return ok;
}
+
/* end of test_peerstore_api_iterate.c */
return ok;
}
+
/* end of test_peerstore_api_store.c */
NULL);
}
+
static void
disc_cont (void *cls)
{
NULL);
}
+
static void
store_cont (void *cls, int success)
{
a chance to actually finish the operation; otherwise,
the test may fail non-deterministically if the new
connection is faster than the cleanup routine of the
- old one. */
- GNUNET_SCHEDULER_add_now (&disc_cont,
+ old one. */GNUNET_SCHEDULER_add_now (&disc_cont,
NULL);
}
+
/**
* Actually run the test.
*/
return ok;
}
+
/* end of test_peerstore_api_sync.c */
return ok;
}
+
/* end of test_peerstore_api_watch.c */
return ok;
}
+
/* end of test_plugin_peerstore.c */
GNUNET_free (db);
}
+
/* end of pq/pq_connect.c */
};
-
/**
* State we keep for a request that is going out via CADET.
*/
avoid a prohibitively negative score (see
#get_channel_weight(), which checks for a certain
minimum number of transmissions before making
- up an opinion) */
- exit->num_transmitted = 5;
+ up an opinion) */exit->num_transmitted = 5;
exit->num_answered = 0;
dns_exit_available--;
/* now try to open an alternative exit */
}
-
/**
* Open '/dev/null' and make the result the given
* file descriptor.
}
-
/**
* Method called to inform about the egos of this peer.
*
return global_ret;
}
+
/* end of test_gns_vpn.c */
return global_ret;
}
+
/* end of test_gnunet_vpn.c */
return NULL;
}
+
/* end of plugin_reclaim_attribute_type_gnuid.c */
return attr;
}
+
/* end of reclaim_attribute.c */
GNUNET_free (attr_to_delete);
}
+
static void
ticket_issue_cb (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
{
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
+
static void
store_attr_cont (void *cls, int32_t success, const char *emsg)
{
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
+
static void
process_attrs (void *cls,
const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
GNUNET_free (id);
}
+
static void
ticket_iter_err (void *cls)
{
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
+
static void
ticket_iter_fin (void *cls)
{
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
+
static void
ticket_iter (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
{
GNUNET_RECLAIM_ticket_iteration_next (ticket_iterator);
}
+
static void
iter_error (void *cls)
{
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
+
static void
timeout_task (void *cls)
{
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
+
static void
process_rvk (void *cls, int success, const char *msg)
{
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
+
static void
iter_cb (void *cls,
const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
GNUNET_RECLAIM_get_attributes_next (attr_iterator);
}
+
static void
start_process ()
{
NULL);
}
+
static int init = GNUNET_YES;
static void
}
-
/**********************************************************
* Revocation
**********************************************************/
GNUNET_SERVICE_client_continue (idp->client);
}
+
/*****************************************
* Attribute store
*****************************************/
GNUNET_free (ai);
}
+
/**
* Error iterating over attributes. Abort.
*
GNUNET_SERVICE_client_continue (idp->client);
}
+
/******************************************************
* Ticket iteration
******************************************************/
static struct GNUNET_STATISTICS_Handle *stats;
-
/**
* Cleanup revoke handle
*
GNUNET_free (label);
}
+
/*************************************************
* Ticket iteration (finding a specific ticket)
*************************************************/
* If we found a matching ticket, return that to the caller and
* we are done.
*/
- if ((attr_cnt == found_attrs_cnt)&&(NULL != ticket))
+ if ((attr_cnt == found_attrs_cnt) && (NULL != ticket))
{
GNUNET_NAMESTORE_zone_iteration_stop (tih->ns_it);
tih->cb (tih->cb_cls, &tih->ticket, GNUNET_OK, NULL);
return GNUNET_OK;
}
+
/**
* Cleanup data left from parsing RSA public key.
*
}
}
+
/**
* JSON Specification for Reclaim claims.
*
*attr = NULL;
return ret;
}
+
+
/**
* Parse given JSON object to a ticket
*
return GNUNET_OK;
}
+
/**
* Cleanup data left from parsing RSA public key.
*
}
}
+
/**
* JSON Specification for Reclaim tickets.
*
return json_str;
}
+
static void
replace_char (char *str, char find, char replace)
{
}
}
+
// RFC4648
static void
fix_base64 (char *str)
replace_char (str, '/', '_');
}
+
/**
* Create a JWT from attributes
*
return result;
}
+
/* Converts a hex character to its integer value */
static char
from_hex (char ch)
return isdigit (ch) ? ch - '0' : tolower (ch) - 'a' + 10;
}
+
/* Converts an integer value to its hex character*/
static char
to_hex (char code)
return hex[code & 15];
}
+
/* Returns a url-encoded version of str */
/* IMPORTANT: be sure to free() the returned string after use */
static char *
return buf;
}
+
/**
* Returns base64 encoded string urlencoded
*
GNUNET_CRYPTO_symmetric_encrypt (payload, payload_len, &key, &iv, buf));
}
+
/**
* Builds an OIDC authorization code including
* a reclaim ticket and nonce
// Assign nonce
nonce = 0;
payload_len = sizeof(struct OIDC_Parameters);
- if ((NULL != nonce_str)&& (strcmp ("", nonce_str) != 0))
+ if ((NULL != nonce_str) && (strcmp ("", nonce_str) != 0))
{
if ((1 != sscanf (nonce_str, "%u", &nonce)) || (nonce > UINT32_MAX))
{
json_decref (root_json);
}
+
/**
* Generate a new access token
*/
const char *id_token,
const struct GNUNET_TIME_Relative *expiration_time,
char **token_response);
+
/**
* Generate a new access token
*/
return NULL;
}
+
/* end of plugin_gnsrecord_dns.c */
GNUNET_free (handle);
}
+
static void
cleanup_handle_delayed (void *cls)
{
GNUNET_free (redirect);
}
+
/**
* Task run on timeout, sends error message. Cleans up everything.
*
do_error (handle);
}
+
/**
* Return attributes for claim
*
GNUNET_free (cookies);
}
+
/**
* Redirects to login page stored in configuration file
*/
GNUNET_SCHEDULER_add_now (&cleanup_handle_delayed, handle);
}
+
/**
* Does internal server error when iteration failed.
*/
GNUNET_free (code_string);
}
+
static void
oidc_collect_finished_cb (void *cls)
{
handle);
}
+
static char *
get_url_parameter_copy (const struct RequestHandle *handle, const char *key)
{
GNUNET_SCHEDULER_add_now (&client_redirect, handle);
}
+
/**
* Iterate over tlds in config
*/
handle->tld = GNUNET_strdup (option + 1);
}
+
/**
* Responds to authorization GET and url-encoded POST request
*
GNUNET_SCHEDULER_add_now (&build_authz_response, handle);
}
+
/**
* Combines an identity with a login time and responds OK to login request
*
GNUNET_SCHEDULER_add_now (&cleanup_handle_delayed, handle);
}
+
static int
check_authorization (struct RequestHandle *handle,
struct GNUNET_CRYPTO_EcdsaPublicKey *cid)
return GNUNET_OK;
}
+
const struct EgoEntry *
find_ego (struct RequestHandle *handle,
struct GNUNET_CRYPTO_EcdsaPublicKey *test_key)
return NULL;
}
+
static void
persist_access_token (const struct RequestHandle *handle,
const char *access_token,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
}
+
/**
* Responds to token url-encoded POST request
*
GNUNET_SCHEDULER_add_now (&cleanup_handle_delayed, handle);
}
+
/**
* Collects claims and stores them in handle
*/
GNUNET_free (tmp_value);
}
+
/**
* Responds to userinfo GET and url-encoded POST request
*
}
}
+
/**
* If listing is enabled, prints information about the egos.
*
}
}
+
static void
rest_identity_process_request (struct GNUNET_REST_RequestHandle *rest_handle,
GNUNET_REST_ResultProcessor proc,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected\n");
}
+
/**
* Entry point for the plugin.
*
return NULL;
}
+
/* end of plugin_rest_openid_connect.c */
GNUNET_free (handle);
}
+
static void
cleanup_handle_delayed (void *cls)
{
do_error (handle);
}
+
static void
finished_cont (void *cls, int32_t success, const char *emsg)
{
cleanup_handle (handle);
}
+
static void
collect_finished_cb (void *cls)
{
GNUNET_JSON_parse_free (tktspec);
}
+
static void
consume_cont (void *cls,
const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
GNUNET_free (val_str);
}
+
static void
consume_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
const char *url,
return;
}
+
/**
* Handle rest request
*
}
}
+
/**
* If listing is enabled, prints information about the egos.
*
}
}
+
static void
rest_identity_process_request (struct GNUNET_REST_RequestHandle *rest_handle,
GNUNET_REST_ResultProcessor proc,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected\n");
}
+
/**
* Entry point for the plugin.
*
return NULL;
}
+
/* end of plugin_rest_reclaim.c */
GNUNET_free (it);
}
+
/**
* Free @a op
*
GNUNET_free (h);
}
+
/**
* Store an attribute. If the attribute is already present,
* it is replaced with the new attribute.
static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
-
/**
* Task run during shutdown.
*
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Announcing regex: %s\n", regex);
GNUNET_STATISTICS_update (stats_handle, "# regexes announced", 1, GNUNET_NO);
- if ((NULL == announce_handle)&&(NULL != regex))
+ if ((NULL == announce_handle) && (NULL != regex))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"First time, creating regex: %s\n",
{
char *copy;
- if ((NULL == regex)||(0 == strlen (regex)))
+ if ((NULL == regex) || (0 == strlen (regex)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot announce empty regex\n");
return;
/**
* MINIMIZE heap size (way below 128k) since this process doesn't need much.
*/
-void __attribute__ ((constructor)) GNUNET_ARM_memory_init ()
+void __attribute__ ((constructor))
+GNUNET_ARM_memory_init ()
{
mallopt (M_TRIM_THRESHOLD, 4 * 1024);
mallopt (M_TOP_PAD, 1 * 1024);
malloc_trim (0);
}
+
+
#endif
{
peer = &peers[peer_cnt];
- if ((GNUNET_YES != peer->search_str_matched) &&(NULL != data_file) )
+ if ((GNUNET_YES != peer->search_str_matched) && (NULL != data_file) )
{
prof_time = GNUNET_TIME_absolute_get_duration (peer->prof_start_time);
size =
{
struct RegexPeer *peer = cls;
- if ((NULL == ca_result)||(NULL != emsg))
+ if ((NULL == ca_result) || (NULL != emsg))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to connect to statistics service on peer %u: %s\n",
{
struct RegexPeer *peer = (struct RegexPeer *) cls;
- if ((NULL != emsg)||(NULL == op)||(NULL == ca_result))
+ if ((NULL != emsg) || (NULL == op) || (NULL == ca_result))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "DHT connect failed: %s\n", emsg);
GNUNET_assert (0);
GNUNET_SCHEDULER_add_delayed (search_timeout_time, &search_timed_out, NULL);
}
+
/**
* Function that will be called whenever something in the testbed changes.
*
GNUNET_SCHEDULER_shutdown ();
}
+
/**
* Iterator over all states that inserts each state into the MySQL db.
*
return;
}
- if ((-1 != total) &&(total > 0) )
+ if ((-1 != total) && (total > 0) )
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Total: %llu (%s, %s)\n",
(unsigned long long) total,
num_merged_states++;
}
- if ((GNUNET_SYSERR == result) || ((1 != result) &&(0 != result) ))
+ if ((GNUNET_SYSERR == result) || ((1 != result) && (0 != result) ))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Error executing prepared mysql statement for edge: Affected rows: %i, expected 0 or 1!\n",
stmt_handle,
params_stmt);
- if ((1 != result) &&(0 != result) )
+ if ((1 != result) && (0 != result) )
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Error executing prepared mysql statement for edge: Affected rows: %i, expected 0 or 1!\n",
return 0;
}
+
/* end of prof-regex.c */
return NULL;
}
+
/* end of plugin_block_regex.c */
};
-
/**
* (Re)connect to the REGEX service with the given announcement @a a.
*
GNUNET_free (a);
}
+
/* end of regex_api_announce.c */
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- if ((NULL != query)&&
+ if ((NULL != query) &&
(0 != GNUNET_memcmp (&key,
query)) )
{
/* Do not add duplicate state transitions */
for (t = from_state->transitions_head; NULL != t; t = t->next)
{
- if ((t->to_state == to_state) &&(0 == nullstrcmp (t->label, label)) &&
+ if ((t->to_state == to_state) && (0 == nullstrcmp (t->label, label)) &&
(t->from_state == from_state) )
return;
}
state_remove_transition (struct REGEX_INTERNAL_State *state,
struct REGEX_INTERNAL_Transition *transition)
{
- if ((NULL == state)||(NULL == transition))
+ if ((NULL == state) || (NULL == transition))
return;
if (transition->from_state != state)
int result;
unsigned int i;
- if ((NULL == sset1)||(NULL == sset2))
+ if ((NULL == sset1) || (NULL == sset2))
return 1;
result = sset1->off - sset2->off;
struct REGEX_INTERNAL_Transition *t_check;
struct REGEX_INTERNAL_Transition *t_check_next;
- if ((NULL == a)||(NULL == s))
+ if ((NULL == a) || (NULL == s))
return;
/* remove all transitions leading to this state */
is_dup = GNUNET_NO;
for (t = t_check->from_state->transitions_head; NULL != t; t = t->next)
{
- if ((t->to_state == s1) &&(0 == strcmp (t_check->label, t->label)) )
+ if ((t->to_state == s1) && (0 == strcmp (t_check->label, t->label)) )
is_dup = GNUNET_YES;
}
if (GNUNET_NO == is_dup)
for (t = s->transitions_head; NULL != t; t = t->next)
{
if ((NULL == check) ||
- ((NULL != check) &&(GNUNET_YES == check (check_cls, s, t)) ))
+ ((NULL != check) && (GNUNET_YES == check (check_cls, s, t)) ))
{
automaton_state_traverse (t->to_state,
marks,
unsigned int count;
struct REGEX_INTERNAL_State *s;
- if ((NULL == a)||(0 == a->state_count))
+ if ((NULL == a) || (0 == a->state_count))
return;
int marks[a->state_count];
* R_cur_ij = R_cur_l | R_cur_r
* R_cur_l == R^{(k-1)}_{ij}
* R_cur_r == R^{(k-1)}_{ik} ( R^{(k-1)}_{kk} )^* R^{(k-1)}_{kj}
- */
-
- if ((GNUNET_YES == R_last_ij->null_flag) &&
+ */if ((GNUNET_YES == R_last_ij->null_flag) &&
((GNUNET_YES == R_last_ik->null_flag) ||
(GNUNET_YES == R_last_kj->null_flag)))
{
* (e|a)|(e|a)a*a = a*
* (e|a)|(e|a)a*(e|a) = a*
* (e|a)|(e|a)(e|a)*(e|a) = a*
- */
- if (GNUNET_YES == needs_parentheses (&R_temp_ij))
+ */if (GNUNET_YES == needs_parentheses (&R_temp_ij))
sb_printf1 (R_cur_r, "(%.*s)*", 3, &R_temp_ij);
else
sb_printf1 (R_cur_r, "%.*s*", 1, &R_temp_ij);
* a|aa*(e|a) = a+
* a|(e|a)(e|a)*a = a+
* a|a(e|a)*(e|a) = a+
- */
- if (GNUNET_YES == needs_parentheses (&R_temp_ij))
+ */if (GNUNET_YES == needs_parentheses (&R_temp_ij))
sb_printf1 (R_cur_r, "(%.*s)+", 3, &R_temp_ij);
else
sb_printf1 (R_cur_r, "%.*s+", 1, &R_temp_ij);
* aa*(e|a) = a+
* a(e|a)*(e|a) = a+
* (e|a)a*a = a+
- */
- else
+ */else
{
eps_check = (has_epsilon (R_last_ik) + has_epsilon (R_last_kk)
+ has_epsilon (R_last_kj));
dead = 1;
for (t = s->transitions_head; NULL != t; t = t->next)
{
- if ((NULL != t->to_state) &&(t->to_state != s) )
+ if ((NULL != t->to_state) && (t->to_state != s) )
{
dead = 0;
break;
struct REGEX_INTERNAL_Transition *t;
struct REGEX_INTERNAL_Transition *t_next;
- if ((1 > stride_len)||(GNUNET_YES == dfa->is_multistrided))
+ if ((1 > stride_len) || (GNUNET_YES == dfa->is_multistrided))
return;
/* Compute the new transitions of given stride_len */
dfa->is_multistrided = GNUNET_YES;
}
+
/**
* Recursive Helper function for DFA path compression. Does DFS on the DFA graph
* and adds new transitions to the given transitions DLL and marks states that
char *new_label;
- if ((NULL != label)&&
- (((cur->incoming_transition_count > 1)||(GNUNET_YES == cur->accepting)||
+ if ((NULL != label) &&
+ (((cur->incoming_transition_count > 1) || (GNUNET_YES ==
+ cur->accepting) ||
(GNUNET_YES == cur->marked) ) ||
- ((start != dfa->start)&&(max_len > 0)&&(max_len == strlen (label))) ||
- ((start == dfa->start)&&(GNUNET_REGEX_INITIAL_BYTES == strlen (label)))))
+ ((start != dfa->start) && (max_len > 0) && (max_len == strlen (
+ label))) ||
+ ((start == dfa->start) && (GNUNET_REGEX_INITIAL_BYTES == strlen (
+ label)))))
{
t = GNUNET_new (struct REGEX_INTERNAL_Transition);
t->label = GNUNET_strdup (label);
else if (cur != start)
cur->contained = GNUNET_YES;
- if ((GNUNET_YES == cur->marked)&&(cur != start))
+ if ((GNUNET_YES == cur->marked) && (cur != start))
return;
cur->marked = GNUNET_YES;
n->end = NULL;
n->state_count = 0;
- if ((NULL == start)||(NULL == end))
+ if ((NULL == start) || (NULL == end))
return n;
automaton_add_state (n, end);
{
struct REGEX_INTERNAL_State *s;
- if ((NULL == n)||(NULL == states_head))
+ if ((NULL == n) || (NULL == states_head))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not add states\n");
return;
int atomcount;
} *p;
- if ((NULL == regex)||(0 == strlen (regex))||(0 == len))
+ if ((NULL == regex) || (0 == strlen (regex)) || (0 == len))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Could not parse regex. Empty regex string provided.\n");
for (ctran = dfa_state->transitions_head; NULL != ctran; ctran = ctran->next)
{
- if ((NULL == ctran->label) ||(NULL != ctran->to_state) )
+ if ((NULL == ctran->label) || (NULL != ctran->to_state) )
continue;
nfa_closure_set_create (&tmp, nfa, &dfa_state->nfa_set, ctran->label);
s = a->start;
/* If the string is empty but the starting state is accepting, we accept. */
- if (((NULL == string)||(0 == strlen (string))) && s->accepting)
+ if (((NULL == string) || (0 == strlen (string))) && s->accepting)
return 0;
for (strp = string; NULL != strp && *strp; strp += step_len)
break;
}
- if ((NULL != s)&& s->accepting)
+ if ((NULL != s) && s->accepting)
return 0;
return 1;
}
/* If the string is empty but the starting state is accepting, we accept. */
- if (((NULL == string)||(0 == strlen (string))) && a->start->accepting)
+ if (((NULL == string) || (0 == strlen (string))) && a->start->accepting)
return 0;
result = 1;
/* already visited and marked */
return GNUNET_YES;
- if ((GNUNET_REGEX_INITIAL_BYTES > strlen (state->proof))&&
+ if ((GNUNET_REGEX_INITIAL_BYTES > strlen (state->proof)) &&
(GNUNET_NO == state->accepting) )
/* not directly reachable */
return GNUNET_YES;
return GNUNET_YES;
}
+
/**
* Iterate over all edges of automaton 'a' that are reachable from a state with
* a proof of at least GNUNET_REGEX_INITIAL_BYTES characters.
const unsigned int stride_len);
-
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
void *iterator_cls);
-
/**
* Handle to store cached data about a regex announce.
*/
return;
}
- if ((NULL == filename)||(strlen (filename) < 1))
+ if ((NULL == filename) || (strlen (filename) < 1))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No Filename given!");
return;
break;
case 16:
- if ((c >= '0') &&(c <= '9') )
+ if ((c >= '0') && (c <= '9') )
return c - '0';
- else if ((c >= 'A') &&(c <= 'F') )
+ else if ((c >= 'A') && (c <= 'F') )
return c - 'A' + 10;
- else if ((c >= 'a') &&(c <= 'f') )
+ else if ((c >= 'a') && (c <= 'f') )
return c - 'a' + 10;
else
{
return best;
}
+
static void
regex_add_multiple (struct RegexCombineCtx *ctx,
const char *regex,
count = 0;
for (i = 1UL; i < l; i++)
{
- if ((regex[i] != '|') &&(regex[i] != ')') )
+ if ((regex[i] != '|') && (regex[i] != ')') )
{
count++;
}
tmp[1] = '\0';
for (i = 1UL; i < l; i++)
{
- if ((regex[i] != '|') &&(regex[i] != ')') )
+ if ((regex[i] != '|') && (regex[i] != ')') )
{
tmp[0] = regex[i];
newctx = new_regex_ctx (ctx->size);
}
}
+
/**
* Add a single regex to a context, splitting the exisiting state.
*
/* There is no prefix match, add new */
idx = c2i (regex[0], ctx->size);
- if ((NULL == ctx->children[idx])&&(NULL != ctx->s))
+ if ((NULL == ctx->children[idx]) && (NULL != ctx->s))
{
/* this was the end before, add empty string */
newctx = new_regex_ctx (ctx->size);
GNUNET_free (regexes);
}
+
/* end of regex_test_lib.c */
enum REGEX_TEST_GraphSavingOptions options);
-
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
}
if ((NULL != matching_strp) &&
- ((current_char != '+') &&(current_char != '*') &&(current_char !=
- '?') &&
+ ((current_char != '+') && (current_char != '*') && (current_char !=
+ '?') &&
(current_char != '|') ))
{
*matching_strp = current_char;
return ok;
}
+
/* end of test_regex_api.c */
/* We only want to match the whole string, because that's what our DFA does,
* too. */
if ((eval_check == 0) &&
- ((matchptr[0].rm_so != 0) ||(matchptr[0].rm_eo != strlen (
- matching_str)) ))
+ ((matchptr[0].rm_so != 0) || (matchptr[0].rm_eo != strlen (
+ matching_str)) ))
eval_check = 1;
/* Match canonical regex */
/* We only want to match the whole string, because that's what our DFA does,
* too. */
if ((eval_canonical_check == 0) &&
- ((matchptr[0].rm_so != 0) ||(matchptr[0].rm_eo != strlen (
- matching_str)) ))
+ ((matchptr[0].rm_so != 0) || (matchptr[0].rm_eo != strlen (
+ matching_str)) ))
eval_canonical_check = 1;
/* compare results */
- if ((eval_check != eval) ||(eval_canonical != eval_canonical_check) )
+ if ((eval_check != eval) || (eval_canonical != eval_canonical_check) )
{
regerror (eval_check, &rx, error, sizeof error);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
return -1;
}
+
/**
* Automaton test that compares the result of matching regular expression 'rx'
* with the strings and expected results in 'rxstr' with the result of matching
(matchptr[0].rm_eo != strlen (rxstr->strings[i])) ))
eval_check = 1;
- if (((rxstr->expected_results[i] == match) && ((0 != eval) ||(0 !=
- eval_check) ))
+ if (((rxstr->expected_results[i] == match) && ((0 != eval) || (0 !=
+ eval_check) ))
|| ((rxstr->expected_results[i] == nomatch) &&
- ((0 == eval) ||(0 == eval_check) )))
+ ((0 == eval) || (0 == eval_check) )))
{
result = 1;
regerror (eval_check, rx, error, sizeof error);
return result;
}
+
int
main (int argc, char *argv[])
{
return ok;
}
+
/* end of test_regex_integration.c */
httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd, NULL);
}
+
/**
* Plugin result callback
*
GNUNET_free (handle);
}
+
static int
header_iterator (void *cls,
enum MHD_ValueKind kind,
return MHD_YES;
}
+
static int
post_data_iter (void *cls,
enum MHD_ValueKind kind,
return MHD_YES;
}
+
/* ********************************* MHD response generation ******************* */
/**
GNUNET_NETWORK_fdset_destroy (wws);
}
+
/**
* Task run whenever HTTP server operations are pending.
*
return ret;
}
+
/* end of gnunet-rest-server.c */
json_object_set_new (sections_obj, section, sec_obj);
}
+
static void
add_section_contents (void *cls,
const char *section,
json_object_set_new (section_obj, option, json_string (value));
}
+
/**
* Handle rest request
*
json_decref (result);
}
+
struct GNUNET_CONFIGURATION_Handle *
set_value (struct GNUNET_CONFIGURATION_Handle *config,
const char *section,
return config; // for error handling (0 -> success, 1 -> error)
}
+
/**
* Handle REST POST request
*
cleanup_handle (handle);
}
+
/**
* Handle rest request
*
return NULL;
}
+
/* end of plugin_rest_config.c */
}
-
/**
* Handle rest request
*
return NULL;
}
+
/* end of plugin_rest_copying.c */
return 0 == strncmp (namespace, url, strlen (namespace));
}
+
/**
* Create MHD response
*
return resp;
}
+
int
GNUNET_REST_handle_request (struct GNUNET_REST_RequestHandle *conn,
const struct GNUNET_REST_RequestHandler *handlers,
return GNUNET_NO;
}
+
/* end of rest.c */
return ret;
}
+
/* end of gnunet-revocation.c */
malloc_trim (0);
}
+
#endif
return NULL;
}
+
/* end of plugin_block_revocation.c */
GNUNET_NETWORK_STRUCT_END
-
#endif
return ok;
}
+
/* end of test_revocation.c */
*
* @return corresponding enum
*/
-enum STAT_TYPE stat_str_2_type (const char *stat_str)
+enum STAT_TYPE
+stat_str_2_type (const char *stat_str)
{
if (0 == strncmp (stat_type_strings[STAT_TYPE_BLOCKS_NO_PULL],
stat_str,
"Failed to write string to buffer (size: %i)\n",
size);
return;
- } */
-
- size = strlen (line) * sizeof(char);
+ } */size = strlen (line) * sizeof(char);
size2 = GNUNET_DISK_file_write (f, line, size);
if (size != size2)
}
}
+
/**
* This function is used to facilitate writing important information to disk
*/
* @return #GNUNET_YES if so
* #GNUNET_NO otherwise
*/
-static int check_statistics_collect_completed_single_peer (
+static int
+check_statistics_collect_completed_single_peer (
const struct RPSPeer *rps_peer)
{
if (cur_test_run.stat_collect_flags !=
}
return GNUNET_YES;
}
+
+
/**
* @brief Checks if all peers already received their statistics value from the
* statistics service.
* @return #GNUNET_YES if so
* #GNUNET_NO otherwise
*/
-static int check_statistics_collect_completed ()
+static int
+check_statistics_collect_completed ()
{
uint32_t i;
return GNUNET_YES;
}
+
static void
rps_disconnect_adapter (void *cls,
void *op_result);
GNUNET_free (pending_req);
}
+
static void
cancel_request (struct PendingReply *pending_rep)
{
pending_rep = NULL;
}
+
void
clean_peer (unsigned peer_index)
{
}
}
+
/**
* Task run on timeout to shut everything down.
*/
close_all_files ();
}
+
static void
trigger_shutdown (void *cls)
{
}
}
/* If we do not collect statistics, shut down directly */
- if ((NO_COLLECT_STATISTICS == cur_test_run.have_collect_statistics)||
+ if ((NO_COLLECT_STATISTICS == cur_test_run.have_collect_statistics) ||
(GNUNET_YES == check_statistics_collect_completed ()) )
{
GNUNET_SCHEDULER_cancel (shutdown_task);
(void) op;
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
- if ((NULL == pinfo)||(NULL != emsg))
+ if ((NULL == pinfo) || (NULL != emsg))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Got Error: %s\n", emsg);
GNUNET_TESTBED_operation_done (entry->op);
struct RPSPeer *rps_peer = cls;
struct GNUNET_RPS_Handle *rps = ca_result;
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
return h;
}
+
/**
* Called to open a connection to the peer's statistics
*
return peer->stats_h;
}
+
/**
* Called to disconnect from peer's statistics service
*
peer->stats_h = NULL;
}
+
/**
* Called after successfully opening a connection to a peer's statistics
* service; we register statistics monitoring for CORE and NSE here.
rps_peer->pending_req_tail,
pending_req);
rps_peer->num_pending_reqs--;
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
return;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Requesting one peer\n");
}
}
+
void
cancel_pending_req_rep (struct RPSPeer *rps_peer)
{
GNUNET_assert (0 == rps_peer->num_pending_reps);
}
+
/***********************************
* MALICIOUS
***********************************/
/**
* Initialise only non-mal RPSPeers
*/
-static void mal_init_peer (struct RPSPeer *rps_peer)
+static void
+mal_init_peer (struct RPSPeer *rps_peer)
{
if (rps_peer->index >= round (portion * num_peers))
rps_peer->num_ids_to_request = 1;
#endif /* ENABLE_MALICIOUS */
}
+
static void
mal_cb (struct RPSPeer *rps_peer)
{
uint32_t num_mal_peers;
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
#endif /* ENABLE_MALICIOUS */
}
+
/***********************************
* CHURN
***********************************/
static void
churn_test_cb (struct RPSPeer *rps_peer)
{
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
/* Start churn */
- if ((HAVE_CHURN == cur_test_run.have_churn)&&(NULL == churn_task))
+ if ((HAVE_CHURN == cur_test_run.have_churn) && (NULL == churn_task))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting churn task\n");
schedule_missing_requests (rps_peer);
}
+
/***********************************
* PROFILER
***********************************/
(void) op;
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
// run_round ();
}
+
/**
* @brief Set the rps-service up or down for a specific peer
*
(void) cls;
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
/**
* Initialise given RPSPeer
*/
-static void profiler_init_peer (struct RPSPeer *rps_peer)
+static void
+profiler_init_peer (struct RPSPeer *rps_peer)
{
rps_peer->num_ids_to_request = cur_test_run.num_requests;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "peer shall request %i peers\n",
static void
profiler_cb (struct RPSPeer *rps_peer)
{
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
/* Start churn */
- if ((HAVE_CHURN == cur_test_run.have_churn)&&(NULL == churn_task))
+ if ((HAVE_CHURN == cur_test_run.have_churn) && (NULL == churn_task))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting churn task\n");
schedule_missing_requests (rps_peer);
}
+
/**
* Function called from #profiler_eval with a filename.
*
return GNUNET_OK;
}
+
/**
* This is run after the test finished.
*
*
* @return
*/
-static int is_in_view (uint32_t a, uint32_t b)
+static int
+is_in_view (uint32_t a, uint32_t b)
{
uint32_t i;
return GNUNET_NO;
}
-static uint32_t get_idx_of_pid (const struct GNUNET_PeerIdentity *pid)
+
+static uint32_t
+get_idx_of_pid (const struct GNUNET_PeerIdentity *pid)
{
uint32_t i;
GNUNET_assert (0);
}
+
/**
* @brief Counts number of peers in view of a that have b in their view
*
*
* @return
*/
-static uint32_t count_containing_views (uint32_t a, uint32_t b)
+static uint32_t
+count_containing_views (uint32_t a, uint32_t b)
{
uint32_t i;
uint32_t peer_idx;
return count;
}
+
/**
* @brief Computes the probability for each other peer to be selected by the
* sampling process based on the views of all peers
*
* @param peer_idx index of the peer that is about to sample
*/
-static void compute_probabilities (uint32_t peer_idx)
+static void
+compute_probabilities (uint32_t peer_idx)
{
// double probs[num_peers] = { 0 };
double probs[num_peers];
GNUNET_free (probs_as_str);
}
+
/**
* @brief This counts the number of peers in which views a given peer occurs.
*
*
* @return the number of occurrences
*/
-static uint32_t count_peer_in_views_2 (uint32_t peer_idx)
+static uint32_t
+count_peer_in_views_2 (uint32_t peer_idx)
{
uint32_t i, j;
uint32_t count = 0;
return count;
}
-static uint32_t cumulated_view_sizes ()
+
+static uint32_t
+cumulated_view_sizes ()
{
uint32_t i;
return view_sizes;
}
-static void count_peer_in_views (uint32_t *count_peers)
+
+static void
+count_peer_in_views (uint32_t *count_peers)
{
uint32_t i, j;
}
}
-void compute_diversity ()
+
+void
+compute_diversity ()
{
uint32_t i;
/* ith entry represents the numer of occurrences in other peer's views */
GNUNET_free (deviation);
}
-void print_view_sizes ()
+
+void
+print_view_sizes ()
{
uint32_t i;
}
}
-void all_views_updated_cb ()
+
+void
+all_views_updated_cb ()
{
compute_diversity ();
print_view_sizes ();
}
-void view_update_cb (void *cls,
- uint64_t view_size,
- const struct GNUNET_PeerIdentity *peers)
+
+void
+view_update_cb (void *cls,
+ uint64_t view_size,
+ const struct GNUNET_PeerIdentity *peers)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"View was updated (%" PRIu64 ")\n", view_size);
all_views_updated_cb ();
}
+
static void
pre_profiler (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h)
{
GNUNET_RPS_view_request (h, 0, view_update_cb, rps_peer);
}
-void write_final_stats (void)
+
+void
+write_final_stats (void)
{
uint64_t sums[STAT_TYPE_MAX] = { 0 };
sums[STAT_TYPE_VIEW_SIZE_AIM]);
}
+
/**
* Continuation called by #GNUNET_STATISTICS_get() functions.
*
return;
}
- if ((NULL != rps_peer->stat_op)&&
+ if ((NULL != rps_peer->stat_op) &&
(GNUNET_YES == check_statistics_collect_completed_single_peer (
rps_peer)) )
{
}
}
+
/**
* Callback function to process statistic values.
*
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "RUN was called\n");
/* Check whether we timed out */
- if ((n_peers != num_peers)||
+ if ((n_peers != num_peers) ||
(NULL == peers) ||
(0 == links_succeeded) )
{
NULL);
}
+
/**
* Entry point for the testcase, sets up the testbed.
*
return ret_value;
}
+
/* end of test_rps.c */
GNUNET_SCHEDULER_shutdown ();
}
+
/**
* Callback called on receipt view update.
* Prints view.
}
}
+
/**
* The main function to rps.
*
options, &run, NULL)) ? ret : 1;
}
+
/* end of gnunet-rps.c */
#define unset_channel_flag(channel_flags, mask) ((*channel_flags) &= ~(mask))
-
/**
* Pending operation on peer consisting of callback and closure
*
return ctx;
}
+
/**
* @brief Check whether we have information about the given peer.
*
return ret;
}
+
static void
remove_pending_message (struct PendingMessage *pending_msg, int cancel);
GNUNET_array_grow (peer_ctx->pending_ops, peer_ctx->num_pending_ops, 0);
}
+
static void
cleanup_destroyed_channel (void *cls,
const struct GNUNET_CADET_Channel *channel);
return peer_ctx->mq;
}
+
/**
* @brief Add an envelope to a message passed to mq to list of pending messages
*
}
}
+
/**
* Issue a check whether peer is online
*
return check_peer_flag_set (peer_ctx, flags);
}
+
/**
* @brief Try connecting to a peer to see whether it is online
*
return GNUNET_NO;
}
+
/**
* @brief Send a message to another peer.
*
GNUNET_MQ_send (mq, ev);
}
+
/**
* @brief Schedule a operation on given peer
*
return GNUNET_NO;
}
+
/***********************************************************************
* /Old gnunet-service-rps_peers.c
***********************************************************************/
***********************************************************************/
-
-
-
/***********************************************************************
* Util functions
***********************************************************************/
cli_ctx_iter = cli_ctx_iter->next)
{
if ((GNUNET_YES == cli_ctx_iter->stream_update) &&
- ((sub == cli_ctx_iter->sub) ||(sub == msub) ))
+ ((sub == cli_ctx_iter->sub) || (sub == msub) ))
{
send_stream_peers (cli_ctx_iter, num_peers, peers);
}
channel_ctx->channel = NULL;
remove_channel_ctx (channel_ctx);
- if ((NULL != peer_ctx)&&
+ if ((NULL != peer_ctx) &&
(peer_ctx->send_channel_ctx == channel_ctx) &&
(GNUNET_YES == check_sending_channel_needed (channel_ctx->peer_ctx)) )
{
}
}
+
/***********************************************************************
* /Util functions
***********************************************************************/
-
/***********************************************************************
* Sub
***********************************************************************/
collect_str);
GNUNET_free (file_name_full);
}
+
+
#endif /* TO_FILE */
GNUNET_CONTAINER_multipeermap_remove_all (map_single_hop, peer);
}
+
/***********************************************************************
* /Core handlers
***********************************************************************/
struct ClientContext *cli_ctx = cls;
LOG (GNUNET_ERROR_TYPE_DEBUG, "Client requested start of a new sub.\n");
- if ((NULL != cli_ctx->sub)&&
+ if ((NULL != cli_ctx->sub) &&
(0 != memcmp (&cli_ctx->sub->hash,
&msg->hash,
sizeof(struct GNUNET_HashCode))) )
#if ENABLE_MALICIOUS
if ((1 == mal_type)
- ||(3 == mal_type))
+ || (3 == mal_type))
{ /* Try to maximise representation */
send_pull_reply (peer_ctx, mal_peers, num_mal_peers);
}
#if ENABLE_MALICIOUS
if ((NULL != att_peer_set) &&
- ((1 == mal_type) ||(3 == mal_type) ))
+ ((1 == mal_type) || (3 == mal_type) ))
{ /* Add attacked peer to local list */
// TODO check if we sent a request and this was the first reply
if ((GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (att_peer_set,
&peers[i]))
- &&(GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (mal_peer_set,
- &peers[i])) )
+ && (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (mal_peer_set,
+ &peers[i])) )
{
tmp_att_peer = GNUNET_new (struct AttackedPeer);
tmp_att_peer->peer_id = peers[i];
return GNUNET_OK;
}
+
/**
* Turn RPS service to act malicious.
*
&do_mal_round, sub);
LOG (GNUNET_ERROR_TYPE_DEBUG, "Finished round\n");
}
+
+
#endif /* ENABLE_MALICIOUS */
return cli_ctx;
}
+
/**
* Callback called when a client disconnected from the service
*
return c_peer_map;
}
+
/**
* Get the size of the custom peer map
*
return GNUNET_CONTAINER_multipeermap_size (c_peer_map->peer_map);
}
+
/**
* Insert peer into the custom peer map
*
return GNUNET_NO;
}
+
/**
* Check whether custom peer map contains a peer
*
return GNUNET_CONTAINER_multipeermap_contains (c_peer_map->peer_map, peer);
}
+
/**
* Get index of peer in custom peer map
*
return index;
}
+
/**
* Remove peer from custom peer map
*
return GNUNET_OK;
}
+
/**
* Get a peer by index
*
return NULL;
}
+
/**
* Remove peer from custom peer map by index
*
return GNUNET_OK;
}
+
/**
* Clear the custom peer map
*
GNUNET_assert (0 == CustomPeerMap_size (c_peer_map));
}
+
/**
* Destroy peermap.
*
GNUNET_free (c_peer_map);
}
+
/* end of gnunet-service-rps_custommap.c */
return sampler;
}
+
/**
* Get one random peer out of the sampled peers.
*
sampler_elem->is_empty = NOT_EMPTY;
}
+
/**
* Set the min-wise independent function of the given sampler element.
*
sampler_elem->auth_key = auth_key;
}
+
/* end of gnunet-service-rps.c */
GNUNET_free (view);
}
+
/* end of gnunet-service-rps_view.c */
for (i = 0; i < sampler->sampler_size; i++)
{
if ((0 == GNUNET_memcmp (&sampler->sampler_elements[i]->peer_id, id))
- &&(EMPTY != sampler->sampler_elements[i]->is_empty) )
+ && (EMPTY != sampler->sampler_elements[i]->is_empty) )
count++;
}
return count;
static struct GNUNET_CONTAINER_MultiHashMap *open_files;
-
/**
* @brief Get file handle
*
}
-
void
to_file_raw (const char *file_name, const char *buf, size_t size_buf)
{
"Unable to close file\n");
}
+
void
to_file_raw_unaligned (const char *file_name,
const char *buf,
LOG (GNUNET_ERROR_TYPE_DEBUG, "\n");
}
+
char *
auth_key_to_string (struct GNUNET_CRYPTO_AuthKey auth_key)
{
return name_buf;
}
+
#endif /* TO_FILE */
64,
"%u",
index);
- if ((64 < out_size)||
+ if ((64 < out_size) ||
(0 > out_size) )
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"/tmp/rps/%s-%s",
prefix,
index_str);
- if ((len_file_name < out_size)||
+ if ((len_file_name < out_size) ||
(0 > out_size) )
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
*
* @return Factorial of @a x
*/
-uint32_t fac (uint32_t x)
+uint32_t
+fac (uint32_t x)
{
if (1 >= x)
{
return x * fac (x - 1);
}
+
/**
* @brief Binomial coefficient (n choose k)
*
*
* @return Binomial coefficient of @a n and @a k
*/
-uint32_t binom (uint32_t n, uint32_t k)
+uint32_t
+binom (uint32_t n, uint32_t k)
{
// GNUNET_assert (n >= k);
if (k > n)
};
-
/***********************************************************************
* Client-Service Messages
***********************************************************************/
GNUNET_free (h);
return NULL;
}
- if ((0 > h->desired_probability)||
+ if ((0 > h->desired_probability) ||
(1 < h->desired_probability) )
{
LOG (GNUNET_ERROR_TYPE_ERROR,
GNUNET_free (h);
return NULL;
}
- if ((0 > h->desired_probability)||
+ if ((0 > h->desired_probability) ||
(1 < h->desired_probability) )
{
LOG (GNUNET_ERROR_TYPE_ERROR,
GNUNET_MQ_send (h->mq, ev);
}
+
+
#endif /* ENABLE_MALICIOUS */
"Failed to write string to buffer (size: %i)\n",
size);
return;
- } */
-
- size = strlen (line) * sizeof(char);
+ } */size = strlen (line) * sizeof(char);
size2 = GNUNET_DISK_file_write (f, line, size);
if (size != size2)
}
}
+
/**
* This function is used to facilitate writing important information to disk
*/
* @return #GNUNET_YES if so
* #GNUNET_NO otherwise
*/
-static int check_statistics_collect_completed_single_peer (
+static int
+check_statistics_collect_completed_single_peer (
const struct RPSPeer *rps_peer)
{
if (cur_test_run.stat_collect_flags !=
* @return #GNUNET_YES if so
* #GNUNET_NO otherwise
*/
-static int check_statistics_collect_completed ()
+static int
+check_statistics_collect_completed ()
{
uint32_t i;
}
}
/* If we do not collect statistics, shut down directly */
- if ((NO_COLLECT_STATISTICS == cur_test_run.have_collect_statistics)||
+ if ((NO_COLLECT_STATISTICS == cur_test_run.have_collect_statistics) ||
(GNUNET_YES == check_statistics_collect_completed ()) )
{
GNUNET_SCHEDULER_shutdown ();
unsigned int amount;
unsigned int i;
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
GNUNET_RPS_seed_ids (peer->rps_handle, amount, ids_to_seed);
}
+
/**
* Get the id of peer i.
*/
(void) op;
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
- if ((NULL == pinfo)||(NULL != emsg))
+ if ((NULL == pinfo) || (NULL != emsg))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Got Error: %s\n", emsg);
GNUNET_TESTBED_operation_done (entry->op);
GNUNET_assert (NULL != ca_result);
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
return h;
}
+
/**
* Called to open a connection to the peer's statistics
*
return peer->stats_h;
}
+
/**
* Called to disconnect from peer's statistics service
*
peer->stats_h = NULL;
}
+
/**
* Called after successfully opening a connection to a peer's statistics
* service; we register statistics monitoring for CORE and NSE here.
return evaluate ();
}
+
static int
no_eval (void)
{
return 0;
}
+
/**
* Initialise given RPSPeer
*/
-static void default_init_peer (struct RPSPeer *rps_peer)
+static void
+default_init_peer (struct RPSPeer *rps_peer)
{
rps_peer->num_ids_to_request = 1;
}
+
/**
* Callback to call on receipt of a reply
*
rps_peer->num_recv_ids++;
}
- if ((0 == evaluate ())&&(HAVE_QUICK_QUIT == cur_test_run.have_quick_quit))
+ if ((0 == evaluate ()) && (HAVE_QUICK_QUIT == cur_test_run.have_quick_quit))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test succeeded before timeout\n");
GNUNET_assert (NULL != post_test_task);
}
}
+
/**
* Request random peers.
*/
struct RPSPeer *rps_peer;
struct PendingReply *pending_rep;
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
return;
rps_peer = pending_req->rps_peer;
GNUNET_assert (1 <= rps_peer->num_pending_reqs);
rps_peer->num_pending_reqs--;
}
+
static void
cancel_pending_req (struct PendingRequest *pending_req)
{
GNUNET_free (pending_req);
}
+
static void
cancel_request (struct PendingReply *pending_rep)
{
GNUNET_free (pending_rep);
}
+
/**
* Cancel a request.
*/
struct RPSPeer *rps_peer = cls;
struct PendingReply *pending_rep;
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
return;
pending_rep = rps_peer->pending_rep_head;
GNUNET_assert (1 <= rps_peer->num_pending_reps);
}
}
+
void
cancel_pending_req_rep (struct RPSPeer *rps_peer)
{
GNUNET_assert (0 == rps_peer->num_pending_reps);
}
+
/***********************************
* MALICIOUS
***********************************/
/**
* Initialise only non-mal RPSPeers
*/
-static void mal_init_peer (struct RPSPeer *rps_peer)
+static void
+mal_init_peer (struct RPSPeer *rps_peer)
{
if (rps_peer->index >= round (portion * num_peers))
rps_peer->num_ids_to_request = 1;
#endif /* ENABLE_MALICIOUS */
}
+
static void
mal_cb (struct RPSPeer *rps_peer)
{
uint32_t num_mal_peers;
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
static void
single_req_cb (struct RPSPeer *rps_peer)
{
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
schedule_missing_requests (rps_peer);
}
+
/***********************************
* DELAYED_REQUESTS
***********************************/
static void
delay_req_cb (struct RPSPeer *rps_peer)
{
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
schedule_missing_requests (rps_peer);
}
+
/***********************************
* SEED
***********************************/
static void
seed_cb (struct RPSPeer *rps_peer)
{
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
seed_peers, rps_peer);
}
+
/***********************************
* SEED_BIG
***********************************/
static void
seed_big_cb (struct RPSPeer *rps_peer)
{
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
seed_peers_big, rps_peer);
}
+
/***********************************
* SINGLE_PEER_SEED
***********************************/
// TODO
}
+
/***********************************
* SEED_REQUEST
***********************************/
static void
seed_req_cb (struct RPSPeer *rps_peer)
{
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
schedule_missing_requests (rps_peer);
}
+
// TODO start big mal
/***********************************
static void
req_cancel_cb (struct RPSPeer *rps_peer)
{
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
cancel_request_cb, rps_peer);
}
+
/***********************************
* CHURN
***********************************/
static void
churn_test_cb (struct RPSPeer *rps_peer)
{
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
/* Start churn */
- if ((HAVE_CHURN == cur_test_run.have_churn)&&(NULL == churn_task))
+ if ((HAVE_CHURN == cur_test_run.have_churn) && (NULL == churn_task))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting churn task\n");
schedule_missing_requests (rps_peer);
}
+
/***********************************
* SUB
***********************************/
rps_peer);
}
+
/***********************************
* PROFILER
***********************************/
// FIXME
struct OpListEntry *entry = cls;
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
// run_round ();
}
+
/**
* @brief Set the rps-service up or down for a specific peer
*
double portion_go_online;
double portion_go_offline;
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
/**
* Initialise given RPSPeer
*/
-static void profiler_init_peer (struct RPSPeer *rps_peer)
+static void
+profiler_init_peer (struct RPSPeer *rps_peer)
{
if (num_peers - 1 == rps_peer->index)
rps_peer->num_ids_to_request = cur_test_run.num_requests;
static void
profiler_cb (struct RPSPeer *rps_peer)
{
- if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test))
+ if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
{
return;
}
/* Start churn */
- if ((HAVE_CHURN == cur_test_run.have_churn)&&(NULL == churn_task))
+ if ((HAVE_CHURN == cur_test_run.have_churn) && (NULL == churn_task))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting churn task\n");
schedule_missing_requests (rps_peer);
}
+
/**
* Function called from #profiler_eval with a filename.
*
return GNUNET_OK;
}
+
/**
* This is run after the test finished.
*
*
* @return
*/
-static int is_in_view (uint32_t a, uint32_t b)
+static int
+is_in_view (uint32_t a, uint32_t b)
{
uint32_t i;
return GNUNET_NO;
}
-static uint32_t get_idx_of_pid (const struct GNUNET_PeerIdentity *pid)
+
+static uint32_t
+get_idx_of_pid (const struct GNUNET_PeerIdentity *pid)
{
uint32_t i;
GNUNET_assert (0);
}
+
/**
* @brief Counts number of peers in view of a that have b in their view
*
*
* @return
*/
-static uint32_t count_containing_views (uint32_t a, uint32_t b)
+static uint32_t
+count_containing_views (uint32_t a, uint32_t b)
{
uint32_t i;
uint32_t peer_idx;
return count;
}
+
/**
* @brief Computes the probability for each other peer to be selected by the
* sampling process based on the views of all peers
*
* @param peer_idx index of the peer that is about to sample
*/
-static void compute_probabilities (uint32_t peer_idx)
+static void
+compute_probabilities (uint32_t peer_idx)
{
// double probs[num_peers] = { 0 };
double probs[num_peers];
GNUNET_free (probs_as_str);
}
+
/**
* @brief This counts the number of peers in which views a given peer occurs.
*
*
* @return the number of occurrences
*/
-static uint32_t count_peer_in_views_2 (uint32_t peer_idx)
+static uint32_t
+count_peer_in_views_2 (uint32_t peer_idx)
{
uint32_t i, j;
uint32_t count = 0;
return count;
}
-static uint32_t cumulated_view_sizes ()
+
+static uint32_t
+cumulated_view_sizes ()
{
uint32_t i;
return view_sizes;
}
-static void count_peer_in_views (uint32_t *count_peers)
+
+static void
+count_peer_in_views (uint32_t *count_peers)
{
uint32_t i, j;
}
}
-void compute_diversity ()
+
+void
+compute_diversity ()
{
uint32_t i;
/* ith entry represents the numer of occurrences in other peer's views */
GNUNET_free (deviation);
}
-void print_view_sizes ()
+
+void
+print_view_sizes ()
{
uint32_t i;
}
}
-void all_views_updated_cb ()
+
+void
+all_views_updated_cb ()
{
compute_diversity ();
print_view_sizes ();
}
-void view_update_cb (void *cls,
- uint64_t view_size,
- const struct GNUNET_PeerIdentity *peers)
+
+void
+view_update_cb (void *cls,
+ uint64_t view_size,
+ const struct GNUNET_PeerIdentity *peers)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"View was updated (%" PRIu64 ")\n", view_size);
all_views_updated_cb ();
}
+
static void
pre_profiler (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h)
{
GNUNET_RPS_view_request (h, 0, view_update_cb, rps_peer);
}
-void write_final_stats (void)
+
+void
+write_final_stats (void)
{
uint32_t i;
}
}
+
/**
* Continuation called by #GNUNET_STATISTICS_get() functions.
*
GNUNET_break (0);
}
- if ((NULL != rps_peer->stat_op)&&
+ if ((NULL != rps_peer->stat_op) &&
(GNUNET_YES == check_statistics_collect_completed_single_peer (
rps_peer)) )
{
}
}
+
/**
* @brief Converts string representation to the corresponding #STAT_TYPE enum.
*
*
* @return corresponding enum
*/
-enum STAT_TYPE stat_str_2_type (const char *stat_str)
+enum STAT_TYPE
+stat_str_2_type (const char *stat_str)
{
if (0 == strncmp ("# rounds blocked - no pull replies", stat_str, strlen (
"# rounds blocked - no pull replies")))
*
* @return string representation that matches statistics value
*/
-char*stat_type_2_str (enum STAT_TYPE stat_type)
+char*
+stat_type_2_str (enum STAT_TYPE stat_type)
{
switch (stat_type)
{
}
}
+
/**
* Callback function to process statistic values.
*
return GNUNET_OK;
}
-void post_profiler (struct RPSPeer *rps_peer)
+
+void
+post_profiler (struct RPSPeer *rps_peer)
{
if (COLLECT_STATISTICS != cur_test_run.have_collect_statistics)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "RUN was called\n");
/* Check whether we timed out */
- if ((n_peers != num_peers)||
+ if ((n_peers != num_peers) ||
(NULL == peers) ||
(0 == links_succeeded) )
{
return check ();
}
+
/* end of test_rps_api.c */
return check ();
}
+
/* end of test_service_rps_custommap.c */
return check ();
}
+
/* end of test_service_rps_peers.c */
return check ();
}
+
/* end of test_service_rps_view.c */
options, &run, NULL)) ? ret : 1;
}
+
/* end of gnunet-scalarproduct.c */
};
-
GNUNET_NETWORK_STRUCT_END
return GNUNET_OK;
}
+
/**
* Handle a multipart chunk of a response we got from another service
* we wanted to calculate a scalarproduct with.
};
-
/**
* GNUnet configuration handle
*/
e);
transmit_bobs_cryptodata_message_multipart (s);
}
+
+
#undef ELEMENT_CAPACITY
return 0;
}
+
/* end of test_ecc_scalarproduct.c */
* @param cls Plaintext
* @param plaintext Plaintext
*/
-static void decrypt_cb (void *cls,
- const struct GNUNET_SECRETSHARING_Plaintext *plaintext)
+static void
+decrypt_cb (void *cls,
+ const struct GNUNET_SECRETSHARING_Plaintext *plaintext)
{
struct GNUNET_SECRETSHARING_DecryptionHandle **dhp = cls;
unsigned int n = dhp - decrypt_handles;
}
-
/**
* Adapter function called to establish a connection to
* a service.
}
-
/**
* Adapter function called to destroy a connection to
* a service.
}
-
/**
* Generate the random coefficients of our pre-secret polynomial
*
}
-
static void
restore_fair (const struct GNUNET_CRYPTO_PaillierPublicKey *ppub,
const struct GNUNET_SECRETSHARING_FairEncryption *fe,
};
-
struct GNUNET_SECRETSHARING_ShareHeaderNBO
{
/**
GNUNET_free (dh);
}
+
/* end of secretsharing_api.c */
* the other peer disconnecting. The client may not know about this
* yet and try to cancel the (just barely non-existent) operation.
* So this is not a hard error.
- */
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ */GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Client canceled non-existent op %u\n",
(uint32_t) ntohl (msg->request_id));
}
(*OpChannelDeathImpl) (struct Operation *op);
-
/**
* Dispatch table for a specific set operation. Every set operation
* has to implement the callback in this struct.
* We should notify the active peer once
* all our demands are satisfied, so that the active
* peer can quit if we gave it everything.
- */
- GNUNET_CADET_receive_done (op->channel);
+ */GNUNET_CADET_receive_done (op->channel);
maybe_finish (op);
return;
*
* We'll close the channel
* to the other peer once our demands are met.
- */
- op->state->phase = PHASE_FINISH_CLOSING;
+ */op->state->phase = PHASE_FINISH_CLOSING;
GNUNET_CADET_receive_done (op->channel);
maybe_finish (op);
return;
}
}
+
/**
* Handle a over message from a remote peer
*
const struct InquiryMessage *msg);
-
/**
* Handle a request for full set transmission.
*
const struct GNUNET_MessageHeader *mh);
-
/**
* Handle a "full done" message.
*
static void
check_all_done (void)
{
- if ((info1.done == GNUNET_NO)||(info2.done == GNUNET_NO))
+ if ((info1.done == GNUNET_NO) || (info2.done == GNUNET_NO))
return;
GNUNET_CONTAINER_multihashmap_iterate (info1.received, map_remove_iterator,
return *(struct IBF_Key *) hash;
}
+
/**
* Create a hashcode from a key, by replicating the key
* until the hascode is filled
get 990/1000 elements on average over 1 million runs; key
idea being to stop short of the 'last' possible IBF as
otherwise a "lowball" per-chance would unduely influence the
- result */
- if ((j > 0) &&
+ result */if ((j > 0) &&
(buckets[j - 1] > MAX_IBF_DECODE))
{
ret *= (1 << (j + 1));
return 0;
}
+
/* TODO: should calculate stddev of the results to also be able to
say something about the stability of the results, outside of
large-scale averages -- gaining 8% precision at the expense of
return NULL;
}
+
/* end of plugin_block_set_test.c */
GNUNET_CRYPTO_hash_context_finish (ctx, ret_hash);
}
+
/* end of set_api.c */
}
-
/**
* Create a `struct GNUNET_SQ_ExecuteStatement` where errors should
* be tolerated.
return GNUNET_OK;
}
+
/* end of sq_exec */
}
-
/**
* Prepare all statements given in the (NULL,NULL)-terminated
* array at @a ps
return GNUNET_OK;
}
+
/* end of sq_prepare.c */
return GNUNET_OK;
}
+
/**
* Generate query parameter for an uint32_t in host byte order.
*
return qp;
}
+
/* end of sq_query_helper.c */
/**
* MINIMIZE heap size (way below 128k) since this process doesn't need much.
*/
-void __attribute__ ((constructor)) GNUNET_STATISTICS_memory_init ()
+void __attribute__ ((constructor))
+GNUNET_STATISTICS_memory_init ()
{
mallopt (M_TRIM_THRESHOLD, 4 * 1024);
mallopt (M_TOP_PAD, 1 * 1024);
malloc_trim (0);
}
+
+
#endif
return value_set;
}
+
/**
* @brief Print the (collected) values.
*
return GNUNET_YES;
}
+
/**
* Callback function to process statistic values.
*
return GNUNET_OK;
}
+
/**
* @brief Clean all data structures related to given node.
*
}
}
+
/**
* @brief Print and shutdown
*
GNUNET_SCHEDULER_shutdown ();
}
+
/**
* @brief Called once all statistic values are available.
*
}
}
+
/**
* Function called last by the statistics code.
*
GNUNET_SCHEDULER_shutdown ();
}
+
/**
* @brief Iterate over statistics values and store them in #values.
* They will be printed once all are available.
return GNUNET_OK;
}
+
/**
* Main task that does the actual work.
*
GNUNET_SCHEDULER_add_shutdown (&clean_node, &nodes[index_node].index_node);
}
+
/**
* @brief Iter over content of a node's directory to check for existence of a
* config file.
}
}
+
/**
* @brief Iterates over filenames in testbed directory.
*
return GNUNET_OK;
}
+
/**
* @brief Count the number of nodes running in the testbed
*
return 0;
}
+
/**
* Main function that will be run by the scheduler.
*
return ret;
}
+
/* end of gnunet-statistics.c */
* Chances are that it's down for good and we are not going to connect to
* it anymore.
* Give up and don't sync the rest of the data.
- */
- loss = GNUNET_NO;
+ */loss = GNUNET_NO;
for (gh = h->action_head; NULL != gh; gh = gh->next)
if ((gh->make_persistent) &&
(ACTION_SET == gh->type))
}
-
/**
* Transmit a GET request (and if successful, start to receive
* the response).
return ok;
}
+
/* end of test_statistics_api.c */
return ok;
}
+
/* end of test_statistics_api_loop.c */
return 1;
}
+
/* end of test_statistics_api_watch_zero_value.c */
return ret;
}
+
/* end of gnunet-template.c */
return 0;
}
+
int
main (int argc, char *argv[])
{
return ret;
}
+
/* end of test_template_api.c */
h->cb_cls = NULL;
}
+
/* End of testbed_logger_api.c */
}
}
+
/**
* Signature of a function that is called with QoS information about an address.
*
return (GNUNET_OK == status) ? 0 : 1;
}
+
/* end of gnunet-helper-testbed.c */
* from stdin, but if stdin fails for some reason, this shouldn't
* hurt for now --- might need to revise this later if we ever
* decide that master connections might be temporarily down
- * for some reason */
- // GNUNET_SCHEDULER_shutdown ();
+ * for some reason */// GNUNET_SCHEDULER_shutdown ();
}
}
GNUNET_TESTBED_ManagePeerServiceMessage *msg);
-
-
/**
* Check #GNUNET_MESSAGE_TYPDE_TESTBED_RECONFIGURE_PEER type messages.
*
}
-
/**
* Check #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_INIT messages.
*
}
}
+
/* end of gnunet-service-testbed_barriers.c */
entry->hello = GNUNET_copy_message (hello);
}
+
/* end of gnunet-service-testbed_hc.c */
(vm_size_t) (cpu_msg_count * sizeof(*cpu_load)));
return GNUNET_OK;
}
+
+
#endif
/**
}
}
+
/**
* Get the load of the CPU relative to what is allowed.
* @return the CPU load as a percentage of allowed
return (int) agedIOLoad;
}
+
/**
* Get the percentage of memory used
*
closedir (dir);
return nproc;
}
+
+
#endif
bw = NULL;
}
+
/* end of cpustatus.c */
unsigned long *slot; /* slot in return struct */
} mem_table_struct;
-static int compare_mem_table_structs (const void *a, const void *b)
+static int
+compare_mem_table_structs (const void *a, const void *b)
{
return strcmp (((const mem_table_struct*) a)->name, ((const
mem_table_struct*) b)->
name);
}
+
/* example data, following junk, with comments added:
*
* MemTotal: 61768 kB old
static unsigned long kb_swap_reclaimable;
static unsigned long kb_swap_unreclaimable;
-void meminfo (void)
+void
+meminfo (void)
{
char namebuf[16]; /* big enough to hold any row name */
mem_table_struct findme = { namebuf, NULL };
}
}
+
/**
* Condition for checking if given peer is ready to be destroyed
*
}
-
-
/**
* FIXME.
*/
static struct PeerReconfigureContext *prc_tail;
-
/**
* DLL head for queue of manage service requests
*/
return (GNUNET_OK == result) ? 0 : 1;
}
+
/* end of test_gnunet_helper_testbed.c */
}
-
/**
* Callback to be called when the requested peer information is available
*
}
-
/**
* Main run function.
*
return 0;
}
+
/* end of test_testbed_api.c */
}
-
/**
* Main run function.
*
return 0;
}
+
/* end of test_testbed_api_2peers_1controller.c */
}
}
+
/* end of test_testbed_api_3peers_3controllers.c */
}
}
+
/**
* Callback to signal successfull startup of the controller process
*
}
}
+
/* end of test_testbed_api_controllerlink.c */
return (GNUNET_OK == status) ? 0 : 1;
}
+
/* end of test_testbed_api_hosts.c */
return 0;
}
+
/* end of test_testbed_api_operations.c */
return ret;
}
+
/* end of test_testbed_api_sd.c */
GNUNET_SCHEDULER_shutdown ();
}
+
/**
* shortcut to exit during failure
*/
return 0;
}
+
/* end of test_testbed_api_test.c */
return 0;
}
+
/* end of test_testbed_api_test.c */
return 0;
}
+
/* end of test_testbed_api_testbed_run.c */
GNUNET_SCHEDULER_shutdown ();
}
+
/**
* Controller event callback
*
return 0;
}
+
/* end of test_testbed_api_topology.c */
GNUNET_SCHEDULER_shutdown ();
}
+
/**
* Controller event callback
*
return 0;
}
+
/* end of test_testbed_api_topology.c */
}
-
/**
* Signature of a main function for a testcase.
*
* required at the chained testbed controller setup to ensure the only the
* test-driver echos the status and the controller hierarchy properly
* propagates the status.
- */
- if ((NULL != barrier) && (GNUNET_YES == barrier->echo))
+ */if ((NULL != barrier) && (GNUNET_YES == barrier->echo))
GNUNET_TESTBED_barrier_remove_ (barrier);
}
};
-
/**
* Enumeration of states of OperationContext
*/
};
-
/**
* Queues a message in send queue for sending to the service
*
uint32_t slave_host_id);
-
/**
* Initialise a barrier and call the given callback when the required percentage
* of peers (quorum) reach the barrier OR upon error.
GNUNET_TESTBED_barrier_remove_ (struct GNUNET_TESTBED_Barrier *barrier);
-
#endif
/* end of testbed_api.h */
};
-
/**
* Check if barrier status message is well-formed.
*
GNUNET_free (h);
}
+
/* end of testbed_api_barriers.c */
host->hostname = GNUNET_strdup (host->hostname);
}
+
/* end of testbed_api_hosts.c */
}
-
/**
* Checks for the readiness of an operation and schedules a operation start task
*
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Be disciplined. Some operations were not marked as done.\n");
}
+
+
/* end of testbed_api_operations.c */
}
-
/**
* Function to call to start a peer_create type operation once all
* queues the operation is part of declare that the
}
-
/* end of testbed_api_peers.c */
return GNUNET_OK;
}
+
/* end of testbed_api_sd.c */
return data->operation;
}
+
/* end of testbed_api_services.c */
return ret;
}
+
/* end of testbed_api_test.c */
rcop));
}
+
/**
* Assuming all peers have been destroyed cleanup run handle
*
}
-
/**
* Function called when a overlay connect operation is ready
*
return ret;
}
+
/* end of testbed_api_topology.c */
return ret;
}
+
/* end of gnunet-testing.c */
}
-int main (int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
return (GNUNET_OK == status) ? 0 : 1;
}
+
/* end of test_testing_peerstartup.c */
}
-int main (int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
return (GNUNET_OK == status) ? 0 : 1;
}
+
/* end of test_testing_peerstartup.c */
}
-int main (int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
return (GNUNET_OK == status) ? 0 : 1;
}
+
/* end of test_testing_portreservation.c */
/**
* The main point of execution
*/
-int main (int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
test_success = GNUNET_NO;
GNUNET_assert (0 == GNUNET_TESTING_service_run ("test-testing-servicestartup",
return (GNUNET_YES == test_success) ? 0 : 1;
}
+
/* end of test_testing_servicestartup.c */
}
-int main (int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
return (GNUNET_OK == status) ? 0 : 3;
}
+
/* end of test_testing_sharedservices.c */
address families are considered open.
On system with either IPv4 or IPv6. A port is considered open if it's
open in the respective address family
- */
- hint.ai_family = AF_UNSPEC; /* IPv4 and IPv6 */
+ */hint.ai_family = AF_UNSPEC; /* IPv4 and IPv6 */
hint.ai_socktype = 0;
hint.ai_protocol = 0;
hint.ai_addrlen = 0;
* of the data structure and would only really become
* "useless" once a HELLO has been passed on to ~100
* other peers, which is likely more than enough in
- * any case; hence 64, 5 as bloomfilter parameters. */
- peer->filter = GNUNET_CONTAINER_bloomfilter_init (NULL, 64, 5);
+ * any case; hence 64, 5 as bloomfilter parameters. */peer->filter = GNUNET_CONTAINER_bloomfilter_init (NULL, 64, 5);
peer->filter_expiration =
GNUNET_TIME_relative_to_absolute (HELLO_ADVERTISEMENT_MIN_REPEAT_FREQUENCY);
/* never send a peer its own HELLO */
/**
* MINIMIZE heap size (way below 128k) since this process doesn't need much.
*/
-void __attribute__ ((constructor)) GNUNET_ARM_memory_init ()
+void __attribute__ ((constructor))
+GNUNET_ARM_memory_init ()
{
mallopt (M_TRIM_THRESHOLD, 4 * 1024);
mallopt (M_TOP_PAD, 1 * 1024);
malloc_trim (0);
}
+
+
#endif
/* end of gnunet-daemon-topology.c */
GNUNET_SCHEDULER_cancel (timeout_tid);
}
+
static void
timeout_task (void *cls)
{
GNUNET_SCHEDULER_shutdown ();
}
+
/*
* The function is called every time the topology of connected
* peers to a peer changes.
if (p_ctx->connections < value)
p_ctx->connections = value;
- if ((THRESHOLD <= value)&&(GNUNET_NO == p_ctx->reported))
+ if ((THRESHOLD <= value) && (GNUNET_NO == p_ctx->reported))
{
p_ctx->reported = GNUNET_YES;
checked_peers++;
return GNUNET_YES;
}
+
static void *
ca_statistics (void *cls,
const struct GNUNET_CONFIGURATION_Handle *cfg)
"call to GNUNET_STATISTICS_watch() failed\n");
}
+
static void
notify_connect_complete (void *cls,
struct GNUNET_TESTBED_Operation *op,
connect_left--;
}
+
static void
do_connect (void *cls,
struct GNUNET_TESTBED_RunHandle *h,
return (GNUNET_OK != result) ? 1 : 0;
}
+
/* end of test_gnunet_daemon_topology.c */
wrong key for everything after the rekey; in that case, we have
to re-do the decryption at 'total' instead of at 'max'. If there
is no rekey and the last message is incomplete (max > total),
- it is safe to keep the decryption so we shift by 'max' */
- if (GNUNET_YES == queue->rekeyed)
+ it is safe to keep the decryption so we shift by 'max' */if (GNUNET_YES == queue->rekeyed)
{
max = total;
queue->rekeyed = GNUNET_NO;
* group in the normal IPv6 routing table and using the resulting
* interface; we do this for each interface, so no need to use
* zero (anymore...).
- */
- bi->mcreq.ipv6mr_interface = s6->sin6_scope_id;
+ */bi->mcreq.ipv6mr_interface = s6->sin6_scope_id;
/* Join the multicast group */
if (GNUNET_OK != GNUNET_NETWORK_socket_setsockopt (udp_sock,
/**
* MINIMIZE heap size (way below 128k) since this process doesn't need much.
*/
-void __attribute__ ((constructor)) GNUNET_ARM_memory_init ()
+void __attribute__ ((constructor))
+GNUNET_ARM_memory_init ()
{
mallopt (M_TRIM_THRESHOLD, 4 * 1024);
mallopt (M_TOP_PAD, 1 * 1024);
malloc_trim (0);
}
+
+
#endif
/* end of gnunet-communicator-unix.c */
return ret;
}
+
/**
* Destroys a tokenizer.
*
free (mst);
}
+
/**
* Calculate crc32, the start of the calculation
*
crc = calc_crc_osdep (buf, len);
buf += len;
- if ((((crc) & 0xFF) == buf[0])&&(((crc >> 8) & 0xFF) == buf[1])&&
- ( ((crc >> 16) & 0xFF) == buf[2]) &&( ((crc >> 24) & 0xFF) == buf[3]) )
+ if ((((crc) & 0xFF) == buf[0]) && (((crc >> 8) & 0xFF) == buf[1]) &&
+ ( ((crc >> 16) & 0xFF) == buf[2]) && ( ((crc >> 24) & 0xFF) == buf[3]) )
return 0;
return 1;
}
-
/* ************** end of clone ***************** */
#ifdef LINUX
/**
return -1;
}
+
+
#endif
/**
* 5. set the name, provider and description
* 6. register the service record to the local SDP server
* 7. cleanup
- */
- uint8_t svc_uuid_int[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ */uint8_t svc_uuid_int[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
dev->pl_mac.mac[5], dev->pl_mac.mac[4],
dev->pl_mac.mac[3],
dev->pl_mac.mac[2], dev->pl_mac.mac[1],
return 0;
}
+
/**
* Function used for searching and browsing for a service. This will return the
* port number on which the service is running.
* 2.2. get a list of service records with the specific UUID
* 2.3. for each service record get a list of the protocol sequences and get
* the port number
- */
- uint8_t svc_uuid_int[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ */uint8_t svc_uuid_int[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
dest.b[5], dest.b[4], dest.b[3],
dest.b[2], dest.b[1], dest.b[0] };
sdp_session_t *session = 0;
return channel;
}
+
/**
* Read from the socket and put the result into the buffer for transmission to 'stdout'.
*
(void) close (fd_hci);
-
/* Bind the rfcomm socket to the interface */
memset (&rc_addr, 0, sizeof(rc_addr));
rc_addr.rc_family = AF_BLUETOOTH;
taIeeeHeader->addr2 = dev->pl_mac;
}
+
#ifdef LINUX
/**
* Test if the given interface name really corresponds to a bluetooth
}
return 0;
}
+
+
#endif
/**
write_pout.size = sendsize;
}
+
#ifdef LINUX
/**
* Broadcast a HELLO message for peer discovery
int loops = 0;
search_for_devices:
- if (((neighbours.size == neighbours.pos)&&(new_device == 1)) ||
+ if (((neighbours.size == neighbours.pos) && (new_device == 1)) ||
(neighbours.size == 0) )
{
inquiry_devices: // skip the conditions and force a inquiry for new devices
return 0;
}
+
+
#endif
/**
connect_retry:
status = connect (sendsocket, (struct sockaddr *) &addr,
sizeof(addr));
- if ((0 != status) &&(errno != EAGAIN) )
+ if ((0 != status) && (errno != EAGAIN) )
{
- if ((errno == ECONNREFUSED) &&(tries < 2) )
+ if ((errno == ECONNREFUSED) && (tries < 2) )
{
fprintf (stderr, "LOG : %.*s failed to connect. Trying again!\n",
IFNAMSIZ, dev.iface);
int retval = select (maxfd + 1, &rfds, &wfds, NULL, NULL);
if ((-1 == retval) && (EINTR == errno))
continue;
- if ((0 > retval) &&(errno != EBADF) ) // we handle BADF errors later
+ if ((0 > retval) && (errno != EBADF) ) // we handle BADF errors later
{
fprintf (stderr, "select failed: %s\n", strerror (errno));
break;
#define MAXLINE 4096
-
/* ********* structure of messages of type ARPHRD_IEEE80211_PRISM *********** */
/**
#define IEEE80211_RADIOTAP_PRESENT_EXTEND_MASK (1 << IEEE80211_RADIOTAP_EXT)
-
/**
* Bit in IEEE80211_RADIOTAP_FLAGS (which we might get
* as part of a 'struct Ieee80211RadiotapHeader' extension
IEEE80211_RADIOTAP_TX_FLAGS))
-
/**
* struct Ieee80211RadiotapHeaderIterator - tracks walk through present radiotap arguments
* in the radiotap header. Used when we parse radiotap packets received from the kernel.
static struct SendBuffer write_std;
-
/* *********** specialized version of server_mst.c begins here ********** */
/**
free (mst);
}
+
/* ***************** end of server_mst.c clone ***************** **/
* check for insanity where the present bitmaps
* keep claiming to extend up to or even beyond the
* stated radiotap header length
- */
- if (iterator->arg - ((uint8_t*) iterator->rtheader) >
+ */if (iterator->arg - ((uint8_t*) iterator->rtheader) >
iterator->max_length)
return -1;
}
* no need to check again for blowing past stated radiotap
* header length, becuase ieee80211_radiotap_iterator_next
* checks it before it is dereferenced
- */
- }
+ */}
/* we are all initialized happily */
return 0;
}
*
* upper nybble: content alignment for arg
* lower nybble: content length for arg
- */
-
- static const uint8_t rt_sizes[] = {
+ */static const uint8_t rt_sizes[] = {
[IEEE80211_RADIOTAP_TSFT] = 0x88,
[IEEE80211_RADIOTAP_FLAGS] = 0x11,
[IEEE80211_RADIOTAP_RATE] = 0x11,
* radiotap header. There is no guarantee that the radiotap
* header itself is aligned on any kind of boundary, thus we
* need to really look at the delta here.
- */
- wanted_alignment = rt_sizes[iterator->arg_index] >> 4;
+ */wanted_alignment = rt_sizes[iterator->arg_index] >> 4;
unalignment = (((void *) iterator->arg) - ((void *) iterator->rtheader))
& (wanted_alignment - 1);
if (0 != unalignment)
* claims to have more arg content than the length of the
* radiotap section. We will normally end up equalling this
* max_length on the last arg, never exceeding it.
- */
- if ((((void *) iterator->arg) - ((void *) iterator->rtheader)) >
+ */if ((((void *) iterator->arg) - ((void *) iterator->rtheader)) >
iterator->max_length)
return -1;
}
crc = calc_crc_osdep (buf, len);
buf += len;
- if ((((crc) & 0xFF) == buf[0])&&(((crc >> 8) & 0xFF) == buf[1])&&
- ( ((crc >> 16) & 0xFF) == buf[2]) &&( ((crc >> 24) & 0xFF) == buf[3]) )
+ if ((((crc) & 0xFF) == buf[0]) && (((crc >> 8) & 0xFF) == buf[1]) &&
+ ( ((crc >> 16) & 0xFF) == buf[2]) && ( ((crc >> 24) & 0xFF) == buf[3]) )
return 0;
return 1;
}
static int
get_channel_from_frequency (int32_t frequency)
{
- if ((frequency >= 2412)&&(frequency <= 2472))
+ if ((frequency >= 2412) && (frequency <= 2472))
return (frequency - 2407) / 5;
if (frequency == 2484)
return 14;
- if ((frequency >= 5000)&&(frequency <= 6100))
+ if ((frequency >= 5000) && (frequency <= 6100))
return (frequency - 5000) / 5;
return -1;
}
return 1; /* we never exit 'normally' */
}
+
/* end of gnunet-helper-transport-wlan.c */
then. See vl->last_fc_rtt! NOTE: to do this properly, we also
need an estimate for the bandwidth-delay-product for the entire
VL, as that determines "significantly". We have the delay, but
- the bandwidth statistics need to be added for the VL!*/
- (void) duration;
+ the bandwidth statistics need to be added for the VL!*/(void) duration;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Sending FC seq %u to %s with new window %llu\n",
we pass this on, CORE would be confused (link down, messages
arrive). We should investigate more if this happens often,
or in a persistent manner, and possibly do "something" about
- it. Thus logging as error for now. */
- GNUNET_break_op (0);
+ it. Thus logging as error for now. */GNUNET_break_op (0);
GNUNET_STATISTICS_update (GST_stats,
"# CORE messages droped (virtual link still down)",
1,
given message fits _this_ queue, and do not consider how well other
queues might suit the message. Taking other queues into consideration
may further improve the result, but could also be expensive
- in terms of CPU time. */
- long long sc_score = sc->frag * 40 + sc->relb * 20 + sc->real_overhead;
+ in terms of CPU time. */long long sc_score = sc->frag * 40 + sc->relb * 20 + sc->real_overhead;
long long pm_score = frag * 40 + relb * 20 + real_overhead;
long long time_delta =
(sc->best->next_attempt.abs_value_us - pos->next_attempt.abs_value_us)
via DV (and thus the ultimate target of the pending message is for
a different virtual link than the one of the queue), then we need
to use up not only the window of the direct link but also the
- flow control window for the DV link! */
- pm->vl->outbound_fc_window_size_used += pm->bytes_msg;
+ flow control window for the DV link! */pm->vl->outbound_fc_window_size_used += pm->bytes_msg;
if (pm->vl != queue->neighbour->vl)
{
OPTIMIZE: Note that in the future this heuristic should likely
be improved further (measure RTT stability, consider message
- urgency and size when delaying ACKs, etc.) */
- update_pm_next_attempt (pm,
+ urgency and size when delaying ACKs, etc.) */update_pm_next_attempt (pm,
GNUNET_TIME_relative_to_absolute (
GNUNET_TIME_relative_multiply (queue->pd.aged_rtt,
4)));
* If (NULL != transport_name) we look for a transport specific entry:
* if (transport_name == be) forbidden
*
- */
-
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ */GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Comparing BL request for peer `%4s':`%s' with BL entry: `%s'\n",
GNUNET_i2s (key),
(NULL == transport_name) ? "unspecified" : transport_name,
struct GST_BlacklistCheck;
-
/**
* Test if a peer/transport combination is blacklisted.
*
GST_clients_broadcast_disconnect (const struct GNUNET_PeerIdentity *peer);
-
-
#endif
/* end of file gnunet-service-transport_plugins.h */
return; /* our own, ignore! */
ai = find_ai (address,
session);
- if ((NULL == ai)||(NULL == ai->ar))
+ if ((NULL == ai) || (NULL == ai->ar))
{
/* The address is already gone/blocked, this can happen during a blacklist
* callback. */
above played out: it was either freed in
#GNUNET_ATS_address_del_session() because it was
incoming, or explicitly in
- #GNUNET_ATS_address_del_session(). */
- ai->ar = NULL;
+ #GNUNET_ATS_address_del_session(). */ai->ar = NULL;
/* determine when the address should come back to life */
ai->blocked = GNUNET_TIME_relative_to_absolute (ai->back_off);
other part of the code could not tell if it just created a new
session or just got one recycled from the plugin; hence, we may
be called with "new" session even for an "old" session; in that
- case, check that this is the case, but just ignore it. */
- GNUNET_assert (NULL != (find_ai (address, session)));
+ case, check that this is the case, but just ignore it. */GNUNET_assert (NULL != (find_ai (address, session)));
return;
}
GNUNET_assert (NULL == ai->session);
above played out: it was either freed in
#GNUNET_ATS_address_del_session() because it was
incoming, or explicitly in
- #GNUNET_ATS_address_del_session(). */
- ai->ar = NULL;
+ #GNUNET_ATS_address_del_session(). */ai->ar = NULL;
}
destroy_ai (ai);
return;
p2a = NULL;
}
+
/* end of gnunet-service-transport_ats.c */
}
}
+
/* end of file gnunet-service-transport_manipulation.c */
We expect a ACK:
- If a remote peer has sent a SYN, we responded with a SYN_ACK and
now wait for the ACK to finally be connected
- - If we sent a SYN_ACK to this peer before */
-
- if (((GNUNET_TRANSPORT_PS_SYN_RECV_ACK != n->state) &&
+ - If we sent a SYN_ACK to this peer before */if (((GNUNET_TRANSPORT_PS_SYN_RECV_ACK != n->state) &&
(ACK_SEND_ACK != n->ack_state)) ||
(NULL == n->primary_address.address))
{
* an ACK.
* That suggests that the primary_address used to be non-NULL, but maybe it
* got reset to NULL without the state being changed appropriately?
- */
- GNUNET_break (0);
+ */GNUNET_break (0);
return GNUNET_OK;
}
};
-
-
/**
* How long is a PONG signature valid? We'll recycle a signature until
* 1/4 of this time is remaining. PONGs should expire so that if our
* - "fast start": run validation immediately
* - have delay of (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.rel_value_us) / (max_fds / 2)
* (300 sec / ~150 == ~2 sec.) between two validations
- */
-
- validation_next = GNUNET_TIME_absolute_get ();
+ */validation_next = GNUNET_TIME_absolute_get ();
validation_delay.rel_value_us =
(GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.rel_value_us) / (max_fds / 2);
validations_fast_start_threshold = (max_fds / 2);
return 1;
}
+
/* end of gnunet-transport-profiler.c */
return GNUNET_YES;
}
+
/**
* function to generate the wlan hardware header for one packet
* @param Header address to write the header to
return 1;
}
+
/* end of gnunet-transport.c */
return get_unaligned_le16 ((const u8 *) &hdr->it_len);
}
+
#endif /* IEEE80211_RADIOTAP_H */
text);
return 0;
}
+
+
#endif
/**
return CURL_SOCKET_BAD;
}
}
+
+
#endif
return api;
}
+
/* end of plugin_transport_http_client.c */
return sp;
}
+
/**
* Closure for #append_port().
*/
return NULL;
}
+
/**
* Function called to convert a string address to
* a binary address.
}
-
/* end of plugin_transport_http_common.c */
#include <regex.h>
-
#if BUILD_HTTPS
#define PLUGIN_NAME "https_server"
#define LIBGNUNET_PLUGIN_TRANSPORT_INIT \
GNUNET_DISK_file_close (gn_file);
return text;
}
+
+
#endif
"TLS certificate loaded\n");
return res;
}
+
+
#endif
#endif
-
plugin->server_v4 = NULL;
if (GNUNET_YES == plugin->use_ipv4)
{
}
-
/**
* Our external IP address/port mapping has changed.
*
return api;
}
+
/* end of plugin_transport_http_server.c */
return NULL;
}
+
/* *************** API implementation *************** */
/**
return GNUNET_OK;
}
+
/**
* Create a hello-Message for the current node. The hello is created
* without signature and without a timestamp. The GNUnet core will
return msg;
}
+
struct GetMessageClosure
{
unsigned int esize;
return gmc->ebody;
}
+
/**
* Send a message to the specified remote node.
*
return GNUNET_OK;
}
+
/**
* Establish a connection to a remote node.
* @param hello the hello-Message for the target node
return GNUNET_OK;
}
+
/**
* Disconnect from a remote node.
*
return GNUNET_OK;
}
+
/**
* Start the server process to receive inbound traffic.
* @return GNUNET_OK on success, GNUNET_SYSERR if the operation failed
return GNUNET_OK;
}
+
/**
* Shutdown the server process (stop receiving inbound traffic). Maybe
* restarted later!
return GNUNET_OK;
}
+
/**
* Convert SMTP hello to an IP address (always fails).
*/
return GNUNET_SYSERR;
}
+
/**
* Always fails.
*/
return GNUNET_SYSERR; /* SMTP connections can never be associated */
}
+
/**
* Always succeeds (for now; we should look at adding
* frequency limits to SMTP in the future!).
return GNUNET_OK; /* we always try... */
}
+
/**
* The exported method. Makes the core api available via a global and
* returns the smtp transport API.
return &smtpAPI;
}
+
void
donetransport_smtp ()
{
email = NULL;
}
+
/* end of smtp.c */
GNUNET_SERVER_client_set_user_context_ (struct GNUNET_SERVER_Client *client,
void *ptr,
size_t size);
+
/**
* Return user context associated with the given client.
*
*addr_lens = saddrlens;
return resi;
}
+
+
/* end ancient copy-and-paste */
one TCP connection to any given peer at the same time.
Without this, peers sometimes disagree about which of the TCP
connections they should use, causing one side to believe that
- they transmit successfully, while the other receives nothing. */
- return NULL; /* Refuse to have more than one TCP connection per
+ they transmit successfully, while the other receives nothing. */return NULL; /* Refuse to have more than one TCP connection per
peer pair at the same time. */
}
* received the punch message and now wants us to use the new connection
* as the default for that peer. Do so and then send a WELCOME message
* so we can really be connected!
- */
- if (ntohs (message->size) != sizeof(struct TCP_NAT_ProbeMessage))
+ */if (ntohs (message->size) != sizeof(struct TCP_NAT_ProbeMessage))
{
GNUNET_break_op (0);
GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
return NULL;
}
+
/* end of plugin_transport_tcp.c */
session,
&info);
}
+
+
#endif
}
-
/**
* Another peer has suggested an address for this
* peer and transport plugin. Check that this could be a valid
GNUNET_TRANSPORT_SS_UP);
return GNUNET_OK;
}
+
+
#endif
return NULL;
}
+
/* end of plugin_transport_template.c */
* For UDP we update session timeout only on receive, this will
* cover keep alives, since remote peer will reply with keep alive
* responses!
- */
- if (udpmlen <= UDP_MTU)
+ */if (udpmlen <= UDP_MTU)
{
/* unfragmented message */
udpw = GNUNET_malloc (sizeof(struct UDP_MessageWrapper) + udpmlen);
* This indicates that this system is IPv6 enabled, but does not
* have a valid global IPv6 address assigned or we do not have
* connectivity
- */
- LOG (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK,
+ */LOG (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK,
_ (
"UDP could not transmit IPv6 message! "
"Please check your network configuration and disable IPv6 if your "
return NULL;
}
+
/* end of plugin_transport_udp.c */
hello_size = GNUNET_HELLO_size ((struct GNUNET_HELLO_Message *) hello);
msg_size = hello_size + sizeof(struct UDP_Beacon_Message);
- if ((hello_size < (sizeof(struct GNUNET_MessageHeader)))||
+ if ((hello_size < (sizeof(struct GNUNET_MessageHeader))) ||
(msg_size > (UDP_MTU)))
return 0;
if the scope ID is ignored, the kernel should just multicast
on ALL interfaces, which is merely slightly less efficient;
in that case, we might want to revert to only doing this
- once, and not per interface (hard to test...) */
- plugin->ipv6_multicast_address.sin6_scope_id = s6->sin6_scope_id;
+ once, and not per interface (hard to test...) */plugin->ipv6_multicast_address.sin6_scope_id = s6->sin6_scope_id;
sent = GNUNET_NETWORK_socket_sendto (plugin->sockv6, &buf, msg_size,
(const struct sockaddr *)
&plugin->ipv6_multicast_address,
*
* This indicates that this system is IPv6 enabled, but does not
* have a valid global IPv6 address assigned
- */
- GNUNET_log (GNUNET_ERROR_TYPE_BULK | GNUNET_ERROR_TYPE_WARNING,
+ */GNUNET_log (GNUNET_ERROR_TYPE_BULK | GNUNET_ERROR_TYPE_WARNING,
"Network connectivity is down, cannot send beacon!\n");
}
else
* group in the normal IPv6 routing table and using the resulting
* interface; we do this for each interface, so no need to use
* zero (anymore...).
- */
- multicastRequest.ipv6mr_interface = s6->sin6_scope_id;
+ */multicastRequest.ipv6mr_interface = s6->sin6_scope_id;
/* Join the multicast group */
if (GNUNET_OK !=
}
}
+
/* end of plugin_transport_udp_broadcasting.c */
return NULL;
}
+
/* end of plugin_transport_unix.c */
#endif
-
/**
* Functions with this signature are called whenever a
* complete message is received by the tokenizer.
}
-
/**
* Lookup a new session
*
}
-
/**
* Function that will be called whenever the transport service wants to
* notify the plugin that a session is still active and in use and
} GNUNET_PACKED;
-
/**
* Message from the plugin to the WLAN helper: send the given message with the
* given connection parameters.
};
-
/**
* Return user context associated with the given client.
* Note: you should probably use the macro (call without the underscore).
};
-
/**
* Create a message stream tokenizer.
*
}
-
/* end of server_mst.c */
NULL); /* cls */
}
+
int
main (int argc,
char *const *argv)
return ret;
}
+
/* end of test_http_common.c */
ok = 1;
}
+
static void
wait_end (void *cls)
{
return GNUNET_TIME_relative_get_zero_ ();
}
+
static int got_reply;
int c1;
for (c1 = 0; c1 < s2a_len; c1++ )
fprintf (stderr, "%u == %u\n", ((char *) s2a)[c1], ((char *) w->addr)[c1]);
- */
- if (s2a_len != w->address->address_length)
+ */if (s2a_len != w->address->address_length)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Plugin creates different address length when converting address->string->address: %u != %u\n",
return ret;
}
+
/* end of test_plugin_transport.c */
return 1;
return 0;
}
+
+
/* end of test_transport_address_switch.c */
return 0;
}
+
/* end of test_transport_api.c */
return 0;
}
+
/* end of test_transport_api_disconnect.c */
return 0;
}
+
#else
/* cannot setrlimit */
return 77;
}
+
#endif
/* end of test_transport_api_limited_sockets.c */
return 0;
}
+
/* end of test_transport_api_manipulation_recv_tcp.c */
return 0;
}
+
/* end of test_transport_api_manipulation_send_tcp.c */
return 0;
}
+
/* end of test_transport_api_monitor_peers.c */
return 0;
}
+
/* end of test_transport_api_restart_1peer.c */
return 0;
}
+
/* end of test_transport_api_timeout.c*/
ok = GNUNET_SYSERR;
}
+
static void
testing_connect_cb (void *cls)
{
GNUNET_SCHEDULER_add_now (&end, NULL);
}
+
static void
run (void *cls, char *const *args, const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL);
}
+
int
main (int argc, char *argv0[])
{
return ok;
}
+
/* end of transport_api_blacklisting.c */
return ret;
}
+
/* end of test_transport_testing_restart.c */
return ret;
}
+
/* end of test_transport_testing_startstop.c */
}
-
/**
* Log a disconnect event.
*
GNUNET_free (ps);
}
+
/* end of transport-testing-loggers.c */
return ret;
}
+
/* end of transport-testing-main.c */
done ? sc->cont_cls : sc);
}
+
/* end of transport-testing-send.c */
return tth;
}
+
/* end of transport-testing.c */
GNUNET_free (mc);
}
+
/* end of transport_api2_monitor.c */
env);
}
+
/**
* Generic error handler, called with the appropriate error code and
* the same closure specified at the creation of the message queue.
}
-
/**
* Generic error handler, called with the appropriate error code and
* the same closure specified at the creation of the message queue.
};
-
/**
* Task run to re-establish the connection.
*
GNUNET_TIME_UNIT_SECONDS, 5)
-
/**
* Internal state for a client connected to a GNUnet service.
*/
return cstate->mq;
}
+
/* end of client.c */
return n;
return e - s;
}
+
+
#endif
GNUNET_stderr = altlog;
return GNUNET_OK;
}
+
+
#endif
{
ld = &logdefs[i];
if (((! force_only) || ld->force) &&
- ((line >= ld->from_line) &&(line <= ld->to_line) ) &&
+ ((line >= ld->from_line) && (line <= ld->to_line) ) &&
(0 == regexec (&ld->component_regex, comp, 0, NULL, 0)) &&
(0 == regexec (&ld->file_regex, file, 0, NULL, 0)) &&
(0 == regexec (&ld->function_regex, function, 0, NULL, 0)))
parse_definitions ("GNUNET_LOG", 0);
gnunet_log_parsed = GNUNET_YES;
}
+
+
#endif
* interactively, yet the same message shouldn't look
* this way if the output is going to logfiles or robots
* instead.
- */
- fprintf (GNUNET_stderr, "* %s", msg);
+ */fprintf (GNUNET_stderr, "* %s", msg);
}
else if (GNUNET_YES == current_async_scope.have_scope)
{
/**
* Initializer
*/
-void __attribute__ ((constructor)) GNUNET_util_cl_init ()
+void __attribute__ ((constructor))
+GNUNET_util_cl_init ()
{
GNUNET_stderr = stderr;
}
/**
* Destructor
*/
-void __attribute__ ((destructor)) GNUNET_util_cl_fini ()
+void __attribute__ ((destructor))
+GNUNET_util_cl_fini ()
{
}
+
/* end of common_logging.c */
return GNUNET_OK;
}
+
/* end of configuration_loader.c */
bitArray[arraySlot] |= targetBit;
}
+
/**
* Clears a bit from bitArray. Bit is cleared from the array
* only if the respective usage counter on the disk hits/is zero.
bitArray[slot] = bitArray[slot] & (~targetBit);
}
+
/**
* Checks if a bit is active in the bitArray
*
return GNUNET_NO;
}
+
/**
* Sets a bit active in the bitArray and increments
* bit-specific usage counter on disk (but only if
GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1));
}
+
/**
* Clears a bit from bitArray if the respective usage
* counter on the disk hits/is zero.
GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1));
}
+
#define BUFFSIZE 65536
/**
return GNUNET_OK;
}
+
/* ************** GNUNET_CONTAINER_BloomFilter iterator ********* */
/**
return GNUNET_YES;
}
+
/* *********************** INTERFACE **************** */
/**
return GNUNET_OK;
}
+
/**
* Or the entries of the given raw data array with the
* data of the given bloom filter. Assumes that
iterateBits (bf, &decrementBitCallback, bf, e);
}
+
/**
* Resize a bloom filter. Note that this operation
* is pretty costly. Essentially, the bloom filter
GNUNET_CONTAINER_bloomfilter_add (bf, &hc);
}
+
/* end of container_bloomfilter.c */
__VA_ARGS__)
-
/**
* Try to compress the given block of data using libz. Only returns
* the compressed block if compression worked and the new block is
return rc;
}
+
static int
aes_128_cbc_encrypt (char*pt,
int size,
return buf_size;
}
+
static int
aes_128_cbc_decrypt (char*ct,
int size,
return len;
}
+
struct GNUNET_CRYPTO_AbeMasterKey*
GNUNET_CRYPTO_cpabe_create_master_key (void)
{
return key;
}
+
void
GNUNET_CRYPTO_cpabe_delete_master_key (struct GNUNET_CRYPTO_AbeMasterKey *key)
{
GNUNET_free (key);
}
+
struct GNUNET_CRYPTO_AbeKey*
GNUNET_CRYPTO_cpabe_create_key (struct GNUNET_CRYPTO_AbeMasterKey *key,
char **attrs)
return prv_key;
}
+
void
GNUNET_CRYPTO_cpabe_delete_key (struct GNUNET_CRYPTO_AbeKey *key,
int delete_pub)
GNUNET_free (key);
}
+
ssize_t
write_cpabe (void **result,
uint32_t file_len,
return 12 + cph_buf_len + aes_buf_len;
}
+
ssize_t
read_cpabe (const void *data,
char**cph_buf,
return buf_len;
}
+
ssize_t
GNUNET_CRYPTO_cpabe_encrypt (const void *block,
size_t size,
return result_len;
}
+
ssize_t
GNUNET_CRYPTO_cpabe_decrypt (const void *block,
size_t size,
return plt_len;
}
+
ssize_t
GNUNET_CRYPTO_cpabe_serialize_key (const struct GNUNET_CRYPTO_AbeKey *key,
void **result)
return len;
}
+
struct GNUNET_CRYPTO_AbeKey*
GNUNET_CRYPTO_cpabe_deserialize_key (const void *data,
size_t len)
return key;
}
+
ssize_t
GNUNET_CRYPTO_cpabe_serialize_master_key (const struct
GNUNET_CRYPTO_AbeMasterKey *key,
return len;
}
+
struct GNUNET_CRYPTO_AbeMasterKey*
GNUNET_CRYPTO_cpabe_deserialize_master_key (const void *data,
size_t len)
}
}
+
/*
* This computes the standard preset and inverted CRC, as used
* by most networking standards. Start by passing in an initial
but should also be harmless. For libgcrypt < 1.7, using 'eddsa'
disables an expensive key testing routine. We do not want to run
the expensive check for ECDHE, as we generate TONS of keys to
- use for a very short time. */
- if (0 != (rc = gcry_sexp_build (&s_keyparam,
+ use for a very short time. */if (0 != (rc = gcry_sexp_build (&s_keyparam,
NULL,
"(genkey(ecc(curve \"" CURVE "\")"
"(flags eddsa no-keytest)))")))
return priv;
}
+
/**
* Create a new private key. Caller must free return value.
*
return ret;
}
+
/**
* @ingroup crypto
* Derive key material from a ECDSA public key and a private ECDH key.
key_material);
}
+
/* end of crypto_ecc.c */
GNUNET_CONFIGURATION_destroy (cfg);
}
+
/* end of crypto_ecc_setup.c */
GNUNET_free (fhc);
}
+
/* end of crypto_hash_file.c */
#define DEBUG_HKDF 0
-
#if GNUNET_BUILD
#include "platform.h"
#include "gnunet_crypto_lib.h"
return (const void *) gcry_md_read (mac, 0);
}
+
/**
* @brief Generate pseudo-random key
* @param mac gcrypt HMAC handle
}
printf ("\n");
}
+
+
#endif
return ret;
}
+
/* end of crypto_hkdf.c */
* hash function."
*
* http://eprint.iacr.org/2010/264
- */
-
- return GNUNET_CRYPTO_hkdf_v (result,
+ */return GNUNET_CRYPTO_hkdf_v (result,
out_len,
GCRY_MD_SHA512,
GCRY_MD_SHA256,
}
}
+
/* end of crypto_kdf.c */
}
}
+
/* end of crypto_mpi.c */
number has the same length (or is smaller), by counting the
number of possible operations. We essentially divide max_num by
2 until the result is no longer larger than 'm', incrementing the
- maximum number of operations in each round, starting at -2 */
- for (possible_opts = -2; gcry_mpi_cmp (max_num, m) > 0; possible_opts++)
+ maximum number of operations in each round, starting at -2 */for (possible_opts = -2; gcry_mpi_cmp (max_num, m) > 0; possible_opts++)
gcry_mpi_div (max_num,
NULL,
max_num,
return ntohl (c->remaining_ops);
}
+
/* end of crypto_paillier.c */
glibc_weak_rand32_state = val;
return val;
}
+
+
#endif
/**
/**
* Initialize libgcrypt.
*/
-void __attribute__ ((constructor)) GNUNET_CRYPTO_random_init ()
+void __attribute__ ((constructor))
+GNUNET_CRYPTO_random_init ()
{
gcry_error_t rc;
/**
* Nicely shut down libgcrypt.
*/
-void __attribute__ ((destructor)) GNUNET_CRYPTO_random_fini ()
+void __attribute__ ((destructor))
+GNUNET_CRYPTO_random_fini ()
{
gcry_set_progress_handler (NULL, NULL);
#ifdef GCRYCTL_CLOSE_RANDOM_DEVICE
* so the exchange is being malicious in an unfamilair way, maybe
* just trying to crash us. Arguably, we've only an internal error
* though because we should've detected this in our previous call
- * to GNUNET_CRYPTO_rsa_unblind. */
- return GNUNET_NO;
+ * to GNUNET_CRYPTO_rsa_unblind. */return GNUNET_NO;
}
data = mpi_to_sexp (r);
argp);
}
+
/* end of crypto_symmetric.c */
return ((! h) || (h->fd == -1)) ? GNUNET_YES : GNUNET_NO;
}
+
/**
* Get the size of an open file.
*
{
c = *idx;
- if ((c == '/') ||(c == '\\') ||(c == ':') ||(c == '*') ||(c == '?') ||(c ==
- '"')
+ if ((c == '/') || (c == '\\') || (c == ':') || (c == '*') || (c == '?') ||
+ (c ==
+ '"')
||
- (c == '<') ||(c == '>') ||(c == '|') )
+ (c == '<') || (c == '>') || (c == '|') )
{
*idx = '_';
}
return (*m)->addr;
}
+
/**
* Unmap a file
* @param h mapping handle
return ret;
}
+
/**
* Detaches one of the ends from the pipe.
* Detached end is a fully-functional FileHandle, it will
return 0;
}
+
/* If using GCC, we can safely declare strlen this way.
If not using GCC, it is ok not to declare it. */
#ifdef __GNUC__
and has done so at least since version 2.4.5. -- rms. */
extern int
strlen (const char *);
+
#endif /* not __STDC__ */
#endif /* __GNUC__ */
#if defined(__STDC__) && __STDC__
static void
exchange (char **);
+
#endif
static void
last_nonopt = GNoptind;
}
+
/* Initialize the internal data when the first call is made. */
#if defined(__STDC__) && __STDC__
static const char *
_getopt_initialize (int, char *const *, const char *);
+
#endif
static const char *
_getopt_initialize (int argc, char *const *argv, const char *optstring)
return optstring;
}
+
/* Scan elements of ARGV (whose length is ARGC) for option characters
given in OPTSTRING.
GNoptarg = NULL;
- if ((GNoptind == 0)|| ! __getopt_initialized)
+ if ((GNoptind == 0) || ! __getopt_initialized)
{
if (GNoptind == 0)
GNoptind = 1; /* Don't scan ARGV[0], the program name. */
* is only used when the used in the GNU libc. */
#define NONOPTION_P (argv[GNoptind][0] != '-' || argv[GNoptind][1] == '\0')
- if ((nextchar == NULL)||(*nextchar == '\0'))
+ if ((nextchar == NULL) || (*nextchar == '\0'))
{
/* Advance to the next ARGV-element. */
/* If we have just processed some options following some non-options,
* exchange them so that the options come first. */
- if ((first_nonopt != last_nonopt) &&(last_nonopt != GNoptind) )
+ if ((first_nonopt != last_nonopt) && (last_nonopt != GNoptind) )
exchange ((char **) argv);
else if (last_nonopt != GNoptind)
first_nonopt = GNoptind;
{
GNoptind++;
- if ((first_nonopt != last_nonopt) &&(last_nonopt != GNoptind) )
+ if ((first_nonopt != last_nonopt) && (last_nonopt != GNoptind) )
exchange ((char **) argv);
else if (first_nonopt == last_nonopt)
first_nonopt = GNoptind;
* the ARGV-element is "-fu", do consider that an abbreviation of
* the long option, just like "--fu", and not "-f" with arg "u".
*
- * This distinction seems to be the most useful approach. */
-
- if ((longopts != NULL)&&
- ((argv[GNoptind][1] == '-')||
+ * This distinction seems to be the most useful approach. */if ((longopts != NULL) &&
+ ((argv[GNoptind][1] == '-') ||
(long_only &&
(argv[GNoptind][2] || ! my_index (optstring, argv[GNoptind][1])))))
{
* or the option starts with '--' or is not a valid short
* option, then it's an error.
* Otherwise interpret it as a short option. */
- if (! long_only ||(argv[GNoptind][1] == '-') ||
+ if (! long_only || (argv[GNoptind][1] == '-') ||
(my_index (optstring, *nextchar) == NULL) )
{
if (GNopterr)
if (*nextchar == '\0')
++GNoptind;
- if ((temp == NULL)||(c == ':'))
+ if ((temp == NULL) || (c == ':'))
{
if (GNopterr)
{
return '?';
}
/* Convenience. Treat POSIX -W foo same as long option --foo */
- if ((temp[0] == 'W')&&(temp[1] == ';'))
+ if ((temp[0] == 'W') && (temp[1] == ';'))
{
char *nameend;
const struct GNoption *p;
return GN_getopt_internal (argc, argv, options, long_options, opt_index, 0);
}
+
/* ******************** now the GNUnet specific modifications... ********************* */
/**
return GNoptind;
}
+
/* end of getopt.c */
return ret;
}
+
/* end of gnunet-config.c */
* n = 5/8 = 0 (bytes)
* rest = 5%8 = 5 (bits)
* mask = ~(2**(8 - 5) - 1) = ~(2**3 - 1) = ~(8 - 1) = ~b111 = b11111000
- */
- mask = ~((int) pow (2, 8 - rest) - 1);
+ */mask = ~((int) pow (2, 8 - rest) - 1);
target_byte = ((unsigned char *) &target_pub)[n] & mask;
}
else
return ret;
}
+
/* end of gnunet-ecc.c */
return ret;
}
+
/* end of gnunet-resolver.c */
return ret;
}
+
/* end of gnunet-scrypt.c */
return GNUNET_OK;
}
+
static void
cache_answers (const char *name,
struct GNUNET_DNSPARSER_Record *records,
}
}
+
/**
* We got a result from DNS. Add it to the cache and
* see if we can make our client happy...
/**
* MINIMIZE heap size (way below 128k) since this process doesn't need much.
*/
-void __attribute__ ((constructor)) GNUNET_RESOLVER_memory_init ()
+void __attribute__ ((constructor))
+GNUNET_RESOLVER_memory_init ()
{
mallopt (M_TRIM_THRESHOLD, 4 * 1024);
mallopt (M_TOP_PAD, 1 * 1024);
malloc_trim (0);
}
+
+
#endif
exit (-1);
}
+
/* end of timeout_watchdog.c */
return ((GNUNET_OK == ret) && (0 == exit_code)) ? 0 : 1;
}
+
/* end of gnunet-uri.c */
return sh;
}
+
/**
* Cancel a #GNUNET_HELPER_send operation. If possible, transmitting the
* message is also aborted, but at least 'cont' won't be
* stddev = (sum (val_i - avg)^2) / (n-1)
* = (sum (val_i^2 - 2 avg val_i + avg^2) / (n-1)
* = (sum (val_i^2) - 2 avg sum (val_i) + n * avg^2) / (n-1)
- */
- sum_val_i = (double) load->cummulative_delay;
+ */sum_val_i = (double) load->cummulative_delay;
n = ((double) load->cummulative_request_count);
nm1 = n - 1.0;
avgdel = sum_val_i / n;
}
-
/* end of load.c */
}
-
/* end of server_mst.c */
return num;
}
+
/* end of nc.c */
return GNUNET_SYSERR;
return GNUNET_OK;
}
+
+
#endif
GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) ? NULL : &tv);
}
+
/* end of network.c */
lnk[size] = '\0';
return GNUNET_strdup (lnk);
}
+
+
#endif
}
return NULL;
}
+
+
#endif
pclose (f);
return GNUNET_OK;
}
+
+
#endif
{
for (ifa_ptr = ifa_first; ifa_ptr != NULL; ifa_ptr = ifa_ptr->ifa_next)
{
- if ((ifa_ptr->ifa_name != NULL) &&(ifa_ptr->ifa_addr != NULL) &&
+ if ((ifa_ptr->ifa_name != NULL) && (ifa_ptr->ifa_addr != NULL) &&
( (ifa_ptr->ifa_flags & IFF_UP) != 0) )
{
if ((ifa_ptr->ifa_addr->sa_family != AF_INET) &&
}
-
/**
* Open '/dev/null' and make the result the given
* file descriptor.
return 0;
}
+
/* end of perf_crypto_asymmetric.c */
return 0;
}
+
/* end of perf_crypto_ecc_dlog.c */
return 0;
}
+
/* end of perf_crypto_hash.c */
return 0;
}
+
/* end of perf_crypto_paillier.c */
64 * 1024 / (1 +
GNUNET_TIME_absolute_get_duration
(start).rel_value_us / 1000LL), "keys/ms");
- */
- start = GNUNET_TIME_absolute_get ();
+ */start = GNUNET_TIME_absolute_get ();
GNUNET_CRYPTO_hash ("test", 4, &hc);
for (i = 0; i < 10; i++)
{
return 0;
}
+
/* end of perf_crypto_aes.c */
return 0;
}
+
/* end of perf_malloc.c */
specified in the configuration, remember the command-line option
in "cfg". This is typically really only having an effect if we
are running code in src/arm/, as obviously the rest of the code
- has little business with ARM-specific options. */
- if (GNUNET_YES != GNUNET_CONFIGURATION_have_value (cfg, "arm", "CONFIG"))
+ has little business with ARM-specific options. */if (GNUNET_YES != GNUNET_CONFIGURATION_have_value (cfg, "arm", "CONFIG"))
{
if (NULL != cc.cfgfile)
GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG", cc.cfgfile);
}
}
}
+
+
#endif
task, task_cls);
}
+
/**
* Schedule a new task to be run with a specified delay or when the
* specified file descriptor is ready. The delay can be
* this case gracefully because some libraries such as libmicrohttpd
* only provide a hint what the maximum FD number in an FD set might be
* and not the exact FD number (see e.g. gnunet-rest-service.c)
- */
- int no_fds_extracted = (0 == read_nhandles_len) &&
+ */int no_fds_extracted = (0 == read_nhandles_len) &&
(0 == read_fhandles_len) &&
(0 == write_nhandles_len) &&
(0 == write_fhandles_len);
*
* It might also mean we are busy-waiting because of a programming
* error in the external event loop.
- */
- LOG (GNUNET_ERROR_TYPE_DEBUG,
+ */LOG (GNUNET_ERROR_TYPE_DEBUG,
"GNUNET_SCHEDULER_do_work did not find any ready "
"tasks and timeout has not been reached yet.\n");
}
return ret;
}
+
void
GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx)
{
* connection.c tells us nothing itself, but mostly its timouts.
* Initially, we'll simply ignore this and leave massive timeouts, but
* maybe that should change for error handling pruposes. It appears that
- * successful operations, including DNS resolution, do not use this. */
- if (NULL == buf)
+ * successful operations, including DNS resolution, do not use this. */if (NULL == buf)
{
if (0 == ih->step)
{
port0 = 9050;
/* A typical Tor client should usually try port 9150 for the TBB too, but
* GNUnet can probably assume a system Tor installation. */
- if ((port0 > 65535)||(port0 <= 0))
+ if ((port0 > 65535) || (port0 <= 0))
{
LOG (GNUNET_ERROR_TYPE_WARNING,
_ (
return GNUNET_SOCKS_run_handshake (ih, socks5);
}
+
/* socks.c */
"Stopped execution speed up\n");
}
+
/* end of speedup.c */
* As for msvcrt, use the wide variant, which always returns utf16
* (otherwise we'd have to detect current codepage or use W32API character
* set conversion routines to convert to UTF8).
- */
-
- strftime (buf, sizeof(buf), "%a %b %d %H:%M:%S %Y", tp);
+ */strftime (buf, sizeof(buf), "%a %b %d %H:%M:%S %Y", tp);
return buf;
}
pp_state += 1;
continue;
}
- if (! (((path[i] >= 'A') &&(path[i] <= 'Z') ) ||
- ((path[i] >= 'a') &&(path[i] <= 'z') ) ||
- ((path[i] >= '0') &&(path[i] <= '9') ) ||(path[i] == '+') ||
+ if (! (((path[i] >= 'A') && (path[i] <= 'Z') ) ||
+ ((path[i] >= 'a') && (path[i] <= 'z') ) ||
+ ((path[i] >= '0') && (path[i] <= '9') ) || (path[i] == '+') ||
(path[i] == '-') || (path[i] == '.')))
end = 1;
break;
return ret;
}
+
#define cvtfind(a) \
((((a) >= 'A') && ((a) <= 'Z')) \
? (a) - 'A' \
return 0;
}
+
static int
test_nullstring_rw ()
{
return 0;
}
+
static int
test_emptystring_rw ()
{
return 0;
}
+
static int
test_bigstring_rw ()
{
return 0;
}
+
static int
test_bigmeta_rw ()
{
return 0;
}
+
static int
test_directory_r ()
{
return 0;
}
+
static int
test_nullfile_rw ()
{
return 0;
}
+
static int
test_fakestring_rw ()
{
return 0;
}
+
static int
test_fakemeta_rw ()
{
return 0;
}
+
static int
test_fakebigmeta_rw ()
{
return 0;
}
+
static int
check_string_rw ()
{
return 0;
}
+
static int
check_metadata_rw ()
{
return 0;
}
+
static int
check_file_rw ()
{
return 0;
}
+
int
main (int argc, char *argv[])
{
return 0;
}
+
/* end of test_bio.c */
return global_ret;
}
+
/* end of test_client.c */
return ret;
}
+
/* end of test_common_allocation.c */
return 0;
}
+
/* end of test_common_endian.c */
}
-
int
main (int argc, char *argv[])
{
return 0;
} /* end of main */
+
/* end of test_common_logging.c */
{
return GNUNET_NETWORK_socket_select (NULL, NULL, NULL, OUTPUT_DELAY);
}
+
+
#endif
return 0;
} /* end of main */
+
/* end of test_common_logging_dummy.c */
j = 0;
int stage = 0;
- if (! ((phase >= phase_from1)&&(phase <= phase_to1)) &&
- ! ((phase >= phase_from2)&&(phase <= phase_to2)))
+ if (! ((phase >= phase_from1) && (phase <= phase_to1)) &&
+ ! ((phase >= phase_from2) && (phase <= phase_to2)))
return p;
#if 0
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
return &r[i];
}
+
/**
* Up to 8 non-skipped GNUNET_log() calls
* + extra line with delay for each one
* | 7D * * * * * * * *
* | 8 * * * *
* | 9 * * * *
- */
- char *p = buf;
+ */char *p = buf;
- if ((bytes == LOG_BUFFER_SIZE)||
+ if ((bytes == LOG_BUFFER_SIZE) ||
! (p =
read_output_line (0, 3, 4, 9, 'L', "ERROR", -1,
1, phase, p,
return ok;
}
+
/* end of test_common_logging_runtime_loglevels.c */
option, &diffValue);
if (NULL != diffValue)
{
- if ((ret == GNUNET_SYSERR) ||(strcmp (diffValue, value) != 0) )
+ if ((ret == GNUNET_SYSERR) || (strcmp (diffValue, value) != 0) )
cbData->status = 1;
}
else
return diffsCB.cfgDiffs;
}
+
/**
* Checking configuration diffs
*/
return 0;
}
+
static const char *want[] = {
"/Hello",
"/File Name",
return GNUNET_SYSERR;
}
+
static int
testConfigFilenames ()
{
GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, hc);
}
+
static int
add_iterator (void *cls, struct GNUNET_HashCode *next)
{
return GNUNET_YES;
}
+
int
main (int argc, char *argv[])
{
return 0;
}
+
/* end of test_container_heap.c */
return GNUNET_OK;
}
+
static int
nstrcmp (const char *a, const char *b)
{
return strcmp (a, b);
}
+
static int
check ()
{
return check ();
}
+
/* end of test_container_heap.c */
return 0;
}
+
int
main (int argc, char *argv[])
{
return 0;
}
+
/* end of test_container_multihashmap.c */
return 0;
}
+
int
main (int argc, char *argv[])
{
return 0;
}
+
/* end of test_container_multihashmap.c */
return 0;
}
+
int
main (int argc, char *argv[])
{
return 0;
}
+
/* end of test_container_multipeermap.c */
}
-
int
main (int argc, char *argv[])
{
return 0;
}
+
/* end of test_crypto_ecc_dlog.c */
return 0;
}
+
/* end of test_crypto_ecdhe.c */
GNUNET_YES));
return ok;
}
+
+
#endif
return 0;
}
+
/* end of test_crypto_ecdsa.c */
GNUNET_YES));
return ok;
}
+
+
#endif
return 0;
}
+
/* end of test_crypto_eddsa.c */
return 0;
}
+
static int
testEncoding ()
{
return 0;
}
+
static int
testArithmetic ()
{
return 0;
}
+
static void
finished_task (void *cls, const struct GNUNET_HashCode *res)
{
return 0;
}
+
/* end of hashingtest.c */
#define LEN 1234
-int main ()
+int
+main ()
{
char data[1234];
struct GNUNET_HashCode hc1;
GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
}
+
void
tc2 ()
{
GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
}
+
void
tc3 ()
{
GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
}
+
void
tc4 ()
{
GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
}
+
void
tc5 ()
{
GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
}
+
void
tc6 ()
{
GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
}
+
void
tc7 ()
{
GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
}
+
void
tc8 ()
{
GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
}
+
int
main ()
{
return ret;
}
+
/* end of test_crypto_paillier.c */
return 0;
}
+
int
main (int argc, char *argv[])
{
return 0;
}
+
/* end of test_crypto_aes.c */
return 0;
}
+
static int ok;
return ret;
}
+
/* end of test_os_network.c */
return ret;
}
+
/* end of test_os_start_process.c */
* Attempt to convert pid = 0 (which is reserved)
* into a peer identity object, the peer identity memory
* is expected to be set to zero
- */
- GNUNET_log_skip (1, GNUNET_YES);
+ */GNUNET_log_skip (1, GNUNET_YES);
GNUNET_PEER_resolve (0, &res);
GNUNET_assert (0 ==
GNUNET_is_zero (&res));
return 0;
}
+
/* end of test_peer.c */
return 0;
}
+
/* end of test_plugin.c */
return NULL;
}
+
void *
libgnunet_plugin_test_done (void *arg)
{
return NULL;
}
+
/* end of test_plugin_plug.c */
return ok;
}
+
/* end of test_program.c */
return ret;
}
+
/* end of test_scheduler.c */
return 0;
}
+
/* end of test_scheduler_delay.c */
return ret;
}
+
/* end of test_service.c */
return ok;
}
+
/* end of test_socks.c */
return 1;
}
+
/* end of test_speedup.c */
}
}
-int main (int argc,
- char **argv)
+
+int
+main (int argc,
+ char **argv)
{
test_udp (4, 3, 22439);
test_udp (4, 1, 23467);
return ret;
}
+
/**
* Compute the time difference between the given start and end times.
* Use this function instead of actual subtraction to ensure that
return ret;
}
+
/**
* Get the duration of an operation as the
* difference of the current time and the given start time "whence".
/**
* Destructor
*/
-void __attribute__ ((destructor)) GNUNET_util_time_fini ()
+void __attribute__ ((destructor))
+GNUNET_util_time_fini ()
{
(void) GNUNET_TIME_absolute_get_monotonic (NULL);
}
+
/* end of time.c */
if (((GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (cfg,
"VPN",
"IPV6ADDR",
- &ipv6addr))||
+ &ipv6addr)) ||
(1 != inet_pton (AF_INET6, ipv6addr, &v6))))
{
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
if (((GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (cfg,
"vpn",
"IPV4ADDR",
- &ipv4addr))||
+ &ipv4addr)) ||
(1 != inet_pton (AF_INET, ipv4addr, &v4))))
{
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
if (((GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (cfg,
"vpn",
"IPV4MASK",
- &ipv4mask))||
+ &ipv4mask)) ||
(1 != inet_pton (AF_INET, ipv4mask, &v4))))
{
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
GNUNET_free (vh);
}
+
/* end of vpn_api.c */
* If no records are known (startup) or none present
* we can safely set the interval to the value for a single
* record
- */
- target_iteration_velocity_per_record = zone_publish_time_window;
+ */target_iteration_velocity_per_record = zone_publish_time_window;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
"No records in namestore database.\n");
}