Navigation


Changeset 1027:0117a7746b21 in freeDiameter for libfdcore


Ignore:
Timestamp:
Apr 15, 2013, 4:17:07 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Fix a number of errors and warnings introduced/highlighted by recent commits

Location:
libfdcore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/cnxctx.c

    r999 r1027  
    513513int fd_cnx_getremoteeps(struct cnxctx * conn, struct fd_list * eps)
    514514{
    515         TRACE_ENTRY("%p %p %p", conn, eps);
     515        TRACE_ENTRY("%p %p", conn, eps);
    516516        CHECK_PARAMS(conn && eps);
    517517       
     
    12101210                                        snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "%02hhx", serial[j]);
    12111211                                }
    1212                                 fd_log_debug(buf);
     1212                                fd_log_debug("%s", buf);
    12131213                        }
    12141214
  • libfdcore/config.c

    r1021 r1027  
    226226#endif /* GNUTLS_VERSION_300 */
    227227
     228#ifndef GNUTLS_VERSION_300
     229# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
     230#endif /* !GNUTLS_VERSION_300 */
    228231/* Parse the configuration file (using the yacc parser) */
    229232int fd_conf_parse()
     
    474477                        unsigned int verify;
    475478                        time_t now;
    476                         #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
    477479                        GNUTLS_TRACE( gnutls_certificate_get_x509_cas (fd_g_config->cnf_sec_data.credentials, &CA_list, (unsigned int *) &CA_list_length) );
    478480                        GNUTLS_TRACE( gnutls_certificate_get_x509_crls (fd_g_config->cnf_sec_data.credentials, &CRL_list, (unsigned int *) &CRL_list_length) );
    479                         #pragma GCC diagnostic warning "-Wdeprecated-declarations"
    480481                        CHECK_GNUTLS_DO( gnutls_x509_crt_list_verify(certs, cert_max, CA_list, CA_list_length, CRL_list, CRL_list_length, 0, &verify),
    481482                                {
     
    597598        return 0;
    598599}
     600#ifndef GNUTLS_VERSION_300
     601# pragma GCC diagnostic pop "-Wdeprecated-declarations"
     602#endif /* !GNUTLS_VERSION_300 */
    599603
    600604
  • libfdcore/core.c

    r994 r1027  
    3838#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
    3939#include <gcrypt.h>
    40 #pragma GCC diagnostic warning "-Wdeprecated-declarations"
     40#pragma GCC diagnostic pop "-Wdeprecated-declarations"
    4141
    4242/* The static configuration structure */
  • libfdcore/p_ce.c

    r1010 r1027  
    307307                                                        peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen, NULL)) {
    308308                                        TRACE_DEBUG(INFO, "Received a message with Origin-Host set to '%.*s' while expecting '%s'",
    309                                                         hdr->avp_value->os.len, hdr->avp_value->os.data, peer->p_hdr.info.pi_diamid);
     309                                                        (int)hdr->avp_value->os.len, hdr->avp_value->os.data, peer->p_hdr.info.pi_diamid);
    310310                                        error->pei_errcode = "DIAMETER_AVP_NOT_ALLOWED";
    311311                                        error->pei_message = "Your Origin-Host value does not match my configuration.";
  • libfdcore/p_out.c

    r1010 r1027  
    8585                if (rcvon.tv_sec != 0 || rcvon.tv_nsec != 0) {
    8686                        TS_DIFFERENCE( &delay, &rcvon, &senton);
    87                         fd_msg_log( FD_MSG_LOG_TIMING, cpy_for_logs_only, "Forwarded in %d.%06.6d sec", delay.tv_sec, delay.tv_nsec/1000);
     87                        fd_msg_log( FD_MSG_LOG_TIMING, cpy_for_logs_only, "Forwarded in %ld.%6.6ld sec", (long)delay.tv_sec, delay.tv_nsec/1000);
    8888                } else { /* We log the answer time only for answers generated locally */
    8989                        if (!msg_is_a_req) {
     
    9494                                (void) fd_msg_ts_get_recv(req, &reqrcvon);
    9595                                TS_DIFFERENCE( &delay, &reqrcvon, &senton);
    96                                 fd_msg_log( FD_MSG_LOG_TIMING, cpy_for_logs_only, "Answered in %d.%06.6d sec", delay.tv_sec, delay.tv_nsec/1000);
     96                                fd_msg_log( FD_MSG_LOG_TIMING, cpy_for_logs_only, "Answered in %ld.%6.6ld sec", (long)delay.tv_sec, delay.tv_nsec/1000);
    9797                        }
    9898                }
  • libfdcore/p_psm.c

    r1010 r1027  
    538538                                (void) fd_msg_ts_get_sent(req, &reqsent);
    539539                                TS_DIFFERENCE( &delay, &reqsent, &rcvon );
    540                                 fd_msg_log( FD_MSG_LOG_TIMING, msg, "Answer received in %d.%06.6d sec.", delay.tv_sec, delay.tv_nsec / 1000 );
     540                                fd_msg_log( FD_MSG_LOG_TIMING, msg, "Answer received in %ld.%6.6ld sec.", (long)delay.tv_sec, delay.tv_nsec / 1000 );
    541541                        }
    542542                } else {
  • libfdcore/peers.c

    r1010 r1027  
    424424                        snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "\t['%s' %u]", peer->p_hdr.info.runtime.pir_prodname, peer->p_hdr.info.runtime.pir_firmrev);
    425425        }
    426         fd_log_debug(buf);
     426        fd_log_debug("%s", buf);
    427427        if (details > FULL) {
    428428                /* Dump all info */
    429429                fd_log_debug("\tEntry origin : %s", peer->p_dbgorig?: "not set");
    430                 fd_log_debug("\tConfig flags : %s%s%s%s%s - %s%s%s",
    431                                 peer->p_hdr.info.config.pic_flags.pro3 == PI_P3_DEFAULT ? "" :
    432                                         (peer->p_hdr.info.config.pic_flags.pro3 == PI_P3_IP ? "IP." : "IPv6."),
    433                                 peer->p_hdr.info.config.pic_flags.pro4 == PI_P4_DEFAULT ? "" :
    434                                         (peer->p_hdr.info.config.pic_flags.pro4 == PI_P4_TCP ? "TCP." : "SCTP."),
    435                                 peer->p_hdr.info.config.pic_flags.alg ? "PrefTCP." : "",
    436                                 peer->p_hdr.info.config.pic_flags.sec & PI_SEC_NONE ? "NoTLSok" :"",
    437                                 peer->p_hdr.info.config.pic_flags.sec & PI_SEC_TLS_OLD ? "OldTLS" :"",
    438                                 peer->p_hdr.info.config.pic_flags.exp ? "Expire." : "",
    439                                 peer->p_hdr.info.config.pic_flags.persist ? "Persist." : ""
     430                fd_log_debug("\tConfig flags : %s%s%s - %s%s - %s%s",
     431                                peer->p_hdr.info.config.pic_flags.pro3 == PI_P3_DEFAULT ? "." :
     432                                        (peer->p_hdr.info.config.pic_flags.pro3 == PI_P3_IP ? "IP" : "IPv6"),
     433                                peer->p_hdr.info.config.pic_flags.pro4 == PI_P4_DEFAULT ? "." :
     434                                        (peer->p_hdr.info.config.pic_flags.pro4 == PI_P4_TCP ? "TCP" : "SCTP"),
     435                                peer->p_hdr.info.config.pic_flags.alg ? "PrefTCP" : ".",
     436                                peer->p_hdr.info.config.pic_flags.sec & PI_SEC_NONE ? "NoTLSok" :".",
     437                                peer->p_hdr.info.config.pic_flags.sec & PI_SEC_TLS_OLD ? "OldTLS" :".",
     438                                peer->p_hdr.info.config.pic_flags.exp ? "Expire" : ".",
     439                                peer->p_hdr.info.config.pic_flags.persist ? "Persist" : "."
    440440                                );
    441441                fd_log_debug("\tLifetime : %d sec", peer->p_hdr.info.config.pic_lft);
  • libfdcore/routing_dispatch.c

    r1014 r1027  
    362362       
    363363        TRACE_DEBUG(FULL, "Processed Decorated NAI : '%.*s' became '%.*s' (%.*s)",
    364                                 un->os.len, old_un,
    365                                 at_idx, un->os.data,
    366                                 dr->os.len, dr->os.data);
     364                                (int)un->os.len, old_un,
     365                                (int)at_idx, un->os.data,
     366                                (int)dr->os.len, dr->os.data);
    367367       
    368368        un->os.len = at_idx;
  • libfdcore/sctp.c

    r974 r1027  
    10371037        mhdr.msg_controllen = sizeof(anci);
    10381038       
    1039         TRACE_DEBUG(FULL, "Sending %db data on stream %hu of socket %d", len, strid, conn->cc_socket);
     1039        TRACE_DEBUG(FULL, "Sending %zdb data on stream %hu of socket %d", len, strid, conn->cc_socket);
    10401040again: 
    10411041        ret = sendmsg(conn->cc_socket, &mhdr, 0);
     
    11351135                union sctp_notification * notif = (union sctp_notification *) data;
    11361136               
    1137                 TRACE_DEBUG(FULL, "Received %db data of notification on socket %d", datasize, conn->cc_socket);
     1137                TRACE_DEBUG(FULL, "Received %zdb data of notification on socket %d", datasize, conn->cc_socket);
    11381138       
    11391139                switch (notif->sn_header.sn_type) {
     
    12331233                        *strid = sndrcv->sinfo_stream;
    12341234                }
    1235                 TRACE_DEBUG(FULL, "Received %db data on socket %d, stream %hu", datasize, conn->cc_socket, *strid);
     1235                TRACE_DEBUG(FULL, "Received %zdb data on socket %d, stream %hu", datasize, conn->cc_socket, *strid);
    12361236        } else {
    1237                 TRACE_DEBUG(FULL, "Received %db data on socket %d (stream ignored)", datasize, conn->cc_socket);
     1237                TRACE_DEBUG(FULL, "Received %zdb data on socket %d (stream ignored)", datasize, conn->cc_socket);
    12381238        }
    12391239       
  • libfdcore/sctps.c

    r1021 r1027  
    9595                                        CHECK_FCT_DO(fd_event_send(conn->cc_sctps_data.array[strid].raw_recv, event, bufsz, buf), goto fatal );
    9696                                } else {
    97                                         TRACE_DEBUG(INFO, "Received packet (%d bytes) on out-of-range stream #%d from %s, discarded.", bufsz, strid, conn->cc_remid);
     97                                        TRACE_DEBUG(INFO, "Received packet (%zd bytes) on out-of-range stream #%d from %s, discarded.", bufsz, strid, conn->cc_remid);
    9898                                        free(buf);
    9999                                }
     
    230230
    231231/* Set the parameters of a session to use the appropriate fifo and stream information */
     232#ifndef GNUTLS_VERSION_300
     233# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
     234#endif /* !GNUTLS_VERSION_300 */
    232235static void set_sess_transport(gnutls_session_t session, struct sctps_ctx *ctx)
    233236{
     
    238241#ifndef GNUTLS_VERSION_300
    239242        /* starting version 2.12, this call is not needed */
    240         #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
    241243        GNUTLS_TRACE( gnutls_transport_set_lowat( session, 0 ) );
    242         #pragma GCC diagnostic warning "-Wdeprecated-declarations"
    243244#endif /* GNUTLS_VERSION_300 */
    244245       
     
    249250        return;
    250251}
     252#ifndef GNUTLS_VERSION_300
     253# pragma GCC diagnostic pop "-Wdeprecated-declarations"
     254#endif /* !GNUTLS_VERSION_300 */
    251255
    252256/*************************************************************/
Note: See TracChangeset for help on using the changeset viewer.