FreeBSD kernel kern code
subr_mchain.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysctl.h>
#include <sys/endian.h>
#include <sys/errno.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/module.h>
#include <sys/uio.h>
#include <sys/mchain.h>
Include dependency graph for subr_mchain.c:

Go to the source code of this file.

Macros

#define MBERROR(format, ...)
 
#define MBPANIC(format, ...)
 

Functions

 __FBSDID ("$FreeBSD$")
 
 FEATURE (libmchain, "mchain library")
 
 MODULE_VERSION (libmchain, 1)
 
int mb_init (struct mbchain *mbp)
 
void mb_initm (struct mbchain *mbp, struct mbuf *m)
 
void mb_done (struct mbchain *mbp)
 
struct mbuf * mb_detach (struct mbchain *mbp)
 
int mb_fixhdr (struct mbchain *mbp)
 
caddr_t mb_reserve (struct mbchain *mbp, int size)
 
int mb_put_padbyte (struct mbchain *mbp)
 
int mb_put_uint8 (struct mbchain *mbp, uint8_t x)
 
int mb_put_uint16be (struct mbchain *mbp, uint16_t x)
 
int mb_put_uint16le (struct mbchain *mbp, uint16_t x)
 
int mb_put_uint32be (struct mbchain *mbp, uint32_t x)
 
int mb_put_uint32le (struct mbchain *mbp, uint32_t x)
 
int mb_put_int64be (struct mbchain *mbp, int64_t x)
 
int mb_put_int64le (struct mbchain *mbp, int64_t x)
 
int mb_put_mem (struct mbchain *mbp, c_caddr_t source, int size, int type)
 
int mb_put_mbuf (struct mbchain *mbp, struct mbuf *m)
 
int mb_put_uio (struct mbchain *mbp, struct uio *uiop, int size)
 
int md_init (struct mdchain *mdp)
 
void md_initm (struct mdchain *mdp, struct mbuf *m)
 
void md_done (struct mdchain *mdp)
 
void md_append_record (struct mdchain *mdp, struct mbuf *top)
 
int md_next_record (struct mdchain *mdp)
 
int md_get_uint8 (struct mdchain *mdp, uint8_t *x)
 
int md_get_uint16 (struct mdchain *mdp, uint16_t *x)
 
int md_get_uint16le (struct mdchain *mdp, uint16_t *x)
 
int md_get_uint16be (struct mdchain *mdp, uint16_t *x)
 
int md_get_uint32 (struct mdchain *mdp, uint32_t *x)
 
int md_get_uint32be (struct mdchain *mdp, uint32_t *x)
 
int md_get_uint32le (struct mdchain *mdp, uint32_t *x)
 
int md_get_int64 (struct mdchain *mdp, int64_t *x)
 
int md_get_int64be (struct mdchain *mdp, int64_t *x)
 
int md_get_int64le (struct mdchain *mdp, int64_t *x)
 
int md_get_mem (struct mdchain *mdp, caddr_t target, int size, int type)
 
int md_get_mbuf (struct mdchain *mdp, int size, struct mbuf **ret)
 
int md_get_uio (struct mdchain *mdp, struct uio *uiop, int size)
 

Macro Definition Documentation

◆ MBERROR

