FreeBSD kernel netgraph code
ng_tee.c File Reference
#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 <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
#include <netgraph/ng_parse.h>
#include <netgraph/ng_tee.h>
Include dependency graph for ng_tee.c:

Go to the source code of this file.

Data Structures

struct  hookinfo
 
struct  privdata
 

Typedefs

typedef struct hookinfohi_p
 
typedef struct privdatasc_p
 

Functions

 NETGRAPH_INIT (tee, &ng_tee_typestruct)
 
static int ng_tee_constructor (node_p node)
 
static int ng_tee_newhook (node_p node, hook_p hook, const char *name)
 
static int ng_tee_rcvmsg (node_p node, item_p item, hook_p lasthook)
 
static int ng_tee_rcvdata (hook_p hook, item_p item)
 
static int ng_tee_close (node_p node)
 
static int ng_tee_shutdown (node_p node)
 
static int ng_tee_disconnect (hook_p hook)
 

Variables

static ng_constructor_t ng_tee_constructor
 
static ng_rcvmsg_t ng_tee_rcvmsg
 
static ng_close_t ng_tee_close
 
static ng_shutdown_t ng_tee_shutdown
 
static ng_newhook_t ng_tee_newhook
 
static ng_rcvdata_t ng_tee_rcvdata
 
static ng_disconnect_t ng_tee_disconnect
 
static const struct ng_parse_struct_field ng_tee_hookstat_type_fields [] = NG_TEE_HOOKSTAT_INFO
 
static const struct ng_parse_type ng_tee_hookstat_type
 
static const struct ng_parse_struct_field ng_tee_stats_type_fields [] = NG_TEE_STATS_INFO(&ng_tee_hookstat_type)
 
static const struct ng_parse_type ng_tee_stats_type
 
static const struct ng_cmdlist ng_tee_cmds []
 
static struct ng_type ng_tee_typestruct
 

Typedef Documentation

◆ hi_p

typedef struct hookinfo* hi_p

Definition at line 71 of file ng_tee.c.

◆ sc_p

typedef struct privdata* sc_p

Definition at line 80 of file ng_tee.c.

Function Documentation

◆ NETGRAPH_INIT()

NETGRAPH_INIT ( tee  ,
ng_tee_typestruct 
)

◆ ng_tee_close()

static int ng_tee_close ( node_p  node)
static

Definition at line 338 of file ng_tee.c.

References hookinfo::hook, privdata::left, ng_bypass(), NG_NODE_PRIVATE, and privdata::right.

Here is the call graph for this function:

◆ ng_tee_constructor()

static int ng_tee_constructor ( node_p  node)
static

Definition at line 152 of file ng_tee.c.

References NG_NODE_SET_PRIVATE.

◆ ng_tee_disconnect()

static int ng_tee_disconnect ( hook_p  hook)
static

Definition at line 366 of file ng_tee.c.

References hookinfo::hook, NG_HOOK_NODE, NG_HOOK_PRIVATE, NG_NODE_IS_VALID, NG_NODE_NUMHOOKS, NG_NODE_PRIVATE, and ng_rmnode_self().

Here is the call graph for this function:

◆ ng_tee_newhook()

◆ ng_tee_rcvdata()

static int ng_tee_rcvdata ( hook_p  hook,
item_p  item 
)
static

◆ ng_tee_rcvmsg()

◆ ng_tee_shutdown()

static int ng_tee_shutdown ( node_p  node)
static

Definition at line 352 of file ng_tee.c.

References NG_NODE_PRIVATE, NG_NODE_SET_PRIVATE, and NG_NODE_UNREF.

Variable Documentation

◆ ng_tee_close

ng_close_t ng_tee_close
static

Definition at line 85 of file ng_tee.c.

◆ ng_tee_cmds

