GNUnet  0.18.1
Collaboration diagram for Logging:

Macros

#define GNUNET_EXTRA_LOGGING   1
 define GNUNET_EXTRA_LOGGING if using this header outside the GNUnet source tree where gnunet_config.h is unavailable More...
 
#define GNUNET_assert(cond)
 Use this for fatal errors that cannot be handled. More...
 
#define GNUNET_assert_at(cond, f, l)
 Use this for fatal errors that cannot be handled. More...
 
#define GNUNET_assert_from(cond, comp)
 Use this for fatal errors that cannot be handled. More...
 
#define GNUNET_break(cond)
 Use this for internal assertion violations that are not fatal (can be handled) but should not occur. More...
 
#define GNUNET_break_op(cond)
 Use this for assertion violations caused by other peers (i.e. More...
 
#define GNUNET_log_strerror(level, cmd)
 Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the message given by strerror(errno). More...
 
#define GNUNET_log_from_strerror(level, component, cmd)
 Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the message given by strerror(errno). More...
 
#define GNUNET_log_strerror_file(level, cmd, filename)
 Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the message given by strerror(errno). More...
 
#define GNUNET_log_from_strerror_file(level, component, cmd, filename)
 Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the message given by strerror(errno). More...
 

Typedefs

typedef void(* GNUNET_Logger) (void *cls, enum GNUNET_ErrorType kind, const char *component, const char *date, const char *message)
 User-defined handler for log messages. More...
 

Enumerations

enum  GNUNET_ErrorType {
  GNUNET_ERROR_TYPE_UNSPECIFIED = -1 , GNUNET_ERROR_TYPE_NONE = 0 , GNUNET_ERROR_TYPE_ERROR = 1 , GNUNET_ERROR_TYPE_WARNING = 2 ,
  GNUNET_ERROR_TYPE_MESSAGE = 4 , GNUNET_ERROR_TYPE_INFO = 8 , GNUNET_ERROR_TYPE_DEBUG = 16 , GNUNET_ERROR_TYPE_INVALID = 32 ,
  GNUNET_ERROR_TYPE_BULK = 64
}
 Types of errors. More...
 

Functions

int GNUNET_get_log_skip (void)
 Get the number of log calls that are going to be skipped. More...
 
void GNUNET_log_nocheck (enum GNUNET_ErrorType kind, const char *message,...) __attribute__((format(printf
 Main log function. More...
 
void GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind, const char *comp, const char *message,...) __attribute__((format(printf
 Log function that specifies an alternative component. More...
 
void GNUNET_log_config_missing (enum GNUNET_ErrorType kind, const char *section, const char *option)
 Log error message about missing configuration option. More...
 
void GNUNET_log_config_invalid (enum GNUNET_ErrorType kind, const char *section, const char *option, const char *required)
 Log error message about invalid configuration option value. More...
 
void GNUNET_abort_ (void) __attribute__((noreturn))
 Abort the process, generate a core dump if possible. More...
 
void GNUNET_log_skip (int n, int check_reset)
 Ignore the next n calls to the log function. More...
 
int GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile)
 Setup logging. More...
 
void GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls)
 Add a custom logger. More...
 
void GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls)
 Remove a custom logger. More...
 
const char * GNUNET_sh2s (const struct GNUNET_ShortHashCode *shc)
 Convert a short hash value to a string (for printing debug messages). More...
 
const char * GNUNET_uuid2s (const struct GNUNET_Uuid *uuid)
 Convert a UUID to a string (for printing debug messages). More...
 
const char * GNUNET_h2s (const struct GNUNET_HashCode *hc)
 Convert a hash value to a string (for printing debug messages). More...
 
const char * GNUNET_h2s2 (const struct GNUNET_HashCode *hc)
 Convert a hash value to a string (for printing debug messages). More...
 
const char * GNUNET_h2s_full (const struct GNUNET_HashCode *hc)
 Convert a hash value to a string (for printing debug messages). More...
 
const char * GNUNET_p2s (const struct GNUNET_CRYPTO_EddsaPublicKey *p)
 Convert a public key value to a string (for printing debug messages). More...
 
const char * GNUNET_p2s2 (const struct GNUNET_CRYPTO_EddsaPublicKey *p)
 Convert a public key value to a string (for printing debug messages). More...
 
const char * GNUNET_e2s (const struct GNUNET_CRYPTO_EcdhePublicKey *p)
 Convert a public key value to a string (for printing debug messages). More...
 
const char * GNUNET_e2s2 (const struct GNUNET_CRYPTO_EcdhePublicKey *p)
 Convert a public key value to a string (for printing debug messages). More...
 
const char * GNUNET_i2s (const struct GNUNET_PeerIdentity *pid)
 Convert a peer identity to a string (for printing debug messages). More...
 
const char * GNUNET_i2s2 (const struct GNUNET_PeerIdentity *pid)
 Convert a peer identity to a string (for printing debug messages). More...
 
const char * GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid)
 Convert a peer identity to a string (for printing debug messages). More...
 
const char * GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen)
 Convert a "struct sockaddr*" (IPv4 or IPv6 address) to a string (for printing debug messages). More...
 
const char * GNUNET_error_type_to_string (enum GNUNET_ErrorType kind)
 Convert error type to string. More...
 

Detailed Description

See also
Documentation

Macro Definition Documentation

◆ GNUNET_EXTRA_LOGGING

#define GNUNET_EXTRA_LOGGING   1

define GNUNET_EXTRA_LOGGING if using this header outside the GNUnet source tree where gnunet_config.h is unavailable

Definition at line 150 of file gnunet_common.h.

◆ GNUNET_assert

#define GNUNET_assert (   cond)
Value:
do \
{ \
if (! (cond)) \
{ \
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \
dgettext ("gnunet", "Assertion failed at %s:%d. Aborting.\n"), \
__FILE__, \
__LINE__); \
GNUNET_abort_ (); \
} \
} while (0)
#define dgettext(Domainname, Msgid)
Definition: gettext.h:46
@ GNUNET_ERROR_TYPE_ERROR

Use this for fatal errors that cannot be handled.

Definition at line 933 of file gnunet_common.h.

◆ GNUNET_assert_at

#define GNUNET_assert_at (   cond,
  f,
  l 
)
Value:
do \
{ \
if (! (cond)) \
{ \
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \
dgettext ("gnunet", "Assertion failed at %s:%d. Aborting.\n"), \
f, \
l); \
GNUNET_abort_ (); \
} \
} while (0)
static struct LoggingHandle * l

Use this for fatal errors that cannot be handled.

Definition at line 951 of file gnunet_common.h.

◆ GNUNET_assert_from

#define GNUNET_assert_from (   cond,
  comp 
)
Value:
do \
{ \
if (! (cond)) \
{ \
GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, \
comp, \
dgettext ("gnunet", "Assertion failed at %s:%d. Aborting.\n"), \
__FILE__, \
__LINE__); \
GNUNET_abort_ (); \
} \
} while (0)

Use this for fatal errors that cannot be handled.

Parameters
condCondition to evaluate
compComponent string to use for logging

Definition at line 972 of file gnunet_common.h.

◆ GNUNET_break

#define GNUNET_break (   cond)
Value:
do \
{ \
if (! (cond)) \
{ \
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \
dgettext ("gnunet", "Assertion failed at %s:%d.\n"), \
__FILE__, \
__LINE__); \
} \
} while (0)

Use this for internal assertion violations that are not fatal (can be handled) but should not occur.

