From d0325b1da64c8ff611cd4c3151e266dd2685c462 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 22 Jul 2015 02:56:49 +0100 Subject: [fault] Generalise NETDEV_DISCARD_RATE fault injection mechanism Provide a generic inject_fault() function that can be used to inject random faults with configurable probabilities. Signed-off-by: Michael Brown --- src/config/fault.h | 19 +++++++++++++++++++ src/config/general.h | 1 - 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/config/fault.h (limited to 'src/config') diff --git a/src/config/fault.h b/src/config/fault.h new file mode 100644 index 00000000..a05aecd5 --- /dev/null +++ b/src/config/fault.h @@ -0,0 +1,19 @@ +#ifndef CONFIG_FAULT_H +#define CONFIG_FAULT_H + +/** @file + * + * Fault injection + * + */ + +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + +#include + +/* Drop every N transmitted or received network packets */ +#define NETDEV_DISCARD_RATE 0 + +#include + +#endif /* CONFIG_FAULT_H */ diff --git a/src/config/general.h b/src/config/general.h index 9a5fbca9..35a9030e 100644 --- a/src/config/general.h +++ b/src/config/general.h @@ -156,7 +156,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * */ -#define NETDEV_DISCARD_RATE 0 /* Drop every N packets (0=>no drop) */ #undef BUILD_SERIAL /* Include an automatic build serial * number. Add "bs" to the list of * make targets. For example: -- cgit v1.2.3-55-g7522