#define MBERROR (   format,
  ... 
)
Value:
printf("%s(%d): "format, __func__ , \
__LINE__ , ## __VA_ARGS__)
int printf(const char *fmt,...)
Definition: subr_prf.c:397

Definition at line 51 of file subr_mchain.c.

◆ MBPANIC

#define MBPANIC (   format,
  ... 
)
Value:
printf("%s(%d): "format, __func__ , \
__LINE__ , ## __VA_ARGS__)

Definition at line 54 of file subr_mchain.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ FEATURE()

FEATURE ( libmchain  ,
"mchain library"   
)

◆ mb_detach()

struct mbuf * mb_detach ( struct mbchain *  mbp)

Definition at line 89 of file subr_mchain.c.

◆ mb_done()

void mb_done ( struct mbchain *  mbp)

Definition at line 80 of file subr_mchain.c.

References m_freem().

Here is the call graph for this function:

◆ mb_fixhdr()

int mb_fixhdr ( struct mbchain *  mbp)

Definition at line 99 of file subr_mchain.c.

References m_fixhdr().

Here is the call graph for this function:

◆ mb_init()

int mb_init ( struct mbchain *  mbp)

Definition at line 61 of file subr_mchain.c.

References mb_initm().

Here is the call graph for this function:

◆ mb_initm()

void mb_initm ( struct mbchain *  mbp,
struct mbuf *  m 
)

Definition at line 72 of file subr_mchain.c.

Referenced by mb_init().

Here is the caller graph for this function:

◆ mb_put_int64be()

int mb_put_int64be ( struct mbchain *  mbp,
int64_t  x 
)

Definition at line 183 of file subr_mchain.c.

References mb_put_mem().

Here is the call graph for this function:

◆ mb_put_int64le()

int mb_put_int64le ( struct mbchain *  mbp,
int64_t  x 
)

Definition at line 190 of file subr_mchain.c.

References mb_put_mem().

Here is the call graph for this function:

◆ mb_put_mbuf()

int mb_put_mbuf ( struct mbchain *  mbp,
struct mbuf *  m 
)

Definition at line 256 of file subr_mchain.c.

◆ mb_put_mem()

int mb_put_mem ( struct mbchain *  mbp,
c_caddr_t  source,
int  size,
int  type 
)

Definition at line 197 of file subr_mchain.c.

References count, src, and type.

Referenced by mb_put_int64be(), mb_put_int64le(), mb_put_padbyte(), mb_put_uint16be(), mb_put_uint16le(), mb_put_uint32be(), mb_put_uint32le(), mb_put_uint8(), and mb_put_uio().

Here is the caller graph for this function:

◆ mb_put_padbyte()

int mb_put_padbyte ( struct mbchain *  mbp)

Definition at line 134 of file subr_mchain.c.

References mb_put_mem().

Here is the call graph for this function:

◆ mb_put_uint16be()

int mb_put_uint16be ( struct mbchain *  mbp,
uint16_t  x 
)

Definition at line 155 of file subr_mchain.c.

References mb_put_mem().

Here is the call graph for this function:

◆ mb_put_uint16le()

int mb_put_uint16le ( struct mbchain *  mbp,
uint16_t  x 
)

Definition at line 162 of file subr_mchain.c.

References mb_put_mem().

Here is the call graph for this function:

◆ mb_put_uint32be()

int mb_put_uint32be ( struct mbchain *  mbp,
uint32_t  x 
)

Definition at line 169 of file subr_mchain.c.

References mb_put_mem().

Here is the call graph for this function:

◆ mb_put_uint32le()

int mb_put_uint32le ( struct mbchain *  mbp,
uint32_t  x 
)

Definition at line 176 of file subr_mchain.c.

References mb_put_mem().

Here is the call graph for this function:

◆ mb_put_uint8()

int mb_put_uint8 ( struct mbchain *  mbp,
uint8_t  x 
)

Definition at line 149 of file subr_mchain.c.

References mb_put_mem().

Here is the call graph for this function:

◆ mb_put_uio()

int mb_put_uio ( struct mbchain *  mbp,
struct uio *  uiop,
int  size 
)

Definition at line 274 of file subr_mchain.c.

References mb_put_mem().

Here is the call graph for this function:

◆ mb_reserve()

caddr_t mb_reserve ( struct mbchain *  mbp,
int  size 
)

Definition at line 111 of file subr_mchain.c.

References panic().

Here is the call graph for this function:

◆ md_append_record()

void md_append_record ( struct mdchain *  mdp,
struct mbuf *  top 
)

Definition at line 341 of file subr_mchain.c.

References md_initm().

Here is the call graph for this function:

◆ md_done()

void md_done ( struct mdchain *  mdp)

Definition at line 328 of file subr_mchain.c.

References m_freem().

Referenced by md_next_record().

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

◆ md_get_int64()

int md_get_int64 ( struct mdchain *  mdp,
int64_t *  x 
)

Definition at line 440 of file subr_mchain.c.

References md_get_mem().

Referenced by md_get_int64be(), and md_get_int64le().

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

◆ md_get_int64be()

int md_get_int64be ( struct mdchain *  mdp,
int64_t *  x 
)

Definition at line 446 of file subr_mchain.c.

References md_get_int64().

Here is the call graph for this function:

◆ md_get_int64le()

int md_get_int64le ( struct mdchain *  mdp,
int64_t *  x 
)

Definition at line 458 of file subr_mchain.c.

References md_get_int64().

Here is the call graph for this function:

◆ md_get_mbuf()

int md_get_mbuf ( struct mdchain *  mdp,
int  size,
struct mbuf **  ret 
)

Definition at line 516 of file subr_mchain.c.

References m_copym(), and md_get_mem().

Here is the call graph for this function:

◆ md_get_mem()

int md_get_mem ( struct mdchain *  mdp,
caddr_t  target,
int  size,
int  type 
)

Definition at line 470 of file subr_mchain.c.

References count, MBERROR, and type.

Referenced by md_get_int64(), md_get_mbuf(), md_get_uint16(), md_get_uint32(), md_get_uint8(), and md_get_uio().

Here is the caller graph for this function:

◆ md_get_uint16()

int md_get_uint16 ( struct mdchain *  mdp,
uint16_t *  x 
)

Definition at line 382 of file subr_mchain.c.

References md_get_mem().

Referenced by md_get_uint16be(), and md_get_uint16le().

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

◆ md_get_uint16be()

int md_get_uint16be ( struct mdchain *  mdp,
uint16_t *  x 
)

Definition at line 399 of file subr_mchain.c.

References md_get_uint16().

Here is the call graph for this function:

◆ md_get_uint16le()

int md_get_uint16le ( struct mdchain *  mdp,
uint16_t *  x 
)

Definition at line 388 of file subr_mchain.c.

References md_get_uint16().

Here is the call graph for this function:

◆ md_get_uint32()

int md_get_uint32 ( struct mdchain *  mdp,
uint32_t *  x 
)

Definition at line 410 of file subr_mchain.c.

References md_get_mem().

Referenced by md_get_uint32be(), and md_get_uint32le().

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

◆ md_get_uint32be()

int md_get_uint32be ( struct mdchain *  mdp,
uint32_t *  x 
)

Definition at line 416 of file subr_mchain.c.

References md_get_uint32().

Here is the call graph for this function:

◆ md_get_uint32le()

int md_get_uint32le ( struct mdchain *  mdp,
uint32_t *  x 
)

Definition at line 428 of file subr_mchain.c.

References md_get_uint32().

Here is the call graph for this function:

◆ md_get_uint8()

int md_get_uint8 ( struct mdchain *  mdp,
uint8_t *  x 
)

Definition at line 376 of file subr_mchain.c.

References md_get_mem().

Here is the call graph for this function:

◆ md_get_uio()

int md_get_uio ( struct mdchain *  mdp,
struct uio *  uiop,
int  size 
)

Definition at line 527 of file subr_mchain.c.

References md_get_mem().

Here is the call graph for this function:

◆ md_init()

int md_init ( struct mdchain *  mdp)

Definition at line 309 of file subr_mchain.c.

References md_initm().

Here is the call graph for this function:

◆ md_initm()

void md_initm ( struct mdchain *  mdp,
struct mbuf *  m 
)

Definition at line 320 of file subr_mchain.c.

Referenced by md_append_record(), md_init(), and md_next_record().

Here is the caller graph for this function:

◆ md_next_record()

int md_next_record ( struct mdchain *  mdp)

Definition at line 361 of file subr_mchain.c.

References md_done(), and md_initm().

Here is the call graph for this function:

◆ MODULE_VERSION()

MODULE_VERSION ( libmchain  ,
 
)