2005-06-10 17:06:33 +02:00
|
|
|
/* $NetBSD: if_tap_stub.c,v 1.3 2005/06/10 15:06:33 cube Exp $ */
|
2005-01-20 19:02:38 +01:00
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
2005-06-10 17:06:33 +02:00
|
|
|
__KERNEL_RCSID(0, "$NetBSD: if_tap_stub.c,v 1.3 2005/06/10 15:06:33 cube Exp $");
|
2005-01-20 19:02:38 +01:00
|
|
|
|
|
|
|
#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"
|
|
|
|
|
2005-06-10 17:06:33 +02:00
|
|
|
/*
|
|
|
|
* fdclone() and friends
|
|
|
|
*/
|
|
|
|
|
2005-01-20 19:02:38 +01:00
|
|
|
/* 2.99.10 is gray area. Oh, well. */
|
|
|
|
#if __NetBSD_Version__ < 299001100
|
|
|
|
int
|
2005-02-15 22:23:07 +01:00
|
|
|
tap_fdclone(struct proc *p, struct file *fp, int flags, int fd,
|
|
|
|
struct fileops *fops, void *data)
|
2005-01-20 19:02:38 +01:00
|
|
|
{
|
2005-02-15 22:23:07 +01:00
|
|
|
fp->f_flag = flags;
|
2005-01-20 19:02:38 +01:00
|
|
|
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
|
2005-06-10 17:06:33 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* hexdigits
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if __NetBSD_Version__ < 399000400
|
|
|
|
const char tap_hexdigits[] = "0123456789abcdef";
|
|
|
|
#endif
|