FreeBSD kernel netgraph code
ngatmbase.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/module.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/systm.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/mbuf.h>
#include <machine/stdarg.h>
#include <netnatm/unimsg.h>
#include <netgraph/atm/ngatmbase.h>
Include dependency graph for ngatmbase.c:

Go to the source code of this file.

Data Structures

struct  ngatm_msg
 

Macros

#define NGATMBASE_VERSION   1
 
#define EXTRA   128
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int ngatm_handler (module_t, int, void *)
 
 MODULE_VERSION (ngatmbase, NGATMBASE_VERSION)
 
 DECLARE_MODULE (ngatmbase, ngatm_data, SI_SUB_EXEC, SI_ORDER_ANY)
 
static MALLOC_DEFINE (M_UNIMSG, "unimsg", "uni message buffers")
 
static MALLOC_DEFINE (M_UNIMSGHDR, "unimsghdr", "uni message headers")
 
static void uni_msg_init (void)
 
int uni_msg_extend (struct uni_msg *m, size_t s)
 
int uni_msg_append (struct uni_msg *m, void *buf, size_t size)
 
struct mbuf * uni_msg_pack_mbuf (struct uni_msg *msg, void *hdr, size_t hdrlen)
 
static LIST_HEAD (ngatm_msg)
 
struct uni_msg * uni_msg_alloc (size_t s)
 
void uni_msg_destroy (struct uni_msg *m)
 
struct uni_msg * uni_msg_build (void *ptr,...)
 
int uni_msg_unpack_mbuf (struct mbuf *m, struct uni_msg **pmsg)
 

Variables

static moduledata_t ngatm_data
 
static struct mtx ngatm_unilist_mtx
 

Macro Definition Documentation

◆ EXTRA

#define EXTRA   128

Definition at line 69 of file ngatmbase.c.

◆ NGATMBASE_VERSION

#define NGATMBASE_VERSION   1

Definition at line 49 of file ngatmbase.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ DECLARE_MODULE()

DECLARE_MODULE ( ngatmbase  ,
ngatm_data  ,
SI_SUB_EXEC  ,
SI_ORDER_ANY   
)

◆ LIST_HEAD()

static LIST_HEAD ( ngatm_msg  )
static

Definition at line 328 of file ngatmbase.c.

◆ MALLOC_DEFINE() [1/2]

static MALLOC_DEFINE ( M_UNIMSG  ,
"unimsg"  ,
"uni message buffers"   
)
static

◆ MALLOC_DEFINE() [2/2]

static MALLOC_DEFINE ( M_UNIMSGHDR  ,
"unimsghdr"  ,
"uni message headers"   
)
static

◆ MODULE_VERSION()

MODULE_VERSION ( ngatmbase  ,
NGATMBASE_VERSION   
)

◆ ngatm_handler()

static int ngatm_handler ( module_t  mod,
int  what,
void *  arg 
)
static

Definition at line 481 of file ngatmbase.c.

References uni_msg_init().

Here is the call graph for this function:

◆ uni_msg_alloc()

struct uni_msg * uni_msg_alloc ( size_t  s)

Definition at line 352 of file ngatmbase.c.

References EXTRA, and ngatm_unilist_mtx.

Referenced by uni_msg_build(), and uni_msg_unpack_mbuf().

Here is the caller graph for this function:

◆ uni_msg_append()

int uni_msg_append ( struct uni_msg *  m,
void *  buf,
size_t  size 
)

Definition at line 120 of file ngatmbase.c.

◆ uni_msg_build()

struct uni_msg * uni_msg_build ( void *  ptr,
  ... 
)

Definition at line 411 of file ngatmbase.c.

References uni_msg_alloc().

Here is the call graph for this function:

◆ uni_msg_destroy()

void uni_msg_destroy ( struct uni_msg *  m)

◆ uni_msg_extend()

int uni_msg_extend ( struct uni_msg *  m,
size_t  s 
)

Definition at line 91 of file ngatmbase.c.

References EXTRA, and uni_msg_destroy().

Here is the call graph for this function:

◆ uni_msg_init()

static void uni_msg_init ( void  )
static

Definition at line 78 of file ngatmbase.c.

References ngatm_unilist_mtx.

Referenced by ngatm_handler().

Here is the caller graph for this function:

◆ uni_msg_pack_mbuf()

struct mbuf * uni_msg_pack_mbuf ( struct uni_msg *  msg,
void *  hdr,
size_t  hdrlen 
)

Definition at line 138 of file ngatmbase.c.

References last.

Referenced by ng_ccatm_send_uni(), ng_ccatm_send_uni_glob(), uni_saal_output(), and uni_uni_output().

Here is the caller graph for this function:

◆ uni_msg_unpack_mbuf()

int uni_msg_unpack_mbuf ( struct mbuf *  m,
struct uni_msg **  pmsg 
)

Definition at line 458 of file ngatmbase.c.

References uni_msg_alloc().

Referenced by ng_ccatm_rcvdata(), ng_ccatm_rcvuni(), ng_uni_rcvlower(), and ng_uni_rcvupper().

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

Variable Documentation

◆ ngatm_data

moduledata_t ngatm_data
static
Initial value:
= {
"ngatmbase",
0
}
static int ngatm_handler(module_t, int, void *)
Definition: ngatmbase.c:481

Definition at line 53 of file ngatmbase.c.

◆ ngatm_unilist_mtx

struct mtx ngatm_unilist_mtx
static

Definition at line 72 of file ngatmbase.c.

Referenced by uni_msg_alloc(), uni_msg_destroy(), and uni_msg_init().