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/>.
struct GNUNET_MessageHeader header;
/**
- * Zero.
+ * Offset of the peer that was requested.
*/
- uint32_t reserved GNUNET_PACKED;
+ uint32_t off GNUNET_PACKED;
};
* Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS
*/
struct GNUNET_MessageHeader header;
-
+
/**
* Number of paths.
*/
* Do we have a tunnel toward this peer?
*/
int16_t tunnel GNUNET_PACKED;
-
+
/**
* Shortest known path.
*/
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/>.
* Backoff for reconnect attempts.
*/
struct GNUNET_TIME_Relative backoff;
-
+
/**
* Peer we want information about.
*/
/**
* Process a local peer info reply, pass info to the user.
*
- * @param cls Closure
+ * @param cls Closure
* @param message Message itself.
*/
static void
{
struct GNUNET_CADET_GetPath *gp = cls;
struct GNUNET_CADET_PeerPathDetail ppd;
-
+
ppd.peer = gp->id;
ppd.path = (const struct GNUNET_PeerIdentity *) &message[1];
+ ppd.target_offset = ntohl (message->off);
ppd.path_length = (ntohs (message->header.size) - sizeof (*message))
/ sizeof (struct GNUNET_PeerIdentity);
gp->path_cb (gp->path_cb_cls,
/**
* Process a local peer info reply, pass info to the user.
*
- * @param cls Closure
+ * @param cls Closure
* @param message Message itself.
*/
static void
gp);
}
-
+
/**
* Reconnect to the service and try again.
*
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/>.
/**
* Active peer listing operation.
- */
+ */
static struct GNUNET_CADET_PeersLister *plo;
/**
{
GNUNET_CADET_channel_destroy (ch);
ch = NULL;
- }
+ }
if (NULL != gpo)
{
GNUNET_CADET_get_path_cancel (gpo);
if (GNUNET_NO == echo)
{
// Use MQ's notification if too much data of stdin is pooring in too fast.
- if (STREAM_BUFFER_SIZE < sent_pkt)
+ if (STREAM_BUFFER_SIZE < sent_pkt)
{
GNUNET_MQ_notify_sent (env, mq_cb, cls);
sent_pkt = 0;
}
- else
+ else
{
listen_stdio ();
}
ppd->path_length);
for (unsigned int i = 0; i < ppd->path_length; i++)
FPRINTF (stdout,
- "%s ",
+ (i == ppd->target_offset) ? "*%s* " : "%s ",
GNUNET_i2s (&ppd->path[i]));
FPRINTF (stdout,
"\n");
GNUNET_CRYPTO_eddsa_public_key_from_string (peer_id,
strlen (peer_id),
&pid.public_key))
- {
+ {
fprintf (stderr,
_("Invalid peer ID `%s'\n"),
peer_id);
GNUNET_GETOPT_option_flag ('e',
"echo",
gettext_noop ("Activate echo mode"),
- &echo),
+ &echo),
GNUNET_GETOPT_option_string ('o',
"open-port",
"SHARED_SECRET",
path_length = GCPP_get_length (path);
path_size = sizeof (struct GNUNET_PeerIdentity) * path_length;
if (sizeof (*resp) + path_size > UINT16_MAX)
+ {
+ /* try just giving the relevant path */
+ path_length = GNUNET_MIN ((UINT16_MAX - sizeof (*resp)) / sizeof (struct GNUNET_PeerIdentity),
+ off);
+ path_size = sizeof (struct GNUNET_PeerIdentity) * path_length;
+ }
+ if (sizeof (*resp) + path_size > UINT16_MAX)
{
LOG (GNUNET_ERROR_TYPE_WARNING,
"Path of %u entries is too long for info message\n",
/* Don't copy first peer. First peer is always the local one. Last
* peer is always the destination (leave as 0, EOL).
*/
- for (unsigned int i = 0; i <= off; i++)
+ for (unsigned int i = 0; i < path_length; i++)
id[i] = *GCP_get_id (GCPP_get_peer_at_offset (path,
i));
+ resp->off = htonl (off);
GNUNET_MQ_send (mq,
env);
return GNUNET_YES;
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/>.
/**
* Internal details about a channel.
- */
+ */
struct GNUNET_CADET_ChannelInternals
{
/**
/**
* Information we return per peer.
- */
+ */
struct GNUNET_CADET_PeerListEntry
{
/**
/**
* Number of disjoint known paths to @e peer.
- */
+ */
unsigned int n_paths;
/**
/**
* Detailed information we return per peer.
- */
+ */
struct GNUNET_CADET_PeerPathDetail
{
/**
*/
struct GNUNET_PeerIdentity peer;
+ /**
+ * Offset of the target peer on the @e path.
+ */
+ unsigned int target_offset;
+
/**
* Number of entries on the @e path.
*/
/**
* How many channels use the tunnel.
- */
+ */
uint32_t channels;
/**
uint16_t estate;
/**
- * What is our connectivity state?
- */
+ * What is our connectivity state?
+ */
uint16_t cstate;
};
[cadet]
OPTIONS=-l /tmp/rps_profiler_logs/cadet-[]-%Y-%m-%d.log
-PREFIX = valgrind
+PREFIX = valgrind --log-file=/home/grothoff/cadet.%p.log
#[arm]
#GLOBAL_POSTFIX=-l /tmp/rps_profiler_logs/other-[]-%Y-%m-%d.log