~/bend-docscommunity

src/vmm/cli.bend checks

raw source on the hub · import 0xeedc51d20a9b77c2ac19c4d8f57d45a6/src/vmm/cli.bend as Cli

3 imports
import Base
import ../boot/dtb.bend as T
import ../net/addr.bend as Ad

Types

type LanSpec source · line 68 · raw

Data

--lan DIR[,ip=A.B.C.D/N][,mac=xx:xx:xx:xx:xx:xx] =============================================== The LAN directory (every VM on the LAN names the same one), the NIC's MAC and the address its DHCP answers give. A MAC must be unicast (its first byte even); without one it is 52:54:01 and the address's last three bytes, so a VM keeps it. An address takes a prefix of 1 to 30. One of ip= and mac= is needed.

type LanOpts source · line 120 · raw

Data

Options so far: the MAC, the address and its prefix (0: none), and whether every option parsed.

Definitions

def Cli.flags source · line 9 · raw

List<&2, String>

def Cli.known source · line 13 · raw

@+flag:String -> @fs:List<&2, String> -> Bool

def Cli.display.mk source · line 21 · raw

@w:Maybe<&2, U32> -> @h:Maybe<&2, U32> -> Maybe<&2, 0xeedc51d20a9b77c2ac19c4d8f57d45a6/src/boot/dtb.Display>

"WxH" as a display; None for anything malformed.

def Cli.display.go source · line 28 · raw

@ws:List<&2, String> -> Maybe<&2, 0xeedc51d20a9b77c2ac19c4d8f57d45a6/src/boot/dtb.Display>

def Cli.display.size source · line 35 · raw

@parts:List<&2, String> -> Maybe<&2, 0xeedc51d20a9b77c2ac19c4d8f57d45a6/src/boot/dtb.Display>

def Cli.display source · line 43 · raw

@spec:String -> Maybe<&2, 0xeedc51d20a9b77c2ac19c4d8f57d45a6/src/boot/dtb.Display>

"WxH" or "WxH,headless" as a display; None for "" or anything malformed.

def Cli.is_some source · line 46 · raw

@m:Maybe<&2, 0xeedc51d20a9b77c2ac19c4d8f57d45a6/src/boot/dtb.Display> -> Bool

def Cli.within source · line 53 · raw

@n:Maybe<&2, U32> -> @+lo:U32 -> @+hi:U32 -> Bool

def Cli.hex source · line 71 · raw

@+c:U32 -> Maybe<&2, U32>

def Cli.byte.mk source · line 76 · raw

@a:Maybe<&2, U32> -> @b:Maybe<&2, U32> -> Maybe<&2, U32>

def Cli.byte source · line 83 · raw

@s:String -> Maybe<&2, U32>

def Cli.bytes.cons source · line 90 · raw

@b:Maybe<&2, U32> -> @rest:Maybe<&2, List<&2, U32>> -> Maybe<&2, List<&2, U32>>

def Cli.bytes source · line 97 · raw

@ps:List<&2, String> -> Maybe<&2, List<&2, U32>>

def Cli.mac.check source · line 104 · raw

@m:Maybe<&2, List<&2, U32>> -> Maybe<&2, List<&2, U32>>

def Cli.mac source · line 112 · raw

@s:String -> Maybe<&2, List<&2, U32>>

xx:xx:xx:xx:xx:xx, unicast.

def Cli.mac_of_ip source · line 115 · raw

@+ip:U32 -> List<&2, U32>

def Cli.lan.ip.mk source · line 123 · raw

@a:Maybe<&2, U32> -> @p:Maybe<&2, U32> -> @o:LanOpts -> LanOpts

def Cli.lan.ip source · line 130 · raw

@parts:List<&2, String> -> @o:LanOpts -> LanOpts

def Cli.lan.mac source · line 139 · raw

@m:Maybe<&2, List<&2, U32>> -> @o:LanOpts -> LanOpts

def Cli.lan.fail source · line 146 · raw

@l:LanOpts -> LanOpts

def Cli.lan.opt source · line 151 · raw

@+o:String -> @+l:LanOpts -> LanOpts

def Cli.lan.opts source · line 156 · raw

@os:List<&2, String> -> @l:LanOpts -> LanOpts

def Cli.lan.make source · line 163 · raw

@+dir:String -> @l:LanOpts -> Maybe<&2, LanSpec>

def Cli.lan.parts source · line 170 · raw

@ps:List<&2, String> -> Maybe<&2, LanSpec>

def Cli.lan source · line 177 · raw

@spec:String -> Maybe<&2, LanSpec>

def Cli.lan_ok source · line 180 · raw

@m:Maybe<&2, LanSpec> -> Bool

def Cli.why source · line 190 · raw

@+flag:String -> @+v:String -> String

What is wrong with one flag and its value ("" when nothing): an unknown flag; --mem other than 1..1048576 MiB (1 TiB, what a snapshot holds); --cpus other than 1..64; a malformed --display.

def Cli.check source · line 199 · raw

@args:List<&1, String> -> String

The first thing wrong with the arguments (flag and value pairs), or "".