Class: Y2Network::ConnectionConfig::Wireless

Inherits:
Base
  • Object
show all
Defined in:
src/lib/y2network/connection_config/wireless.rb

Overview

Configuration for wireless connections

Constant Summary

Constants inherited from Base

Base::PROPOSED_PPPOE_MTU

Instance Attribute Summary collapse

Attributes inherited from Base

#bootproto, #description, #ethtool_options, #firewall_zone, #hostname, #id, #interface, #ip, #ip_aliases, #lladdress, #mtu, #name, #startmode

Instance Method Summary collapse

Methods inherited from Base

#all_ips, #find_master, #propose, #propose_startmode, #type, #virtual?

Constructor Details

#initializeWireless

Returns a new instance of Wireless.


76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'src/lib/y2network/connection_config/wireless.rb', line 76

def initialize
  super

  self.mode = "Managed"
  self.essid = ""
  self.nwid = ""
  self.auth_mode = :open
  self.wpa_psk = ""
  self.key_length = 128
  self.keys = []
  self.default_key = 0
  self.eap_mode = "PEAP"
  self.eap_auth = "MSCHAPV2"
  self.ap_scanmode = 1
  # For WIFI DHCP makes more sense as majority of wifi routers act as dhcp servers
  self.bootproto = BootProtocol::DHCP
end

Instance Attribute Details

#apString

Returns:

  • (String)

59
60
61
# File 'src/lib/y2network/connection_config/wireless.rb', line 59

def ap
  @ap
end

#ap_scanmodeInteger

FIXME: Consider an enum

Returns:

  • (Integer)

    (0, 1, 2)


62
63
64
# File 'src/lib/y2network/connection_config/wireless.rb', line 62

def ap_scanmode
  @ap_scanmode
end

#auth_modeObject

@return [Symbol] Authorization mode (:open, :shared, :psk, :eap)


36
37
38
# File 'src/lib/y2network/connection_config/wireless.rb', line 36

def auth_mode
  @auth_mode
end

#bitrateFloat?

Returns bitrate limitation in Mb/s or nil for automatic.

Returns:

  • (Float, nil)

    bitrate limitation in Mb/s or nil for automatic


57
58
59
# File 'src/lib/y2network/connection_config/wireless.rb', line 57

def bitrate
  @bitrate
end

#ca_certString

Returns ca certificate used to sign server certificate.

Returns:

  • (String)

    ca certificate used to sign server certificate


70
71
72
# File 'src/lib/y2network/connection_config/wireless.rb', line 70

def ca_cert
  @ca_cert
end

#channelInteger?

Returns:

  • (Integer, nil)

53
54
55
# File 'src/lib/y2network/connection_config/wireless.rb', line 53

def channel
  @channel
end

#client_certString

Returns client certificate used to login for TLS.

Returns:

  • (String)

    client certificate used to login for TLS


72
73
74
# File 'src/lib/y2network/connection_config/wireless.rb', line 72

def client_cert
  @client_cert
end

#client_keyString

Returns client private key used to encrypt for TLS.

Returns:

  • (String)

    client private key used to encrypt for TLS


74
75
76
# File 'src/lib/y2network/connection_config/wireless.rb', line 74

def client_key
  @client_key
end

#default_keyInteger

Returns default WEP key.

Returns:

  • (Integer)

    default WEP key


45
46
47
# File 'src/lib/y2network/connection_config/wireless.rb', line 45

def default_key
  @default_key
end

#eap_authString

Returns:

  • (String)

51
52
53
# File 'src/lib/y2network/connection_config/wireless.rb', line 51

def eap_auth
  @eap_auth
end

#eap_modeString

Returns:

  • (String)

49
50
51
# File 'src/lib/y2network/connection_config/wireless.rb', line 49

def eap_mode
  @eap_mode
end

#essidString

Returns:

  • (String)

32
33
34
# File 'src/lib/y2network/connection_config/wireless.rb', line 32

def essid
  @essid
end

#frequencyInteger

Returns:

  • (Integer)

55
56
57
# File 'src/lib/y2network/connection_config/wireless.rb', line 55

def frequency
  @frequency
end

#key_lengthInteger

Returns:

  • (Integer)

41
42
43
# File 'src/lib/y2network/connection_config/wireless.rb', line 41

def key_length
  @key_length
end

#keysArray<String>

Returns WEP keys.

Returns:

  • (Array<String>)

    WEP keys


43
44
45
# File 'src/lib/y2network/connection_config/wireless.rb', line 43

def keys
  @keys
end

#modeString

wireless options

FIXME: Consider an enum

Returns:

  • (String)

    (Ad-hoc, Managed, Master)


30
31
32
# File 'src/lib/y2network/connection_config/wireless.rb', line 30

def mode
  @mode
end

#nickString

Returns:

  • (String)

47
48
49
# File 'src/lib/y2network/connection_config/wireless.rb', line 47

def nick
  @nick
end

#nwidString

Returns Network ID.

Returns:

  • (String)

    Network ID


34
35
36
# File 'src/lib/y2network/connection_config/wireless.rb', line 34

def nwid
  @nwid
end

#wpa_anonymous_identityString

Returns initial identity used for creating tunnel.

Returns:

  • (String)

    initial identity used for creating tunnel


68
69
70
# File 'src/lib/y2network/connection_config/wireless.rb', line 68

def wpa_anonymous_identity
  @wpa_anonymous_identity
end

#wpa_identityString

Returns:

  • (String)

66
67
68
# File 'src/lib/y2network/connection_config/wireless.rb', line 66

def wpa_identity
  @wpa_identity
end

#wpa_passwordString

Returns:

  • (String)

64
65
66
# File 'src/lib/y2network/connection_config/wireless.rb', line 64

def wpa_password
  @wpa_password
end

#wpa_pskString

FIXME: Consider moving keys to different classes.

Returns:

  • (String)

    WPA preshared key


39
40
41
# File 'src/lib/y2network/connection_config/wireless.rb', line 39

def wpa_psk
  @wpa_psk
end

Instance Method Details

#==(other) ⇒ Object


94
95
96
97
98
99
100
101
102
103
# File 'src/lib/y2network/connection_config/wireless.rb', line 94

def ==(other)
  return false unless super

  [:mode, :essid, :nwid, :auth_mode, :wpa_psk, :key_length, :keys, :default_key, :nick,
   :eap_mode, :eap_auth, :channel, :frequency, :bitrate, :ap, :ap_scanmode,
   :wpa_password, :wpa_identity, :wpa_anonymous_identity, :ca_cert, :client_cert,
   :client_key].all? do |method|
    public_send(method) == other.public_send(method)
  end
end