summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDiego Nieto Cid <dnietoc@gmail.com>2011-01-22 19:15:37 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-01-31 23:53:00 +0100
commitdb05cfc30a3e816e98c34ee5f2c386ec989594bf (patch)
treed95ec30f051765ab79cb6c134fa49faa31c74b42 /doc
parent3d83912b046fca4710bb7e1034419215350d403b (diff)
* doc/mach.texi (device_set_filter): Document filter header.
Acked-by: Richard Braun <rbraun@sceen.net>
Diffstat (limited to 'doc')
-rw-r--r--doc/mach.texi29
1 files changed, 28 insertions, 1 deletions
diff --git a/doc/mach.texi b/doc/mach.texi
index 858880a..e93fdb8 100644
--- a/doc/mach.texi
+++ b/doc/mach.texi
@@ -6493,7 +6493,7 @@ device port or the device is dead or not completely open.
@deftypefun kern_return_t device_set_filter (@w{device_t @var{device}}, @w{mach_port_t @var{receive_port}}, @w{mach_msg_type_name_t @var{receive_port_type}}, @w{int @var{priority}}, @w{filter_array_t @var{filter}}, @w{mach_msg_type_number_t @var{filter_count}})
The function @code{device_set_filter} makes it possible to filter out
-selected data arriving at the device and forward it to a port.
+selected data arriving at or leaving the device and forward it to a port.
@var{filter} is a list of filter commands, which are applied to incoming
data to determine if the data should be sent to @var{receive_port}. The
IPC type of the send right is specified by @var{receive_port_right}, it
@@ -6507,6 +6507,33 @@ purpose of the filter test, an internal stack is provided. After all
commands have been processed, the value on the top of the stack
determines if the data is forwarded or the next filter is tried.
+The first command is a header which contains two fields: one for flags
+and the other for the type of interpreter used to run the rest of the
+commands.
+
+Any combination of the following flags is allowed but at least one of them
+must be specified.
+
+@table @code
+@item NETF_IN
+The filter will be applied to data received by the device.
+
+@item NETF_OUT
+The filter will be applied to data transmitted by the device.
+@end table
+
+Unless the type is given explicitly the native NETF interpreter will be used.
+To select an alternative implementation use one of the following types:
+
+@table @code
+@item NETF_BPF
+Use Berkeley Packet Filter.
+@end table
+
+For the listener to know what kind of packet is being received, when the
+filter code accepts a packet the message sent to @var{receive_port} is
+tagged with either NETF_IN or NETF_OUT.
+
@c XXX The following description was taken verbatim from the
@c kernel_interface.pdf document.
Each word of the command list specifies a data (push) operation (high