Mercurial > hg > freeDiameter
changeset 1097:4d2dcb54d9a6
New function fd_rtd_get_nb_attempts
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Mon, 06 May 2013 18:49:59 +0800 |
parents | 97a257c80de0 |
children | f38d77f9cfd3 6ce5c99a40af |
files | include/freeDiameter/libfdproto.h libfdproto/rt_data.c |
diffstat | 2 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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 */
--- 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) {