summaryrefslogtreecommitdiff
path: root/sys/netgraph/ng_source.c
Commit message (Collapse)AuthorAgeFilesLines
* Major overhaul and cleanup of ng_source node.Gleb Smirnoff2005-04-051-162/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Functional changes: - Cut struct source_hookinfo. Just use hook_p pointer. - Remove "start_now" command. "start" command now requires number of packets to send as argument. "start" command actually starts sending. Move the code that actually starts sending from ng_source_rcvmsg() to ng_source_start(). - Remove check for NG_SOURCE_ACTIVE in ng_source_stop(). We can be called with flag cleared (see begin of ng_source_intr()). - If NG_SEND_DATA_ONLY() use log(LOG_DEBUG) instead of printf(). Otherwise we will *flood* console. - Add ng_connect_t method, which sends NGM_ETHER_GET_IFNAME command to "output" hook. Cut ng_source_request_output_ifp(). Refactor ng_source_store_output_ifp() to use ifunit() and don't muck through interface list. - Add "setiface" command, which gives ability to configure interface in case when ng_source_connect() failed. This happens, when we are not connected directly to ng_ether(4) node. - Remove KASSERTs, which can never fire. - Don't check for M_PKTHDR in rcvdata method. netgraph(4) does this for us. Style: - Assign sc_p = NG_NODE_PRIVATE(node) in declaration, to be consistent with style of other nodes. - Sort variables. - u_intXX -> uintXX. - Dots at ends of comments. Sponsored by: Rambler Notes: svn path=/head/; revision=144674
* Make some basic grammar and style fixes to ng_source.c and ng_source.h.Bosko Milekic2005-03-101-7/+5
| | | | | | | | The latter was particularly violated by someone's editor in the past, due to an effect I like to call "premature linewrapping." Notes: svn path=/head/; revision=143387
* Fallout from the ALTQ import.Ruslan Ermilov2005-02-121-1/+1
| | | | Notes: svn path=/head/; revision=141745
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-071-1/+3
| | | | Notes: svn path=/head/; revision=139823
* Mechanically rename s/ng_timeout/ng_callout/g, s/ng_untimeout/ng_uncallout/g.Gleb Smirnoff2004-12-011-4/+4
| | | | | | | | | | This is done to keep both versions in RELENG_5 and support both APIs. Reviewed by: scottl Approved by: julian (mentor), implicitly Notes: svn path=/head/; revision=138268
* - Make ng_timeout() to use callout() interface instead of timeout().Gleb Smirnoff2004-11-021-8/+7
| | | | | | | | | | - Remove callout-hacking from ng_untimeout(). Approved by: julian (mentor) MFC after: 1 month Notes: svn path=/head/; revision=137138
* Fix a harmless error in order of ng_timeout() arguments.Gleb Smirnoff2004-11-021-2/+2
| | | | | | | Approved by: julian (mentor) Notes: svn path=/head/; revision=137136
* Slight cosmetic changes.Julian Elischer2004-07-201-1/+0
| | | | | | | | | | | | Also introduce a macro to be called by persistent nodes to signal their persistence during shutdown to hide this mechanism from the node author. Make node flags have a consistent style in naming. Document the change. Notes: svn path=/head/; revision=132464
* Switch to using C99 sparse initialisers for the type methods array.Julian Elischer2004-05-291-12/+9
| | | | | | | | | | | Should make no binary difference. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru> Reviewed by: Harti Brandt <harti@freebsd.org> MFC after: 1 week Notes: svn path=/head/; revision=129823
* Use the official ng_timeout function to trigger sending. This means,Hartmut Brandt2004-01-301-22/+14
| | | | | | | | that we can get rid of of all the spl*() calls, because ng_timeout handles the locking issues. Notes: svn path=/head/; revision=125243
* Don't confuse NULL and 0, use 0 where an integer is expected.Hartmut Brandt2004-01-271-2/+2
| | | | Notes: svn path=/head/; revision=125078
* Style: add __FBSDID, relocate some { that were on the wrong line,Hartmut Brandt2004-01-271-36/+24
| | | | | | | | correct some indendation, change __FUNCTION__ to __func__ and remove a local KASSERT definition. Notes: svn path=/head/; revision=125077
* Make ng_source to work with non-ethernet interfaces. We do this byHartmut Brandt2004-01-261-2/+37
| | | | | | | | | | introducing a START_NOW command. This command does not send and GET_IFINDEX message downstream (to wait for the response from the ETHERNET node), but directly starts the sending process. This allows one to generate traffic as input for any hook on any node. Notes: svn path=/head/; revision=125033
* Declare a function to silence a warning.Hartmut Brandt2004-01-261-0/+2
| | | | Notes: svn path=/head/; revision=125032
* Should use the non-locking versions of the ifqueue macros toHartmut Brandt2004-01-261-7/+7
| | | | | | | | | fiddle around with private queues, because their mutex is not needed. All this processing should be protected by the netgraph locking. Notes: svn path=/head/; revision=125031
* Replace a call to bzero() with an M_ZERO flag. Replace the MALLOC() withHartmut Brandt2004-01-261-2/+1
| | | | | | | malloc(). Notes: svn path=/head/; revision=125030
* The version in the type description must be the ABI version, notHartmut Brandt2004-01-261-3/+3
| | | | | | | | | | the netgraph version. Correct the return type of a function: it wants to return an error code, so it cannot be void. Notes: svn path=/head/; revision=125029
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-1/+1
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-1/+1
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* SMP locking for ifnet list.Jeffrey Hsu2002-12-221-0/+2
| | | | Notes: svn path=/head/; revision=108172
* o Untangle the confusion with the malloc flags {M_WAITOK, M_NOWAIT} andBosko Milekic2002-12-191-1/+1
| | | | | | | | | | | | | the mbuf allocator flags {M_TRYWAIT, M_DONTWAIT}. o Fix a bpf_compat issue where malloc() was defined to just call bpf_alloc() and pass the 'canwait' flag(s) along. It's been changed to call bpf_alloc() but pass the corresponding M_TRYWAIT or M_DONTWAIT flag (and only one of those two). Submitted by: Hiten Pandya <hiten@unixdaemons.com> (hiten->commit_count++) Notes: svn path=/head/; revision=108107
* Slight redesign for fitting in with -current.Julian Elischer2002-11-051-27/+50
| | | | Notes: svn path=/head/; revision=106435
* The easy part of converting the ng_source node to -current.Julian Elischer2002-11-021-54/+50
| | | | | | | More to come.. does not compile (deliberatly.. logic broken) Notes: svn path=/head/; revision=106321
* Whitespace fixesJulian Elischer2002-11-021-47/+28
| | | | Notes: svn path=/head/; revision=106319
* Add the netgraph 'source' module.Julian Elischer2002-10-311-0/+682
This is NOT YET CONVERTED TO -current. This node is a source for preprogrammed packets at a known rate for testing. I will convert it to -current "in place" but will MFC teh original pre-conversion variant as that is what is originally submitted. Man page my me, info from Dave's README. Submitted by: Dave Chapeskie <dchapeskie@SANDVINE.com> Obtained from: Sandvine inc. MFC after: 1 week Notes: svn path=/head/; revision=106266