FreeBSD kernel netgraph code
ng_vlan_rotate.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 <sys/types.h>
#include <sys/counter.h>
#include <net/ethernet.h>
#include <netgraph/ng_message.h>
#include <netgraph/ng_parse.h>
#include <netgraph/ng_vlan_rotate.h>
#include <netgraph/netgraph.h>
Include dependency graph for ng_vlan_rotate.c:

Go to the source code of this file.

Data Structures

struct  ng_vlanrotate_kernel_stats
 
struct  vlanrotate
 
struct  ether_vlan_stack_entry
 
struct  ether_vlan_stack_header
 

Typedefs

typedef struct vlanrotatevlanrotate_p
 

Functions

 NETGRAPH_INIT (vlanrotate, &typestruct)
 
static int ng_vlanrotate_constructor (node_p node)
 
static int ng_vlanrotate_newhook (node_p node, hook_p hook, const char *name)
 
static int ng_vlanrotate_rcvmsg (node_p node, item_p item, hook_p lasthook)
 
static int ng_vlanrotate_gcd (int a, int b)
 
static void ng_vlanrotate_rotate (struct ether_vlan_stack_entry arr[], int d, int n)
 
static int ng_vlanrotate_rcvdata (hook_p hook, item_p item)
 
static int ng_vlanrotate_shutdown (node_p node)
 
static int ng_vlanrotate_disconnect (hook_p hook)
 

Variables

static ng_constructor_t ng_vlanrotate_constructor
 
static ng_rcvmsg_t ng_vlanrotate_rcvmsg
 
static ng_shutdown_t ng_vlanrotate_shutdown
 
static ng_newhook_t ng_vlanrotate_newhook
 
static ng_rcvdata_t ng_vlanrotate_rcvdata
 
static ng_disconnect_t ng_vlanrotate_disconnect
 
static const struct ng_parse_struct_field ng_vlanrotate_conf_fields []
 
static const struct ng_parse_type ng_vlanrotate_conf_type
 
static struct ng_parse_fixedarray_info ng_vlanrotate_stat_hist_info
 
static struct ng_parse_type ng_vlanrotate_stat_hist
 
static const struct ng_parse_struct_field ng_vlanrotate_stat_fields []
 
static struct ng_parse_type ng_vlanrotate_stat_type
 
static const struct ng_cmdlist ng_vlanrotate_cmdlist []
 
static struct ng_type typestruct
 
struct ether_vlan_stack_entry __packed
 

Typedef Documentation

◆ vlanrotate_p

typedef struct vlanrotate* vlanrotate_p

Definition at line 164 of file ng_vlan_rotate.c.

Function Documentation

◆ NETGRAPH_INIT()

NETGRAPH_INIT ( vlanrotate  ,
typestruct 
)

◆ ng_vlanrotate_constructor()

◆ ng_vlanrotate_disconnect()

static int ng_vlanrotate_disconnect ( hook_p  hook)
static

◆ ng_vlanrotate_gcd()

static int ng_vlanrotate_gcd ( int  a,
int  b 
)
static

Definition at line 338 of file ng_vlan_rotate.c.

References ng_vlanrotate_gcd().

Referenced by ng_vlanrotate_gcd(), and ng_vlanrotate_rotate().

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

◆ ng_vlanrotate_newhook()

◆ ng_vlanrotate_rcvdata()

◆ ng_vlanrotate_rcvmsg()

◆ ng_vlanrotate_rotate()

static void ng_vlanrotate_rotate ( struct ether_vlan_stack_entry  arr[],
int  d,
int  n 
)
static

Definition at line 347 of file ng_vlan_rotate.c.

References ng_vlanrotate_gcd().

Referenced by ng_vlanrotate_rcvdata().

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

◆ ng_vlanrotate_shutdown()

Variable Documentation

◆ __packed

struct ether_vlan_stack_header __packed

◆ ng_vlanrotate_cmdlist

const struct ng_cmdlist ng_vlanrotate_cmdlist[]
static

Definition at line 97 of file ng_vlan_rotate.c.

