34#include <sys/kernel.h>
36#include <sys/malloc.h>
39#include <sys/syslog.h>
41#include <sys/counter.h>
43#include <net/ethernet.h>
174 vlanrotate_p vrp = malloc(
sizeof(*vrp), M_NETGRAPH, M_WAITOK | M_ZERO);
178 vrp->
stats.
drops = counter_u64_alloc(M_WAITOK);
254 (abs(pcf->
rot) >= pcf->
max)) {
332 uint8_t
dst[ETHER_ADDR_LEN];
333 uint8_t
src[ETHER_ADDR_LEN];
377 struct mbuf *m = NULL;
396 if (dst_hook == NULL) {
406 if (m->m_len < expected_len) {
407 m = m_pullup(m, expected_len);
418 case ETHERTYPE_8021Q9100:
419 case ETHERTYPE_8021Q9200:
420 case ETHERTYPE_8021Q9300:
433 if ((vlans < vrp->conf.min) || (vlans <= abs(rotate))) {
443 }
else if (rotate > 0) {
450 if (dst_hook == NULL)
481 free(vrp, M_NETGRAPH);
#define NG_HOOK_NODE(hook)
int ng_rcvmsg_t(node_p node, item_p item, hook_p lasthook)
int ng_disconnect_t(hook_p hook)
#define NG_NODE_SET_PRIVATE(node, val)
#define NG_RESPOND_MSG(error, here, item, resp)
#define NG_NODE_IS_VALID(node)
#define NG_NODE_UNREF(node)
int ng_rmnode_self(node_p here)
#define NG_FWD_NEW_DATA(error, item, hook, m)
int ng_rcvdata_t(hook_p hook, item_p item)
int ng_shutdown_t(node_p node)
#define NG_FREE_ITEM(item)
int ng_constructor_t(node_p node)
#define NG_NODE_NUMHOOKS(node)
#define NGI_GET_MSG(i, m)
#define NG_NODE_PRIVATE(node)
int ng_newhook_t(node_p node, hook_p hook, const char *name)
#define NG_MKRESPONSE(rsp, msg, len, how)
const struct ng_parse_type ng_parse_uint64_type
const struct ng_parse_type ng_parse_fixedarray_type
const struct ng_parse_type ng_parse_int8_type
const struct ng_parse_type ng_parse_struct_type
const struct ng_parse_type ng_parse_uint8_type
static ng_constructor_t ng_vlanrotate_constructor
static struct ng_parse_fixedarray_info ng_vlanrotate_stat_hist_info
static ng_shutdown_t ng_vlanrotate_shutdown
struct ether_vlan_stack_entry __packed
static ng_rcvmsg_t ng_vlanrotate_rcvmsg
static struct ng_parse_type ng_vlanrotate_stat_type
NETGRAPH_INIT(vlanrotate, &typestruct)
static ng_rcvdata_t ng_vlanrotate_rcvdata
static int ng_vlanrotate_gcd(int a, int b)
static const struct ng_cmdlist ng_vlanrotate_cmdlist[]
static void ng_vlanrotate_rotate(struct ether_vlan_stack_entry arr[], int d, int n)
static struct ng_type typestruct
static ng_newhook_t ng_vlanrotate_newhook
static const struct ng_parse_type ng_vlanrotate_conf_type
static const struct ng_parse_struct_field ng_vlanrotate_stat_fields[]
struct vlanrotate * vlanrotate_p
static struct ng_parse_type ng_vlanrotate_stat_hist
static const struct ng_parse_struct_field ng_vlanrotate_conf_fields[]
static ng_disconnect_t ng_vlanrotate_disconnect
#define NGM_VLANROTATE_COOKIE
#define NG_VLANROTATE_HOOK_ORDERED
#define NG_VLANROTATE_HOOK_INCOMPLETE
#define NG_VLANROTATE_HOOK_EXCESSIVE
@ NGM_VLANROTATE_GET_CONF
@ NGM_VLANROTATE_GET_STAT
@ NGM_VLANROTATE_GETCLR_STAT
@ NGM_VLANROTATE_CLR_STAT
@ NGM_VLANROTATE_SET_CONF
#define NG_VLANROTATE_MAX_VLANS
#define NG_VLANROTATE_NODE_TYPE
#define NG_VLANROTATE_HOOK_ORIGINAL
struct ng_mesg::ng_msghdr header
counter_u64_t histogram[NG_VLANROTATE_MAX_VLANS]
uint64_t histogram[NG_VLANROTATE_MAX_VLANS]
struct ng_vlanrotate_kernel_stats stats
struct ng_vlanrotate_conf conf