From c628b5784aa6958227d6928c439c82f1f0ebea98 Mon Sep 17 00:00:00 2001 From: jakllsch Date: Mon, 19 May 2014 18:47:19 +0000 Subject: [PATCH] add npf_ext_param_string() --- lib/libnpf/npf.c | 11 +++++++++-- lib/libnpf/npf.h | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/libnpf/npf.c b/lib/libnpf/npf.c index 436ade352c8a..ae5c07a31e1d 100644 --- a/lib/libnpf/npf.c +++ b/lib/libnpf/npf.c @@ -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 -__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 #include @@ -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. */ diff --git a/lib/libnpf/npf.h b/lib/libnpf/npf.h index ba78a1f11fc2..d26adbd36d65 100644 --- a/lib/libnpf/npf.h +++ b/lib/libnpf/npf.h @@ -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);