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


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


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

def ap
  @ap
end

#ap_scanmodeInteger

FIXME: Consider an enum


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?


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

def bitrate
  @bitrate
end

#ca_certString


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

def ca_cert
  @ca_cert
end

#channelInteger?


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

def channel
  @channel
end

#client_certString


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

def client_cert
  @client_cert
end

#client_keyString


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

def client_key
  @client_key
end

#default_keyInteger


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

def default_key
  @default_key
end

#eap_authString


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

def eap_auth
  @eap_auth
end

#eap_modeString


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

def eap_mode
  @eap_mode
end

#essidString


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

def essid
  @essid
end

#frequencyInteger


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

def frequency
  @frequency
end

#key_lengthInteger


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

def key_length
  @key_length
end

#keysArray<String>


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

def keys
  @keys
end

#modeString

wireless options

FIXME: Consider an enum


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

def mode
  @mode
end

#nickString


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

def nick
  @nick
end

#nwidString


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

def nwid
  @nwid
end

#wpa_anonymous_identityString


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

def wpa_anonymous_identity
  @wpa_anonymous_identity
end

#wpa_identityString


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

def wpa_identity
  @wpa_identity
end

#wpa_passwordString


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.


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