Class: IPAccess::UDPSocket

Inherits:
UDPSocket
  • Object
show all
Includes:
Patches::UDPSocket
Defined in:
lib/ipaccess/ghost_doc/ghost_doc_sockets.rb,
lib/ipaccess/socket.rb

Overview

UDPSocket class with IP access control. It uses input and output access lists. Default list for rules management methods is input.

This class acts the same way as UDPSocket class but provides special member called acl and a few new instance methods for controlling IP access.

:include:ghost_doc_patched_usage.rb

This documentation doesn’t cover description of all class and instance methods of the original UDPSocket class, just the patched variants that make use of IP access control.

Instance Attribute Summary collapse

Attributes included from Patches::ACL

#opened_on_deny

Instance Method Summary collapse

Methods included from Patches::ACL

#__ipa_wrap_socket_call, #close_on_deny, #close_on_deny=, #default_list, #terminate, #valid_acl?

Instance Attribute Details

#aclObject

:include:ghost_doc_acl.rb

Example

require 'ipaccess/socket'       # load sockets subsystem

socket = IPAccess::UDPSocket.new
socket.acl = :global            # use global access set
socket.acl = :private           # create and use individual access set
socket.acl = IPAccess::Set.new  # use external (shared) access set


226
227
228
# File 'lib/ipaccess/ghost_doc/ghost_doc_sockets.rb', line 226

def acl
  @acl
end

Instance Method Details

#acl_recheckObject

This method allows you to re-check access on demad. It uses internal socket’s address and access set assigned to an object. It will close your communication session before throwing an exception in case of denied access – you can prevent it by setting the flag opened_on_deny to true. The flag can be set while initializing object (through argument :opened_on_deny) or by setting the attribute.



237
238
239
# File 'lib/ipaccess/ghost_doc/ghost_doc_sockets.rb', line 237

def acl_recheck
  # Real code hidden.
end

#blacklistObject Also known as: add_black, deny, block

:include:ghost_doc_p_blacklist.rb



172
# File 'lib/ipaccess/ghost_doc/ghost_doc_sockets.rb', line 172

def blacklist; end

#blacklist!Object Also known as: add_black!, deny!, block!

:include:ghost_doc_p_blacklist_e.rb



169
# File 'lib/ipaccess/ghost_doc/ghost_doc_sockets.rb', line 169

def blacklist!; end

#blacklist_reasonable(reason, *addresses) ⇒ Object

This method works like blacklist but allows to set reason.



213
# File 'lib/ipaccess/ghost_doc/ghost_doc_sockets.rb', line 213

def blacklist_reasonable(reason, *addresses); end

#blacklist_reasonable!(reason, *addresses) ⇒ Object

This method works like blacklist! but allows to set reason.



209
# File 'lib/ipaccess/ghost_doc/ghost_doc_sockets.rb', line 209

def blacklist_reasonable!(reason, *addresses); end

#unblacklistObject Also known as: unblock, del_black

:include:ghost_doc_p_unblacklist.rb



184
# File 'lib/ipaccess/ghost_doc/ghost_doc_sockets.rb', line 184

def unblacklist; end

#unblacklist!Object Also known as: unblock!, del_black!

:include:ghost_doc_p_unblacklist_e.rb



181
# File 'lib/ipaccess/ghost_doc/ghost_doc_sockets.rb', line 181

def unblacklist!; end

#unwhitelistObject Also known as: del_white

:include:ghost_doc_p_unwhitelist.rb



178
# File 'lib/ipaccess/ghost_doc/ghost_doc_sockets.rb', line 178

def unwhitelist; end

#unwhitelist!Object Also known as: del_white!

:include:ghost_doc_p_unwhitelist_e.rb



175
# File 'lib/ipaccess/ghost_doc/ghost_doc_sockets.rb', line 175

def unwhitelist!; end

#whitelistObject

:include:ghost_doc_p_whitelist.rb



166
# File 'lib/ipaccess/ghost_doc/ghost_doc_sockets.rb', line 166

def whitelist; end

#whitelist!Object

:include:ghost_doc_p_whitelist_e.rb



163
# File 'lib/ipaccess/ghost_doc/ghost_doc_sockets.rb', line 163

def whitelist!; end

#whitelist_reasonable(reason, *addresses) ⇒ Object

This method works like whitelist but allows to set reason.



205
# File 'lib/ipaccess/ghost_doc/ghost_doc_sockets.rb', line 205

def whitelist_reasonable(reason, *addresses); end

#whitelist_reasonable!(reason, *addresses) ⇒ Object

This method works like whitelist! but allows to set reason.



201
# File 'lib/ipaccess/ghost_doc/ghost_doc_sockets.rb', line 201

def whitelist_reasonable!(reason, *addresses); end