ng_patch.4 (235319) | ng_patch.4 (242997) |
---|---|
1.\" Copyright (c) 2010 Maxim Ignatenko <gelraen.ua@gmail.com> 2.\" Copyright (c) 2010 Vadim Goncharov <vadimnuclight@tpu.ru> 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" | 1.\" Copyright (c) 2010 Maxim Ignatenko <gelraen.ua@gmail.com> 2.\" Copyright (c) 2010 Vadim Goncharov <vadimnuclight@tpu.ru> 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" |
26.\" $FreeBSD: head/share/man/man4/ng_patch.4 235319 2012-05-12 03:46:43Z gjb $ | 26.\" $FreeBSD: head/share/man/man4/ng_patch.4 242997 2012-11-13 20:41:36Z joel $ |
27.\" 28.Dd March 5, 2012 29.Dt NG_PATCH 4 30.Os 31.Sh NAME 32.Nm ng_patch 33.Nd "trivial mbuf data modifying netgraph node type" 34.Sh SYNOPSIS --- 17 unchanged lines hidden (view full) --- 52Data payload of packet is viewed as array of bytes, with zero offset 53corresponding to the very first byte of packet headers, and 54.Va length 55bytes beginning from 56.Va offset 57are taken as a single integer in network byte order. 58.Sh HOOKS 59This node type has two hooks: | 27.\" 28.Dd March 5, 2012 29.Dt NG_PATCH 4 30.Os 31.Sh NAME 32.Nm ng_patch 33.Nd "trivial mbuf data modifying netgraph node type" 34.Sh SYNOPSIS --- 17 unchanged lines hidden (view full) --- 52Data payload of packet is viewed as array of bytes, with zero offset 53corresponding to the very first byte of packet headers, and 54.Va length 55bytes beginning from 56.Va offset 57are taken as a single integer in network byte order. 58.Sh HOOKS 59This node type has two hooks: |
60.Bl -tag -width indent | 60.Bl -tag -width ".Va out" |
61.It Va in 62Packets received on this hook are modified according to rules specified 63in config and then forwarded to 64.Ar out 65hook, if it exists and connected. 66Otherwise they are reflected back to the 67.Ar in 68hook. 69.It Va out 70Packets received on this hook are forwarded to 71.Ar in 72hook without any changes. 73.El 74.Sh CONTROL MESSAGES 75This node type supports the generic control messages, plus the following: | 61.It Va in 62Packets received on this hook are modified according to rules specified 63in config and then forwarded to 64.Ar out 65hook, if it exists and connected. 66Otherwise they are reflected back to the 67.Ar in 68hook. 69.It Va out 70Packets received on this hook are forwarded to 71.Ar in 72hook without any changes. 73.El 74.Sh CONTROL MESSAGES 75This node type supports the generic control messages, plus the following: |
76.Bl -tag -width indent 77.It Dv NGM_PATCH_SETCONFIG Pq Li setconfig | 76.Bl -tag -width foo 77.It Dv NGM_PATCH_SETCONFIG Pq Ic setconfig |
78This command sets the sequence of modify operations 79that will be applied to incoming data on a hook. 80The following 81.Vt "struct ng_patch_config" 82must be supplied as an argument: 83.Bd -literal -offset 4n 84struct ng_patch_op { 85 uint64_t value; --- 24 unchanged lines hidden (view full) --- 110The 111.Va csum_flags 112can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_SCTP and CSUM_UDP 113(other values are ignored) for instructing the IP stack to recalculate the 114corresponding checksum before transmitting packet on output interface. 115The 116.Nm 117node does not do any checksum correction by itself. | 78This command sets the sequence of modify operations 79that will be applied to incoming data on a hook. 80The following 81.Vt "struct ng_patch_config" 82must be supplied as an argument: 83.Bd -literal -offset 4n 84struct ng_patch_op { 85 uint64_t value; --- 24 unchanged lines hidden (view full) --- 110The 111.Va csum_flags 112can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_SCTP and CSUM_UDP 113(other values are ignored) for instructing the IP stack to recalculate the 114corresponding checksum before transmitting packet on output interface. 115The 116.Nm 117node does not do any checksum correction by itself. |
118.It Dv NGM_PATCH_GETCONFIG Pq Li getconfig | 118.It Dv NGM_PATCH_GETCONFIG Pq Ic getconfig |
119This control message obtains current set of modify operations, 120returned as 121.Vt "struct ng_patch_config" . | 119This control message obtains current set of modify operations, 120returned as 121.Vt "struct ng_patch_config" . |
122.It Dv NGM_PATCH_GET_STATS Pq Li getstats | 122.It Dv NGM_PATCH_GET_STATS Pq Ic getstats |
123Returns node statistics as a 124.Vt "struct ng_patch_stats" . | 123Returns node statistics as a 124.Vt "struct ng_patch_stats" . |
125.It Dv NGM_PATCH_CLR_STATS Pq Li clrstats | 125.It Dv NGM_PATCH_CLR_STATS Pq Ic clrstats |
126Clear node statistics. | 126Clear node statistics. |
127.It Dv NGM_PATCH_GETCLR_STATS Pq Li getclrstats | 127.It Dv NGM_PATCH_GETCLR_STATS Pq Ic getclrstats |
128This command is identical to 129.Dv NGM_PATCH_GET_STATS , 130except that the statistics are also atomically cleared. 131.El 132.Sh SHUTDOWN 133This node shuts down upon receipt of a 134.Dv NGM_SHUTDOWN 135control message, or when all hooks have been disconnected. --- 100 unchanged lines hidden --- | 128This command is identical to 129.Dv NGM_PATCH_GET_STATS , 130except that the statistics are also atomically cleared. 131.El 132.Sh SHUTDOWN 133This node shuts down upon receipt of a 134.Dv NGM_SHUTDOWN 135control message, or when all hooks have been disconnected. --- 100 unchanged lines hidden --- |