Sponsored by:	Rubicon Communications, LLC (netgate.com)
This commit is contained in:
Glen Barber 2020-07-31 19:37:45 +00:00
commit c7aa572cac
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/release-git/; revision=363741
555 changed files with 19461 additions and 14824 deletions

View File

@ -36,6 +36,14 @@
# xargs -n1 | sort | uniq -d;
# done
# 20200729: remove long expired serial drivers
OLD_FILES+=usr/share/man/man4/cy.4.gz
OLD_FILES+=usr/share/man/man4/rc.4.gz
OLD_FILES+=usr/share/man/man4/rp.4.gz
# 20200715: rework of devstat(9) man page
OLD_FILES+=usr/share/man/man9/devstat_add_entry.9.gz
# 20200714: update byacc to 20200330
OLD_FILES+=usr/tests/usr.bin/yacc/btyacc_calc1.y
OLD_FILES+=usr/tests/usr.bin/yacc/btyacc_demo.y

View File

@ -10,6 +10,10 @@ newline. Entries should be separated by a newline.
Changes to this file should not be MFCed.
r363679:
Applications using regex(3), e.g. sed/grep, will no longer accept
redundant escapes for most ordinary characters.
r363253:
SCTP support has been removed from GENERIC kernel configurations.
The SCTP stack is now built as sctp.ko and can be dynamically loaded.

View File

@ -26,6 +26,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
20200729:
r363679 has redefined some undefined behavior in regcomp(3); notably,
extraneous escapes of most ordinary characters will no longer be
accepted. An exp-run has identified all of the problems with this in
ports, but other non-ports software may need extra escapes removed to
continue to function.
Because of this change, installworld may encounter the following error
from rtld: Undefined symbol "regcomp@FBSD_1.6" -- It is imperative that
you do not halt installworld. Instead, let it run to completion (whether
successful or not) and run installworld once more.
20200627:
A new implementation of bc and dc has been imorted in r362681. This
implementation corrects non-conformant behavior of the previous bc

View File

@ -1144,7 +1144,7 @@ find_element(char *voltag, uint16_t *et, uint16_t *eu)
/*
* Now search the list the specified <voltag>
*/
for (elem = 0; elem <= total_elem; ++elem) {
for (elem = 0; elem < total_elem; ++elem) {
ces = &ch_ces[elem];

View File

@ -1264,6 +1264,7 @@ fmt(char **(*fn)(kvm_t *, const struct kinfo_proc *, int), KINFO *ki,
static void
saveuser(KINFO *ki)
{
char tdname[COMMLEN + 1];
char *argsp;
if (ki->ki_p->ki_flag & P_INMEM) {
@ -1280,12 +1281,14 @@ saveuser(KINFO *ki)
* save arguments if needed
*/
if (needcomm) {
if (ki->ki_p->ki_stat == SZOMB)
if (ki->ki_p->ki_stat == SZOMB) {
ki->ki_args = strdup("<defunct>");
else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL))
} else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL)) {
(void)snprintf(tdname, sizeof(tdname), "%s%s",
ki->ki_p->ki_tdname, ki->ki_p->ki_moretdname);
ki->ki_args = fmt(kvm_getargv, ki,
ki->ki_p->ki_comm, ki->ki_p->ki_tdname, MAXCOMLEN);
else {
ki->ki_p->ki_comm, tdname, COMMLEN * 2 + 1);
} else {
asprintf(&argsp, "(%s)", ki->ki_p->ki_comm);
ki->ki_args = argsp;
}

View File

@ -228,6 +228,10 @@ cmdloop(int top)
}
}
popstackmark(&smark);
if (top && iflag) {
out2c('\n');
flushout(out2);
}
}

View File

@ -134,7 +134,7 @@
.Op Fl gLP
.Op Ar pool
.Ar ...
.Op Ar inverval Op Ar count
.Op Ar interval Op Ar count
.Nm
.Cm labelclear
.Op Fl f
@ -146,7 +146,7 @@
.Op Fl T Cm d Ns | Ns Cm u
.Op Ar pool
.Ar ...
.Op Ar inverval Op Ar count
.Op Ar interval Op Ar count
.Nm
.Cm offline
.Op Fl t
@ -1654,7 +1654,7 @@ Treat exported or foreign devices as inactive.
.Op Fl T Cm d Ns | Ns Cm u
.Op Ar pool
.Ar ...
.Op Ar inverval Op Ar count
.Op Ar interval Op Ar count
.Xc
.Pp
Lists the given pools along with a health status and space usage. If no

View File

@ -6226,24 +6226,12 @@ typedef struct hist_cbdata {
boolean_t internal;
} hist_cbdata_t;
/*
* Print out the command history for a specific pool.
*/
static int
get_history_one(zpool_handle_t *zhp, void *data)
static void
print_history_records(nvlist_t *nvhis, hist_cbdata_t *cb)
{
nvlist_t *nvhis;
nvlist_t **records;
uint_t numrecords;
int ret, i;
hist_cbdata_t *cb = (hist_cbdata_t *)data;
cb->first = B_FALSE;
(void) printf(gettext("History for '%s':\n"), zpool_get_name(zhp));
if ((ret = zpool_get_history(zhp, &nvhis)) != 0)
return (ret);
int i;
verify(nvlist_lookup_nvlist_array(nvhis, ZPOOL_HIST_RECORD,
&records, &numrecords) == 0);
@ -6344,8 +6332,32 @@ get_history_one(zpool_handle_t *zhp, void *data)
(void) printf("]");
(void) printf("\n");
}
}
/*
* Print out the command history for a specific pool.
*/
static int
get_history_one(zpool_handle_t *zhp, void *data)
{
nvlist_t *nvhis;
int ret;
hist_cbdata_t *cb = (hist_cbdata_t *)data;
uint64_t off = 0;
boolean_t eof = B_FALSE;
cb->first = B_FALSE;
(void) printf(gettext("History for '%s':\n"), zpool_get_name(zhp));
while (!eof) {
if ((ret = zpool_get_history(zhp, &nvhis, &off, &eof)) != 0)
return (ret);
print_history_records(nvhis, cb);
nvlist_free(nvhis);
}
(void) printf("\n");
nvlist_free(nvhis);
return (ret);
}

View File

