conntrack: labels: add function to fetch default config file location
Florian Westphal
maintainerPATCH 1/1 conntrack: labels: add function to fetch default config file location
Suggested-by Pablo Neira Ayuso <[email protected]>
Signed-off-by Florian Westphal <[email protected]>
--- include/internal/prototypes.h | 1 + include/libnetfilter_conntrack/libnetfilter_conntrack.h | 1 + src/conntrack/api.c | 11 +++++++++++ src/conntrack/labels.c | 5 +++++ 4 files changed, 18 insertions(+)
include/internal/prototypes.h +1 -0
@@ -58,6 +58,7 @@ int __snprintf_expect_xml(char *buf, unsigned int len, const struct nf_expect *e/* * connlabel internal prototypes */ +const char *__labels_get_path (void );struct nfct_labelmap *__labelmap_new (const char *);void __labelmap_destroy (struct nfct_labelmap *);
include/libnetfilter_conntrack/libnetfilter_conntrack.h +1 -0
@@ -297,6 +297,7 @@ bool nfct_bitmask_equal(const struct nfct_bitmask *, const struct nfct_bitmask */* connlabel name <-> bit translation mapping */ struct nfct_labelmap ; +const char *nfct_labels_get_path (void );struct nfct_labelmap *nfct_labelmap_new (const char *mapfile);void nfct_labelmap_destroy (struct nfct_labelmap *map);const char *nfct_labelmap_get_name (struct nfct_labelmap *m,unsigned int bit);
src/conntrack/api.c +11 -0
@@ -1527,6 +1527,17 @@ void nfct_filter_dump_set_attr_u8(struct nfct_filter_dump *filter_dump,*/ /** +* nfct_labels_get_path - get name of default config path +* +* returns a pointer to a immutable (static) string containing +* the default connlabel.conf file location. +*/ +const char *nfct_labels_get_path (void ) +{ +return __labels_get_path (); +} + +/** * nfct_labelmap_get_name - get name of the label bit * * \param m label map obtained from nfct_label_open
src/conntrack/labels.c +5 -0
@@ -209,6 +209,11 @@ static bool label_is_sane(const char *label)return true; } +const char *__labels_get_path (void ) +{ +return CONNLABEL_CFG ; +} +struct nfct_labelmap *__labelmap_new (const char *name) {struct nfct_labelmap *map;
Signature · 1 line
2.7.3
Quoted 2 lines · Florian Westphal
Suggested-by Pablo Neira Ayuso <[email protected]>Signed-off-by Florian Westphal <[email protected]>