FreeBSD kernel netgraph code
|
#include <sys/param.h>
#include <sys/types.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/mbuf.h>
#include <sys/queue.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
#include <machine/stdarg.h>
#include <netnatm/saal/sscopdef.h>
Go to the source code of this file.
Macros | |
#define | MEMINIT() |
#define | MEMZALLOC(PTR, CAST, SIZE) ((PTR) = (CAST)malloc((SIZE), M_NG_SSCOP, M_NOWAIT | M_ZERO)) |
#define | MEMFREE(PTR) free((PTR), M_NG_SSCOP) |
#define | MSG_ALLOC(PTR) MEMZALLOC(PTR, struct sscop_msg *, sizeof(struct sscop_msg)) |
#define | MSG_FREE(PTR) MEMFREE(PTR) |
#define | SIG_ALLOC(PTR) MEMZALLOC(PTR, struct sscop_sig *, sizeof(struct sscop_sig)) |
#define | SIG_FREE(PTR) MEMFREE(PTR) |
#define | TIMER_INIT(S, T) ng_callout_init(&(S)->t_##T) |
#define | TIMER_STOP(S, T) |
#define | TIMER_RESTART(S, T) |
#define | TIMER_ISACT(S, T) (callout_pending(&(S)->t_##T)) |
#define | TIMER_FUNC(T, N) |
#define | MSGQ_EMPTY(Q) TAILQ_EMPTY(Q) |
#define | MSGQ_INIT(Q) TAILQ_INIT(Q) |
#define | MSGQ_FOREACH(P, Q) TAILQ_FOREACH(P, Q, link) |
#define | MSGQ_REMOVE(Q, M) TAILQ_REMOVE(Q, M, link) |
#define | MSGQ_INSERT_BEFORE(B, M) TAILQ_INSERT_BEFORE(B, M, link) |
#define | MSGQ_APPEND(Q, M) TAILQ_INSERT_TAIL(Q, M, link) |
#define | MSGQ_PEEK(Q) TAILQ_FIRST((Q)) |
#define | MSGQ_GET(Q) ng_sscop_msgq_get((Q)) |
#define | DECL_MSGQ_GET |
#define | MSGQ_CLEAR(Q) |
#define | SIGQ_INIT(Q) TAILQ_INIT(Q) |
#define | SIGQ_APPEND(Q, S) TAILQ_INSERT_TAIL(Q, S, link) |
#define | SIGQ_EMPTY(Q) TAILQ_EMPTY(Q) |
#define | SIGQ_GET(Q) ng_sscop_sigq_get((Q)) |
#define | DECL_SIGQ_GET |
#define | SIGQ_MOVE(F, T) |
#define | SIGQ_PREPEND(F, T) |
#define | SIGQ_CLEAR(Q) |
#define | MBUF_FREE(M) do { if ((M)) m_freem((M)); } while(0) |
#define | MBUF_DUP(M) m_copypacket((M), M_NOWAIT) |
#define | MBUF_LEN(M) ((size_t)(M)->m_pkthdr.len) |
#define | MBUF_TRAIL32(M, I) ng_sscop_mbuf_trail32((M), (I)) |
#define | MBUF_STRIP32(M) ng_sscop_mbuf_strip32((M)) |
#define | MBUF_GET32(M) ng_sscop_mbuf_get32((M)) |
#define | MBUF_APPEND32(M, W) |
#define | MBUF_PAD4(M) ng_sscop_mbuf_pad4((M)) |
#define | MBUF_UNPAD(M, P) do { if( (P) > 0) m_adj((M), -(P)); } while (0) |
#define | MBUF_ALLOC(N) ng_sscop_mbuf_alloc((N)) |
#define | DECL_MBUF_ALLOC |
#define | ASSERT(X) |
Typedefs | |
typedef struct callout | sscop_timer_t |
Functions | |
typedef | TAILQ_ENTRY (sscop_msg) sscop_msgq_link_t |
typedef | TAILQ_HEAD (sscop_msgq, sscop_msg) sscop_msgq_head_t |
typedef | TAILQ_ENTRY (sscop_sig) sscop_sigq_link_t |
typedef | TAILQ_HEAD (sscop_sigq, sscop_sig) sscop_sigq_head_t |
static uint32_t __inline | ng_sscop_mbuf_trail32 (const struct mbuf *m, int i) |
static uint32_t __inline | ng_sscop_mbuf_strip32 (struct mbuf *m) |
static uint32_t __inline | ng_sscop_mbuf_get32 (struct mbuf *m) |
static u_int __inline | ng_sscop_mbuf_pad4 (struct mbuf *m) |
#define ASSERT | ( | X | ) |
Definition at line 343 of file ng_sscop_cust.h.
#define DECL_MBUF_ALLOC |
Definition at line 320 of file ng_sscop_cust.h.
#define DECL_MSGQ_GET |
Definition at line 151 of file ng_sscop_cust.h.
#define DECL_SIGQ_GET |
Definition at line 186 of file ng_sscop_cust.h.
#define MBUF_ALLOC | ( | N | ) | ng_sscop_mbuf_alloc((N)) |
Definition at line 318 of file ng_sscop_cust.h.
#define MBUF_APPEND32 | ( | M, | |
W | |||
) |
Definition at line 287 of file ng_sscop_cust.h.
#define MBUF_DUP | ( | M | ) | m_copypacket((M), M_NOWAIT) |
Definition at line 238 of file ng_sscop_cust.h.
#define MBUF_FREE | ( | M | ) | do { if ((M)) m_freem((M)); } while(0) |
Definition at line 237 of file ng_sscop_cust.h.
#define MBUF_GET32 | ( | M | ) | ng_sscop_mbuf_get32((M)) |
Definition at line 272 of file ng_sscop_cust.h.
#define MBUF_LEN | ( | M | ) | ((size_t)(M)->m_pkthdr.len) |
Definition at line 239 of file ng_sscop_cust.h.
#define MBUF_PAD4 | ( | M | ) | ng_sscop_mbuf_pad4((M)) |
Definition at line 299 of file ng_sscop_cust.h.
#define MBUF_STRIP32 | ( | M | ) | ng_sscop_mbuf_strip32((M)) |
Definition at line 260 of file ng_sscop_cust.h.
#define MBUF_TRAIL32 | ( | M, | |
I | |||
) | ng_sscop_mbuf_trail32((M), (I)) |
Definition at line 246 of file ng_sscop_cust.h.
#define MBUF_UNPAD | ( | M, | |
P | |||
) | do { if( (P) > 0) m_adj((M), -(P)); } while (0) |
Definition at line 313 of file ng_sscop_cust.h.
#define MEMFREE | ( | PTR | ) | free((PTR), M_NG_SSCOP) |
Definition at line 65 of file ng_sscop_cust.h.
#define MEMINIT | ( | ) |
Definition at line 57 of file ng_sscop_cust.h.
#define MEMZALLOC | ( | PTR, | |
CAST, | |||
SIZE | |||
) | ((PTR) = (CAST)malloc((SIZE), M_NG_SSCOP, M_NOWAIT | M_ZERO)) |
Definition at line 63 of file ng_sscop_cust.h.
#define MSG_ALLOC | ( | PTR | ) | MEMZALLOC(PTR, struct sscop_msg *, sizeof(struct sscop_msg)) |
Definition at line 68 of file ng_sscop_cust.h.
#define MSG_FREE | ( | PTR | ) | MEMFREE(PTR) |
Definition at line 70 of file ng_sscop_cust.h.
#define MSGQ_APPEND | ( | Q, | |
M | |||
) | TAILQ_INSERT_TAIL(Q, M, link) |
Definition at line 146 of file ng_sscop_cust.h.
#define MSGQ_CLEAR | ( | Q | ) |
Definition at line 163 of file ng_sscop_cust.h.
#define MSGQ_EMPTY | ( | Q | ) | TAILQ_EMPTY(Q) |
Definition at line 141 of file ng_sscop_cust.h.
#define MSGQ_FOREACH | ( | P, | |
Q | |||
) | TAILQ_FOREACH(P, Q, link) |
Definition at line 143 of file ng_sscop_cust.h.
#define MSGQ_GET | ( | Q | ) | ng_sscop_msgq_get((Q)) |
Definition at line 149 of file ng_sscop_cust.h.
#define MSGQ_INIT | ( | Q | ) | TAILQ_INIT(Q) |
Definition at line 142 of file ng_sscop_cust.h.
#define MSGQ_INSERT_BEFORE | ( | B, | |
M | |||
) | TAILQ_INSERT_BEFORE(B, M, link) |
Definition at line 145 of file ng_sscop_cust.h.
#define MSGQ_PEEK | ( | Q | ) | TAILQ_FIRST((Q)) |
Definition at line 147 of file ng_sscop_cust.h.
#define MSGQ_REMOVE | ( | Q, | |
M | |||
) | TAILQ_REMOVE(Q, M, link) |
Definition at line 144 of file ng_sscop_cust.h.
#define SIG_ALLOC | ( | PTR | ) | MEMZALLOC(PTR, struct sscop_sig *, sizeof(struct sscop_sig)) |
Definition at line 73 of file ng_sscop_cust.h.
#define SIG_FREE | ( | PTR | ) | MEMFREE(PTR) |
Definition at line 75 of file ng_sscop_cust.h.
#define SIGQ_APPEND | ( | Q, | |
S | |||
) | TAILQ_INSERT_TAIL(Q, S, link) |
Definition at line 182 of file ng_sscop_cust.h.
#define SIGQ_CLEAR | ( | Q | ) |
Definition at line 220 of file ng_sscop_cust.h.
#define SIGQ_EMPTY | ( | Q | ) | TAILQ_EMPTY(Q) |
Definition at line 183 of file ng_sscop_cust.h.
#define SIGQ_GET | ( | Q | ) | ng_sscop_sigq_get((Q)) |
Definition at line 185 of file ng_sscop_cust.h.
#define SIGQ_INIT | ( | Q | ) | TAILQ_INIT(Q) |
Definition at line 181 of file ng_sscop_cust.h.
#define SIGQ_MOVE | ( | F, | |
T | |||
) |
Definition at line 198 of file ng_sscop_cust.h.
#define SIGQ_PREPEND | ( | F, | |
T | |||
) |
Definition at line 209 of file ng_sscop_cust.h.
#define TIMER_FUNC | ( | T, | |
N | |||
) |
Definition at line 125 of file ng_sscop_cust.h.
#define TIMER_INIT | ( | S, | |
T | |||
) | ng_callout_init(&(S)->t_##T) |
Definition at line 111 of file ng_sscop_cust.h.
#define TIMER_ISACT | ( | S, | |
T | |||
) | (callout_pending(&(S)->t_##T)) |
Definition at line 120 of file ng_sscop_cust.h.
#define TIMER_RESTART | ( | S, | |
T | |||
) |
Definition at line 115 of file ng_sscop_cust.h.
#define TIMER_STOP | ( | S, | |
T | |||
) |
Definition at line 112 of file ng_sscop_cust.h.
typedef struct callout sscop_timer_t |
Definition at line 110 of file ng_sscop_cust.h.
|
static |
Definition at line 275 of file ng_sscop_cust.h.
|
static |
Definition at line 302 of file ng_sscop_cust.h.
References pad.
|
static |
Definition at line 263 of file ng_sscop_cust.h.
|
static |
Definition at line 249 of file ng_sscop_cust.h.
typedef TAILQ_ENTRY | ( | sscop_msg | ) |
typedef TAILQ_ENTRY | ( | sscop_sig | ) |
typedef TAILQ_HEAD | ( | sscop_msgq | , |
sscop_msg | |||
) |
typedef TAILQ_HEAD | ( | sscop_sigq | , |
sscop_sig | |||
) |