const struct ng_cmdlist ng_tee_cmds[]
static
Initial value:
= {
{
"getstats",
NULL,
},
{
"clrstats",
NULL,
NULL
},
{
"getclrstats",
NULL,
},
{ 0 }
}
static const struct ng_parse_type ng_tee_stats_type
Definition: ng_tee.c:102
#define NGM_TEE_COOKIE
Definition: ng_tee.h:50
@ NGM_TEE_GETCLR_STATS
Definition: ng_tee.h:96
@ NGM_TEE_CLR_STATS
Definition: ng_tee.h:95
@ NGM_TEE_GET_STATS
Definition: ng_tee.h:94

Definition at line 108 of file ng_tee.c.

◆ ng_tee_constructor

ng_constructor_t ng_tee_constructor
static

Definition at line 83 of file ng_tee.c.

◆ ng_tee_disconnect

ng_disconnect_t ng_tee_disconnect
static

Definition at line 89 of file ng_tee.c.

◆ ng_tee_hookstat_type

const struct ng_parse_type ng_tee_hookstat_type
static
Initial value:
= {
}
const struct ng_parse_type ng_parse_struct_type
Definition: ng_parse.c:222
static const struct ng_parse_struct_field ng_tee_hookstat_type_fields[]
Definition: ng_tee.c:93

Definition at line 94 of file ng_tee.c.

◆ ng_tee_hookstat_type_fields

const struct ng_parse_struct_field ng_tee_hookstat_type_fields[] = NG_TEE_HOOKSTAT_INFO
static

Definition at line 92 of file ng_tee.c.

◆ ng_tee_newhook

ng_newhook_t ng_tee_newhook
static

Definition at line 87 of file ng_tee.c.

◆ ng_tee_rcvdata

ng_rcvdata_t ng_tee_rcvdata
static

Definition at line 88 of file ng_tee.c.

◆ ng_tee_rcvmsg

ng_rcvmsg_t ng_tee_rcvmsg
static

Definition at line 84 of file ng_tee.c.

◆ ng_tee_shutdown

ng_shutdown_t ng_tee_shutdown
static

Definition at line 86 of file ng_tee.c.

◆ ng_tee_stats_type

const struct ng_parse_type ng_tee_stats_type
static
Initial value:
= {
}
static const struct ng_parse_struct_field ng_tee_stats_type_fields[]
Definition: ng_tee.c:101

Definition at line 102 of file ng_tee.c.

◆ ng_tee_stats_type_fields

const struct ng_parse_struct_field ng_tee_stats_type_fields[] = NG_TEE_STATS_INFO(&ng_tee_hookstat_type)
static

Definition at line 100 of file ng_tee.c.

◆ ng_tee_typestruct

struct ng_type ng_tee_typestruct
static
Initial value:
= {
.version = NG_ABI_VERSION,
.constructor = ng_tee_constructor,
.rcvmsg = ng_tee_rcvmsg,
.close = ng_tee_close,
.shutdown = ng_tee_shutdown,
.newhook = ng_tee_newhook,
.rcvdata = ng_tee_rcvdata,
.disconnect = ng_tee_disconnect,
.cmdlist = ng_tee_cmds,
}
#define NG_ABI_VERSION
Definition: netgraph.h:77
static ng_rcvdata_t ng_tee_rcvdata
Definition: ng_tee.c:88
static ng_shutdown_t ng_tee_shutdown
Definition: ng_tee.c:86
static ng_rcvmsg_t ng_tee_rcvmsg
Definition: ng_tee.c:84
static const struct ng_cmdlist ng_tee_cmds[]
Definition: ng_tee.c:108
static ng_constructor_t ng_tee_constructor
Definition: ng_tee.c:83
static ng_disconnect_t ng_tee_disconnect
Definition: ng_tee.c:89
static ng_close_t ng_tee_close
Definition: ng_tee.c:85
static ng_newhook_t ng_tee_newhook
Definition: ng_tee.c:87
#define NG_TEE_NODE_TYPE
Definition: ng_tee.h:49

Definition at line 134 of file ng_tee.c.