Class: Y2Network::ConnectionConfig::IPConfig

Inherits:
Object
  • Object
show all
Includes:
Y2Network::CanBeCopied, Yast2::Equatable
Defined in:
src/lib/y2network/connection_config/ip_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Y2Network::CanBeCopied

#copy

Constructor Details

#initialize(address, id: "", label: nil, remote_address: nil, broadcast: nil) ⇒ IPConfig

Constructor

Parameters:

  • address (IPAddress)
  • id (String) (defaults to: "")

    ID (needed for sysconfig backend in order to write suffixes in ifcfg-* files)

  • label (String, nil) (defaults to: nil)
  • remote_address (IPaddress, nil) (defaults to: nil)
  • broadcast (IPaddress, nil) (defaults to: nil)


52
53
54
55
56
57
58
# File 'src/lib/y2network/connection_config/ip_config.rb', line 52

def initialize(address, id: "", label: nil, remote_address: nil, broadcast: nil)
  @address = address
  @id = id
  @label = label
  @remote_address = remote_address
  @broadcast = broadcast
end

Instance Attribute Details

#addressIPAddress

Returns IP address.

Returns:



31
32
33
# File 'src/lib/y2network/connection_config/ip_config.rb', line 31

def address
  @address
end

#broadcastIPAddress?

Returns Broadcast address.

Returns:



37
38
39
# File 'src/lib/y2network/connection_config/ip_config.rb', line 37

def broadcast
  @broadcast
end

#idString

Returns ID (needed for sysconfig backend in order to write suffixes in ifcfg-* files).

Returns:

  • (String)

    ID (needed for sysconfig backend in order to write suffixes in ifcfg-* files)



40
41
42
# File 'src/lib/y2network/connection_config/ip_config.rb', line 40

def id
  @id
end

#labelString?

Returns Address label.

Returns:

  • (String, nil)

    Address label



33
34
35
# File 'src/lib/y2network/connection_config/ip_config.rb', line 33

def label
  @label
end

#remote_addressIPAddress?

Returns Remote IP address of a point to point connection.

Returns:

  • (IPAddress, nil)

    Remote IP address of a point to point connection



35
36
37
# File 'src/lib/y2network/connection_config/ip_config.rb', line 35

def remote_address
  @remote_address
end