2 * Copied from LiMon - BOOTP.
4 * Copyright 1994, 1995, 2000 Neil Russell.
6 * Copyright 2000 Paolo Scaffardi
10 #define __NET_RAND_H__
15 * Return a seed for the PRNG derived from the eth0 MAC address.
17 static inline unsigned int seed_mac(void)
19 unsigned char enetaddr[6];
23 eth_getenv_enetaddr("ethaddr", enetaddr);
26 seed ^= enetaddr[4] << 8;
27 seed ^= enetaddr[3] << 16;
28 seed ^= enetaddr[2] << 24;
30 seed ^= enetaddr[0] << 8;
36 * Seed the random number generator using the eth0 MAC address.
38 static inline void srand_mac(void)
43 #endif /* __NET_RAND_H__ */