⬢ DragonFlyBSD Kernel Audit
DF-2294 / fwharness.h
← back to finding ↓ download raw
/*
 * fwharness.h -- shared ioctl definitions for the fwdev.c verification
 * harness (kernel fwharness.c + userland fwhctl(8) helper).
 */
#ifndef _FWHARNESS_H
#define _FWHARNESS_H

#include <sys/ioccom.h>
#include <sys/types.h>

#define FWHIOC_MAXREC	_IOW('H', 1, u_int32_t)
#define FWHIOC_INJECT	_IOW('H', 2, u_int32_t)

struct fwh_sprayreq {
	u_int32_t n;		/* number of chunks */
	u_int32_t size;		/* chunk size in bytes */
};
#define FWHIOC_SPRAY	_IOW('H', 3, struct fwh_sprayreq)
#define FWHIOC_UNSPRAY	_IOW('H', 4, u_int32_t)

struct fwh_respreq {
	u_int32_t paylen;	/* emulated peer response payload length */
	u_int32_t fill;		/* fill byte of emulated response */
};
#define FWHIOC_RESP	_IOW('H', 5, struct fwh_respreq)

struct fwh_chkreq {
	u_int32_t corrupt;	/* 1 if any canary chunk damaged */
	u_int32_t badwords;	/* count of damaged 16-byte records */
};
#define FWHIOC_SPRAYCHK	_IOWR('H', 6, struct fwh_chkreq)

#define FWH_DUMP_CHUNKS 24	/* keep sizeof(fwh_dumpreq) under IOC max 8191 */
#define FWH_DUMP_HDR    160
struct fwh_dumpchunk {
	u_int32_t idx;
	u_int32_t size;
	u_int32_t data[FWH_DUMP_HDR / 4];
};
struct fwh_dumpreq {
	u_int32_t start;		/* first chunk index to dump */
	u_int32_t n;			/* in: capacity, out: dumped */
	struct fwh_dumpchunk chunk[FWH_DUMP_CHUNKS];
};
#define FWHIOC_SPRAYDUMP _IOWR('H', 7, struct fwh_dumpreq)
#define FWHIOC_SPRAYFREE	_IOW('H', 8, u_int32_t)
#define FWHIOC_SPRAYPOP		_IOW('H', 9, u_int32_t)

#endif /* _FWHARNESS_H */