ng_source.c (111119) | ng_source.c (125029) |
---|---|
1/* 2 * ng_source.c 3 * 4 * Copyright 2002 Sandvine Inc. 5 * All rights reserved. 6 * 7 * Subject to the following obligations and disclaimer of warranty, use and 8 * redistribution of this software, in source or object code forms, with or --- 20 unchanged lines hidden (view full) --- 29 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 * THIS SOFTWARE, EVEN IF SANDVINE IS ADVISED OF THE POSSIBILITY OF SUCH 33 * DAMAGE. 34 * 35 * Author: Dave Chapeskie <dchapeskie@sandvine.com> 36 * | 1/* 2 * ng_source.c 3 * 4 * Copyright 2002 Sandvine Inc. 5 * All rights reserved. 6 * 7 * Subject to the following obligations and disclaimer of warranty, use and 8 * redistribution of this software, in source or object code forms, with or --- 20 unchanged lines hidden (view full) --- 29 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 * THIS SOFTWARE, EVEN IF SANDVINE IS ADVISED OF THE POSSIBILITY OF SUCH 33 * DAMAGE. 34 * 35 * Author: Dave Chapeskie <dchapeskie@sandvine.com> 36 * |
37 * $FreeBSD: head/sys/netgraph/ng_source.c 111119 2003-02-19 05:47:46Z imp $ | 37 * $FreeBSD: head/sys/netgraph/ng_source.c 125029 2004-01-26 14:14:09Z harti $ |
38 */ 39 40/* 41 * This node is used for high speed packet geneneration. It queues 42 * all data recieved on it's 'input' hook and when told to start via 43 * a control message it sends the packets out it's 'output' hook. In 44 * this way this node can be preloaded with a packet stream which is 45 * continuously sent. --- 65 unchanged lines hidden (view full) --- 111static ng_rcvmsg_t ng_source_rcvmsg; 112static ng_shutdown_t ng_source_rmnode; 113static ng_newhook_t ng_source_newhook; 114static ng_rcvdata_t ng_source_rcvdata; 115static ng_disconnect_t ng_source_disconnect; 116 117/* Other functions */ 118static timeout_t ng_source_intr; | 38 */ 39 40/* 41 * This node is used for high speed packet geneneration. It queues 42 * all data recieved on it's 'input' hook and when told to start via 43 * a control message it sends the packets out it's 'output' hook. In 44 * this way this node can be preloaded with a packet stream which is 45 * continuously sent. --- 65 unchanged lines hidden (view full) --- 111static ng_rcvmsg_t ng_source_rcvmsg; 112static ng_shutdown_t ng_source_rmnode; 113static ng_newhook_t ng_source_newhook; 114static ng_rcvdata_t ng_source_rcvdata; 115static ng_disconnect_t ng_source_disconnect; 116 117/* Other functions */ 118static timeout_t ng_source_intr; |
119static void ng_source_request_output_ifp (sc_p); | 119static int ng_source_request_output_ifp (sc_p); |
120static void ng_source_clr_data (sc_p); 121static void ng_source_start (sc_p); 122static void ng_source_stop (sc_p); 123static int ng_source_send (sc_p, int, int *); 124static int ng_source_store_output_ifp(sc_p sc, 125 struct ng_mesg *msg); 126 127 --- 61 unchanged lines hidden (view full) --- 189 NULL, 190 NULL 191 }, 192 { 0 } 193}; 194 195/* Netgraph type descriptor */ 196static struct ng_type ng_source_typestruct = { | 120static void ng_source_clr_data (sc_p); 121static void ng_source_start (sc_p); 122static void ng_source_stop (sc_p); 123static int ng_source_send (sc_p, int, int *); 124static int ng_source_store_output_ifp(sc_p sc, 125 struct ng_mesg *msg); 126 127 --- 61 unchanged lines hidden (view full) --- 189 NULL, 190 NULL 191 }, 192 { 0 } 193}; 194 195/* Netgraph type descriptor */ 196static struct ng_type ng_source_typestruct = { |
197 NG_VERSION, | 197 NG_ABI_VERSION, |
198 NG_SOURCE_NODE_TYPE, 199 NULL, /* module event handler */ 200 ng_source_constructor, 201 ng_source_rcvmsg, 202 ng_source_rmnode, 203 ng_source_newhook, 204 NULL, /* findhook */ 205 NULL, --- 234 unchanged lines hidden (view full) --- 440 return (0); 441} 442 443/* 444 * 445 * Ask out neighbour on the output hook side to send us it's interface 446 * information. 447 */ | 198 NG_SOURCE_NODE_TYPE, 199 NULL, /* module event handler */ 200 ng_source_constructor, 201 ng_source_rcvmsg, 202 ng_source_rmnode, 203 ng_source_newhook, 204 NULL, /* findhook */ 205 NULL, --- 234 unchanged lines hidden (view full) --- 440 return (0); 441} 442 443/* 444 * 445 * Ask out neighbour on the output hook side to send us it's interface 446 * information. 447 */ |
448static void | 448static int |
449ng_source_request_output_ifp(sc_p sc) 450{ 451 struct ng_mesg *msg; 452 int error = 0; 453 454 sc->output_ifp = NULL; 455 456 /* Ask the attached node for the connected interface's index */ --- 228 unchanged lines hidden --- | 449ng_source_request_output_ifp(sc_p sc) 450{ 451 struct ng_mesg *msg; 452 int error = 0; 453 454 sc->output_ifp = NULL; 455 456 /* Ask the attached node for the connected interface's index */ --- 228 unchanged lines hidden --- |