Class: UPnP::PortMapping

Inherits:
Object
  • Object
show all
Defined in:
lib/UPnP.rb

Overview

Represent a port mapping decriptor received from the router.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cl, lp, np, p, d, e, rh, du) ⇒ PortMapping

Returns a new instance of PortMapping.



41
42
43
44
45
46
47
48
49
50
# File 'lib/UPnP.rb', line 41

def initialize(cl,lp,np,p,d,e,rh,du)
    @client = cl
    @lport = lp
    @nport = np
    @protocol = p
    @description = d
    @enabled = e
    @rhost = rh
    @duration = du
end

Instance Attribute Details

#clientObject (readonly)

Internal address.



18
19
20
# File 'lib/UPnP.rb', line 18

def client
  @client
end

#descriptionObject (readonly)

Provided description.



30
31
32
# File 'lib/UPnP.rb', line 30

def description
  @description
end

#durationObject (readonly)

Duration of the binding.



39
40
41
# File 'lib/UPnP.rb', line 39

def duration
  @duration
end

#enabledObject (readonly)

Is the mapping enabled?.



33
34
35
# File 'lib/UPnP.rb', line 33

def enabled
  @enabled
end

#lportObject (readonly)

Internal port.



21
22
23
# File 'lib/UPnP.rb', line 21

def lport
  @lport
end

#nportObject (readonly)

External port.



24
25
26
# File 'lib/UPnP.rb', line 24

def nport
  @nport
end

#protocolObject (readonly)

External protocol.



27
28
29
# File 'lib/UPnP.rb', line 27

def protocol
  @protocol
end

#rhostObject (readonly)

Don’t know …



36
37
38
# File 'lib/UPnP.rb', line 36

def rhost
  @rhost
end

Instance Method Details

#to_sObject



52
53
54
# File 'lib/UPnP.rb', line 52

def to_s()
    return "#{@nport}->#{@client}:#{@lport} #{@protocol} for #{@duration} -- #{@description}"
end