On Friday, 7 May 2021 19:14:14 CEST Alexander Sarmanow wrote:
+void netlink_print_json_entries(struct nlattr *attrs[], int selected_attrs[],
int arr_len, struct print_opts *opts);
+void netlink_print_json_entry(struct nlattr *attrs[], int idx); +void nljson_print_str(struct json_opts *json_opts, struct print_opts *opts, struct nlattr *attrs[], int idx); +void nljson_print_ifname_by_ifindex(struct json_opts *json_opts, struct print_opts *opts,
struct nlattr *attrs[], int idx);
+void nljson_print_int(struct json_opts *json_opts, struct print_opts *opts, struct nlattr *attrs[], int idx); +void nljson_print_unsigned(struct json_opts *json_opts, struct print_opts *opts, struct nlattr *attrs[],
int idx);
+void nljson_print_uint8_t(struct json_opts *json_opts, struct print_opts *opts, struct nlattr *attrs[],
int idx);
+void nljson_print_vid(struct json_opts *json_opts, struct print_opts *opts, struct nlattr *attrs[], int idx); +void nljson_print_crc32(struct json_opts *json_opts, struct print_opts *opts, struct nlattr *attrs[], int idx); +void nljson_print_mac(struct json_opts *json_opts, struct print_opts *opts, struct nlattr *attrs[], int idx); +void nljson_print_bool(struct json_opts *json_opts, struct print_opts *opts, struct nlattr *attrs[], int idx); +void nljson_print_ttflags(struct json_opts *json_opts, struct print_opts *opts, struct nlattr *attrs[],
int idx);
+void create_json_print_string(const char *str, const char **str_ret); +void sanitize_string(const char *str, int str_len);
Why are you exporting all of these functions? Most should be static inside the c file. I would recommend a new genl_json.c file.
Kind regards, Sven