blob: 4d1fc522759347b2977e9d9b983ab8b894a80904 [file] [log] [blame]
Thierry FOURNIER4d7bfa12018-02-25 21:28:05 +01001require("print_r")
Daniel Corbett06176682019-06-11 10:04:15 -04002require("math")
Thierry FOURNIER4d7bfa12018-02-25 21:28:05 +01003
4print_r("Load lua message processors")
5
6spoa.register_message("check-client-ip", function(args)
7 print_r(args)
8 spoa.set_var_null("null", spoa.scope.txn)
9 spoa.set_var_boolean("boolean", spoa.scope.txn, true)
10 spoa.set_var_int32("int32", spoa.scope.txn, 1234)
11 spoa.set_var_uint32("uint32", spoa.scope.txn, 1234)
12 spoa.set_var_int64("int64", spoa.scope.txn, 1234)
13 spoa.set_var_uint64("uint64", spoa.scope.txn, 1234)
14 spoa.set_var_ipv4("ipv4", spoa.scope.txn, "127.0.0.1")
15 spoa.set_var_ipv6("ipv6", spoa.scope.txn, "1::f")
16 spoa.set_var_str("str", spoa.scope.txn, "1::f")
17 spoa.set_var_bin("bin", spoa.scope.txn, "1::f")
Daniel Corbett06176682019-06-11 10:04:15 -040018 spoa.set_var_int32("ip_score", spoa.scope.sess, math.random(100))
Thierry FOURNIER4d7bfa12018-02-25 21:28:05 +010019end)