FreeBSD kernel netgraph code
ng_sscop.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/errno.h>
#include <sys/syslog.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/callout.h>
#include <sys/sbuf.h>
#include <sys/stdint.h>
#include <machine/stdarg.h>
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
#include <netgraph/ng_parse.h>
#include <netnatm/saal/sscopdef.h>
#include <netgraph/atm/ng_sscop.h>
#include <netgraph/atm/sscop/ng_sscop_cust.h>
#include <netnatm/saal/sscop.h>
Include dependency graph for ng_sscop.c:

Go to the source code of this file.

Data Structures

struct  stats
 
struct  priv
 

Macros

#define DDD   printf("%s: %d\n", __func__, __LINE__)
 
#define VERBOSE(P, M, F)
 

Functions

 __FBSDID ("$FreeBSD$")
 
 MALLOC_DEFINE (M_NG_SSCOP, "netgraph_sscop", "netgraph sscop node")
 
 MODULE_DEPEND (ng_sscop, ngatmbase, 1, 1, 1)
 
static int ng_sscop_mod_event (module_t, int, void *)
 
 NETGRAPH_INIT (sscop, &ng_sscop_typestruct)
 
static void sscop_send_manage (struct sscop *, void *, enum sscop_maasig, struct SSCOP_MBUF_T *, u_int, u_int)
 
static void sscop_send_upper (struct sscop *, void *, enum sscop_aasig, struct SSCOP_MBUF_T *, u_int)
 
static void sscop_send_lower (struct sscop *, void *, struct SSCOP_MBUF_T *)
 
static void sscop_verbose (struct sscop *, void *, const char *,...)
 
static int ng_sscop_constructor (node_p node)
 
static int ng_sscop_shutdown (node_p node)
 
static int flow_upper (node_p node, struct ng_mesg *msg)
 
static int flow_lower (node_p node, struct ng_mesg *msg)
 
static int text_status (node_p node, struct priv *priv, char *arg, u_int len)
 
static int ng_sscop_rcvmsg (node_p node, item_p item, hook_p lasthook)
 
static int ng_sscop_newhook (node_p node, hook_p hook, const char *name)
 
static int ng_sscop_disconnect (hook_p hook)
 
static int ng_sscop_rcvlower (hook_p hook, item_p item)
 
static void sscop_send_lower (struct sscop *sscop, void *p, struct mbuf *m)
 
static int ng_sscop_rcvupper (hook_p hook, item_p item)
 
static int ng_sscop_rcvmanage (hook_p hook, item_p item)
 

Variables

static const struct ng_parse_struct_field ng_sscop_param_type_info []
 
static const struct ng_parse_type ng_sscop_param_type
 
static const struct ng_parse_struct_field ng_sscop_setparam_type_info []
 
static const struct ng_parse_type ng_sscop_setparam_type
 
static const struct ng_parse_struct_field ng_sscop_setparam_resp_type_info []
 
static const struct ng_parse_type ng_sscop_setparam_resp_type
 
static const struct ng_cmdlist ng_sscop_cmdlist []
 
static ng_constructor_t ng_sscop_constructor
 
static ng_shutdown_t ng_sscop_shutdown
 
static ng_rcvmsg_t ng_sscop_rcvmsg
 
static ng_newhook_t ng_sscop_newhook
 
static ng_disconnect_t ng_sscop_disconnect
 
static ng_rcvdata_t ng_sscop_rcvlower
 
static ng_rcvdata_t ng_sscop_rcvupper
 
static ng_rcvdata_t ng_sscop_rcvmanage
 
static struct ng_type ng_sscop_typestruct
 

Macro Definition Documentation

◆ DDD

#define DDD   printf("%s: %d\n", __func__, __LINE__)

Definition at line 58 of file ng_sscop.c.

◆ VERBOSE

#define VERBOSE (   P,
  M,
 
)

Definition at line 67 of file ng_sscop.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ flow_lower()

static int flow_lower ( node_p  node,
struct ng_mesg msg 
)
static

Definition at line 349 of file ng_sscop.c.

References ng_mesg::ng_msghdr::arglen, ng_mesg::ng_msghdr::cmd, ng_mesg::header, NG_NODE_PRIVATE, NGM_HIGH_WATER_PASSED, NGM_LOW_WATER_PASSED, and priv::sscop.

Referenced by ng_sscop_rcvmsg().

Here is the caller graph for this function:

◆ flow_upper()

◆ MALLOC_DEFINE()

