Navigation


Changeset 23:db6c40b8b307 in freeDiameter for include


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

Location:
include/freeDiameter
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/CMakeLists.txt

    r17 r23  
    1010
    1111# Disable SCTP support completly ?
    12 OPTION(DISABLE_SCTP "Disable SCTP support?")
     12OPTION(DISABLE_SCTP "Disable SCTP support?" OFF)
     13IF (NOT DISABLE_SCTP)
     14        OPTION(DEBUG_SCTP "Verbose SCTP (for debug)?" OFF)
     15ENDIF (NOT DISABLE_SCTP)
    1316
    1417# Find TODO items in the code easily ?
  • include/freeDiameter/freeDiameter-host.h.in

    r13 r23  
    4545
    4646#cmakedefine DISABLE_SCTP
     47#cmakedefine DEBUG_SCTP
    4748#cmakedefine ERRORS_ON_TODO
    4849#cmakedefine DEBUG
  • include/freeDiameter/freeDiameter.h

    r22 r23  
    118118struct fd_endpoint {
    119119        struct fd_list  chain;  /* link in cnf_endpoints list */
    120         sSS             ss;     /* the socket information. List is always ordered by ss value (memcmp) */
     120        union {
     121                sSS             ss;     /* the socket information. List is always ordered by ss value (memcmp) */
     122                sSA4            sin;
     123                sSA6            sin6;
     124                sSA             sa;
     125        };
    121126        struct {
    122127                unsigned conf : 1; /* This endpoint is statically configured in a configuration file */
     
    129134        }               meta;   /* Additional information about the endpoint */
    130135};
     136
     137/* Add a new entry in a list of endpoints -- merge if the sockaddr was already there */
     138int fd_ep_add_merge( struct fd_list * list, sSA * sa, socklen_t sl, int conf, int disc, int adv, int ll );
    131139
    132140/* Applications */
  • include/freeDiameter/libfreeDiameter.h

    r22 r23  
    329329                        flag);                                  \
    330330          if (__rc)                                             \
    331                 fd_log_debug((char *)gai_strerror(__rc));       \
     331                fd_log_debug("%s", (char *)gai_strerror(__rc)); \
    332332          else                                                  \
    333                 fd_log_debug(&__addrbuf[0]);                    \
     333                fd_log_debug("%s", &__addrbuf[0]);              \
    334334        } else {                                                \
    335335                fd_log_debug("(NULL / ANY)");                   \
    336336        }                                                       \
    337337}
    338 /* if needed, add sSA_DUMP_SERVICE */
     338/* Same, for a service */
     339#define sSA_DUMP_SERV( sa, flag ) {                             \
     340        sSA * __sa = (sSA *)(sa);                               \
     341        char __servbuf[32];                                     \
     342        if (__sa) {                                             \
     343          int __rc = getnameinfo(__sa,                          \
     344                        sizeof(sSS),                            \
     345                        NULL,                                   \
     346                        0,                                      \
     347                        __servbuf,                              \
     348                        sizeof(__servbuf),                      \
     349                        flag);                                  \
     350          if (__rc)                                             \
     351                fd_log_debug("%s", (char *)gai_strerror(__rc)); \
     352          else                                                  \
     353                fd_log_debug("%s", &__servbuf[0]);              \
     354        } else {                                                \
     355                fd_log_debug("(unknown)");                      \
     356        }                                                       \
     357}
     358/* Combine both */
     359#define sSA_DUMP_NODE_SERV( sa, flag ) {                                \
     360        sSA * __sa = (sSA *)(sa);                                       \
     361        char __addrbuf[INET6_ADDRSTRLEN];                               \
     362        char __servbuf[32];                                             \
     363        if (__sa) {                                                     \
     364          int __rc = getnameinfo(__sa,                                  \
     365                        sizeof(sSS),                                    \
     366                        __addrbuf,                                      \
     367                        sizeof(__addrbuf),                              \
     368                        __servbuf,                                      \
     369                        sizeof(__servbuf),                              \
     370                        flag);                                          \
     371          if (__rc)                                                     \
     372                fd_log_debug("%s", (char *)gai_strerror(__rc));         \
     373          else                                                          \
     374                fd_log_debug("[%s]:%s", &__addrbuf[0],&__servbuf[0]);   \
     375        } else {                                                        \
     376                fd_log_debug("(NULL / ANY)");                           \
     377        }                                                               \
     378}
     379
    339380
    340381/* A l4 protocol name (TCP / SCTP) */
Note: See TracChangeset for help on using the changeset viewer.