FreeBSD kernel netgraph code
ng_sscfu_cust.h File Reference
#include <sys/param.h>
#include <sys/types.h>
#include <sys/kernel.h>
#include <sys/mbuf.h>
#include <sys/queue.h>
#include <sys/callout.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <machine/stdarg.h>
Include dependency graph for ng_sscfu_cust.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MEMINIT()
 
#define MEMZALLOC(PTR, CAST, SIZE)    ((PTR) = (CAST)malloc((SIZE), M_NG_SSCFU, M_NOWAIT | M_ZERO))
 
#define MEMFREE(PTR)    free(PTR, M_NG_SSCFU)
 
#define SIG_ALLOC(PTR)    MEMZALLOC(PTR, struct sscfu_sig *, sizeof(struct sscfu_sig))
 
#define SIG_FREE(PTR)    MEMFREE(PTR)
 
#define SIGQ_INIT(Q)   TAILQ_INIT(Q)
 
#define SIGQ_APPEND(Q, S)   TAILQ_INSERT_TAIL(Q, S, link)
 
#define SIGQ_GET(Q)   ng_sscfu_sigq_get((Q))
 
#define DECL_SIGQ_GET
 
#define SIGQ_CLEAR(Q)
 
#define MBUF_FREE(M)   m_freem(M)
 
#define ASSERT(S)
 

Functions

typedef TAILQ_ENTRY (sscfu_sig) sscfu_sigq_link_t
 
typedef TAILQ_HEAD (sscfu_sigq, sscfu_sig) sscfu_sigq_head_t
 

Macro Definition Documentation

◆ ASSERT

#define ASSERT (   S)

Definition at line 130 of file ng_sscfu_cust.h.

◆ DECL_SIGQ_GET

#define DECL_SIGQ_GET
Value:
static __inline struct sscfu_sig * \
ng_sscfu_sigq_get(struct sscfu_sigq *q) \
{ \
struct sscfu_sig *s; \
\
s = TAILQ_FIRST(q); \
if (s != NULL) \
TAILQ_REMOVE(q, s, link); \
return (s); \
}

Definition at line 95 of file ng_sscfu_cust.h.

◆ MBUF_FREE

#define MBUF_FREE (   M)    m_freem(M)

Definition at line 125 of file ng_sscfu_cust.h.

◆ MEMFREE

#define MEMFREE (   PTR)     free(PTR, M_NG_SSCFU)

Definition at line 57 of file ng_sscfu_cust.h.

◆ MEMINIT

#define MEMINIT ( )
Value:
MALLOC_DECLARE(M_NG_SSCFU); \
DECL_SIGQ_GET
MALLOC_DECLARE(M_NG_CCATM)

Definition at line 51 of file ng_sscfu_cust.h.

◆ MEMZALLOC

#define MEMZALLOC (   PTR,
  CAST,
  SIZE 
)     ((PTR) = (CAST)malloc((SIZE), M_NG_SSCFU, M_NOWAIT | M_ZERO))

Definition at line 55 of file ng_sscfu_cust.h.

◆ SIG_ALLOC

#define SIG_ALLOC (   PTR)     MEMZALLOC(PTR, struct sscfu_sig *, sizeof(struct sscfu_sig))

Definition at line 60 of file ng_sscfu_cust.h.

◆ SIG_FREE

#define SIG_FREE (   PTR)     MEMFREE(PTR)

Definition at line 62 of file ng_sscfu_cust.h.

◆ SIGQ_APPEND

#define SIGQ_APPEND (   Q,
 
)    TAILQ_INSERT_TAIL(Q, S, link)

Definition at line 91 of file ng_sscfu_cust.h.

◆ SIGQ_CLEAR

#define SIGQ_CLEAR (   Q)
Value:
do { \
struct sscfu_sig *_s1, *_s2; \
\
_s1 = TAILQ_FIRST(Q); \
while (_s1 != NULL) { \
_s2 = TAILQ_NEXT(_s1, link); \
if (_s1->m) \
MBUF_FREE(_s1->m); \
SIG_FREE(_s1); \
_s1 = _s2; \
} \
TAILQ_INIT(Q); \
} while (0)

Definition at line 107 of file ng_sscfu_cust.h.

◆ SIGQ_GET

#define SIGQ_GET (   Q)    ng_sscfu_sigq_get((Q))

Definition at line 93 of file ng_sscfu_cust.h.

◆ SIGQ_INIT

#define SIGQ_INIT (   Q)    TAILQ_INIT(Q)

Definition at line 90 of file ng_sscfu_cust.h.

Function Documentation

◆ TAILQ_ENTRY()

typedef TAILQ_ENTRY ( sscfu_sig  )

◆ TAILQ_HEAD()

typedef TAILQ_HEAD ( sscfu_sigq  ,
sscfu_sig   
)