summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_source.c
Commit message (Collapse)AuthorAgeFilesLines
* #include <net/vnet.h> is no longer needed here.zec2012-04-161-1/+0
| | | | | Spotted by: Ed Maste MFC after: 3 days.
* Node constructor methods are supposed to be called in syscallglebius2011-04-181-3/+1
| | | | | | | context always. Convert nodes to consistently use M_WAITOK flag for memory allocation. Reviewed by: julian
* Fix typos - remove duplicate "the".brucec2011-02-211-1/+1
| | | | | | PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days
* Remove email address that no longer exists.emaste2010-07-061-1/+1
|
* Merge the remainder of kern_vimage.c and vimage.h into vnet.c andrwatson2009-08-011-1/+1
| | | | | | | | | | vnet.h, we now use jails (rather than vimages) as the abstraction for virtualization management, and what remained was specific to virtual network stacks. Minor cleanups are done in the process, and comments updated to reflect these changes. Reviewed by: bz Approved by: re (vimage blanket)
* Fix error message content.zec2008-09-211-1/+1
| | | | | Approved by: julian (mentor) MFC after: 3 days
* Commit step 1 of the vimage project, (network stack)bz2008-08-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | virtualization work done by Marko Zec (zec@). This is the first in a series of commits over the course of the next few weeks. Mark all uses of global variables to be virtualized with a V_ prefix. Use macros to map them back to their global names for now, so this is a NOP change only. We hope to have caught at least 85-90% of what is needed so we do not invalidate a lot of outstanding patches again. Obtained from: //depot/projects/vimage-commit2/... Reviewed by: brooks, des, ed, mav, julian, jamie, kris, rwatson, zec, ... (various people I forgot, different versions) md5 (with a bit of help) Sponsored by: NLnet Foundation, The FreeBSD Foundation X-MFC after: never V_Commit_Message_Reviewed_By: more people than the patch
* Ensure message passed to "settimestamp" and "setcounter" is the rightemaste2007-03-021-1/+9
| | | | | | length. Use NULL instead of 0. Submitted by: glebius, ru
* Add "setcounter" and "getcounter" messages, providing the the abilityemaste2007-03-021-0/+108
| | | | | | | | | | | | | to embed up to four counters in outgoing packets. The message specifies the offset at which the counter should be inserted as well as the parameters of the counter. Example usage: ngctl msg src0: setcounter \ '{ index=0 offset=0x40 flags=1 width=4 increment=1 max_val=12345 }' Sponsored by: Sandvine Incorporated
* Add "settimestamp" and "gettimestamp" messages, providing the the abilityemaste2007-03-011-5/+122
| | | | | | | | | | | | | to embed a timestamp (struct timeval) in outgoing packets. The message specifies the offset at which the timestamp should be inserted. NG_SOURCE(4) gives an example usage that queues an ICMP packet. Using that example, the following command will insert a timestamp in the ICMP's data payload: ngctl msg src0: settimestamp '{ offset=0x2a flags=1 }' Sponsored by: Sandvine Incorporated
* Simplify ng_source_send() removing temporary queue and merging twoglebius2006-01-231-25/+9
| | | | cycles into one.
* Implement an upper limit for packets per second sent by node.glebius2005-12-231-0/+38
|
* Major overhaul and cleanup of ng_source node.glebius2005-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
* Make some basic grammar and style fixes to ng_source.c and ng_source.h.bmilekic2005-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."
* Fallout from the ALTQ import.ru2005-02-121-1/+1
|
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+3
|
* Mechanically rename s/ng_timeout/ng_callout/g, s/ng_untimeout/ng_uncallout/g.glebius2004-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
* - Make ng_timeout() to use callout() interface instead of timeout().glebius2004-11-021-8/+7
| | | | | | | - Remove callout-hacking from ng_untimeout(). Approved by: julian (mentor) MFC after: 1 month
* Fix a harmless error in order of ng_timeout() arguments.glebius2004-11-021-2/+2
| | | | Approved by: julian (mentor)
* Slight cosmetic changes.julian2004-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.
* Switch to using C99 sparse initialisers for the type methods array.julian2004-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
* Use the official ng_timeout function to trigger sending. This means,harti2004-01-301-22/+14
| | | | | that we can get rid of of all the spl*() calls, because ng_timeout handles the locking issues.
* Don't confuse NULL and 0, use 0 where an integer is expected.harti2004-01-271-2/+2
|
* Style: add __FBSDID, relocate some { that were on the wrong line,harti2004-01-271-36/+24
| | | | | correct some indendation, change __FUNCTION__ to __func__ and remove a local KASSERT definition.
* Make ng_source to work with non-ethernet interfaces. We do this byharti2004-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.
* Declare a function to silence a warning.harti2004-01-261-0/+2
|
* Should use the non-locking versions of the ifqueue macros toharti2004-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.
* Replace a call to bzero() with an M_ZERO flag. Replace the MALLOC() withharti2004-01-261-2/+1
| | | | malloc().
* The version in the type description must be the ABI version, notharti2004-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.
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* SMP locking for ifnet list.hsu2002-12-221-0/+2
|
* o Untangle the confusion with the malloc flags {M_WAITOK, M_NOWAIT} andbmilekic2002-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++)
* Slight redesign for fitting in with -current.julian2002-11-051-27/+50
|
* The easy part of converting the ng_source node to -current.julian2002-11-021-54/+50
| | | | More to come.. does not compile (deliberatly.. logic broken)
* Whitespace fixesjulian2002-11-021-47/+28
|
* Add the netgraph 'source' module.julian2002-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
OpenPOWER on IntegriCloud