#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/errno.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/syslog.h>
#include <net/if.h>
#include <net/if_var.h>
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
#include <netgraph/ng_parse.h>
#include <netgraph/ng_ether.h>
#include <netgraph/ng_source.h>
Go to the source code of this file.
|
| __FBSDID ("$FreeBSD$") |
|
static void | ng_source_intr (node_p, hook_p, void *, int) |
|
static void | ng_source_clr_data (sc_p) |
|
static int | ng_source_start (sc_p, uint64_t) |
|
static void | ng_source_stop (sc_p) |
|
static int | ng_source_send (sc_p, int, int *) |
|
static int | ng_source_store_output_ifp (sc_p, char *) |
|
static void | ng_source_packet_mod (sc_p, struct mbuf *, int, int, caddr_t, int) |
|
static void | ng_source_mod_counter (sc_p sc, struct ng_source_embed_cnt_info *cnt, struct mbuf *m, int increment) |
|
static int | ng_source_dup_mod (sc_p, struct mbuf *, struct mbuf **) |
|
| NETGRAPH_INIT (source, &ng_source_typestruct) |
|
static int | ng_source_set_autosrc (sc_p, uint32_t) |
|
static int | ng_source_constructor (node_p node) |
|
static int | ng_source_newhook (node_p node, hook_p hook, const char *name) |
|
static int | ng_source_connect (hook_p hook) |
|
static int | ng_source_rcvmsg (node_p node, item_p item, hook_p lasthook) |
|
static int | ng_source_rcvdata (hook_p hook, item_p item) |
|
static int | ng_source_rmnode (node_p node) |
|
static int | ng_source_disconnect (hook_p hook) |
|
◆ mtod_off
#define mtod_off |
( |
|
m, |
|
|
|
off, |
|
|
|
t |
|
) |
| ((t)(mtod((m),caddr_t)+(off))) |
◆ NG_SOURCE_ACTIVE
◆ NG_SOURCE_DRIVER_IFQ_MAXLEN
#define NG_SOURCE_DRIVER_IFQ_MAXLEN (4*1024) |
◆ NG_SOURCE_INTR_TICKS
#define NG_SOURCE_INTR_TICKS 1 |
◆ sc_p
◆ __FBSDID()
◆ NETGRAPH_INIT()
NETGRAPH_INIT |
( |
source |
, |
|
|
& |
ng_source_typestruct |
|
) |
| |
◆ ng_source_clr_data()
static void ng_source_clr_data |
( |
sc_p |
sc | ) |
|
|
static |
◆ ng_source_connect()
static int ng_source_connect |
( |
hook_p |
hook | ) |
|
|
static |
◆ ng_source_constructor()
static int ng_source_constructor |
( |
node_p |
node | ) |
|
|
static |
◆ ng_source_disconnect()
static int ng_source_disconnect |
( |
hook_p |
hook | ) |
|
|
static |
◆ ng_source_dup_mod()
static int ng_source_dup_mod |
( |
sc_p |
sc, |
|
|
struct mbuf * |
m0, |
|
|
struct mbuf ** |
m_ptr |
|
) |
| |
|
static |
◆ ng_source_intr()
static void ng_source_intr |
( |
node_p |
node, |
|
|
hook_p |
hook, |
|
|
void * |
arg1, |
|
|
int |
arg2 |
|
) |
| |
|
static |
Definition at line 729 of file ng_source.c.
References ng_node::nd_flags, ng_callout(), NG_SOURCE_ACTIVE, ng_source_intr(), NG_SOURCE_INTR_TICKS, ng_source_send(), ng_source_stop(), ng_async_private::node, packets, and ng_async_private::stats.
Referenced by ng_source_intr(), and ng_source_start().
◆ ng_source_mod_counter()
◆ ng_source_newhook()
static int ng_source_newhook |
( |
node_p |
node, |
|
|
hook_p |
hook, |
|
|
const char * |
name |
|
) |
| |
|
static |
◆ ng_source_packet_mod()
static void ng_source_packet_mod |
( |
sc_p |
sc, |
|
|
struct mbuf * |
m, |
|
|
int |
offset, |
|
|
int |
len, |
|
|
caddr_t |
cp, |
|
|
int |
flags |
|
) |
| |
|
static |
◆ ng_source_rcvdata()
◆ ng_source_rcvmsg()
Definition at line 348 of file ng_source.c.
References ng_mesg::ng_msghdr::arglen, ng_mesg::ng_msghdr::cmd, ng_mesg::data, ng_mesg::ng_msghdr::flags, ng_mesg::header, ng_source_embed_cnt_info::index, ng_node::nd_flags, NG_FREE_MSG, NG_MKRESPONSE, NG_NODE_PRIVATE, NG_RESPOND_MSG, NG_SOURCE_ACTIVE, ng_source_clr_data(), NG_SOURCE_COUNTERS, ng_source_set_autosrc(), ng_source_start(), ng_source_stop(), ng_source_store_output_ifp(), NGF_RESP, NGI_GET_MSG, NGM_ETHER_COOKIE, NGM_ETHER_GET_IFNAME, NGM_SOURCE_CLR_DATA, NGM_SOURCE_CLR_STATS, NGM_SOURCE_COOKIE, NGM_SOURCE_GET_COUNTER, NGM_SOURCE_GET_STATS, NGM_SOURCE_GET_TIMESTAMP, NGM_SOURCE_GETCLR_STATS, NGM_SOURCE_SET_COUNTER, NGM_SOURCE_SET_TIMESTAMP, NGM_SOURCE_SETIFACE, NGM_SOURCE_SETPPS, NGM_SOURCE_START, NGM_SOURCE_STOP, ng_async_private::node, packets, ng_async_private::stats, ng_mesg::ng_msghdr::typecookie, and ng_source_embed_cnt_info::width.
◆ ng_source_rmnode()
static int ng_source_rmnode |
( |
node_p |
node | ) |
|
|
static |
◆ ng_source_send()
static int ng_source_send |
( |
sc_p |
sc, |
|
|
int |
tosend, |
|
|
int * |
sent_p |
|
) |
| |
|
static |
◆ ng_source_set_autosrc()
static int ng_source_set_autosrc |
( |
sc_p |
sc, |
|
|
uint32_t |
flag |
|
) |
| |
|
static |
◆ ng_source_start()
static int ng_source_start |
( |
sc_p |
sc, |
|
|
uint64_t |
packets |
|
) |
| |
|
static |
◆ ng_source_stop()
static void ng_source_stop |
( |
sc_p |
sc | ) |
|
|
static |
◆ ng_source_store_output_ifp()
static int ng_source_store_output_ifp |
( |
sc_p |
sc, |
|
|
char * |
ifname |
|
) |
| |
|
static |
◆ ng_source_cmds
◆ ng_source_connect
◆ ng_source_constructor
◆ ng_source_disconnect
◆ ng_source_embed_cnt_type
Initial value:= {
}
const struct ng_parse_type ng_parse_struct_type
static const struct ng_parse_struct_field ng_source_embed_cnt_type_fields[]
Definition at line 164 of file ng_source.c.
◆ ng_source_embed_cnt_type_fields
Initial value:=
#define NG_SOURCE_EMBED_CNT_TYPE_INFO
Definition at line 162 of file ng_source.c.
◆ ng_source_embed_type
Initial value:= {
}
static const struct ng_parse_struct_field ng_source_embed_type_fields[]
Definition at line 156 of file ng_source.c.
◆ ng_source_embed_type_fields
Initial value:=
#define NG_SOURCE_EMBED_TYPE_INFO
Definition at line 154 of file ng_source.c.
◆ ng_source_newhook
◆ ng_source_rcvdata
◆ ng_source_rcvmsg
◆ ng_source_rmnode
◆ ng_source_stats_type
Initial value:= {
}
static const struct ng_parse_struct_field ng_source_stats_type_fields[]
Definition at line 148 of file ng_source.c.
◆ ng_source_stats_type_fields
◆ ng_source_timeval_type
Initial value:= {
}
static const struct ng_parse_struct_field ng_source_timeval_type_fields[]
Definition at line 140 of file ng_source.c.
◆ ng_source_timeval_type_fields
Initial value:= {
{ NULL }
}
const struct ng_parse_type ng_parse_int32_type
const struct ng_parse_type ng_parse_int64_type
Definition at line 127 of file ng_source.c.
◆ ng_source_typestruct
struct ng_type ng_source_typestruct |
|
static |
Initial value:= {
}
static ng_rcvdata_t ng_source_rcvdata
static ng_newhook_t ng_source_newhook
static const struct ng_cmdlist ng_source_cmds[]
static ng_constructor_t ng_source_constructor
static ng_disconnect_t ng_source_disconnect
static ng_rcvmsg_t ng_source_rcvmsg
static ng_connect_t ng_source_connect
static ng_shutdown_t ng_source_rmnode
#define NG_SOURCE_NODE_TYPE
Definition at line 259 of file ng_source.c.