Changeset 23:db6c40b8b307 in freeDiameter for freeDiameter/cnxctx.c
- Timestamp:
- Oct 20, 2009, 5:30:20 PM (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freeDiameter/cnxctx.c
r22 r23 214 214 break; 215 215 216 #ifndef DISABLE_SCTP 216 217 case IPPROTO_SCTP: 217 218 CHECK_FCT(fd_sctp_listen(conn->cc_socket)); 218 219 break; 220 #endif /* DISABLE_SCTP */ 219 221 220 222 default: … … 400 402 } 401 403 402 /* Get the list of endpoints (IP addresses) of the local and remote peers on this con enction */404 /* Get the list of endpoints (IP addresses) of the local and remote peers on this connection */ 403 405 int fd_cnx_getendpoints(struct cnxctx * conn, struct fd_list * local, struct fd_list * remote) 404 406 { … … 408 410 if (local) { 409 411 /* Retrieve the local endpoint(s) of the connection */ 410 TODO("TCP : getsockname"); 411 TODO("SCTP: sctp_getladdrs / _sctp_getboundaddrs (waaad)"); 412 switch (conn->cc_proto) { 413 case IPPROTO_TCP: { 414 sSS ss; 415 socklen_t sl; 416 CHECK_FCT(fd_tcp_get_local_ep(conn->cc_socket, &ss, &sl)); 417 CHECK_FCT(fd_ep_add_merge( local, (sSA *)&ss, sl, 0, 0, 0, 1 )); 418 } 419 break; 420 421 #ifndef DISABLE_SCTP 422 case IPPROTO_SCTP: { 423 CHECK_FCT(fd_sctp_get_local_ep(conn->cc_socket, local)); 424 } 425 break; 426 #endif /* DISABLE_SCTP */ 427 428 default: 429 CHECK_PARAMS(0); 430 } 412 431 } 413 432 414 433 if (remote) { 434 /* Check we have a full connection object, not a listening socket (with no remote) */ 435 CHECK_PARAMS( conn->cc_events ); 436 415 437 /* Retrieve the peer endpoint(s) of the connection */ 416 TODO("TCP : getpeername"); 417 TODO("SCTP: sctp_getpaddrs"); 418 419 } 420 421 return ENOTSUP; 438 switch (conn->cc_proto) { 439 case IPPROTO_TCP: { 440 sSS ss; 441 socklen_t sl; 442 CHECK_FCT(fd_tcp_get_remote_ep(conn->cc_socket, &ss, &sl)); 443 CHECK_FCT(fd_ep_add_merge( remote, (sSA *)&ss, sl, 0, 0, 0, 1 )); 444 } 445 break; 446 447 #ifndef DISABLE_SCTP 448 case IPPROTO_SCTP: { 449 CHECK_FCT(fd_sctp_get_remote_ep(conn->cc_socket, remote)); 450 } 451 break; 452 #endif /* DISABLE_SCTP */ 453 454 default: 455 CHECK_PARAMS(0); 456 } 457 } 458 459 return 0; 422 460 } 423 461
Note: See TracChangeset
for help on using the changeset viewer.