Definition at line 1014 of file gnunet_common.h.

◆ GNUNET_break_op

#define GNUNET_break_op (   cond)
Value:
do \
{ \
if (! (cond)) \
{ \
dgettext ("gnunet", "External protocol violation detected at %s:%d.\n"), \
__FILE__, \
__LINE__); \
} \
} while (0)
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_BULK

Use this for assertion violations caused by other peers (i.e.

protocol violations). We do not want to confuse end-users (say, some other peer runs an older, broken or incompatible GNUnet version), but we still want to see these problems during development and testing. "OP == other peer".

Definition at line 1036 of file gnunet_common.h.

◆ GNUNET_log_strerror

#define GNUNET_log_strerror (   level,
  cmd 
)
Value:
do \
{ \
GNUNET_log (level, \
dgettext ("gnunet", "`%s' failed at %s:%d with error: %s\n"), \
cmd, \
__FILE__, \
__LINE__, \
strerror (errno)); \
} while (0)

Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the message given by strerror(errno).

Definition at line 1055 of file gnunet_common.h.

◆ GNUNET_log_from_strerror

#define GNUNET_log_from_strerror (   level,
  component,
  cmd 
)
Value:
do \
{ \
GNUNET_log_from (level, \
dgettext ("gnunet", "`%s' failed at %s:%d with error: %s\n"), \
cmd, \
__FILE__, \
__LINE__, \
strerror (errno)); \
} while (0)
static char * component
Running component.

Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the message given by strerror(errno).

Definition at line 1073 of file gnunet_common.h.

◆ GNUNET_log_strerror_file

#define GNUNET_log_strerror_file (   level,
  cmd,
  filename 
)
Value:
do \
{ \
GNUNET_log (level, \
dgettext ("gnunet", "`%s' failed on file `%s' at %s:%d with error: %s\n"), \
cmd, \
__FILE__, \
__LINE__, \
strerror (errno)); \
} while (0)
static char * filename

Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the message given by strerror(errno).

Definition at line 1092 of file gnunet_common.h.

◆ GNUNET_log_from_strerror_file

#define GNUNET_log_from_strerror_file (   level,
  component,
  cmd,
  filename 
)
Value:
do \
{ \
GNUNET_log_from (level, \
dgettext ("gnunet", "`%s' failed on file `%s' at %s:%d with error: %s\n"), \
cmd, \
__FILE__, \
__LINE__, \
strerror (errno)); \
} while (0)

Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the message given by strerror(errno).

Definition at line 1111 of file gnunet_common.h.

Typedef Documentation

◆ GNUNET_Logger

typedef void(* GNUNET_Logger) (void *cls, enum GNUNET_ErrorType kind, const char *component, const char *date, const char *message)

User-defined handler for log messages.

Parameters
clsclosure
kindsevereity
componentwhat component is issuing the message?
datewhen was the message logged?
messagewhat is the message

Definition at line 450 of file gnunet_common.h.

Enumeration Type Documentation

◆ GNUNET_ErrorType

Types of errors.

Enumerator
GNUNET_ERROR_TYPE_UNSPECIFIED 
GNUNET_ERROR_TYPE_NONE 
GNUNET_ERROR_TYPE_ERROR 
GNUNET_ERROR_TYPE_WARNING 
GNUNET_ERROR_TYPE_MESSAGE 
GNUNET_ERROR_TYPE_INFO 
GNUNET_ERROR_TYPE_DEBUG 
GNUNET_ERROR_TYPE_INVALID 
GNUNET_ERROR_TYPE_BULK 

Definition at line 423 of file gnunet_common.h.

424 {
429  /* UX: We need a message type that is output by
430  * default without looking like there is a problem.
431  */
437 };
@ GNUNET_ERROR_TYPE_UNSPECIFIED
@ GNUNET_ERROR_TYPE_NONE
@ GNUNET_ERROR_TYPE_INVALID
@ GNUNET_ERROR_TYPE_MESSAGE
@ GNUNET_ERROR_TYPE_DEBUG
@ GNUNET_ERROR_TYPE_INFO

Function Documentation

◆ GNUNET_get_log_skip()

int GNUNET_get_log_skip ( void  )

Get the number of log calls that are going to be skipped.

Returns
number of log calls to be ignored

Definition at line 949 of file common_logging.c.

950 {
951  return skip_log;
952 }
static GNUNET_THREAD_LOCAL int skip_log
Number of log calls to ignore.

References skip_log.

◆ GNUNET_log_nocheck()

void GNUNET_log_nocheck ( enum GNUNET_ErrorType  kind,
const char *  message,
  ... 
)

Main log function.

Parameters
kindhow serious is the error?
messagewhat is the message (format string)
...arguments for format string

◆ GNUNET_log_from_nocheck()

void GNUNET_log_from_nocheck ( enum GNUNET_ErrorType  kind,
const char *  comp,
const char *  message,
  ... 
)

Log function that specifies an alternative component.

This function should be used by plugins.

Parameters
kindhow serious is the error?
compcomponent responsible for generating the message
messagewhat is the message (format string)
...arguments for format string

Referenced by mq_init(), proto_read_kx(), queue_read(), queue_read_kx(), run(), send_challenge(), and transmit_kx().

Here is the caller graph for this function:

◆ GNUNET_log_config_missing()

void GNUNET_log_config_missing ( enum GNUNET_ErrorType  kind,
const char *  section,
const char *  option 
)

Log error message about missing configuration option.

Parameters
kindlog level
sectionsection with missing option
optionname of missing option

Definition at line 1411 of file common_logging.c.

1414 {
1415  GNUNET_log (kind,
1416  _ (
1417  "Configuration fails to specify option `%s' in section `%s'!\n"),
1418  option,
1419  section);
1420 }
#define GNUNET_log(kind,...)
#define _(String)
GNU gettext support macro.
Definition: platform.h:177

References _, and GNUNET_log.

Referenced by database_setup(), get_bootstrap_server(), get_update_information_directory(), GNUNET_CONFIGURATION_config_tool_run(), GNUNET_CONVERSATION_phone_create(), GNUNET_DATACACHE_create(), GNUNET_FRIENDS_parse(), GNUNET_FRIENDS_write_start(), GNUNET_PQ_connect_with_cfg2(), GNUNET_RPS_connect(), GNUNET_TESTBED_run(), GSF_pending_request_init_(), libgnunet_plugin_dhtu_ip_init(), libgnunet_plugin_transport_tcp_init(), libgnunet_plugin_transport_unix_init(), load(), load_hostlist_file(), logger_run(), new_sub(), read_index_list(), run(), save(), save_hostlist_file(), setup_exit_helper_args(), and write_index_list().

Here is the caller graph for this function:

◆ GNUNET_log_config_invalid()

void GNUNET_log_config_invalid ( enum GNUNET_ErrorType  kind,
const char *  section,
const char *  option,
const char *  required 
)

Log error message about invalid configuration option value.

Parameters
kindlog level
sectionsection with invalid option
optionname of invalid option
requiredwhat is required that is invalid about the option

Definition at line 1424 of file common_logging.c.

1428 {
1429  GNUNET_log (
1430  kind,
1431  _ (
1432  "Configuration specifies invalid value for option `%s' in section `%s': %s\n"),
1433  option,
1434  section,
1435  required);
1436 }

References _, and GNUNET_log.

