mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 01:19:20 +08:00
Added empty/defaulted prison methods to for linking RealTek Nic.
This commit is contained in:
parent
334957baa1
commit
55fbb18365
@ -90,8 +90,117 @@ struct prison prison0 = {
|
|||||||
};
|
};
|
||||||
MTX_SYSINIT(prison0, &prison0.pr_mtx, "jail mutex", MTX_DEF);
|
MTX_SYSINIT(prison0, &prison0.pr_mtx, "jail mutex", MTX_DEF);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* See if a prison has the specific flag set.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
prison_flag(struct ucred *cred, unsigned flag)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* This is an atomic read, so no locking is necessary. */
|
||||||
|
return (cred->cr_prison->pr_flags & flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void prison_free(struct prison *pr) {}
|
void prison_free(struct prison *pr) {}
|
||||||
void prison_hold(struct prison *pr) {}
|
void prison_hold(struct prison *pr) {}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if given address belongs to the jail referenced by cred (wrapper to
|
||||||
|
* prison_check_ip[46]).
|
||||||
|
*
|
||||||
|
* Returns 0 if jail doesn't restrict the address family or if address belongs
|
||||||
|
* to jail, EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if
|
||||||
|
* the jail doesn't allow the address family. IPv4 Address passed in in NBO.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
prison_if(struct ucred *cred, struct sockaddr *sa)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Return 1 if we should do proper source address selection or are not jailed.
|
||||||
|
* We will return 0 if we should bypass source address selection in favour
|
||||||
|
* of the primary jail IPv6 address. Only in this case *ia will be updated and
|
||||||
|
* returned in NBO.
|
||||||
|
* Return EAFNOSUPPORT, in case this jail does not allow IPv6.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
prison_saddrsel_ip6(struct ucred *cred, struct in6_addr *ia6)
|
||||||
|
{
|
||||||
|
return EAFNOSUPPORT;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Return true if pr1 and pr2 have the same IPv4 address restrictions.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
prison_equal_ip4(struct prison *pr1, struct prison *pr2)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
prison_check_ip6(struct ucred *cred, struct in6_addr *ia6)
|
||||||
|
{
|
||||||
|
return EAFNOSUPPORT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Make sure our (source) address is set to something meaningful to this
|
||||||
|
* jail.
|
||||||
|
*
|
||||||
|
* Returns 0 if jail doesn't restrict IPv4 or if address belongs to jail,
|
||||||
|
* EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if the jail
|
||||||
|
* doesn't allow IPv4. Address passed in in NBO and returned in NBO.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
prison_local_ip4(struct ucred *cred, struct in_addr *ia)
|
||||||
|
{
|
||||||
|
return EAFNOSUPPORT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Rewrite destination address in case we will connect to loopback address.
|
||||||
|
*
|
||||||
|
* Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv4.
|
||||||
|
* Address passed in in NBO and returned in NBO.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
prison_remote_ip4(struct ucred *cred, struct in_addr *ia)
|
||||||
|
{
|
||||||
|
return EAFNOSUPPORT;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Return true if pr1 and pr2 have the same IPv6 address restrictions.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
prison_equal_ip6(struct prison *pr1, struct prison *pr2)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Make sure our (source) address is set to something meaningful to this jail.
|
||||||
|
*
|
||||||
|
* v6only should be set based on (inp->inp_flags & IN6P_IPV6_V6ONLY != 0)
|
||||||
|
* when needed while binding.
|
||||||
|
*
|
||||||
|
* Returns 0 if jail doesn't restrict IPv6 or if address belongs to jail,
|
||||||
|
* EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if the jail
|
||||||
|
* doesn't allow IPv6.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
prison_local_ip6(struct ucred *cred, struct in6_addr *ia6, int v6only)
|
||||||
|
{
|
||||||
|
return EAFNOSUPPORT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Rewrite destination address in case we will connect to loopback address.
|
||||||
|
*
|
||||||
|
* Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv6.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
prison_remote_ip6(struct ucred *cred, struct in6_addr *ia6)
|
||||||
|
{
|
||||||
|
return EAFNOSUPPORT;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user