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.



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

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.



16
17
18
# File 'lib/UPnP.rb', line 16

def client
  @client
end

#descriptionObject (readonly)

Provided description.



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

def description
  @description
end

#durationObject (readonly)

Duration of the binding.



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

def duration
  @duration
end

#enabledObject (readonly)

Is the mapping enabled?.



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

def enabled
  @enabled
end

#lportObject (readonly)

Internal port.



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

def lport
  @lport
end

#nportObject (readonly)

External port.



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

def nport
  @nport
end

#protocolObject (readonly)

External protocol.



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

def protocol
  @protocol
end

#rhostObject (readonly)

Don’t know …



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

def rhost
  @rhost
end

Instance Method Details

#to_sObject



50
51
52
# File 'lib/UPnP.rb', line 50

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