Professional Documents
Culture Documents
An Open Source
implementation of OMA-DM
David Navarro
FOSDEM 2013
What is Device Management ?
2
OMA-DM Presentation
• Defined by the Open Mobile Alliance
• Client-Server protocol.
• Mutual authentication.
3
OMA-DM Protocol Overview
• Server sends SyncML commands on device’s standardized node
URIs. (e.g. ./DevInfo/DevId or ./LAWMO/Operations/PartiallyLock)
4
Example: Changing the Browser HomePage 1/3
.
BMO
HomePage
Name Orange
URL http://www.orange.co.uk
Favorites
URL https://01.org/libdmclient
…
5
Example: Changing the Browser HomePage 2/3
.
.
.
<Replace>
<CmdID>4</CmdID>
<Item>
<Target> .
.
<LocURI>./BMO/HomePage/URL</LocURI> .
</Target> < Status>
<Data>https://www.orange.fr</Data> <CmdRef>4</CmdRef>
</Item> <Cmd>Replace</Cmd>
</Replace> <Data>200</Data>
.
. </Status>
. .
.
.
6
Example: Changing the Browser HomePage 3/3
.
BMO
HomePage
Name Orange
URL https://www.orange.fr
Favorites
URL https://01.org/libdmclient
…
7
OMA-DM Management Objects
8
OMA DM Session Overview
User DM Client Push Server DM Server
User’s input
Package n: more DM commands
9
Introducing libdmclient
https://01.org/libdmclient
10
Characteristics
• Written in C
• Single threaded
• Dependencies:
• libxml2
• libwbxml
11
libdmclient Usage Overview
12
Usage Flow
Push DM
Server Messaging Application libdmclient http Server
notification
Push notification
session_init()
Session pointer
session_start()
get_next_packet()
DM packet
DM packet
DM packet
DM packet
DM packet
process_reply()
session_close()
13
libdmclient Plugins
DevDetail
DmAcc
Vendor
Intel
14
libdmclient Plugins
• Defined by a base URI and typedef struct
several callbacks. {
char * base_uri;
omadm_mo_init_fn initFunc;
• Loading mechanisms: omadm_mo_close_fn closeFunc;
• API omadm_mo_is_node_fn isNodeFunc;
omadm_mo_find_urn_fn findURNFunc;
• shared libraries omadm_mo_get_fn getFunc;
omadm_mo_set_fn setFunc;
omadm_mo_get_ACL_fn getACLFunc;
omadm_mo_set_ACL_fn setACLFunc;
omadm_mo_rename_fn renameFunc;
omadm_mo_delete_fn deleteFunc;
omadm_mo_exec_fn execFunc;
} omadm_mo_interface_t;
15
libdmclient Plugins example ./Vendor/Intel
DM server application libdmclient plugin
DM packet omadmclient_process_reply
GET ./Vendor/Intel/version
isNodeFunc
getACLFunc
permission check
getFunc
store result
omadmclient_get_next_packet
compose reply
DM packet
16
Component View
libdmclient
application omadmclient dmtree
momgr plugins
package0
callbacks credentials
libxml2 libwbxml
17
Session Data Structure
• In memory
18
omadmclient_process_reply
./Vendor/Intel
omadmclient SyncML RTK callbacks dmtree momgr session plugin
DM packet
DM packet
decoding
get callback
get
check URI
find plugin
isNodeFunc
getACLFunc
check ACL
getFunc
result
compose
store result
19
omadmclient_get_next_packet
omadmclient SyncML RTK session
start message
get element
add element
end message
DM packet
20
omadmclient_session_start_on alert
omadmclient package0 session dmtree credentials momgr DMAcc
payload plugin
payload
decoding
server ID
set server ID
check ID
store ID
store account
set state to
STATE_SERVER_INIT
21
Current Status
22
TODOs
• EXEC support
• Bootstrapping
• Logs https://01.org/libdmclient
23