summaryrefslogtreecommitdiff
path: root/sys/net/pf_ioctl.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-06-03 12:30:34 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-06-03 12:30:34 +0000
commit809196520a7a7fddd15b5dae4321b9f24db50995 (patch)
treec03dd2e696dca5d92551a19f4fbb8b747cba2aa0 /sys/net/pf_ioctl.c
parent19f706d21a74cb53b6584d41e65ec10f20ef940e (diff)
provide pf_tag2tagname which is the reverse of pf_tagname2tag. needed soon.
Diffstat (limited to 'sys/net/pf_ioctl.c')
-rw-r--r--sys/net/pf_ioctl.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index d0fe22b00db..896213c37d3 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.65 2003/05/14 01:39:51 frantzen Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.66 2003/06/03 12:30:33 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -84,6 +84,7 @@ void pf_mv_pool(struct pf_palist *, struct pf_palist *);
void pf_empty_pool(struct pf_palist *);
int pfioctl(dev_t, u_long, caddr_t, int, struct proc *);
u_int16_t pf_tagname2tag(char *);
+void pf_tag2tagname(u_int16_t, char *);
void pf_tag_unref(u_int16_t);
void pf_tag_purge(void);
@@ -454,6 +455,18 @@ pf_tagname2tag(char *tagname)
}
void
+pf_tag2tagname(u_int16_t tagid, char *p)
+{
+ struct pf_tagname *tag;
+
+ TAILQ_FOREACH(tag, &pf_tags, entries)
+ if (tag->tag == tagid) {
+ strlcpy(p, tag->name, PF_TAG_NAME_SIZE);
+ return;
+ }
+}
+
+void
pf_tag_unref(u_int16_t tag)
{
struct pf_tagname *p;