New wpa_supplicand dbus API proposal

Witold Sowa witold.sowa
Thu Jun 11 16:23:37 PDT 2009


Marcel Holtmann pisze:
> Hi Witold,
>
>   
>> Here is second proposal of new DBus API build basing of our earlier
>> e-mail correspondence, Marcel's remarks and arrangement I made with Dan
>> on #wireless.
>> I will start to implement this in next week. Request for comments.
>>
>> Service Name: fi.w1.wpa_supplicant1
>>
>> O: /fi/w1/wpa_supplicant1
>> I : fi.w1.wpa_supplicant1
>>
>> M: CreateInterface(args a{sv}) -> path o
>>    args: Ifname -> s
>>          Driver -> s
>>          Bridge-ifname -> s
>>          Level -> u
>>          Timestamp -> b
>>          Show_keys -> b
>>     
Level should be DebugLevel - my mistake.
>
> can we add an Ifindex -> u here. So you can optionally give the
> interface index or the name. Could be useful in some cases where
> everything is based around the ifindex anyway.
>   
OK. We would return InterfaceExists error if specified index is in use.
Do we actually need that indexing? Couldn't we just use paths like
s/Interfaces/<ifname>/... instead of s/Interfaces/<ifindex>/...? That
would make paths more telling, and we could kill interface indexing.
>   
>> E: fi.w1.wpa_supplicant1.InterfaceExists
>>    fi.w1.wpa_supplicant1.InterfaceUnknown
>>    fi.w1.wpa_supplicant1.UnknownError
>>
>> M: RemoveInterface(path o)
>> E: fi.w1.wpa_supplicant1.InterfaceUnknown
>>    fi.w1.wpa_supplicant1.UnknownError
>>
>> M: GetInterface(ifname s) -> path o
>> E: fi.w1.wpa_supplicant1.InterfaceUnknown
>>    fi.w1.wpa_supplicant1.UnknownError
>>
>> P: Interfaces -> ao
>>    EapMethods -> as
>>
>> S: InterfaceAdded -> path o
>> S: InterfaceRemoved -> path o
>> S: PropertiesChanged -> properties a{sv}
>>     
>
> I still think using Device instead of Interface is better for the sake
> of mind :)
>   
Heh, actually I agree with Dan's explanation. I would rather consider
Device as hardware device, and Interface as logical network Interface.
Since there may be more than one interface on one device, and we are
actually interested in interfaces, *not* in devices here, I think that
Interface describes matter better than Device.
>   
>> ****************************************
>>
>> O: /fi/w1.wpa_supplicant1/Interfaces/<interface_number>
>> I: fi.w1.wpa_supplicant1.Interface
>>
>> P: Capabilities (read-only) -> a{sv}
>>      Pairwise -> as          [ccmp, tkip, none]
>>      Group -> as             [ccmp, tkip, wep104, wep40]
>>      Keymgmt -> as           [wpa-psk, wpa-eap, ieee8021x, wpa-none,
>> wps, none]
>>      Protocol -> as          [rsn, wpa]
>>      AuthAlg -> as           [open, shared, leap]
>>      Scan -> as              [active, passive, ssid, bssid, ies, channel]
>> P: State (read-only) -> s    [disconnected, inactive, scanning,
>> authenticating, associating, associated, way_handshake, group_handshake,
>> completed, unknown]
>> P: Scanning (read-only) -> b
>> P: ApScan (read/write) -> u  [0, 1, 2]
>> P: Ifname (read-only) -> s
>>     
>
> Can we just add the Ifindex for completion here.
>   
Sure, although we may resign from indexes at all.
>   
>> P: Driver (read-only) -> s
>> P: Bridge-ifname (read-only) -> s
>> P: Level (read/write) -> u
>>     
>
> What is Level. It is not intuitive.
>   
Good point - It should be DebugLevel.
>   
>> P: Timestamp (read/write) -> b
>> P: Show_keys (read/write) -> b
>> P: Blobs (read-only) ->ao
>> P: Bsss (read-only) -> ao
>> P: Networks (read-only) -> ao
>>
>> M: Scan (args a{sv})
>>      args: Type -> s          [active, passive]
>>            SSIDs -> aay       array of (SSID)
>>            IEs -> aay         array of (IE)
>>            Channels -> a(uu)  array of (center freq in KHz, width)
>>
>> E: fi.w1.wpa_supplicant1.Interface.ScanDenied
>>    fi.w1.wpa_supplicant1.Interface.ScanError
>>    fi.w1.wpa_supplicant1.InvalidArgs
>>
>> M: Disconnect
>> E: fi.w1.wpa_supplicant1.Interface.NotConnected
>>
>> M: AddNetwork (args a{sv}) -> o
>>      args: <dict of network properties, see
>> fi.w1.wpa_supplicant1.Interface.Network>
>>
>> M: RemoveNetwork (path o)
>> E: fi.w1.wpa_supplicant1.Interface.NetworkUnknown
>>
>> M: SelectNetwork (path o)
>> E: fi.w1.wpa_supplicant1.Interface.NetworkUnknown
>>
>> M: AddBlob (name s, data ay) -> o
>> E: fi.w1.wpa_supplicant1.Interface.BlobExists
>> E: fi.w1.wpa_supplicant1.UnknownError
>>
>> M: RemoveBlob (path o)
>> E: fi.w1.wpa_supplicant1.Interface.BlobUnknown
>>
>> S: PropertiesChanged -> properties a{sv}
>> S: ScanDone -> success b
>> S: StateChanged -> new_state s, old_state s
>> S: BssAdded -> path o
>> S: BssRemoved -> path o
>> S: BlobAdded -> path o
>> S: BlobRemoved -> path o
>>
>> There were missing these signals in original Dan's proposal:
>> S: NetworkAdded, -> path o
>> S: NetworkRemoved -> path o
>> S: NetworkSelected -> path o
>>
>> ****************************************
>>
>> O: /fi/w1.wpa_supplicant1/Interfaces/<interface_number>
>> I: fi.w1.wpa_supplicant1.Interface.WPS
>>
>> M: Start (args a{sv}) -> a{sv}
>>      args: Role -> s         [enrollee, registrar]
>>            Type -> a         [pin, pbc]
>>            Bssid -> ay       (optional)
>>            Pin -> s          (optional)
>>      Returns:
>>            Pin -> s          (autogenerated PIN if not specified in args)
>> P: Credentials (read-only) -> a{sv}
>>      BSSID -> ay
>>      SSID -> ay
>>      AuthType -> as                       [open, shared, wpa-psk,
>> wpa-eap, wpa2-eap, wpa2-psk]
>>      EncrType -> as                       [none, wep, tkip, aes]
>>      Key -> ay                            byte-array of key data
>>      KeyIndex -> u
>> P: ProcessCredentials (read/write) -> b   (TRUE ==
>> wps_cred_processing=2, FALSE == wps_cred_processing=1)
>> S: PropertiesChanged -> a{sv}
>> S: Event -> name s, args a{sv}
>>
>> ****************************************
>>
>> O:
>> /fi/w1.wpa_supplicant1/Interfaces/<interface_number>/Networks/<network_number>
>> I: fi.w1.wpa_supplicant1.Interface.Network
>>
>> P: Enabled (read/write) -> b
>> P: <wpa_supplicant network block properties> (read/write) -> a{sv}
>>      - Most properties can be set as strings, but can also be set
>>        as a byte array if necessary (SSID, BSSID, PSK, etc).  Supplicant
>>        can autoconvert like it does right now.
>>
>> S: PropertiesChanged -> a{sv}
>>     
>
> So what is the difference between Enabled and SelectNetwork() call. This
> differentiation confused the hell out of me already with the current
> code. Why do we bother here at all.
>
> Lets just use SelectNetwork() to switch between networks and forget
> about Enabled stuff. If some network should not be in the list, then
> just lets use RemoveNetwork().
>   
The Enable/Disable methods wasn't present in Dan's proposal, but I
haven't found any equivalents in new API, so I added it. I've just
looked at these methods closely and I think you're right - we probably
don't need it.
>   
>> ****************************************
>>
>> O: /fi/w1.wpa_supplicant1/Interfaces/<interface_number>/Blobs/<blob_name>
>> I: fi.w1.wpa_supplicant1.Interface.Blob
>>
>> P: Name (read-only) -> s
>> P: Data (read-only) -> ay
>>
>> ****************************************
>>
>> O: /fi/w1.wpa_supplicant1/Interfaces/<interface_number>/BSSs/<BSSID>
>> I: fi.w1.wpa_supplicant1.Interface.BSS
>>
>> P: <BSS properties - identical to current BSSID properties> (read-only)
>>
>> ****************************************
>>     
>
> Looks good after a really quick review.
>
> Regards
>
> Marcel
>
>
>   




More information about the Hostap mailing list