@ -441,7 +441,8 @@ typedef enum {
extern char *zpool_vdev_name(libzfs_handle_t *, zpool_handle_t *, nvlist_t *,
int name_flags);
extern int zpool_upgrade(zpool_handle_t *, uint64_t);
extern int zpool_get_history(zpool_handle_t *, nvlist_t **);
extern int zpool_get_history(zpool_handle_t *, nvlist_t **, uint64_t *,
boolean_t *);
extern int zpool_history_unpack(char *, uint64_t, uint64_t *,
nvlist_t ***, uint_t *);
extern void zpool_obj_to_path(zpool_handle_t *, uint64_t, uint64_t, char *,

View File

@ -4124,33 +4124,37 @@ zpool_history_unpack(char *buf, uint64_t bytes_read, uint64_t *leftover,
* Retrieve the command history of a pool.
*/
int
zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp)
zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp, uint64_t *off,
boolean_t *eof)
{
char *buf;
uint64_t buflen = HIS_BUF_LEN_DEF;
uint64_t off = 0;
nvlist_t **records = NULL;
uint_t numrecords = 0;
int err, i;
uint64_t start = *off;
buf = malloc(buflen);
if (buf == NULL)
return (ENOMEM);
do {
/* process about 1MB at a time */
while (*off - start < 1024 * 1024) {
uint64_t bytes_read = buflen;
uint64_t leftover;
if ((err = get_history(zhp, buf, &off, &bytes_read)) != 0)
if ((err = get_history(zhp, buf, off, &bytes_read)) != 0)
break;
/* if nothing else was read in, we're at EOF, just return */
if (bytes_read == 0)
if (bytes_read == 0) {
*eof = B_TRUE;
break;
}
if ((err = zpool_history_unpack(buf, bytes_read,
&leftover, &records, &numrecords)) != 0)
break;
off -= leftover;
*off -= leftover;
if (leftover == bytes_read) {
/*
* no progress made, because buffer is not big enough
@ -4165,9 +4169,7 @@ zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp)
break;
}
}
/* CONSTCOND */
} while (1);
}
free(buf);

View File

@ -2,10 +2,10 @@
.include <src.opts.mk>
SUBDIR= ${_drti} \
SUBDIR= drti \
libavl \
libctf \
${_libdtrace} \
libdtrace \
libnvpair \
libumem \
libuutil \
@ -23,11 +23,6 @@ _libzpool= libzpool
.endif
.endif
.if ${MACHINE_CPUARCH} != "sparc64"
_drti= drti
_libdtrace= libdtrace
.endif
SUBDIR_DEPEND_libdtrace= libctf
SUBDIR_DEPEND_libzfs_core= libnvpair
SUBDIR_DEPEND_libzfs= libavl libnvpair libumem libuutil libzfs_core

View File

@ -103,9 +103,6 @@ CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/riscv
.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/riscv
.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/riscv
.elif ${MACHINE_CPUARCH} == "sparc64"
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc
.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/sparc
.else
# temporary hack
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel

View File

@ -18,9 +18,7 @@
.if exists(${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S)
.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}
ATOMIC_SRCS= opensolaris_atomic.S
.if ${MACHINE_ARCH} != "sparc64"
ACFLAGS+= -Wa,--noexecstack
.endif
.else
.PATH: ${SRCTOP}/sys/cddl/compat/opensolaris/kern
ATOMIC_SRCS= opensolaris_atomic.c

View File

@ -260,6 +260,9 @@ _dwarf_elf_init(Dwarf_Debug dbg, Elf *elf, Dwarf_Error *error)
goto fail_cleanup;
}
if (sh.sh_type == SHT_NOBITS)
continue;
if ((name = elf_strptr(elf, e->eo_strndx, sh.sh_name)) ==
NULL) {
DWARF_SET_ELF_ERROR(dbg, error);
@ -313,6 +316,9 @@ _dwarf_elf_init(Dwarf_Debug dbg, Elf *elf, Dwarf_Error *error)
goto fail_cleanup;
}
if (sh.sh_type == SHT_NOBITS)
continue;
memcpy(&e->eo_shdr[j], &sh, sizeof(sh));
if ((name = elf_strptr(elf, e->eo_strndx, sh.sh_name)) ==

View File

@ -45,11 +45,6 @@
#include "ipf.h"
#include "iplang.h"
#if !defined(__NetBSD__) && (!defined(__FreeBSD_version) && \
__FreeBSD_version < 400020) && (!SOLARIS || SOLARIS2 < 10)
extern struct ether_addr *ether_aton __P((char *));
#endif
extern int opts;
extern struct ipopt_names ionames[];
extern int state, state, lineNum, token;
@ -58,11 +53,7 @@ extern char yytext[];
extern FILE *yyin;
int yylex __P((void));
#define YYDEBUG 1
#if !defined(ultrix) && !defined(hpux)
int yydebug = 1;
#else
extern int yydebug;
#endif
iface_t *iflist = NULL, **iftail = &iflist;
iface_t *cifp = NULL;

View File

@ -11,17 +11,13 @@ static const char rcsid[] = "@(#)$Id$";
#endif
#include <sys/types.h>
#include <sys/socket.h>
#if !defined(ultrix) && !defined(hpux) && !defined(__hpux) && !defined(__osf__) && !defined(_AIX51)
# include <sys/sockio.h>
#endif
#include <sys/ioctl.h>
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <net/if.h>
#include <netinet/if_ether.h>
#ifndef ultrix
# include <net/if_arp.h>
#endif
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>

View File

@ -38,15 +38,7 @@ int opts = 0;
# ifdef sun
char default_device[] = "le0";
# else
# ifdef ultrix
char default_device[] = "ln0";
# else
# ifdef __bsdi__
char default_device[] = "ef0";
# else
char default_device[] = "lan0";
# endif
# endif
# endif
#else
char default_device[] = DEFAULT_DEVICE;

View File

@ -33,15 +33,7 @@ extern void iplang __P((FILE *));
char options[68];
int opts;
# ifdef ultrix
char default_device[] = "ln0";
# else
# ifdef __bsdi__
char default_device[] = "ef0";
# else
char default_device[] = "le0";
# endif /* __bsdi__ */
# endif /* ultrix */
static void usage __P((char *));

View File

@ -34,15 +34,7 @@ char options[68];
# ifdef sun
char default_device[] = "le0";
# else
# ifdef ultrix
char default_device[] = "ln0";
# else
# ifdef __bsdi__
char default_device[] = "ef0";
# else
char default_device[] = "lan0";
# endif
# endif
# endif
static void usage __P((char *));

View File

@ -36,18 +36,13 @@ typedef int boolean_t;
# endif
# undef _KERNEL
# undef KERNEL
#if !defined(solaris) && !defined(linux) && !defined(__sgi)
#if !defined(solaris)
# include <nlist.h>
# include <sys/user.h>
# include <sys/proc.h>
#endif
#if !defined(ultrix) && !defined(hpux) && !defined(linux) && \
!defined(__sgi) && !defined(__osf__) && !defined(_AIX51)
# include <kvm.h>
#endif
#ifndef ultrix
# include <sys/socket.h>
#endif
#if defined(solaris)
# include <sys/stream.h>
#else
@ -57,11 +52,9 @@ typedef int boolean_t;
#include <sys/systm.h>
#include <sys/session.h>
#endif
#if BSD >= 199103
# include <sys/sysctl.h>
# include <sys/filedesc.h>
# include <paths.h>
#endif
#include <netinet/in_systm.h>
#include <sys/socket.h>
#include <net/if.h>
@ -74,7 +67,7 @@ typedef int boolean_t;
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netinet/ip.h>
#if defined(__SVR4) || defined(__svr4__) || defined(__sgi)
#if defined(__SVR4) || defined(__svr4__)
# include <sys/sysmacros.h>
#endif
#include <stdio.h>
@ -82,7 +75,7 @@ typedef int boolean_t;
#include <stdlib.h>
#include <string.h>
# include <netinet/ip_var.h>
# if !defined(__hpux) && !defined(solaris)
# if !defined(solaris)
# include <netinet/in_pcb.h>
# endif
#include "ipsend.h"

View File

@ -21,14 +21,8 @@ static const char rcsid[] = "@(#)$Id$";
*/
typedef int boolean_t;
#endif
#ifndef ultrix
#include <fcntl.h>
#endif
#if (__FreeBSD_version >= 300000)
# include <sys/dirent.h>
#else
# include <sys/dir.h>
#endif
# ifdef __NetBSD__
# include <machine/lock.h>
# endif
@ -38,10 +32,6 @@ typedef int boolean_t;
# define _KERNEL
# define KERNEL
# endif
# ifdef ultrix
# undef LOCORE
# include <sys/smp_lock.h>
# endif
# include <sys/file.h>
# ifdef __FreeBSD__
# undef _WANT_FILE
@ -54,18 +44,14 @@ typedef int boolean_t;
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/proc.h>
#if !defined(ultrix) && !defined(hpux) && !defined(__osf__)
# include <kvm.h>
#endif
#ifdef sun
#include <sys/systm.h>
#include <sys/session.h>
#endif
#if BSD >= 199103
#include <sys/sysctl.h>
#include <sys/filedesc.h>
#include <paths.h>
#endif
#include <math.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
@ -143,128 +129,10 @@ int kmemcpy(buf, pos, n)
struct nlist names[4] = {
{ "_proc" },
{ "_nproc" },
#ifdef ultrix
{ "_u" },
#else
{ NULL },
#endif
{ NULL }
};
#if BSD < 199103
static struct proc *getproc()
{
struct proc *p;
pid_t pid = getpid();
int siz, n;
n = nlist(KERNEL, names);
if (n != 0)
{
fprintf(stderr, "nlist(%#x) == %d\n", names, n);
return NULL;
}
if (KMCPY(&nproc, names[1].n_value, sizeof(nproc)) == -1)
{
fprintf(stderr, "read nproc (%#x)\n", names[1].n_value);
return NULL;
}
siz = nproc * sizeof(struct proc);
if (KMCPY(&p, names[0].n_value, sizeof(p)) == -1)
{
fprintf(stderr, "read(%#x,%#x,%d) proc\n",
names[0].n_value, &p, sizeof(p));
return NULL;
}
proc = (struct proc *)malloc(siz);
if (KMCPY(proc, p, siz) == -1)
{
fprintf(stderr, "read(%#x,%#x,%d) proc\n",
p, proc, siz);
return NULL;
}
p = proc;
for (n = nproc; n; n--, p++)
if (p->p_pid == pid)
break;
if (!n)
return NULL;
return p;
}
struct tcpcb *find_tcp(fd, ti)
int fd;
struct tcpiphdr *ti;
{
struct tcpcb *t;
struct inpcb *i;
struct socket *s;
struct user *up;
struct proc *p;
struct file *f, **o;
if (!(p = getproc()))
return NULL;
up = (struct user *)malloc(sizeof(*up));
#ifndef ultrix
if (KMCPY(up, p->p_uarea, sizeof(*up)) == -1)
{
fprintf(stderr, "read(%#x,%#x) failed\n", p, p->p_uarea);
return NULL;
}
#else
if (KMCPY(up, names[2].n_value, sizeof(*up)) == -1)
{
fprintf(stderr, "read(%#x,%#x) failed\n", p, names[2].n_value);
return NULL;
}
#endif
o = (struct file **)calloc(up->u_lastfile + 1, sizeof(*o));
if (KMCPY(o, up->u_ofile, (up->u_lastfile + 1) * sizeof(*o)) == -1)
{
fprintf(stderr, "read(%#x,%#x,%d) - u_ofile - failed\n",
up->u_ofile, o, sizeof(*o));
return NULL;
}
f = (struct file *)calloc(1, sizeof(*f));
if (KMCPY(f, o[fd], sizeof(*f)) == -1)
{
fprintf(stderr, "read(%#x,%#x,%d) - o[fd] - failed\n",
up->u_ofile[fd], f, sizeof(*f));
return NULL;
}
s = (struct socket *)calloc(1, sizeof(*s));
if (KMCPY(s, f->f_data, sizeof(*s)) == -1)
{
fprintf(stderr, "read(%#x,%#x,%d) - f_data - failed\n",
o[fd], s, sizeof(*s));
return NULL;
}
i = (struct inpcb *)calloc(1, sizeof(*i));
if (KMCPY(i, s->so_pcb, sizeof(*i)) == -1)
{
fprintf(stderr, "kvm_read(%#x,%#x,%d) - so_pcb - failed\n",
s->so_pcb, i, sizeof(*i));
return NULL;
}
t = (struct tcpcb *)calloc(1, sizeof(*t));
if (KMCPY(t, i->inp_ppcb, sizeof(*t)) == -1)
{
fprintf(stderr, "read(%#x,%#x,%d) - inp_ppcb - failed\n",
i->inp_ppcb, t, sizeof(*t));
return NULL;
}
return (struct tcpcb *)i->inp_ppcb;
}
#else
static struct kinfo_proc *getproc()
{
static struct kinfo_proc kp;
@ -304,7 +172,7 @@ struct tcpcb *find_tcp(tfd, ti)
fd = (struct filedesc *)malloc(sizeof(*fd));
if (fd == NULL)
return NULL;
#if defined( __FreeBSD_version) && __FreeBSD_version >= 500013
#if defined( __FreeBSD_version)
if (KMCPY(fd, p->ki_fd, sizeof(*fd)) == -1)
{
fprintf(stderr, "read(%#lx,%#lx) failed\n",
@ -381,7 +249,6 @@ struct tcpcb *find_tcp(tfd, ti)
free(t);
return NULL;
}
#endif /* BSD < 199301 */
int do_socket(dev, mtu, ti, gwip)
char *dev;

View File

@ -158,6 +158,15 @@ display the statistics prior to them being zeroed.
Zero global statistics held in the kernel for filtering only (this doesn't
affect fragment or state statistics).
.DT
.SH ENVIRONMENT
.NM utilizes the following environment variable.
.TP
.B IPF_PREDEFINED
ipfilter variables, see VARIABLES in ipf(5), can be specified in this
environment variable providing shell access to ipfilter and ipnat variables.
For example,
.br
IPF_PREDEFINED='my_server="10.1.1.1"; my_client="10.1.1.2";'
.SH FILES
/dev/ipauth
.br

View File

@ -5,7 +5,7 @@ ipfstat \- reports on packet filter statistics and filter list
.SH SYNOPSIS
.B ipfstat
[
.B \-6aAdfghIilnoRsv
.B \-46aAdfghIilnoRsv
]
.br
.B ipfstat -t
@ -35,6 +35,11 @@ is to retrieve and display the accumulated statistics which have been
accumulated over time as the kernel has put packets through the filter.
.SH OPTIONS
.TP
.B \-4
Display filter lists and states for IPv4, if available. This is the default
when displaying states. \fB-4\fP and \fB-6\fP is the default when
displaying lists.
.TP
.B \-6
Display filter lists and states for IPv6, if available.
.TP
@ -190,4 +195,5 @@ more entries is to resize the screen.
.SH SEE ALSO
ipf(8)
.SH BUGS
none known.
\fB-4\fP and \fB-6\fP are only valid with \fB-i\fP, \fB-o\fP, and \fB-t\fP.
An error should result when used with other arguments.

View File

@ -57,7 +57,10 @@ static wordtab_t *state_fields = NULL;
int nohdrfields = 0;
int opts = 0;
#ifdef USE_INET6
int use_inet4 = 0;
int use_inet6 = 0;
#endif
int live_kernel = 1;
int state_fd = -1;
int ipf_fd = -1;
@ -163,15 +166,17 @@ static void usage(name)
char *name;
{
#ifdef USE_INET6
fprintf(stderr, "Usage: %s [-6aAdfghIilnoRsv]\n", name);
fprintf(stderr, "Usage: %s [-46aAdfghIilnoRsv]\n", name);
#else
fprintf(stderr, "Usage: %s [-aAdfghIilnoRsv]\n", name);
fprintf(stderr, "Usage: %s [-4aAdfghIilnoRsv]\n", name);
#endif
fprintf(stderr, " %s [-M corefile] [-N symbol-list]\n", name);
#ifdef STATETOP
#ifdef USE_INET6
fprintf(stderr, " %s -t [-6C] ", name);
fprintf(stderr, " %s -t [-46C] ", name);
#else
fprintf(stderr, " %s -t [-C] ", name);
fprintf(stderr, " %s -t [-4C] ", name);
#endif
#endif
fprintf(stderr, "[-D destination address] [-P protocol] [-S source address] [-T refresh time]\n");
exit(1);
@ -206,9 +211,9 @@ int main(argc,argv)
u_32_t frf;
#ifdef USE_INET6
options = "6aACdfghIilnostvD:m:M:N:O:P:RS:T:";
options = "46aACdfghIilnostvD:m:M:N:O:P:RS:T:";
#else
options = "aACdfghIilnostvD:m:M:N:O:P:RS:T:";
options = "4aACdfghIilnostvD:m:M:N:O:P:RS:T:";
#endif
saddr.in4.s_addr = INADDR_ANY; /* default any v4 source addr */
@ -283,6 +288,9 @@ int main(argc,argv)
switch (c)
{
#ifdef USE_INET6
case '4' :
use_inet4 = 1;
break;
case '6' :
use_inet6 = 1;
break;
@ -385,6 +393,19 @@ int main(argc,argv)
break;
}
}
#ifdef USE_INET6
if ((use_inet4 || use_inet6) &&
!(opts & (OPT_INQUE | OPT_OUTQUE | OPT_STATETOP))) {
#ifdef STATETOP
FPRINTF(stderr, "No -i, -o, or -t given with -4 or -6\n");
#else
FPRINTF(stderr, "No -i or -o given with -4 or -6\n");
#endif
exit(-2);
}
if (use_inet4 == 0 && use_inet6 == 0)
use_inet4 = use_inet6 = 1;
#endif
if (live_kernel == 1) {
bzero((char *)&fio, sizeof(fio));
@ -410,8 +431,13 @@ int main(argc,argv)
#ifdef STATETOP
else if (opts & OPT_STATETOP)
topipstates(saddr, daddr, sport, dport, protocol,
use_inet6 ? 6 : 4, refreshtime, topclosed, filter);
#ifdef USE_INET6
use_inet6 && use_inet4 ? 0 : use_inet6 && !use_inet4 ? 6 : 4,
#else
4,
#endif
#endif
refreshtime, topclosed, filter);
else if (opts & OPT_AUTHSTATS)
showauthstates(frauthstp);
else if (opts & OPT_GROUPS)
@ -805,15 +831,21 @@ printlivelist(fiop, out, set, fp, group, comment)
if (rule.iri_rule == NULL)
break;
#ifdef USE_INET6
if (use_inet6 != 0) {
if (use_inet6 != 0 && use_inet4 == 0) {
if (fp->fr_family != 0 && fp->fr_family != AF_INET6)
continue;
} else
} else if (use_inet4 != 0 && use_inet6 == 0) {
#endif
{
if (fp->fr_family != 0 && fp->fr_family != AF_INET)
continue;
#ifdef USE_INET6
} else {
if (fp->fr_family != 0 &&
fp->fr_family != AF_INET && fp->fr_family != AF_INET6)
continue;
}
#endif
if (fp->fr_data != NULL)
fp->fr_data = (char *)fp + fp->fr_size;
@ -904,13 +936,21 @@ static void printdeadlist(fiop, out, set, fp, group, comment)
return;
}
fp = &fb;
if (use_inet6 != 0) {
if (fp->fr_family != 0 && fp->fr_family != 6)
#ifdef USE_INET6
if (use_inet6 != 0 && use_inet4 == 0) {
if (fp->fr_family != 0 && fp->fr_family != AF_INET6)
continue;
} else if (use_inet4 != 0 && use_inet6 == 0) {
#endif
if (fp->fr_family != 0 && fp->fr_family != AF_INET)
continue;
#ifdef USE_INET6
} else {
if (fp->fr_family != 0 && fp->fr_family != 4)
if (fp->fr_family != 0 &&
fp->fr_family != AF_INET && fp->fr_family != AF_INET6)
continue;
}
#endif
data = NULL;
type = fb.fr_type & ~FR_T_BUILTIN;
@ -1338,7 +1378,7 @@ static void topipstates(saddr, daddr, sport, dport, protocol, ver,
if (ipsstp->iss_list == NULL)
break;
if (ips.is_v != ver)
if (ver != 0 && ips.is_v != ver)
continue;
if ((filter != NULL) &&
@ -1906,7 +1946,7 @@ static void parse_ipportstr(argument, ip, port)
ok = 1;
#ifdef USE_INET6
ip->in6 = in6addr_any;
} else if (use_inet6 && inet_pton(AF_INET6, s, &ip->in6)) {
} else if (use_inet6 && !use_inet4 && inet_pton(AF_INET6, s, &ip->in6)) {
ok = 1;
#endif
} else if (inet_aton(s, &ip->in4))
@ -1944,6 +1984,9 @@ static char *getip(v, addr)
static char hostbuf[MAXHOSTNAMELEN+1];
#endif
if (v == 0)
return ("any");
if (v == 4)
return inet_ntoa(addr->in4);
@ -2047,7 +2090,7 @@ static int sort_srcip(a, b)
register const statetop_t *bp = b;
#ifdef USE_INET6
if (use_inet6) {
if (use_inet6 && !use_inet4) {
if (IP6_EQ(&ap->st_src, &bp->st_src))
return 0;
else if (IP6_GT(&ap->st_src, &bp->st_src))
@ -2087,7 +2130,7 @@ static int sort_dstip(a, b)
register const statetop_t *bp = b;
#ifdef USE_INET6
if (use_inet6) {
if (use_inet6 && !use_inet4) {
if (IP6_EQ(&ap->st_dst, &bp->st_dst))
return 0;
else if (IP6_GT(&ap->st_dst, &bp->st_dst))

View File

@ -4,7 +4,9 @@ a[bc]d & abd abd
a\*c & a*c a*c
a\\b & a\b a\b
a\\\*b & a\*b a\*b
a\bc & abc abc
# Begin FreeBSD
a\bc &C EESCAPE
# End FreeBSD
a\ &C EESCAPE
a\\bc & a\bc a\bc
\{ bC BADRPT

View File

@ -12,7 +12,7 @@ a(b+)c - abbbc abbbc bbb
a(b*)c - ac ac @c
(a|ab)(bc([de]+)f|cde) - abcdef abcdef a,bcdef,de
# Begin FreeBSD
a\(b\|c\)d b ab|cd ab|cd b|c
a\(b|c\)d b ab|cd ab|cd b|c
# End FreeBSD
# the regression tester only asks for 9 subexpressions
a(b)(c)(d)(e)(f)(g)(h)(i)(j)k - abcdefghijk abcdefghijk b,c,d,e,f,g,h,i,j

View File

@ -214,6 +214,89 @@ zgrep_body()
atf_check -o file:"$(atf_get_srcdir)/d_zgrep.out" zgrep -h line d_input.gz
}
atf_test_case zgrep_combined_flags
zgrep_combined_flags_head()
{
atf_set "descr" "Checks for zgrep wrapper problems with combined flags (PR 247126)"
}
zgrep_combined_flags_body()
{
atf_expect_fail "known but unsolved zgrep wrapper script regression"
echo 'foo bar' > test
atf_check -o inline:"foo bar\n" zgrep -we foo test
# Avoid hang on reading from stdin in the failure case
atf_check -o inline:"foo bar\n" zgrep -wefoo test < /dev/null
}
atf_test_case zgrep_eflag
zgrep_eflag_head()
{
atf_set "descr" "Checks for zgrep wrapper problems with -e PATTERN (PR 247126)"
}
zgrep_eflag_body()
{
echo 'foo bar' > test
# Avoid hang on reading from stdin in the failure case
atf_check -o inline:"foo bar\n" zgrep -e 'foo bar' test < /dev/null
atf_check -o inline:"foo bar\n" zgrep --regexp='foo bar' test < /dev/null
}
atf_test_case zgrep_fflag
zgrep_fflag_head()
{
atf_set "descr" "Checks for zgrep wrapper problems with -f FILE (PR 247126)"
}
zgrep_fflag_body()
{
echo foo > pattern
echo foobar > test
# Avoid hang on reading from stdin in the failure case
atf_check -o inline:"foobar\n" zgrep -f pattern test </dev/null
atf_check -o inline:"foobar\n" zgrep --file=pattern test </dev/null
}
atf_test_case zgrep_long_eflag
zgrep_long_eflag_head()
{
atf_set "descr" "Checks for zgrep wrapper problems with --ignore-case reading from stdin (PR 247126)"
}
zgrep_long_eflag_body()
{
echo foobar > test
atf_check -o inline:"foobar\n" zgrep -e foo --ignore-case < test
}
atf_test_case zgrep_multiple_eflags
zgrep_multiple_eflags_head()
{
atf_set "descr" "Checks for zgrep wrapper problems with multiple -e flags (PR 247126)"
}
zgrep_multiple_eflags_body()
{
atf_expect_fail "known but unsolved zgrep wrapper script regression"
echo foobar > test
atf_check -o inline:"foobar\n" zgrep -e foo -e xxx test
}
atf_test_case zgrep_empty_eflag
zgrep_empty_eflag_head()
{
atf_set "descr" "Checks for zgrep wrapper problems with empty -e flags pattern (PR 247126)"
}
zgrep_empty_eflag_body()
{
echo foobar > test
atf_check -o inline:"foobar\n" zgrep -e '' test
}
atf_test_case nonexistent
nonexistent_head()
{
@ -826,6 +909,12 @@ atf_init_test_cases()
atf_add_test_case file_exp
atf_add_test_case egrep
atf_add_test_case zgrep
atf_add_test_case zgrep_combined_flags
atf_add_test_case zgrep_eflag
atf_add_test_case zgrep_empty_eflag
atf_add_test_case zgrep_fflag
atf_add_test_case zgrep_long_eflag
atf_add_test_case zgrep_multiple_eflags
atf_add_test_case nonexistent
atf_add_test_case context2
# Begin FreeBSD

View File

@ -36,6 +36,9 @@ the development of OpenBSM:
Ryan Steinmetz
The FreeBSD Foundation
Brooks Davis
Mateusz Piotrowski
Alan Somers
Aniket Pandey
In addition, Coverity, Inc.'s Prevent(tm) static analysis tool and Gimpel
Software's FlexeLint tool were used to identify a number of bugs in the

View File

@ -712,7 +712,7 @@ auditd_config_controls(void)
*/
err = auditd_set_qsize();
if (err) {
auditd_log_err("audit_set_qsize() %s: %m",
auditd_log_err("auditd_set_qsize() %s: %m",
auditd_strerror(err));
ret = -1;
} else

View File

@ -523,7 +523,7 @@ main_loop(void)
}
TAILQ_FOREACH(adhost, &adcfg->adc_hosts, adh_next) {
if (adhost->adh_role == ADIST_ROLE_SENDER) {
/* Only sender workers asks for connections. */
/* Only sender workers ask for connections. */
PJDLOG_ASSERT(adhost->adh_conn != NULL);
fd = proto_descriptor(adhost->adh_conn);
PJDLOG_ASSERT(fd >= 0);

View File

@ -413,7 +413,7 @@ tls_exec_client(const char *user, int startfd, const char *srcaddr,
tls_certificate_verify(ssl, fingerprint);
/*
* The following byte is send to make proto_connect_wait() to work.
* The following byte is sent to make proto_connect_wait() work.
*/
connected = 1;
for (;;) {
@ -460,7 +460,7 @@ tls_call_exec_client(struct proto_conn *sock, const char *srcaddr,
proto_close(sock);
} else {
/*
* The FD_CLOEXEC is cleared by dup2(2), so when we not
* The FD_CLOEXEC is cleared by dup2(2), so when we do not
* call it, we have to clear it by hand in case it is set.
*/
if (fcntl(startfd, F_SETFD, 0) == -1)

View File

@ -498,7 +498,7 @@ auditd_expire_trails(int (*warn_expired)(char *))
* update the mtime of the trail file to the current
* time. This is so we don't prematurely remove a trail
* file that was created while the system clock reset
* to the * "beginning of time" but later the system
* to the "beginning of time" but later the system
* clock is set to the correct current time.
*/
if (current_time >= JAN_01_2000 &&

View File

@ -201,7 +201,7 @@ converts an audit policy flags string,
.Fa polstr ,
to a numeric audit policy mask returned via
.Fa policy .
.Sh RETURN VALULES
.Sh RETURN VALUES
The
.Fn getacfilesz ,
.Fn getacdir ,

View File

@ -62,7 +62,7 @@ The
function accepts a local domain, and returns the BSM domain for it.
This call cannot fail, and instead returns a BSM domain indicating to a later
decoder that the domain could not be encoded.
.Sh RETURN VALULES
.Sh RETURN VALUES
On success,
.Fn au_bsm_to_domain
returns 0 and a converted domain; on failure, it returns -1 but does not set

View File

@ -76,7 +76,7 @@ function converts a BSM error value to a string, generally by converting first t
local error number and using the local
.Xr strerror 3
function, but will also work for errors that are not locally defined.
.Sh RETURN VALULES
.Sh RETURN VALUES
On success,
.Fn au_bsm_to_errno
returns 0 and a converted error value; on failure, it returns -1 but does not

View File

@ -61,7 +61,7 @@ operating system.
function accepts a local socket type, and returns the BSM socket type for it.
This call cannot fail, and instead returns a BSM socket type indicating to a
later decoder that the socket type could not be encoded.
.Sh RETURN VALULES
.Sh RETURN VALUES
On success,
.Fn au_bsm_to_socket_type
returns 0 and a converted socket type; on failure, it returns -1 but does not

View File

@ -102,7 +102,7 @@ token can be created using
.It Sy "Field Bytes Description"
.It "Token ID 1 byte Token ID"
.It "Record Byte Count 4 bytes Number of bytes in record"
.It "Version Number 2 bytes Record version number"
.It "Version Number 1 byte Record version number"
.It "Event Type 2 bytes Event type"
.It "Event Modifier 2 bytes Event sub-type"
.It "Seconds 4/8 bytes Record time stamp (32/64-bits)"
@ -126,7 +126,7 @@ token can be created using
.It Sy "Field Bytes Description"
.It "Token ID 1 byte Token ID"
.It "Record Byte Count 4 bytes Number of bytes in record"
.It "Version Number 2 bytes Record version number"
.It "Version Number 1 byte Record version number"
.It "Event Type 2 bytes Event type"
.It "Event Modifier 2 bytes Event sub-type"
.It "Address Type/Length 1 byte Host address type and length"
@ -325,7 +325,7 @@ or
.It "Process ID 4 bytes Process ID"
.It "Session ID 4 bytes Audit session ID"
.It "Terminal Port ID 4/8 bytes Terminal port ID (32/64-bits)"
.It "Terminal Address Type/Length 1 byte Length of machine address"
.It "Terminal Address Type/Length 4 bytes Length of machine address"
.It "Terminal Machine Address 4 bytes IPv4 or IPv6 address of machine"
.El
.Ss Return Token

View File

@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd October 19, 2008
.Dd March 14, 2018
.Dt GETAUDIT 2
.Os
.Sh NAME
@ -62,6 +62,7 @@ struct auditinfo {
au_mask_t ai_mask; /* Audit masks */
au_tid_t ai_termid; /* Terminal ID */
au_asid_t ai_asid; /* Audit session ID */
au_asflgs_t ai_flags; /* Audit session flags. */
};
typedef struct auditinfo auditinfo_t;
.Ed

View File

@ -46,7 +46,7 @@
#define MIN_AUDIT_FILE_SIZE (512 * 1024)
/*
* Minimum noumber of free blocks on the filesystem containing the audit
* Minimum number of free blocks on the filesystem containing the audit
* log necessary to avoid a hard log rotation. DO NOT SET THIS VALUE TO 0
* as the kernel does an unsigned compare, plus we want to leave a few blocks
* free so userspace can terminate the log, etc.
@ -249,14 +249,14 @@ typedef struct au_token token_t;
/*
* Kernel audit queue control parameters:
* Default: Maximum:
* aq_hiwater: AQ_HIWATER (100) AQ_MAXHIGH (10000)
* aq_hiwater: AQ_HIWATER (100) AQ_MAXHIGH (10000)
* aq_lowater: AQ_LOWATER (10) <aq_hiwater
* aq_bufsz: AQ_BUFSZ (32767) AQ_MAXBUFSZ (1048576)
* aq_delay: 20 20000 (not used)
* aq_delay: 20 20000 (not used)
*/
struct au_qctrl {
int aq_hiwater; /* Max # of audit recs in queue when */
/* threads with new ARs get blocked. */
/* threads with new ARs get blocked. */
int aq_lowater; /* # of audit recs in queue when */
/* blocked threads get unblocked. */

View File

@ -168,13 +168,6 @@
ignore HPN-related configuration options to avoid breaking existing
configurations.
9) AES-CBC
The AES-CBC ciphers were removed from the server-side proposal list
in 6.7p1 due to theoretical weaknesses and the availability of
superior ciphers (including AES-CTR and AES-GCM). We have re-added
them for compatibility with third-party clients.
This port was brought to you by (in no particular order) DARPA, NAI

View File

@ -1,5 +1,4 @@
/* $OpenBSD: myproposal.h,v 1.57 2018/09/12 01:34:02 djm Exp $ */
/* $FreeBSD$ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
@ -122,8 +121,7 @@
#define KEX_SERVER_ENCRYPT \
"chacha20-poly1305@openssh.com," \
"aes128-ctr,aes192-ctr,aes256-ctr" \
AESGCM_CIPHER_MODES \
",aes128-cbc,aes192-cbc,aes256-cbc"
AESGCM_CIPHER_MODES
#define KEX_CLIENT_ENCRYPT KEX_SERVER_ENCRYPT

View File

@ -660,6 +660,7 @@ static struct {
{ "rdomain", sRDomain, SSHCFG_ALL },
{ "casignaturealgorithms", sCASignatureAlgorithms, SSHCFG_ALL },
{ "useblacklist", sUseBlacklist, SSHCFG_GLOBAL },
{ "useblocklist", sUseBlacklist, SSHCFG_GLOBAL }, /* alias */
{ "noneenabled", sUnsupported, SSHCFG_ALL },
{ "hpndisabled", sDeprecated, SSHCFG_ALL },
{ "hpnbuffersize", sDeprecated, SSHCFG_ALL },

View File

@ -35,7 +35,7 @@
.\"
.\" $OpenBSD: sshd_config.5,v 1.282 2018/09/20 03:28:06 djm Exp $
.\" $FreeBSD$
.Dd $Mdocdate: September 20 2018 $
.Dd $Mdocdate: July 28 2020 $
.Dt SSHD_CONFIG 5
.Os
.Sh NAME
@ -495,8 +495,7 @@ The default is:
.Bd -literal -offset indent
chacha20-poly1305@openssh.com,
aes128-ctr,aes192-ctr,aes256-ctr,
aes128-gcm@openssh.com,aes256-gcm@openssh.com,
aes128-cbc,aes192-cbc,aes256-cbc
aes128-gcm@openssh.com,aes256-gcm@openssh.com
.Ed
.Pp
The list of available ciphers may also be obtained using
@ -1603,6 +1602,11 @@ to the
daemon.
The default is
.Cm no .
For forward compatibility with an upcoming
.Xr blacklistd
rename, the
.Cm UseBlocklist
alias can be used instead.
.It Cm UseDNS
Specifies whether
.Xr sshd 8

View File

@ -448,6 +448,8 @@
..
ping6
..
route
..
..
secure
lib

View File

@ -864,8 +864,6 @@
..
powerpc
..
sparc64
..
..
man5
..
@ -880,8 +878,6 @@
..
powerpc
..
sparc64
..
..
man9
..

View File

@ -71,6 +71,7 @@ typedef struct {
#define REG_NOSPEC 0020
#define REG_PEND 0040
#define REG_DUMP 0200
#define REG_POSIX 0400 /* only POSIX-compliant regex (libregex) */
/* regerror() flags */
#define REG_ENOSYS (-1)

View File

@ -1,14 +1,14 @@
// $FreeBSD$
#define LLVM_REVISION "llvmorg-10.0.1-rc2-0-g77d76b71d7d"
#define LLVM_REVISION "llvmorg-10.0.1-0-gef32c611aa2"
#define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git"
#define CLANG_REVISION "llvmorg-10.0.1-rc2-0-g77d76b71d7d"
#define CLANG_REVISION "llvmorg-10.0.1-0-gef32c611aa2"
#define CLANG_REPOSITORY "git@github.com:llvm/llvm-project.git"
// <Upstream revision at import>-<Local identifier in __FreeBSD_version style>
#define LLD_REVISION "llvmorg-10.0.1-rc2-0-g77d76b71d7d-1300007"
#define LLD_REVISION "llvmorg-10.0.1-0-gef32c611aa2-1300007"
#define LLD_REPOSITORY "FreeBSD"
#define LLDB_REVISION "llvmorg-10.0.1-rc2-0-g77d76b71d7d"
#define LLDB_REVISION "llvmorg-10.0.1-0-gef32c611aa2"
#define LLDB_REPOSITORY "git@github.com:llvm/llvm-project.git"

View File

@ -1,3 +1,3 @@
/* $FreeBSD$ */
#define LLVM_REVISION "llvmorg-10.0.1-rc2-0-g77d76b71d7d"
#define LLVM_REVISION "llvmorg-10.0.1-0-gef32c611aa2"
#define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git"

View File

@ -13,7 +13,7 @@ OBJS+= crtbegin.o crtbeginS.o crtbeginT.o
OBJS+= crtend.o crtendS.o
OBJS+= crti.o crtn.o
CRT1OBJS+= crtbrand.o ignore_init_note.o
CRT1OBJS+= crtbrand.o feature_note.o ignore_init_note.o
ACFLAGS+= -DLOCORE
@ -33,6 +33,7 @@ FILESDIR= ${LIBDIR}
.undef LIBRARIES_ONLY
CLEANFILES+= ${OBJS} ${CRT1OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o
CLEANFILES+= crti_s.o
crt1.o: crt1_c.o ${CRT1OBJS}
${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
@ -68,6 +69,12 @@ crtbeginS.o crtendS.o:
${CC} ${CFLAGS} -I${.CURDIR} ${CFLAGS_CRTS} -c -o ${.TARGET} \
${.ALLSRC:N*.h:[1]}
crti_s.o: crti.S
${CC} ${CFLAGS} ${ACFLAGS} -c ${.ALLSRC:M*.S} -o ${.TARGET}
crti.o: crti_s.o crtbrand.o
${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
.endif
.include "../Makefile.inc"

View File

@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
* for more information.
*/
.section .note.tag,"a",%note
.section .note.tag,"aG",%note,.freebsd.noteG,comdat
.p2align 2
.4byte 2f-1f
.4byte 4f-3f
@ -46,14 +46,4 @@ __FBSDID("$FreeBSD$");
1: .asciz NOTE_FREEBSD_VENDOR
2: .p2align 2
3: .4byte __FreeBSD_version
4:
.section .note.tag,"a",%note
.p2align 2
.4byte 2f-1f
.4byte 4f-3f
.4byte NT_FREEBSD_FEATURE_CTL
1: .asciz NOTE_FREEBSD_VENDOR
2: .p2align 2
3: .4byte 0
4:

View File

@ -0,0 +1,42 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright 2000 David E. O'Brien, John D. Polstra.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
#include <sys/elf_common.h>
#include "notes.h"
.section .note.tag,"a",%note
.p2align 2
.4byte 2f-1f
.4byte 4f-3f
.4byte NT_FREEBSD_FEATURE_CTL
1: .asciz NOTE_FREEBSD_VENDOR
2: .p2align 2
3: .4byte 0
4:

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd April 14, 2020
.Dd July 22, 2020
.Dt GELI 8
.Os
.Sh NAME
@ -1095,6 +1095,66 @@ resuming the laptop:
# geli resume gpt/private
Enter passphrase:
.Ed
.Pp
To create a
.Nm
encrypted filesystem with a file as storage device follow this example.
First a file named private0 is created in
.Pa /usr
and attached as a memory disk like
.Pa /dev/md0
for example.
.Bd -literal -offset indent
# dd if=/dev/zero of=/usr/private0 bs=1m count=256
# chmod 0600 /usr/private0
# mdconfig -t vnode -f /usr/private0
.Ed
.Pp
It is recommended to place the following line in
.Xr rc.conf 5
to have the memory disk automatically created during boot.
.Bd -literal -offset indent
mdconfig_md0="-t vnode -f /usr/private0"
.Ed
.Pp
After
.Pa /dev/md0
is created a random key has to be generated and stored in a secure location,
like
.Pa /root
for example.
This key should be protected by a passphrase, which
is requested when geli init is called.
.Bd -literal -offset indent
# dd if=/dev/random of=/root/private0.key bs=64 count=1
# geli init -K /root/private0.key -s 4096 /dev/md0
Enter new passphrase:
Reenter new passphrase:
# geli attach -k /root/private0.key /dev/md0
Enter passphrase:
# dd if=/dev/random of=/dev/md0.eli bs=1m
.Ed
.Pp
Once the initialization of the
.Pa /dev/md0.eli
device is ready create a UFS filesystem and mount it for example in
.Pa /private .
.Bd -literal -offset indent
# newfs /dev/md0.eli
# mount /dev/md0.eli /private
.Ed
.Pp
After a system reboot the
.Nm
device can be mounted again with the following commands.
The call of geli attach will ask for the passphrase.
It is recommended to do this procedure after the boot, because otherwise
the boot process would be waiting for the passphrase input.
.Bd -literal -offset indent
# geli attach -k /root/private0.key /dev/md0
Enter passphrase:
# mount /dev/md0.eli /private
.Ed
.Sh ENCRYPTION MODES
.Nm
supports two encryption modes:
@ -1157,7 +1217,9 @@ block cipher was implemented by Yoshisato Yanagisawa in
.Pp
Highest
.Nm GELI
metadata version supported by the given FreeBSD version:
metadata version supported by the given
.Fx
version:
.Bl -column -offset indent ".Sy FreeBSD" ".Sy version"
.It Sy FreeBSD Ta Sy GELI
.It Sy version Ta Sy version

View File

@ -563,7 +563,7 @@ be_setup_snapshot_name(libbe_handle_t *lbh, char *buf, size_t buflen)
}
bool
be_is_auto_snapshot_name(libbe_handle_t *lbh, const char *name)
be_is_auto_snapshot_name(libbe_handle_t *lbh __unused, const char *name)
{
const char *snap;
int day, hour, minute, month, second, serial, year;

View File

@ -3,8 +3,11 @@
*/
FBSD_1.0 {
regcomp;
regerror;
regexec;
regfree;
};
FBSD_1.6 {
regcomp;
};

View File

@ -102,11 +102,14 @@ struct parse {
sopno pend[NPAREN]; /* -> ) ([0] unused) */
bool allowbranch; /* can this expression branch? */
bool bre; /* convenience; is this a BRE? */
int pflags; /* other parsing flags -- legacy escapes? */
bool (*parse_expr)(struct parse *, struct branchc *);
void (*pre_parse)(struct parse *, struct branchc *);
void (*post_parse)(struct parse *, struct branchc *);
};
#define PFLAG_LEGACY_ESC 0x00000001
/* ========= begin header generated by ./mkh ========= */
#ifdef __cplusplus
extern "C" {
@ -132,6 +135,7 @@ static void p_b_cclass(struct parse *p, cset *cs);
static void p_b_eclass(struct parse *p, cset *cs);
static wint_t p_b_symbol(struct parse *p);
static wint_t p_b_coll_elem(struct parse *p, wint_t endc);
static bool may_escape(struct parse *p, const wint_t ch);
static wint_t othercase(wint_t ch);
static void bothcases(struct parse *p, wint_t ch);
static void ordinary(struct parse *p, wint_t ch);
@ -199,22 +203,10 @@ static char nuls[10]; /* place to point scanner in event of error */
/* Macro used by computejump()/computematchjump() */
#define MIN(a,b) ((a)<(b)?(a):(b))
/*
- regcomp - interface for parser and compilation
= extern int regcomp(regex_t *, const char *, int);
= #define REG_BASIC 0000
= #define REG_EXTENDED 0001
= #define REG_ICASE 0002
= #define REG_NOSUB 0004
= #define REG_NEWLINE 0010
= #define REG_NOSPEC 0020
= #define REG_PEND 0040
= #define REG_DUMP 0200
*/
int /* 0 success, otherwise REG_something */
regcomp(regex_t * __restrict preg,
static int /* 0 success, otherwise REG_something */
regcomp_internal(regex_t * __restrict preg,
const char * __restrict pattern,
int cflags)
int cflags, int pflags)
{
struct parse pa;
struct re_guts *g;
@ -273,6 +265,7 @@ regcomp(regex_t * __restrict preg,
p->end = p->next + len;
p->error = 0;
p->ncsalloc = 0;
p->pflags = pflags;
for (i = 0; i < NPAREN; i++) {
p->pbegin[i] = 0;
p->pend[i] = 0;
@ -345,6 +338,43 @@ regcomp(regex_t * __restrict preg,
return(p->error);
}
/*
- regcomp - interface for parser and compilation
= extern int regcomp(regex_t *, const char *, int);
= #define REG_BASIC 0000
= #define REG_EXTENDED 0001
= #define REG_ICASE 0002
= #define REG_NOSUB 0004
= #define REG_NEWLINE 0010
= #define REG_NOSPEC 0020
= #define REG_PEND 0040
= #define REG_DUMP 0200
*/
int /* 0 success, otherwise REG_something */
regcomp(regex_t * __restrict preg,
const char * __restrict pattern,
int cflags)
{
return (regcomp_internal(preg, pattern, cflags, 0));
}
#ifndef LIBREGEX
/*
* Legacy interface that requires more lax escaping behavior.
*/
int
freebsd12_regcomp(regex_t * __restrict preg,
const char * __restrict pattern,
int cflags, int pflags)
{
return (regcomp_internal(preg, pattern, cflags, PFLAG_LEGACY_ESC));
}
__sym_compat(regcomp, freebsd12_regcomp, FBSD_1.0);
#endif /* !LIBREGEX */
/*
- p_ere_exp - parse one subERE, an atom possibly followed by a repetition op,
- return whether we should terminate or not
@ -435,7 +465,10 @@ p_ere_exp(struct parse *p, struct branchc *bc)
EMIT(OEOW, 0);
break;
default:
ordinary(p, wc);
if (may_escape(p, wc))
ordinary(p, wc);
else
SETERROR(REG_EESCAPE);
break;
}
break;
@ -797,7 +830,10 @@ p_simp_re(struct parse *p, struct branchc *bc)
return (false); /* Definitely not $... */
p->next--;
wc = WGETNEXT();
ordinary(p, wc);
if ((c & BACKSL) == 0 || may_escape(p, wc))
ordinary(p, wc);
else
SETERROR(REG_EESCAPE);
break;
}
@ -1094,6 +1130,55 @@ p_b_coll_elem(struct parse *p,
return(0);
}
/*
- may_escape - determine whether 'ch' is escape-able in the current context
== static int may_escape(struct parse *p, const wint_t ch)
*/
static bool
may_escape(struct parse *p, const wint_t ch)
{
if ((p->pflags & PFLAG_LEGACY_ESC) != 0)
return (true);
if (isalpha(ch) || ch == '\'' || ch == '`')
return (false);
return (true);
#ifdef NOTYET
/*
* Build a whitelist of characters that may be escaped to produce an
* ordinary in the current context. This assumes that these have not
* been otherwise interpreted as a special character. Escaping an
* ordinary character yields undefined results according to
* IEEE 1003.1-2008. Some extensions (notably, some GNU extensions) take
* advantage of this and use escaped ordinary characters to provide
* special meaning, e.g. \b, \B, \w, \W, \s, \S.
*/
switch(ch) {
case '|':
case '+':
case '?':
/* The above characters may not be escaped in BREs */
if (!(p->g->cflags&REG_EXTENDED))
return (false);
/* Fallthrough */
case '(':
case ')':
case '{':
case '}':
case '.':
case '[':
case ']':
case '\\':
case '*':
case '^':
case '$':
return (true);
default:
return (false);
}
#endif
}
/*
- othercase - return the case counterpart of an alphabetic
== static wint_t othercase(wint_t ch);

View File

@ -28,7 +28,7 @@
.\" From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94
.\" $FreeBSD$
.\"
.Dd June 28, 2018
.Dd June 29, 2020
.Dt SIGACTION 2
.Os
.Sh NAME
@ -569,6 +569,7 @@ Extension Interfaces:
.Pp
.Fn accept4 ,
.Fn bindat ,
.Fn close_range ,
.Fn closefrom ,
.Fn connectat ,
.Fn eaccess ,

View File

@ -116,12 +116,12 @@ CFLAGS+= -DSHA1_ASM
SRCS+= rmd160.S
CFLAGS+= -DRMD160_ASM
.endif
.if exists(${MACHINE_ARCH}/skein_block_asm.S)
# Fully unroll all loops in the assembly optimized version
ACFLAGS+= -DSKEIN_LOOP=0
SRCS+= skein_block_asm.S
CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792
.endif
#.if exists(${MACHINE_ARCH}/skein_block_asm.S)
## Fully unroll all loops in the assembly optimized version
#ACFLAGS+= -DSKEIN_LOOP=0
#SRCS+= skein_block_asm.S
#CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792
#.endif
.if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) || exists(${MACHINE_ARCH}/skein_block_asm.S)
ACFLAGS+= -DELF -Wa,--noexecstack
.endif

View File

@ -30,6 +30,7 @@
#include <sys/types.h>
#include <sys/errno.h>
#include <sys/pmc.h>
#include <sys/sysctl.h>
#include <stddef.h>
#include <stdlib.h>
@ -89,20 +90,13 @@ static struct pmu_alias pmu_amd_alias_table[] = {
static pmu_mfr_t
pmu_events_mfr(void)
{
char *buf;
size_t s;
char buf[PMC_CPUID_LEN];
size_t s = sizeof(buf);
pmu_mfr_t mfr;
if (sysctlbyname("kern.hwpmc.cpuid", (void *)NULL, &s,
if (sysctlbyname("kern.hwpmc.cpuid", buf, &s,
(void *)NULL, 0) == -1)
return (PMU_INVALID);
if ((buf = malloc(s + 1)) == NULL)
return (PMU_INVALID);
if (sysctlbyname("kern.hwpmc.cpuid", buf, &s,
(void *)NULL, 0) == -1) {
free(buf);
return (PMU_INVALID);
}
if (strcasestr(buf, "AuthenticAMD") != NULL ||
strcasestr(buf, "HygonGenuine") != NULL)
mfr = PMU_AMD;
@ -110,7 +104,6 @@ pmu_events_mfr(void)
mfr = PMU_INTEL;
else
mfr = PMU_INVALID;
free(buf);
return (mfr);
}
@ -169,17 +162,14 @@ pmu_events_map_get(const char *cpuid)
{
regex_t re;
regmatch_t pmatch[1];
size_t s;
char buf[64];
char buf[PMC_CPUID_LEN];
size_t s = sizeof(buf);
int match;
const struct pmu_events_map *pme;
if (cpuid != NULL) {
memcpy(buf, cpuid, 64);
strlcpy(buf, cpuid, s);
} else {
if (sysctlbyname("kern.hwpmc.cpuid", (void *)NULL, &s,
(void *)NULL, 0) == -1)
return (NULL);
if (sysctlbyname("kern.hwpmc.cpuid", buf, &s,
(void *)NULL, 0) == -1)
return (NULL);

View File

@ -28,7 +28,7 @@
.\" from: @(#)getty.8 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\" "
.Dd March 2, 2018
.Dd July 21, 2020
.Dt GETTY 8
.Os
.Sh NAME
@ -122,4 +122,4 @@ does not exist.
A
.Nm
utility appeared in
.At v6 .
.At v3 .

View File

@ -5,7 +5,7 @@
# PROVIDE: ipfilter
# REQUIRE: FILESYSTEMS
# KEYWORD: nojail
# KEYWORD: nojailvnet
. /etc/rc.subr

View File

@ -6,7 +6,7 @@
# PROVIDE: ipmon
# REQUIRE: FILESYSTEMS hostname sysctl ipfilter
# BEFORE: SERVERS
# KEYWORD: nojail
# KEYWORD: nojailvnet
. /etc/rc.subr

View File

@ -5,7 +5,7 @@
# PROVIDE: ipnat
# REQUIRE: ipfilter
# KEYWORD: nojail
# KEYWORD: nojailvnet
. /etc/rc.subr

View File

@ -6,7 +6,7 @@
# PROVIDE: ippool
# REQUIRE: FILESYSTEMS
# BEFORE: ipfilter
# KEYWORD: nojail
# KEYWORD: nojailvnet
. /etc/rc.subr

View File

@ -222,9 +222,6 @@ case ${firewall_type} in
if [ -n "$net6" ]; then
${fwcmd} add pass all from me to ${net6}
${fwcmd} add pass all from ${net6} to me
fi
if [ -n "$net6" ]; then
# Allow any link-local multicast traffic
${fwcmd} add pass all from fe80::/10 to ff02::/16
${fwcmd} add pass all from ${net6} to ff02::/16

View File

@ -17,6 +17,7 @@ PROG?= ld-elf.so.1
TAGS+= lib32
.endif
SRCS= \
crtbrand.S \
rtld_start.S \
reloc.c \
rtld.c \
@ -29,6 +30,7 @@ SRCS= \
libmap.c
MAN?= rtld.1
CSTD?= gnu99
ACFLAGS+= -DLOCORE
CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding
CFLAGS+= -I${SRCTOP}/lib/csu/common
.if exists(${RTLD_ELF_DIR}/${MACHINE_ARCH})
@ -75,7 +77,7 @@ beforeinstall:
-chflags -h noschg ${DESTDIR}/usr/libexec/${PROG}
.endif
.PATH: ${RTLD_ELF_DIR}/${RTLD_ARCH}
.PATH: ${RTLD_ELF_DIR}/${RTLD_ARCH} ${SRCTOP}/lib/csu/common
.if ${.CURDIR} == ${RTLD_ELF_DIR}
HAS_TESTS=

View File

@ -470,19 +470,6 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
}
direct_exec = true;
/*
* Set osrel for us, it is later reset to the binary'
* value before first instruction of code from the binary
* is executed.
*/
mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_OSREL;
mib[3] = getpid();
osrel = __FreeBSD_version;
sz = sizeof(old_osrel);
(void)sysctl(mib, 4, &old_osrel, &sz, &osrel, sizeof(osrel));
dbg("opening main program in direct exec mode");
if (argc >= 2) {
rtld_argc = parse_args(argv, argc, &search_in_path, &fd, &argv0);

View File

@ -1,86 +0,0 @@
#!/bin/sh
#
# Module: mkisoimages.sh
# Author: Jordan K Hubbard
# Date: 22 June 2001
#
# $FreeBSD$
#
# This script is used by release/Makefile to build the (optional) ISO images
# for a FreeBSD release. It is considered architecture dependent since each
# platform has a slightly unique way of making bootable CDs. This script
# is also allowed to generate any number of images since that is more of
# publishing decision than anything else.
#
# Usage:
#
# mkisoimages.sh [-b] image-label image-name base-bits-dir [extra-bits-dir]
#
# Where -b is passed if the ISO image should be made "bootable" by
# whatever standards this architecture supports (may be unsupported),
# image-label is the ISO image label, image-name is the filename of the
# resulting ISO image, base-bits-dir contains the image contents and
# extra-bits-dir, if provided, contains additional files to be merged
# into base-bits-dir as part of making the image.
set -e
if [ $# -lt 3 ]; then
echo "Usage: $0 [-b] image-label image-name base-bits-dir [extra-bits-dir]" > /dev/stderr
exit 1
fi
case "$1" in
-b) BOPT="$1"; shift ;;
esac
LABEL=`echo "$1" | tr '[:lower:]' '[:upper:]'`; shift
NAME="$1"; shift
BASEBITSDIR="$1"
# Create an ISO image
publisher="The FreeBSD Project. https://www.FreeBSD.org/"
echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$BASEBITSDIR/etc/fstab"
makefs -t cd9660 -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME.tmp" "$@"
rm -f "$BASEBITSDIR/etc/fstab"
if [ "$BOPT" != "-b" ]; then
mv "$NAME.tmp" "$NAME"
exit 0
fi
TMPIMGDIR=`mktemp -d /tmp/bootfs.XXXXXXXX` || exit 1
BOOTFSDIR="$TMPIMGDIR/bootfs"
BOOTFSIMG="$TMPIMGDIR/bootfs.img"
# Create a boot filesystem
mkdir -p "$BOOTFSDIR/boot"
cp -p "$BASEBITSDIR/boot/loader" "$BOOTFSDIR/boot"
makefs -t ffs -B be -M 512k "$BOOTFSIMG" "$BOOTFSDIR"
dd if="$BASEBITSDIR/boot/boot1" of="$BOOTFSIMG" bs=512 conv=notrunc,sync
# Create a boot ISO image
: ${CYLSIZE:=640}
ISOSIZE=$(stat -f %z "$NAME.tmp")
ISOBLKS=$((($ISOSIZE + 511) / 512))
ISOCYLS=$((($ISOBLKS + ($CYLSIZE - 1)) / $CYLSIZE))
BOOTFSSIZE=$(stat -f %z "$BOOTFSIMG")
BOOTFSBLKS=$((($BOOTFSSIZE + 511) / 512))
BOOTFSCYLS=$((($BOOTFSBLKS + ($CYLSIZE - 1)) / $CYLSIZE))
ENDCYL=$(($ISOCYLS + $BOOTFSCYLS))
NSECTS=$(($ENDCYL * 1 * $CYLSIZE))
dd if="$NAME.tmp" of="$NAME" bs="${CYLSIZE}b" conv=notrunc,sync
dd if="$BOOTFSIMG" of="$NAME" bs="${CYLSIZE}b" seek=$ISOCYLS conv=notrunc,sync
# The number of alternative cylinders is always 2.
dd if=/dev/zero of="$NAME" bs="${CYLSIZE}b" seek=$ENDCYL count=2 conv=notrunc,sync
rm -rf "$NAME.tmp" "$TMPIMGDIR"
# Write VTOC8 label to boot ISO image
MD=`mdconfig -a -t vnode -S 512 -y 1 -x "$CYLSIZE" -f "$NAME"`
gpart create -s VTOC8 $MD
# !4: usr, for ISO image part
gpart add -i 1 -s "$(($ISOCYLS * $CYLSIZE * 512))b" -t \!4 $MD
# !2: root, for bootfs part.
gpart add -i 6 -s "$(($BOOTFSCYLS * $CYLSIZE * 512))b" -t \!2 $MD
mdconfig -d -u ${MD#md}

View File

@ -1,10 +0,0 @@
#!/bin/sh
#
# $FreeBSD$
#
# Configuration file for release/release.sh to build sparc64/sparc64.
TARGET="sparc64"
TARGET_ARCH="sparc64"
KERNEL="GENERIC"

View File

@ -147,10 +147,6 @@ CRUNCH_ALIAS_bsdlabel= disklabel
#CRUNCH_LIBS+= -lsmb
.endif
.if ${MACHINE_CPUARCH} == "sparc64"
CRUNCH_PROGS_sbin+= bsdlabel sunlabel
.endif
.if ${MACHINE_CPUARCH} == "amd64"
CRUNCH_PROGS_sbin+= bsdlabel fdisk
CRUNCH_ALIAS_bsdlabel= disklabel

View File

@ -190,7 +190,7 @@ static struct camcontrol_opts option_table[] = {
{"rescan", CAM_CMD_RESCAN, CAM_ARG_NONE, NULL},
{"reset", CAM_CMD_RESET, CAM_ARG_NONE, NULL},
{"cmd", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts},
{"mmcsdcmd", CAM_CMD_MMCSD_CMD, CAM_ARG_NONE, "c:a:f:Wb:l:41S:I"},
{"mmcsdcmd", CAM_CMD_MMCSD_CMD, CAM_ARG_NONE, "c:a:F:f:Wb:l:41S:I"},
{"command", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts},
{"smpcmd", CAM_CMD_SMP_CMD, CAM_ARG_NONE, "r:R:"},
{"smprg", CAM_CMD_SMP_RG, CAM_ARG_NONE, smprg_opts},
@ -7833,10 +7833,12 @@ mmcsdcmd(struct cam_device *device, int argc, char **argv, char *combinedopt,
int retval;
int is_write = 0;
int is_bw_4 = 0, is_bw_1 = 0;
int is_frequency = 0;
int is_highspeed = 0, is_stdspeed = 0;
int is_info_request = 0;
int flags = 0;
uint8_t mmc_data_byte = 0;
uint32_t mmc_frequency = 0;
/* For IO_RW_EXTENDED command */
uint8_t *mmc_data = NULL;
@ -7873,6 +7875,10 @@ mmcsdcmd(struct cam_device *device, int argc, char **argv, char *combinedopt,
case 'I':
is_info_request = 1;
break;
case 'F':
is_frequency = 1;
mmc_frequency = strtol(optarg, NULL, 0);
break;
case 'c':
mmc_opcode = strtol(optarg, NULL, 0);
if (mmc_opcode < 0) {
@ -7978,6 +7984,23 @@ mmcsdcmd(struct cam_device *device, int argc, char **argv, char *combinedopt,
return (retval);
}
if (is_frequency) {
struct ccb_trans_settings_mmc *cts;
ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
ccb->ccb_h.flags = 0;
cts = &ccb->cts.proto_specific.mmc;
cts->ios.clock = mmc_frequency;
cts->ios_valid = MMC_CLK;
if (((retval = cam_send_ccb(device, ccb)) < 0)
|| ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) {
warn("Error sending command");
} else {
printf("Parameters set OK\n");
}
cam_freeccb(ccb);
return (retval);
}
// Switch bus speed instead of sending IO command
if (is_stdspeed || is_highspeed) {
struct ccb_trans_settings_mmc *cts;
@ -8011,13 +8034,48 @@ mmcsdcmd(struct cam_device *device, int argc, char **argv, char *combinedopt,
printf("Host OCR: 0x%x\n", cts->host_ocr);
printf("Min frequency: %u KHz\n", cts->host_f_min / 1000);
printf("Max frequency: %u MHz\n", cts->host_f_max / 1000000);
printf("Supported bus width: ");
printf("Supported bus width:\n");
if (cts->host_caps & MMC_CAP_4_BIT_DATA)
printf(" 4 bit\n");
if (cts->host_caps & MMC_CAP_8_BIT_DATA)
printf(" 8 bit\n");
printf("\nCurrent settings:\n");
printf("Bus width: ");
printf("Supported operating modes:\n");
if (cts->host_caps & MMC_CAP_HSPEED)
printf(" Can do High Speed transfers\n");
if (cts->host_caps & MMC_CAP_UHS_SDR12)
printf(" Can do UHS SDR12\n");
if (cts->host_caps & MMC_CAP_UHS_SDR25)
printf(" Can do UHS SDR25\n");
if (cts->host_caps & MMC_CAP_UHS_SDR50)
printf(" Can do UHS SDR50\n");
if (cts->host_caps & MMC_CAP_UHS_SDR104)
printf(" Can do UHS SDR104\n");
if (cts->host_caps & MMC_CAP_UHS_DDR50)
printf(" Can do UHS DDR50\n");
if (cts->host_caps & MMC_CAP_MMC_DDR52_120)
printf(" Can do eMMC DDR52 at 1.2V\n");
if (cts->host_caps & MMC_CAP_MMC_DDR52_180)
printf(" Can do eMMC DDR52 at 1.8V\n");
if (cts->host_caps & MMC_CAP_MMC_HS200_120)
printf(" Can do eMMC HS200 at 1.2V\n");
if (cts->host_caps & MMC_CAP_MMC_HS200_180)
printf(" Can do eMMC HS200 at 1.8V\n");
if (cts->host_caps & MMC_CAP_MMC_HS400_120)
printf(" Can do eMMC HS400 at 1.2V\n");
if (cts->host_caps & MMC_CAP_MMC_HS400_180)
printf(" Can do eMMC HS400 at 1.8V\n");
printf("Supported VCCQ voltages:\n");
if (cts->host_caps & MMC_CAP_SIGNALING_120)
printf(" 1.2V\n");
if (cts->host_caps & MMC_CAP_SIGNALING_180)
printf(" 1.8V\n");
if (cts->host_caps & MMC_CAP_SIGNALING_330)
printf(" 3.3V\n");
printf("Current settings:\n");
printf(" Bus width: ");
switch (cts->ios.bus_width) {
case bus_width_1:
printf("1 bit\n");
@ -8029,10 +8087,23 @@ mmcsdcmd(struct cam_device *device, int argc, char **argv, char *combinedopt,
printf("8 bit\n");
break;
}
printf("Freq: %d.%03d MHz%s\n",
printf(" Freq: %d.%03d MHz%s\n",
cts->ios.clock / 1000000,
(cts->ios.clock / 1000) % 1000,
cts->ios.timing == bus_timing_hs ? "(high-speed timing)" : "");
cts->ios.timing == bus_timing_hs ? " (high-speed timing)" : "");
printf(" VCCQ: ");
switch (cts->ios.vccq) {
case vccq_330:
printf("3.3V\n");
break;
case vccq_180:
printf("1.8V\n");
break;
case vccq_120:
printf("1.2V\n");
break;
}
return (0);
}

View File

@ -1,54 +0,0 @@
#
# $FreeBSD$
# @(#)ttys 5.1 (Berkeley) 4/17/89
#
# This file specifies various information about terminals on the system.
# It is used by several different programs. Common entries for the
# various columns include:
#
# name The name of the terminal device.
#
# getty The program to start running on the terminal. Typically a
# getty program, as the name implies. Other common entries
# include none, when no getty is needed, and xdm, to start the
# X Window System.
#
# type The initial terminal type for this port. For hardwired
# terminal lines, this will contain the type of terminal used.
# For virtual consoles, the correct type is typically xterm.
# Other common values include dialup for incoming modem ports, and
# unknown when the terminal type cannot be predetermined.
#
# status Must be on or off. If on, init will run the getty program on
# the specified port. If the word "secure" appears, this tty
# allows root login.
#
# name getty type status comments
#
# If console is marked "insecure", then init will ask for the root password
# when going to single-user mode.
console none unknown off secure
# ofw_console(4)
screen "/usr/libexec/getty Pc" vt100 off secure
ttya "/usr/libexec/getty 3wire.9600" vt100 off secure
ttyb "/usr/libexec/getty 3wire.9600" vt100 off secure
# syscons(4)
ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure
# Virtual terminals
ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure
ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure
ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure
ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure
ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure
ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure
ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure
ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure
# Serial terminals
# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
# uart(4)
ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure
ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure
ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure
ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure
# Dumb console
dcons "/usr/libexec/getty std.9600" vt100 off secure

View File

@ -498,10 +498,12 @@ MDTestSuite(const Algorithm_t *alg)
for (i = 0; i < MDTESTCOUNT; i++) {
(*alg->Data)(MDTestInput[i], strlen(MDTestInput[i]), buffer);
printf("%s (\"%s\") = %s", alg->name, MDTestInput[i], buffer);
if (strcmp(buffer, (*alg->TestOutput)[i]) == 0)
if (strcmp(buffer, (*alg->TestOutput)[i]) == 0) {
printf(" - verified correct\n");
else
} else {
printf(" - INCORRECT RESULT!\n");
failed++;
}
}
}

View File

@ -159,7 +159,16 @@ should be specified without instance or domain and is typically
.Dq "host" ,
.Dq "nfs"
or
.Dq "root" .
.Dq "root" ,
although the form
.Sm off
.Aq Ar service
@
.Aq Ar fqdn
.Sm on
can also be used if the local system's
.Xr gethostname 3
value does not match the host-based principal in the keytab.
.It Cm hard
Same as not specifying
.Cm soft .

View File

@ -151,15 +151,15 @@ print_namespace(struct nvme_namespace_data *nsdata)
uint128_to_str(to128(nsdata->nvmcap), cbuf, sizeof(cbuf)));
if ((nsdata->nsfeat >> NVME_NS_DATA_NSFEAT_NPVALID_SHIFT) &
NVME_NS_DATA_NSFEAT_NPVALID_MASK) {
printf("Preferred Write Granularity: %u blocks",
printf("Preferred Write Granularity: %u blocks\n",
nsdata->npwg + 1);
printf("Preferred Write Alignment: %u blocks",
printf("Preferred Write Alignment: %u blocks\n",
nsdata->npwa + 1);
printf("Preferred Deallocate Granul: %u blocks",
printf("Preferred Deallocate Granul: %u blocks\n",
nsdata->npdg + 1);
printf("Preferred Deallocate Align: %u blocks",
printf("Preferred Deallocate Align: %u blocks\n",
nsdata->npda + 1);
printf("Optimal Write Size: %u blocks",
printf("Optimal Write Size: %u blocks\n",
nsdata->nows + 1);
}
printf("Globally Unique Identifier: ");

View File

@ -19,6 +19,9 @@ CFLAGS+= -DINET6
.endif
CFLAGS+= -I.
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests
keywords.h: keywords
LC_ALL=C awk '!/^#|^$$/ { \
printf "#define\tK_%s\t%d\n\t{\"%s\", K_%s},\n", \

11
sbin/route/tests/Makefile Normal file
View File

@ -0,0 +1,11 @@
# $FreeBSD$
PACKAGE= tests
ATF_TESTS_SH+= \
basic
${PACKAGE}FILES+= \
utils.subr
.include <bsd.test.mk>

125
sbin/route/tests/basic.sh Normal file
View File

@ -0,0 +1,125 @@
#-
# SPDX-License-Identifier: BSD-2-Clause-FreeBSD
#
# Copyright (c) 2020 Ahsan Barkati
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD$
#
. $(atf_get_srcdir)/utils.subr
atf_test_case "basic_v4" "cleanup"
basic_v4_head()
{
atf_set descr 'add/change/delete route test for v4'
atf_set require.user root
atf_set require.progs jq
}
basic_v4_body()
{
epair=$(vnet_mkepair)
ifconfig ${epair}a 192.0.2.2/24 up
vnet_mkjail alcatraz ${epair}b
jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up
# add a new route in the jail
jexec alcatraz route add 192.0.2.3 192.0.2.2
gateway=$(check_route "alcatraz" "192.0.2.3")
if [ "${gateway}" != "192.0.2.2" ]; then
atf_fail "Failed to add new route."
fi
# change the added route
jexec alcatraz route change 192.0.2.3 192.0.2.4
gateway=$(check_route "alcatraz" "192.0.2.3")
if [ "${gateway}" != "192.0.2.4" ]; then
atf_fail "Failed to change route."
fi
# delete the route
jexec alcatraz route delete 192.0.2.3
gateway=$(check_route "alcatraz" "192.0.2.3")
if [ "${gateway}" != "" ]; then
atf_fail "Failed to delete route."
fi
}
basic_v4_cleanup()
{
vnet_cleanup
}
atf_test_case "basic_v6" "cleanup"
basic_v6_head()
{
atf_set descr 'add/change/delete route test for v6'
atf_set require.user root
atf_set require.progs jq
}
basic_v6_body()
{
epair=$(vnet_mkepair)
ifconfig ${epair}a inet6 2001:db8:cc4b::1/64 up no_dad
vnet_mkjail alcatraz ${epair}b
jexec alcatraz ifconfig ${epair}b inet6 2001:db8:cc4b::2/64 up no_dad
# add a new route in the jail
jexec alcatraz route add -6 2001:db8:cc4b::3 2001:db8:cc4b::1
gateway=$(check_route "alcatraz" "2001:db8:cc4b::3")
if [ "${gateway}" != "2001:db8:cc4b::1" ]; then
atf_fail "Failed to add new route."
fi
# change the added route
jexec alcatraz route change -6 2001:db8:cc4b::3 2001:db8:cc4b::4
gateway=$(check_route "alcatraz" "2001:db8:cc4b::3")
if [ "${gateway}" != "2001:db8:cc4b::4" ]; then
atf_fail "Failed to change route."
fi
# delete the route
jexec alcatraz route -6 delete 2001:db8:cc4b::3
gateway=$(check_route "alcatraz" "2001:db8:cc4b::3")
if [ "${gateway}" != "" ]; then
atf_fail "Failed to delete route."
fi
}
basic_v6_cleanup()
{
vnet_cleanup
}
atf_init_test_cases()
{
atf_add_test_case "basic_v4"
atf_add_test_case "basic_v6"
}

View File

@ -0,0 +1,47 @@
#-
# SPDX-License-Identifier: BSD-2-Clause-FreeBSD
#
# Copyright (c) 2020 Ahsan Barkati
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD$
#
. $(atf_get_srcdir)/../../sys/common/vnet.subr
check_route()
{
jname=$1
dest=$2
result=$(jexec $jname netstat -r --libxo json)
# This query selects the JSON item from the array of rt-entry
# for which the destination address is $dest
query=".statistics.\"route-information\".\"route-table\".\"rt-family\"[0].\"rt-entry\"[]|select(.destination==\"${dest}\")"
# Gateway is then extracted from the JSON item as described above
gateway=$(echo $result | jq -r ${query}.gateway)
echo ${gateway}
}

View File

@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd May 8, 2020
.Dd July 28, 2020
.Dt SIGINFO 3
.Os
.Sh NAME
@ -68,7 +68,7 @@ sending process ID
.It Vt uid_t Ta Va si_uid Ta
sending process's real user ID
.It Vt void Ta Va *si_addr Ta
address of faulting instruction
virtual address
.It Vt int Ta Va si_status Ta
exit value or signal
.It Vt long Ta Va si_band Ta
@ -208,25 +208,24 @@ signal sent by
.Xr pthread_kill 3
.El
.Pp
For synchronous signals,
.Va si_addr
is generally set to the address of the faulting instruction.
However, synchronous signals raised by a faulting memory access such as
.Dv SIGSEGV
and
.Dv SIGBUS
may report the address of the faulting memory access (if available) in
.Va si_addr
instead.
.Pp
Sychronous signals set
.Va si_trapno
to a machine-dependent trap number.
.Pp
In addition, the following signal-specific information is available:
.Bl -column ".Dv SIGPOLL" ".Dv CLD_CONTINUED"
.It Sy Signal Ta Sy Member Ta Sy Value
.It Dv SIGILL Ta Va si_addr Ta
address of faulting instruction
.It Ta Va si_trapno Ta
machine dependent of trap code
.It Dv SIGFPE Ta Va si_addr Ta
address of faulting instruction
.It Ta Va si_trapno Ta
machine dependent of trap code
.It Dv SIGSEGV Ta Va si_addr Ta
address of faulting memory reference
.It Ta Va si_trapno Ta
machine dependent of trap code
.It Dv SIGBUS Ta Va si_addr Ta
address of faulting instruction
.It Ta Va si_trapno Ta
machine dependent of trap code
.It Dv SIGCHLD Ta Va si_pid Ta
child process ID
.It Ta Va si_status Ta

View File

@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd February 25, 2020
.Dd July 27, 2020
.Dt TREE 3
.Os
.Sh NAME
@ -99,7 +99,7 @@
.Nm RB_INSERT ,
.Nm RB_REMOVE ,
.Nm RB_REINSERT
.Nd "implementations of splay and red-black trees"
.Nd "implementations of splay and rank-balanced (wavl) trees"
.Sh SYNOPSIS
.In sys/tree.h
.Fn SPLAY_PROTOTYPE NAME TYPE FIELD CMP
@ -195,7 +195,7 @@
.Fn RB_REINSERT NAME "RB_HEAD *head" "struct TYPE *elm"
.Sh DESCRIPTION
These macros define data structures for different types of trees:
splay trees and red-black trees.
splay trees and rank-balanced (wavl) trees.
.Pp
In the macro definitions,
.Fa TYPE
@ -364,26 +364,27 @@ macro:
The
.Fn SPLAY_EMPTY
macro should be used to check whether a splay tree is empty.
.Sh RED-BLACK TREES
A red-black tree is a binary search tree with the node color as an
extra attribute.
It fulfills a set of conditions:
.Bl -enum -offset indent
.It
Every search path from the root to a leaf consists of the same number of
black nodes.
.It
Each red node (except for the root) has a black parent.
.It
Each leaf node is black.
.El
.Sh RANK-BALANCED TREES
Rank-balanced (RB) trees are a framework for defining height-balanced
binary search trees, including AVL and red-black trees.
Each tree node has an associated rank.
Balance conditions are expressed by conditions on the differences in
rank between any node and its children.
Rank differences are stored in each tree node.
.Pp
Every operation on a red-black tree is bounded as
.Fn O "lg n" .
The maximum height of a red-black tree is
.Fn 2lg "n + 1" .
The balance conditions implemented by the RB macros lead to weak AVL
(wavl) trees, which combine the best aspects of AVL and red-black
trees.
Wavl trees rebalance after an insertion in the same way AVL trees do,
with the same worst-case time as red-black trees offer, and with
better balance in the resulting tree.
Wavl trees rebalance after a removal in a way that requires less
restructuring, in the worst case, than either AVL or red-black trees
do.
Removals can lead to a tree almost as unbalanced as a red-black
tree; insertions lead to a tree becoming as balanced as an AVL tree.
.Pp
A red-black tree is headed by a structure defined by the
A rank-balanced tree is headed by a structure defined by the
.Fn RB_HEAD
macro.
A
@ -488,7 +489,7 @@ The
macro initializes the tree referenced by
.Fa head .
.Pp
The red-black tree can also be initialized statically by using the
The rank-balanced tree can also be initialized statically by using the
.Fn RB_INITIALIZER
macro like this:
.Bd -ragged -offset indent
@ -567,7 +568,7 @@ and will be overwritten to provide safe traversal.
.Pp
The
.Fn RB_EMPTY
macro should be used to check whether a red-black tree is empty.
macro should be used to check whether a rank-balanced tree is empty.
.Pp
The
.Fn RB_REINSERT
@ -581,7 +582,7 @@ a node's key.
This is a lower overhead alternative to removing the element
and reinserting it again.
.Sh EXAMPLES
The following example demonstrates how to declare a red-black tree
The following example demonstrates how to declare a rank-balanced tree
holding integers.
Values are inserted into it and the contents of the tree are printed
in order.
@ -697,6 +698,17 @@ to indicate an error.
.Sh SEE ALSO
.Xr arb 3 ,
.Xr queue 3
.Rs
.%A "Bernhard Haeupler"
.%A "Siddhartha Sen"
.%A "Robert E. Tarjan"
.%T "Rank-Balanced Trees"
.%U "http://sidsen.azurewebsites.net/papers/rb-trees-talg.pdf"
.%J "ACM Transactions on Algorithms"
.%V "11"
.%N "4"
.%D "June 2015"
.Re
.Sh HISTORY
The tree macros first appeared in
.Fx 4.6 .

View File

@ -121,7 +121,6 @@ MAN= aac.4 \
cxgb.4 \
cxgbe.4 \
cxgbev.4 \
cy.4 \
cyapa.4 \
da.4 \
dc.4 \
@ -434,7 +433,6 @@ MAN= aac.4 \
${_qlnxe.4} \
ral.4 \
random.4 \
rc.4 \
rctl.4 \
re.4 \
rgephy.4 \
@ -442,7 +440,6 @@ MAN= aac.4 \
rl.4 \
rndtest.4 \
route.4 \
rp.4 \
rtwn.4 \
rtwnfw.4 \
rtwn_pci.4 \

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd September 26, 2017
.Dd July 29, 2020
.Dt AESNI 4
.Os
.Sh NAME
@ -88,6 +88,7 @@ implementations.
.Xr ipsec 4 ,
.Xr padlock 4 ,
.Xr random 4 ,
.Xr crypto 7 ,
.Xr crypto 9
.Sh HISTORY
The

View File

@ -1,257 +0,0 @@
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Systems Programming Group of the University of Utah Computer
.\" Science Department.
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" from: @(#)dca.4 5.2 (Berkeley) 3/27/91
.\" from: com.4,v 1.1 1993/08/06 11:19:07 cgd Exp
.\" from: sio.4,v 1.16 1995/06/26 06:05:30 bde Exp $
.\" $FreeBSD$
.\"
.Dd May 24, 2004
.Dt CY 4
.Os
.Sh NAME
.Nm cy
.Nd Cyclades Cyclom-Y serial driver
.Sh SYNOPSIS
For one ISA card:
.Bd -ragged -offset indent -compact
.Cd "device cy"
.Pp
In
.Pa /boot/device.hints :
.Cd hint.cy.0.at="isa"
.Cd hint.cy.0.irq="10"
.Cd hint.cy.0.maddr="0xd4000"
.Cd hint.cy.0.msize="0x2000"
.Ed
.Pp
For two ISA cards:
.Bd -ragged -offset indent -compact
.Cd "device cy"
.Pp
In
.Pa /boot/device.hints :
.Cd hint.cy.0.at="isa"
.Cd hint.cy.0.irq="10"
.Cd hint.cy.0.maddr="0xd4000"
.Cd hint.cy.0.msize="0x2000"
.Cd hint.cy.1.at="isa"
.Cd hint.cy.1.irq="11"
.Cd hint.cy.1.maddr="0xd6000"
.Cd hint.cy.1.msize="0x2000"
.Ed
.Pp
For PCI cards:
.Bd -ragged -offset indent -compact
.Cd "device cy"
.Cd "options CY_PCI_FASTINTR"
.Pp
No lines are required in
.Pa /boot/device.hints
for PCI cards.
.Ed
.Pp
Minor numbering:
.Bd -literal -offset indent -compact
0b\fIMMMMMMMMMMMMMMMMxxxxxxxxOLIMMMMM\fR
call\fBO\fRut
\fBL\fRock
\fBI\fRnitial
\fBMMMMMMMMMMMMMMMM MMMMMM\fRinor
.Ed
.Sh DESCRIPTION
The
.Nm
driver provides support for Cirrus Logic CD1400-based
.Tn EIA
.Tn RS-232C
.Pf ( Tn CCITT
.Tn V.24 )
communications interfaces (ports) on Cyclades Cyclom-Y boards.
Each CD1400 provides 4 ports.
Cyclom-Y boards with various numbers of CD1400's are available.
This driver supports up to 8 CD1400's (32 ports) per board.
.Pp
Input and output for each line may set independently
to the following speeds:
50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2400, 4800, 9600,
19200, 38400, 57600, or 115200 bps.
Other speeds of up to 150000 are supported by the termios interface
but not by the sgttyb compatibility interface.
The CD1400 is not fast enough to handle speeds above 115200 bps
effectively.
It can transmit on a single line at slightly more than 115200 bps,
but when 4 lines are active in both directions its limit is about
90000 bps on each line.
.\" XXX the following should be true for all serial drivers and
.\" should not be repeated in the man pages for all serial drivers.
.\" It was copied from sio.4. The only change was s/sio/cy/g.
.Pp
Serial ports controlled by the
.Nm
driver can be used for both `callin' and `callout'.
For each port there is a callin device and a callout device.
The minor number of the callout device is 128 higher
than that of the corresponding callin port.
The callin device is general purpose.
Processes opening it normally wait for carrier
and for the callout device to become inactive.
The callout device is used to steal the port from
processes waiting for carrier on the callin device.
Processes opening it do not wait for carrier
and put any processes waiting for carrier on the callin device into
a deeper sleep so that they do not conflict with the callout session.
The callout device is abused for handling programs that are supposed
to work on general ports and need to open the port without waiting
but are too stupid to do so.
.Pp
The
.Nm
driver also supports an initial-state and a lock-state control
device for each of the callin and the callout "data" devices.
The minor number of the initial-state device is 32 higher
than that of the corresponding data device.
The minor number of the lock-state device is 64 higher
than that of the corresponding data device.
The termios settings of a data device are copied
from those of the corresponding initial-state device
on first opens and are not inherited from previous opens.
Use
.Xr stty 1
in the normal way on the initial-state devices to program
initial termios states suitable for your setup.
.Pp
The lock termios state acts as flags to disable changing
the termios state.
E.g., to lock a flag variable such as
CRTSCTS, use
.Em "stty crtscts"
on the lock-state device.
Speeds and special characters
may be locked by setting the corresponding value in the lock-state
device to any nonzero value.
.Pp
Correct programs talking to correctly wired external devices
work with almost arbitrary initial states and almost no locking,
but other setups may benefit from changing some of the default
initial state and locking the state.
In particular, the initial states for non (POSIX) standard flags
should be set to suit the devices attached and may need to be
locked to prevent buggy programs from changing them.
E.g., CRTSCTS should be locked on for devices that support
RTS/CTS handshaking at all times and off for devices that do not
support it at all.
CLOCAL should be locked on for devices
that do not support carrier.
HUPCL may be locked off if you do not
want to hang up for some reason.
In general, very bad things happen
if something is locked to the wrong state, and things should not
be locked for devices that support more than one setting.
The
CLOCAL flag on callin ports should be locked off for logins
to avoid certain security holes, but this needs to be done by
getty if the callin port is used for anything else.
.Ss Kernel Configuration Options
The
.Em CY_PCI_FASTINTR
option should be used to avoid suboptimal interrupt handling for
PCI Cyclades boards.
The PCI BIOS must be configured with the
.Nm
interrupt not shared with any other active device
for this option to work.
This option is not the default because it is currently harmful in
certain cases where it does not work.
.Sh FILES
.\" XXX more cloning: s/d/c/g and add a ? for the card number.
.Bl -tag -width /dev/ttyic?? -compact
.It Pa /dev/ttyc??
for callin ports
.It Pa /dev/ttyic??
.It Pa /dev/ttylc??
corresponding callin initial-state and lock-state devices
.Pp
.\" XXX more cloning: s/a/c/g. No consistency :-(.
.It Pa /dev/cuac??
for callout ports
.It Pa /dev/cuaic??
.It Pa /dev/cualc??
corresponding callout initial-state and lock-state devices
.El
.Pp
.Bl -tag -width /etc/rc.serial -compact
.It Pa /etc/rc.serial
examples of setting the initial-state and lock-state devices
.El
.Pp
The first question mark in these device names is short for the
card number
(a decimal number between 0 and 65535 inclusive).
The second question mark is short for the port number
(a letter in the range [0-9a-v]).
.Sh DIAGNOSTICS
.Bl -diag
.\" XXX back to s/sio/cy/g.
.It cy%d: silo overflow.
Problem in the interrupt handler.
.El
.Bl -diag
.It cy%d: interrupt-level buffer overflow.
Problem in the bottom half of the driver.
.El
.Bl -diag
.It cy%d: tty-level buffer overflow.
Problem in the application.
Input has arrived faster than the given module could process it
and some has been lost.
.El
.\" .Bl -diag
.\" .It sio%d: reduced fifo trigger level to %d.
.\" Attempting to avoid further silo overflows.
.\" .El
.Sh SEE ALSO
.Xr stty 1 ,
.Xr termios 4 ,
.Xr tty 4 ,
.Xr comcontrol 8 ,
.Xr pstat 8
.Sh HISTORY
The
.Nm
driver is derived from the
.Nm sio
driver and the
.Nx
.Nm
driver and is
.Ud
.Sh BUGS
Serial consoles are not implemented.

View File

@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd May 11, 2020
.Dd July 29, 2020
.Dt HIFN 4
.Os
.Sh NAME
@ -101,11 +101,11 @@ See
Contains a 7955 and supports symmetric and random number operations.
.El
.Sh SEE ALSO
.Xr crypt 3 ,
.Xr crypto 4 ,
.Xr intro 4 ,
.Xr ipsec 4 ,
.Xr random 4 ,
.Xr crypto 7 ,
.Xr crypto 9
.Sh HISTORY
The

View File

@ -106,6 +106,12 @@ For more information on configuring this device, see
This driver requires the firmware built with the
.Nm iwmfw
module to work.
.Pp
Currently,
.Nm
only supports 802.11b and 802.11g modes.
It will not associate to access points that are configured to operate only
in 802.11n or 802.11ac modes.
.Sh EXAMPLES
Join an existing BSS network (i.e., connect to an access point):
.Bd -literal -offset indent

View File

@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd October 20, 2016
.Dd July 29, 2020
.Dt ARMV8CRYPTO 4
.Os
.Sh NAME
@ -69,6 +69,7 @@ driver registers itself to accelerate AES operations for
.Xr intro 4 ,
.Xr ipsec 4 ,
.Xr random 4 ,
.Xr crypto 7 ,
.Xr crypto 9
.Sh HISTORY
The

View File

@ -16,7 +16,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 8, 2008
.Dd July 29, 2020
.Dt GLXSB 4 i386
.Os
.Sh NAME
@ -73,6 +73,7 @@ device driver with AES keys of length != 128 bits.
.Xr ipsec 4 ,
.Xr pci 4 ,
.Xr random 4 ,
.Xr crypto 7 ,
.Xr crypto 9
.Sh HISTORY
The

View File

@ -35,7 +35,7 @@
.\" $FreeBSD$
.\" $Whistle: ng_iface.8,v 1.5 1999/01/25 23:46:26 archie Exp $
.\"
.Dd February 6, 2019
.Dd July 31, 2020
.Dt NG_IFACE 4
.Os
.Sh NAME
@ -70,7 +70,7 @@ Packets transmitted via the interface flow out the corresponding
protocol-specific hook.
Similarly, packets received on a hook appear on the interface as
packets received into the corresponding protocol stack.
The currently supported protocols are IP, IPv6, ATM, NATM, and NS.
The currently supported protocols are IP and IPv6.
.Pp
An
.Nm iface
@ -87,12 +87,6 @@ This node type supports the following hooks:
Transmission and reception of IP packets.
.It Va inet6
Transmission and reception of IPv6 packets.
.It Va atm
Transmission and reception of ATM packets.
.It Va natm
Transmission and reception of NATM packets.
.It Va ns
Transmission and reception of NS packets.
.El
.Sh CONTROL MESSAGES
This node type supports the generic control messages, plus the following:

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd February 8, 2010
.Dd July 29, 2020
.Dt PADLOCK 4
.Os
.Sh NAME
@ -72,6 +72,7 @@ subsystem.
.Xr intro 4 ,
.Xr ipsec 4 ,
.Xr random 4 ,
.Xr crypto 7 ,
.Xr crypto 9
.Sh HISTORY
The

View File

@ -1,124 +0,0 @@
.\"
.\" Copyright (c) 2004 Tom Rhodes
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd March 18, 2005
.Dt RC 4
.Os
.Sh NAME
.Nm rc
.Nd RISCom/8 multiport card
.Sh SYNOPSIS
.Cd device isa
.Cd device rc
.Sh DESCRIPTION
The
.Tn RISCom/8
is an eight port
.Tn ISA
.Tn RS-232C
communications multiplexer with a built in
.Tn RISC
processor.
It uses a block of sixteen
.Tn I/O
ports in the range 0x200 to 0x3f0 selectable by on-board
switches or jumpers.
The block must be aligned on a sixteen port boundary.
The jumper-selectable hardware interrupt level may be set to
be detected during system
initialization using settings found in the
.Pa /boot/device.hints
file.
.Pp
This driver is mostly based on the Cirrus Logic CL-CD180 driver.
.Sh HARDWARE
The
.Nm
driver provides support for the
.Tn SDL
Communications
.Tn RISCom/8
boards.
.Sh DIAGNOSTICS
The following driver specific error messages
may be reported:
.Bl -diag
.It "rc%d channel%d: interrupt-level buffer overflow"
An internal buffer overflow error has occurred on
the listed channel.
The
.Nm
driver will need to be reloaded to correct this.
.It "rc%d: Bad char chan %d"
The channel has obtained a bad set of characters.
.It "rc%d: Got extra chars chan %d"
The
.Nm
driver got more characters than expected on the channel shown.
.It "rc%d: data mismatch chan %d ptr %d (%d != %d)"
Data sent from channel
.Ar %d
to the rx buffer was different then expected.
.It "rc%d: channel %d command timeout, rc.c line: %d"
A command timeout has occurred on the channel, the
.Pa src/sys/dev/rc/rc.c
file can be consulted for more information.
.El
.Sh SEE ALSO
.Xr tty 1 ,
.Xr ttyname 3 ,
.Xr tty 4 ,
.Xr device.hints 5 ,
.Xr comcontrol 8 ,
.Xr getty 8 ,
.Xr mutex 9 ,
.Xr splx 9
.Pp
.Pa http://www.sdlcomm.com
.Sh HISTORY
The
.Nm
driver first appeared in
.Fx 2.0.5 .
This manual page first appeared in
.Fx 5.3 .
.Sh AUTHORS
This manual page was written by
.An Tom Rhodes Aq Mt trhodes@FreeBSD.org .
.Sh BUGS
The
.Nm
driver code still uses the
.Xr spl 9
functions.
These should be replaced by
.Xr mutex 9
functions.
.Pp
The various
.Fn ttyld_*
functions should be documented.

View File

@ -1,195 +0,0 @@
.\" Copyright (c) 1995 Comtrol, Inc.
.\" All rights reserved.
.\"
.\" $FreeBSD$
.Dd November 15, 1995
.Dt RP 4
.Os
.Sh NAME
.Nm rp
.Nd "driver for Comtrol RocketPort Intelligent Serial Port Cards"
.Sh SYNOPSIS
.Cd "device rp"
.Pp
For ISA cards, you must specify the port address in
.Pa /boot/device.hints :
.Cd hint.rp.0.at="isa"
.Cd hint.rp.0.port="0x100"
.Sh DESCRIPTION
This driver provides a kernel device driver for the
.Tn RocketPort
and
.Tn RocketPort RA
serial boards.
These boards provide 8, 16, or 32 high-speed serial ports
while requiring only 68 bytes of I/O space for all 8, 16,
or 32 ports, and do not require an interrupt channel.
This driver supports up to four
.Tn RocketPort
or
.Tn RocketPort RA
boards in one machine simultaneously.
If you are using four 32 port
.Tn RocketPort
boards, you can put as many as 128 intelligent serial ports
on your system.
.Pp
The
.Nm
driver supports the following speeds: 50, 75, 110, 134, 150,
200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 7200,
14400, 57600, 76800, 115200, and 230400.
(You must use
.Xr termios 4 ,
rather than the old style ioctl interface to use non-traditional
speeds.)
.Pp
An open on the
.Nm
driver will block until carrier is present, unless
.Dv O_NONBLOCK
or
.Dv CLOCAL
is set.
.Sh HARDWARE CONFIGURATION
The first
.Tn RocketPort
or
.Tn RocketPort RA
card requires a 68-byte contiguous block of I/O addresses,
starting at one of the following:
0x100h, 0x140h, 0x180h, 0x200h, 0x240h, 0x280h, 0x300h, 0x340h,
0x380h.
The second, third, and fourth
.Tn RocketPort
cards require only a
64-byte contiguous block of I/O addresses, starting at one of the
above address ranges.
The I/O address range used by any of the
.Tn RocketPort
cards must not conflict with any other cards in the system,
including other
.Tn RocketPort
cards.
The starting range of the I/O ports used by each card
must match with the I/O address specified in
.Pa /boot/device.hints .
.Pp
Since the first
.Tn RocketPort
uses 68 I/O addresses, if the first card is
set to use an I/O block starting at 0x100,
it will occupy the I/O ports between 0x100 and 0x143.
This means that the second, third, or fourth
.Tn RocketPort
board may not use the block of addresses starting at 0x140,
since the first three I/O addresses of that range
are used by the first board.
This is an important point to keep in mind.
.Pp
If you have two ISA cards, one installed at 0x100 and the
second installed at 0x180, then you should add the following to
.Pa /boot/device.hints :
.Pp
.Dl hint.rp.0.at="isa"
.Dl hint.rp.0.port="0x100"
.Dl hint.rp.1.at="isa"
.Dl hint.rp.1.port="0x180"
.Pp
The configuration of the
.Tn RocketPort
cards is done via the set of 8 DIP switches,
labeled SW1 on the
.Tn RocketPort
card:
.Bd -literal -offset indent
+-------------------------------+
| 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
+-------+-------+---------------+
| Unused| Card | I/O Port Block|
+-------------------------------+
.Ed
.Pp
DIP switches 7 and 8 are unused, and must be left on.
.Pp
DIP switches 6 and 5 identify the card number of each
.Tn RocketPort
card.
The first card installed in the system must have its DIP switches set
as card number one; the second card installed in the system must have
its DIP switches set as card number two; and so on.
As shipped from
the factory, DIP switches 6 and 5 are both on by default, indicating
that this is the first card installed on the system:
.Bd -literal -offset indent
DIP Switches
6 5
===================
On On First Card
On Off Second Card
Off On Third Card
Off Off Fourth Card
.Ed
.Pp
DIP switches 4, 3, 2, and 1 indicate the I/O address range used by the
first
.Tn RocketPort
card.
If there are more than one
.Tn RocketPort
cards installed in a system,
the second, third and fourth
.Tn RocketPort
cards must
also be set to the I/O address range used by the first
.Tn RocketPort
card;
all cards must have these DIP switches set identically
for proper operation.
As shipped from the factory, DIP switch 4 is on,
and switches 3, 2, and 1 are off by default,
indicating an I/O address range used by the first
card which starts at 0x180 and extends to 0x1C3.
.Bd -literal -offset indent
DIP Switches I/O Address Range
4 3 2 1 Used by the First Card
=====================================
On Off On Off 100-143
On Off Off On 140-183
On Off Off Off 180-1C3
Off On On Off 200-243
Off On Off On 240-283
Off On Off Off 280-2C3
Off Off On Off 300-343
Off Off Off On 340-383
Off Off Off Off 380-3C3
.Ed
.Sh FILES
.Bl -tag -width ".Pa /dev/ttyR[0-4][0-9a-f]"
.It Pa /dev/ttyR[0-4][0-9a-f]
.El
.Sh AUTHORS
.An Theodore Ts'o Aq Mt tytso@mit.edu
.Pp
This driver was written under contract for Comtrol Corporation.
For dealer, distributor and other information regarding Comtrol
.Tn RocketPort ,
contact Comtrol Corporation at (800) 926-6876 or send email to
.Aq Mt info@comtrol.com .
To report bugs for this driver, please send email to
.Aq Mt bug-bsdi-rocketport@comtrol.com .
.Sh BUGS
If incoming software flow control is enabled on a 486 or Pentium
machine, and the flow control is very heavily exercised, on rare occasions
a character will get dropped.
This problem does not occur on a 386, and
it is not currently known whether the bug is in the
.Nm
driver
or in the
.Bsx
tty layer.
.\" (Although my bet is that it's in the higher-level tty layer;
.\" given the bugs I found while writing this driver, it's clear
.\" the BSD software flow control code has not been tested very much
.\" at all! -- TYT)

View File

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"/
.Dd May 11, 2020
.Dd July 29, 2020
.Dt SAFE 4
.Os
.Sh NAME
@ -124,6 +124,7 @@ A faster version of the 1141.
.Xr intro 4 ,
.Xr ipsec 4 ,
.Xr random 4 ,
.Xr crypto 7 ,
.Xr crypto 9
.Sh BUGS
Public key support is not implemented.

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 23, 2020
.Dd July 29, 2020
.Dt SAFEXCEL 4
.Os
.Sh NAME
@ -75,6 +75,7 @@ with SHA1-HMAC and SHA2-HMAC for encrypt-then-authenticate operations.
.Xr crypto 4 ,
.Xr ipsec 4 ,
.Xr random 4 ,
.Xr crypto 7 ,
.Xr geli 8 ,
.Xr crypto 9
.Sh HISTORY

View File

@ -34,7 +34,7 @@
.\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"
.Dd April 27, 2020
.Dd July 23, 2020
.Dt TCP 4
.Os
.Sh NAME
@ -356,10 +356,22 @@ control message along with the decrypted payload.
The control message contains a
.Vt struct tls_get_record
which includes fields from the TLS record header.
If a corrupted TLS record is received,
If an invalid or corrupted TLS record is received,
recvmsg 2
will fail with
.Dv EBADMSG .
will fail with one of the following errors:
.Bl -tag -width Er
.It Bq Er EINVAL
The version fields in a TLS record's header did not match the version required
by the
.Vt struct tls_so_enable
structure used to enable in-kernel TLS.
.It Bq Er EMSGSIZE
A TLS record's length was either too small or too large.
.It Bq Er EMSGSIZE
The connection was closed after sending a truncated TLS record.
.It Bq Er EBADMSG
The TLS record failed to match the included authentication tag.
.El
.Pp
At present, only a single receive key may be set on a socket.
As such, users of this option must disable rekeying.

View File

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd February 4, 2020
.Dd July 17, 2020
.Dt PORTS 7
.Os
.Sh NAME
@ -437,6 +437,14 @@ Where to find/put distfiles, normally
.Pa distfiles/
in
.Va PORTSDIR .
.It Va SU_CMD
Command used to elevate privilege to configure and install a port.
The unprivileged user must have write access to
.Va WRKDIRPREFIX
and
.Va DISTDIR .
The default is
.Ql /usr/bin/su root -c
.It Va PACKAGES
Used only for the
.Cm package

View File

@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd September 5, 2019
.Dd July 31, 2020
.Dt RC.SUBR 8
.Os
.Sh NAME
@ -237,8 +237,13 @@ The
.Ar name
argument is the
.Xr basename 1
component of the path to the script, usually
.Pa /etc/rc.d/name .
component of the path to the script located at
.Pa /etc/rc.d
(scripts stored in other locations such as
.Pa /usr/local/etc/rc.d
cannot be controlled with
.Ic force_depend
currently).
If the script fails for any reason it will output a warning
and return with a return value of 1.
If it was successful
@ -877,7 +882,11 @@ Prevent booting to multiuser mode.
If the
.Va autoboot
variable is set to
.Ql yes ,
.Ql yes
(see
.Xr rc 8
to learn more about
.Va autoboot ) ,
or
.Ic checkyesno Ar always
indicates a truth value, then a

View File

@ -607,13 +607,19 @@ MLINKS+=bitset.9 BITSET_DEFINE.9 \
bitset.9 BIT_EMPTY.9 \
bitset.9 BIT_ISFULLSET.9 \
bitset.9 BIT_FFS.9 \
bitset.9 BIT_FLS.9 \
bitset.9 BIT_COUNT.9 \
bitset.9 BIT_SUBSET.9 \
bitset.9 BIT_OVERLAP.9 \
bitset.9 BIT_CMP.9 \
bitset.9 BIT_OR.9 \
bitset.9 BIT_OR2.9 \
bitset.9 BIT_AND.9 \
bitset.9 BIT_AND2.9 \
bitset.9 BIT_ANDNOT.9 \
bitset.9 BIT_ANDNOT2.9 \
bitset.9 BIT_XOR.9 \
bitset.9 BIT_XOR2.9 \
bitset.9 BIT_CLR_ATOMIC.9 \
bitset.9 BIT_SET_ATOMIC.9 \
bitset.9 BIT_SET_ATOMIC_ACQ.9 \
@ -927,9 +933,11 @@ MLINKS+=crypto_driver.9 crypto_copyback.9 \
crypto_driver.9 CRYPTODEV_PROCESS.9 \
crypto_driver.9 hmac_init_ipad.9 \
crypto_driver.9 hmac_init_opad.9
MLINKS+=crypto_request.9 crypto_dispatch.9 \
MLINKS+=crypto_request.9 crypto_destroyreq.9 \
crypto_request.9 crypto_dispatch.9 \
crypto_request.9 crypto_freereq.9 \
crypto_request.9 crypto_getreq.9 \
crypto_request.9 crypto_initreq.9 \
crypto_request.9 crypto_use_buf.9 \
crypto_request.9 crypto_use_mbuf.9 \
crypto_request.9 crypto_use_output_buf.9 \
@ -966,10 +974,12 @@ MLINKS+=device_set_desc.9 device_get_desc.9 \
device_set_desc.9 device_set_desc_copy.9
MLINKS+=device_set_flags.9 device_get_flags.9
MLINKS+=devstat.9 devicestat.9 \
devstat.9 devstat_add_entry.9 \
devstat.9 devstat_new_entry.9 \
devstat.9 devstat_end_transaction.9 \
devstat.9 devstat_end_transaction_bio.9 \
devstat.9 devstat_remove_entry.9 \
devstat.9 devstat_start_transaction.9
devstat.9 devstat_start_transaction.9 \
devstat.9 devstat_start_transaction_bio.9
MLINKS+=disk.9 disk_add_alias.9 \
disk.9 disk_alloc.9 \
disk.9 disk_create.9 \

View File

@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 22, 2020
.Dd July 16, 2020
.Dt CRYPTO_REQUEST 9
.Os
.Sh NAME
@ -41,10 +41,14 @@
.Ft int
.Fn crypto_dispatch "struct cryptop *crp"
.Ft void
.Fn crypto_destroyreq "struct cryptop *crp"
.Ft void
.Fn crypto_freereq "struct cryptop *crp"
.Ft "struct cryptop *"
.Fn crypto_getreq "crypto_session_t cses" "int how"
.Ft void
.Fn crypto_initreq "crypto_session_t cses" "int how"
.Ft void
.Fn crypto_use_buf "struct cryptop *crp" "void *buf" "int len"
.Ft void
.Fn crypto_use_mbuf "struct cryptop *crp" "struct mbuf *m"
@ -62,10 +66,27 @@ an instance of
.Vt struct cryptop
and is associated with an active session.
.Pp
New requests are allocated by
.Fn crypto_getreq .
Requests can either be allocated dynamically or use caller-supplied
storage.
Dynamically allocated requests should be allocated by
.Fn crypto_getreq
and freed by
.Fn crypto_freereq
once the request has completed.
Requests using caller-supplied storage should be initialized by
.Fn crypto_initreq
at the start of each operation and destroyed by
.Fn crypto_destroyreq
once the request has completed.
.Pp
For both
.Fn crypto_getreq
and
.Fn crypto_initreq ,
.Fa cses
is a reference to an active session.
For
.Fn crypto_getreq ,
.Fa how
is passed to
.Xr malloc 9
@ -73,7 +94,9 @@ and should be set to either
.Dv M_NOWAIT
or
.Dv M_WAITOK .
The caller should then set fields in the returned structure to describe
.Pp
Once a request has been initialized,
the caller should set fields in the structure to describe
request-specific parameters.
Unused fields should be left as-is.
.Pp
@ -92,7 +115,9 @@ Note that a request's callback function may be invoked before
returns.
.Pp
Once a request has signaled completion by invoking its callback function,
it should be feed via
it should be freed via
.Fn crypto_destroyreq
or
.Fn crypto_freereq .
.Pp
Cryptographic operations include several fields to describe the request.

View File

@ -27,25 +27,24 @@
.\"
.\" $FreeBSD$
.\"
.Dd August 22, 2018
.Dd July 15, 2020
.Dt DEVSTAT 9
.Os
.Sh NAME
.Nm devstat ,
.Nm devstat_add_entry ,
.Nm devstat_end_transaction ,
.Nm devstat_end_transaction_bio ,
.Nm devstat_end_transaction_bio_bt ,
.Nm devstat_new_entry ,
.Nm devstat_remove_entry ,
.Nm devstat_start_transaction ,
.Nm devstat_start_transaction_bio
.Nd kernel interface for keeping device statistics
.Sh SYNOPSIS
.In sys/devicestat.h
.Ft void
.Fo devstat_add_entry
.Fa "struct devstat *ds"
.Fa "const char *dev_name"
.Ft struct devstat *
.Fo devstat_new_entry
.Fa "const void *dev_name"
.Fa "int unit_number"
.Fa "uint32_t block_size"
.Fa "devstat_support_flags flags"
@ -78,7 +77,6 @@
.Fa "struct devstat *ds"
.Fa "const struct bio *bp"
.Fc
.Fc
.Ft void
.Fo devstat_end_transaction_bio_bt
.Fa "struct devstat *ds"
@ -103,19 +101,13 @@ for most disk-like drivers in the 2000s and beyond.
New consumers of the interface should almost certainly use only the "bio"
variants of the start and end transacation routines.
.Pp
.Fn devstat_add_entry
registers a device with the
.Nm
subsystem.
The caller is expected to have already allocated \fBand zeroed\fR
the devstat structure before calling this function.
.Fn devstat_add_entry
.Fn devstat_new_entry
allocates and initializes
.Va devstat
structure and returns a pointer to it.
.Fn devstat_new_entry
takes several arguments:
.Bl -tag -width device_type
.It ds
The
.Va devstat
structure, allocated and zeroed by the client.
.It dev_name
The device name, e.g., da, cd, sa.
.It unit_number
@ -386,6 +378,8 @@ to insert a device in the
list.
The second parameter is attach order.
See below for a list of available priorities.
.It id
Identification for GEOM nodes.
.El
.Pp
Each device is given a device type.
@ -478,8 +472,19 @@ typedef enum {
DEVSTAT_WRITE = 0x02,
DEVSTAT_FREE = 0x03
} devstat_trans_flags;
#define DEVSTAT_N_TRANS_FLAGS 4
.Ed
.Pp
DEVSTAT_NO_DATA is a type of transactions to the device which are neither
reads or writes.
For instance,
.Tn SCSI
drivers often send a test unit ready command to
.Tn SCSI
devices.
The test unit ready command does not read or write any data.
It merely causes the device to return its status.
.Pp
There are four possible values for the
.Va tag_type
argument to

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 28, 2019
.Dd July 23, 2020
.Dt MBUF 9
.Os
.\"
@ -574,6 +574,9 @@ for non-critical paths.
Allocate an
.Vt mbuf
with enough space to hold specified amount of data.
If the size is is larger than
.Dv MJUMPAGESIZE , NULL
will be returned.
.It Fn m_getm orig len how type
Allocate
.Fa len
@ -632,9 +635,12 @@ on failure.
.It Fn m_getjcl how type flags size
This is like
.Fn m_getcl
but it the size of the cluster allocated will be large enough for
but the specified
.Fa size
bytes.
of the cluster to be allocated must be one of
.Dv MCLBYTES , MJUMPAGESIZE , MJUM9BYTES ,
or
.Dv MJUM16BYTES.
.It Fn m_free mbuf
Frees
.Vt mbuf .

Some files were not shown because too many files have changed in this diff Show More