155 lines
5.9 KiB
Go
155 lines
5.9 KiB
Go
|
package cmd
|
||
|
|
||
|
type Jail struct {
|
||
|
Name string
|
||
|
InternalName string
|
||
|
JID int
|
||
|
Config JailConfig
|
||
|
RootPath string
|
||
|
ConfigPath string
|
||
|
Running bool
|
||
|
}
|
||
|
|
||
|
// iocage struct as stored in config.json
|
||
|
// CONFIG_VERSION = 27
|
||
|
type JailConfig struct {
|
||
|
Config_version string `json:"CONFIG_VERSION"`
|
||
|
Allow_chflags int `json:"allow_chflags"`
|
||
|
Allow_mlock int `json:"allow_mlock"`
|
||
|
Allow_mount int `json:"allow_mount"`
|
||
|
Allow_mount_devfs int `json:"allow_mount_devfs"`
|
||
|
Allow_mount_fusefs int `json:"allow_mount_fusefs"`
|
||
|
Allow_mount_nullfs int `json:"allow_mount_nullfs"`
|
||
|
Allow_mount_procfs int `json:"allow_mount_procfs"`
|
||
|
Allow_mount_tmpfs int `json:"allow_mount_tmpfs"`
|
||
|
Allow_mount_zfs int `json:"allow_mount_zfs"`
|
||
|
Allow_quotas int `json:"allow_quotas"`
|
||
|
Allow_raw_sockets int `json:"allow_raw_sockets"`
|
||
|
Allow_set_hostname int `json:"allow_set_hostname"`
|
||
|
Allow_socket_af int `json:"allow_socket_af"`
|
||
|
Allow_sysvipc int `json:"allow_sysvipc"`
|
||
|
Allow_tun int `json:"allow_tun"`
|
||
|
Allow_vmm int `json:"allow_vmm"`
|
||
|
Assign_localhost int `json:"assign_localhost"`
|
||
|
Available string `json:"available"`
|
||
|
Basejail int `json:"basejail"`
|
||
|
Boot int `json:"boot"`
|
||
|
Bpf int `json:"bpf"`
|
||
|
Children_max string `json:"children_max"`
|
||
|
Cloned_release string `json:"cloned_release"`
|
||
|
Comment string `json:"comment"`
|
||
|
Compression string `json:"compression"`
|
||
|
Compressratio string `json:"compressratio"`
|
||
|
Coredumpsize string `json:"coredumpsize"`
|
||
|
Count string `json:"count"`
|
||
|
Cpuset string `json:"cpuset"`
|
||
|
Cputime string `json:"cputime"`
|
||
|
Datasize string `json:"datasize"`
|
||
|
Dedup string `json:"dedup"`
|
||
|
Defaultrouter string `json:"defaultrouter"`
|
||
|
Defaultrouter6 string `json:"defaultrouter6"`
|
||
|
Depends string `json:"depends"`
|
||
|
Devfs_ruleset string `json:"devfs_ruleset"`
|
||
|
Dhcp int `json:"dhcp"`
|
||
|
Enforce_statfs string `json:"enforce_statfs"`
|
||
|
Exec_clean int `json:"exec_clean"`
|
||
|
Exec_created string `json:"exec_created"`
|
||
|
Exec_fib string `json:"exec_fib"`
|
||
|
Exec_jail_user string `json:"exec_jail_user"`
|
||
|
Exec_poststart string `json:"exec_poststart"`
|
||
|
Exec_poststop string `json:"exec_poststop"`
|
||
|
Exec_prestart string `json:"exec_prestart"`
|
||
|
Exec_prestop string `json:"exec_prestop"`
|
||
|
Exec_start string `json:"exec_start"`
|
||
|
Exec_stop string `json:"exec_stop"`
|
||
|
Exec_system_jail_user string `json:"exec_system_jail_user"`
|
||
|
Exec_system_user string `json:"exec_system_user"`
|
||
|
Exec_timeout string `json:"exec_timeout"`
|
||
|
Host_domainname string `json:"host_domainname"`
|
||
|
Host_hostname string `json:"host_hostname"`
|
||
|
Host_hostuuid string `json:"host_hostuuid"`
|
||
|
Host_time int `json:"host_time"`
|
||
|
Hostid string `json:"hostid"`
|
||
|
Hostid_strict_check int `json:"hostid_strict_check"`
|
||
|
Interfaces string `json:"interfaces"`
|
||
|
Ip4 string `json:"ip4"`
|
||
|
Ip4_addr string `json:"ip4_addr"`
|
||
|
Ip4_saddrsel string `json:"ip4_saddrsel"`
|
||
|
Ip6 string `json:"ip6"`
|
||
|
Ip6_addr string `json:"ip6_addr"`
|
||
|
Ip6_saddrsel string `json:"ip4_saddrsel"`
|
||
|
Ip_hostname int `json:"ip_hostname"`
|
||
|
Jail_zfs int `json:"jail_zfs"`
|
||
|
Jail_zfs_dataset string `json:"jail_zfs_dataset"`
|
||
|
Jail_zfs_mountpoint string `json:"jail_zfs_mountpoint"`
|
||
|
Last_started string `json:"last_started"`
|
||
|
Localhost_ip string `json:"localhost_ip"`
|
||
|
Login_flags string `json:"login_flags"`
|
||
|
Mac_prefix string `json:"mac_prefix"`
|
||
|
Maxproc string `json:"maxproc"`
|
||
|
Memorylocked string `json:"memorylocked"`
|
||
|
Memoryuse string `json:"memoryuse"`
|
||
|
Min_dyn_devfs_ruleset string `json:"min_dyn_devfs_ruleset"`
|
||
|
Mount_devfs int `json:"mount_devfs"`
|
||
|
Mount_fdescfs int `json:"mount_fdescfs"`
|
||
|
Mount_linprocfs int `json:"mount_linprocfs"`
|
||
|
Mount_procfs int `json:"mount_procfs"`
|
||
|
Mountpoint string `json:"mountpoint"`
|
||
|
Msgqqueued string `json:"msgqqueued"`
|
||
|
Msgqsize string `json:"msgqsize"`
|
||
|
Nat int `json:"nat"`
|
||
|
Nat_backend string `json:"nat_backend"`
|
||
|
Nat_forwards string `json:"nat_forwards"`
|
||
|
Nat_interface string `json:"nat_interface"`
|
||
|
Nat_prefix string `json:"nat_prefix"`
|
||
|
Nmsgq string `json:"nmsgq"`
|
||
|
Notes string `json:"notes"`
|
||
|
Nsem string `json:"nsem"`
|
||
|
Nsemop string `json:"nsemop"`
|
||
|
Nshm string `json:"nshm"`
|
||
|
Nthr string `json:"nthr"`
|
||
|
Openfiles string `json:"openfiles"`
|
||
|
Origin string `json:"origin"`
|
||
|
Owner string `json:"owner"`
|
||
|
Pcpu string `json:"pcpu"`
|
||
|
Plugin_name string `json:"plugin_name"`
|
||
|
Plugin_repository string `json:"plugin_repository"`
|
||
|
Priority string `json:"priority"`
|
||
|
Pseudoterminals string `json:"pseudoterminals"`
|
||
|
Quota string `json:"quota"`
|
||
|
Readbps string `json:"readbps"`
|
||
|
Readiops string `json:"readiops"`
|
||
|
Release string `json:"release"`
|
||
|
Reservation string `json:"reservation"`
|
||
|
Resolver string `json:"resolver"`
|
||
|
Rlimits string `json:"rlimits"`
|
||
|
Rtsold int `json:"rtsold"`
|
||
|
Securelevel string `json:"securelevel"`
|
||
|
Shmsize string `json:"shmsize"`
|
||
|
Stacksize string `json:"stacksize"`
|
||
|
Stop_timeout string `json:"stop_timeout"`
|
||
|
Swapuse string `json:"swapuse"`
|
||
|
Sync_state string `json:"sync_state"`
|
||
|
Sync_target string `json:"sync_target"`
|
||
|
Sync_tgt_zpool string `json:"sync_tgt_zpool"`
|
||
|
Sysvmsg string `json:"sysvmsg"`
|
||
|
Sysvsem string `json:"sysvsem"`
|
||
|
Sysvshm string `json:"sysvshm"`
|
||
|
Template int `json:"template"`
|
||
|
// Go don't like a variable named "type" (And i dont care about finding a cleaner way)
|
||
|
Jailtype string `json:"type"`
|
||
|
Used string `json:"used"`
|
||
|
Vmemoryuse string `json:"vmemoryuse"`
|
||
|
Vnet int `json:"vnet"`
|
||
|
Vnet0_mac string `json:"vnet0_mac"`
|
||
|
Vnet1_mac string `json:"vnet1_mac"`
|
||
|
Vnet2_mac string `json:"vnet2_mac"`
|
||
|
Vnet3_mac string `json:"vnet3_mac"`
|
||
|
Vnet_default_interface string `json:"vnet_default_interface"`
|
||
|
Vnet_interfaces string `json:"vnet_interfaces"`
|
||
|
Wallclock string `json:"wallclock"`
|
||
|
Writebps string `json:"writebps"`
|
||
|
Writeiops string `json:"writeiops"`
|
||
|
}
|
||
|
|