add npf_ext_param_string()

This commit is contained in:
jakllsch 2014-05-19 18:47:19 +00:00
parent 2f89c03432
commit c628b5784a
2 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: npf.c,v 1.28 2014/02/13 03:34:41 rmind Exp $ */
/* $NetBSD: npf.c,v 1.29 2014/05/19 18:47:19 jakllsch Exp $ */
/*-
* Copyright (c) 2010-2014 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.28 2014/02/13 03:34:41 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.29 2014/05/19 18:47:19 jakllsch Exp $");
#include <sys/types.h>
#include <netinet/in_systm.h>
@ -432,6 +432,13 @@ npf_ext_param_bool(nl_ext_t *ext, const char *key, bool val)
prop_dictionary_set_bool(extdict, key, val);
}
void
npf_ext_param_string(nl_ext_t *ext, const char *key, const char *val)
{
prop_dictionary_t extdict = ext->nxt_dict;
prop_dictionary_set_cstring(extdict, key, val);
}
/*
* RULE INTERFACE.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: npf.h,v 1.25 2014/02/13 03:34:41 rmind Exp $ */
/* $NetBSD: npf.h,v 1.26 2014/05/19 18:47:19 jakllsch Exp $ */
/*-
* Copyright (c) 2011-2014 The NetBSD Foundation, Inc.
@ -87,6 +87,7 @@ int npf_ruleset_flush(int, const char *);
nl_ext_t * npf_ext_construct(const char *name);
void npf_ext_param_u32(nl_ext_t *, const char *, uint32_t);
void npf_ext_param_bool(nl_ext_t *, const char *, bool);
void npf_ext_param_string(nl_ext_t *, const char *, const char *);
nl_rule_t * npf_rule_create(const char *, uint32_t, const char *);
int npf_rule_setcode(nl_rule_t *, int, const void *, size_t);