FreeBSD kernel netgraph code
ng_atmllc.c File Reference
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
#include <netgraph/ng_atmllc.h>
#include <net/if.h>
#include <net/ethernet.h>
Include dependency graph for ng_atmllc.c:

Go to the source code of this file.

Data Structures

struct  ng_atmllc_priv
 
struct  atmllc
 

Macros

#define NG_ATMLLC_HEADER   "\252\252\3\0\200\302"
 
#define NG_ATMLLC_HEADER_LEN   (sizeof(struct atmllc))
 
#define NG_ATMLLC_TYPE_ETHERNET_FCS   0x0001
 
#define NG_ATMLLC_TYPE_FDDI_FCS   0x0004
 
#define NG_ATMLLC_TYPE_ETHERNET_NOFCS   0x0007
 
#define NG_ATMLLC_TYPE_FDDI_NOFCS   0x000A
 
#define ATM_LLC_TYPE(X)   (((X)->type[0] << 8) | ((X)->type[1]))
 
#define ATM_LLC_SETTYPE(X, V)
 

Functions

 NETGRAPH_INIT (atmllc, &ng_atmllc_typestruct)
 
static int ng_atmllc_constructor (node_p node)
 
static int ng_atmllc_rcvmsg (node_p node, item_p item, hook_p lasthook)
 
static int ng_atmllc_shutdown (node_p node)
 
static int ng_atmllc_newhook (node_p node, hook_p hook, const char *name)
 
static int ng_atmllc_rcvdata (hook_p hook, item_p item)
 
static int ng_atmllc_disconnect (hook_p hook)
 

Variables

static ng_constructor_t ng_atmllc_constructor
 
static ng_shutdown_t ng_atmllc_shutdown
 
static ng_rcvmsg_t ng_atmllc_rcvmsg
 
static ng_newhook_t ng_atmllc_newhook
 
static ng_rcvdata_t ng_atmllc_rcvdata
 
static ng_disconnect_t ng_atmllc_disconnect
 
static struct ng_type ng_atmllc_typestruct
 

Macro Definition Documentation

◆ ATM_LLC_SETTYPE

#define ATM_LLC_SETTYPE (   X,
 
)
Value:
do { \
(X)->type[0] = ((V) >> 8) & 0xff; \
(X)->type[1] = ((V) & 0xff); \
} while (0)
u_int8_t type

Definition at line 66 of file ng_atmllc.c.

◆ ATM_LLC_TYPE

#define ATM_LLC_TYPE (   X)    (((X)->type[0] << 8) | ((X)->type[1]))

Definition at line 65 of file ng_atmllc.c.

◆ NG_ATMLLC_HEADER

#define NG_ATMLLC_HEADER   "\252\252\3\0\200\302"

Definition at line 46 of file ng_atmllc.c.

◆ NG_ATMLLC_HEADER_LEN

#define NG_ATMLLC_HEADER_LEN   (sizeof(struct atmllc))

Definition at line 47 of file ng_atmllc.c.

◆ NG_ATMLLC_TYPE_ETHERNET_FCS

#define NG_ATMLLC_TYPE_ETHERNET_FCS   0x0001

Definition at line 48 of file ng_atmllc.c.

◆ NG_ATMLLC_TYPE_ETHERNET_NOFCS

#define NG_ATMLLC_TYPE_ETHERNET_NOFCS   0x0007

Definition at line 50 of file ng_atmllc.c.

◆ NG_ATMLLC_TYPE_FDDI_FCS

#define NG_ATMLLC_TYPE_FDDI_FCS   0x0004

Definition at line 49 of file ng_atmllc.c.

◆ NG_ATMLLC_TYPE_FDDI_NOFCS

#define NG_ATMLLC_TYPE_FDDI_NOFCS   0x000A

Definition at line 51 of file ng_atmllc.c.

Function Documentation

◆ NETGRAPH_INIT()

NETGRAPH_INIT ( atmllc  ,
ng_atmllc_typestruct 
)

◆ ng_atmllc_constructor()

static int ng_atmllc_constructor ( node_p  node)
static

Definition at line 92 of file ng_atmllc.c.

References NG_NODE_SET_PRIVATE.

◆ ng_atmllc_disconnect()

static int ng_atmllc_disconnect ( hook_p  hook)
static

Definition at line 263 of file ng_atmllc.c.

References NG_HOOK_NODE, NG_NODE_IS_VALID, NG_NODE_NUMHOOKS, NG_NODE_PRIVATE, and ng_rmnode_self().

Here is the call graph for this function:

◆ ng_atmllc_newhook()

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

◆ ng_atmllc_rcvdata()

◆ ng_atmllc_rcvmsg()

static int ng_atmllc_rcvmsg ( node_p  node,
item_p  item,
hook_p  lasthook 
)
static

◆ ng_atmllc_shutdown()

static int ng_atmllc_shutdown ( node_p  node)
static

Definition at line 116 of file ng_atmllc.c.

References NG_NODE_PRIVATE, and NG_NODE_UNREF.

Variable Documentation

◆ ng_atmllc_constructor

ng_constructor_t ng_atmllc_constructor
static

Definition at line 72 of file ng_atmllc.c.

◆ ng_atmllc_disconnect

ng_disconnect_t ng_atmllc_disconnect
static

Definition at line 77 of file ng_atmllc.c.

◆ ng_atmllc_newhook

ng_newhook_t ng_atmllc_newhook
static

Definition at line 75 of file ng_atmllc.c.

◆ ng_atmllc_rcvdata

ng_rcvdata_t ng_atmllc_rcvdata
static

Definition at line 76 of file ng_atmllc.c.

◆ ng_atmllc_rcvmsg

ng_rcvmsg_t ng_atmllc_rcvmsg
static

Definition at line 74 of file ng_atmllc.c.

◆ ng_atmllc_shutdown

ng_shutdown_t ng_atmllc_shutdown
static

Definition at line 73 of file ng_atmllc.c.

◆ ng_atmllc_typestruct

struct ng_type ng_atmllc_typestruct
static
Initial value:
= {
.version = NG_ABI_VERSION,
.constructor = ng_atmllc_constructor,
.rcvmsg = ng_atmllc_rcvmsg,
.shutdown = ng_atmllc_shutdown,
.newhook = ng_atmllc_newhook,
.rcvdata = ng_atmllc_rcvdata,
.disconnect = ng_atmllc_disconnect,
}
#define NG_ABI_VERSION
Definition: netgraph.h:77
static ng_shutdown_t ng_atmllc_shutdown
Definition: ng_atmllc.c:73
static ng_disconnect_t ng_atmllc_disconnect
Definition: ng_atmllc.c:77
static ng_newhook_t ng_atmllc_newhook
Definition: ng_atmllc.c:75
static ng_constructor_t ng_atmllc_constructor
Definition: ng_atmllc.c:72
static ng_rcvmsg_t ng_atmllc_rcvmsg
Definition: ng_atmllc.c:74
static ng_rcvdata_t ng_atmllc_rcvdata
Definition: ng_atmllc.c:76
#define NG_ATMLLC_NODE_TYPE
Definition: ng_atmllc.h:35

Definition at line 79 of file ng_atmllc.c.