1. Concepts
    1. Common Management Application Programming Interface (CMAPI)
    2. Open platform
      1. to any daemon below it
      2. to any client above it
      3. Uses adaptation layers to allow any application or daemon
    3. Architecture in three levels
      1. > Client level: contains the applications and clients that need to interact with the MBus. The clients map the parameters of the applications and interfaces to the data model objects in the MBus.
      2. > MBus Level: contains the data model, as well as Import/Export , the Load/Save and the Authentication/Authorization modules
      3. > Daemon level: contains the daemons that need to be configured, as well as their plugins. The plugins map the daemon parameters to the MBus objects.
    4. Client Level
      1. Registers with MBus
      2. Initiates get/set parameter actions
      3. Initiates add/delete object actions
      4. Un)Subscribes to/from events
      5. Receives and processes events
    5. Mbus level
      1. The CMAPI has a limited but complete set of primitives capable of handling these parameters.
      2. Contains no data (stored in the modules)
    6. Daemon level
      1. > Registers with MBus:
        1. Parent objecttype (place in datamodel
        2. Unique objecttype name
        3. Flags: single instance, add/delete, static/
        4. List of parameters
      2. > Name, parameter type, basic value
      3. > Flags: key parameters, writable, mandatory,
      4. > Converts all MBus calls in daemon calls
  2. mbus hierarchy
    1. Typemodel
    2. Datamodel (example)
      1. datamodel.txt
    3. Values of interests for the Bebox
      1. mbusData_forGUI_20090703_bxm.xls
  3. Commands
    1. > getvalues: retrieve the values of one or more parameters of a specific object.
    2. > setvalues: write a value to one or more parameters of an object. Rollback for this action is supported at client command level.
    3. > getcount: number of parameter/value pairs that getvalues would return with the same arguments
    4. > addobject: add an object to the data model.
    5. > deleteobject: delete an object from the data model.
    6. > subscribe: subscribe a client to the MBus event.
    7. > unsubscribe: unsubscribe a client from the MBus event.
  4. Web SDK
    1. AppWeb
      1. run.sh
      2. embedded webserver
      3. CGI via the lua programming language
      4. Folders
        1. include/
        2. webpages/
        3. webpages/img
    2. server-side scripting example
    3. cgilua.QUERY
      1. request to http://dsldevice.lan/foo.lp?xyz=bar&abc=test
      2. print(cgilua.QUERY["xyz"])
        1. bar
      3. print(cgilua.QUERY["abc"])
        1. test
    4. cgilua.POST
      1. print(cgilua.POST["description"])
        1. will print the default value or the user's input
      2. uploaded file are stored in the POST table
        1. filename
        2. filesize
        3. contenttype
    5. LuaCGI methods
      1. cgilua.servervariable"REQUEST_METHOD" == "POST"
      2. cgilua.errorlog(msg, level)
      3. cgilua.switchuser()
      4. cgilua.logout()
      5. cgilua.auth(t)
      6. cgilua.preauth()
    6. Lua
      1. Change made to lua
        1. support for tainted strings
        2. all calculations happen as integers.
        3. all scripts run in a strict mode
        4. global variables only in the main chunk or through the C API
      2. doc
        1. http://www.lua.org/manual/5.1/
        2. http://lua-users.org/wiki/LuaDirectory
      3. removed :
        1. os
        2. math
        3. require()
        4. string.dump()
      4. not removed :
        1. io.open() io.type() f:close() f:read()
        2. os.remove() os.rename()
  5. Commandline ITF
    1. telnet <gateway_ip_address>
      1. 192.168.1.254 (usually)
      2. Administrator
    2. :mbus listtypes dmtree=atomic path=RSS expand=enabled
    3. :mbus listtypes dmtree=atomic path=DeviceConfig expand=enabled
    4. :mbus debug loadobjects dmtree=atomic path=Language
    5. :mbus listtypes dmtree=atomic path=ETH.Phys expand=enabled
    6. :mbus listenums dmtree atomic name=PhysTechnology expand=enabled
  6. Lua Interface
    1. mbus.modify
    2. save configuration
    3. mbus.get
      1. result, error = mbus.get { cwmp_url = "CWMP.Server.URL" }
      2. print(result.cwmp_url and result.cwmp_url or error.cwmp_url)
    4. mbus.getParameters
      1. mbus.getParameters { { path = "DSL", param = "Status_Value" } }
      2. results = { DSL = { { path = "DSL", param = { Status_Value = "NoLink" } } } }
      3. errors = nil
    5. mbust.setParameters
      1. error = mbus.setParameters{ path = "ToD", param = { Enable = "0" } }
    6. mbus.set
      1. result, error = mbus.set { ["DSD.Status"] = "Disabled", ["ToD.Enable"] = "0" }
      2. result = { ENV = { { path = "ENV.97", param = } } }
      3. error = nil
    7. mbus.addObjects
      1. mbus.addObjects { path = "ENV", param = { Name = "test_env", Value = "test" } }
      2. result = { ENV = { { path = "ENV.97", param = { Name = "test_env", Value = "test" } } } }
      3. error = nil
    8. mbus.deleteObjects
      1. results, errors = mbus.deleteObjects { path = "ENV", filter = "(== Name test_env)" }
      2. result = { ENV = { { path = "ENV.97", param = } } }
      3. error = nil