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

Go to the source code of this file.

Data Structures

struct  XXX_hookinfo
 
struct  XXX
 

Macros

#define M_NETGRAPH_XXX   M_NETGRAPH
 

Typedefs

typedef struct XXXxxx_p
 

Functions

 NETGRAPH_INIT (xxx, &typestruct)
 
static int ng_xxx_constructor (node_p node)
 
static int ng_xxx_newhook (node_p node, hook_p hook, const char *name)
 
static int ng_xxx_rcvmsg (node_p node, item_p item, hook_p lasthook)
 
static int ng_xxx_rcvdata (hook_p hook, item_p item)
 
static int ng_xxx_shutdown (node_p node)
 
static int ng_xxx_connect (hook_p hook)
 
static int ng_xxx_disconnect (hook_p hook)
 

Variables

static ng_constructor_t ng_xxx_constructor
 
static ng_rcvmsg_t ng_xxx_rcvmsg
 
static ng_shutdown_t ng_xxx_shutdown
 
static ng_newhook_t ng_xxx_newhook
 
static ng_connect_t ng_xxx_connect
 
static ng_rcvdata_t ng_xxx_rcvdata
 
static ng_disconnect_t ng_xxx_disconnect
 
static const struct ng_parse_struct_field ng_xxx_stat_type_fields [] = NG_XXX_STATS_TYPE_INFO
 
static const struct ng_parse_type ng_xxx_stat_type
 
static const struct ng_cmdlist ng_xxx_cmdlist []
 
static struct ng_type typestruct
 

Macro Definition Documentation

◆ M_NETGRAPH_XXX

#define M_NETGRAPH_XXX   M_NETGRAPH

Definition at line 63 of file ng_sample.c.

Typedef Documentation

◆ xxx_p

typedef struct XXX* xxx_p

Definition at line 139 of file ng_sample.c.

Function Documentation

◆ NETGRAPH_INIT()

NETGRAPH_INIT ( xxx  ,
typestruct 
)

◆ ng_xxx_connect()

static int ng_xxx_connect ( hook_p  hook)
static

Definition at line 447 of file ng_sample.c.

References dlci, XXX_hookinfo::hook, NG_HOOK_FORCE_QUEUE, NG_HOOK_PEER, and NG_HOOK_PRIVATE.

◆ ng_xxx_constructor()

static int ng_xxx_constructor ( node_p  node)
static

Definition at line 151 of file ng_sample.c.

References NG_NODE_SET_PRIVATE, privdata::node, XXX::node, and XXX_NUM_DLCIS.

◆ ng_xxx_disconnect()

static int ng_xxx_disconnect ( hook_p  hook)
static

Definition at line 487 of file ng_sample.c.

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

Here is the call graph for this function:

◆ ng_xxx_newhook()

◆ ng_xxx_rcvdata()

◆ ng_xxx_rcvmsg()

◆ ng_xxx_shutdown()

static int ng_xxx_shutdown ( node_p  node)
static

Variable Documentation

◆ ng_xxx_cmdlist

const struct ng_cmdlist ng_xxx_cmdlist[]
static
Initial value:
= {
{
"getstatus",
NULL,
},
{
"setflag",
NULL
},
{ 0 }
}
const struct ng_parse_type ng_parse_int32_type
Definition: ng_parse.c:598
static const struct ng_parse_type ng_xxx_stat_type
Definition: ng_sample.c:82
@ NGM_XXX_GET_STATUS
Definition: ng_sample.h:67
@ NGM_XXX_SET_FLAG
Definition: ng_sample.h:66
#define NGM_XXX_COOKIE
Definition: ng_sample.h:54

Definition at line 88 of file ng_sample.c.

◆ ng_xxx_connect

ng_connect_t ng_xxx_connect
static

Definition at line 75 of file ng_sample.c.

◆ ng_xxx_constructor

ng_constructor_t ng_xxx_constructor
static

Definition at line 71 of file ng_sample.c.

◆ ng_xxx_disconnect

ng_disconnect_t ng_xxx_disconnect
static

Definition at line 77 of file ng_sample.c.

◆ ng_xxx_newhook

ng_newhook_t ng_xxx_newhook
static

Definition at line 74 of file ng_sample.c.

◆ ng_xxx_rcvdata

ng_rcvdata_t ng_xxx_rcvdata
static

Definition at line 76 of file ng_sample.c.

◆ ng_xxx_rcvmsg

ng_rcvmsg_t ng_xxx_rcvmsg
static

Definition at line 72 of file ng_sample.c.

◆ ng_xxx_shutdown

ng_shutdown_t ng_xxx_shutdown
static

Definition at line 73 of file ng_sample.c.

◆ ng_xxx_stat_type

const struct ng_parse_type ng_xxx_stat_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_xxx_stat_type_fields[]
Definition: ng_sample.c:81

Definition at line 82 of file ng_sample.c.

◆ ng_xxx_stat_type_fields

const struct ng_parse_struct_field ng_xxx_stat_type_fields[] = NG_XXX_STATS_TYPE_INFO
static

Definition at line 80 of file ng_sample.c.

◆ typestruct

struct ng_type typestruct
static
Initial value:
= {
.version = NG_ABI_VERSION,
.constructor = ng_xxx_constructor,
.rcvmsg = ng_xxx_rcvmsg,
.shutdown = ng_xxx_shutdown,
.newhook = ng_xxx_newhook,
.connect = ng_xxx_connect,
.rcvdata = ng_xxx_rcvdata,
.disconnect = ng_xxx_disconnect,
.cmdlist = ng_xxx_cmdlist,
}
#define NG_ABI_VERSION
Definition: netgraph.h:77
static ng_newhook_t ng_xxx_newhook
Definition: ng_sample.c:74
static ng_rcvdata_t ng_xxx_rcvdata
Definition: ng_sample.c:76
static ng_rcvmsg_t ng_xxx_rcvmsg
Definition: ng_sample.c:72
static ng_disconnect_t ng_xxx_disconnect
Definition: ng_sample.c:77
static const struct ng_cmdlist ng_xxx_cmdlist[]
Definition: ng_sample.c:88
static ng_shutdown_t ng_xxx_shutdown
Definition: ng_sample.c:73
static ng_connect_t ng_xxx_connect
Definition: ng_sample.c:75
static ng_constructor_t ng_xxx_constructor
Definition: ng_sample.c:71
#define NG_XXX_NODE_TYPE
Definition: ng_sample.h:48

Definition at line 107 of file ng_sample.c.