FreeBSD kernel netgraph code
ng_hub.c File Reference
#include <sys/param.h>
#include <sys/errno.h>
#include <sys/kernel.h>
#include <sys/mbuf.h>
#include <sys/systm.h>
#include <netgraph/ng_message.h>
#include <netgraph/ng_hub.h>
#include <netgraph/netgraph.h>
Include dependency graph for ng_hub.c:

Go to the source code of this file.

Data Structures

struct  ng_hub_private
 

Macros

#define M_NETGRAPH_HUB   M_NETGRAPH
 

Typedefs

typedef struct ng_hub_privatepriv_p
 

Functions

 NETGRAPH_INIT (hub, &ng_hub_typestruct)
 
static int ng_hub_constructor (node_p node)
 
static int ng_hub_rcvmsg (node_p node, item_p item, hook_p lasthook)
 
static int ng_hub_rcvdata (hook_p hook, item_p item)
 
static int ng_hub_shutdown (node_p node)
 
static int ng_hub_disconnect (hook_p hook)
 

Variables

static ng_constructor_t ng_hub_constructor
 
static ng_rcvmsg_t ng_hub_rcvmsg
 
static ng_shutdown_t ng_hub_shutdown
 
static ng_rcvdata_t ng_hub_rcvdata
 
static ng_disconnect_t ng_hub_disconnect
 
static const struct ng_cmdlist ng_hub_cmdlist []
 
static struct ng_type ng_hub_typestruct
 

Macro Definition Documentation

◆ M_NETGRAPH_HUB

#define M_NETGRAPH_HUB   M_NETGRAPH

Definition at line 44 of file ng_hub.c.

Typedef Documentation

◆ priv_p

typedef struct ng_hub_private* priv_p

Definition at line 51 of file ng_hub.c.

Function Documentation

◆ NETGRAPH_INIT()

NETGRAPH_INIT ( hub  ,
ng_hub_typestruct 
)

◆ ng_hub_constructor()

static int ng_hub_constructor ( node_p  node)
static

Definition at line 85 of file ng_hub.c.

References M_NETGRAPH_HUB, and NG_NODE_SET_PRIVATE.

◆ ng_hub_disconnect()

static int ng_hub_disconnect ( hook_p  hook)
static

Definition at line 165 of file ng_hub.c.

References NG_HOOK_NODE, NG_NODE_IS_VALID, NG_NODE_NUMHOOKS, NG_NODE_PRIVATE, and ng_rmnode_self().

Here is the call graph for this function:

◆ ng_hub_rcvdata()

static int ng_hub_rcvdata ( hook_p  hook,
item_p  item 
)
static

◆ ng_hub_rcvmsg()

static int ng_hub_rcvmsg ( node_p  node,
item_p  item,
hook_p  lasthook 
)
static

◆ ng_hub_shutdown()

static int ng_hub_shutdown ( node_p  node)
static

Definition at line 154 of file ng_hub.c.

References M_NETGRAPH_HUB, NG_NODE_PRIVATE, NG_NODE_SET_PRIVATE, and NG_NODE_UNREF.

Variable Documentation

◆ ng_hub_cmdlist

const struct ng_cmdlist ng_hub_cmdlist[]
static
Initial value:
= {
{
"setpersistent",
NULL,
NULL
},
{ 0 }
}
#define NGM_HUB_COOKIE
Definition: ng_hub.h:36
@ NGM_HUB_SET_PERSISTENT
Definition: ng_hub.h:40

Definition at line 61 of file ng_hub.c.

◆ ng_hub_constructor

ng_constructor_t ng_hub_constructor
static

Definition at line 54 of file ng_hub.c.

◆ ng_hub_disconnect

ng_disconnect_t ng_hub_disconnect
static

Definition at line 58 of file ng_hub.c.

◆ ng_hub_rcvdata

ng_rcvdata_t ng_hub_rcvdata
static

Definition at line 57 of file ng_hub.c.

◆ ng_hub_rcvmsg

ng_rcvmsg_t ng_hub_rcvmsg
static

Definition at line 55 of file ng_hub.c.

◆ ng_hub_shutdown

ng_shutdown_t ng_hub_shutdown
static

Definition at line 56 of file ng_hub.c.

◆ ng_hub_typestruct

struct ng_type ng_hub_typestruct
static
Initial value:
= {
.version = NG_ABI_VERSION,
.constructor = ng_hub_constructor,
.rcvmsg = ng_hub_rcvmsg,
.shutdown = ng_hub_shutdown,
.rcvdata = ng_hub_rcvdata,
.disconnect = ng_hub_disconnect,
.cmdlist = ng_hub_cmdlist,
}
#define NG_ABI_VERSION
Definition: netgraph.h:77
static ng_shutdown_t ng_hub_shutdown
Definition: ng_hub.c:56
static const struct ng_cmdlist ng_hub_cmdlist[]
Definition: ng_hub.c:61
static ng_rcvmsg_t ng_hub_rcvmsg
Definition: ng_hub.c:55
static ng_constructor_t ng_hub_constructor
Definition: ng_hub.c:54
static ng_rcvdata_t ng_hub_rcvdata
Definition: ng_hub.c:57
static ng_disconnect_t ng_hub_disconnect
Definition: ng_hub.c:58
#define NG_HUB_NODE_TYPE
Definition: ng_hub.h:35

Definition at line 72 of file ng_hub.c.