xref: /src/usr.sbin/ngctl/ngctl.8 (revision 9ed56cd8d6929e3ee733e1e61d2e0c6b81122983)
1.\" Copyright (c) 1996-1999 Whistle Communications, Inc.
2.\" All rights reserved.
3.\"
4.\" Subject to the following obligations and disclaimer of warranty, use and
5.\" redistribution of this software, in source or object code forms, with or
6.\" without modifications are expressly permitted by Whistle Communications;
7.\" provided, however, that:
8.\" 1. Any and all reproductions of the source or object code must include the
9.\"    copyright notice above and the following disclaimer of warranties; and
10.\" 2. No rights are granted, in any manner or form, to use Whistle
11.\"    Communications, Inc. trademarks, including the mark "WHISTLE
12.\"    COMMUNICATIONS" on advertising, endorsements, or otherwise except as
13.\"    such appears in the above copyright notice or in the software.
14.\"
15.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
16.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
17.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
18.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
19.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
20.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
21.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
22.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
23.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
24.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
25.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
27.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
31.\" OF SUCH DAMAGE.
32.\" $Whistle: ngctl.8,v 1.6 1999/01/20 03:19:44 archie Exp $
33.\"
34.Dd August 29, 2025
35.Dt NGCTL 8
36.Os
37.Sh NAME
38.Nm ngctl
39.Nd netgraph control utility
40.Sh SYNOPSIS
41.Nm
42.Op Fl j Ar jail
43.Op Fl d
44.Op Fl f Ar filename
45.Op Fl n Ar nodename
46.Op Ar command Op Ns Ar argument ...
47.Sh DESCRIPTION
48The
49.Nm
50utility creates a new netgraph node of type
51.Em socket
52which can be used to issue netgraph commands.
53If no
54.Fl f
55flag is given, no
56command is supplied on the command line, and standard input is a tty,
57.Nm
58will enter interactive mode.
59Otherwise
60.Nm
61will execute the supplied command(s) and exit immediately.
62.Pp
63Nodes can be created, removed, joined together, etc.
64.Tn ASCII
65formatted control messages can be sent to any node if that node
66supports binary/ASCII control message conversion.
67.Pp
68In interactive mode,
69.Nm
70will display any control messages and data packets received by the socket node.
71In the case of control messages, the message arguments are displayed in
72.Tn ASCII
73form if the originating node supports conversion.
74.Pp
75The options are as follows:
76.Bl -tag -width indent
77.It Fl f Ar filename
78Read commands from the named file.
79A single dash represents the standard input.
80Blank lines and lines starting with a
81.Dq #
82are ignored.
83Note that when the
84.Fl j Ar jail
85option is specified, the file will be opened before attaching to the jail and
86then be processed inside the jail.
87.It Fl j Ar jail
88Perform the actions inside the
89.Ar jail .
90.Pp
91.Nm
92will first attach to the
93.Ar jail
94(by jail id or jail name) before performing the effects.
95.Pp
96This allows netgraph nodes of
97.Ar jail
98to be created, modified, and destroyed even if the
99.Nm
100binary is not available in
101.Ar jail .
102.It Fl n Ar nodename
103Assign
104.Em nodename
105to the newly created netgraph node.
106The default name is
107.Em ngctlXXX
108where XXX is the process ID number.
109.It Fl d
110Increase the debugging verbosity level.
111.El
112.Sh COMMANDS
113The currently supported commands in
114.Nm
115are:
116.Pp
117.Bd -literal -offset indent -compact
118config     get or set configuration of node at <path>
119connect    Connects hook <peerhook> of the node at <relpath> to <hook>
120debug      Get/set debugging verbosity level
121dot        Produce a GraphViz (.dot) of the entire netgraph.
122help       Show command summary or get more help on a specific command
123list       Show information about all nodes
124mkpeer     Create and connect a new node to the node at "path"
125msg        Send a netgraph control message to the node at "path"
126name       Assign name <name> to the node at <path>
127read       Read and execute commands from a file
128rmhook     Disconnect hook "hook" of the node at "path"
129show       Show information about the node at <path>
130shutdown   Shutdown the node at <path>
131status     Get human readable status information from the node at <path>
132types      Show information about all installed node types
133write      Send a data packet down the hook named by "hook".
134quit       Exit program
135.Ed
136.Pp
137Some commands have aliases, e.g.,
138.Dq ls
139is the same as
140.Dq list .
141The
142.Dq help
143command displays the available
144commands, their usage and aliases, and a brief description.
145.Sh EXIT STATUS
146.Ex -std
147.Sh SEE ALSO
148.Xr netgraph 3 ,
149.Xr netgraph 4 ,
150.Xr nghook 8
151.Sh HISTORY
152The
153.Nm netgraph
154system was designed and first implemented at Whistle Communications, Inc.\& in
155a version of
156.Fx 2.2
157customized for the Whistle InterJet.
158.Sh AUTHORS
159.An Archie Cobbs Aq Mt archie@whistle.com
160