summaryrefslogtreecommitdiff
path: root/net/netbsd-tap/files/if_tap_stub.c
blob: 5cfd7a89aa018fbe062b77434177a73ef46d17b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*	$NetBSD: if_tap_stub.c,v 1.3 2005/06/10 15:06:33 cube Exp $	*/

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_tap_stub.c,v 1.3 2005/06/10 15:06:33 cube Exp $");

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/stat.h>

#include "if_tap_stub.h"

/*
 * fdclone() and friends
 */

/* 2.99.10 is gray area.  Oh, well. */
#if __NetBSD_Version__ < 299001100
int
tap_fdclone(struct proc *p, struct file *fp, int flags, int fd,
    struct fileops *fops, void *data)
{
	fp->f_flag = flags;
	fp->f_type = DTYPE_MISC;
	fp->f_ops = fops;
	fp->f_data = data;

	curlwp->l_dupfd = fd;

	FILE_SET_MATURE(fp);
	FILE_UNUSE(fp, p);
	return ENXIO;
}

/* ARGSUSED */
int
tap_fnullop_fcntl(struct file *fp, u_int cmd, void *data, struct proc *p)
{
	if (cmd == F_SETFL)
		return 0;

	return EOPNOTSUPP;
}

/* ARGSUSED */
int
tap_fbadop_stat(struct file *fp, struct stat *sb, struct proc *p)
{
	return EOPNOTSUPP;
}
#endif

/*
 * hexdigits
 */

#if __NetBSD_Version__ < 399000400
const char tap_hexdigits[] = "0123456789abcdef";
#endif