aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/app/snmp_internal.hrl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-05-07 14:59:22 +0200
committerMicael Karlberg <[email protected]>2019-05-22 18:21:02 +0200
commit3f490bea2e21871f534cdcd49d85314eb35f0164 (patch)
treeedcf27f43e6589e1681736baf16d4c9b4c334b9c /lib/snmp/src/app/snmp_internal.hrl
parent6d955c8377f4df9c215424349050b38b8c7628b4 (diff)
downloadotp-3f490bea2e21871f534cdcd49d85314eb35f0164.tar.gz
otp-3f490bea2e21871f534cdcd49d85314eb35f0164.tar.bz2
otp-3f490bea2e21871f534cdcd49d85314eb35f0164.zip
[snmp] Replaced usage of random with rand
Use of the deprecated module random has been replaced by the module rand. OTP-15331
Diffstat (limited to 'lib/snmp/src/app/snmp_internal.hrl')
-rw-r--r--lib/snmp/src/app/snmp_internal.hrl9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/snmp/src/app/snmp_internal.hrl b/lib/snmp/src/app/snmp_internal.hrl
index 97a7c63ef1..f9a758ab7b 100644
--- a/lib/snmp/src/app/snmp_internal.hrl
+++ b/lib/snmp/src/app/snmp_internal.hrl
@@ -25,6 +25,13 @@
-define(APPLICATION, snmp).
-endif.
+
+-define(SNMP_RAND_SEED_ALG, exrop).
+-define(SNMP_RAND_SEED(), rand:seed(?SNMP_RAND_SEED_ALG,
+ {erlang:phash2([node()]),
+ erlang:monotonic_time(),
+ erlang:unique_integer()})).
+
-define(snmp_info(C, F, A), ?snmp_msg(info_msg, C, F, A)).
-define(snmp_warning(C, F, A), ?snmp_msg(warning_msg, C, F, A)).
-define(snmp_error(C, F, A), ?snmp_msg(error_msg, C, F, A)).
@@ -37,5 +44,3 @@
-endif. % -ifdef(snmp_internal).
-
-