# HG changeset patch # User Sebastien Decugis # Date 1367837399 -28800 # Node ID 4d2dcb54d9a6480c5a5ae9fb59545f11533f00d5 # Parent 97a257c80de007701063924c460d75be57c88b71 New function fd_rtd_get_nb_attempts diff -r 97a257c80de0 -r 4d2dcb54d9a6 include/freeDiameter/libfdproto.h --- a/include/freeDiameter/libfdproto.h Mon May 06 18:25:50 2013 +0800 +++ b/include/freeDiameter/libfdproto.h Mon May 06 18:49:59 2013 +0800 @@ -2084,6 +2084,9 @@ /* If a peer returned a protocol error for this message, save it so that we don't try to send it there again. Optionally retrieve the current list of candidates. */ int fd_rtd_error_add(struct rt_data * rtd, DiamId_t sentto, size_t senttolen, uint8_t * origin, size_t originsz, uint32_t rcode, struct fd_list ** candidates, int * sendingattemtps); +/* Only retrieve the number of times this message has been processed by the routing-out mechanism (i.e. number of times it was failed over) */ +int fd_rtd_get_nb_attempts(struct rt_data * rtd, int * sendingattemtps); + /* The extracted list items have the following structure: */ struct rtd_candidate { struct fd_list chain; /* link in the list returned by the previous fcts */ diff -r 97a257c80de0 -r 4d2dcb54d9a6 libfdproto/rt_data.c --- a/libfdproto/rt_data.c Mon May 06 18:25:50 2013 +0800 +++ b/libfdproto/rt_data.c Mon May 06 18:49:59 2013 +0800 @@ -248,6 +248,21 @@ return 0; } +/* Only retrieve the number of times this message has been processed by the routing-out mechanism (i.e. number of times it was failed over) */ +int fd_rtd_get_nb_attempts(struct rt_data * rtd, int * sendingattemtps) +{ + struct fd_list * li; + int match = 0; + + TRACE_ENTRY("%p %p", rtd, sendingattemtps); + CHECK_PARAMS( rtd && sendingattemtps ); + + *sendingattemtps = rtd->extracted; + + /* Done! */ + return 0; +} + /* Extract the list of valid candidates, and initialize their scores */ void fd_rtd_candidate_extract(struct rt_data * rtd, struct fd_list ** candidates, int ini_score) {