forked from Mirror/frr
*: apply proper format string attributes
So that we get warnings about broken format strings. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
e784f789fb
commit
0f9de11a11
|
@ -746,6 +746,7 @@ static void bfd_sd_reschedule(struct bfd_vrf_global *bvrf, int sd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PRINTFRR(6, 7)
|
||||||
static void cp_debug(bool mhop, struct sockaddr_any *peer,
|
static void cp_debug(bool mhop, struct sockaddr_any *peer,
|
||||||
struct sockaddr_any *local, ifindex_t ifindex,
|
struct sockaddr_any *local, ifindex_t ifindex,
|
||||||
vrf_id_t vrfid, const char *fmt, ...)
|
vrf_id_t vrfid, const char *fmt, ...)
|
||||||
|
|
|
@ -81,6 +81,7 @@ static void bfdd_client_deregister(struct stream *msg);
|
||||||
/*
|
/*
|
||||||
* Functions
|
* Functions
|
||||||
*/
|
*/
|
||||||
|
PRINTFRR(2, 3)
|
||||||
static void debug_printbpc(const struct bfd_peer_cfg *bpc, const char *fmt, ...)
|
static void debug_printbpc(const struct bfd_peer_cfg *bpc, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
char timers[3][128] = {};
|
char timers[3][128] = {};
|
||||||
|
|
|
@ -322,6 +322,7 @@ int rfapiDebugPrintf(void *dummy, const char *format, ...)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PRINTFRR(2, 3)
|
||||||
static int rfapiStdioPrintf(void *stream, const char *format, ...)
|
static int rfapiStdioPrintf(void *stream, const char *format, ...)
|
||||||
{
|
{
|
||||||
FILE *file = NULL;
|
FILE *file = NULL;
|
||||||
|
|
|
@ -108,6 +108,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
PRINTFRR(3, 0)
|
||||||
void vzlogx(const struct xref_logmsg *xref, int prio,
|
void vzlogx(const struct xref_logmsg *xref, int prio,
|
||||||
const char *format, va_list args)
|
const char *format, va_list args)
|
||||||
{
|
{
|
||||||
|
|
|
@ -219,6 +219,7 @@ ferr_r ferr_clear(void)
|
||||||
return ferr_ok();
|
return ferr_ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PRINTFRR(7, 0)
|
||||||
static ferr_r ferr_set_va(const char *file, int line, const char *func,
|
static ferr_r ferr_set_va(const char *file, int line, const char *func,
|
||||||
enum ferr_kind kind, const char *pathname,
|
enum ferr_kind kind, const char *pathname,
|
||||||
int errno_val, const char *text, va_list va)
|
int errno_val, const char *text, va_list va)
|
||||||
|
|
|
@ -178,10 +178,12 @@ ferr_r ferr_clear(void);
|
||||||
|
|
||||||
/* do NOT call these functions directly. only for macro use! */
|
/* do NOT call these functions directly. only for macro use! */
|
||||||
ferr_r ferr_set_internal(const char *file, int line, const char *func,
|
ferr_r ferr_set_internal(const char *file, int line, const char *func,
|
||||||
enum ferr_kind kind, const char *text, ...);
|
enum ferr_kind kind, const char *text, ...)
|
||||||
|
PRINTFRR(5, 6);
|
||||||
ferr_r ferr_set_internal_ext(const char *file, int line, const char *func,
|
ferr_r ferr_set_internal_ext(const char *file, int line, const char *func,
|
||||||
enum ferr_kind kind, const char *pathname,
|
enum ferr_kind kind, const char *pathname,
|
||||||
int errno_val, const char *text, ...);
|
int errno_val, const char *text, ...)
|
||||||
|
PRINTFRR(7, 8);
|
||||||
|
|
||||||
#define ferr_ok() 0
|
#define ferr_ok() 0
|
||||||
|
|
||||||
|
@ -221,7 +223,8 @@ ferr_r ferr_set_internal_ext(const char *file, int line, const char *func,
|
||||||
|
|
||||||
#include "vty.h"
|
#include "vty.h"
|
||||||
/* print error message to vty; $ERR is replaced by the error's message */
|
/* print error message to vty; $ERR is replaced by the error's message */
|
||||||
void vty_print_error(struct vty *vty, ferr_r err, const char *msg, ...);
|
void vty_print_error(struct vty *vty, ferr_r err, const char *msg, ...)
|
||||||
|
PRINTFRR(3, 4);
|
||||||
|
|
||||||
#define CMD_FERR_DO(func, action, ...) \
|
#define CMD_FERR_DO(func, action, ...) \
|
||||||
do { \
|
do { \
|
||||||
|
|
|
@ -71,7 +71,8 @@ extern void nb_cli_enqueue_change(struct vty *vty, const char *xpath,
|
||||||
* CMD_SUCCESS on success, CMD_WARNING_CONFIG_FAILED otherwise.
|
* CMD_SUCCESS on success, CMD_WARNING_CONFIG_FAILED otherwise.
|
||||||
*/
|
*/
|
||||||
extern int nb_cli_apply_changes_clear_pending(struct vty *vty,
|
extern int nb_cli_apply_changes_clear_pending(struct vty *vty,
|
||||||
const char *xpath_base_fmt, ...);
|
const char *xpath_base_fmt, ...)
|
||||||
|
PRINTFRR(2, 3);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Apply enqueued changes to the candidate configuration, this function
|
* Apply enqueued changes to the candidate configuration, this function
|
||||||
|
@ -89,7 +90,7 @@ extern int nb_cli_apply_changes_clear_pending(struct vty *vty,
|
||||||
* CMD_SUCCESS on success, CMD_WARNING_CONFIG_FAILED otherwise.
|
* CMD_SUCCESS on success, CMD_WARNING_CONFIG_FAILED otherwise.
|
||||||
*/
|
*/
|
||||||
extern int nb_cli_apply_changes(struct vty *vty, const char *xpath_base_fmt,
|
extern int nb_cli_apply_changes(struct vty *vty, const char *xpath_base_fmt,
|
||||||
...);
|
...) PRINTFRR(2, 3);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Execute a YANG RPC or Action.
|
* Execute a YANG RPC or Action.
|
||||||
|
|
|
@ -130,6 +130,7 @@ struct ttable *ttable_new(const struct ttable_style *style)
|
||||||
*
|
*
|
||||||
* @return pointer to the first cell of allocated row
|
* @return pointer to the first cell of allocated row
|
||||||
*/
|
*/
|
||||||
|
PRINTFRR(3, 0)
|
||||||
static struct ttable_cell *ttable_insert_row_va(struct ttable *tt, int i,
|
static struct ttable_cell *ttable_insert_row_va(struct ttable *tt, int i,
|
||||||
const char *format, va_list ap)
|
const char *format, va_list ap)
|
||||||
{
|
{
|
||||||
|
|
15
lib/yang.h
15
lib/yang.h
|
@ -331,7 +331,8 @@ extern void yang_dnode_get_path(const struct lyd_node *dnode, char *xpath,
|
||||||
* Schema name of the libyang data node.
|
* Schema name of the libyang data node.
|
||||||
*/
|
*/
|
||||||
extern const char *yang_dnode_get_schema_name(const struct lyd_node *dnode,
|
extern const char *yang_dnode_get_schema_name(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...)
|
||||||
|
PRINTFRR(2, 3);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find a libyang data node by its YANG data path.
|
* Find a libyang data node by its YANG data path.
|
||||||
|
@ -366,7 +367,8 @@ extern struct lyd_node *yang_dnode_get(const struct lyd_node *dnode,
|
||||||
* The libyang data node if found, or NULL if not found.
|
* The libyang data node if found, or NULL if not found.
|
||||||
*/
|
*/
|
||||||
extern struct lyd_node *yang_dnode_getf(const struct lyd_node *dnode,
|
extern struct lyd_node *yang_dnode_getf(const struct lyd_node *dnode,
|
||||||
const char *path_fmt, ...);
|
const char *path_fmt, ...)
|
||||||
|
PRINTFRR(2, 3);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if a libyang data node exists.
|
* Check if a libyang data node exists.
|
||||||
|
@ -400,7 +402,7 @@ extern bool yang_dnode_exists(const struct lyd_node *dnode, const char *xpath);
|
||||||
* true if a libyang data node was found, false otherwise.
|
* true if a libyang data node was found, false otherwise.
|
||||||
*/
|
*/
|
||||||
extern bool yang_dnode_existsf(const struct lyd_node *dnode,
|
extern bool yang_dnode_existsf(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(2, 3);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Iterate over all libyang data nodes that satisfy an XPath query.
|
* Iterate over all libyang data nodes that satisfy an XPath query.
|
||||||
|
@ -422,7 +424,7 @@ extern bool yang_dnode_existsf(const struct lyd_node *dnode,
|
||||||
*/
|
*/
|
||||||
void yang_dnode_iterate(yang_dnode_iter_cb cb, void *arg,
|
void yang_dnode_iterate(yang_dnode_iter_cb cb, void *arg,
|
||||||
const struct lyd_node *dnode, const char *xpath_fmt,
|
const struct lyd_node *dnode, const char *xpath_fmt,
|
||||||
...);
|
...) PRINTFRR(4, 5);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if the libyang data node contains a default value. Non-presence
|
* Check if the libyang data node contains a default value. Non-presence
|
||||||
|
@ -459,7 +461,7 @@ extern bool yang_dnode_is_default(const struct lyd_node *dnode,
|
||||||
* true if the data node contains the default value, false otherwise.
|
* true if the data node contains the default value, false otherwise.
|
||||||
*/
|
*/
|
||||||
extern bool yang_dnode_is_defaultf(const struct lyd_node *dnode,
|
extern bool yang_dnode_is_defaultf(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(2, 3);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if the libyang data node and all of its children contain default
|
* Check if the libyang data node and all of its children contain default
|
||||||
|
@ -566,7 +568,8 @@ extern struct list *yang_data_list_new(void);
|
||||||
* Pointer to yang_data if found, NULL otherwise.
|
* Pointer to yang_data if found, NULL otherwise.
|
||||||
*/
|
*/
|
||||||
extern struct yang_data *yang_data_list_find(const struct list *list,
|
extern struct yang_data *yang_data_list_find(const struct list *list,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...)
|
||||||
|
PRINTFRR(2, 3);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create and set up a libyang context (for use by the translator)
|
* Create and set up a libyang context (for use by the translator)
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
PRINTFRR(2, 0)
|
||||||
static inline const char *
|
static inline const char *
|
||||||
yang_dnode_xpath_get_canon(const struct lyd_node *dnode, const char *xpath_fmt,
|
yang_dnode_xpath_get_canon(const struct lyd_node *dnode, const char *xpath_fmt,
|
||||||
va_list ap)
|
va_list ap)
|
||||||
|
@ -75,6 +76,7 @@ yang_dnode_xpath_get_canon(const struct lyd_node *dnode, const char *xpath_fmt,
|
||||||
return lyd_get_value(&__dleaf->node);
|
return lyd_get_value(&__dleaf->node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PRINTFRR(2, 0)
|
||||||
static inline const struct lyd_value *
|
static inline const struct lyd_value *
|
||||||
yang_dnode_xpath_get_value(const struct lyd_node *dnode, const char *xpath_fmt,
|
yang_dnode_xpath_get_value(const struct lyd_node *dnode, const char *xpath_fmt,
|
||||||
va_list ap)
|
va_list ap)
|
||||||
|
|
|
@ -30,105 +30,120 @@ extern "C" {
|
||||||
extern bool yang_str2bool(const char *value);
|
extern bool yang_str2bool(const char *value);
|
||||||
extern struct yang_data *yang_data_new_bool(const char *xpath, bool value);
|
extern struct yang_data *yang_data_new_bool(const char *xpath, bool value);
|
||||||
extern bool yang_dnode_get_bool(const struct lyd_node *dnode,
|
extern bool yang_dnode_get_bool(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(2, 3);
|
||||||
extern bool yang_get_default_bool(const char *xpath_fmt, ...);
|
extern bool yang_get_default_bool(const char *xpath_fmt, ...) PRINTFRR(1, 2);
|
||||||
|
|
||||||
/* dec64 */
|
/* dec64 */
|
||||||
extern double yang_str2dec64(const char *xpath, const char *value);
|
extern double yang_str2dec64(const char *xpath, const char *value);
|
||||||
extern struct yang_data *yang_data_new_dec64(const char *xpath, double value);
|
extern struct yang_data *yang_data_new_dec64(const char *xpath, double value);
|
||||||
extern double yang_dnode_get_dec64(const struct lyd_node *dnode,
|
extern double yang_dnode_get_dec64(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(2, 3);
|
||||||
extern double yang_get_default_dec64(const char *xpath_fmt, ...);
|
extern double yang_get_default_dec64(const char *xpath_fmt, ...) PRINTFRR(1, 2);
|
||||||
|
|
||||||
/* enum */
|
/* enum */
|
||||||
extern int yang_str2enum(const char *xpath, const char *value);
|
extern int yang_str2enum(const char *xpath, const char *value);
|
||||||
extern struct yang_data *yang_data_new_enum(const char *xpath, int value);
|
extern struct yang_data *yang_data_new_enum(const char *xpath, int value);
|
||||||
extern int yang_dnode_get_enum(const struct lyd_node *dnode,
|
extern int yang_dnode_get_enum(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(2, 3);
|
||||||
extern int yang_get_default_enum(const char *xpath_fmt, ...);
|
extern int yang_get_default_enum(const char *xpath_fmt, ...) PRINTFRR(1, 2);
|
||||||
|
|
||||||
/* int8 */
|
/* int8 */
|
||||||
extern int8_t yang_str2int8(const char *value);
|
extern int8_t yang_str2int8(const char *value);
|
||||||
extern struct yang_data *yang_data_new_int8(const char *xpath, int8_t value);
|
extern struct yang_data *yang_data_new_int8(const char *xpath, int8_t value);
|
||||||
extern int8_t yang_dnode_get_int8(const struct lyd_node *dnode,
|
extern int8_t yang_dnode_get_int8(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(2, 3);
|
||||||
extern int8_t yang_get_default_int8(const char *xpath_fmt, ...);
|
extern int8_t yang_get_default_int8(const char *xpath_fmt, ...) PRINTFRR(1, 2);
|
||||||
|
|
||||||
/* int16 */
|
/* int16 */
|
||||||
extern int16_t yang_str2int16(const char *value);
|
extern int16_t yang_str2int16(const char *value);
|
||||||
extern struct yang_data *yang_data_new_int16(const char *xpath, int16_t value);
|
extern struct yang_data *yang_data_new_int16(const char *xpath, int16_t value);
|
||||||
extern int16_t yang_dnode_get_int16(const struct lyd_node *dnode,
|
extern int16_t yang_dnode_get_int16(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(2, 3);
|
||||||
extern int16_t yang_get_default_int16(const char *xpath_fmt, ...);
|
extern int16_t yang_get_default_int16(const char *xpath_fmt, ...)
|
||||||
|
PRINTFRR(1, 2);
|
||||||
|
|
||||||
/* int32 */
|
/* int32 */
|
||||||
extern int32_t yang_str2int32(const char *value);
|
extern int32_t yang_str2int32(const char *value);
|
||||||
extern struct yang_data *yang_data_new_int32(const char *xpath, int32_t value);
|
extern struct yang_data *yang_data_new_int32(const char *xpath, int32_t value);
|
||||||
extern int32_t yang_dnode_get_int32(const struct lyd_node *dnode,
|
extern int32_t yang_dnode_get_int32(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(2, 3);
|
||||||
extern int32_t yang_get_default_int32(const char *xpath_fmt, ...);
|
extern int32_t yang_get_default_int32(const char *xpath_fmt, ...)
|
||||||
|
PRINTFRR(1, 2);
|
||||||
|
|
||||||
/* int64 */
|
/* int64 */
|
||||||
extern int64_t yang_str2int64(const char *value);
|
extern int64_t yang_str2int64(const char *value);
|
||||||
extern struct yang_data *yang_data_new_int64(const char *xpath, int64_t value);
|
extern struct yang_data *yang_data_new_int64(const char *xpath, int64_t value);
|
||||||
extern int64_t yang_dnode_get_int64(const struct lyd_node *dnode,
|
extern int64_t yang_dnode_get_int64(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(2, 3);
|
||||||
extern int64_t yang_get_default_int64(const char *xpath_fmt, ...);
|
extern int64_t yang_get_default_int64(const char *xpath_fmt, ...)
|
||||||
|
PRINTFRR(1, 2);
|
||||||
|
|
||||||
/* uint8 */
|
/* uint8 */
|
||||||
extern uint8_t yang_str2uint8(const char *value);
|
extern uint8_t yang_str2uint8(const char *value);
|
||||||
extern struct yang_data *yang_data_new_uint8(const char *xpath, uint8_t value);
|
extern struct yang_data *yang_data_new_uint8(const char *xpath, uint8_t value);
|
||||||
extern uint8_t yang_dnode_get_uint8(const struct lyd_node *dnode,
|
extern uint8_t yang_dnode_get_uint8(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(2, 3);
|
||||||
extern uint8_t yang_get_default_uint8(const char *xpath_fmt, ...);
|
extern uint8_t yang_get_default_uint8(const char *xpath_fmt, ...)
|
||||||
|
PRINTFRR(1, 2);
|
||||||
|
|
||||||
/* uint16 */
|
/* uint16 */
|
||||||
extern uint16_t yang_str2uint16(const char *value);
|
extern uint16_t yang_str2uint16(const char *value);
|
||||||
extern struct yang_data *yang_data_new_uint16(const char *xpath,
|
extern struct yang_data *yang_data_new_uint16(const char *xpath,
|
||||||
uint16_t value);
|
uint16_t value);
|
||||||
extern uint16_t yang_dnode_get_uint16(const struct lyd_node *dnode,
|
extern uint16_t yang_dnode_get_uint16(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...)
|
||||||
extern uint16_t yang_get_default_uint16(const char *xpath_fmt, ...);
|
PRINTFRR(2, 3);
|
||||||
|
extern uint16_t yang_get_default_uint16(const char *xpath_fmt, ...)
|
||||||
|
PRINTFRR(1, 2);
|
||||||
|
|
||||||
/* uint32 */
|
/* uint32 */
|
||||||
extern uint32_t yang_str2uint32(const char *value);
|
extern uint32_t yang_str2uint32(const char *value);
|
||||||
extern struct yang_data *yang_data_new_uint32(const char *xpath,
|
extern struct yang_data *yang_data_new_uint32(const char *xpath,
|
||||||
uint32_t value);
|
uint32_t value);
|
||||||
extern uint32_t yang_dnode_get_uint32(const struct lyd_node *dnode,
|
extern uint32_t yang_dnode_get_uint32(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...)
|
||||||
extern uint32_t yang_get_default_uint32(const char *xpath_fmt, ...);
|
PRINTFRR(2, 3);
|
||||||
|
extern uint32_t yang_get_default_uint32(const char *xpath_fmt, ...)
|
||||||
|
PRINTFRR(1, 2);
|
||||||
|
|
||||||
/* uint64 */
|
/* uint64 */
|
||||||
extern uint64_t yang_str2uint64(const char *value);
|
extern uint64_t yang_str2uint64(const char *value);
|
||||||
extern struct yang_data *yang_data_new_uint64(const char *xpath,
|
extern struct yang_data *yang_data_new_uint64(const char *xpath,
|
||||||
uint64_t value);
|
uint64_t value);
|
||||||
extern uint64_t yang_dnode_get_uint64(const struct lyd_node *dnode,
|
extern uint64_t yang_dnode_get_uint64(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...)
|
||||||
extern uint64_t yang_get_default_uint64(const char *xpath_fmt, ...);
|
PRINTFRR(2, 3);
|
||||||
|
extern uint64_t yang_get_default_uint64(const char *xpath_fmt, ...)
|
||||||
|
PRINTFRR(1, 2);
|
||||||
|
|
||||||
/* string */
|
/* string */
|
||||||
extern struct yang_data *yang_data_new_string(const char *xpath,
|
extern struct yang_data *yang_data_new_string(const char *xpath,
|
||||||
const char *value);
|
const char *value);
|
||||||
extern const char *yang_dnode_get_string(const struct lyd_node *dnode,
|
extern const char *yang_dnode_get_string(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...)
|
||||||
|
PRINTFRR(2, 3);
|
||||||
extern void yang_dnode_get_string_buf(char *buf, size_t size,
|
extern void yang_dnode_get_string_buf(char *buf, size_t size,
|
||||||
const struct lyd_node *dnode,
|
const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...)
|
||||||
extern const char *yang_get_default_string(const char *xpath_fmt, ...);
|
PRINTFRR(4, 5);
|
||||||
|
extern const char *yang_get_default_string(const char *xpath_fmt, ...)
|
||||||
|
PRINTFRR(1, 2);
|
||||||
extern void yang_get_default_string_buf(char *buf, size_t size,
|
extern void yang_get_default_string_buf(char *buf, size_t size,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...)
|
||||||
|
PRINTFRR(3, 4);
|
||||||
|
|
||||||
/* binary */
|
/* binary */
|
||||||
extern struct yang_data *yang_data_new_binary(const char *xpath,
|
extern struct yang_data *yang_data_new_binary(const char *xpath,
|
||||||
const char *value, size_t len);
|
const char *value, size_t len);
|
||||||
extern size_t yang_dnode_get_binary_buf(char *buf, size_t size,
|
extern size_t yang_dnode_get_binary_buf(char *buf, size_t size,
|
||||||
const struct lyd_node *dnode,
|
const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...)
|
||||||
|
PRINTFRR(4, 5);
|
||||||
|
|
||||||
/* empty */
|
/* empty */
|
||||||
extern struct yang_data *yang_data_new_empty(const char *xpath);
|
extern struct yang_data *yang_data_new_empty(const char *xpath);
|
||||||
extern bool yang_dnode_get_empty(const struct lyd_node *dnode,
|
extern bool yang_dnode_get_empty(const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(2, 3);
|
||||||
|
|
||||||
/* ip prefix */
|
/* ip prefix */
|
||||||
extern void yang_str2prefix(const char *value, union prefixptr prefix);
|
extern void yang_str2prefix(const char *value, union prefixptr prefix);
|
||||||
|
@ -136,9 +151,9 @@ extern struct yang_data *yang_data_new_prefix(const char *xpath,
|
||||||
union prefixconstptr prefix);
|
union prefixconstptr prefix);
|
||||||
extern void yang_dnode_get_prefix(struct prefix *prefix,
|
extern void yang_dnode_get_prefix(struct prefix *prefix,
|
||||||
const struct lyd_node *dnode,
|
const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(3, 4);
|
||||||
extern void yang_get_default_prefix(union prefixptr var, const char *xpath_fmt,
|
extern void yang_get_default_prefix(union prefixptr var, const char *xpath_fmt,
|
||||||
...);
|
...) PRINTFRR(2, 3);
|
||||||
|
|
||||||
/* ipv4 */
|
/* ipv4 */
|
||||||
extern void yang_str2ipv4(const char *value, struct in_addr *addr);
|
extern void yang_str2ipv4(const char *value, struct in_addr *addr);
|
||||||
|
@ -146,9 +161,9 @@ extern struct yang_data *yang_data_new_ipv4(const char *xpath,
|
||||||
const struct in_addr *addr);
|
const struct in_addr *addr);
|
||||||
extern void yang_dnode_get_ipv4(struct in_addr *addr,
|
extern void yang_dnode_get_ipv4(struct in_addr *addr,
|
||||||
const struct lyd_node *dnode,
|
const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(3, 4);
|
||||||
extern void yang_get_default_ipv4(struct in_addr *var, const char *xpath_fmt,
|
extern void yang_get_default_ipv4(struct in_addr *var, const char *xpath_fmt,
|
||||||
...);
|
...) PRINTFRR(2, 3);
|
||||||
|
|
||||||
/* ipv4p */
|
/* ipv4p */
|
||||||
extern void yang_str2ipv4p(const char *value, union prefixptr prefix);
|
extern void yang_str2ipv4p(const char *value, union prefixptr prefix);
|
||||||
|
@ -156,9 +171,9 @@ extern struct yang_data *yang_data_new_ipv4p(const char *xpath,
|
||||||
union prefixconstptr prefix);
|
union prefixconstptr prefix);
|
||||||
extern void yang_dnode_get_ipv4p(union prefixptr prefix,
|
extern void yang_dnode_get_ipv4p(union prefixptr prefix,
|
||||||
const struct lyd_node *dnode,
|
const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(3, 4);
|
||||||
extern void yang_get_default_ipv4p(union prefixptr var, const char *xpath_fmt,
|
extern void yang_get_default_ipv4p(union prefixptr var, const char *xpath_fmt,
|
||||||
...);
|
...) PRINTFRR(2, 3);
|
||||||
|
|
||||||
/* ipv6 */
|
/* ipv6 */
|
||||||
extern void yang_str2ipv6(const char *value, struct in6_addr *addr);
|
extern void yang_str2ipv6(const char *value, struct in6_addr *addr);
|
||||||
|
@ -166,9 +181,9 @@ extern struct yang_data *yang_data_new_ipv6(const char *xpath,
|
||||||
const struct in6_addr *addr);
|
const struct in6_addr *addr);
|
||||||
extern void yang_dnode_get_ipv6(struct in6_addr *addr,
|
extern void yang_dnode_get_ipv6(struct in6_addr *addr,
|
||||||
const struct lyd_node *dnode,
|
const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(3, 4);
|
||||||
extern void yang_get_default_ipv6(struct in6_addr *var, const char *xpath_fmt,
|
extern void yang_get_default_ipv6(struct in6_addr *var, const char *xpath_fmt,
|
||||||
...);
|
...) PRINTFRR(2, 3);
|
||||||
|
|
||||||
/* ipv6p */
|
/* ipv6p */
|
||||||
extern void yang_str2ipv6p(const char *value, union prefixptr prefix);
|
extern void yang_str2ipv6p(const char *value, union prefixptr prefix);
|
||||||
|
@ -176,17 +191,18 @@ extern struct yang_data *yang_data_new_ipv6p(const char *xpath,
|
||||||
union prefixconstptr prefix);
|
union prefixconstptr prefix);
|
||||||
extern void yang_dnode_get_ipv6p(union prefixptr prefix,
|
extern void yang_dnode_get_ipv6p(union prefixptr prefix,
|
||||||
const struct lyd_node *dnode,
|
const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(3, 4);
|
||||||
extern void yang_get_default_ipv6p(union prefixptr var, const char *xpath_fmt,
|
extern void yang_get_default_ipv6p(union prefixptr var, const char *xpath_fmt,
|
||||||
...);
|
...) PRINTFRR(2, 3);
|
||||||
|
|
||||||
/* ip */
|
/* ip */
|
||||||
extern void yang_str2ip(const char *value, struct ipaddr *addr);
|
extern void yang_str2ip(const char *value, struct ipaddr *addr);
|
||||||
extern struct yang_data *yang_data_new_ip(const char *xpath,
|
extern struct yang_data *yang_data_new_ip(const char *xpath,
|
||||||
const struct ipaddr *addr);
|
const struct ipaddr *addr);
|
||||||
extern void yang_dnode_get_ip(struct ipaddr *addr, const struct lyd_node *dnode,
|
extern void yang_dnode_get_ip(struct ipaddr *addr, const struct lyd_node *dnode,
|
||||||
const char *xpath_fmt, ...);
|
const char *xpath_fmt, ...) PRINTFRR(3, 4);
|
||||||
extern void yang_get_default_ip(struct ipaddr *var, const char *xpath_fmt, ...);
|
extern void yang_get_default_ip(struct ipaddr *var, const char *xpath_fmt, ...)
|
||||||
|
PRINTFRR(2, 3);
|
||||||
|
|
||||||
/* mac */
|
/* mac */
|
||||||
extern struct yang_data *yang_data_new_mac(const char *xpath,
|
extern struct yang_data *yang_data_new_mac(const char *xpath,
|
||||||
|
|
|
@ -38,7 +38,8 @@ DEFINE_MTYPE_STATIC(PATHD, PCEPLIB_MESSAGES, "PCEPlib PCEP Messages");
|
||||||
#define MAX_PATH_NAME_SIZE 255
|
#define MAX_PATH_NAME_SIZE 255
|
||||||
|
|
||||||
/* pceplib logging callback */
|
/* pceplib logging callback */
|
||||||
static int pceplib_logging_cb(int level, const char *fmt, va_list args);
|
static int pceplib_logging_cb(int level, const char *fmt, va_list args)
|
||||||
|
PRINTFRR(2, 0);
|
||||||
|
|
||||||
/* Socket callbacks */
|
/* Socket callbacks */
|
||||||
static int pcep_lib_pceplib_socket_read_cb(void *fpt, void **thread, int fd,
|
static int pcep_lib_pceplib_socket_read_cb(void *fpt, void **thread, int fd,
|
||||||
|
|
|
@ -27,10 +27,12 @@
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "compiler.h"
|
||||||
#include "pcep_utils_logging.h"
|
#include "pcep_utils_logging.h"
|
||||||
|
|
||||||
/* Forward declaration */
|
/* Forward declaration */
|
||||||
int pcep_stdout_logger(int priority, const char *format, va_list args);
|
int pcep_stdout_logger(int priority, const char *format, va_list args)
|
||||||
|
PRINTFRR(2, 0);
|
||||||
|
|
||||||
static pcep_logger_func logger_func = pcep_stdout_logger;
|
static pcep_logger_func logger_func = pcep_stdout_logger;
|
||||||
static int logging_level_ = LOG_INFO;
|
static int logging_level_ = LOG_INFO;
|
||||||
|
|
Loading…
Reference in a new issue