Commit Graph

27 Commits

Author SHA1 Message Date
Gleb Smirnoff
61b6fd5ab2 Plug mutex leak.
MFC after:	1 week
Sponsored by:	Nginx, Inc.
2015-01-16 18:51:26 +00:00
Philippe Charnier
d31ff7a8fb Add __unused. Ansi prototypes. 2010-12-20 09:36:54 +00:00
Dag-Erling Smørgrav
c540146463 Add volatile to sig_atomic_t where it was missing.
MFC after:	1 week
2009-06-14 21:39:52 +00:00
Mike Makonnen
48b5fd636e Modify the DoParseCommand() to work on (const char *) instead of just
(char *). This is a slightly simplified version of the patch in the PR. It
fixes compilitation issues with -O3.

PR: misc/124385
2008-06-28 12:31:30 +00:00
Kevin Lo
9c20ad30e0 getopt(3) returns -1, not EOF. 2007-02-06 08:48:28 +00:00
Gleb Smirnoff
eac2afced2 - Pass pointer to fd_set in ReadSockets.
- style(9) nits.

Submitted by:	ru
2006-08-08 07:04:40 +00:00
Gleb Smirnoff
b9124a7354 Add line edit and history support to ngctl(8) via editline(3).
Details:
- The main thread runs editline(3) functions, that can block.
- A separate thread is launched to monitor netgraph sockets.
- The access to the descriptors is protected by a mutex. At
  runtime the monitoring thread owns the mutex. When the main
  thread reads a command from el_gets() it asks the monitoring
  thread to release a mutex and sleep until the main thread
  processes the command.

This makes ngctl(8) depend on libedit, and libpthread. Thus, the
new functionality isn't compiled in if release is being built
with -DRELEASE_CRUNCH.

PR:		bin/87352
Reviewed by:	ru, Nuno Antunes <nuno.antunes gmail.com>
2006-08-07 14:17:05 +00:00
Gleb Smirnoff
9caee2ece7 Style: space after "return". 2006-06-28 10:38:38 +00:00
Gleb Smirnoff
78cdd8ed1b Unnest includes before forthcoming editing. 2006-05-24 14:46:55 +00:00
Maxim Konovalov
c44e20ebec Backout rev. 1.17 per ru@ request: there are net.graph.recvspace and
net.graph.maxdgram sysctls.
2005-02-04 20:09:11 +00:00
Maxim Konovalov
b5974bdbab Increase a socket receive buffer size. This helps 'ngctl list'
to deal with a big number of nodes.

Submitted by:		archie
Approved by:		archie
Reported and tested:	Konstantin Timashkov
MFC after:		1 month
2004-11-25 09:27:56 +00:00
Ruslan Ermilov
9fe5fadaf1 Get rid of all (but one in write.c) static size buffers. 2004-01-27 21:52:52 +00:00
Ruslan Ermilov
723c1c2ee8 Make this WARNS=3 clean. 2004-01-26 10:27:18 +00:00
Brian Feldman
bbd6d60a85 Add a GraphViz-exporting ngctl(8) "dot" command. You can now create
very useful .dot files of your netgraph(4) to quickly visualize the
nodes, hooks and edges.  An example of this can be found here:
	http://people.freebsd.org/~green/sample-netgraph-dot.ps
If anyone would like to refine the output further, please do so.
2004-01-09 03:19:40 +00:00
Philippe Charnier
b00304d4a1 Use fprintf() instead of errx() when displaying usage string. The program name
will not be written twice.
2004-01-04 16:11:29 +00:00
Hartmut Brandt
9d901d3b5f Get rid of the old constants which did not include the trailing NUL
and use the new constants which do.
2003-11-12 13:04:44 +00:00
Dag-Erling Smørgrav
d397408818 Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
2002-04-22 13:44:47 +00:00
Archie Cobbs
be44fce4fa Add ngctl "write" command.
MFC after:	1 week
2002-01-22 22:01:25 +00:00
Poul-Henning Kamp
0c5c7719e6 Backout my previous commit, it appearantly doesn't work for asynchronous
messages.
2001-03-17 08:59:31 +00:00
Poul-Henning Kamp
420e745a90 Add -ledit to ngctl.
Somebody submitted this long time ago, and it has been sitting in my
tree for months because I thought archie would pick it up.

Submitted by:	(sorry, lost track)
2001-03-16 19:35:07 +00:00
Archie Cobbs
f35e82dfe3 Fix bug in "read" command.
Submitted by:	Dave Cornelius <dc@packetdesign.com>
2000-10-10 01:34:20 +00:00
Poul-Henning Kamp
7095e0970e Experiemntal ascii based device configuration mechanism.
This may or may not survive, decision will be made well before 5.0-R
2000-07-03 13:34:18 +00:00
Archie Cobbs
6ebb8ebbd1 When the 'msg' command is used from the command line, check for a
synchronous reply, and display it (if any) before exiting.

Requested by:	phk
2000-06-20 18:51:38 +00:00
Archie Cobbs
b08b2814a1 No need to try loading ng_socket.ko, as NgMkSockNode() does that
for us now if necessary.
2000-01-28 00:50:28 +00:00
Archie Cobbs
f8307e1233 Add two new generic control messages, NGM_ASCII2BINARY and
NGM_BINARY2ASCII, which convert control messages to ASCII and back.
This allows control messages to be sent and received in ASCII form
using ngctl(8), which makes ngctl a lot more useful.

This also allows all the type-specific debugging code in libnetgraph
to go away -- instead, we just ask the node itself to do the ASCII
translation for us.

Currently, all generic control messages are supported, as well as
messages associated with the following node types: async, cisco,
ksocket, and ppp.

See /usr/share/examples/netgraph/ngctl for an example of using this.

Also give ngctl(8) the ability to print out incoming data and
control messages at any time.  Eventually nghook(8) may be subsumed.

Several other misc. bug fixes.

Reviewed by:	julian
1999-11-30 02:45:32 +00:00
Archie Cobbs
0d6985e2c1 If we get an EPROTONOSUPP error when trying to create the netgraph socket
node, it's most likely because the "ng_socket.ko" KLD is not loaded yet.
So make an attempt to load it before giving up.
1999-10-27 22:17:18 +00:00
Julian Elischer
4cf49a4355 Whistle's Netgraph link-layer (sometimes more) networking infrastructure.
Been in production for 3 years now. Gives Instant Frame relay to if_sr
and if_ar drivers, and PPPOE support soon. See:
ftp://ftp.whistle.com/pub/archie/netgraph/index.html
for on-line manual pages.

Reviewed by: Doug Rabson (dfr@freebsd.org)
Obtained from:  Whistle CVS tree
1999-10-21 09:06:11 +00:00