MALLOC_DEFINE ( M_NG_SSCOP  ,
"netgraph_sscop"  ,
"netgraph sscop node"   
)

◆ MODULE_DEPEND()

MODULE_DEPEND ( ng_sscop  ,
ngatmbase  ,
,
,
 
)

◆ NETGRAPH_INIT()

NETGRAPH_INIT ( sscop  ,
ng_sscop_typestruct 
)

◆ ng_sscop_constructor()

static int ng_sscop_constructor ( node_p  node)
static

Definition at line 245 of file ng_sscop.c.

References NG_NODE_FORCE_WRITER, NG_NODE_SET_PRIVATE, and priv::sscop.

◆ ng_sscop_disconnect()

static int ng_sscop_disconnect ( hook_p  hook)
static

Definition at line 623 of file ng_sscop.c.

References priv::enabled, priv::lower, priv::manage, NG_HOOK_NODE, NG_NODE_IS_VALID, NG_NODE_NUMHOOKS, NG_NODE_PRIVATE, ng_rmnode_self(), priv::sscop, and priv::upper.

Here is the call graph for this function:

◆ ng_sscop_mod_event()

static int ng_sscop_mod_event ( module_t  mod,
int  event,
void *  data 
)
static

Definition at line 856 of file ng_sscop.c.

References event.

◆ ng_sscop_newhook()

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

◆ ng_sscop_rcvlower()

static int ng_sscop_rcvlower ( hook_p  hook,
item_p  item 
)
static

◆ ng_sscop_rcvmanage()

static int ng_sscop_rcvmanage ( hook_p  hook,
item_p  item 
)
static

◆ ng_sscop_rcvmsg()

◆ ng_sscop_rcvupper()

static int ng_sscop_rcvupper ( hook_p  hook,
item_p  item 
)
static

◆ ng_sscop_shutdown()

static int ng_sscop_shutdown ( node_p  node)
static

Definition at line 264 of file ng_sscop.c.

References NG_NODE_PRIVATE, NG_NODE_SET_PRIVATE, NG_NODE_UNREF, and priv::sscop.

◆ sscop_send_lower() [1/2]

static void sscop_send_lower ( struct sscop *  ,
void *  ,
struct SSCOP_MBUF_T *   
)
static

Referenced by sscop_verbose().

Here is the caller graph for this function:

◆ sscop_send_lower() [2/2]

static void sscop_send_lower ( struct sscop *  sscop,
void *  p,
struct mbuf *  m 
)
static

◆ sscop_send_manage()

static void sscop_send_manage ( struct sscop *  sscop,
void *  p,
enum sscop_maasig  sig,
struct SSCOP_MBUF_T *  m,
u_int  err,
u_int  cnt 
)
static

Definition at line 799 of file ng_sscop.c.

References sscop_merr::cnt, sscop_merr::err, stats::errors, stats::maa_dropped, stats::maa_signals, priv::manage, NG_NODE_PRIVATE, NG_SEND_DATA_ONLY, sscop_marg::sig, sscop_merr::sig, and priv::stats.

Referenced by sscop_verbose().

Here is the caller graph for this function:

◆ sscop_send_upper()

static void sscop_send_upper ( struct sscop *  sscop,
void *  p,
enum sscop_aasig  sig,
struct SSCOP_MBUF_T *  m,
u_int  arg 
)
static

Definition at line 735 of file ng_sscop.c.

References stats::aa_dropped, stats::aa_signals, sscop_arg::arg, stats::data_delivered, priv::flow, NG_NODE_PRIVATE, NG_SEND_DATA_ONLY, sscop_arg::sig, priv::sscop, priv::stats, and priv::upper.

Referenced by sscop_verbose().

Here is the caller graph for this function:

◆ sscop_verbose()

static void sscop_verbose ( struct sscop *  sscop,
void *  arg,
const char *  fmt,
  ... 
)
static

Definition at line 218 of file ng_sscop.c.

References sscop_send_lower(), sscop_send_manage(), sscop_send_upper(), and sscop_verbose().

Referenced by sscop_verbose().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ text_status()

static int text_status ( node_p  node,
struct priv priv,
char *  arg,
u_int  len 
)
static

Variable Documentation

◆ ng_sscop_cmdlist

const struct ng_cmdlist ng_sscop_cmdlist[]
static

Definition at line 134 of file ng_sscop.c.

◆ ng_sscop_constructor

ng_constructor_t ng_sscop_constructor
static

