Mercurial > hg > freeDiameter
comparison libfdcore/peers.c @ 1186:56c36d1007b4
Further preparation of the DTLS integration. Some cleanups in the GNUTLS handling.
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Fri, 07 Jun 2013 18:48:34 +0800 |
parents | 23695957bfc0 |
children | f40de74bd1c7 |
comparison
equal
deleted
inserted
replaced
1185:23695957bfc0 | 1186:56c36d1007b4 |
---|---|
255 | 255 |
256 /* Done */ | 256 /* Done */ |
257 return; | 257 return; |
258 } | 258 } |
259 | 259 |
260 /* Describe the current connection */ | |
261 int fd_peer_cnx_proto_info(struct peer_hdr *peer, char * buf, size_t len) | |
262 { | |
263 struct fd_peer * p = (struct fd_peer *)peer; | |
264 TRACE_ENTRY("%p %p %zd", peer, buf, len); | |
265 CHECK_PARAMS(CHECK_PEER(peer) && buf && len); | |
266 | |
267 if (p->p_cnxctx) { | |
268 CHECK_FCT(fd_cnx_proto_info(p->p_cnxctx, buf, len)); | |
269 } else if (p->p_receiver) { | |
270 CHECK_FCT(fd_cnx_proto_info(p->p_receiver, buf, len)); | |
271 } else { | |
272 snprintf(buf, len, "Not Connected"); | |
273 } | |
274 | |
275 return 0; | |
276 } | |
277 | |
260 /* Return the value of srlist->cnt */ | 278 /* Return the value of srlist->cnt */ |
261 int fd_peer_get_load_pending(struct peer_hdr *peer, long * to_receive, long * to_send) | 279 int fd_peer_get_load_pending(struct peer_hdr *peer, long * to_receive, long * to_send) |
262 { | 280 { |
263 struct fd_peer * p = (struct fd_peer *)peer; | 281 struct fd_peer * p = (struct fd_peer *)peer; |
264 TRACE_ENTRY("%p %p %p", peer, to_receive, to_send); | 282 TRACE_ENTRY("%p %p %p", peer, to_receive, to_send); |
509 CHECK_FCT( fd_msg_rescode_set(*cer, "DIAMETER_INVALID_AVP_VALUE", | 527 CHECK_FCT( fd_msg_rescode_set(*cer, "DIAMETER_INVALID_AVP_VALUE", |
510 "Your Origin-Host contains invalid characters.", avp_oh, 1 ) ); | 528 "Your Origin-Host contains invalid characters.", avp_oh, 1 ) ); |
511 | 529 |
512 fd_hook_call(HOOK_PEER_CONNECT_FAILED, *cer, NULL, "Received CER with invalid Origin-Host AVP", NULL); | 530 fd_hook_call(HOOK_PEER_CONNECT_FAILED, *cer, NULL, "Received CER with invalid Origin-Host AVP", NULL); |
513 | 531 |
514 CHECK_FCT( fd_out_send(cer, *cnx, NULL, FD_CNX_ORDERED) ); | 532 CHECK_FCT( fd_out_send(cer, *cnx, NULL) ); |
515 return EINVAL; | 533 return EINVAL; |
516 } | 534 } |
517 | 535 |
518 /* Search if we already have this peer id in our list. We take directly the write lock so that we don't need to upgrade if it is a new peer. | 536 /* Search if we already have this peer id in our list. We take directly the write lock so that we don't need to upgrade if it is a new peer. |
519 * There is space for a small optimization here if needed. | 537 * There is space for a small optimization here if needed. |