summaryrefslogtreecommitdiffstats
path: root/share/man/man4/ng_source.4
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2006-10-22 21:33:57 +0000
committeremaste <emaste@FreeBSD.org>2006-10-22 21:33:57 +0000
commit4da66795808e4b7b89b702baf5d11d61201d0ca6 (patch)
treee1277a4205349272683fd8cb4b210a039ec1c755 /share/man/man4/ng_source.4
parent5d9c66a3f8fe76b65b02406c551668f4b645abf5 (diff)
downloadFreeBSD-src-4da66795808e4b7b89b702baf5d11d61201d0ca6.zip
FreeBSD-src-4da66795808e4b7b89b702baf5d11d61201d0ca6.tar.gz
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.
Diffstat (limited to 'share/man/man4/ng_source.4')
-rw-r--r--share/man/man4/ng_source.426
1 files changed, 17 insertions, 9 deletions
diff --git a/share/man/man4/ng_source.4 b/share/man/man4/ng_source.4
index f58fd89..d66550b 100644
--- a/share/man/man4/ng_source.4
+++ b/share/man/man4/ng_source.4
@@ -1,4 +1,4 @@
-.\" Copyright 2002 Sandvine Inc.
+.\" Copyright 2002-2006 Sandvine Inc.
.\" All rights reserved.
.\"
.\" Subject to the following obligations and disclaimer of warranty, use and
@@ -32,7 +32,7 @@
.\" Author: Dave Chapeskie <dchapeskie@sandvine.com>
.\" $FreeBSD$
.\"
-.Dd December 5, 2005
+.Dd October 22, 2006
.Dt NG_SOURCE 4
.Os
.Sh NAME
@@ -223,19 +223,27 @@ node can be given its own name like this:
After which it can be referred to as
.Dq Li src0: .
.Pp
-Once created, packets need to be sent to the node, the TCL net package
-can be used to generate these packets:
+Once created, packets can be sent to the node as raw binary data.
+Each packet must be delivered in a separate netgraph message.
.Pp
-[Sandvine specific TCL code example omitted]
-.Pp
-To feed the output of the above TCL script to the
+The following example uses a short Perl script to convert the hex
+representation of an ICMP packet to binary and deliver it to the
.Nm source
node's
.Va input
hook via
.Xr nghook 8 :
-.Pp
-.Dl "tcl genPacket | nghook bge0:orphans input"
+.Bd -literal -offset indent
+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
To check that the node has queued these packets you can get the node
statistics:
OpenPOWER on IntegriCloud