b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | --- a/netem/maketable.c |
| 2 | +++ b/netem/maketable.c |
| 3 | @@ -11,7 +11,9 @@ |
| 4 | #include <stdio.h> |
| 5 | #include <stdlib.h> |
| 6 | #include <math.h> |
| 7 | +#if !defined(__APPLE__) && !defined(__FreeBSD__) |
| 8 | #include <malloc.h> |
| 9 | +#endif |
| 10 | #include <string.h> |
| 11 | #include <sys/types.h> |
| 12 | #include <sys/stat.h> |
| 13 | --- a/netem/normal.c |
| 14 | +++ b/netem/normal.c |
| 15 | @@ -9,8 +9,12 @@ |
| 16 | #include <string.h> |
| 17 | #include <limits.h> |
| 18 | |
| 19 | +#if !defined(__APPLE__) && !defined(__FreeBSD__) |
| 20 | #include <linux/types.h> |
| 21 | #include <linux/pkt_sched.h> |
| 22 | +#else |
| 23 | +#define NETEM_DIST_SCALE 8192 |
| 24 | +#endif |
| 25 | |
| 26 | #define TABLESIZE 16384 |
| 27 | #define TABLEFACTOR NETEM_DIST_SCALE |
| 28 | --- a/netem/pareto.c |
| 29 | +++ b/netem/pareto.c |
| 30 | @@ -8,8 +8,12 @@ |
| 31 | #include <math.h> |
| 32 | #include <limits.h> |
| 33 | |
| 34 | +#if !defined(__APPLE__) && !defined(__FreeBSD__) |
| 35 | #include <linux/types.h> |
| 36 | #include <linux/pkt_sched.h> |
| 37 | +#else |
| 38 | +#define NETEM_DIST_SCALE 8192 |
| 39 | +#endif |
| 40 | |
| 41 | static const double a=3.0; |
| 42 | #define TABLESIZE 16384 |
| 43 | --- a/netem/paretonormal.c |
| 44 | +++ b/netem/paretonormal.c |
| 45 | @@ -15,10 +15,13 @@ |
| 46 | #include <string.h> |
| 47 | #include <math.h> |
| 48 | #include <limits.h> |
| 49 | +#if !defined(__APPLE__) && !defined(__FreeBSD__) |
| 50 | #include <malloc.h> |
| 51 | - |
| 52 | #include <linux/types.h> |
| 53 | #include <linux/pkt_sched.h> |
| 54 | +#else |
| 55 | +#define NETEM_DIST_SCALE 8192 |
| 56 | +#endif |
| 57 | |
| 58 | #define TABLESIZE 16384 |
| 59 | #define TABLEFACTOR NETEM_DIST_SCALE |