#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_inet6.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/eventhandler.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/mbuf.h>
#include <sys/errno.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_var.h>
#include <netinet/in.h>
#include <netinet/ip_var.h>
#include <netinet/ip_encap.h>
Go to the source code of this file.
|
| __FBSDID ("$FreeBSD$") |
|
static | MALLOC_DEFINE (M_NETADDR, "encap_export_host", "Export host address structure") |
|
| CK_LIST_HEAD (encaptab_head, encaptab) |
|
| CK_LIST_HEAD (srcaddrtab_head, srcaddrtab) |
|
| MTX_SYSINIT (encapmtx, &encapmtx, "encapmtx", MTX_DEF) |
|
| MTX_SYSINIT (srcaddrmtx, &srcaddrmtx, "srcaddrmtx", MTX_DEF) |
|
static void | srcaddr_change_event (void *arg __unused, struct ifnet *ifp, struct ifaddr *ifa, int event) |
|
| EVENTHANDLER_DEFINE (ifaddr_event_ext, srcaddr_change_event, NULL, 0) |
|
static struct srcaddrtab * | encap_register_srcaddr (struct srcaddrtab_head *head, encap_srcaddr_t func, void *arg, int mflags) |
|
static int | encap_unregister_srcaddr (struct srcaddrtab_head *head, const struct srcaddrtab *cookie) |
|
static struct encaptab * | encap_attach (struct encaptab_head *head, const struct encap_config *cfg, void *arg, int mflags) |
|
static int | encap_detach (struct encaptab_head *head, const struct encaptab *cookie) |
|
static int | encap_input (struct encaptab_head *head, struct mbuf *m, int off, int proto) |
|
◆ ENCAP_RLOCK
#define ENCAP_RLOCK |
( |
| ) |
NET_EPOCH_ENTER(encap_et) |
◆ ENCAP_RLOCK_TRACKER
#define ENCAP_RLOCK_TRACKER struct epoch_tracker encap_et |
◆ ENCAP_RUNLOCK
#define ENCAP_RUNLOCK |
( |
| ) |
NET_EPOCH_EXIT(encap_et) |
◆ ENCAP_WAIT
#define ENCAP_WAIT |
( |
| ) |
NET_EPOCH_WAIT() |
◆ ENCAP_WLOCK
#define ENCAP_WLOCK |
( |
| ) |
mtx_lock(&encapmtx) |
◆ ENCAP_WUNLOCK
#define ENCAP_WUNLOCK |
( |
| ) |
mtx_unlock(&encapmtx) |
◆ SRCADDR_RLOCK
#define SRCADDR_RLOCK |
( |
| ) |
epoch_enter_preempt(net_epoch_preempt, &srcaddr_et) |
◆ SRCADDR_RLOCK_TRACKER
#define SRCADDR_RLOCK_TRACKER struct epoch_tracker srcaddr_et |
◆ SRCADDR_RUNLOCK
#define SRCADDR_RUNLOCK |
( |
| ) |
epoch_exit_preempt(net_epoch_preempt, &srcaddr_et) |
◆ SRCADDR_WAIT
#define SRCADDR_WAIT |
( |
| ) |
epoch_wait_preempt(net_epoch_preempt) |
◆ SRCADDR_WLOCK
◆ SRCADDR_WUNLOCK
#define SRCADDR_WUNLOCK |
( |
| ) |
mtx_unlock(&srcaddrmtx) |
◆ __FBSDID()
◆ CK_LIST_HEAD() [1/2]
CK_LIST_HEAD |
( |
encaptab_head |
, |
|
|
encaptab |
|
|
) |
| |
◆ CK_LIST_HEAD() [2/2]
◆ encap_attach()
static struct encaptab * encap_attach |
( |
struct encaptab_head * |
head, |
|
|
const struct encap_config * |
cfg, |
|
|
void * |
arg, |
|
|
int |
mflags |
|
) |
| |
|
static |
◆ encap_detach()
static int encap_detach |
( |
struct encaptab_head * |
head, |
|
|
const struct encaptab * |
cookie |
|
) |
| |
|
static |
◆ encap_input()
static int encap_input |
( |
struct encaptab_head * |
head, |
|
|
struct mbuf * |
m, |
|
|
int |
off, |
|
|
int |
proto |
|
) |
| |
|
static |
◆ encap_register_srcaddr()
static struct srcaddrtab * encap_register_srcaddr |
( |
struct srcaddrtab_head * |
head, |
|
|
encap_srcaddr_t |
func, |
|
|
void * |
arg, |
|
|
int |
mflags |
|
) |
| |
|
static |
◆ encap_unregister_srcaddr()
static int encap_unregister_srcaddr |
( |
struct srcaddrtab_head * |
head, |
|
|
const struct srcaddrtab * |
cookie |
|
) |
| |
|
static |
◆ EVENTHANDLER_DEFINE()
◆ MALLOC_DEFINE()
static MALLOC_DEFINE |
( |
M_NETADDR |
, |
|
|
"encap_export_host" |
, |
|
|
"Export host address structure" |
|
|
) |
| |
|
static |
◆ MTX_SYSINIT() [1/2]
MTX_SYSINIT |
( |
encapmtx |
, |
|
|
& |
encapmtx, |
|
|
"encapmtx" |
, |
|
|
MTX_DEF |
|
|
) |
| |
◆ MTX_SYSINIT() [2/2]
MTX_SYSINIT |
( |
srcaddrmtx |
, |
|
|
& |
srcaddrmtx, |
|
|
"srcaddrmtx" |
, |
|
|
MTX_DEF |
|
|
) |
| |
◆ srcaddr_change_event()
static void srcaddr_change_event |
( |
void *arg |
__unused, |
|
|
struct ifnet * |
ifp, |
|
|
struct ifaddr * |
ifa, |
|
|
int |
event |
|
) |
| |
|
static |
◆ srcaddrmtx
struct mtx encapmtx srcaddrmtx |
|
static |