FreeBSD kernel netgraph code
ng_hole.c File Reference
#include <sys/param.h>
#include <sys/systm.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_hole.h>
Include dependency graph for ng_hole.c:

Go to the source code of this file.

Data Structures

struct  ng_hole_hookinfo
 

Typedefs

typedef struct ng_hole_hookinfohinfo_p
 

Functions

 NETGRAPH_INIT (hole, &typestruct)
 
static int ngh_cons (node_p node)
 
static int ngh_newhook (node_p node, hook_p hook, const char *name)
 
static int ngh_rcvmsg (node_p node, item_p item, hook_p lasthook)
 
static int ngh_rcvdata (hook_p hook, item_p item)
 
static int ngh_disconnect (hook_p hook)
 

Variables

static const struct ng_parse_struct_field ng_hole_hookstat_type_fields []
 
static const struct ng_parse_type ng_hole_hookstat_type
 
static const struct ng_cmdlist ng_hole_cmdlist []
 
static ng_constructor_t ngh_cons
 
static ng_rcvmsg_t ngh_rcvmsg
 
static ng_newhook_t ngh_newhook
 
static ng_rcvdata_t ngh_rcvdata
 
static ng_disconnect_t ngh_disconnect
 
static struct ng_type typestruct
 

Typedef Documentation

◆ hinfo_p

typedef struct ng_hole_hookinfo* hinfo_p

Definition at line 62 of file ng_hole.c.

Function Documentation

◆ NETGRAPH_INIT()

NETGRAPH_INIT ( hole  ,
typestruct 
)

◆ ngh_cons()

static int ngh_cons ( node_p  node)
static

Definition at line 121 of file ng_hole.c.

◆ ngh_disconnect()

static int ngh_disconnect ( hook_p  hook)
static

Definition at line 219 of file ng_hole.c.

References NG_HOOK_NODE, NG_HOOK_PRIVATE, NG_HOOK_SET_PRIVATE, NG_NODE_NUMHOOKS, and ng_rmnode_self().

Here is the call graph for this function:

◆ ngh_newhook()

static int ngh_newhook ( node_p  node,
hook_p  hook,
const char *  name 
)
static

Definition at line 130 of file ng_hole.c.

References NG_HOOK_SET_PRIVATE.

◆ ngh_rcvdata()

static int ngh_rcvdata ( hook_p  hook,
item_p  item 
)
static

Definition at line 205 of file ng_hole.c.

References NG_FREE_ITEM, NG_HOOK_PRIVATE, NGI_M, and ng_bpf_hookinfo::stats.

◆ ngh_rcvmsg()

Variable Documentation

◆ ng_hole_cmdlist

const struct ng_cmdlist ng_hole_cmdlist[]
static
Initial value:
= {
{
"getstats",
},
{
"clrstats",
NULL
},
{
"getclrstats",
},
{ 0 }
}
static const struct ng_parse_type ng_hole_hookstat_type
Definition: ng_hole.c:67
#define NGM_HOLE_COOKIE
Definition: ng_hole.h:49
@ NGM_HOLE_GETCLR_STATS
Definition: ng_hole.h:68
@ NGM_HOLE_CLR_STATS
Definition: ng_hole.h:67
@ NGM_HOLE_GET_STATS
Definition: ng_hole.h:66
const struct ng_parse_type ng_parse_hookbuf_type
Definition: ng_parse.c:851

Definition at line 73 of file ng_hole.c.

◆ ng_hole_hookstat_type

const struct ng_parse_type ng_hole_hookstat_type
static
Initial value:
= {
}
static const struct ng_parse_struct_field ng_hole_hookstat_type_fields[]
Definition: ng_hole.c:65
const struct ng_parse_type ng_parse_struct_type
Definition: ng_parse.c:222

Definition at line 67 of file ng_hole.c.

◆ ng_hole_hookstat_type_fields

const struct ng_parse_struct_field ng_hole_hookstat_type_fields[]
static
Initial value:
=
#define NG_HOLE_HOOKSTAT_TYPE_INFO
Definition: ng_hole.h:58

Definition at line 65 of file ng_hole.c.

◆ ngh_cons

ng_constructor_t ngh_cons
static

Definition at line 99 of file ng_hole.c.

◆ ngh_disconnect

ng_disconnect_t ngh_disconnect
static

Definition at line 103 of file ng_hole.c.

◆ ngh_newhook

ng_newhook_t ngh_newhook
static

Definition at line 101 of file ng_hole.c.

◆ ngh_rcvdata

ng_rcvdata_t ngh_rcvdata
static

Definition at line 102 of file ng_hole.c.

◆ ngh_rcvmsg

ng_rcvmsg_t ngh_rcvmsg
static

Definition at line 100 of file ng_hole.c.

◆ typestruct

struct ng_type typestruct
static
Initial value:
= {
.version = NG_ABI_VERSION,
.constructor = ngh_cons,
.rcvmsg = ngh_rcvmsg,
.newhook = ngh_newhook,
.rcvdata = ngh_rcvdata,
.disconnect = ngh_disconnect,
.cmdlist = ng_hole_cmdlist,
}
#define NG_ABI_VERSION
Definition: netgraph.h:77
static ng_disconnect_t ngh_disconnect
Definition: ng_hole.c:103
static ng_rcvmsg_t ngh_rcvmsg
Definition: ng_hole.c:100
static ng_constructor_t ngh_cons
Definition: ng_hole.c:99
static const struct ng_cmdlist ng_hole_cmdlist[]
Definition: ng_hole.c:73
static ng_rcvdata_t ngh_rcvdata
Definition: ng_hole.c:102
static ng_newhook_t ngh_newhook
Definition: ng_hole.c:101
#define NG_HOLE_NODE_TYPE
Definition: ng_hole.h:48

Definition at line 105 of file ng_hole.c.