Project Alice
Loading...
Searching...
No Matches
pcp_utils.h File Reference
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "pcp_logger.h"
#include "pcp_client_db.h"
#include "pcp_msg.h"
Include dependency graph for pcp_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define UNUSED
 
#define DUPPRINT(fp, fmt...)
 
#define log_err(STR)
 
#define log_debug_scr(STR)
 
#define log_debug(STR)
 
#define CHECK_RET_EXIT(func)
 
#define CHECK_NULL_EXIT(func)
 
#define CHECK_RET(func)
 
#define CHECK_RET_GOTO_ERROR(func)
 
#define OSDEP(x)   (void)(x)
 
#define S6_ADDR32(sa6)   ((uint32_t *)((sa6)->s6_addr))
 
#define IPV6_ADDR_COPY(dest, src)
 
#define strndup   pcp_strndup
 

Macro Definition Documentation

◆ CHECK_NULL_EXIT

#define CHECK_NULL_EXIT (   func)
Value:
do { \
if (func == NULL) { \
log_err(""); \
exit (EXIT_FAILURE); \
} \
} while(0)

Definition at line 83 of file pcp_utils.h.

◆ CHECK_RET

#define CHECK_RET (   func)
Value:
do { \
if (func < 0) { \
log_err(""); \
} \
} while(0)

Definition at line 92 of file pcp_utils.h.

◆ CHECK_RET_EXIT

#define CHECK_RET_EXIT (   func)
Value:
do { \
if (func < 0) { \
log_err(""); \
exit (EXIT_FAILURE); \
} \
} while(0)

Definition at line 75 of file pcp_utils.h.

◆ CHECK_RET_GOTO_ERROR

#define CHECK_RET_GOTO_ERROR (   func)
Value:
do { \
if (func < 0) { \
log_err(""); \
goto ERROR; \
} \
} while(0)
#define ERROR(name)
Definition: error_private.h:55

Definition at line 99 of file pcp_utils.h.

◆ DUPPRINT

#define DUPPRINT (   fp,
  fmt... 
)
Value:
do { \
printf(fmt); \
if (fp != NULL) { \
fprintf(fp,fmt); \
} \
} while(0)

Definition at line 51 of file pcp_utils.h.

◆ IPV6_ADDR_COPY

#define IPV6_ADDR_COPY (   dest,
  src 
)
Value:
do { \
(S6_ADDR32(dest))[0]=(S6_ADDR32(src))[0]; \
(S6_ADDR32(dest))[1]=(S6_ADDR32(src))[1]; \
(S6_ADDR32(dest))[2]=(S6_ADDR32(src))[2]; \
(S6_ADDR32(dest))[3]=(S6_ADDR32(src))[3]; \
} while (0)
#define S6_ADDR32(sa6)
Definition: pcp_utils.h:114

Definition at line 117 of file pcp_utils.h.

◆ log_debug

#define log_debug (   STR)
Value:
do { \
printf("%s:%d "#STR" \n", __FUNCTION__, __LINE__); \
} while (0)

Definition at line 70 of file pcp_utils.h.

◆ log_debug_scr

#define log_debug_scr (   STR)
Value:
do { \
printf("%s:%d %s \n", __FUNCTION__, __LINE__, STR); \
} while (0)

Definition at line 65 of file pcp_utils.h.

◆ log_err

#define log_err (   STR)
Value:
do { \
printf("%s:%d "#STR": %s \n", __FUNCTION__, __LINE__, strerror(errno)); \
} while (0)

Definition at line 60 of file pcp_utils.h.

◆ OSDEP

#define OSDEP (   x)    (void)(x)

Definition at line 109 of file pcp_utils.h.

◆ S6_ADDR32

#define S6_ADDR32 (   sa6)    ((uint32_t *)((sa6)->s6_addr))

Definition at line 114 of file pcp_utils.h.

◆ strndup

#define strndup   pcp_strndup

Definition at line 233 of file pcp_utils.h.

◆ UNUSED

#define UNUSED

Definition at line 38 of file pcp_utils.h.