Referenced by advertise_dns_exit(), GCD_init(), GNUNET_CLIENT_test(), GNUNET_GNS_lookup_with_tld(), GNUNET_TESTBED_run(), GSF_push_init_(), libgnunet_plugin_dhtu_ip_init(), libgnunet_plugin_transport_udp_init(), read_service_conf(), run(), setup_exit_helper_args(), setup_service(), and test_service_configuration().

Here is the caller graph for this function:

◆ GNUNET_abort_()

void GNUNET_abort_ ( void  )

Abort the process, generate a core dump if possible.

Most code should use GNUNET_assert (0) instead to first log the location of the failure.

Definition at line 279 of file common_logging.c.

280 {
281  abort ();
282 }

◆ GNUNET_log_skip()

void GNUNET_log_skip ( int  n,
int  check_reset 
)

Ignore the next n calls to the log function.

Parameters
nnumber of log calls to ignore (could be negative)
check_resetGNUNET_YES to assert that the log skip counter is currently zero

Definition at line 925 of file common_logging.c.

926 {
927  int ok;
928 
929  if (0 == n)
930  {
931  ok = (0 == skip_log);
932  skip_log = 0;
933  if (check_reset)
934  GNUNET_break (ok);
935  }
936  else
937  {
938  skip_log += n;
939  }
940 }
static int ok
Return value from 'main' (0 == success)
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.

References GNUNET_break, ok, and skip_log.

◆ GNUNET_log_setup()

int GNUNET_log_setup ( const char *  comp,
const char *  loglevel,
const char *  logfile 
)

Setup logging.

Parameters
compdefault component to use
loglevelwhat types of messages should be logged
logfilechange logging to logfile (use NULL to keep stderr)
Returns
GNUNET_OK on success, GNUNET_SYSERR if logfile could not be opened
Parameters
compdefault component to use
loglevelwhat types of messages should be logged
logfilewhich file to write log messages to (can be NULL)
Returns
GNUNET_OK on success

Definition at line 730 of file common_logging.c.

733 {
734  const char *env_logfile;
735 
736  min_level = get_type (loglevel);
737 #if ! defined(GNUNET_CULL_LOGGING)
739 #endif
741  GNUNET_asprintf (&component, "%s-%d", comp, getpid ());
744 
745  env_logfile = getenv ("GNUNET_FORCE_LOGFILE");
746  if ((NULL != env_logfile) && (strlen (env_logfile) > 0))
747  logfile = env_logfile;
748  if (NULL == logfile)
749  return GNUNET_OK;
752  if (NULL == log_file_name)
753  return GNUNET_SYSERR;
754 #if defined(GNUNET_CULL_LOGGING)
755  /* log file option not allowed for wallet logic */
756  GNUNET_assert (NULL == logfile);
757  return GNUNET_OK;
758 #else
759  {
760  time_t t;
761  const struct tm *tm;
762 
763  t = time (NULL);
764  tm = gmtime (&t);
765  return setup_log_file (tm);
766  }
767 #endif
768 }
static void parse_all_definitions()
Utility function - parses GNUNET_LOG and GNUNET_FORCE_LOG.
static char * log_file_name
Format string describing the name of the log file.
static char * component_nopid
Running component (without pid).
static enum GNUNET_ErrorType get_type(const char *log)
Convert a textual description of a loglevel to the respective enumeration type.
static enum GNUNET_ErrorType min_level
Minimum log level.
static int setup_log_file(const struct tm *tm)
Setup the log file.
char * getenv()
static struct GNUNET_SCHEDULER_Task * t
Main task.
@ GNUNET_OK
Definition: gnunet_common.h:99
@ GNUNET_SYSERR
Definition: gnunet_common.h:97
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_free(ptr)
Wrapper around free.
char * GNUNET_STRINGS_filename_expand(const char *fil)
Complete filename (a la shell) from abbrevition.
Definition: strings.c:495

References component, component_nopid, get_type(), getenv(), GNUNET_asprintf(), GNUNET_assert, GNUNET_free, GNUNET_OK, GNUNET_strdup, GNUNET_STRINGS_filename_expand(), GNUNET_SYSERR, log_file_name, min_level, parse_all_definitions(), setup_log_file(), and t.

Referenced by get_app(), GNUNET_SERVICE_run_(), GNUNET_TESTING_service_run(), GNUNET_TRANSPORT_TESTING_main_(), LEGACY_SERVICE_run(), main(), run(), run_service(), test_master(), and testbed_run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_logger_add()

void GNUNET_logger_add ( GNUNET_Logger  logger,
void *  logger_cls 
)

Add a custom logger.

Note that installing any custom logger will disable the standard logger. When multiple custom loggers are installed, all will be called. The standard logger will only be used if no custom loggers are present.

Parameters
loggerlog function
logger_clsclosure for logger

Definition at line 772 of file common_logging.c.

773 {
774  struct CustomLogger *entry;
775 
776  entry = GNUNET_new (struct CustomLogger);
777  entry->logger = logger;
778  entry->logger_cls = logger_cls;
779  entry->next = loggers;
780  loggers = entry;
781 }
static struct CustomLogger * loggers
Linked list of our custom loggres.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Linked list of active loggers.
void * logger_cls
Closure for logger.
struct CustomLogger * next
This is a linked list.
GNUNET_Logger logger
Log function.

References GNUNET_new, gnunet_testing::logger, CustomLogger::logger, CustomLogger::logger_cls, loggers, and CustomLogger::next.

◆ GNUNET_logger_remove()

void GNUNET_logger_remove ( GNUNET_Logger  logger,
void *  logger_cls 
)

Remove a custom logger.

Parameters
loggerlog function
logger_clsclosure for logger

Definition at line 785 of file common_logging.c.

786 {
787  struct CustomLogger *pos;
788  struct CustomLogger *prev;
789 
790  prev = NULL;
791  pos = loggers;
792  while ((NULL != pos) &&
793  ((pos->logger != logger) || (pos->logger_cls != logger_cls)))
794  {
795  prev = pos;
796  pos = pos->next;
797  }
798  GNUNET_assert (NULL != pos);
799  if (NULL == prev)
800  loggers = pos->next;
801  else
802  prev->next = pos->next;
803  GNUNET_free (pos);
804 }

References GNUNET_assert, GNUNET_free, gnunet_testing::logger, CustomLogger::logger, CustomLogger::logger_cls, loggers, and CustomLogger::next.

◆ GNUNET_sh2s()

const char * GNUNET_sh2s ( const struct GNUNET_ShortHashCode shc)

Convert a short hash value to a string (for printing debug messages).

This is one of the very few calls in the entire API that is NOT reentrant!

Parameters
shcthe hash code
Returns
string

Definition at line 1219 of file common_logging.c.

1220 {
1221  static GNUNET_THREAD_LOCAL char buf[64];
1222 
1223  GNUNET_STRINGS_data_to_string (shc, sizeof(*shc), buf, sizeof(buf));
1224  buf[6] = '\0';
1225  return (const char *) buf;
1226 }
static char buf[2048]
char * GNUNET_STRINGS_data_to_string(const void *data, size_t size, char *out, size_t out_size)
Convert binary data to ASCII encoding using CrockfordBase32.
Definition: strings.c:709
#define GNUNET_THREAD_LOCAL
Definition: platform.h:246

References buf, GNUNET_STRINGS_data_to_string(), and GNUNET_THREAD_LOCAL.

