iptables: modify the formatting of some definitions in xtables.h

Based on the previous patch comments, some changes were made to make it more
nuttx style.
https://github.com/apache/nuttx-apps/pull/1829

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2023-07-17 11:19:20 +08:00 committed by Alin Jerpelea
parent 046fe00b96
commit 1bc2e93124

View File

@ -18,8 +18,8 @@
* *
****************************************************************************/ ****************************************************************************/
#ifndef __APPS_INCLUDE_XTABLES_H #ifndef __APPS_INCLUDE_NETUTILS_XTABLES_H
#define __APPS_INCLUDE_XTABLES_H #define __APPS_INCLUDE_NETUTILS_XTABLES_H
/**************************************************************************** /****************************************************************************
* Included Files * Included Files
@ -121,8 +121,9 @@ struct xtables_globals
FAR const char *program_version; FAR const char *program_version;
FAR struct option *orig_opts; FAR struct option *orig_opts;
FAR struct option *opts; FAR struct option *opts;
void (*exit_err)(enum xtables_exittype status, FAR const char *msg, ...) noreturn_function void (*exit_err)(enum xtables_exittype status,
__attribute__ ((noreturn, format(printf, 2, 3))); FAR const char *msg, ...)
printf_like(2, 3);
int (*compat_rev)(FAR const char *name, uint8_t rev, int opt); int (*compat_rev)(FAR const char *name, uint8_t rev, int opt);
}; };
@ -460,35 +461,48 @@ struct xtables_rule_match
* Public Data * Public Data
****************************************************************************/ ****************************************************************************/
extern FAR struct xtables_match *xtables_matches; #ifdef __cplusplus
extern FAR struct xtables_target *xtables_targets; #define EXTERN extern "C"
extern FAR struct xtables_globals *xt_params; extern "C"
{
#else
#define EXTERN extern
#endif
EXTERN FAR struct xtables_match *xtables_matches;
EXTERN FAR struct xtables_target *xtables_targets;
EXTERN FAR struct xtables_globals *xt_params;
/**************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
****************************************************************************/ ****************************************************************************/
extern int xtables_insmod(FAR const char *, FAR const char *, bool); int xtables_insmod(FAR const char *, FAR const char *, bool);
extern int xtables_init_all(FAR struct xtables_globals *xtp, int xtables_init_all(FAR struct xtables_globals *xtp,
uint8_t nfproto); uint8_t nfproto);
extern uint16_t xtables_parse_protocol(FAR const char *s); uint16_t xtables_parse_protocol(FAR const char *s);
extern void xtables_option_tpcall(unsigned int, FAR char **, bool, void xtables_option_tpcall(unsigned int, FAR char **, bool,
FAR struct xtables_target *, FAR void *); FAR struct xtables_target *, FAR void *);
extern void xtables_option_mpcall(unsigned int, FAR char **, bool, void xtables_option_mpcall(unsigned int, FAR char **, bool,
FAR struct xtables_match *, FAR void *); FAR struct xtables_match *, FAR void *);
extern void xtables_option_tfcall(FAR struct xtables_target *); void xtables_option_tfcall(FAR struct xtables_target *);
extern void xtables_option_mfcall(FAR struct xtables_match *); void xtables_option_mfcall(FAR struct xtables_match *);
extern FAR struct option *xtables_options_xfrm(FAR struct option *, FAR struct option *xtables_options_xfrm(FAR struct option *,
FAR struct option *, FAR const struct xt_option_entry *, FAR struct option *,
FAR const struct xt_option_entry *,
FAR unsigned int *); FAR unsigned int *);
extern FAR struct option *xtables_merge_options(FAR struct option *origopts, FAR struct option *xtables_merge_options(FAR struct option *origopts,
FAR struct option *oldopts, FAR const struct option *newopts, FAR struct option *oldopts, FAR const struct option *newopts,
FAR unsigned int *option_offset); FAR unsigned int *option_offset);
extern FAR struct xtables_match *xtables_find_match(FAR const char *name, FAR struct xtables_match *xtables_find_match(FAR const char *name,
enum xtables_tryload, FAR struct xtables_rule_match **match); enum xtables_tryload, FAR struct xtables_rule_match **match);
extern FAR struct xtables_target *xtables_find_target(FAR const char *name, FAR struct xtables_target *xtables_find_target(FAR const char *name,
enum xtables_tryload); enum xtables_tryload);
extern int xtables_compatible_revision(FAR const char *name, int xtables_compatible_revision(FAR const char *name,
uint8_t revision, int opt); uint8_t revision, int opt);
#endif /* __APPS_INCLUDE_XTABLES_H */ #ifdef __cplusplus
}
#endif
#endif /* __APPS_INCLUDE_NETUTILS_XTABLES_H */