diff --git a/sys/crypto/3des.c b/sys/crypto/3des.c index c69443af4f0b72679fe9d741661a912fef79c819..6a7af54b0282f127cdeda11a050e0e20fae794ca 100644 --- a/sys/crypto/3des.c +++ b/sys/crypto/3des.c @@ -285,7 +285,8 @@ int tripledes_encrypt(const cipher_context_t *context, const uint8_t *plain, uin uint32_t work[2]; if (!key) { - DEBUGF("[ERROR] Could NOT malloc space for the des3_key_s struct.\r\n"); + DEBUG("%s:%d in %s: [ERROR] Could NOT malloc space for the des3_key_s struct.\r\n", + RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC); return -1; } @@ -293,7 +294,8 @@ int tripledes_encrypt(const cipher_context_t *context, const uint8_t *plain, uin res = des3_key_setup(context->context, key); if (res < 0) { - DEBUGF("[ERROR] des3_key_setup failed with Code %i\r\n", res); + DEBUG("%s:%d in %s: [ERROR] des3_key_setup failed with Code %i\r\n", + RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC, res); free(key); return -2; } @@ -318,7 +320,8 @@ int tripledes_decrypt(const cipher_context_t *context, const uint8_t *crypt, uin uint32_t work[2]; if (!key) { - DEBUGF("[ERROR] Could NOT malloc space for the des3_key_s struct.\r\n"); + DEBUG("%s:%d in %s: [ERROR] Could NOT malloc space for the des3_key_s struct.\r\n", + __FILE__, __LINE__, DEBUG_FUNC); return -1; } @@ -326,7 +329,8 @@ int tripledes_decrypt(const cipher_context_t *context, const uint8_t *crypt, uin res = des3_key_setup(context->context, key); if (res < 0) { - DEBUGF("[ERROR] des3_key_setup failed with Code %i\r\n", res); + DEBUG("%s:%d in %s: [ERROR] des3_key_setup failed with Code %i\r\n", + __FILE__, __LINE__, DEBUG_FUNC, res); free(key); return -2; } diff --git a/sys/crypto/twofish.c b/sys/crypto/twofish.c index ca2a57b0e1360f917aa3ed588d027fc8fb78ded6..2507ca82b9c3f93b8983c5cae672e1927a5de0a0 100644 --- a/sys/crypto/twofish.c +++ b/sys/crypto/twofish.c @@ -540,8 +540,9 @@ static int twofish_setup_key(twofish_context_t *ctx, const uint8_t *key, uint8_t /* Check key length. */ if (((keylen - 16) | 16) != 16) { - DEBUGF("[ERROR] invalid key-length!\r\n"); - return -1;//GPG_ERR_INV_KEYLEN; + DEBUG("%s:%d in %s: [ERROR] invalid key-length!\r\n", RIOT_FILE_RELATIVE, + __LINE__, DEBUG_FUNC); + return -1; } @@ -660,15 +661,16 @@ int twofish_encrypt(const cipher_context_t *context, const uint8_t *in, uint8_t twofish_context_t *ctx = malloc(sizeof(twofish_context_t)); if (!ctx) { - DEBUGF("[ERROR] Could NOT malloc space for the twofish_context_t \ - struct.\r\n"); + DEBUG("%s:%d in %s: [ERROR] Could NOT malloc space for the twofish_context_t \ + struct.\r\n", RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC); return -1; } res = twofish_setup_key(ctx, context->context, TWOFISH_KEY_SIZE); if (res < 0) { - DEBUGF("[ERROR] twofish_setKey failed with Code %i\r\n", res); + DEBUG("%s:%d in %s: [ERROR] twofish_setKey failed with Code %i\r\n", + RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC, res); free(ctx); return -2; } @@ -716,15 +718,16 @@ int twofish_decrypt(const cipher_context_t *context, const uint8_t *in, uint8_t twofish_context_t *ctx = malloc(sizeof(twofish_context_t)); if (!ctx) { - DEBUGF("[ERROR] Could NOT malloc space for the twofish_context_t \ - struct.\r\n"); + DEBUG("%s:%d in %s: [ERROR] Could NOT malloc space for the twofish_context_t \ + struct.\r\n", RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC); return -1; } res = twofish_setup_key(ctx, context->context, TWOFISH_KEY_SIZE); if (res < 0) { - DEBUGF("[ERROR] twofish_setKey failed with Code %i\r\n", res); + DEBUG("%s:%d in %s: [ERROR] twofish_setKey failed with Code %i\r\n", + RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC, res); free(ctx); return -2; } diff --git a/sys/net/routing/nhdp/iib_table.c b/sys/net/routing/nhdp/iib_table.c index 599d1ed183964be3941fcea6ef27ca9ec63040e1..bc746b9bdb540ab4bec8c35a325bb4e6fd6c8543 100644 --- a/sys/net/routing/nhdp/iib_table.c +++ b/sys/net/routing/nhdp/iib_table.c @@ -194,7 +194,8 @@ void iib_fill_wr_addresses(kernel_pid_t if_pid, struct rfc5444_writer *wr) default: /* Should not happen */ - DEBUGF("[WARNING] Unknown link tuple status\n"); + DEBUG("%s:%d in %s: [WARNING] Unknown link tuple status\n", + __FILE__, __LINE__, DEBUG_FUNC); break; } } @@ -260,8 +261,8 @@ void iib_process_metric_msg(iib_link_set_entry_t *ls_entry, uint64_t int_time) /* NHDP_METRIC is not set properly */ (void)ls_entry; (void)int_time; - DEBUGF("[WARNING] Unknown NHDP_METRIC setting\n"); -#endif + DEBUG("%s:%d in %s: [WARNING] Unknown NHDP_METRIC setting\n", __FILE__, + __LINE__, DEBUG_FUNC); #endif } void iib_process_metric_pckt(iib_link_set_entry_t *ls_entry, uint32_t metric_out, uint16_t seq_no) @@ -332,8 +333,8 @@ void iib_process_metric_pckt(iib_link_set_entry_t *ls_entry, uint32_t metric_out (void)ls_entry; (void)metric_out; (void)seq_no; - DEBUGF("[WARNING] Unknown NHDP_METRIC setting\n"); -#endif + DEBUG("%s:%d in %s: [WARNING] Unknown NHDP_METRIC setting\n", __FILE__, + __LINE__, DEBUG_FUNC); #endif } void iib_process_metric_refresh(void) @@ -344,8 +345,8 @@ void iib_process_metric_refresh(void) dat_metric_refresh(); #else /* NHDP_METRIC is not set properly */ - DEBUGF("[WARNING] Unknown NHDP_METRIC setting\n"); -#endif + DEBUG("%s:%d in %s: [WARNING] Unknown NHDP_METRIC setting\n", __FILE__, + __LINE__, DEBUG_FUNC); #endif } diff --git a/sys/trickle/trickle.c b/sys/trickle/trickle.c index 877fe7c29177c524c52c2ffcdbac9b94a7589cbf..6ab4a85c4d91b066f7fe91d29be9d1bff0a6d6c8 100644 --- a/sys/trickle/trickle.c +++ b/sys/trickle/trickle.c @@ -37,11 +37,12 @@ void trickle_interval(trickle_t *trickle) DEBUG("TRICKLE new Interval %" PRIu32 "\n", trickle->I); if (trickle->I == 0) { - DEBUGF("[WARNING] Interval was 0\n"); + DEBUG("%s:%d in %s: [WARNING] Interval was 0\n", __FILE__, __LINE__, + DEBUG_FUNC); if (trickle->Imax == 0) { - DEBUGF("[WARNING] Imax == 0\n"); - } + DEBUG("%s:%d in %s: [WARNING] Imax == 0\n", __FILE__, __LINE__, + DEBUG_FUNC); } trickle->I = (trickle->Imin << trickle->Imax); }