Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libnpf * As is customary, append the parameter names from
details: https://anonhg.NetBSD.org/src/rev/3dc53fb3a14e
branches: trunk
changeset: 763500:3dc53fb3a14e
user: jruoho <jruoho%NetBSD.org@localhost>
date: Tue Mar 22 07:28:41 2011 +0000
description:
* As is customary, append the parameter names from
SYNOPSIS to the description of the functions.
* Use .Ss for non-standard subtitles.
* Fix two identical subtitles.
* Add missing .It's, fix few .Ft's.
* Use a little more markup.
* Improve offsets.
diffstat:
lib/libnpf/npf.3 | 74 ++++++++++++++++++++++++++++++-------------------------
1 files changed, 40 insertions(+), 34 deletions(-)
diffs (192 lines):
diff -r ef69ecdd658d -r 3dc53fb3a14e lib/libnpf/npf.3
--- a/lib/libnpf/npf.3 Tue Mar 22 07:06:02 2011 +0000
+++ b/lib/libnpf/npf.3 Tue Mar 22 07:28:41 2011 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: npf.3,v 1.2 2011/02/02 09:05:01 wiz Exp $
+.\" $NetBSD: npf.3,v 1.3 2011/03/22 07:28:41 jruoho Exp $
.\"
.\" Copyright (c) 2011 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -27,7 +27,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd February 2, 2011
+.Dd March 22, 2011
.Dt NPF 3
.Os
.Sh NAME
@@ -76,7 +76,7 @@
.Fn npf_table_create "int index" "int type"
.Ft int
.Fn npf_table_add_entry "nl_table_t *tl" "in_addr_t addr" "in_addr_t mask"
-.Fa bool
+.Ft bool
.Fn npf_table_exists_p "nl_config_t *ncf" "u_int tid"
.Ft int
.Fn npf_table_insert "nl_config_t *ncf" "nl_table_t *tl"
@@ -97,19 +97,23 @@
tables, procedures, or translation policies.
The configuration can be submitted to the kernel.
.\" -----
-.Sh CONFIGURATION
+.Sh FUNCTIONS
+.Ss Configuration
.Bl -tag -width 4n
.It Fn npf_config_create
Create a configuration.
-.It Fn npf_config_submit
-Submit configuration to the kernel.
-.It Fn npf_config_destroy
-Destroy the configuration.
+.It Fn npf_config_submit "ncf" "fd"
+Submit configuration
+.Fa ncf
+to the kernel.
+.It Fn npf_config_destroy "ncf"
+Destroy the configuration
+.Fa ncf .
.El
.\" ---
-.Sh RULE INTERFACE
+.Ss Rule interface
.Bl -tag -width 4n
-.It Fn npf_rule_create
+.It Fn npf_rule_create "name" "attr" "if_idx"
Create a rule with a given name, attribute and priorty.
Name can be
.Dv NULL ,
@@ -148,7 +152,7 @@
.Xr if_nametoindex 3 .
Zero indicates any interface.
.\" ---
-.It Fn npf_rule_setcode
+.It Fn npf_rule_setcode "rl" "type" "code" "sz"
Assign compiled code for the rule specified by
.Fa rl ,
used for filter criteria.
@@ -162,7 +166,7 @@
.Dv NPF_CODE_NCODE
should be passed.
.\" ---
-.It Fn npf_rule_insert
+.It Fn npf_rule_insert "ncf" "parent" "rl" "pri"
Insert the rule into the set of parent rule specified by
.Fa parent .
If value of
@@ -177,28 +181,28 @@
A special constant
.Dv NPF_PRI_NEXT
may be passed to use the value of last used priority incremented by 1.
-.It npf_rule_setproc
+.It Fn npf_rule_setproc "ncf" "rl" "name"
Set procedure for the specified rule.
-.It Fn npf_rule_destroy
+.It Fn npf_rule_destroy "rl"
Destroy the given rule.
.El
.\" -----
-.Sh RULE PROCEDURE INTERFACE
+.Ss Rule procedure interface
.Bl -tag -width 4n
-.It Fn npf_rproc_create
+.It Fn npf_rproc_create "name"
Create a rule procedure with a given
.Fa name .
Name must be unique for each procedure.
-.It Fn npf_rproc_insert
+.It Fn npf_rproc_insert "ncf" "rp"
Insert rule procedure into the specified configuration.
.El
.\" -----
-.Sh TRANSLATION INTERFACE
+.Ss Translation interface
.Bl -tag -width 4n
-.It Fn npf_nat_create
+.It Fn npf_nat_create "type" "flags" "if_idx" "addr" "af" "port"
Create a NAT translation policy of a specified type.
There are two types:
-.Bl -tag -width indent
+.Bl -tag -width "NPF_NAT_PORTMAP "
.It Dv NPF_NATIN
Inbound NAT policy.
.It Dv NPF_NATOUT
@@ -206,8 +210,10 @@
.El
.Pp
A bi-directional NAT is obtained by combining two policies.
-The following flags are supported:
-.Bl -tag -width indent
+The following
+.Fa flags
+are supported:
+.Bl -tag -width "NPF_NAT_PORTMAP "
.It Dv NPF_NAT_PORTS
Indicates to perform port translation.
Otherwise, port translation is not performed and
@@ -232,16 +238,16 @@
for IPv4 or
.Dv AF_INET6
for IPv6 address.
-.It Fn npf_nat_insert
+.It Fn npf_nat_insert "ncf" "nt" "pri"
Insert NAT policy, its rule, into the specified configuration.
.El
.\" -----
-.Sh TABLE INTERFACE
+.Ss Table interface
.Bl -tag -width 4n
-.It Fn npf_table_create
+.It Fn npf_table_create "index" "type"
Create NPF table of specified type.
The following types are supported:
-.Bl -tag -width indent
+.Bl -tag -width "NPF_TABLE_RBTREE "
.It Dv NPF_TABLE_HASH
Indicates to use hash table for storage.
.It Dv NPF_TABLE_RBTREE
@@ -251,14 +257,14 @@
which should be in the range between 1 and
.Dv NPF_MAX_TABLE_ID .
.El
-.It Fn npf_table_add_entry
+.It Fn npf_table_add_entry "tl" "addr" "mask"
Add an entry of IPv4 address and mask, specified by
.Fa addr
and
.Fa mask ,
to the table specified by
.Fa tl .
-.It Fn npf_table_exists_p
+.It Fn npf_table_exists_p "ncf" "name"
Determine whether table with ID
.Fa tid
exists in the configuration
@@ -268,21 +274,21 @@
if exists, and
.Dv false
otherwise.
-.It Fn npf_table_insert
+.It Fn npf_table_insert "ncf" "tl"
Insert table into set of configuration.
Routine performs a check for duplicate table ID.
-.It Fn npf_table_destroy
+.It Fn npf_table_destroy "tl"
Destroy the specified table.
.El
.\" -----
-.Sh TABLE INTERFACE
+.Ss Session interface
.Bl -tag -width 4n
-.It Fn npf_update_rule
-.It Fn npf_sessions_send
+.It Fn npf_update_rule "fd" "rname" "rl"
+.It Fn npf_sessions_send "fd" "fpath"
Read the file specified by
.Fa fpath ,
and send sessions saved in it to the kernel.
-.It Fn npf_sessions_recv
+.It Fn npf_sessions_recv "fd" "fpath"
Receive currently loaded session from the kernel, and save them to a file
specified by
.Fa fpath .
Home |
Main Index |
Thread Index |
Old Index