X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Frandom.c;h=3ea65d59cadf967ab5854c04969055596b116440;hb=e0f3585d4499db4ad0f22fd3c4749ba2e9814c33;hp=a802bc743a99c1e9a3a6615747eb348beab5b529;hpb=279c9e030818e039bb1c26be76e2cc1e8f6b13a6;p=sliver-openvswitch.git diff --git a/lib/random.c b/lib/random.c index a802bc743..3ea65d59c 100644 --- a/lib/random.c +++ b/lib/random.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -100,6 +100,18 @@ random_uint32(void) return random_next(); } +uint64_t +random_uint64(void) +{ + uint64_t x; + + random_init(); + + x = random_next(); + x |= (uint64_t) random_next() << 32; + return x; +} + int random_range(int max) {