FreeBSD kernel netgraph code
|
#include <sys/param.h>
#include <sys/eventhandler.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/errno.h>
#include <sys/proc.h>
#include <sys/syslog.h>
#include <sys/socket.h>
#include <sys/taskqueue.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/if_arp.h>
#include <net/if_var.h>
#include <net/ethernet.h>
#include <net/if_bridgevar.h>
#include <net/vnet.h>
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
#include <netgraph/ng_parse.h>
#include <netgraph/ng_ether.h>
Go to the source code of this file.
Data Structures | |
struct | private |
Macros | |
#define | IFP2NG(ifp) ((ifp)->if_l2com) |
Typedefs | |
typedef struct private * | priv_p |
Functions | |
MODULE_VERSION (ng_ether, 1) | |
static void | ng_ether_input (struct ifnet *ifp, struct mbuf **mp) |
static void | ng_ether_input_orphan (struct ifnet *ifp, struct mbuf *m) |
static int | ng_ether_output (struct ifnet *ifp, struct mbuf **mp) |
static void | ng_ether_attach (struct ifnet *ifp) |
static void | ng_ether_detach (struct ifnet *ifp) |
static void | ng_ether_link_state (struct ifnet *ifp, int state) |
static int | ng_ether_rcv_lower (hook_p node, item_p item) |
static int | ng_ether_rcv_upper (hook_p node, item_p item) |
static int | ng_ether_mod_event (module_t mod, int event, void *data) |
NETGRAPH_INIT (ether, &ng_ether_typestruct) | |
static void | ng_ether_sanitize_ifname (const char *ifname, char *name) |
static void | ng_ether_ifnet_arrival_event (void *arg __unused, struct ifnet *ifp) |
static int | ng_ether_constructor (node_p node) |
static int | ng_ether_newhook (node_p node, hook_p hook, const char *name) |
static int | ng_ether_rcvmsg (node_p node, item_p item, hook_p lasthook) |
static int | ng_ether_rcvdata (hook_p hook, item_p item) |
static int | ng_ether_shutdown (node_p node) |
static int | ng_ether_disconnect (hook_p hook) |
static void | vnet_ng_ether_init (const void *unused) |
VNET_SYSINIT (vnet_ng_ether_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_ng_ether_init, NULL) | |
Variables | |
void(* | ng_ether_input_p )(struct ifnet *ifp, struct mbuf **mp) |
void(* | ng_ether_input_orphan_p )(struct ifnet *ifp, struct mbuf *m) |
int(* | ng_ether_output_p )(struct ifnet *ifp, struct mbuf **mp) |
void(* | ng_ether_attach_p )(struct ifnet *ifp) |
void(* | ng_ether_detach_p )(struct ifnet *ifp) |
void(* | ng_ether_link_state_p )(struct ifnet *ifp, int state) |
static ng_constructor_t | ng_ether_constructor |
static ng_rcvmsg_t | ng_ether_rcvmsg |
static ng_shutdown_t | ng_ether_shutdown |
static ng_newhook_t | ng_ether_newhook |
static ng_rcvdata_t | ng_ether_rcvdata |
static ng_disconnect_t | ng_ether_disconnect |
static eventhandler_tag | ng_ether_ifnet_arrival_cookie |
static const struct ng_cmdlist | ng_ether_cmdlist [] |
static struct ng_type | ng_ether_typestruct |
#define IFP2NG | ( | ifp | ) | ((ifp)->if_l2com) |
Definition at line 77 of file ng_ether.c.
Definition at line 90 of file ng_ether.c.
MODULE_VERSION | ( | ng_ether | , |
1 | |||
) |
NETGRAPH_INIT | ( | ether | , |
& | ng_ether_typestruct | ||
) |
|
static |
Definition at line 304 of file ng_ether.c.
References IFP2NG, name, ng_ether_sanitize_ifname(), ng_ether_typestruct, ng_make_node_common(), ng_name2noderef(), ng_name_node(), NG_NODE_SET_PRIVATE, and NG_NODE_UNREF.
Referenced by ng_ether_mod_event(), and vnet_ng_ether_init().
|
static |
Definition at line 445 of file ng_ether.c.
|
static |
Definition at line 354 of file ng_ether.c.
References IFP2NG, NG_NODE_PRIVATE, NG_NODE_REALLY_DIE, and ng_rmnode_self().
Referenced by ng_ether_mod_event(), and ng_ether_rcvmsg().
|
static |
Definition at line 780 of file ng_ether.c.
References priv::lower, NG_HOOK_NODE, NG_NODE_IS_VALID, NG_NODE_NUMHOOKS, NG_NODE_PRIVATE, ng_rmnode_self(), and priv::upper.
|
static |
Definition at line 411 of file ng_ether.c.
References IFP2NG, name, ng_ether_sanitize_ifname(), and ng_name_node().
Referenced by ng_ether_mod_event().
|
static |
Definition at line 246 of file ng_ether.c.
References IFP2NG, priv::lower, NG_NODE_PRIVATE, and NG_SEND_DATA_ONLY.
Referenced by ng_ether_mod_event().
|
static |
Definition at line 263 of file ng_ether.c.
References IFP2NG, NG_NODE_PRIVATE, and NG_SEND_DATA_ONLY.
Referenced by ng_ether_mod_event().
|
static |
Definition at line 376 of file ng_ether.c.
References IFP2NG, priv::lower, NG_MKMESSAGE, NG_NODE_PRIVATE, NG_SEND_MSG_HOOK, NGM_FLOW_COOKIE, NGM_LINK_IS_DOWN, and NGM_LINK_IS_UP.
Referenced by ng_ether_mod_event().
|
static |
Definition at line 808 of file ng_ether.c.
References event, ng_ether_attach(), ng_ether_attach_p, ng_ether_detach(), ng_ether_detach_p, ng_ether_ifnet_arrival_cookie, ng_ether_ifnet_arrival_event(), ng_ether_input(), ng_ether_input_orphan(), ng_ether_input_orphan_p, ng_ether_input_p, ng_ether_link_state(), ng_ether_link_state_p, ng_ether_output(), and ng_ether_output_p.
Definition at line 454 of file ng_ether.c.
References priv::lower, name, NG_ETHER_HOOK_DIVERT, NG_ETHER_HOOK_LOWER, NG_ETHER_HOOK_ORPHAN, NG_ETHER_HOOK_UPPER, ng_ether_rcv_lower(), ng_ether_rcv_upper(), NG_HOOK_HI_STACK, NG_HOOK_SET_RCVDATA, NG_HOOK_SET_TO_INBOUND, NG_NODE_PRIVATE, and priv::upper.
|
static |
Definition at line 282 of file ng_ether.c.
References IFP2NG, NG_NODE_PRIVATE, NG_OUTBOUND_THREAD_REF, NG_OUTBOUND_THREAD_UNREF, NG_SEND_DATA_ONLY, and priv::upper.
Referenced by ng_ether_mod_event().
Definition at line 665 of file ng_ether.c.
References NG_FREE_ITEM, NG_FREE_M, NG_HOOK_NODE, NG_NODE_PRIVATE, and NGI_GET_M.
Referenced by ng_ether_newhook().
Definition at line 713 of file ng_ether.c.
References NG_FREE_ITEM, NG_FREE_M, NG_HOOK_NODE, NG_NODE_PRIVATE, and NGI_GET_M.
Referenced by ng_ether_newhook().
Definition at line 654 of file ng_ether.c.
References NG_FREE_ITEM.
Definition at line 494 of file ng_ether.c.
References ng_mesg::ng_msghdr::arglen, ng_mesg::ng_msghdr::cmd, ng_mesg::data, ng_mesg::header, ng_ether_detach(), NG_FREE_MSG, NG_MKRESPONSE, NG_NODE_PRIVATE, NG_RESPOND_MSG, NGI_GET_MSG, NGM_ETHER_ADD_MULTI, NGM_ETHER_COOKIE, NGM_ETHER_DEL_MULTI, NGM_ETHER_DETACH, NGM_ETHER_GET_AUTOSRC, NGM_ETHER_GET_ENADDR, NGM_ETHER_GET_IFINDEX, NGM_ETHER_GET_IFNAME, NGM_ETHER_GET_PROMISC, NGM_ETHER_SET_AUTOSRC, NGM_ETHER_SET_ENADDR, NGM_ETHER_SET_PROMISC, and ng_mesg::ng_msghdr::typecookie.
|
static |
Definition at line 223 of file ng_ether.c.
References name.
Referenced by ng_ether_attach(), and ng_ether_ifnet_arrival_event().
|
static |
Definition at line 751 of file ng_ether.c.
References IFP2NG, ng_node::nd_flags, NG_NODE_PRIVATE, NG_NODE_REVIVE, NG_NODE_SET_PRIVATE, NG_NODE_UNREF, and NGF_REALLY_DIE.
|
static |
Definition at line 862 of file ng_ether.c.
References ng_ether_attach(), and ng_ether_attach_p.
VNET_SYSINIT | ( | vnet_ng_ether_init | , |
SI_SUB_PSEUDO | , | ||
SI_ORDER_ANY | , | ||
vnet_ng_ether_init | , | ||
NULL | |||
) |
|
extern |
Referenced by ng_ether_mod_event(), and vnet_ng_ether_init().
|
static |
Definition at line 124 of file ng_ether.c.
|
static |
Definition at line 113 of file ng_ether.c.
|
extern |
Referenced by ng_ether_mod_event().
|
static |
Definition at line 118 of file ng_ether.c.
|
static |
Definition at line 121 of file ng_ether.c.
Referenced by ng_ether_mod_event().
|
extern |
Referenced by ng_ether_mod_event().
|
extern |
Referenced by ng_ether_mod_event().
|
extern |
Referenced by ng_ether_mod_event().
|
static |
Definition at line 116 of file ng_ether.c.
|
extern |
Referenced by ng_ether_mod_event().
|
static |
Definition at line 117 of file ng_ether.c.
|
static |
Definition at line 114 of file ng_ether.c.
|
static |
Definition at line 115 of file ng_ether.c.
|
static |
Definition at line 205 of file ng_ether.c.
Referenced by ng_ether_attach().