Clarify that the input hook requires binary packet data. Instead of
referencing an omitted example, include a short (Perl) example that queues an ICMP Echo message.
This commit is contained in:
parent
2a53696fb8
commit
58b1cfde0d
@ -1,4 +1,4 @@
|
|||||||
.\" Copyright 2002 Sandvine Inc.
|
.\" Copyright 2002-2006 Sandvine Inc.
|
||||||
.\" All rights reserved.
|
.\" All rights reserved.
|
||||||
.\"
|
.\"
|
||||||
.\" Subject to the following obligations and disclaimer of warranty, use and
|
.\" Subject to the following obligations and disclaimer of warranty, use and
|
||||||
@ -32,7 +32,7 @@
|
|||||||
.\" Author: Dave Chapeskie <dchapeskie@sandvine.com>
|
.\" Author: Dave Chapeskie <dchapeskie@sandvine.com>
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd December 5, 2005
|
.Dd October 22, 2006
|
||||||
.Dt NG_SOURCE 4
|
.Dt NG_SOURCE 4
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -223,19 +223,27 @@ node can be given its own name like this:
|
|||||||
After which it can be referred to as
|
After which it can be referred to as
|
||||||
.Dq Li src0: .
|
.Dq Li src0: .
|
||||||
.Pp
|
.Pp
|
||||||
Once created, packets need to be sent to the node, the TCL net package
|
Once created, packets can be sent to the node as raw binary data.
|
||||||
can be used to generate these packets:
|
Each packet must be delivered in a separate netgraph message.
|
||||||
.Pp
|
.Pp
|
||||||
[Sandvine specific TCL code example omitted]
|
The following example uses a short Perl script to convert the hex
|
||||||
.Pp
|
representation of an ICMP packet to binary and deliver it to the
|
||||||
To feed the output of the above TCL script to the
|
|
||||||
.Nm source
|
.Nm source
|
||||||
node's
|
node's
|
||||||
.Va input
|
.Va input
|
||||||
hook via
|
hook via
|
||||||
.Xr nghook 8 :
|
.Xr nghook 8 :
|
||||||
.Pp
|
.Bd -literal -offset indent
|
||||||
.Dl "tcl genPacket | nghook bge0:orphans input"
|
perl -pe 's/(..)[ \et\en]*/chr(hex($1))/ge' <<EOF | nghook src0: input
|
||||||
|
ff ff ff ff ff ff 00 00 00 00 00 00 08 00 45 00
|
||||||
|
00 54 cb 13 00 00 40 01 b9 87 c0 a8 2b 65 0a 00
|
||||||
|
00 01 08 00 f8 d0 c9 76 00 00 45 37 01 73 00 01
|
||||||
|
04 0a 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15
|
||||||
|
16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25
|
||||||
|
26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35
|
||||||
|
36 37
|
||||||
|
EOF
|
||||||
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
To check that the node has queued these packets you can get the node
|
To check that the node has queued these packets you can get the node
|
||||||
statistics:
|
statistics:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user