◆ ng_vlanrotate_conf_fields

const struct ng_parse_struct_field ng_vlanrotate_conf_fields[]
static
Initial value:
= {
{"rot", &ng_parse_int8_type},
{NULL}
}
const struct ng_parse_type ng_parse_int8_type
Definition: ng_parse.c:403
const struct ng_parse_type ng_parse_uint8_type
Definition: ng_parse.c:413

Definition at line 63 of file ng_vlan_rotate.c.

◆ ng_vlanrotate_conf_type

const struct ng_parse_type ng_vlanrotate_conf_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_vlanrotate_conf_fields[]

Definition at line 69 of file ng_vlan_rotate.c.

◆ ng_vlanrotate_constructor

ng_constructor_t ng_vlanrotate_constructor
static

Definition at line 55 of file ng_vlan_rotate.c.

◆ ng_vlanrotate_disconnect

ng_disconnect_t ng_vlanrotate_disconnect
static

Definition at line 60 of file ng_vlan_rotate.c.

◆ ng_vlanrotate_newhook

ng_newhook_t ng_vlanrotate_newhook
static

Definition at line 58 of file ng_vlan_rotate.c.

◆ ng_vlanrotate_rcvdata

ng_rcvdata_t ng_vlanrotate_rcvdata
static

Definition at line 59 of file ng_vlan_rotate.c.

◆ ng_vlanrotate_rcvmsg

ng_rcvmsg_t ng_vlanrotate_rcvmsg
static

Definition at line 56 of file ng_vlan_rotate.c.

◆ ng_vlanrotate_shutdown

ng_shutdown_t ng_vlanrotate_shutdown
static

Definition at line 57 of file ng_vlan_rotate.c.

◆ ng_vlanrotate_stat_fields

const struct ng_parse_struct_field ng_vlanrotate_stat_fields[]
static
Initial value:
= {
{"drops", &ng_parse_uint64_type},
{"excessive", &ng_parse_uint64_type},
{"incomplete", &ng_parse_uint64_type},
{"histogram", &ng_vlanrotate_stat_hist},
{NULL}
}
const struct ng_parse_type ng_parse_uint64_type
Definition: ng_parse.c:703
static struct ng_parse_type ng_vlanrotate_stat_hist

Definition at line 83 of file ng_vlan_rotate.c.

◆ ng_vlanrotate_stat_hist

struct ng_parse_type ng_vlanrotate_stat_hist
static
Initial value:
= {
}
const struct ng_parse_type ng_parse_fixedarray_type
Definition: ng_parse.c:271
static struct ng_parse_fixedarray_info ng_vlanrotate_stat_hist_info

Definition at line 79 of file ng_vlan_rotate.c.

◆ ng_vlanrotate_stat_hist_info

struct ng_parse_fixedarray_info ng_vlanrotate_stat_hist_info
static
Initial value:

Definition at line 75 of file ng_vlan_rotate.c.

◆ ng_vlanrotate_stat_type

struct ng_parse_type ng_vlanrotate_stat_type
static
Initial value:
= {
}
static const struct ng_parse_struct_field ng_vlanrotate_stat_fields[]

Definition at line 90 of file ng_vlan_rotate.c.

◆ typestruct

struct ng_type typestruct
static
Initial value:
= {
.version = NG_ABI_VERSION,
.constructor = ng_vlanrotate_constructor,
.disconnect = ng_vlanrotate_disconnect,
}
#define NG_ABI_VERSION
Definition: netgraph.h:77
static ng_constructor_t ng_vlanrotate_constructor
static ng_shutdown_t ng_vlanrotate_shutdown
static ng_rcvmsg_t ng_vlanrotate_rcvmsg
static ng_rcvdata_t ng_vlanrotate_rcvdata
static const struct ng_cmdlist ng_vlanrotate_cmdlist[]
static ng_newhook_t ng_vlanrotate_newhook
static ng_disconnect_t ng_vlanrotate_disconnect
#define NG_VLANROTATE_NODE_TYPE

Definition at line 137 of file ng_vlan_rotate.c.