Navigation


Changeset 1019:6fcd30ce3ce7 in freeDiameter for libfdproto


Ignore:
Timestamp:
Apr 1, 2013, 5:16:28 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Retrieve additional information when adding a routing error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdproto/rt_data.c

    r740 r1019  
    4343/* Structure that contains the routing data for a message */
    4444struct rt_data {
    45         int             extracted;      /* if 0, candidates is ordered by diamid, otherwise the order is unspecified */
     45        int             extracted;      /* if 0, candidates is ordered by diamid, otherwise the order is unspecified. This also counts the number of times the message was (re-)sent, as a side effect */
    4646        struct fd_list  candidates;     /* All the candidates. Items are struct rtd_candidate. */
    4747        struct fd_list  errors;         /* All errors received from other peers for this message */
     
    185185/* If a peer returned a protocol error for this message, save it so that we don't try to send it there again.
    186186 Case insensitive search since the names are received from other peers*/
    187 int  fd_rtd_error_add(struct rt_data * rtd, DiamId_t sentto, size_t senttolen, uint8_t * origin, size_t originsz, uint32_t rcode)
     187int  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)
    188188{
    189189        struct fd_list * li;
    190190        int match = 0;
    191191       
    192         TRACE_ENTRY("%p %p %zd %p %zd %u", rtd, sentto, senttolen, origin, originsz, rcode);
     192        TRACE_ENTRY("%p %p %zd %p %zd %u %p %p", rtd, sentto, senttolen, origin, originsz, rcode, candidates, sendingattemtps);
    193193        CHECK_PARAMS( rtd && sentto && senttolen ); /* origin may be NULL */
    194194       
     
    239239                fd_rtd_candidate_del(rtd, origin, originsz);
    240240       
     241        if (candidates)
     242                *candidates = &rtd->candidates;
     243       
     244        if (sendingattemtps)
     245                *sendingattemtps = rtd->extracted;
     246       
    241247        /* Done! */
    242248        return 0;
     
    260266        }
    261267       
    262         rtd->extracted = 1;
     268        rtd->extracted += 1;
    263269        return;
    264270}
Note: See TracChangeset for help on using the changeset viewer.