Referenced by change_srv_handle_member_id(), check_for_rekeying(), check_member_session_completion(), create_handle_member_id(), decrypt_box(), decrypt_rekey(), delete_srv_room_message(), destroy_route(), discard_all_from_rung_tail(), dv_setup_key_state_from_km(), GCC_2s(), GCC_handle_kx(), GCC_handle_kx_auth(), handle_connection_broken(), handle_connection_create(), handle_connection_create_ack(), handle_connection_destroy(), handle_dv_learn(), handle_message_join(), handle_message_leave(), handle_room_entry(), handle_room_open(), handle_tunnel_kx(), handle_validation_challenge(), handle_validation_response(), iterate_load_next_member_sessions(), iterate_save_members(), join_room(), mqm_execute(), on_message(), pack_message(), remove_room_member_session(), route_message(), send_broken(), send_kx(), send_kx_auth(), send_srv_room_message(), send_UDPRekey(), sock_read(), start_address_validation(), start_dv_learn(), update_member_session_history(), validation_start_cb(), and validation_transmit_on_queue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_uuid2s()

const char * GNUNET_uuid2s ( const struct GNUNET_Uuid uuid)

Convert a UUID to a string (for printing debug messages).

This is one of the very few calls in the entire API that is NOT reentrant!

Parameters
uuidthe UUID
Returns
string

Definition at line 1239 of file common_logging.c.

1240 {
1241  static GNUNET_THREAD_LOCAL char buf[32];
1242 
1243  GNUNET_STRINGS_data_to_string (uuid, sizeof(*uuid), buf, sizeof(buf));
1244  buf[6] = '\0';
1245  return (const char *) buf;
1246 }

References buf, GNUNET_STRINGS_data_to_string(), and GNUNET_THREAD_LOCAL.

Referenced by cummulative_ack(), free_pending_acknowledgement(), handle_reliability_ack(), handle_reliability_box(), and prepare_pending_acknowledgement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_h2s()

const char* GNUNET_h2s ( const struct GNUNET_HashCode hc)

Convert a hash value to a string (for printing debug messages).

This is one of the very few calls in the entire API that is NOT reentrant!

Parameters
hcthe hash code
Returns
string

Convert a hash value to a string (for printing debug messages).

Parameters
hcthe hash code
Returns
string form; will be overwritten by next call to GNUNET_h2s.

Definition at line 1126 of file common_logging.c.

1127 {
1129 
1131  ret.encoding[8] = '\0';
1132  return (const char *) ret.encoding;
1133 }
static int ret
Return value of the commandline.
Definition: gnunet-abd.c:81
void GNUNET_CRYPTO_hash_to_enc(const struct GNUNET_HashCode *block, struct GNUNET_CRYPTO_HashAsciiEncoded *result)
Convert hash to ASCII encoding.
Definition: crypto_hash.c:55
0-terminated ASCII encoding of a struct GNUNET_HashCode.

References GNUNET_CRYPTO_hash_to_enc(), GNUNET_THREAD_LOCAL, and ret.

Referenced by add_member_session(), advertise_dns_exit(), block_proc(), callback_found_message(), callback_room_connect(), callback_room_deletion(), callback_room_handle_message(), cancel_store_operation(), cb_channel_destruction(), cb_intersection_element_removed(), change_srv_handle_member_id(), check_dht_local_get(), check_dht_local_get_result_seen(), check_dht_p2p_put(), check_edge(), clean_request(), client_release_ports(), client_request_complete_alice(), client_response_handler(), consider_ss_ack(), create_channel_to_destination(), create_handle_member_id(), datacache_get_iterator(), decrypt_rekey(), delayed_get(), delayed_put(), delete_srv_room_message(), derive_aes_key(), derive_auth_key(), derive_iv(), derive_pong_iv(), dht_get_string_accept_handler(), dht_get_string_handler(), do_flood(), do_rekey(), dv_setup_key_state_from_km(), env_delete_notify(), execute_add(), execute_select(), expired_processor(), filter_all(), filtered_map_initialization(), forward_reply(), forward_tunnel_message(), GCCH_2s(), GCCH_bind(), GCCH_channel_incoming_new(), GCCH_channel_local_new(), GCCH_get_id(), GDS_CLIENTS_handle_reply(), get_any(), get_cb(), get_room_data_subdir(), get_store_message(), get_target_peers(), get_typed(), GNUNET_CADET_channel_create(), GNUNET_CADET_open_port(), GNUNET_DATACACHE_get(), GNUNET_DATACACHE_get_closest(), GNUNET_DATASTORE_get_key(), GNUNET_DATASTORE_put(), GNUNET_DATASTORE_remove(), GNUNET_DHT_get_start(), GNUNET_DHT_get_stop(), GNUNET_DHT_put(), GNUNET_FS_add_to_index(), GNUNET_FS_handle_on_demand_block(), GNUNET_FS_tree_encoder_next(), GNUNET_NAMECACHE_lookup_block(), GNUNET_SET_listen(), GNUNET_SET_listen_cancel(), GNUNET_SETI_listen(), GNUNET_SETI_listen_cancel(), GNUNET_SETU_listen(), GNUNET_SETU_listen_cancel(), GSC_KX_encrypt_and_transmit(), GSC_KX_init(), GSF_cadet_query(), GSF_cadet_query_cancel(), GSF_pending_request_create_(), GSF_pending_request_get_message_(), GSF_plan_add_(), handle_ack(), handle_bob_client_message(), handle_channel_create(), handle_channel_created(), handle_client_evaluate(), handle_client_join(), handle_client_listen(), handle_client_redirect_to_service(), handle_client_register_message(), handle_client_reject(), handle_client_set_add(), handle_client_start_search(), handle_client_unindex(), handle_data(), handle_datastore_reply(), handle_dht_local_put(), handle_dht_p2p_get(), handle_dht_p2p_put(), handle_dht_reply(), handle_encrypted(), handle_ephemeral_key(), handle_get_key(), handle_get_message(), handle_icmp_service(), handle_incoming_msg(), handle_member_id(), handle_message_join(), handle_message_leave(), handle_namecache_block_response(), handle_p2p_get(), handle_p2p_put(), handle_p2p_reply(), handle_plaintext_channel_open(), handle_port_close(), handle_port_open(), handle_put(), handle_recv_message(), handle_remove(), handle_reply(), handle_request(), handle_room_close(), handle_room_entry(), handle_room_open(), handle_send_message(), handle_tcp_service(), handle_udp_service(), handle_union_p2p_demand(), handle_union_p2p_elements(), handle_union_p2p_full_element(), handle_union_p2p_offer(), hash_for_index_cb(), hash_for_index_val(), initialize_map_unfiltered(), initiate_put_from_pipe_trigger(), iterate_initial_edge(), iterate_load_next_session(), iterate_save_operations(), iterate_save_rooms(), iterate_save_session(), iterator_bf_create(), iterator_bf_reduce(), join_room(), kce_generate_cb(), kce_generate_rekey_cb(), load_state(), lookup_task(), mq_send_d(), mysql_plugin_put(), mysql_plugin_remove_key(), namecache_sqlite_cache_block(), new_element_cb(), notify_srv_handle_message(), on_message(), open_srv_room(), plan(), prepare_client_end_notification(), prepare_ibf_iterator(), print_channel_destination(), print_edge(), print_indexed(), process_dht_put_content(), process_local_reply(), process_migration_content(), process_result_with_request(), put_continuation(), quota_processor(), recv_message_request(), regex_find_path(), REGEX_INTERNAL_iterate_all_edges(), REGEX_INTERNAL_search(), regex_iterator(), regex_next_edge(), REGEX_TEST_automaton_save_graph_step(), remove_continuation(), remove_member_session(), remove_room_member_session(), remove_store_contact(), requester_callback(), responder_callback(), route_packet(), run(), schedule_block_download(), secret_destroy(), select_peer(), send_full_element_iterator(), send_key(), send_offers_iterator(), send_remaining_elements(), send_srv_handle_message(), send_tunnel_message(), send_UDPRekey(), set_result_cb(), sqlite_plugin_get_closest(), sqlite_plugin_put(), start_intersection(), start_local_query(), start_p2p_processing(), store_service(), timeout_closed_cb(), transmit_client_response(), transmit_item(), transmit_pending(), transmit_request(), update_member_session_history(), update_room_message(), update_store_contact(), and write_item().

