Navigation


Changeset 23:db6c40b8b307 in freeDiameter for freeDiameter/tcp.c


Ignore:
Timestamp:
Oct 20, 2009, 5:30:20 PM (15 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Added some code in cnxctx.c mainly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freeDiameter/tcp.c

    r22 r23  
    3737#include <netinet/tcp.h>
    3838#include <netinet/ip6.h>
     39#include <sys/socket.h>
    3940
    4041/* Set the socket options for TCP sockets, before bind is called */
     
    111112        return 0;
    112113}
     114
     115/* Get the local name of a TCP socket -- would be nice if it did not return "0.0.0.0"... */
     116int fd_tcp_get_local_ep(int sock, sSS * ss, socklen_t *sl)
     117{
     118        TRACE_ENTRY("%d %p %p", sock, ss, sl);
     119        CHECK_PARAMS( ss && sl );
     120       
     121        *sl = sizeof(sSS);
     122        CHECK_SYS(getsockname(sock, (sSA *)ss, sl));
     123       
     124        return 0;
     125}
     126
     127/* Get the remote name of a TCP socket */
     128int fd_tcp_get_remote_ep(int sock, sSS * ss, socklen_t *sl)
     129{
     130        TRACE_ENTRY("%d %p %p", sock, ss, sl);
     131        CHECK_PARAMS( ss && sl );
     132       
     133        *sl = sizeof(sSS);
     134        CHECK_SYS(getpeername(sock, (sSA *)ss, sl));
     135       
     136        return 0;
     137}
Note: See TracChangeset for help on using the changeset viewer.