This directory contains a port of the MBIM control interface to Genode. The app
directly communicates via a Terminal session to Genode 'usb_net' driver.

Configuration
~~~~~~~~~~~~~

! <start name="mbimcli" caps="500">
!   <resource name="RAM" quantum="32M"/>
!   <config>
!     <network apn="internet.eplus.de" user="eplus" password="eplus" pin="XXXX"/>
!     <vfs>
!       <dir name="dev">
!         <log/>
!         <inline name="rtc">2020-08-05 00:01</inline>
!         <dir name="pipe"> <pipe/> </dir>
!         <terminal name="cdc-wdm0" raw="yes"/>
!       </dir>
!       <ram/>
!     </vfs>
!     <libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" pipe="/dev/pipe"/>
!   </config>
!   <route>
!     <service name="Report"> <child name="report_rom"/> </service>
!     <any-service> <parent/> <any-child/> </any-service>
!   </route>
! </start>

Upon successful connection 'mbimcli' will generate a NIC router configuration
report that can be directly processed by the router. An example is shown below:

! <config>
!   <default-policy domain="default"/>
!   <domain name="uplink" interface="10.207.25.25/30" gateway="10.207.25.26" use_arp="no">
!     <nat domain="default" tcp-ports="1000" udp-ports="1000" icmp-ids="1000"/>
!   </domain>
!   <domain name="default" interface="10.0.3.1/24">
!     <dhcp-server ip_first="10.0.3.2" ip_last="10.0.3.200" dns_server="62.109.121.17"/>
!     <tcp dst="0.0.0.0/0">
!       <permit-any domain="uplink"/>
!     </tcp>
!     <udp dst="0.0.0.0/0">
!       <permit-any domain="uplink"/>
!     </udp>
!     <icmp dst="0.0.0.0/0" domain="uplink"/>
!   </domain>
! </config>


Optional Configuration
~~~~~~~~~~~~~~~~~~~~~~

The interface's IP address and address range for the DHCP server is
customizable by adding a `<default-domain>` node to mbimcli's config, e.g.:

! <config>
!   <default-domain interface="10.0.3.1/24" ip_first="10.0.3.2" ip_last="10.0.3.200"/>
! </config>

If you want to use the generated nic_router in a cascaded setup of multiple
nic_routers, you can add a 'nic_client_enable="yes"' attribute to the '<config>'
node. In consequence, mbimcli will generate a nic_router.config like this:

! <config>
!   <default-policy domain="default"/>
!   <nic-client domain="downlink"/>
!   <domain name="uplink" interface="10.207.25.25/30" gateway="10.207.25.26" use_arp="no">
!     <nat domain="default" tcp-ports="1000" udp-ports="1000" icmp-ids="1000"/>
!     <nat domain="downlink" tcp-ports="1000" udp-ports="1000" icmp-ids="1000"/>
!   </domain>
!   <domain name="downlink" interface="10.0.2.1/24">
!     <dhcp-server ip_first="10.0.2.2" ip_last="10.0.2.3" dns_server="62.109.121.17"/>
!     <tcp dst="0.0.0.0/0">
!       <permit-any domain="uplink"/>
!     </tcp>
!     <udp dst="0.0.0.0/0">
!       <permit-any domain="uplink"/>
!     </udp>
!     <icmp dst="0.0.0.0/0" domain="uplink"/>
!   </domain>
!   <domain name="default" interface="10.0.3.1/24">
!     <dhcp-server ip_first="10.0.3.2" ip_last="10.0.3.200" dns_server="62.109.121.17"/>
!     <tcp dst="0.0.0.0/0">
!       <permit-any domain="uplink"/>
!     </tcp>
!     <udp dst="0.0.0.0/0">
!       <permit-any domain="uplink"/>
!     </udp>
!     <icmp dst="0.0.0.0/0" domain="uplink"/>
!   </domain>
! </config>
