Changeset 1019:6fcd30ce3ce7 in freeDiameter
- Timestamp:
- Apr 1, 2013, 5:16:28 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/dbg_interactive/routing.i
r1013 r1019 66 66 fd_rtd_candidate_del($self, (os0_t)STRING, LENGTH); 67 67 } 68 void error(char * peerid, size_t peeridlen, char * STRING, size_t LENGTH, uint32_t rcode) { 69 int ret = fd_rtd_error_add($self, peerid, peeridlen, (os0_t)STRING, LENGTH, rcode); 70 if (ret != 0) { 71 DI_ERROR(ret, NULL, NULL); 72 } 68 int error(char * peerid, size_t peeridlen, char * STRING, size_t LENGTH, uint32_t rcode) { 69 int n; 70 int ret = fd_rtd_error_add($self, peerid, peeridlen, (os0_t)STRING, LENGTH, rcode, NULL, &n); 71 if (ret != 0) { 72 DI_ERROR(ret, NULL, NULL); 73 } 74 return n; 73 75 } 74 76 struct fd_list * extract(int score = 0) { -
extensions/rt_redirect/redir_fwd.c
r740 r1019 238 238 CHECK_FCT( fd_msg_rt_get(q, &rtd) ); 239 239 CHECK_FCT( fd_msg_source_get( m, &nh, &nhlen ) ); 240 CHECK_FCT( fd_rtd_error_add(rtd, nh, nhlen, a_oh->os.data, a_oh->os.len, a_rc->u32 ) );240 CHECK_FCT( fd_rtd_error_add(rtd, nh, nhlen, a_oh->os.data, a_oh->os.len, a_rc->u32, NULL, NULL) ); 241 241 242 242 /* Create a redir_rule */ -
include/freeDiameter/libfdproto.h
r1014 r1019 2048 2048 void fd_rtd_candidate_extract(struct rt_data * rtd, struct fd_list ** candidates, int ini_score); 2049 2049 2050 /* If a peer returned a protocol error for this message, save it so that we don't try to send it there again */2051 int fd_rtd_error_add(struct rt_data * rtd, DiamId_t sentto, size_t senttolen, uint8_t * origin, size_t originsz, uint32_t rcode );2050 /* 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. */ 2051 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); 2052 2052 2053 2053 /* The extracted list items have the following structure: */ 2054 2054 struct rtd_candidate { 2055 struct fd_list chain; /* link in the list returned by the previous fct */2055 struct fd_list chain; /* link in the list returned by the previous fcts */ 2056 2056 DiamId_t diamid; /* the diameter Id of the peer */ 2057 2057 size_t diamidlen; /* cached size of the diamid string */ -
libfdproto/rt_data.c
r740 r1019 43 43 /* Structure that contains the routing data for a message */ 44 44 struct 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 */ 46 46 struct fd_list candidates; /* All the candidates. Items are struct rtd_candidate. */ 47 47 struct fd_list errors; /* All errors received from other peers for this message */ … … 185 185 /* If a peer returned a protocol error for this message, save it so that we don't try to send it there again. 186 186 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 )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, struct fd_list ** candidates, int * sendingattemtps) 188 188 { 189 189 struct fd_list * li; 190 190 int match = 0; 191 191 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); 193 193 CHECK_PARAMS( rtd && sentto && senttolen ); /* origin may be NULL */ 194 194 … … 239 239 fd_rtd_candidate_del(rtd, origin, originsz); 240 240 241 if (candidates) 242 *candidates = &rtd->candidates; 243 244 if (sendingattemtps) 245 *sendingattemtps = rtd->extracted; 246 241 247 /* Done! */ 242 248 return 0; … … 260 266 } 261 267 262 rtd->extracted = 1;268 rtd->extracted += 1; 263 269 return; 264 270 }
Note: See TracChangeset
for help on using the changeset viewer.