Definition at line 187 of file ng_sscop.c.

◆ ng_sscop_disconnect

ng_disconnect_t ng_sscop_disconnect
static

Definition at line 191 of file ng_sscop.c.

◆ ng_sscop_newhook

ng_newhook_t ng_sscop_newhook
static

Definition at line 190 of file ng_sscop.c.

◆ ng_sscop_param_type

const struct ng_parse_type ng_sscop_param_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_sscop_param_type_info[]
Definition: ng_sscop.c:104

Definition at line 107 of file ng_sscop.c.

◆ ng_sscop_param_type_info

const struct ng_parse_struct_field ng_sscop_param_type_info[]
static
Initial value:
=
#define NG_SSCOP_PARAM_INFO
Definition: ng_sscop.h:53

Definition at line 104 of file ng_sscop.c.

◆ ng_sscop_rcvlower

ng_rcvdata_t ng_sscop_rcvlower
static

Definition at line 192 of file ng_sscop.c.

◆ ng_sscop_rcvmanage

ng_rcvdata_t ng_sscop_rcvmanage
static

Definition at line 194 of file ng_sscop.c.

Referenced by ng_sscop_newhook().

◆ ng_sscop_rcvmsg

ng_rcvmsg_t ng_sscop_rcvmsg
static

Definition at line 189 of file ng_sscop.c.

◆ ng_sscop_rcvupper

ng_rcvdata_t ng_sscop_rcvupper
static

Definition at line 193 of file ng_sscop.c.

Referenced by ng_sscop_newhook().

◆ ng_sscop_setparam_resp_type

const struct ng_parse_type ng_sscop_setparam_resp_type
static
Initial value:
= {
}
static const struct ng_parse_struct_field ng_sscop_setparam_resp_type_info[]
Definition: ng_sscop.c:126

Definition at line 129 of file ng_sscop.c.

◆ ng_sscop_setparam_resp_type_info

const struct ng_parse_struct_field ng_sscop_setparam_resp_type_info[]
static
Initial value:
=
#define NG_SSCOP_SETPARAM_RESP_INFO
Definition: ng_sscop.h:85

Definition at line 126 of file ng_sscop.c.

◆ ng_sscop_setparam_type

const struct ng_parse_type ng_sscop_setparam_type
static
Initial value:
= {
}
static const struct ng_parse_struct_field ng_sscop_setparam_type_info[]
Definition: ng_sscop.c:115

Definition at line 118 of file ng_sscop.c.

◆ ng_sscop_setparam_type_info

const struct ng_parse_struct_field ng_sscop_setparam_type_info[]
static
Initial value:
=
#define NG_SSCOP_SETPARAM_INFO
Definition: ng_sscop.h:74

Definition at line 115 of file ng_sscop.c.

◆ ng_sscop_shutdown

ng_shutdown_t ng_sscop_shutdown
static

Definition at line 188 of file ng_sscop.c.

◆ ng_sscop_typestruct

struct ng_type ng_sscop_typestruct
static
Initial value:
= {
.version = NG_ABI_VERSION,
.mod_event = ng_sscop_mod_event,
.constructor = ng_sscop_constructor,
.rcvmsg = ng_sscop_rcvmsg,
.shutdown = ng_sscop_shutdown,
.newhook = ng_sscop_newhook,
.rcvdata = ng_sscop_rcvlower,
.disconnect = ng_sscop_disconnect,
.cmdlist = ng_sscop_cmdlist,
}
#define NG_ABI_VERSION
Definition: netgraph.h:77
static ng_constructor_t ng_sscop_constructor
Definition: ng_sscop.c:187
static ng_shutdown_t ng_sscop_shutdown
Definition: ng_sscop.c:188
static ng_newhook_t ng_sscop_newhook
Definition: ng_sscop.c:190
static const struct ng_cmdlist ng_sscop_cmdlist[]
Definition: ng_sscop.c:134
static ng_rcvmsg_t ng_sscop_rcvmsg
Definition: ng_sscop.c:189
static ng_disconnect_t ng_sscop_disconnect
Definition: ng_sscop.c:191
static int ng_sscop_mod_event(module_t, int, void *)
Definition: ng_sscop.c:856
static ng_rcvdata_t ng_sscop_rcvlower
Definition: ng_sscop.c:192
#define NG_SSCOP_NODE_TYPE
Definition: ng_sscop.h:38

Definition at line 198 of file ng_sscop.c.