size_t
GNUNET_HELLO_add_address (const char *tname,
struct GNUNET_TIME_Absolute expiration,
- const void *addr,
- uint16_t addr_len, char *target, size_t max)
+ const void *addr, uint16_t addr_len, char *target,
+ size_t max)
{
uint16_t alen;
size_t slen;
memcpy (&expire,
&inptr[esize - alen - sizeof (struct GNUNET_TIME_AbsoluteNBO)],
sizeof (struct GNUNET_TIME_AbsoluteNBO));
- iret = it (it_cls,
- inptr,
- GNUNET_TIME_absolute_ntoh (expire), &inptr[esize - alen], alen);
+ iret =
+ it (it_cls, inptr, GNUNET_TIME_absolute_ntoh (expire),
+ &inptr[esize - alen], alen);
if (iret == GNUNET_SYSERR)
{
if (ret != NULL)
static int
-get_match_exp (void *cls,
- const char *tname,
- struct GNUNET_TIME_Absolute expiration,
- const void *addr, uint16_t addrlen)
+get_match_exp (void *cls, const char *tname,
+ struct GNUNET_TIME_Absolute expiration, const void *addr,
+ uint16_t addrlen)
{
struct ExpireContext *ec = cls;
- if ((addrlen == ec->addrlen) &&
- (0 == memcmp (addr, ec->addr, addrlen)) &&
+ if ((addrlen == ec->addrlen) && (0 == memcmp (addr, ec->addr, addrlen)) &&
(0 == strcmp (tname, ec->tname)))
{
ec->found = GNUNET_YES;
static int
-copy_latest (void *cls,
- const char *tname,
- struct GNUNET_TIME_Absolute expiration,
- const void *addr, uint16_t addrlen)
+copy_latest (void *cls, const char *tname,
+ struct GNUNET_TIME_Absolute expiration, const void *addr,
+ uint16_t addrlen)
{
struct MergeContext *mc = cls;
struct ExpireContext ec;
((ec.expiration.abs_value == expiration.abs_value) &&
(mc->take_equal == GNUNET_YES)))
{
- mc->ret += GNUNET_HELLO_add_address (tname,
- expiration,
- addr,
- addrlen,
- &mc->buf[mc->ret], mc->max - mc->ret);
+ mc->ret +=
+ GNUNET_HELLO_add_address (tname, expiration, addr, addrlen,
+ &mc->buf[mc->ret], mc->max - mc->ret);
}
return GNUNET_OK;
}
static int
-delta_match (void *cls,
- const char *tname,
- struct GNUNET_TIME_Absolute expiration,
- const void *addr, uint16_t addrlen)
+delta_match (void *cls, const char *tname,
+ struct GNUNET_TIME_Absolute expiration, const void *addr,
+ uint16_t addrlen)
{
struct DeltaContext *dc = cls;
int ret;
ec.addrlen = addrlen;
ec.found = GNUNET_NO;
ec.tname = tname;
- GNUNET_HELLO_iterate_addresses (dc->old_hello,
- GNUNET_NO, &get_match_exp, &ec);
+ GNUNET_HELLO_iterate_addresses (dc->old_hello, GNUNET_NO, &get_match_exp,
+ &ec);
if ((ec.found == GNUNET_YES) &&
((ec.expiration.abs_value > expiration.abs_value) ||
(ec.expiration.abs_value >= dc->expiration_limit.abs_value)))
static int
-find_other_matching (void *cls,
- const char *tname,
- struct GNUNET_TIME_Absolute expiration,
- const void *addr, uint16_t addrlen)
+find_other_matching (void *cls, const char *tname,
+ struct GNUNET_TIME_Absolute expiration, const void *addr,
+ uint16_t addrlen)
{
struct EqualsContext *ec = cls;
if (expiration.abs_value < ec->expiration_limit.abs_value)
return GNUNET_YES;
- if ((addrlen == ec->addrlen) &&
- (0 == strcmp (tname,
- ec->tname)) && (0 == memcmp (addr, ec->addr, addrlen)))
+ if ((addrlen == ec->addrlen) && (0 == strcmp (tname, ec->tname)) &&
+ (0 == memcmp (addr, ec->addr, addrlen)))
{
ec->found = GNUNET_YES;
if (expiration.abs_value < ec->expiration.abs_value)
static int
-find_matching (void *cls,
- const char *tname,
- struct GNUNET_TIME_Absolute expiration,
- const void *addr, uint16_t addrlen)
+find_matching (void *cls, const char *tname,
+ struct GNUNET_TIME_Absolute expiration, const void *addr,
+ uint16_t addrlen)
{
struct EqualsContext *ec = cls;
* @param h2 the second HELLO message
* @param now time to use for deciding which addresses have
* expired and should not be considered at all
- * @return absolute time forever if the two HELLOs are
+ * @return absolute time forever if the two HELLOs are
* totally identical; smallest timestamp >= now if
- * they only differ in timestamps;
+ * they only differ in timestamps;
* zero if the some addresses with expirations >= now
* do not match at all
*/
struct GNUNET_TIME_Absolute
-GNUNET_HELLO_equals (const struct
- GNUNET_HELLO_Message *h1,
- const struct
- GNUNET_HELLO_Message *h2, struct GNUNET_TIME_Absolute now)
+GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1,
+ const struct GNUNET_HELLO_Message *h2,
+ struct GNUNET_TIME_Absolute now)
{
struct EqualsContext ec;
- if (0 != memcmp (&h1->publicKey,
- &h2->publicKey,
- sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))
+ if (0 !=
+ memcmp (&h1->publicKey, &h2->publicKey,
+ sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))
return GNUNET_TIME_UNIT_ZERO_ABS;
ec.expiration_limit = now;
ec.result = GNUNET_TIME_UNIT_FOREVER_ABS;