2 * Generic address resultion entity
6 * net_ratelimit Andy Kleen
8 * Created by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
16 #include <linux/module.h>
17 #include <linux/jiffies.h>
18 #include <linux/kernel.h>
20 #include <linux/string.h>
21 #include <linux/types.h>
23 #include <asm/system.h>
24 #include <asm/uaccess.h>
26 static unsigned long net_rand_seed = 152L;
28 unsigned long net_random(void)
30 net_rand_seed=net_rand_seed*69069L+1;
31 return net_rand_seed^jiffies;
34 void net_srandom(unsigned long entropy)
36 net_rand_seed ^= entropy;
40 int net_msg_cost = 5*HZ;
41 int net_msg_burst = 10;
44 * All net warning printk()s should be guarded by this function.
46 int net_ratelimit(void)
48 return __printk_ratelimit(net_msg_cost, net_msg_burst);
51 EXPORT_SYMBOL(net_random);
52 EXPORT_SYMBOL(net_ratelimit);
53 EXPORT_SYMBOL(net_srandom);