Class: Y2Network::ConnectionConfig::Wireless

Inherits:
Base
  • Object
show all
Includes:
Yast2::Equatable
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, #dhclient_set_hostname, #ethtool_options, #firewall_zone, #hostnames, #id, #interface, #ip, #ip_aliases, #lladdress, #mtu, #name, #startmode

Instance Method Summary collapse

Methods inherited from Base

#all_ips, #dhcp?, #find_parent, #hostname, #hostname=, #propose, #propose_startmode, #static?, #type, #virtual?

Constructor Details

#initializeWireless

Returns a new instance of Wireless.


82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'src/lib/y2network/connection_config/wireless.rb', line 82

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)

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

def ap
  @ap
end

#ap_scanmodeInteger

FIXME: Consider an enum

Returns:

  • (Integer)

    (0, 1, 2)


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

def ap_scanmode
  @ap_scanmode
end

#auth_modeSymbol

Returns Authorization mode (:open, :shared, :psk, :eap).

Returns:

  • (Symbol)

    Authorization mode (:open, :shared, :psk, :eap)


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

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


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

def bitrate
  @bitrate
end

#ca_certString

Returns ca certificate used to sign server certificate.

Returns:

  • (String)

    ca certificate used to sign server certificate


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

def ca_cert
  @ca_cert
end

#channelInteger?

Returns:

  • (Integer, nil)

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

def channel
  @channel
end

#client_certString

Returns client certificate used to login for TLS.

Returns:

  • (String)

    client certificate used to login for TLS


76
77
78
# File 'src/lib/y2network/connection_config/wireless.rb', line 76

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


78
79
80
# File 'src/lib/y2network/connection_config/wireless.rb', line 78

def client_key
  @client_key
end

#client_key_passwordString

Returns client private key password.

Returns:

  • (String)

    client private key password


80
81
82
# File 'src/lib/y2network/connection_config/wireless.rb', line 80

def client_key_password
  @client_key_password
end

#default_keyInteger

Returns default WEP key.

Returns:

  • (Integer)

    default WEP key


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

def default_key
  @default_key
end

#eap_authString

Returns:

  • (String)

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

def eap_auth
  @eap_auth
end

#eap_modeString

Returns:

  • (String)

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

def eap_mode
  @eap_mode
end

#essidString

Returns:

  • (String)

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

def essid
  @essid
end

#frequencyInteger

Returns:

  • (Integer)

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

def frequency
  @frequency
end

#key_lengthInteger

Returns:

  • (Integer)

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

def key_length
  @key_length
end

#keysArray<String>

Returns WEP keys.

Returns:

  • (Array<String>)

    WEP keys


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

def keys
  @keys
end

#modeString

wireless options

FIXME: Consider an enum

Returns:

  • (String)

    (ad-hoc, managed, master)


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

def mode
  @mode
end

#nickString

Returns:

  • (String)

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

def nick
  @nick
end

#nwidString

Returns Network ID.

Returns:

  • (String)

    Network ID


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

def nwid
  @nwid
end

#wpa_anonymous_identityString

Returns initial identity used for creating tunnel.

Returns:

  • (String)

    initial identity used for creating tunnel


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

def wpa_anonymous_identity
  @wpa_anonymous_identity
end

#wpa_identityString

Returns:

  • (String)

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

def wpa_identity
  @wpa_identity
end

#wpa_passwordString

TODO: unify psk and password and write correct one depending on mode

Returns:

  • (String)

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

def wpa_password
  @wpa_password
end

#wpa_pskString

FIXME: Consider moving keys to different classes.

Returns:

  • (String)

    WPA preshared key


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

def wpa_psk
  @wpa_psk
end

Instance Method Details

#keys?Boolean

Convenience method to check whether there are some WEP key defined

Returns:

  • (Boolean)

    return true if there is at least one not empty key


113
114
115
# File 'src/lib/y2network/connection_config/wireless.rb', line 113

def keys?
  !(keys || []).compact.all?(&:empty?)
end