/*
This file is part of GNUnet.
- Copyright (C) 2009, 2015 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2009, 2015 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
* If a callback is specified, invoke it with the attribute.
*
* @param data the packet
- * @param len the length of the packet
- * @param arg sockaddr_in where we will set our discovered packet
+ * @param len the length of the packet in @a data
+ * @param[out] arg sockaddr_in where we will set our discovered address
*
* @return, #GNUNET_OK on OK, #GNUNET_NO if the packet is invalid (not a stun packet)
*/
message_magic_cookie = ntohl(hdr->magic);
/* Compare if the cookie match */
- if(STUN_MAGIC_COOKIE != message_magic_cookie)
+ if (STUN_MAGIC_COOKIE != message_magic_cookie)
{
LOG (GNUNET_ERROR_TYPE_INFO,
"Invalid magic cookie \n");
return GNUNET_NO;
}
len = advertised_message_size;
- memset (&st,0, sizeof(st));
+ memset (&st, 0, sizeof(st));
while (len > 0)
{
(int)len);
break;
}
- stun_get_mapped (&st, attr, arg, hdr->magic);
+ stun_get_mapped (&st,
+ attr,
+ arg,
+ hdr->magic);
/* Clear attribute id: in case previous entry was a string,
* this will act as the terminator for the string.
*/
/* sending STUN request done, let's wait for replies... */
rh->cb (rh->cb_cls,
GNUNET_NAT_ERROR_SUCCESS);
+ GNUNET_NAT_stun_make_request_cancel (rh);
}