FreeBSD kernel netgraph code
ng_gif_demux.c File Reference
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/ctype.h>
#include <sys/mbuf.h>
#include <sys/errno.h>
#include <sys/socket.h>
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
#include <netgraph/ng_parse.h>
#include <netgraph/ng_gif_demux.h>
Include dependency graph for ng_gif_demux.c:

Go to the source code of this file.

Data Structures

struct  iffam
 
struct  ng_gif_demux_private
 

Macros

#define M_NETGRAPH_GIF_DEMUX   M_NETGRAPH
 
#define NUM_FAMILIES   nitems(gFamilies)
 

Typedefs

typedef const struct iffamiffam_p
 
typedef struct ng_gif_demux_privatepriv_p
 

Functions

static iffam_p get_iffam_from_af (sa_family_t family)
 
static iffam_p get_iffam_from_hook (priv_p priv, hook_p hook)
 
static iffam_p get_iffam_from_name (const char *name)
 
static hook_pget_hook_from_iffam (priv_p priv, iffam_p iffam)
 
 NETGRAPH_INIT (gif_demux, &ng_gif_demux_typestruct)
 
static int ng_gif_demux_constructor (node_p node)
 
static int ng_gif_demux_newhook (node_p node, hook_p hook, const char *name)
 
static int ng_gif_demux_rcvmsg (node_p node, item_p item, hook_p lasthook)
 
static int ng_gif_demux_rcvdata (hook_p hook, item_p item)
 
static int ng_gif_demux_shutdown (node_p node)
 
static int ng_gif_demux_disconnect (hook_p hook)
 

Variables

static const struct iffam gFamilies []
 
static ng_constructor_t ng_gif_demux_constructor
 
static ng_rcvmsg_t ng_gif_demux_rcvmsg
 
static ng_shutdown_t ng_gif_demux_shutdown
 
static ng_newhook_t ng_gif_demux_newhook
 
static ng_rcvdata_t ng_gif_demux_rcvdata
 
static ng_disconnect_t ng_gif_demux_disconnect
 
static const struct ng_cmdlist ng_gif_demux_cmdlist []
 
static struct ng_type ng_gif_demux_typestruct
 

Macro Definition Documentation

◆ M_NETGRAPH_GIF_DEMUX

#define M_NETGRAPH_GIF_DEMUX   M_NETGRAPH

Definition at line 97 of file ng_gif_demux.c.

◆ NUM_FAMILIES

#define NUM_FAMILIES   nitems(gFamilies)

Definition at line 116 of file ng_gif_demux.c.

Typedef Documentation

◆ iffam_p

typedef const struct iffam* iffam_p

Definition at line 105 of file ng_gif_demux.c.

◆ priv_p

typedef struct ng_gif_demux_private* priv_p

Definition at line 124 of file ng_gif_demux.c.

Function Documentation

◆ get_hook_from_iffam()

static __inline hook_p * get_hook_from_iffam ( priv_p  priv,
iffam_p  iffam 
)
static

Definition at line 203 of file ng_gif_demux.c.

References gFamilies.

Referenced by ng_gif_demux_disconnect(), ng_gif_demux_newhook(), and ng_gif_demux_rcvdata().

Here is the caller graph for this function:

◆ get_iffam_from_af()

static __inline iffam_p get_iffam_from_af ( sa_family_t  family)
static

Definition at line 171 of file ng_gif_demux.c.

References iffam::family, gFamilies, and NUM_FAMILIES.

Referenced by ng_gif_demux_rcvdata().

Here is the caller graph for this function:

◆ get_iffam_from_hook()

static __inline iffam_p get_iffam_from_hook ( priv_p  priv,
hook_p  hook 
)
static

Definition at line 188 of file ng_gif_demux.c.

References gFamilies, and NUM_FAMILIES.

Referenced by ng_gif_demux_disconnect(), and ng_gif_demux_rcvdata().

Here is the caller graph for this function:

◆ get_iffam_from_name()

static __inline iffam_p get_iffam_from_name ( const char *  name)
static

Definition at line 212 of file ng_gif_demux.c.

References gFamilies, iffam::hookname, name, and NUM_FAMILIES.

Referenced by ng_gif_demux_newhook().

Here is the caller graph for this function:

◆ NETGRAPH_INIT()

NETGRAPH_INIT ( gif_demux  ,
ng_gif_demux_typestruct 
)

◆ ng_gif_demux_constructor()

static int ng_gif_demux_constructor ( node_p  node)
static

Definition at line 233 of file ng_gif_demux.c.

References M_NETGRAPH_GIF_DEMUX, and NG_NODE_SET_PRIVATE.

◆ ng_gif_demux_disconnect()

static int ng_gif_demux_disconnect ( hook_p  hook)
static

