FreeBSD kernel IPv4 code
in_jail.c File Reference
#include <sys/cdefs.h>
#include "opt_ddb.h"
#include "opt_inet.h"
#include "opt_inet6.h"
#include <sys/param.h>
#include <sys/types.h>
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/errno.h>
#include <sys/sysproto.h>
#include <sys/malloc.h>
#include <sys/osd.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/taskqueue.h>
#include <sys/fcntl.h>
#include <sys/jail.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/racct.h>
#include <sys/refcount.h>
#include <sys/sx.h>
#include <sys/sysent.h>
#include <sys/namei.h>
#include <sys/mount.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
#include <sys/vnode.h>
#include <net/if.h>
#include <net/vnet.h>
#include <netinet/in.h>
Include dependency graph for in_jail.c:

Go to the source code of this file.

Functions

 __FBSDID ("$FreeBSD$")
 
static in_addr_t prison_primary_ip4 (const struct prison *pr)
 
int prison_qcmp_v4 (const void *ip1, const void *ip2)
 
bool prison_valid_v4 (const void *ip)
 
int prison_get_ip4 (struct ucred *cred, struct in_addr *ia)
 
int prison_saddrsel_ip4 (struct ucred *cred, struct in_addr *ia)
 
int prison_equal_ip4 (struct prison *pr1, struct prison *pr2)
 
int prison_local_ip4 (struct ucred *cred, struct in_addr *ia)
 
int prison_remote_ip4 (struct ucred *cred, struct in_addr *ia)
 
int prison_check_ip4_locked (const struct prison *pr, const struct in_addr *ia)
 
int prison_check_ip4 (const struct ucred *cred, const struct in_addr *ia)
 

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ prison_check_ip4()

◆ prison_check_ip4_locked()

int prison_check_ip4_locked ( const struct prison *  pr,
const struct in_addr ia 
)

Definition at line 312 of file in_jail.c.

Referenced by prison_check_ip4(), prison_local_ip4(), and prison_remote_ip4().

Here is the caller graph for this function:

◆ prison_equal_ip4()

int prison_equal_ip4 ( struct prison *  pr1,
struct prison *  pr2 
)

Definition at line 186 of file in_jail.c.

◆ prison_get_ip4()

int prison_get_ip4 ( struct ucred *  cred,
struct in_addr ia 
)

Definition at line 122 of file in_jail.c.

References prison_primary_ip4(), and in_addr::s_addr.

Referenced by prison_saddrsel_ip4().

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

◆ prison_local_ip4()

int prison_local_ip4 ( struct ucred *  cred,
struct in_addr ia 
)

Definition at line 220 of file in_jail.c.

References INADDR_ANY, prison_check_ip4_locked(), prison_primary_ip4(), and in_addr::s_addr.

Referenced by sctp_inpcb_bind_locked(), and sctp_setopt().

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

◆ prison_primary_ip4()

static in_addr_t prison_primary_ip4 ( const struct prison *  pr)
static

Definition at line 69 of file in_jail.c.

References s_addr.

Referenced by prison_get_ip4(), prison_local_ip4(), and prison_remote_ip4().

Here is the caller graph for this function:

◆ prison_qcmp_v4()

int prison_qcmp_v4 ( const void *  ip1,
const void *  ip2 
)

Definition at line 76 of file in_jail.c.

References s_addr.

◆ prison_remote_ip4()

int prison_remote_ip4 ( struct ucred *  cred,
struct in_addr ia 
)

Definition at line 271 of file in_jail.c.

References prison_check_ip4_locked(), prison_primary_ip4(), and in_addr::s_addr.

Referenced by tcp_usr_send().

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

◆ prison_saddrsel_ip4()

int prison_saddrsel_ip4 ( struct ucred *  cred,
struct in_addr ia 
)

Definition at line 155 of file in_jail.c.

References INADDR_ANY, prison_get_ip4(), and in_addr::s_addr.

Here is the call graph for this function:

◆ prison_valid_v4()

bool prison_valid_v4 ( const void *  ip)

Definition at line 101 of file in_jail.c.

References INADDR_ANY, and INADDR_BROADCAST.