summaryrefslogtreecommitdiff
path: root/jni/ruby/sample/drb/acl.rb
blob: d93eb9c1fcd119f3b0474bbb26f83ecaeb1f0e76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'drb/acl'

list = %w(deny all
          allow 192.168.1.1
          allow ::ffff:192.168.1.2
          allow 192.168.1.3
)

addr = ["AF_INET", 10, "lc630", "192.168.1.3"]

acl = ACL.new
p acl.allow_addr?(addr)

acl = ACL.new(list, ACL::DENY_ALLOW)
p acl.allow_addr?(addr)