git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Break OFPT_* constants into common value and 1.0- and 1.1-specific values.
[sliver-openvswitch.git]
/
lib
/
random.c
diff --git
a/lib/random.c
b/lib/random.c
index
a802bc7
..
911ebf3
100644
(file)
--- 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 Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* 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();
}
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)
{
int
random_range(int max)
{