mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
16 lines
280 B
Ruby
16 lines
280 B
Ruby
|
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)
|