Here is the call graph for this function:

◆ GNUNET_h2s2()

const char* GNUNET_h2s2 ( const struct GNUNET_HashCode hc)

Convert a hash value to a string (for printing debug messages).

This is one of the very few calls in the entire API that is NOT reentrant! Identical to GNUNET_h2s(), except that another buffer is used so both GNUNET_h2s() and GNUNET_h2s2() can be used within the same log statement.

Parameters
hcthe hash code
Returns
string

Convert a hash value to a string (for printing debug messages).

This is one of the very few calls in the entire API that is NOT reentrant! Identical to GNUNET_h2s(), except that another buffer is used so both GNUNET_h2s() and GNUNET_h2s2() can be used within the same log statement.

Parameters
hcthe hash code
Returns
string form; will be overwritten by next call to GNUNET_h2s.

Definition at line 1147 of file common_logging.c.

1148 {
1150 
1152  ret.encoding[8] = '\0';
1153  return (const char *) ret.encoding;
1154 }

References GNUNET_CRYPTO_hash_to_enc(), GNUNET_THREAD_LOCAL, and ret.

Referenced by GSC_KX_encrypt_and_transmit(), and handle_encrypted().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_h2s_full()

const char* GNUNET_h2s_full ( const struct GNUNET_HashCode hc)

Convert a hash value to a string (for printing debug messages).

This prints all 104 characters of a hashcode! This is one of the very few calls in the entire API that is NOT reentrant!

Parameters
hcthe hash code
Returns
string

Convert a hash value to a string (for printing debug messages).

This is one of the very few calls in the entire API that is NOT reentrant!

Parameters
hcthe hash code
Returns
string form; will be overwritten by next call to GNUNET_h2s_full.

Definition at line 1258 of file common_logging.c.

1259 {
1261 
1263  ret.encoding[sizeof(ret) - 1] = '\0';
1264  return (const char *) ret.encoding;
1265 }

References GNUNET_CRYPTO_hash_to_enc(), GNUNET_THREAD_LOCAL, and ret.

Referenced by check_dht_local_get_result_seen(), get_callback(), get_resp_callback(), handle_dht_local_put(), handle_recv_message(), namecache_cache_block(), namecache_lookup_block(), namecache_sqlite_cache_block(), namecache_sqlite_lookup_block(), new_sub(), put_callback(), run(), and sign_hello().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_p2s()

const char* GNUNET_p2s ( const struct GNUNET_CRYPTO_EddsaPublicKey p)

Convert a public key value to a string (for printing debug messages).

This is one of the very few calls in the entire API that is NOT reentrant!

Parameters
hcthe hash code
Returns
string

Definition at line 1158 of file common_logging.c.

1159 {
1161  struct GNUNET_HashCode hc;
1162 
1163  GNUNET_CRYPTO_hash (p, sizeof(*p), &hc);
1165  ret.encoding[6] = '\0';
1166  return (const char *) ret.encoding;
1167 }
static struct GNUNET_OS_Process * p
Helper process we started.
Definition: gnunet-uri.c:37
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
Definition: crypto_hash.c:41
A 512-bit hashcode.

References GNUNET_CRYPTO_hash(), GNUNET_CRYPTO_hash_to_enc(), GNUNET_THREAD_LOCAL, p, and ret.

Referenced by do_rekey(), and inject_rekey().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_p2s2()

const char* GNUNET_p2s2 ( const struct GNUNET_CRYPTO_EddsaPublicKey p)

Convert a public key value to a string (for printing debug messages).

This is one of the very few calls in the entire API that is NOT reentrant!

Parameters
hcthe hash code
Returns
string

Definition at line 1171 of file common_logging.c.

1172 {
1174  struct GNUNET_HashCode hc;
1175 
1176  GNUNET_CRYPTO_hash (p, sizeof(*p), &hc);
1178  ret.encoding[6] = '\0';
1179  return (const char *) ret.encoding;
1180 }

References GNUNET_CRYPTO_hash(), GNUNET_CRYPTO_hash_to_enc(), GNUNET_THREAD_LOCAL, p, and ret.

Here is the call graph for this function:

◆ GNUNET_e2s()

const char* GNUNET_e2s ( const struct GNUNET_CRYPTO_EcdhePublicKey p)

Convert a public key value to a string (for printing debug messages).

This is one of the very few calls in the entire API that is NOT reentrant!

Parameters
hcthe hash code
Returns
string

Definition at line 1184 of file common_logging.c.

1185 {
1187  struct GNUNET_HashCode hc;
1188 
1189  GNUNET_CRYPTO_hash (p, sizeof(*p), &hc);
1191  ret.encoding[6] = '\0';
1192  return (const char *) ret.encoding;
1193 }

References GNUNET_CRYPTO_hash(), GNUNET_CRYPTO_hash_to_enc(), GNUNET_THREAD_LOCAL, p, and ret.

Referenced by do_rekey(), GCC_handle_kx(), GCC_handle_kx_auth(), GCT_add_channel(), GCT_handle_kx(), handle_tunnel_kx(), inject_rekey(), mqm_execute(), send_kx(), and send_kx_auth().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_e2s2()

const char* GNUNET_e2s2 ( const struct GNUNET_CRYPTO_EcdhePublicKey p)

Convert a public key value to a string (for printing debug messages).

This is one of the very few calls in the entire API that is NOT reentrant!

Parameters
hcthe hash code
Returns
string

Definition at line 1197 of file common_logging.c.

1198 {
1200  struct GNUNET_HashCode hc;
1201 
1202  GNUNET_CRYPTO_hash (p, sizeof(*p), &hc);
1204  ret.encoding[6] = '\0';
1205  return (const char *) ret.encoding;
1206 }

References GNUNET_CRYPTO_hash(), GNUNET_CRYPTO_hash_to_enc(), GNUNET_THREAD_LOCAL, p, and ret.

Here is the call graph for this function:

◆ GNUNET_i2s()

const char* GNUNET_i2s ( const struct GNUNET_PeerIdentity pid)

Convert a peer identity to a string (for printing debug messages).

This is one of the very few calls in the entire API that is NOT reentrant!

Parameters
pidthe peer identity
Returns
string form of the pid; will be overwritten by next call to GNUNET_i2s().
Parameters
pidthe peer identity
Returns
string form of the pid; will be overwritten by next call to GNUNET_i2s.

Definition at line 1276 of file common_logging.c.