Definition at line 383 of file ng_gif_demux.c.

References get_hook_from_iffam(), get_iffam_from_hook(), NG_HOOK_NODE, and NG_NODE_PRIVATE.

Here is the call graph for this function:

◆ ng_gif_demux_newhook()

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

Definition at line 251 of file ng_gif_demux.c.

References get_hook_from_iffam(), get_iffam_from_name(), name, NG_GIF_DEMUX_HOOK_GIF, and NG_NODE_PRIVATE.

Here is the call graph for this function:

◆ ng_gif_demux_rcvdata()

static int ng_gif_demux_rcvdata ( hook_p  hook,
item_p  item 
)
static

◆ ng_gif_demux_rcvmsg()

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

◆ ng_gif_demux_shutdown()

static int ng_gif_demux_shutdown ( node_p  node)
static

Variable Documentation

◆ gFamilies

const struct iffam gFamilies[]
static
Initial value:
= {
{ AF_INET, NG_GIF_DEMUX_HOOK_INET },
{ AF_INET6, NG_GIF_DEMUX_HOOK_INET6 },
{ AF_APPLETALK, NG_GIF_DEMUX_HOOK_ATALK },
{ AF_IPX, NG_GIF_DEMUX_HOOK_IPX },
{ AF_ATM, NG_GIF_DEMUX_HOOK_ATM },
{ AF_NATM, NG_GIF_DEMUX_HOOK_NATM },
}
#define NG_GIF_DEMUX_HOOK_INET6
Definition: ng_gif_demux.h:47
#define NG_GIF_DEMUX_HOOK_NATM
Definition: ng_gif_demux.h:51
#define NG_GIF_DEMUX_HOOK_ATALK
Definition: ng_gif_demux.h:48
#define NG_GIF_DEMUX_HOOK_ATM
Definition: ng_gif_demux.h:50
#define NG_GIF_DEMUX_HOOK_INET
Definition: ng_gif_demux.h:46
#define NG_GIF_DEMUX_HOOK_IPX
Definition: ng_gif_demux.h:49

Definition at line 108 of file ng_gif_demux.c.

Referenced by get_hook_from_iffam(), get_iffam_from_af(), get_iffam_from_hook(), and get_iffam_from_name().

◆ ng_gif_demux_cmdlist

const struct ng_cmdlist ng_gif_demux_cmdlist[]
static
Initial value:
= {
{ 0 }
}

Definition at line 145 of file ng_gif_demux.c.

◆ ng_gif_demux_constructor

ng_constructor_t ng_gif_demux_constructor
static

Definition at line 127 of file ng_gif_demux.c.

◆ ng_gif_demux_disconnect

ng_disconnect_t ng_gif_demux_disconnect
static

Definition at line 132 of file ng_gif_demux.c.

◆ ng_gif_demux_newhook

ng_newhook_t ng_gif_demux_newhook
static

Definition at line 130 of file ng_gif_demux.c.

◆ ng_gif_demux_rcvdata

ng_rcvdata_t ng_gif_demux_rcvdata
static

Definition at line 131 of file ng_gif_demux.c.

◆ ng_gif_demux_rcvmsg

ng_rcvmsg_t ng_gif_demux_rcvmsg
static

Definition at line 128 of file ng_gif_demux.c.

◆ ng_gif_demux_shutdown

ng_shutdown_t ng_gif_demux_shutdown
static

Definition at line 129 of file ng_gif_demux.c.

◆ ng_gif_demux_typestruct

struct ng_type ng_gif_demux_typestruct
static
Initial value:
= {
.version = NG_ABI_VERSION,
.constructor = ng_gif_demux_constructor,
.shutdown = ng_gif_demux_shutdown,
.disconnect = ng_gif_demux_disconnect,
}
#define NG_ABI_VERSION
Definition: netgraph.h:77
static ng_shutdown_t ng_gif_demux_shutdown
Definition: ng_gif_demux.c:129
static ng_newhook_t ng_gif_demux_newhook
Definition: ng_gif_demux.c:130
static const struct ng_cmdlist ng_gif_demux_cmdlist[]
Definition: ng_gif_demux.c:145
static ng_rcvmsg_t ng_gif_demux_rcvmsg
Definition: ng_gif_demux.c:128
static ng_disconnect_t ng_gif_demux_disconnect
Definition: ng_gif_demux.c:132
static ng_rcvdata_t ng_gif_demux_rcvdata
Definition: ng_gif_demux.c:131
static ng_constructor_t ng_gif_demux_constructor
Definition: ng_gif_demux.c:127
#define NG_GIF_DEMUX_NODE_TYPE
Definition: ng_gif_demux.h:41

Definition at line 150 of file ng_gif_demux.c.