Navigation


Changeset 1107:96f2051215c8 in freeDiameter for extensions


Ignore:
Timestamp:
May 12, 2013, 11:39:07 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Replaced calls to TRACE_sSA and sSA_DUMP_NODE* macros

Location:
extensions/app_radgw
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_radgw/rgw_clients.c

    r1033 r1107  
    921921        /* Dump the entry in debug mode */
    922922        if (TRACE_BOOL(FULL + 1 )) {
     923                char sa_buf[sSA_DUMP_STRLEN];
     924                fd_sa_sdump_numeric(sa_buf, ip_port);
    923925                TRACE_DEBUG(FULL, "Adding %s:", (type == RGW_CLI_NAS) ? "NAS" : "PROXY"  );
    924                 TRACE_sSA(FD_LOG_DEBUG, FULL,    "\tIP : ", ip_port, NI_NUMERICHOST | NI_NUMERICSERV, "" );
     926                TRACE_DEBUG(FULL, "\tIP : %s", sa_buf );
    925927                TRACE_BUFFER(FD_LOG_DEBUG, FULL, "\tKey: [", *key, keylen, "]" );
    926928        }
     
    941943       
    942944        if (ret == EEXIST) {
     945                char sa_buf[sSA_DUMP_STRLEN];
    943946                /* Check if the key is the same, then skip or return an error */
    944947                if ((keylen == prev->key.len ) && ( ! memcmp(*key, prev->key.data, keylen) ) && (type == prev->type)) {
     
    950953                fd_log_error("ERROR: Conflicting RADIUS clients descriptions!");
    951954                TRACE_ERROR("Previous entry: %s", (prev->type == RGW_CLI_NAS) ? "NAS" : "PROXY");
    952                 TRACE_sSA(FD_LOG_ERROR, NONE,    "\tIP : ", prev->sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );
     955                fd_sa_sdump_numeric(sa_buf, prev->sa);
     956                TRACE_ERROR("\tIP : %s", sa_buf);
    953957                TRACE_BUFFER(FD_LOG_ERROR, NONE, "\tKey: [", prev->key.data, prev->key.len, "]" );
    954958                TRACE_ERROR("Conflicting entry: %s", (type == RGW_CLI_NAS) ? "NAS" : "PROXY");
    955                 TRACE_sSA(FD_LOG_ERROR, NONE,    "\tIP : ", ip_port, NI_NUMERICHOST | NI_NUMERICSERV, "" );
     959                fd_sa_sdump_numeric(sa_buf, ip_port);
     960                TRACE_ERROR("\tIP : %s", sa_buf);
    956961                TRACE_BUFFER(FD_LOG_ERROR, NONE, "\tKey: [", *key, keylen, "]" );
    957962        }
     
    969974       
    970975        for (ref = senti->next; ref != senti; ref = ref->next) {
     976                char sa_buf[sSA_DUMP_STRLEN];
    971977                client = (struct rgw_client *)ref;
    972978                /* TODO: use a fct param instead of hardcoded FD_LOG_DEBUG */
    973                 TRACE_sSA(FD_LOG_DEBUG, NONE,    "  - ", client->sa, NI_NUMERICHOST | NI_NUMERICSERV, (client->type == RGW_CLI_NAS) ? "" : " [PROXY]" );
     979                TODO("Replace with appropriate code");
     980/*              TRACE_sSA(FD_LOG_DEBUG, NONE,    "  - ", client->sa, NI_NUMERICHOST | NI_NUMERICSERV, (client->type == RGW_CLI_NAS) ? "" : " [PROXY]" ); */
    974981        }
    975982}
  • extensions/app_radgw/rgw_servers.c

    r1027 r1107  
    111111        while (1) {
    112112                struct sockaddr_storage from;
     113                char sa_buf[sSA_DUMP_STRLEN];
    113114                socklen_t fromlen = sizeof(from);
    114115                int len;
     
    133134                }
    134135               
    135                 {
    136                         char __buf[1024];
    137                         sSA_DUMP_NODE_SERV(__buf, sizeof(__buf), &from, NI_NUMERICHOST | NI_NUMERICSERV );
    138                         TRACE_DEBUG(FULL, "Received %d bytes from %s", len, __buf);
    139                 }
     136                fd_sa_sdump_numeric(sa_buf, (sSA*)&from);
     137                TRACE_DEBUG(FULL, "Received %d bytes from %s", len, sa_buf);
    140138               
    141139                /* Search the associated client definition, if any */
    142140                CHECK_FCT_DO( rgw_clients_search((struct sockaddr *) &from, &nas_info),
    143141                        {
    144                                 TRACE_NOTICE("Discarding %d bytes received from unknown IP:", len);
    145                                 TRACE_sSA(FD_LOG_NOTICE, INFO, " ", &from, NI_NUMERICHOST | NI_NUMERICSERV, "" );
     142                                TRACE_NOTICE("Discarding %d bytes received from unknown IP: %s", len, sa_buf);
    146143                                continue;
    147144                        } );
     
    250247        int ret = 0;
    251248        struct sockaddr_storage sto;
     249        char sa_buf[sSA_DUMP_STRLEN];
    252250       
    253251        /* Find the appropriate socket to use (not sure if it is important) */
     
    276274        }
    277275       
    278         {
    279                 char __buf[1024];
    280                 sSA_DUMP_NODE_SERV(__buf, sizeof(__buf), &sto, NI_NUMERICHOST | NI_NUMERICSERV );
    281                 TRACE_DEBUG(FULL, "Sending %zd bytes to %s", buflen, __buf);
    282         }
     276        fd_sa_sdump_numeric(sa_buf, (sSA*)&sto);
     277        TRACE_DEBUG(FULL, "Sending %zd bytes to %s", buflen, sa_buf);
    283278               
    284279        /* Send */
Note: See TracChangeset for help on using the changeset viewer.