1277 {
1278  static GNUNET_THREAD_LOCAL char buf[5];
1279  char *ret;
1280 
1281  if (NULL == pid)
1282  return "NULL";
1284  GNUNET_strlcpy (buf, ret, sizeof(buf));
1285  GNUNET_free (ret);
1286  return buf;
1287 }
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
char * GNUNET_CRYPTO_eddsa_public_key_to_string(const struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Convert a public key to a string.
Definition: crypto_ecc.c:251
size_t GNUNET_strlcpy(char *dst, const char *src, size_t n)
Like strlcpy but portable.
Definition: strings.c:139
struct GNUNET_CRYPTO_EddsaPublicKey public_key

References buf, GNUNET_CRYPTO_eddsa_public_key_to_string(), GNUNET_free, GNUNET_strlcpy(), GNUNET_THREAD_LOCAL, pid, GNUNET_PeerIdentity::public_key, and ret.

Referenced by activate_core_visible_dv_path(), add_host_to_known_hosts(), add_revocation(), add_search_string(), add_to_tc(), add_valid_address(), addr_info_cb(), adjust_running_peers(), age_values(), ats_perf_mon_cb(), ats_request_address_change(), attempt_connect(), attempt_connect_task(), backtalker_monotime_cb(), bandwidth_changed_cb(), blacklist_cb(), blacklist_cfg_iter(), broadcast_mst_cb(), cache_transport_peer_connect_notify(), cadet_mq_send_now(), cadet_timeout(), callback_room_connect(), cb_channel_destruction(), cb_channel_incoming(), cb_intersection_request_alice(), check_access(), check_dht_p2p_hello(), check_dht_p2p_put(), check_hello(), check_info(), check_peer_online(), check_peer_pull_reply(), check_vl_transmission(), churn_cb(), clean_peer(), client_connect(), client_delete_session(), client_disconnect_cb(), client_receive(), client_receive_mst_cb(), client_run(), client_send_response(), clients_notify_stream_peer(), compute_diversity(), compute_rand_delay(), connect_bl_check_cont(), connect_cb(), connect_handler(), connect_notify(), connect_peers_run(), consider_for_advertising(), consider_sending_fc(), core_connect_cb(), core_disconnect_cb(), core_init(), core_mq_send_impl(), core_startup_cb(), cores_send_connect_info(), cores_send_disconnect_info(), create_channel_to_destination(), create_session(), cummulative_ack(), database_setup(), decrypt_new_element(), default_reply_handle(), delayed_disconnect(), deliver_message(), derive_aes_key(), derive_iv(), derive_pong_iv(), destroy_ai(), destroy_peer(), destroy_route(), disconnect_all_neighbours(), disconnect_neighbour(), disconnect_notify(), distribute_bandwidth(), do_blacklist_check(), do_connect(), do_decrypt(), do_encrypt(), do_restart_typemap_message(), do_round(), do_send(), do_transmit(), dv_neighbour_transmission(), evaluate(), extract_box_cb(), finish_handling_raw_message(), forward_dv_box(), forward_dv_learn(), fragment_message(), free_backtalker(), free_matching_requests(), free_neighbour(), GAS_addresses_add(), GAS_addresses_destroy(), GAS_addresses_get_peer_info(), GAS_addresses_update(), GAS_handle_preference_change(), GAS_handle_request_address_cancel(), GAS_normalization_update_property(), GAS_proportional_address_add(), GAS_proportional_address_delete(), GAS_scheduling_transmit_address_suggestion(), GCCH_2s(), GCD_search(), GCPP_2s(), GCT_2s(), GCT_handle_kx(), GDS_try_connect(), GDS_u_connect(), GDS_u_disconnect(), GDS_u_receive(), get_cadet(), get_channel(), get_hello(), get_result_iterator(), GNUNET_ATS_address_destroy(), GNUNET_ATS_address_update(), GNUNET_ATS_connectivity_suggest(), GNUNET_CADET_channel_create(), GNUNET_CRYPTO_ecc_dlog(), GNUNET_CRYPTO_ecc_dlog_prepare(), GNUNET_DHT_pp2s(), GNUNET_DHT_verify_path(), GNUNET_PEERINFO_add_peer(), GNUNET_PEERSTORE_store(), GNUNET_PEERSTORE_watch(), GNUNET_RPS_seed_ids(), GNUNET_TRANSPORT_address_to_string(), GNUNET_TRANSPORT_application_suggest(), GNUNET_TRANSPORT_application_suggest_cancel(), GNUNET_TRANSPORT_communicator_receive(), GNUNET_TRANSPORT_TESTING_log_connect(), GNUNET_TRANSPORT_TESTING_log_disconnect(), GNUNET_TRANSPORT_TESTING_restart_peer(), GNUNET_TRANSPORT_TESTING_send(), GNUNET_TRANSPORT_TESTING_stop_peer(), got_hello(), GSC_CLIENTS_deliver_message(), GSC_CLIENTS_notify_client_about_neighbour(), GSC_CLIENTS_solicit_request(), GSC_KX_encrypt_and_transmit(), GSC_SESSIONS_confirm_typemap(), GSC_SESSIONS_create(), GSC_SESSIONS_end(), GSC_SESSIONS_set_typemap(), GSC_SESSIONS_solicit(), GSF_cadet_query(), GSF_cadet_query_cancel(), GSF_cadet_release_clients(), GSF_peer_connect_handler(), GSF_plan_add_(), GSF_push_start_(), GST_ats_add_address(), GST_ats_add_inbound_address(), GST_ats_block_address(), GST_ats_del_session(), GST_ats_expire_address(), GST_ats_new_session(), GST_ats_update_delay(), GST_ats_update_distance(), GST_ats_update_utilization(), GST_blacklist_add_peer(), GST_blacklist_test_allowed(), GST_manipulation_send(), GST_manipulation_set_metric(), GST_neighbours_calculate_receive_delay(), GST_neighbours_force_disconnect(), GST_neighbours_handle_disconnect_message(), GST_neighbours_handle_quota_message(), GST_neighbours_handle_session_ack(), GST_neighbours_handle_session_syn(), GST_neighbours_handle_session_syn_ack(), GST_neighbours_keepalive(), GST_neighbours_send(), GST_neighbours_session_terminated(), GST_neighbours_switch_to_address(), GST_validation_handle_address(), GST_validation_handle_hello(), GST_validation_handle_ping(), GST_validation_handle_pong(), handle_add_queue_message(), handle_address_list(), handle_ats_address_suggestion(), handle_backchannel_encapsulation(), handle_channel_create(), handle_client_blacklist_reply(), handle_client_monitor_peers(), handle_client_redirect_to_service(), handle_client_seed(), handle_client_send(), handle_client_send_request(), handle_client_start(), handle_communicator_backchannel(), handle_connect(), handle_connect_notify(), handle_connection_create(), handle_core_connect(), handle_core_disconnect(), handle_del_queue_message(), handle_dht_p2p_get(), handle_dht_p2p_put(), handle_disconnect(), handle_disconnect_notify(), handle_dv_box(), handle_dv_learn(), handle_encrypted(), handle_ephemeral_key(), handle_feedback(), handle_flow_control(), handle_fragment_box(), handle_friend(), handle_get(), handle_hello(), handle_helper_message(), handle_icmp_remote(), handle_icmp_service(), handle_inbound_channel(), handle_incoming_ack(), handle_incoming_msg(), handle_init_reply(), handle_iterate(), handle_local_ack(), handle_local_data(), handle_notification(), handle_notify_inbound(), handle_overlay_connect(), handle_p2p_estimate(), handle_p2p_get(), handle_p2p_migration_stop(), handle_p2p_put(), handle_peer_check(), handle_peer_pull_request(), handle_peer_push(), handle_ping(), handle_pong(), handle_raw_message(), handle_recv(), handle_regex_result(), handle_reliability_ack(), handle_reliability_box(), handle_remote_overlay_connect(), handle_reply(), handle_revocation_union_request(), handle_room_entry(), handle_search_response(), handle_send_message_ack(), handle_send_ok(), handle_send_ready(), handle_send_transmit_continuation(), handle_set_quota(), handle_store(), handle_suggest(), handle_tcp_data(), handle_tcp_remote(), handle_tcp_service(), handle_tcp_welcome(), handle_transport_notify_connect(), handle_transport_notify_disconnect(), handle_transport_notify_excess_bw(), handle_udp_remote(), handle_udp_service(), handle_validation_response(), handshake_ack_monotime_cb(), handshake_monotime_cb(), hello_iter_cb(), hello_update_cb(), host_processor(), hosts_directory_scan_callback(), http_client_plugin_get_session(), http_client_plugin_peer_disconnect(), http_client_plugin_send(), http_server_plugin_disconnect_peer(), http_server_plugin_send(), ifc_broadcast(), inbound_bw_tracker_update(), info_cb(), init_peer_cb(), insert_in_sampler(), keygen_round1_new_element(), keygen_round2_new_element(), learn_dv_path(), main_init(), manage_service_wrapper(), master_task(), monitor_cb(), monitor_notify_connect(), monitor_notify_disconnect(), mq_error(), mq_init(), mq_online_check_successful(), mq_send_impl(), nat_connect_timeout(), neighbour_delete(), neighbours_changed_notification(), neighbours_connect_notification(), neighbours_disconnect_notification(), new_channel(), new_service_channel(), notify_all(), notify_client_connect_info(), notify_connect(), notify_disconnect(), notify_excess_cb(), occ_cache_get_handle_ats_occ_cb(), occ_cache_get_handle_core_cb(), occ_hello_sent_cb(), offer_hello(), on_message(), operation_timeout(), overlay_connect_notify(), p1_transport_connect_cache_callback(), p2_transport_connect(), p2_transport_connect_cache_callback(), pass_plaintext_to_core(), path_callback(), peer_id_cb(), peerinfo_it(), peerstore_flat_store_record(), plugin_env_session_end(), plugin_env_session_start(), plugin_session_info_cb(), print_channel_destination(), print_info(), print_peer_list(), print_plugin_event_info(), print_view_sizes(), process_data(), process_migration_content(), process_peer_iteration_cb(), process_peer_string(), process_peerinfo_hello(), process_peerinfo_peers(), process_resolved_address(), profiler_reply_handle(), profiler_reply_handle_info(), proto_read_kx(), qc_fragment_sent(), queue_destroy(), queue_send_msg(), read_process_ack(), receiver_destroy(), rekey_monotime_cb(), reliability_box_message(), rem_from_list(), remove_timeout_messages_and_select(), req_addr_peerinfo_it(), requester_callback(), reset_cadet(), result_processor(), rocc_cache_get_handle_transport_cb(), rocc_hello_sent_cb(), route_message(), route_packet(), RPS_sampler_elem_next(), run(), schedule_select_v4(), schedule_select_v6(), schedule_transmit_on_queue(), select_peer(), select_write_cb(), send_add_address_message(), send_broken(), send_disconnect(), send_hello(), send_hello_thru_rocc(), send_ic_request(), send_keep_alive(), send_keepalive(), send_key(), send_message(), send_msg_from_cache(), send_outbound_quota_to_clients(), send_peer_information(), send_pull_reply(), send_pull_request(), send_push(), send_session_ack_message(), send_session_syn_ack_cont(), send_session_syn_cont(), send_syn(), send_syn_ack_message(), send_utilization_data(), send_with_session(), server_access_cb(), server_delete_session(), server_disconnect_cb(), server_lookup_connection(), server_receive_mst_cb(), server_send_callback(), set_incoming_quota(), set_peer_online(), set_primary_address(), set_state_and_timeout(), setup_neighbour(), sock_read(), solver_bandwidth_changed_cb(), start_address_validation(), start_cb(), stop_peer_run(), suggest_to_connect(), switch_address_bl_check_cont(), tcp_plugin_disconnect(), tcp_plugin_disconnect_session(), tcp_plugin_get_session(), tcp_plugin_send(), test_blacklisted(), tokenized_cb(), transmit_cummulative_ack_cb(), transmit_on_queue(), transmit_pending(), transmit_ping_if_allowed(), transmit_send_continuation(), transmit_task_cb(), transmit_typemap_task(), transport_addr_to_str_cb(), try_transmission(), udp_disconnect(), udp_disconnect_session(), udp_plugin_create_session(), udp_plugin_lookup_session(), udp_plugin_send(), udp_select_send(), unblock_address(), unix_plugin_send(), unix_plugin_session_disconnect(), update_active_address(), update_hello(), update_preference(), update_rel_sum(), update_relative_values_for_peer(), valid_peers_iterator(), validation_transmit_on_queue(), view_update_cb(), wlan_plugin_get_session(), wlan_plugin_send(), and write_final_stats().

Here is the call graph for this function:

◆ GNUNET_i2s2()

const char* GNUNET_i2s2 ( const struct GNUNET_PeerIdentity pid)

Convert a peer identity to a string (for printing debug messages).

This is one of the very few calls in the entire API that is NOT reentrant! Identical to GNUNET_i2s(), except that another buffer is used so both GNUNET_i2s() and GNUNET_i2s2() can be used within the same log statement.

Parameters
pidthe peer identity
Returns
string form of the pid; will be overwritten by next call to GNUNET_i2s().

Identical to GNUNET_i2s(), except that another buffer is used so both GNUNET_i2s() and GNUNET_i2s2() can be used within the same log statement.

Parameters
pidthe peer identity
Returns
string form of the pid; will be overwritten by next call to GNUNET_i2s.

Definition at line 1301 of file common_logging.c.

1302 {
1303  static GNUNET_THREAD_LOCAL char buf[5];
1304  char *ret;
1305 
1306  if (NULL == pid)
1307  return "NULL";
1309  GNUNET_strlcpy (buf, ret, sizeof(buf));
1310  GNUNET_free (ret);
1311  return buf;
1312 }

References buf, GNUNET_CRYPTO_eddsa_public_key_to_string(), GNUNET_free, GNUNET_strlcpy(), GNUNET_THREAD_LOCAL, pid, GNUNET_PeerIdentity::public_key, and ret.

Referenced by derive_aes_key(), destroy_route(), forward_dv_learn(), handle_dv_box(), handle_ping(), send_broken(), and send_msg_from_cache().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_i2s_full()

const char* GNUNET_i2s_full ( const struct GNUNET_PeerIdentity pid)

Convert a peer identity to a string (for printing debug messages).

This is one of the very few calls in the entire API that is NOT reentrant!

Parameters
pidthe peer identity
Returns
string form of the pid; will be overwritten by next call to GNUNET_i2s_full().
Parameters
pidthe peer identity
Returns
string form of the pid; will be overwritten by next call to GNUNET_i2s_full.

Definition at line 1323 of file common_logging.c.

1324 {
1325  static GNUNET_THREAD_LOCAL char buf[256];
1326  char *ret;
1327 
1329  strcpy (buf, ret);
1330  GNUNET_free (ret);
1331  return buf;
1332 }

References buf, GNUNET_CRYPTO_eddsa_public_key_to_string(), GNUNET_free, GNUNET_THREAD_LOCAL, pid, GNUNET_PeerIdentity::public_key, and ret.

Referenced by channel_incoming(), client_connect(), consider_ss_ack(), do_round(), dump_pc(), enc_notify_cb(), get_host_filename(), get_idx_of_pid(), gns_value_to_string(), GNUNET_TRANSPORT_TESTING_start_peer(), GST_validation_handle_ping(), handle_ephemeral_key(), hist_update(), info_cb(), mq_init(), on_message(), operation_timeout(), peers_callback(), print_peer_info(), profiler_reply_handle(), profiler_reply_handle_info(), read_blacklist_configuration(), reply_handle(), restore_valid_peers(), run(), server_configure_plugin(), server_parse_url(), start_peer_run(), state_machine(), store_peer_presistently_iterator(), stream_input_handle(), tunnels_callback(), and view_update_handle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_a2s()

const char* GNUNET_a2s ( const struct sockaddr *  addr,
socklen_t  addrlen 
)

Convert a "struct sockaddr*" (IPv4 or IPv6 address) to a string (for printing debug messages).

This is one of the very few calls in the entire API that is NOT reentrant!

Parameters
addrthe address
addrlenthe length of the addr
Returns
nicely formatted string for the address will be overwritten by next call to GNUNET_a2s().

This is one of the very few calls in the entire API that is NOT reentrant!

Parameters
addrthe address
addrlenthe length of the address in addr
Returns
nicely formatted string for the address will be overwritten by next call to GNUNET_a2s.

Definition at line 1346 of file common_logging.c.

1347 {
1348 #define LEN \
1349  GNUNET_MAX ((INET6_ADDRSTRLEN + 8), \
1350  (1 + sizeof(struct sockaddr_un) - sizeof(sa_family_t)))
1351  static GNUNET_THREAD_LOCAL char buf[LEN];
1352 #undef LEN
1353  static GNUNET_THREAD_LOCAL char b2[6];
1354  const struct sockaddr_in *v4;
1355  const struct sockaddr_un *un;
1356  const struct sockaddr_in6 *v6;
1357  unsigned int off;
1358 
1359  if (addr == NULL)
1360  return _ ("unknown address");
1361  switch (addr->sa_family)
1362  {
1363  case AF_INET:
1364  if (addrlen != sizeof(struct sockaddr_in))
1365  return "<invalid v4 address>";
1366  v4 = (const struct sockaddr_in *) addr;
1367  inet_ntop (AF_INET, &v4->sin_addr, buf, INET_ADDRSTRLEN);
1368  if (0 == ntohs (v4->sin_port))
1369  return buf;
1370  strcat (buf, ":");
1371  GNUNET_snprintf (b2, sizeof(b2), "%u", ntohs (v4->sin_port));
1372  strcat (buf, b2);
1373  return buf;
1374 
1375  case AF_INET6:
1376  if (addrlen != sizeof(struct sockaddr_in6))
1377  return "<invalid v6 address>";
1378  v6 = (const struct sockaddr_in6 *) addr;
1379  buf[0] = '[';
1380  inet_ntop (AF_INET6, &v6->sin6_addr, &buf[1], INET6_ADDRSTRLEN);
1381  if (0 == ntohs (v6->sin6_port))
1382  return &buf[1];
1383  strcat (buf, "]:");
1384  GNUNET_snprintf (b2, sizeof(b2), "%u", ntohs (v6->sin6_port));
1385  strcat (buf, b2);
1386  return buf;
1387 
1388  case AF_UNIX:
1389  if (addrlen <= sizeof(sa_family_t))
1390  return "<unbound UNIX client>";
1391  un = (const struct sockaddr_un *) addr;
1392  off = 0;
1393  if ('\0' == un->sun_path[0])
1394  off++;
1395  memset (buf, 0, sizeof(buf));
1397  sizeof(buf),
1398  "%s%.*s",
1399  (1 == off) ? "@" : "",
1400  (int) (addrlen - sizeof(sa_family_t) - off),
1401  &un->sun_path[off]);
1402  return buf;
1403 
1404  default:
1405  return _ ("invalid address");
1406  }
1407 }
#define LEN
int GNUNET_snprintf(char *buf, size_t size, const char *format,...) __attribute__((format(printf
Like snprintf, just aborts if the buffer is of insufficient size.

References _, buf, GNUNET_snprintf(), GNUNET_THREAD_LOCAL, and LEN.

Referenced by accept_client(), add_addr(), addr_cb(), address_cb(), analyze_send_error(), check_access(), connect_success_continuation(), create_listen_socket(), free_lal(), get_server_addresses(), GNUNET_CONNECTION_connect_socket(), GNUNET_CONNECTION_create_from_accept(), GNUNET_NAT_AUTO_test_start(), GNUNET_NAT_test_start(), GNUNET_NETWORK_socket_accept(), handle_request(), handle_response(), handle_tcp_data(), handle_tcp_nat_probe(), handle_tcp_welcome(), http_common_address_from_socket(), http_common_dns_ip_lookup_cb(), iface_proc(), ifc_broadcast(), init_socket(), interface_proc(), LEGACY_SERVICE_get_server_addresses(), libgnunet_plugin_transport_tcp_init(), mq_init(), mq_send_kx(), nat_address_cb(), nat_register(), notify_client(), notify_client_external_ipv4_change(), open_listen_socket(), print_sockaddr(), process_external_ip(), process_incoming(), proto_read_kx(), queue_read_kx(), receive_ready(), reversal_cb(), run(), run_scan(), send_UDPRekey(), server_accept_cb(), server_get_addresses(), server_nat_port_map_callback(), service_task(), setup_sockets(), sock_read(), sockaddr_to_udpaddr_string(), tcp_nat_port_map_callback(), tcp_plugin_get_session(), transmit_query(), transmit_ready(), transmit_timeout(), try_connect_using_address(), try_handle_plaintext(), try_send_tcp(), try_send_udp(), udp_ipv4_broadcast_send(), udp_ipv6_broadcast_send(), udp_nat_port_map_callback(), udp_select_read(), udp_select_send(), unix_plugin_get_network(), and upnp_addr_change_cb().

Here is the call graph for this function:

◆ GNUNET_error_type_to_string()

const char* GNUNET_error_type_to_string ( enum GNUNET_ErrorType  kind)

Convert error type to string.

Parameters
kindtype to convert
Returns
string corresponding to the type

Definition at line 1101 of file common_logging.c.

1102 {
1103  if ((kind & GNUNET_ERROR_TYPE_ERROR) > 0)
1104  return _ ("ERROR");
1105  if ((kind & GNUNET_ERROR_TYPE_WARNING) > 0)
1106  return _ ("WARNING");
1107  if ((kind & GNUNET_ERROR_TYPE_MESSAGE) > 0)
1108  return _ ("MESSAGE");
1109  if ((kind & GNUNET_ERROR_TYPE_INFO) > 0)
1110  return _ ("INFO");
1111  if ((kind & GNUNET_ERROR_TYPE_DEBUG) > 0)
1112  return _ ("DEBUG");
1113  if ((kind & ~GNUNET_ERROR_TYPE_BULK) == 0)
1114  return _ ("NONE");
1115  return _ ("INVALID");
1116 }

References _, GNUNET_ERROR_TYPE_BULK, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_ERROR_TYPE_MESSAGE, and GNUNET_ERROR_TYPE_WARNING.

Referenced by output_message(), and run().

Here is the caller graph for this function: